From 184e3ce10273b43cb3fac2ae054e38647476288a Mon Sep 17 00:00:00 2001 From: Frostebite Date: Tue, 6 Feb 2024 23:46:31 +0000 Subject: [PATCH] Cloud runner develop - Stabilizes kubernetes provider (#531) * fixes * fixes * fixes * fixes * fixes * check for startup message in workflows * check for startup message in workflows * check for startup message in workflows * check for startup message in workflows * check for startup message in workflows * check for startup message in workflows * Update cloud-runner-ci-pipeline.yml * Update cloud-runner-ci-pipeline.yml * no storage class specified * log file path * log file path * log file path * log file path * log file path * log file path * log file path * log file path * updates * log file path * latest develop * log file path * log file path * Update package.json * log file path * log file path * log file path * log file path * log file path * log file path * log file path * log file path * log file path * log file path * log file path * log file path * log file path * log file path * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * stream logs through standard input and new remote client cli command * update pipeline to use k3s * version: 'latest' * fixes * disable aws pipe for now * disable aws pipe for now * disable aws pipe for now * disable aws pipe for now * disable aws pipe for now * disable aws pipe for now * disable aws pipe for now * disable aws pipe for now * disable aws pipe for now * disable aws pipe for now * push k8s logs to LOG SERVICE IP * push k8s logs to LOG SERVICE IP * push k8s logs to LOG SERVICE IP * push k8s logs to LOG SERVICE IP * push k8s logs to LOG SERVICE IP * push k8s logs to LOG SERVICE IP * push k8s logs to LOG SERVICE IP * push k8s logs to LOG SERVICE IP * tests * tests * tests * tests * tests * tests * tests * tests * tests * tests * tests * tests * tests * tests * tests * tests * tests * podname logs for log service * podname logs for log service * podname logs for log service * podname logs for log service * podname logs for log service * podname logs for log service * podname logs for log service * podname logs for log service * podname logs for log service * hashed logs * hashed logs * hashed logs * hashed logs * hashed logs * hashed logs * no wait, just repeat logs * no wait, just repeat logs * remove typo - double await * test fix - kubernetes - name typo in github yaml * test fix - kubernetes - name typo in github yaml * check missing log file * check missing log file * Push to steam test * Push to steam test * Fix path * k8s reliable log hashing * k8s reliable log hashing * k8s reliable log hashing * hashed logging k8s * hashed logging k8s * hashed logging k8s * hashed logging k8s * hashed logging k8s * hashed logging k8s * Include log chunk when task runner sees log update, clarify if we can pull logs from same line or next line * Include log chunk when task runner sees log update, clarify if we can pull logs from same line or next line * Include log chunk when task runner sees log update, clarify if we can pull logs from same line or next line * Include log chunk when task runner sees log update, clarify if we can pull logs from same line or next line * Include log chunk when task runner sees log update, clarify if we can pull logs from same line or next line * Fix exit flow for k8s job * hash comparison logging for log complete in k8s flow * Interrupt k8s logs when logs found * cleanup async parameter * cleanup async parameter * cleanup async parameter * fixes * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * fix --- .eslintrc.json | 29 +- .../workflows/cloud-runner-ci-pipeline.yml | 152 ++-- action.yml | 4 +- dist/index.js | 585 +++++++++------ dist/index.js.map | 2 +- dist/platforms/ubuntu/steps/activate.sh | 9 + package.json | 12 +- scripts/game-ci.bat | 15 + src/index.ts | 1 + src/model/cli/cli.ts | 34 +- src/model/cloud-runner/cloud-runner.ts | 31 +- .../cloud-runner/error/cloud-runner-error.ts | 7 +- .../options/cloud-runner-options.ts | 4 +- .../task-definition-formation.ts | 12 +- src/model/cloud-runner/providers/aws/index.ts | 2 - .../cloud-runner/providers/docker/index.ts | 1 - src/model/cloud-runner/providers/k8s/index.ts | 45 +- .../k8s/kubernetes-job-spec-factory.ts | 17 +- .../providers/k8s/kubernetes-role.ts | 53 ++ .../k8s/kubernetes-service-account.ts | 2 +- .../providers/k8s/kubernetes-task-runner.ts | 72 +- .../cloud-runner/providers/local/index.ts | 2 - .../providers/provider-interface.ts | 2 - .../cloud-runner/providers/test/index.ts | 2 - .../cloud-runner/remote-client/caching.ts | 2 +- src/model/cloud-runner/remote-client/index.ts | 70 +- .../remote-client/remote-client-logger.ts | 65 +- .../services/core/cloud-runner-result.ts | 24 + .../services/core/cloud-runner-system.ts | 13 +- .../core/task-parameter-serializer.ts | 3 +- .../services/hooks/container-hook-service.ts | 5 - .../tests/cloud-runner-async-workflow.test.ts | 6 + .../tests/cloud-runner-environment.test.ts | 6 +- .../tests/cloud-runner-github-checks.test.ts | 59 ++ .../tests/cloud-runner-hooks.test.ts | 6 +- .../tests/cloud-runner-image.test.ts | 51 ++ .../tests/cloud-runner-s3-steps.test.ts | 3 +- .../e2e/cloud-runner-end2end-caching.test.ts | 14 +- .../cloud-runner-end2end-retaining.test.ts | 10 +- .../tests/e2e/cloud-runner-kubernetes.test.ts | 56 ++ .../cloud-runner/workflows/async-workflow.ts | 5 + .../workflows/build-automation-workflow.ts | 21 +- src/model/github.ts | 65 +- src/model/image-tag.ts | 15 +- src/model/input.ts | 4 +- .../Settings.json | 12 +- yarn.lock | 700 +++++++++--------- 47 files changed, 1455 insertions(+), 855 deletions(-) create mode 100644 scripts/game-ci.bat create mode 100644 src/model/cloud-runner/providers/k8s/kubernetes-role.ts create mode 100644 src/model/cloud-runner/services/core/cloud-runner-result.ts create mode 100644 src/model/cloud-runner/tests/cloud-runner-github-checks.test.ts create mode 100644 src/model/cloud-runner/tests/cloud-runner-image.test.ts create mode 100644 src/model/cloud-runner/tests/e2e/cloud-runner-kubernetes.test.ts diff --git a/.eslintrc.json b/.eslintrc.json index 7ff0c5893..ce2dfb066 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,22 +1,11 @@ { - "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 }, @@ -33,10 +22,7 @@ // Namespaces or sometimes needed "import/no-namespace": "off", // Properly format comments - "spaced-comment": [ - "error", - "always" - ], + "spaced-comment": ["error", "always"], "lines-around-comment": [ "error", { @@ -71,12 +57,7 @@ // 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 diff --git a/.github/workflows/cloud-runner-ci-pipeline.yml b/.github/workflows/cloud-runner-ci-pipeline.yml index efe186b78..bd8969eb7 100644 --- a/.github/workflows/cloud-runner-ci-pipeline.yml +++ b/.github/workflows/cloud-runner-ci-pipeline.yml @@ -18,42 +18,37 @@ env: GCP_PROJECT: unitykubernetesbuilder GCP_LOG_FILE: ${{ github.workspace }}/cloud-runner-logs.txt AWS_REGION: eu-west-2 - AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: eu-west-2 AWS_STACK_NAME: game-ci-team-pipelines CLOUD_RUNNER_BRANCH: ${{ github.ref }} DEBUG: true - UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} PROJECT_PATH: test-project UNITY_VERSION: 2019.3.15f1 USE_IL2CPP: false USE_GKE_GCLOUD_AUTH_PLUGIN: true - GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} jobs: - smokeTests: - name: Smoke Tests + tests: + name: Tests if: github.event.event_type != 'pull_request_target' runs-on: ubuntu-latest strategy: fail-fast: false matrix: test: - #- 'cloud-runner-async-workflow' + - 'cloud-runner-end2end-locking' + - 'cloud-runner-end2end-caching' + - 'cloud-runner-end2end-retaining' - 'cloud-runner-caching' - # - 'cloud-runner-end2end-caching' - # - 'cloud-runner-end2end-retaining' - 'cloud-runner-environment' + - 'cloud-runner-image' - 'cloud-runner-hooks' - 'cloud-runner-local-persistence' - 'cloud-runner-locking-core' - 'cloud-runner-locking-get-locked' - providerStrategy: - #- aws - - local-docker - #- k8s steps: - name: Checkout (default) uses: actions/checkout@v4 @@ -65,58 +60,85 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: eu-west-2 - - uses: google-github-actions/auth@v1 - if: matrix.providerStrategy == 'k8s' + - run: yarn + - run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand + timeout-minutes: 60 + env: + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + PROJECT_PATH: test-project + TARGET_PLATFORM: StandaloneWindows64 + cloudRunnerTests: true + versioning: None + KUBE_STORAGE_CLASS: local-path + PROVIDER_STRATEGY: local-docker + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: | + docker volume rm $(docker volume ls -qf dangling=true) + docker rmi $(docker images -q -f dangling=true) + docker rm $(docker ps -aqf status=exited) + docker rmi $(docker images -q) + k8sTests: + name: K8s Tests + if: github.event.event_type != 'pull_request_target' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + test: + # - 'cloud-runner-async-workflow' + - 'cloud-runner-end2end-locking' + - 'cloud-runner-end2end-caching' + - 'cloud-runner-end2end-retaining' + - 'cloud-runner-kubernetes' + - 'cloud-runner-environment' + - 'cloud-runner-github-checks' + steps: + - name: Checkout (default) + uses: actions/checkout@v2 with: - credentials_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }} - - name: 'Set up Cloud SDK' - if: matrix.providerStrategy == 'k8s' - uses: 'google-github-actions/setup-gcloud@v1.1.0' - - name: Get GKE cluster credentials - if: matrix.providerStrategy == 'k8s' - run: | - export USE_GKE_GCLOUD_AUTH_PLUGIN=True - gcloud components install gke-gcloud-auth-plugin - gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT + lfs: false - run: yarn + - name: actions-k3s + uses: debianmaster/actions-k3s@v1.0.5 + with: + version: 'latest' - run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand - timeout-minutes: 35 + timeout-minutes: 60 env: - UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} PROJECT_PATH: test-project TARGET_PLATFORM: StandaloneWindows64 cloudRunnerTests: true versioning: None - CLOUD_RUNNER_CLUSTER: ${{ matrix.providerStrategy }} - tests: - # needs: - # - smokeTests - # - buildTargetTests - name: Integration Tests + KUBE_STORAGE_CLASS: local-path + PROVIDER_STRATEGY: k8s + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + awsTests: + name: AWS Tests if: github.event.event_type != 'pull_request_target' runs-on: ubuntu-latest strategy: fail-fast: false matrix: - providerStrategy: - - aws - - local-docker - - k8s test: - - 'cloud-runner-async-workflow' - #- 'cloud-runner-caching' - 'cloud-runner-end2end-locking' - 'cloud-runner-end2end-caching' - 'cloud-runner-end2end-retaining' - 'cloud-runner-environment' - #- 'cloud-runner-hooks' - 'cloud-runner-s3-steps' - #- 'cloud-runner-local-persistence' - #- 'cloud-runner-locking-core' - #- 'cloud-runner-locking-get-locked' steps: - name: Checkout (default) - uses: actions/checkout@v4 + uses: actions/checkout@v2 with: lfs: false - name: Configure AWS Credentials @@ -125,29 +147,24 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: eu-west-2 - - uses: google-github-actions/auth@v1 - if: matrix.providerStrategy == 'k8s' - with: - credentials_json: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }} - - name: 'Set up Cloud SDK' - if: matrix.providerStrategy == 'k8s' - uses: 'google-github-actions/setup-gcloud@v1.1.0' - - name: Get GKE cluster credentials - if: matrix.providerStrategy == 'k8s' - run: | - export USE_GKE_GCLOUD_AUTH_PLUGIN=True - gcloud components install gke-gcloud-auth-plugin - gcloud container clusters get-credentials $GKE_CLUSTER --zone $GKE_ZONE --project $GKE_PROJECT - run: yarn - run: yarn run test "${{ matrix.test }}" --detectOpenHandles --forceExit --runInBand timeout-minutes: 60 env: - UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} PROJECT_PATH: test-project TARGET_PLATFORM: StandaloneWindows64 cloudRunnerTests: true versioning: None - PROVIDER_STRATEGY: ${{ matrix.providerStrategy }} + KUBE_STORAGE_CLASS: local-path + PROVIDER_STRATEGY: aws + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + buildTargetTests: name: Local Build Target Tests runs-on: ubuntu-latest @@ -164,7 +181,7 @@ jobs: - StandaloneLinux64 # Build a Linux 64-bit standalone. - WebGL # WebGL. - iOS # Build an iOS player. - - Android # Build an Android .apk. + # - Android # Build an Android .apk. steps: - name: Checkout (default) uses: actions/checkout@v4 @@ -175,7 +192,13 @@ jobs: id: unity-build timeout-minutes: 30 env: - UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} + UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} + UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} + UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + GIT_PRIVATE_TOKEN: ${{ secrets.GIT_PRIVATE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: cloudRunnerTests: true versioning: None @@ -188,3 +211,8 @@ jobs: name: ${{ matrix.providerStrategy }} Build (${{ matrix.targetPlatform }}) path: ${{ steps.unity-build.outputs.BUILD_ARTIFACT }} retention-days: 14 + - run: | + docker volume rm $(docker volume ls -qf dangling=true) + docker rmi $(docker images -q -f dangling=true) + docker rm $(docker ps -aqf status=exited) + docker rmi $(docker images -q) diff --git a/action.yml b/action.yml index e0ccba408..09f95e08f 100644 --- a/action.yml +++ b/action.yml @@ -186,11 +186,11 @@ inputs: description: '[CloudRunner] Either local, k8s or aws can be used to run builds on a remote cluster. Additional parameters must be configured.' - cloudRunnerCpu: + containerCpu: default: '' required: false description: '[CloudRunner] Amount of CPU time to assign the remote build container' - cloudRunnerMemory: + containerMemory: default: '' required: false description: '[CloudRunner] Amount of memory to assign the remote build container' diff --git a/dist/index.js b/dist/index.js index 261824a1f..bde8c7636 100644 --- a/dist/index.js +++ b/dist/index.js @@ -64,6 +64,7 @@ async function runMain() { } else { await model_1.CloudRunner.run(buildParameters, baseImage.toString()); + exitCode = 0; } // Set output await model_1.Output.setBuildVersion(buildParameters.buildVersion); @@ -242,7 +243,7 @@ const versioning_1 = __importDefault(__nccwpck_require__(93901)); const git_repo_1 = __nccwpck_require__(24271); const github_cli_1 = __nccwpck_require__(44990); const cli_1 = __nccwpck_require__(55651); -const github_1 = __importDefault(__nccwpck_require__(83654)); +const github_1 = __importDefault(__nccwpck_require__(39789)); const cloud_runner_options_1 = __importDefault(__nccwpck_require__(66965)); const cloud_runner_1 = __importDefault(__nccwpck_require__(79144)); const core = __importStar(__nccwpck_require__(42186)); @@ -552,9 +553,7 @@ const caching_1 = __nccwpck_require__(32885); const lfs_hashing_1 = __nccwpck_require__(16785); const remote_client_1 = __nccwpck_require__(48135); const cloud_runner_options_reader_1 = __importDefault(__nccwpck_require__(96879)); -const github_1 = __importDefault(__nccwpck_require__(83654)); -const cloud_runner_folders_1 = __nccwpck_require__(77795); -const cloud_runner_system_1 = __nccwpck_require__(4197); +const github_1 = __importDefault(__nccwpck_require__(39789)); class Cli { static get isCliMode() { return Cli.options !== undefined && Cli.options.mode !== undefined && Cli.options.mode !== ''; @@ -587,6 +586,7 @@ class Cli { program.option('--cachePushTo ', 'cache push to caching folder'); program.option('--artifactName ', 'caching artifact name'); program.option('--select ', 'select a particular resource');\n program.parse(process.argv);\n Cli.options = program.opts();\n return Cli.isCliMode;\n }\n static async RunCli() {\n github_1.default.githubInputEnabled = false;\n if (Cli.options['populateOverride'] === `true`) {\n await cloud_runner_query_override_1.default.PopulateQueryOverrideInput();\n }\n if (Cli.options['logInput']) {\n Cli.logInput();\n }\n const results = cli_functions_repository_1.CliFunctionsRepository.GetCliFunctions(Cli.options?.mode);\n cloud_runner_logger_1.default.log(`Entrypoint: ${results.key}`);\n Cli.options.versioning = 'None';\n __1.CloudRunner.buildParameters = await __1.BuildParameters.create();\n __1.CloudRunner.buildParameters.buildGuid = process.env.BUILD_GUID || ``;\n cloud_runner_logger_1.default.log(`Build Params:\n ${JSON.stringify(__1.CloudRunner.buildParameters, undefined, 4)}\n `);\n __1.CloudRunner.lockedWorkspace = process.env.LOCKED_WORKSPACE || ``;\n cloud_runner_logger_1.default.log(`Locked Workspace: ${__1.CloudRunner.lockedWorkspace}`);\n await __1.CloudRunner.setup(__1.CloudRunner.buildParameters);\n return await results.target[results.propertyKey](Cli.options);\n }\n static logInput() {\n core.info(`\\n`);\n core.info(`INPUT:`);\n const properties = cloud_runner_options_reader_1.default.GetProperties();\n for (const element of properties) {\n if (element in __1.Input &&\n __1.Input[element] !== undefined &&\n __1.Input[element] !== '' &&\n typeof __1.Input[element] !== `function` &&\n element !== 'length' &&\n element !== 'cliOptions' &&\n element !== 'prototype') {\n core.info(`${element} ${__1.Input[element]}`);\n }\n }\n core.info(`\\n`);\n }\n static async CLIBuild() {\n const buildParameter = await __1.BuildParameters.create();\n const baseImage = new __1.ImageTag(buildParameter);\n return await __1.CloudRunner.run(buildParameter, baseImage.toString());\n }\n static async asyncronousWorkflow() {\n const buildParameter = await __1.BuildParameters.create();\n const baseImage = new __1.ImageTag(buildParameter);\n await __1.CloudRunner.setup(buildParameter);\n return await __1.CloudRunner.run(buildParameter, baseImage.toString());\n }\n static async checksUpdate() {\n const buildParameter = await __1.BuildParameters.create();\n await __1.CloudRunner.setup(buildParameter);\n const input = JSON.parse(process.env.CHECKS_UPDATE || ``);\n core.info(`Checks Update ${process.env.CHECKS_UPDATE}`);\n if (input.mode === `create`) {\n throw new Error(`Not supported: only use update`);\n }\n else if (input.mode === `update`) {\n await github_1.default.updateGitHubCheckRequest(input.data);\n }\n }\n static async GarbageCollect() {\n const buildParameter = await __1.BuildParameters.create();\n await __1.CloudRunner.setup(buildParameter);\n return await __1.CloudRunner.Provider.garbageCollect(``, false, 0, false, false);\n }\n static async ListResources() {\n const buildParameter = await __1.BuildParameters.create();\n await __1.CloudRunner.setup(buildParameter);\n const result = await __1.CloudRunner.Provider.listResources();\n cloud_runner_logger_1.default.log(JSON.stringify(result, undefined, 4));\n return result.map((x) => x.Name);\n }\n static async ListWorfklow() {\n const buildParameter = await __1.BuildParameters.create();\n await __1.CloudRunner.setup(buildParameter);\n return (await __1.CloudRunner.Provider.listWorkflow()).map((x) => x.Name);\n }\n static async Watch() {\n const buildParameter = await __1.BuildParameters.create();\n await __1.CloudRunner.setup(buildParameter);\n return await __1.CloudRunner.Provider.watchWorkflow();\n }\n static async PostCLIBuild() {\n core.info(`Running POST build tasks`);\n await caching_1.Caching.PushToCache(cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(`${cloud_runner_folders_1.CloudRunnerFolders.cacheFolderForCacheKeyFull}/Library`), cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.libraryFolderAbsolute), `lib-${__1.CloudRunner.buildParameters.buildGuid}`);\n await caching_1.Caching.PushToCache(cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(`${cloud_runner_folders_1.CloudRunnerFolders.cacheFolderForCacheKeyFull}/build`), cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute), `build-${__1.CloudRunner.buildParameters.buildGuid}`);\n if (!__1.BuildParameters.shouldUseRetainedWorkspaceMode(__1.CloudRunner.buildParameters)) {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`rm -r ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}`);\n }\n await remote_client_1.RemoteClient.runCustomHookFiles(`after-build`);\n return new Promise((result) => result(``));\n }\n}\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`print-input`, `prints all input`)\n], Cli, \"logInput\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`cli-build`, `runs a cloud runner build`)\n], Cli, \"CLIBuild\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`async-workflow`, `runs a cloud runner build`)\n], Cli, \"asyncronousWorkflow\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`checks-update`, `runs a cloud runner build`)\n], Cli, \"checksUpdate\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`garbage-collect`, `runs garbage collection`)\n], Cli, \"GarbageCollect\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`list-resources`, `lists active resources`)\n], Cli, \"ListResources\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`list-worfklow`, `lists running workflows`)\n], Cli, \"ListWorfklow\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`watch`, `follows logs of a running workflow`)\n], Cli, \"Watch\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`remote-cli-post-build`, `runs a cloud runner build`)\n], Cli, \"PostCLIBuild\", null);\nexports.Cli = Cli;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst aws_1 = __importDefault(require(\"./providers/aws\"));\nconst __1 = require(\"..\");\nconst k8s_1 = __importDefault(require(\"./providers/k8s\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"./services/core/cloud-runner-logger\"));\nconst cloud_runner_step_parameters_1 = require(\"./options/cloud-runner-step-parameters\");\nconst workflow_composition_root_1 = require(\"./workflows/workflow-composition-root\");\nconst cloud_runner_error_1 = require(\"./error/cloud-runner-error\");\nconst task_parameter_serializer_1 = require(\"./services/core/task-parameter-serializer\");\nconst core = __importStar(require(\"@actions/core\"));\nconst test_1 = __importDefault(require(\"./providers/test\"));\nconst local_1 = __importDefault(require(\"./providers/local\"));\nconst docker_1 = __importDefault(require(\"./providers/docker\"));\nconst github_1 = __importDefault(require(\"../github\"));\nconst shared_workspace_locking_1 = __importDefault(require(\"./services/core/shared-workspace-locking\"));\nconst follow_log_stream_service_1 = require(\"./services/core/follow-log-stream-service\");\nclass CloudRunner {\n static get isCloudRunnerEnvironment() {\n return process.env[`GITHUB_ACTIONS`] !== `true`;\n }\n static get isCloudRunnerAsyncEnvironment() {\n return process.env[`ASYNC_WORKFLOW`] === `true`;\n }\n static async setup(buildParameters) {\n cloud_runner_logger_1.default.setup();\n cloud_runner_logger_1.default.log(`Setting up cloud runner`);\n CloudRunner.buildParameters = buildParameters;\n if (CloudRunner.buildParameters.githubCheckId === ``) {\n CloudRunner.buildParameters.githubCheckId = await github_1.default.createGitHubCheck(CloudRunner.buildParameters.buildGuid);\n }\n CloudRunner.setupSelectedBuildPlatform();\n CloudRunner.defaultSecrets = task_parameter_serializer_1.TaskParameterSerializer.readDefaultSecrets();\n CloudRunner.cloudRunnerEnvironmentVariables =\n task_parameter_serializer_1.TaskParameterSerializer.createCloudRunnerEnvironmentVariables(buildParameters);\n if (github_1.default.githubInputEnabled) {\n const buildParameterPropertyNames = Object.getOwnPropertyNames(buildParameters);\n for (const element of CloudRunner.cloudRunnerEnvironmentVariables) {\n // CloudRunnerLogger.log(`Cloud Runner output ${Input.ToEnvVarFormat(element.name)} = ${element.value}`);\n core.setOutput(__1.Input.ToEnvVarFormat(element.name), element.value);\n }\n for (const element of buildParameterPropertyNames) {\n // CloudRunnerLogger.log(`Cloud Runner output ${Input.ToEnvVarFormat(element)} = ${buildParameters[element]}`);\n core.setOutput(__1.Input.ToEnvVarFormat(element), buildParameters[element]);\n }\n core.setOutput(__1.Input.ToEnvVarFormat(`buildArtifact`), `build-${CloudRunner.buildParameters.buildGuid}.tar${CloudRunner.buildParameters.useCompressionStrategy ? '.lz4' : ''}`);\n }\n follow_log_stream_service_1.FollowLogStreamService.Reset();\n }\n static setupSelectedBuildPlatform() {\n cloud_runner_logger_1.default.log(`Cloud Runner platform selected ${CloudRunner.buildParameters.providerStrategy}`);\n switch (CloudRunner.buildParameters.providerStrategy) {\n case 'k8s':\n CloudRunner.Provider = new k8s_1.default(CloudRunner.buildParameters);\n break;\n case 'aws':\n CloudRunner.Provider = new aws_1.default(CloudRunner.buildParameters);\n break;\n case 'test':\n CloudRunner.Provider = new test_1.default();\n break;\n case 'local-docker':\n CloudRunner.Provider = new docker_1.default();\n break;\n case 'local-system':\n CloudRunner.Provider = new local_1.default();\n break;\n }\n }\n static async run(buildParameters, baseImage) {\n await CloudRunner.setup(buildParameters);\n if (!CloudRunner.buildParameters.isCliMode)\n core.startGroup('Setup shared cloud runner resources');\n await CloudRunner.Provider.setupWorkflow(CloudRunner.buildParameters.buildGuid, CloudRunner.buildParameters, CloudRunner.buildParameters.branch, CloudRunner.defaultSecrets);\n if (!CloudRunner.buildParameters.isCliMode)\n core.endGroup();\n try {\n if (buildParameters.maxRetainedWorkspaces > 0) {\n CloudRunner.lockedWorkspace = shared_workspace_locking_1.default.NewWorkspaceName();\n const result = await shared_workspace_locking_1.default.GetLockedWorkspace(CloudRunner.lockedWorkspace, CloudRunner.buildParameters.buildGuid, CloudRunner.buildParameters);\n if (result) {\n cloud_runner_logger_1.default.logLine(`Using retained workspace ${CloudRunner.lockedWorkspace}`);\n CloudRunner.cloudRunnerEnvironmentVariables = [\n ...CloudRunner.cloudRunnerEnvironmentVariables,\n { name: `LOCKED_WORKSPACE`, value: CloudRunner.lockedWorkspace },\n ];\n }\n else {\n cloud_runner_logger_1.default.log(`Max retained workspaces reached ${buildParameters.maxRetainedWorkspaces}`);\n buildParameters.maxRetainedWorkspaces = 0;\n CloudRunner.lockedWorkspace = ``;\n }\n }\n const content = { ...CloudRunner.buildParameters };\n content.gitPrivateToken = ``;\n content.unitySerial = ``;\n const jsonContent = JSON.stringify(content, undefined, 4);\n await github_1.default.updateGitHubCheck(jsonContent, CloudRunner.buildParameters.buildGuid);\n const output = await new workflow_composition_root_1.WorkflowCompositionRoot().run(new cloud_runner_step_parameters_1.CloudRunnerStepParameters(baseImage, CloudRunner.cloudRunnerEnvironmentVariables, CloudRunner.defaultSecrets));\n if (!CloudRunner.buildParameters.isCliMode)\n core.startGroup('Cleanup shared cloud runner resources');\n await CloudRunner.Provider.cleanupWorkflow(CloudRunner.buildParameters.buildGuid, CloudRunner.buildParameters, CloudRunner.buildParameters.branch, CloudRunner.defaultSecrets);\n cloud_runner_logger_1.default.log(`Cleanup complete`);\n if (!CloudRunner.buildParameters.isCliMode)\n core.endGroup();\n await github_1.default.updateGitHubCheck(CloudRunner.buildParameters.buildGuid, `success`, `success`, `completed`);\n if (__1.BuildParameters.shouldUseRetainedWorkspaceMode(buildParameters)) {\n const workspace = CloudRunner.lockedWorkspace || ``;\n await shared_workspace_locking_1.default.ReleaseWorkspace(workspace, CloudRunner.buildParameters.buildGuid, CloudRunner.buildParameters);\n const isLocked = await shared_workspace_locking_1.default.IsWorkspaceLocked(workspace, CloudRunner.buildParameters);\n if (isLocked) {\n throw new Error(`still locked after releasing ${await shared_workspace_locking_1.default.GetAllLocksForWorkspace(workspace, buildParameters)}`);\n }\n CloudRunner.lockedWorkspace = ``;\n }\n await github_1.default.triggerWorkflowOnComplete(CloudRunner.buildParameters.finalHooks);\n if (buildParameters.constantGarbageCollection) {\n CloudRunner.Provider.garbageCollect(``, true, buildParameters.garbageMaxAge, true, true);\n }\n return output;\n }\n catch (error) {\n cloud_runner_logger_1.default.log(JSON.stringify(error, undefined, 4));\n await github_1.default.updateGitHubCheck(CloudRunner.buildParameters.buildGuid, `Failed - Error ${error?.message || error}`, `failure`, `completed`);\n if (!CloudRunner.buildParameters.isCliMode)\n core.endGroup();\n await cloud_runner_error_1.CloudRunnerError.handleException(error, CloudRunner.buildParameters, CloudRunner.defaultSecrets);\n throw error;\n }\n }\n}\nCloudRunner.lockedWorkspace = ``;\nCloudRunner.retainedWorkspacePrefix = `retained-workspace`;\nexports.default = CloudRunner;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CloudRunnerError = void 0;\nconst cloud_runner_logger_1 = __importDefault(require(\"../services/core/cloud-runner-logger\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst cloud_runner_1 = __importDefault(require(\"../cloud-runner\"));\nclass CloudRunnerError {\n static async handleException(error, buildParameters, secrets) {\n cloud_runner_logger_1.default.error(JSON.stringify(error, undefined, 4));\n core.setFailed('Cloud Runner failed');\n if (cloud_runner_1.default.Provider !== undefined) {\n await cloud_runner_1.default.Provider.cleanupWorkflow(buildParameters.buildGuid, buildParameters, buildParameters.branch, secrets);\n }\n }\n}\nexports.CloudRunnerError = CloudRunnerError;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass CloudRunnerConstants {\n}\nCloudRunnerConstants.alphabet = '0123456789abcdefghijklmnopqrstuvwxyz';\nexports.default = CloudRunnerConstants;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass CloudRunnerEnvironmentVariable {\n}\nexports.default = CloudRunnerEnvironmentVariable;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CloudRunnerFolders = void 0;\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst cloud_runner_options_1 = __importDefault(require(\"./cloud-runner-options\"));\nconst cloud_runner_1 = __importDefault(require(\"../cloud-runner\"));\nconst build_parameters_1 = __importDefault(require(\"../../build-parameters\"));\nclass CloudRunnerFolders {\n static ToLinuxFolder(folder) {\n return folder.replace(/\\\\/g, `/`);\n }\n // Only the following paths that do not start a path.join with another \"Full\" suffixed property need to start with an absolute /\n static get uniqueCloudRunnerJobFolderAbsolute() {\n return cloud_runner_1.default.buildParameters && build_parameters_1.default.shouldUseRetainedWorkspaceMode(cloud_runner_1.default.buildParameters)\n ? node_path_1.default.join(`/`, CloudRunnerFolders.buildVolumeFolder, cloud_runner_1.default.lockedWorkspace)\n : node_path_1.default.join(`/`, CloudRunnerFolders.buildVolumeFolder, cloud_runner_1.default.buildParameters.buildGuid);\n }\n static get cacheFolderForAllFull() {\n return node_path_1.default.join('/', CloudRunnerFolders.buildVolumeFolder, CloudRunnerFolders.cacheFolder);\n }\n static get cacheFolderForCacheKeyFull() {\n return node_path_1.default.join('/', CloudRunnerFolders.buildVolumeFolder, CloudRunnerFolders.cacheFolder, cloud_runner_1.default.buildParameters.cacheKey);\n }\n static get builderPathAbsolute() {\n return node_path_1.default.join(cloud_runner_options_1.default.useSharedBuilder\n ? `/${CloudRunnerFolders.buildVolumeFolder}`\n : CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute, `builder`);\n }\n static get repoPathAbsolute() {\n return node_path_1.default.join(CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute, CloudRunnerFolders.repositoryFolder);\n }\n static get projectPathAbsolute() {\n return node_path_1.default.join(CloudRunnerFolders.repoPathAbsolute, cloud_runner_1.default.buildParameters.projectPath);\n }\n static get libraryFolderAbsolute() {\n return node_path_1.default.join(CloudRunnerFolders.projectPathAbsolute, `Library`);\n }\n static get projectBuildFolderAbsolute() {\n return node_path_1.default.join(CloudRunnerFolders.repoPathAbsolute, cloud_runner_1.default.buildParameters.buildPath);\n }\n static get lfsFolderAbsolute() {\n return node_path_1.default.join(CloudRunnerFolders.repoPathAbsolute, `.git`, `lfs`);\n }\n static get purgeRemoteCaching() {\n return process.env.PURGE_REMOTE_BUILDER_CACHE !== undefined;\n }\n static get lfsCacheFolderFull() {\n return node_path_1.default.join(CloudRunnerFolders.cacheFolderForCacheKeyFull, `lfs`);\n }\n static get libraryCacheFolderFull() {\n return node_path_1.default.join(CloudRunnerFolders.cacheFolderForCacheKeyFull, `Library`);\n }\n static get unityBuilderRepoUrl() {\n return `https://${cloud_runner_1.default.buildParameters.gitPrivateToken}@github.com/game-ci/unity-builder.git`;\n }\n static get targetBuildRepoUrl() {\n return `https://${cloud_runner_1.default.buildParameters.gitPrivateToken}@github.com/${cloud_runner_1.default.buildParameters.githubRepo}.git`;\n }\n static get buildVolumeFolder() {\n return 'data';\n }\n static get cacheFolder() {\n return 'cache';\n }\n}\nexports.CloudRunnerFolders = CloudRunnerFolders;\nCloudRunnerFolders.repositoryFolder = 'repo';\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst nanoid_1 = require(\"nanoid\");\nconst cloud_runner_constants_1 = __importDefault(require(\"./cloud-runner-constants\"));\nclass CloudRunnerNamespace {\n static generateGuid(runNumber, platform) {\n const nanoid = (0, nanoid_1.customAlphabet)(cloud_runner_constants_1.default.alphabet, 4);\n return `${runNumber}-${platform.toLowerCase().replace('standalone', '')}-${nanoid()}`;\n }\n}\nexports.default = CloudRunnerNamespace;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst input_1 = __importDefault(require(\"../../input\"));\nconst cloud_runner_options_1 = __importDefault(require(\"./cloud-runner-options\"));\nclass CloudRunnerOptionsReader {\n static GetProperties() {\n return [...Object.getOwnPropertyNames(input_1.default), ...Object.getOwnPropertyNames(cloud_runner_options_1.default)];\n }\n}\nexports.default = CloudRunnerOptionsReader;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cli_1 = require(\"../../cli/cli\");\nconst cloud_runner_query_override_1 = __importDefault(require(\"./cloud-runner-query-override\"));\nconst github_1 = __importDefault(require(\"../../github\"));\nconst core = __importStar(require(\"@actions/core\"));\nclass CloudRunnerOptions {\n // ### ### ###\n // Input Handling\n // ### ### ###\n static getInput(query) {\n if (github_1.default.githubInputEnabled) {\n const coreInput = core.getInput(query);\n if (coreInput && coreInput !== '') {\n return coreInput;\n }\n }\n const alternativeQuery = CloudRunnerOptions.ToEnvVarFormat(query);\n // Query input sources\n if (cli_1.Cli.query(query, alternativeQuery)) {\n return cli_1.Cli.query(query, alternativeQuery);\n }\n if (cloud_runner_query_override_1.default.query(query, alternativeQuery)) {\n return cloud_runner_query_override_1.default.query(query, alternativeQuery);\n }\n if (process.env[query] !== undefined) {\n return process.env[query];\n }\n if (alternativeQuery !== query && process.env[alternativeQuery] !== undefined) {\n return process.env[alternativeQuery];\n }\n }\n static ToEnvVarFormat(input) {\n if (input.toUpperCase() === input) {\n return input;\n }\n return input\n .replace(/([A-Z])/g, ' $1')\n .trim()\n .toUpperCase()\n .replace(/ /g, '_');\n }\n // ### ### ###\n // Provider parameters\n // ### ### ###\n static get region() {\n return CloudRunnerOptions.getInput('region') || 'eu-west-2';\n }\n // ### ### ###\n // GitHub parameters\n // ### ### ###\n static get githubChecks() {\n const value = CloudRunnerOptions.getInput('githubChecks');\n return value === `true` || false;\n }\n static get githubCheckId() {\n return CloudRunnerOptions.getInput('githubCheckId') || ``;\n }\n static get githubOwner() {\n return CloudRunnerOptions.getInput('githubOwner') || CloudRunnerOptions.githubRepo?.split(`/`)[0] || '';\n }\n static get githubRepoName() {\n return CloudRunnerOptions.getInput('githubRepoName') || CloudRunnerOptions.githubRepo?.split(`/`)[1] || '';\n }\n static get finalHooks() {\n return CloudRunnerOptions.getInput('finalHooks')?.split(',') || [];\n }\n // ### ### ###\n // Git syncronization parameters\n // ### ### ###\n static get githubRepo() {\n return CloudRunnerOptions.getInput('GITHUB_REPOSITORY') || CloudRunnerOptions.getInput('GITHUB_REPO') || undefined;\n }\n static get branch() {\n if (CloudRunnerOptions.getInput(`GITHUB_REF`)) {\n return (CloudRunnerOptions.getInput(`GITHUB_REF`)?.replace('refs/', '').replace(`head/`, '').replace(`heads/`, '') || ``);\n }\n else if (CloudRunnerOptions.getInput('branch')) {\n return CloudRunnerOptions.getInput('branch') || ``;\n }\n else {\n return '';\n }\n }\n // ### ### ###\n // Cloud Runner parameters\n // ### ### ###\n static get buildPlatform() {\n const input = CloudRunnerOptions.getInput('buildPlatform');\n if (input) {\n return input;\n }\n if (CloudRunnerOptions.providerStrategy !== 'local') {\n return 'linux';\n }\n return ``;\n }\n static get cloudRunnerBranch() {\n return CloudRunnerOptions.getInput('cloudRunnerBranch') || 'main';\n }\n static get providerStrategy() {\n const provider = CloudRunnerOptions.getInput('cloudRunnerCluster') || CloudRunnerOptions.getInput('providerStrategy');\n if (cli_1.Cli.isCliMode) {\n return provider || 'aws';\n }\n return provider || 'local';\n }\n static get containerCpu() {\n return CloudRunnerOptions.getInput('containerCpu') || `1024`;\n }\n static get containerMemory() {\n return CloudRunnerOptions.getInput('containerMemory') || `3072`;\n }\n static get customJob() {\n return CloudRunnerOptions.getInput('customJob') || '';\n }\n // ### ### ###\n // Custom commands from files parameters\n // ### ### ###\n static get containerHookFiles() {\n return CloudRunnerOptions.getInput('containerHookFiles')?.split(`,`) || [];\n }\n static get commandHookFiles() {\n return CloudRunnerOptions.getInput('commandHookFiles')?.split(`,`) || [];\n }\n // ### ### ###\n // Custom commands from yaml parameters\n // ### ### ###\n static get commandHooks() {\n return CloudRunnerOptions.getInput('commandHooks') || '';\n }\n static get postBuildContainerHooks() {\n return CloudRunnerOptions.getInput('postBuildContainerHooks') || '';\n }\n static get preBuildContainerHooks() {\n return CloudRunnerOptions.getInput('preBuildContainerHooks') || '';\n }\n // ### ### ###\n // Input override handling\n // ### ### ###\n static get pullInputList() {\n return CloudRunnerOptions.getInput('pullInputList')?.split(`,`) || [];\n }\n static get inputPullCommand() {\n const value = CloudRunnerOptions.getInput('inputPullCommand');\n if (value === 'gcp-secret-manager') {\n return 'gcloud secrets versions access 1 --secret=\"{0}\"';\n }\n else if (value === 'aws-secret-manager') {\n return 'aws secretsmanager get-secret-value --secret-id {0}';\n }\n return value || '';\n }\n // ### ### ###\n // Aws\n // ### ### ###\n static get awsStackName() {\n return CloudRunnerOptions.getInput('awsStackName') || 'game-ci';\n }\n // ### ### ###\n // K8s\n // ### ### ###\n static get kubeConfig() {\n return CloudRunnerOptions.getInput('kubeConfig') || '';\n }\n static get kubeVolume() {\n return CloudRunnerOptions.getInput('kubeVolume') || '';\n }\n static get kubeVolumeSize() {\n return CloudRunnerOptions.getInput('kubeVolumeSize') || '25Gi';\n }\n static get kubeStorageClass() {\n return CloudRunnerOptions.getInput('kubeStorageClass') || '';\n }\n // ### ### ###\n // Caching\n // ### ### ###\n static get cacheKey() {\n return CloudRunnerOptions.getInput('cacheKey') || CloudRunnerOptions.branch;\n }\n // ### ### ###\n // Utility Parameters\n // ### ### ###\n static get cloudRunnerDebug() {\n return (CloudRunnerOptions.getInput(`cloudRunnerTests`) === `true` ||\n CloudRunnerOptions.getInput(`cloudRunnerDebug`) === `true` ||\n CloudRunnerOptions.getInput(`cloudRunnerDebugTree`) === `true` ||\n CloudRunnerOptions.getInput(`cloudRunnerDebugEnv`) === `true` ||\n false);\n }\n static get skipLfs() {\n return CloudRunnerOptions.getInput(`skipLfs`) === `true`;\n }\n static get skipCache() {\n return CloudRunnerOptions.getInput(`skipCache`) === `true`;\n }\n static get asyncCloudRunner() {\n return CloudRunnerOptions.getInput('asyncCloudRunner') === 'true';\n }\n static get useLargePackages() {\n return CloudRunnerOptions.getInput(`useLargePackages`) === `true`;\n }\n static get useSharedBuilder() {\n return CloudRunnerOptions.getInput(`useSharedBuilder`) === `true`;\n }\n static get useCompressionStrategy() {\n return CloudRunnerOptions.getInput(`useCompressionStrategy`) === `true`;\n }\n static get useCleanupCron() {\n return (CloudRunnerOptions.getInput(`useCleanupCron`) || 'true') === 'true';\n }\n // ### ### ###\n // Retained Workspace\n // ### ### ###\n static get maxRetainedWorkspaces() {\n return CloudRunnerOptions.getInput(`maxRetainedWorkspaces`) || `0`;\n }\n // ### ### ###\n // Garbage Collection\n // ### ### ###\n static get garbageMaxAge() {\n return Number(CloudRunnerOptions.getInput(`garbageMaxAge`)) || 24;\n }\n}\nexports.default = CloudRunnerOptions;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst input_1 = __importDefault(require(\"../../input\"));\nconst generic_input_reader_1 = require(\"../../input-readers/generic-input-reader\");\nconst cloud_runner_options_1 = __importDefault(require(\"./cloud-runner-options\"));\nconst formatFunction = (value, arguments_) => {\n for (const element of arguments_) {\n value = value.replace(`{${element.key}}`, element.value);\n }\n return value;\n};\nclass CloudRunnerQueryOverride {\n // TODO accept premade secret sources or custom secret source definition yamls\n static query(key, alternativeKey) {\n if (CloudRunnerQueryOverride.queryOverrides && CloudRunnerQueryOverride.queryOverrides[key] !== undefined) {\n return CloudRunnerQueryOverride.queryOverrides[key];\n }\n if (CloudRunnerQueryOverride.queryOverrides &&\n alternativeKey &&\n CloudRunnerQueryOverride.queryOverrides[alternativeKey] !== undefined) {\n return CloudRunnerQueryOverride.queryOverrides[alternativeKey];\n }\n return;\n }\n static shouldUseOverride(query) {\n if (cloud_runner_options_1.default.inputPullCommand !== '') {\n if (cloud_runner_options_1.default.pullInputList.length > 0) {\n const doesInclude = cloud_runner_options_1.default.pullInputList.includes(query) ||\n cloud_runner_options_1.default.pullInputList.includes(input_1.default.ToEnvVarFormat(query));\n return doesInclude ? true : false;\n }\n else {\n return true;\n }\n }\n }\n static async queryOverride(query) {\n if (!this.shouldUseOverride(query)) {\n throw new Error(`Should not be trying to run override query on ${query}`);\n }\n return await generic_input_reader_1.GenericInputReader.Run(formatFunction(cloud_runner_options_1.default.inputPullCommand, [{ key: 0, value: query }]));\n }\n static async PopulateQueryOverrideInput() {\n const queries = cloud_runner_options_1.default.pullInputList;\n CloudRunnerQueryOverride.queryOverrides = {};\n for (const element of queries) {\n if (CloudRunnerQueryOverride.shouldUseOverride(element)) {\n CloudRunnerQueryOverride.queryOverrides[element] = await CloudRunnerQueryOverride.queryOverride(element);\n }\n }\n }\n}\nexports.default = CloudRunnerQueryOverride;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CloudRunnerStatics = void 0;\nclass CloudRunnerStatics {\n}\nexports.CloudRunnerStatics = CloudRunnerStatics;\nCloudRunnerStatics.logPrefix = `Cloud-Runner`;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CloudRunnerStepParameters = void 0;\nclass CloudRunnerStepParameters {\n constructor(image, environmentVariables, secrets) {\n this.image = image;\n this.environment = environmentVariables;\n this.secrets = secrets;\n }\n}\nexports.CloudRunnerStepParameters = CloudRunnerStepParameters;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AWSBaseStack = void 0;\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst base_stack_formation_1 = require(\"./cloud-formations/base-stack-formation\");\nconst node_crypto_1 = __importDefault(require(\"node:crypto\"));\nclass AWSBaseStack {\n constructor(baseStackName) {\n this.baseStackName = baseStackName;\n }\n async setupBaseStack(CF) {\n const baseStackName = this.baseStackName;\n const baseStack = base_stack_formation_1.BaseStackFormation.formation;\n // Cloud Formation Input\n const describeStackInput = {\n StackName: baseStackName,\n };\n const parametersWithoutHash = [\n { ParameterKey: 'EnvironmentName', ParameterValue: baseStackName },\n ];\n const parametersHash = node_crypto_1.default\n .createHash('md5')\n .update(baseStack + JSON.stringify(parametersWithoutHash))\n .digest('hex');\n const parameters = [\n ...parametersWithoutHash,\n ...[{ ParameterKey: 'Version', ParameterValue: parametersHash }],\n ];\n const updateInput = {\n StackName: baseStackName,\n TemplateBody: baseStack,\n Parameters: parameters,\n Capabilities: ['CAPABILITY_IAM'],\n };\n const createStackInput = {\n StackName: baseStackName,\n TemplateBody: baseStack,\n Parameters: parameters,\n Capabilities: ['CAPABILITY_IAM'],\n };\n const stacks = await CF.listStacks({\n StackStatusFilter: ['UPDATE_COMPLETE', 'CREATE_COMPLETE', 'ROLLBACK_COMPLETE'],\n }).promise();\n const stackNames = stacks.StackSummaries?.map((x) => x.StackName) || [];\n const stackExists = stackNames.includes(baseStackName) || false;\n const describeStack = async () => {\n return await CF.describeStacks(describeStackInput).promise();\n };\n try {\n if (!stackExists) {\n cloud_runner_logger_1.default.log(`${baseStackName} stack does not exist (${JSON.stringify(stackNames)})`);\n await CF.createStack(createStackInput).promise();\n cloud_runner_logger_1.default.log(`created stack (version: ${parametersHash})`);\n }\n const CFState = await describeStack();\n let stack = CFState.Stacks?.[0];\n if (!stack) {\n throw new Error(`Base stack doesn't exist, even after creation, stackExists check: ${stackExists}`);\n }\n const stackVersion = stack.Parameters?.find((x) => x.ParameterKey === 'Version')?.ParameterValue;\n if (stack.StackStatus === 'CREATE_IN_PROGRESS') {\n await CF.waitFor('stackCreateComplete', describeStackInput).promise();\n }\n if (stackExists) {\n cloud_runner_logger_1.default.log(`Base stack exists (version: ${stackVersion}, local version: ${parametersHash})`);\n if (parametersHash !== stackVersion) {\n cloud_runner_logger_1.default.log(`Attempting update of base stack`);\n try {\n await CF.updateStack(updateInput).promise();\n }\n catch (error) {\n if (error['message'].includes('No updates are to be performed')) {\n cloud_runner_logger_1.default.log(`No updates are to be performed`);\n }\n else {\n cloud_runner_logger_1.default.log(`Update Failed (Stack name: ${baseStackName})`);\n cloud_runner_logger_1.default.log(error['message']);\n }\n cloud_runner_logger_1.default.log(`Continuing...`);\n }\n }\n else {\n cloud_runner_logger_1.default.log(`No update required`);\n }\n stack = (await describeStack()).Stacks?.[0];\n if (!stack) {\n throw new Error(`Base stack doesn't exist, even after updating and creation, stackExists check: ${stackExists}`);\n }\n if (stack.StackStatus === 'UPDATE_IN_PROGRESS') {\n await CF.waitFor('stackUpdateComplete', describeStackInput).promise();\n }\n }\n cloud_runner_logger_1.default.log('base stack is now ready');\n }\n catch (error) {\n core.error(JSON.stringify(await describeStack(), undefined, 4));\n throw error;\n }\n }\n}\nexports.AWSBaseStack = AWSBaseStack;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AWSCloudFormationTemplates = void 0;\nconst task_definition_formation_1 = require(\"./cloud-formations/task-definition-formation\");\nclass AWSCloudFormationTemplates {\n static getParameterTemplate(p1) {\n return `\n ${p1}:\n Type: String\n Default: ''\n`;\n }\n static getSecretTemplate(p1) {\n return `\n ${p1}Secret:\n Type: AWS::SecretsManager::Secret\n Properties:\n Name: '${p1}'\n SecretString: !Ref ${p1}\n`;\n }\n static getSecretDefinitionTemplate(p1, p2) {\n return `\n - Name: '${p1}'\n ValueFrom: !Ref ${p2}Secret\n`;\n }\n static insertAtTemplate(template, insertionKey, insertion) {\n const index = template.search(insertionKey) + insertionKey.length + '\\n'.length;\n template = [template.slice(0, index), insertion, template.slice(index)].join('');\n return template;\n }\n static readTaskCloudFormationTemplate() {\n return task_definition_formation_1.TaskDefinitionFormation.formation;\n }\n}\nexports.AWSCloudFormationTemplates = AWSCloudFormationTemplates;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AWSError = void 0;\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nclass AWSError {\n static async handleStackCreationFailure(error, CF, taskDefStackName) {\n cloud_runner_logger_1.default.log('aws error: ');\n core.error(JSON.stringify(error, undefined, 4));\n if (cloud_runner_1.default.buildParameters.cloudRunnerDebug) {\n cloud_runner_logger_1.default.log('Getting events and resources for task stack');\n const events = (await CF.describeStackEvents({ StackName: taskDefStackName }).promise()).StackEvents;\n cloud_runner_logger_1.default.log(JSON.stringify(events, undefined, 4));\n }\n }\n}\nexports.AWSError = AWSError;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AWSJobStack = void 0;\nconst aws_cloud_formation_templates_1 = require(\"./aws-cloud-formation-templates\");\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst aws_error_1 = require(\"./aws-error\");\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nconst cleanup_cron_formation_1 = require(\"./cloud-formations/cleanup-cron-formation\");\nconst cloud_runner_options_1 = __importDefault(require(\"../../options/cloud-runner-options\"));\nconst task_definition_formation_1 = require(\"./cloud-formations/task-definition-formation\");\nclass AWSJobStack {\n constructor(baseStackName) {\n this.baseStackName = baseStackName;\n }\n async setupCloudFormations(CF, buildGuid, image, entrypoint, commands, mountdir, workingdir, secrets) {\n const taskDefStackName = `${this.baseStackName}-${buildGuid}`;\n let taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.readTaskCloudFormationTemplate();\n taskDefCloudFormation = taskDefCloudFormation.replace(`ContainerCpu:\n Default: 1024`, `ContainerCpu:\n Default: ${Number.parseInt(cloud_runner_1.default.buildParameters.containerCpu)}`);\n taskDefCloudFormation = taskDefCloudFormation.replace(`ContainerMemory:\n Default: 2048`, `ContainerMemory:\n Default: ${Number.parseInt(cloud_runner_1.default.buildParameters.containerMemory)}`);\n if (!cloud_runner_options_1.default.asyncCloudRunner) {\n taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '# template resources logstream', task_definition_formation_1.TaskDefinitionFormation.streamLogs);\n }\n for (const secret of secrets) {\n secret.ParameterKey = `${buildGuid.replace(/[^\\dA-Za-z]/g, '')}${secret.ParameterKey.replace(/[^\\dA-Za-z]/g, '')}`;\n if (typeof secret.ParameterValue == 'number') {\n secret.ParameterValue = `${secret.ParameterValue}`;\n }\n if (!secret.ParameterValue || secret.ParameterValue === '') {\n secrets = secrets.filter((x) => x !== secret);\n continue;\n }\n taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p1 - input', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getParameterTemplate(secret.ParameterKey));\n taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, '# template resources secrets', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretTemplate(`${secret.ParameterKey}`));\n taskDefCloudFormation = aws_cloud_formation_templates_1.AWSCloudFormationTemplates.insertAtTemplate(taskDefCloudFormation, 'p3 - container def', aws_cloud_formation_templates_1.AWSCloudFormationTemplates.getSecretDefinitionTemplate(secret.EnvironmentVariable, secret.ParameterKey));\n }\n const secretsMappedToCloudFormationParameters = secrets.map((x) => {\n return { ParameterKey: x.ParameterKey.replace(/[^\\dA-Za-z]/g, ''), ParameterValue: x.ParameterValue };\n });\n const logGroupName = `${this.baseStackName}/${taskDefStackName}`;\n const parameters = [\n {\n ParameterKey: 'EnvironmentName',\n ParameterValue: this.baseStackName,\n },\n {\n ParameterKey: 'ImageUrl',\n ParameterValue: image,\n },\n {\n ParameterKey: 'ServiceName',\n ParameterValue: taskDefStackName,\n },\n {\n ParameterKey: 'LogGroupName',\n ParameterValue: logGroupName,\n },\n {\n ParameterKey: 'Command',\n ParameterValue: 'echo \"this template should be overwritten when running a task\"',\n },\n {\n ParameterKey: 'EntryPoint',\n ParameterValue: entrypoint.join(','),\n },\n {\n ParameterKey: 'WorkingDirectory',\n ParameterValue: workingdir,\n },\n {\n ParameterKey: 'EFSMountDirectory',\n ParameterValue: mountdir,\n },\n ...secretsMappedToCloudFormationParameters,\n ];\n cloud_runner_logger_1.default.log(`Starting AWS job with memory: ${cloud_runner_1.default.buildParameters.containerMemory} cpu: ${cloud_runner_1.default.buildParameters.containerCpu}`);\n let previousStackExists = true;\n while (previousStackExists) {\n previousStackExists = false;\n const stacks = await CF.listStacks().promise();\n if (!stacks.StackSummaries) {\n throw new Error('Faild to get stacks');\n }\n for (let index = 0; index < stacks.StackSummaries.length; index++) {\n const element = stacks.StackSummaries[index];\n if (element.StackName === taskDefStackName && element.StackStatus !== 'DELETE_COMPLETE') {\n previousStackExists = true;\n cloud_runner_logger_1.default.log(`Previous stack still exists: ${JSON.stringify(element)}`);\n await new Promise((promise) => setTimeout(promise, 5000));\n }\n }\n }\n const createStackInput = {\n StackName: taskDefStackName,\n TemplateBody: taskDefCloudFormation,\n Capabilities: ['CAPABILITY_IAM'],\n Parameters: parameters,\n };\n try {\n cloud_runner_logger_1.default.log(`Creating job aws formation ${taskDefStackName}`);\n await CF.createStack(createStackInput).promise();\n await CF.waitFor('stackCreateComplete', { StackName: taskDefStackName }).promise();\n const describeStack = await CF.describeStacks({ StackName: taskDefStackName }).promise();\n for (const parameter of parameters) {\n if (!describeStack.Stacks?.[0].Parameters?.some((x) => x.ParameterKey === parameter.ParameterKey)) {\n throw new Error(`Parameter ${parameter.ParameterKey} not found in stack`);\n }\n }\n }\n catch (error) {\n await aws_error_1.AWSError.handleStackCreationFailure(error, CF, taskDefStackName);\n throw error;\n }\n const createCleanupStackInput = {\n StackName: `${taskDefStackName}-cleanup`,\n TemplateBody: cleanup_cron_formation_1.CleanupCronFormation.formation,\n Capabilities: ['CAPABILITY_IAM'],\n Parameters: [\n {\n ParameterKey: 'StackName',\n ParameterValue: taskDefStackName,\n },\n {\n ParameterKey: 'DeleteStackName',\n ParameterValue: `${taskDefStackName}-cleanup`,\n },\n {\n ParameterKey: 'TTL',\n ParameterValue: `1080`,\n },\n {\n ParameterKey: 'BUILDGUID',\n ParameterValue: cloud_runner_1.default.buildParameters.buildGuid,\n },\n {\n ParameterKey: 'EnvironmentName',\n ParameterValue: this.baseStackName,\n },\n ],\n };\n if (cloud_runner_options_1.default.useCleanupCron) {\n try {\n cloud_runner_logger_1.default.log(`Creating job cleanup formation`);\n await CF.createStack(createCleanupStackInput).promise();\n // await CF.waitFor('stackCreateComplete', { StackName: createCleanupStackInput.StackName }).promise();\n }\n catch (error) {\n await aws_error_1.AWSError.handleStackCreationFailure(error, CF, taskDefStackName);\n throw error;\n }\n }\n const taskDefResources = (await CF.describeStackResources({\n StackName: taskDefStackName,\n }).promise()).StackResources;\n const baseResources = (await CF.describeStackResources({ StackName: this.baseStackName }).promise()).StackResources;\n return {\n taskDefStackName,\n taskDefCloudFormation,\n taskDefResources,\n baseResources,\n };\n }\n}\nexports.AWSJobStack = AWSJobStack;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst zlib = __importStar(require(\"node:zlib\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst __1 = require(\"../../..\");\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nconst command_hook_service_1 = require(\"../../services/hooks/command-hook-service\");\nconst follow_log_stream_service_1 = require(\"../../services/core/follow-log-stream-service\");\nconst cloud_runner_options_1 = __importDefault(require(\"../../options/cloud-runner-options\"));\nconst github_1 = __importDefault(require(\"../../../github\"));\nclass AWSTaskRunner {\n static async runTask(taskDef, environment, commands) {\n const cluster = taskDef.baseResources?.find((x) => x.LogicalResourceId === 'ECSCluster')?.PhysicalResourceId || '';\n const taskDefinition = taskDef.taskDefResources?.find((x) => x.LogicalResourceId === 'TaskDefinition')?.PhysicalResourceId || '';\n const SubnetOne = taskDef.baseResources?.find((x) => x.LogicalResourceId === 'PublicSubnetOne')?.PhysicalResourceId || '';\n const SubnetTwo = taskDef.baseResources?.find((x) => x.LogicalResourceId === 'PublicSubnetTwo')?.PhysicalResourceId || '';\n const ContainerSecurityGroup = taskDef.baseResources?.find((x) => x.LogicalResourceId === 'ContainerSecurityGroup')?.PhysicalResourceId || '';\n const streamName = taskDef.taskDefResources?.find((x) => x.LogicalResourceId === 'KinesisStream')?.PhysicalResourceId || '';\n const runParameters = {\n cluster,\n taskDefinition,\n platformVersion: '1.4.0',\n overrides: {\n containerOverrides: [\n {\n name: taskDef.taskDefStackName,\n environment,\n command: ['-c', command_hook_service_1.CommandHookService.ApplyHooksToCommands(commands, cloud_runner_1.default.buildParameters)],\n },\n ],\n },\n launchType: 'FARGATE',\n networkConfiguration: {\n awsvpcConfiguration: {\n subnets: [SubnetOne, SubnetTwo],\n assignPublicIp: 'ENABLED',\n securityGroups: [ContainerSecurityGroup],\n },\n },\n };\n if (JSON.stringify(runParameters.overrides.containerOverrides).length > 8192) {\n cloud_runner_logger_1.default.log(JSON.stringify(runParameters.overrides.containerOverrides, undefined, 4));\n throw new Error(`Container Overrides length must be at most 8192`);\n }\n const task = await AWSTaskRunner.ECS.runTask(runParameters).promise();\n const taskArn = task.tasks?.[0].taskArn || '';\n cloud_runner_logger_1.default.log('Cloud runner job is starting');\n await AWSTaskRunner.waitUntilTaskRunning(taskArn, cluster);\n cloud_runner_logger_1.default.log(`Cloud runner job status is running ${(await AWSTaskRunner.describeTasks(cluster, taskArn))?.lastStatus} Async:${cloud_runner_options_1.default.asyncCloudRunner}`);\n if (cloud_runner_options_1.default.asyncCloudRunner) {\n const shouldCleanup = false;\n const output = '';\n cloud_runner_logger_1.default.log(`Watch Cloud Runner To End: false`);\n return { output, shouldCleanup };\n }\n cloud_runner_logger_1.default.log(`Streaming...`);\n const { output, shouldCleanup } = await this.streamLogsUntilTaskStops(cluster, taskArn, streamName);\n let exitCode;\n let containerState;\n let taskData;\n while (exitCode === undefined) {\n await new Promise((resolve) => resolve(10000));\n taskData = await AWSTaskRunner.describeTasks(cluster, taskArn);\n containerState = taskData.containers?.[0];\n exitCode = containerState?.exitCode;\n }\n cloud_runner_logger_1.default.log(`Container State: ${JSON.stringify(containerState, undefined, 4)}`);\n if (exitCode === undefined) {\n cloud_runner_logger_1.default.logWarning(`Undefined exitcode for container`);\n }\n const wasSuccessful = exitCode === 0;\n if (wasSuccessful) {\n cloud_runner_logger_1.default.log(`Cloud runner job has finished successfully`);\n return { output, shouldCleanup };\n }\n if (taskData?.stoppedReason === 'Essential container in task exited' && exitCode === 1) {\n throw new Error('Container exited with code 1');\n }\n throw new Error(`Task failed`);\n }\n static async waitUntilTaskRunning(taskArn, cluster) {\n try {\n await AWSTaskRunner.ECS.waitFor('tasksRunning', { tasks: [taskArn], cluster }).promise();\n }\n catch (error_) {\n const error = error_;\n await new Promise((resolve) => setTimeout(resolve, 3000));\n cloud_runner_logger_1.default.log(`Cloud runner job has ended ${(await AWSTaskRunner.describeTasks(cluster, taskArn)).containers?.[0].lastStatus}`);\n core.setFailed(error);\n core.error(error);\n }\n }\n static async describeTasks(clusterName, taskArn) {\n const tasks = await AWSTaskRunner.ECS.describeTasks({\n cluster: clusterName,\n tasks: [taskArn],\n }).promise();\n if (tasks.tasks?.[0]) {\n return tasks.tasks?.[0];\n }\n else {\n throw new Error('No task found');\n }\n }\n static async streamLogsUntilTaskStops(clusterName, taskArn, kinesisStreamName) {\n await new Promise((resolve) => setTimeout(resolve, 3000));\n cloud_runner_logger_1.default.log(`Streaming...`);\n const stream = await AWSTaskRunner.getLogStream(kinesisStreamName);\n let iterator = await AWSTaskRunner.getLogIterator(stream);\n const logBaseUrl = `https://${__1.Input.region}.console.aws.amazon.com/cloudwatch/home?region=${__1.Input.region}#logsV2:log-groups/log-group/${cloud_runner_1.default.buildParameters.awsStackName}${AWSTaskRunner.encodedUnderscore}${cloud_runner_1.default.buildParameters.awsStackName}-${cloud_runner_1.default.buildParameters.buildGuid}`;\n cloud_runner_logger_1.default.log(`You view the log stream on AWS Cloud Watch: ${logBaseUrl}`);\n await github_1.default.updateGitHubCheck(`You view the log stream on AWS Cloud Watch: ${logBaseUrl}`, ``);\n let shouldReadLogs = true;\n let shouldCleanup = true;\n let timestamp = 0;\n let output = '';\n while (shouldReadLogs) {\n await new Promise((resolve) => setTimeout(resolve, 1500));\n const taskData = await AWSTaskRunner.describeTasks(clusterName, taskArn);\n ({ timestamp, shouldReadLogs } = AWSTaskRunner.checkStreamingShouldContinue(taskData, timestamp, shouldReadLogs));\n ({ iterator, shouldReadLogs, output, shouldCleanup } = await AWSTaskRunner.handleLogStreamIteration(iterator, shouldReadLogs, output, shouldCleanup));\n }\n return { output, shouldCleanup };\n }\n static async handleLogStreamIteration(iterator, shouldReadLogs, output, shouldCleanup) {\n const records = await AWSTaskRunner.Kinesis.getRecords({\n ShardIterator: iterator,\n }).promise();\n iterator = records.NextShardIterator || '';\n ({ shouldReadLogs, output, shouldCleanup } = AWSTaskRunner.logRecords(records, iterator, shouldReadLogs, output, shouldCleanup));\n return { iterator, shouldReadLogs, output, shouldCleanup };\n }\n static checkStreamingShouldContinue(taskData, timestamp, shouldReadLogs) {\n if (taskData?.lastStatus === 'UNKNOWN') {\n cloud_runner_logger_1.default.log('## Cloud runner job unknwon');\n }\n if (taskData?.lastStatus !== 'RUNNING') {\n if (timestamp === 0) {\n cloud_runner_logger_1.default.log('## Cloud runner job stopped, streaming end of logs');\n timestamp = Date.now();\n }\n if (timestamp !== 0 && Date.now() - timestamp > 30000) {\n cloud_runner_logger_1.default.log('## Cloud runner status is not RUNNING for 30 seconds, last query for logs');\n shouldReadLogs = false;\n }\n cloud_runner_logger_1.default.log(`## Status of job: ${taskData.lastStatus}`);\n }\n return { timestamp, shouldReadLogs };\n }\n static logRecords(records, iterator, shouldReadLogs, output, shouldCleanup) {\n if (records.Records.length > 0 && iterator) {\n for (const record of records.Records) {\n const json = JSON.parse(zlib.gunzipSync(Buffer.from(record.Data, 'base64')).toString('utf8'));\n if (json.messageType === 'DATA_MESSAGE') {\n for (const logEvent of json.logEvents) {\n ({ shouldReadLogs, shouldCleanup, output } = follow_log_stream_service_1.FollowLogStreamService.handleIteration(logEvent.message, shouldReadLogs, shouldCleanup, output));\n }\n }\n }\n }\n return { shouldReadLogs, output, shouldCleanup };\n }\n static async getLogStream(kinesisStreamName) {\n return await AWSTaskRunner.Kinesis.describeStream({\n StreamName: kinesisStreamName,\n }).promise();\n }\n static async getLogIterator(stream) {\n return ((await AWSTaskRunner.Kinesis.getShardIterator({\n ShardIteratorType: 'TRIM_HORIZON',\n StreamName: stream.StreamDescription.StreamName,\n ShardId: stream.StreamDescription.Shards[0].ShardId,\n }).promise()).ShardIterator || '');\n }\n}\nAWSTaskRunner.encodedUnderscore = `$252F`;\nexports.default = AWSTaskRunner;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaseStackFormation = void 0;\nclass BaseStackFormation {\n}\nexports.BaseStackFormation = BaseStackFormation;\nBaseStackFormation.baseStackDecription = `Game-CI base stack`;\nBaseStackFormation.formation = `AWSTemplateFormatVersion: '2010-09-09'\nDescription: ${BaseStackFormation.baseStackDecription}\nParameters:\n EnvironmentName:\n Type: String\n Default: development\n Description: 'Your deployment environment: DEV, QA , PROD'\n Version:\n Type: String\n Description: 'hash of template'\n\n # ContainerPort:\n # Type: Number\n # Default: 80\n # Description: What port number the application inside the docker container is binding to\n\nMappings:\n # Hard values for the subnet masks. These masks define\n # the range of internal IP addresses that can be assigned.\n # The VPC can have all IP's from 10.0.0.0 to 10.0.255.255\n # There are four subnets which cover the ranges:\n #\n # 10.0.0.0 - 10.0.0.255\n # 10.0.1.0 - 10.0.1.255\n # 10.0.2.0 - 10.0.2.255\n # 10.0.3.0 - 10.0.3.255\n\n SubnetConfig:\n VPC:\n CIDR: '10.0.0.0/16'\n PublicOne:\n CIDR: '10.0.0.0/24'\n PublicTwo:\n CIDR: '10.0.1.0/24'\n\nResources:\n # VPC in which containers will be networked.\n # It has two public subnets, and two private subnets.\n # We distribute the subnets across the first two available subnets\n # for the region, for high availability.\n VPC:\n Type: AWS::EC2::VPC\n Properties:\n EnableDnsSupport: true\n EnableDnsHostnames: true\n CidrBlock: !FindInMap ['SubnetConfig', 'VPC', 'CIDR']\n\n MainBucket:\n Type: \"AWS::S3::Bucket\"\n Properties:\n BucketName: !Ref EnvironmentName\n\n EFSServerSecurityGroup:\n Type: AWS::EC2::SecurityGroup\n Properties:\n GroupName: 'efs-server-endpoints'\n GroupDescription: Which client ip addrs are allowed to access EFS server\n VpcId: !Ref 'VPC'\n SecurityGroupIngress:\n - IpProtocol: tcp\n FromPort: 2049\n ToPort: 2049\n SourceSecurityGroupId: !Ref ContainerSecurityGroup\n #CidrIp: !FindInMap ['SubnetConfig', 'VPC', 'CIDR']\n # A security group for the containers we will run in Fargate.\n # Rules are added to this security group based on what ingress you\n # add for the cluster.\n ContainerSecurityGroup:\n Type: AWS::EC2::SecurityGroup\n Properties:\n GroupName: 'task security group'\n GroupDescription: Access to the Fargate containers\n VpcId: !Ref 'VPC'\n # SecurityGroupIngress:\n # - IpProtocol: tcp\n # FromPort: !Ref ContainerPort\n # ToPort: !Ref ContainerPort\n # CidrIp: 0.0.0.0/0\n SecurityGroupEgress:\n - IpProtocol: -1\n FromPort: 2049\n ToPort: 2049\n CidrIp: '0.0.0.0/0'\n\n # Two public subnets, where containers can have public IP addresses\n PublicSubnetOne:\n Type: AWS::EC2::Subnet\n Properties:\n AvailabilityZone: !Select\n - 0\n - Fn::GetAZs: !Ref 'AWS::Region'\n VpcId: !Ref 'VPC'\n CidrBlock: !FindInMap ['SubnetConfig', 'PublicOne', 'CIDR']\n # MapPublicIpOnLaunch: true\n\n PublicSubnetTwo:\n Type: AWS::EC2::Subnet\n Properties:\n AvailabilityZone: !Select\n - 1\n - Fn::GetAZs: !Ref 'AWS::Region'\n VpcId: !Ref 'VPC'\n CidrBlock: !FindInMap ['SubnetConfig', 'PublicTwo', 'CIDR']\n # MapPublicIpOnLaunch: true\n\n # Setup networking resources for the public subnets. Containers\n # in the public subnets have public IP addresses and the routing table\n # sends network traffic via the internet gateway.\n InternetGateway:\n Type: AWS::EC2::InternetGateway\n GatewayAttachement:\n Type: AWS::EC2::VPCGatewayAttachment\n Properties:\n VpcId: !Ref 'VPC'\n InternetGatewayId: !Ref 'InternetGateway'\n\n # Attaching a Internet Gateway to route table makes it public.\n PublicRouteTable:\n Type: AWS::EC2::RouteTable\n Properties:\n VpcId: !Ref 'VPC'\n PublicRoute:\n Type: AWS::EC2::Route\n DependsOn: GatewayAttachement\n Properties:\n RouteTableId: !Ref 'PublicRouteTable'\n DestinationCidrBlock: '0.0.0.0/0'\n GatewayId: !Ref 'InternetGateway'\n\n # Attaching a public route table makes a subnet public.\n PublicSubnetOneRouteTableAssociation:\n Type: AWS::EC2::SubnetRouteTableAssociation\n Properties:\n SubnetId: !Ref PublicSubnetOne\n RouteTableId: !Ref PublicRouteTable\n PublicSubnetTwoRouteTableAssociation:\n Type: AWS::EC2::SubnetRouteTableAssociation\n Properties:\n SubnetId: !Ref PublicSubnetTwo\n RouteTableId: !Ref PublicRouteTable\n\n # ECS Resources\n ECSCluster:\n Type: AWS::ECS::Cluster\n\n # A role used to allow AWS Autoscaling to inspect stats and adjust scaleable targets\n # on your AWS account\n AutoscalingRole:\n Type: AWS::IAM::Role\n Properties:\n AssumeRolePolicyDocument:\n Statement:\n - Effect: Allow\n Principal:\n Service: [application-autoscaling.amazonaws.com]\n Action: ['sts:AssumeRole']\n Path: /\n Policies:\n - PolicyName: service-autoscaling\n PolicyDocument:\n Statement:\n - Effect: Allow\n Action:\n - 'application-autoscaling:*'\n - 'cloudwatch:DescribeAlarms'\n - 'cloudwatch:PutMetricAlarm'\n - 'ecs:DescribeServices'\n - 'ecs:UpdateService'\n Resource: '*'\n\n # This is an IAM role which authorizes ECS to manage resources on your\n # account on your behalf, such as updating your load balancer with the\n # details of where your containers are, so that traffic can reach your\n # containers.\n ECSRole:\n Type: AWS::IAM::Role\n Properties:\n AssumeRolePolicyDocument:\n Statement:\n - Effect: Allow\n Principal:\n Service: [ecs.amazonaws.com]\n Action: ['sts:AssumeRole']\n Path: /\n Policies:\n - PolicyName: ecs-service\n PolicyDocument:\n Statement:\n - Effect: Allow\n Action:\n # Rules which allow ECS to attach network interfaces to instances\n # on your behalf in order for awsvpc networking mode to work right\n - 'ec2:AttachNetworkInterface'\n - 'ec2:CreateNetworkInterface'\n - 'ec2:CreateNetworkInterfacePermission'\n - 'ec2:DeleteNetworkInterface'\n - 'ec2:DeleteNetworkInterfacePermission'\n - 'ec2:Describe*'\n - 'ec2:DetachNetworkInterface'\n\n # Rules which allow ECS to update load balancers on your behalf\n # with the information sabout how to send traffic to your containers\n - 'elasticloadbalancing:DeregisterInstancesFromLoadBalancer'\n - 'elasticloadbalancing:DeregisterTargets'\n - 'elasticloadbalancing:Describe*'\n - 'elasticloadbalancing:RegisterInstancesWithLoadBalancer'\n - 'elasticloadbalancing:RegisterTargets'\n Resource: '*'\n\n # This is a role which is used by the ECS tasks themselves.\n ECSTaskExecutionRole:\n Type: AWS::IAM::Role\n Properties:\n AssumeRolePolicyDocument:\n Statement:\n - Effect: Allow\n Principal:\n Service: [ecs-tasks.amazonaws.com]\n Action: ['sts:AssumeRole']\n Path: /\n Policies:\n - PolicyName: AmazonECSTaskExecutionRolePolicy\n PolicyDocument:\n Statement:\n - Effect: Allow\n Action:\n # Allow the use of secret manager\n - 'secretsmanager:GetSecretValue'\n - 'kms:Decrypt'\n\n # Allow the ECS Tasks to download images from ECR\n - 'ecr:GetAuthorizationToken'\n - 'ecr:BatchCheckLayerAvailability'\n - 'ecr:GetDownloadUrlForLayer'\n - 'ecr:BatchGetImage'\n\n # Allow the ECS tasks to upload logs to CloudWatch\n - 'logs:CreateLogStream'\n - 'logs:PutLogEvents'\n Resource: '*'\n\n DeleteCFNLambdaExecutionRole:\n Type: 'AWS::IAM::Role'\n Properties:\n AssumeRolePolicyDocument:\n Version: '2012-10-17'\n Statement:\n - Effect: 'Allow'\n Principal:\n Service: ['lambda.amazonaws.com']\n Action: 'sts:AssumeRole'\n Path: '/'\n Policies:\n - PolicyName: DeleteCFNLambdaExecutionRole\n PolicyDocument:\n Version: '2012-10-17'\n Statement:\n - Effect: 'Allow'\n Action:\n - 'logs:CreateLogGroup'\n - 'logs:CreateLogStream'\n - 'logs:PutLogEvents'\n Resource: 'arn:aws:logs:*:*:*'\n - Effect: 'Allow'\n Action:\n - 'cloudformation:DeleteStack'\n - 'kinesis:DeleteStream'\n - 'secretsmanager:DeleteSecret'\n - 'kinesis:DescribeStreamSummary'\n - 'logs:DeleteLogGroup'\n - 'logs:DeleteSubscriptionFilter'\n - 'ecs:DeregisterTaskDefinition'\n - 'lambda:DeleteFunction'\n - 'lambda:InvokeFunction'\n - 'events:RemoveTargets'\n - 'events:DeleteRule'\n - 'lambda:RemovePermission'\n Resource: '*'\n\n ### cloud watch to kinesis role\n CloudWatchIAMRole:\n Type: AWS::IAM::Role\n Properties:\n AssumeRolePolicyDocument:\n Statement:\n - Effect: Allow\n Principal:\n Service: [logs.amazonaws.com]\n Action: ['sts:AssumeRole']\n Path: /\n Policies:\n - PolicyName: service-autoscaling\n PolicyDocument:\n Statement:\n - Effect: Allow\n Action:\n - 'kinesis:PutRecord'\n Resource: '*'\n\n #####################EFS#####################\n EfsFileStorage:\n Type: 'AWS::EFS::FileSystem'\n Properties:\n BackupPolicy:\n Status: ENABLED\n PerformanceMode: maxIO\n Encrypted: false\n\n FileSystemPolicy:\n Version: '2012-10-17'\n Statement:\n - Effect: 'Allow'\n Action:\n - 'elasticfilesystem:ClientMount'\n - 'elasticfilesystem:ClientWrite'\n - 'elasticfilesystem:ClientRootAccess'\n Principal:\n AWS: '*'\n\n MountTargetResource1:\n Type: AWS::EFS::MountTarget\n Properties:\n FileSystemId: !Ref EfsFileStorage\n SubnetId: !Ref PublicSubnetOne\n SecurityGroups:\n - !Ref EFSServerSecurityGroup\n\n MountTargetResource2:\n Type: AWS::EFS::MountTarget\n Properties:\n FileSystemId: !Ref EfsFileStorage\n SubnetId: !Ref PublicSubnetTwo\n SecurityGroups:\n - !Ref EFSServerSecurityGroup\n\nOutputs:\n EfsFileStorageId:\n Description: 'The connection endpoint for the database.'\n Value: !Ref EfsFileStorage\n Export:\n Name: !Sub ${'${EnvironmentName}'}:EfsFileStorageId\n ClusterName:\n Description: The name of the ECS cluster\n Value: !Ref 'ECSCluster'\n Export:\n Name: !Sub${' ${EnvironmentName}'}:ClusterName\n AutoscalingRole:\n Description: The ARN of the role used for autoscaling\n Value: !GetAtt 'AutoscalingRole.Arn'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:AutoscalingRole\n ECSRole:\n Description: The ARN of the ECS role\n Value: !GetAtt 'ECSRole.Arn'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:ECSRole\n ECSTaskExecutionRole:\n Description: The ARN of the ECS role tsk execution role\n Value: !GetAtt 'ECSTaskExecutionRole.Arn'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:ECSTaskExecutionRole\n\n DeleteCFNLambdaExecutionRole:\n Description: Lambda execution role for cleaning up cloud formations\n Value: !GetAtt 'DeleteCFNLambdaExecutionRole.Arn'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:DeleteCFNLambdaExecutionRole\n\n CloudWatchIAMRole:\n Description: The ARN of the CloudWatch role for subscription filter\n Value: !GetAtt 'CloudWatchIAMRole.Arn'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:CloudWatchIAMRole\n VpcId:\n Description: The ID of the VPC that this stack is deployed in\n Value: !Ref 'VPC'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:VpcId\n PublicSubnetOne:\n Description: Public subnet one\n Value: !Ref 'PublicSubnetOne'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:PublicSubnetOne\n PublicSubnetTwo:\n Description: Public subnet two\n Value: !Ref 'PublicSubnetTwo'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:PublicSubnetTwo\n ContainerSecurityGroup:\n Description: A security group used to allow Fargate containers to receive traffic\n Value: !Ref 'ContainerSecurityGroup'\n Export:\n Name: !Sub ${'${EnvironmentName}'}:ContainerSecurityGroup\n`;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CleanupCronFormation = void 0;\nclass CleanupCronFormation {\n}\nexports.CleanupCronFormation = CleanupCronFormation;\nCleanupCronFormation.formation = `AWSTemplateFormatVersion: '2010-09-09'\nDescription: Schedule automatic deletion of CloudFormation stacks\nMetadata:\n AWS::CloudFormation::Interface:\n ParameterGroups:\n - Label:\n default: Input configuration\n Parameters:\n - StackName\n - TTL\n ParameterLabels:\n StackName:\n default: Stack name\n TTL:\n default: Time-to-live\nParameters:\n EnvironmentName:\n Type: String\n Default: development\n Description: 'Your deployment environment: DEV, QA , PROD'\n BUILDGUID:\n Type: String\n Default: ''\n StackName:\n Type: String\n Description: Stack name that will be deleted.\n DeleteStackName:\n Type: String\n Description: Stack name that will be deleted.\n TTL:\n Type: Number\n Description: Time-to-live in minutes for the stack.\nResources:\n DeleteCFNLambda:\n Type: \"AWS::Lambda::Function\"\n Properties:\n FunctionName: !Join [ \"\", [ 'DeleteCFNLambda', !Ref BUILDGUID ] ]\n Code:\n ZipFile: |\n import boto3\n import os\n import json\n\n stack_name = os.environ['stackName']\n delete_stack_name = os.environ['deleteStackName']\n\n def delete_cfn(stack_name):\n try:\n cfn = boto3.resource('cloudformation')\n stack = cfn.Stack(stack_name)\n stack.delete()\n return \"SUCCESS\"\n except:\n return \"ERROR\"\n\n def handler(event, context):\n print(\"Received event:\")\n print(json.dumps(event))\n result = delete_cfn(stack_name)\n delete_cfn(delete_stack_name)\n return result\n Environment:\n Variables:\n stackName: !Ref 'StackName'\n deleteStackName: !Ref 'DeleteStackName'\n Handler: \"index.handler\"\n Runtime: \"python3.9\"\n Timeout: \"5\"\n Role:\n 'Fn::ImportValue': !Sub '\\${EnvironmentName}:DeleteCFNLambdaExecutionRole'\n DeleteStackEventRule:\n DependsOn:\n - DeleteCFNLambda\n - GenerateCronExpression\n Type: \"AWS::Events::Rule\"\n Properties:\n Name: !Join [ \"\", [ 'DeleteStackEventRule', !Ref BUILDGUID ] ]\n Description: Delete stack event\n ScheduleExpression: !GetAtt GenerateCronExpression.cron_exp\n State: \"ENABLED\"\n Targets:\n -\n Arn: !GetAtt DeleteCFNLambda.Arn\n Id: 'DeleteCFNLambda'\n PermissionForDeleteCFNLambda:\n Type: \"AWS::Lambda::Permission\"\n DependsOn:\n - DeleteStackEventRule\n Properties:\n FunctionName: !Join [ \"\", [ 'DeleteCFNLambda', !Ref BUILDGUID ] ]\n Action: \"lambda:InvokeFunction\"\n Principal: \"events.amazonaws.com\"\n SourceArn: !GetAtt DeleteStackEventRule.Arn\n GenerateCronExpLambda:\n Type: \"AWS::Lambda::Function\"\n Properties:\n FunctionName: !Join [ \"\", [ 'GenerateCronExpressionLambda', !Ref BUILDGUID ] ]\n Code:\n ZipFile: |\n from datetime import datetime, timedelta\n import os\n import logging\n import json\n import cfnresponse\n\n def deletion_time(ttl):\n delete_at_time = datetime.now() + timedelta(minutes=int(ttl))\n hh = delete_at_time.hour\n mm = delete_at_time.minute\n yyyy = delete_at_time.year\n month = delete_at_time.month\n dd = delete_at_time.day\n # minutes hours day month day-of-week year\n cron_exp = \"cron({} {} {} {} ? {})\".format(mm, hh, dd, month, yyyy)\n return cron_exp\n\n def handler(event, context):\n print('Received event: %s' % json.dumps(event))\n status = cfnresponse.SUCCESS\n try:\n if event['RequestType'] == 'Delete':\n cfnresponse.send(event, context, status, {})\n else:\n ttl = event['ResourceProperties']['ttl']\n responseData = {}\n responseData['cron_exp'] = deletion_time(ttl)\n cfnresponse.send(event, context, cfnresponse.SUCCESS, responseData)\n except Exception as e:\n logging.error('Exception: %s' % e, exc_info=True)\n status = cfnresponse.FAILED\n cfnresponse.send(event, context, status, {}, None)\n Handler: \"index.handler\"\n Runtime: \"python3.9\"\n Timeout: \"5\"\n Role:\n 'Fn::ImportValue': !Sub '\\${EnvironmentName}:DeleteCFNLambdaExecutionRole'\n GenerateCronExpression:\n Type: \"Custom::GenerateCronExpression\"\n Version: \"1.0\"\n Properties:\n Name: !Join [ \"\", [ 'GenerateCronExpression', !Ref BUILDGUID ] ]\n ServiceToken: !GetAtt GenerateCronExpLambda.Arn\n ttl: !Ref 'TTL'\n`;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TaskDefinitionFormation = void 0;\nclass TaskDefinitionFormation {\n}\nexports.TaskDefinitionFormation = TaskDefinitionFormation;\nTaskDefinitionFormation.description = `Game CI Cloud Runner Task Stack`;\nTaskDefinitionFormation.formation = `AWSTemplateFormatVersion: 2010-09-09\nDescription: ${TaskDefinitionFormation.description}\nParameters:\n EnvironmentName:\n Type: String\n Default: development\n Description: 'Your deployment environment: DEV, QA , PROD'\n ServiceName:\n Type: String\n Default: example\n Description: A name for the service\n LogGroupName:\n Type: String\n Default: example\n Description: Name to use for the log group created for this task\n ImageUrl:\n Type: String\n Default: nginx\n Description: >-\n The url of a docker image that contains the application process that will\n handle the traffic for this service\n ContainerPort:\n Type: Number\n Default: 80\n Description: What port number the application inside the docker container is binding to\n ContainerCpu:\n Default: 1024\n Type: Number\n Description: How much CPU to give the container. 1024 is 1 CPU\n ContainerMemory:\n Default: 4096\n Type: Number\n Description: How much memory in megabytes to give the container\n BUILDGUID:\n Type: String\n Default: ''\n Command:\n Type: String\n Default: 'ls'\n EntryPoint:\n Type: String\n Default: '/bin/sh'\n WorkingDirectory:\n Type: String\n Default: '/efsdata/'\n Role:\n Type: String\n Default: ''\n Description: >-\n (Optional) An IAM role to give the service's containers if the code within\n needs to access other AWS resources like S3 buckets, DynamoDB tables, etc\n EFSMountDirectory:\n Type: String\n Default: '/efsdata'\n # template secrets p1 - input\nMappings:\n SubnetConfig:\n VPC:\n CIDR: 10.0.0.0/16\n PublicOne:\n CIDR: 10.0.0.0/24\n PublicTwo:\n CIDR: 10.0.1.0/24\nConditions:\n HasCustomRole: !Not\n - !Equals\n - Ref: Role\n - ''\nResources:\n LogGroup:\n Type: 'AWS::Logs::LogGroup'\n Properties:\n LogGroupName: !Ref LogGroupName\n Metadata:\n 'AWS::CloudFormation::Designer':\n id: aece53ae-b82d-4267-bc16-ed964b05db27\n # template resources secrets\n\n # template resources logstream\n\n TaskDefinition:\n Type: 'AWS::ECS::TaskDefinition'\n Properties:\n Family: !Ref ServiceName\n Cpu: !Ref ContainerCpu\n Memory: !Ref ContainerMemory\n NetworkMode: awsvpc\n Volumes:\n - Name: efs-data\n EFSVolumeConfiguration:\n FilesystemId:\n 'Fn::ImportValue': !Sub '${'${EnvironmentName}'}:EfsFileStorageId'\n TransitEncryption: ENABLED\n RequiresCompatibilities:\n - FARGATE\n ExecutionRoleArn:\n 'Fn::ImportValue': !Sub '${'${EnvironmentName}'}:ECSTaskExecutionRole'\n TaskRoleArn:\n 'Fn::If':\n - HasCustomRole\n - !Ref Role\n - !Ref 'AWS::NoValue'\n ContainerDefinitions:\n - Name: !Ref ServiceName\n Cpu: !Ref ContainerCpu\n Memory: !Ref ContainerMemory\n Image: !Ref ImageUrl\n EntryPoint:\n Fn::Split:\n - ','\n - !Ref EntryPoint\n Command:\n Fn::Split:\n - ','\n - !Ref Command\n WorkingDirectory: !Ref WorkingDirectory\n Environment:\n - Name: ALLOW_EMPTY_PASSWORD\n Value: 'yes'\n # template - env vars\n MountPoints:\n - SourceVolume: efs-data\n ContainerPath: !Ref EFSMountDirectory\n ReadOnly: false\n Secrets:\n # template secrets p3 - container def\n LogConfiguration:\n LogDriver: awslogs\n Options:\n awslogs-group: !Ref LogGroupName\n awslogs-region: !Ref 'AWS::Region'\n awslogs-stream-prefix: !Ref ServiceName\n DependsOn:\n - LogGroup\n`;\nTaskDefinitionFormation.streamLogs = `\n SubscriptionFilter:\n Type: 'AWS::Logs::SubscriptionFilter'\n Properties:\n FilterPattern: ''\n RoleArn:\n 'Fn::ImportValue': !Sub '${'${EnvironmentName}'}:CloudWatchIAMRole'\n LogGroupName: !Ref LogGroupName\n DestinationArn:\n 'Fn::GetAtt':\n - KinesisStream\n - Arn\n Metadata:\n 'AWS::CloudFormation::Designer':\n id: 7f809e91-9e5d-4678-98c1-c5085956c480\n DependsOn:\n - LogGroup\n - KinesisStream\n KinesisStream:\n Type: 'AWS::Kinesis::Stream'\n Properties:\n Name: !Ref ServiceName\n ShardCount: 1\n Metadata:\n 'AWS::CloudFormation::Designer':\n id: c6f18447-b879-4696-8873-f981b2cedd2b\n`;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst SDK = __importStar(require(\"aws-sdk\"));\nconst aws_task_runner_1 = __importDefault(require(\"./aws-task-runner\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst aws_job_stack_1 = require(\"./aws-job-stack\");\nconst aws_base_stack_1 = require(\"./aws-base-stack\");\nconst __1 = require(\"../../..\");\nconst garbage_collection_service_1 = require(\"./services/garbage-collection-service\");\nconst task_service_1 = require(\"./services/task-service\");\nconst cloud_runner_options_1 = __importDefault(require(\"../../options/cloud-runner-options\"));\nclass AWSBuildEnvironment {\n constructor(buildParameters) {\n this.baseStackName = buildParameters.awsStackName;\n }\n async listResources() {\n await task_service_1.TaskService.getCloudFormationJobStacks();\n await task_service_1.TaskService.getLogGroups();\n await task_service_1.TaskService.getTasks();\n return [];\n }\n listWorkflow() {\n throw new Error('Method not implemented.');\n }\n async watchWorkflow() {\n return await task_service_1.TaskService.watch();\n }\n async listOtherResources() {\n await task_service_1.TaskService.getLogGroups();\n return '';\n }\n async garbageCollect(filter, previewOnly, \n // eslint-disable-next-line no-unused-vars\n olderThan, \n // eslint-disable-next-line no-unused-vars\n fullCache, \n // eslint-disable-next-line no-unused-vars\n baseDependencies) {\n await garbage_collection_service_1.GarbageCollectionService.cleanup(!previewOnly);\n return ``;\n }\n async cleanupWorkflow(\n // eslint-disable-next-line no-unused-vars\n buildGuid, \n // eslint-disable-next-line no-unused-vars\n buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) { }\n async setupWorkflow(\n // eslint-disable-next-line no-unused-vars\n buildGuid, \n // eslint-disable-next-line no-unused-vars\n buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) {\n process.env.AWS_REGION = __1.Input.region;\n const CF = new SDK.CloudFormation();\n await new aws_base_stack_1.AWSBaseStack(this.baseStackName).setupBaseStack(CF);\n }\n async runTaskInWorkflow(buildGuid, image, commands, mountdir, workingdir, environment, secrets) {\n process.env.AWS_REGION = __1.Input.region;\n const ECS = new SDK.ECS();\n const CF = new SDK.CloudFormation();\n aws_task_runner_1.default.ECS = ECS;\n aws_task_runner_1.default.Kinesis = new SDK.Kinesis();\n cloud_runner_logger_1.default.log(`AWS Region: ${CF.config.region}`);\n const entrypoint = ['/bin/sh'];\n const startTimeMs = Date.now();\n const taskDef = await new aws_job_stack_1.AWSJobStack(this.baseStackName).setupCloudFormations(CF, buildGuid, image, entrypoint, commands, mountdir, workingdir, secrets);\n let postRunTaskTimeMs;\n try {\n const postSetupStacksTimeMs = Date.now();\n cloud_runner_logger_1.default.log(`Setup job time: ${Math.floor((postSetupStacksTimeMs - startTimeMs) / 1000)}s`);\n const { output, shouldCleanup } = await aws_task_runner_1.default.runTask(taskDef, environment, commands);\n postRunTaskTimeMs = Date.now();\n cloud_runner_logger_1.default.log(`Run job time: ${Math.floor((postRunTaskTimeMs - postSetupStacksTimeMs) / 1000)}s`);\n if (shouldCleanup) {\n await this.cleanupResources(CF, taskDef);\n }\n const postCleanupTimeMs = Date.now();\n if (postRunTaskTimeMs !== undefined)\n cloud_runner_logger_1.default.log(`Cleanup job time: ${Math.floor((postCleanupTimeMs - postRunTaskTimeMs) / 1000)}s`);\n return output;\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`error running task ${error}`);\n await this.cleanupResources(CF, taskDef);\n throw error;\n }\n }\n async cleanupResources(CF, taskDef) {\n cloud_runner_logger_1.default.log('Cleanup starting');\n await CF.deleteStack({\n StackName: taskDef.taskDefStackName,\n }).promise();\n if (cloud_runner_options_1.default.useCleanupCron) {\n await CF.deleteStack({\n StackName: `${taskDef.taskDefStackName}-cleanup`,\n }).promise();\n }\n await CF.waitFor('stackDeleteComplete', {\n StackName: taskDef.taskDefStackName,\n }).promise();\n await CF.waitFor('stackDeleteComplete', {\n StackName: `${taskDef.taskDefStackName}-cleanup`,\n }).promise();\n cloud_runner_logger_1.default.log(`Deleted Stack: ${taskDef.taskDefStackName}`);\n cloud_runner_logger_1.default.log('Cleanup complete');\n }\n}\nexports.default = AWSBuildEnvironment;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GarbageCollectionService = void 0;\nconst aws_sdk_1 = __importDefault(require(\"aws-sdk\"));\nconst input_1 = __importDefault(require(\"../../../../input\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../../../services/core/cloud-runner-logger\"));\nconst task_service_1 = require(\"./task-service\");\nclass GarbageCollectionService {\n static isOlderThan1day(date) {\n const ageDate = new Date(date.getTime() - Date.now());\n return ageDate.getDay() > 0;\n }\n static async cleanup(deleteResources = false, OneDayOlderOnly = false) {\n process.env.AWS_REGION = input_1.default.region;\n const CF = new aws_sdk_1.default.CloudFormation();\n const ecs = new aws_sdk_1.default.ECS();\n const cwl = new aws_sdk_1.default.CloudWatchLogs();\n const taskDefinitionsInUse = new Array();\n const tasks = await task_service_1.TaskService.getTasks();\n for (const task of tasks) {\n const { taskElement, element } = task;\n taskDefinitionsInUse.push(taskElement.taskDefinitionArn);\n if (deleteResources && (!OneDayOlderOnly || GarbageCollectionService.isOlderThan1day(taskElement.createdAt))) {\n cloud_runner_logger_1.default.log(`Stopping task ${taskElement.containers?.[0].name}`);\n await ecs.stopTask({ task: taskElement.taskArn || '', cluster: element }).promise();\n }\n }\n const jobStacks = await task_service_1.TaskService.getCloudFormationJobStacks();\n for (const element of jobStacks) {\n if ((await CF.describeStackResources({ StackName: element.StackName }).promise()).StackResources?.some((x) => x.ResourceType === 'AWS::ECS::TaskDefinition' && taskDefinitionsInUse.includes(x.PhysicalResourceId))) {\n cloud_runner_logger_1.default.log(`Skipping ${element.StackName} - active task was running not deleting`);\n return;\n }\n if (deleteResources && (!OneDayOlderOnly || GarbageCollectionService.isOlderThan1day(element.CreationTime))) {\n if (element.StackName === 'game-ci' || element.TemplateDescription === 'Game-CI base stack') {\n cloud_runner_logger_1.default.log(`Skipping ${element.StackName} ignore list`);\n return;\n }\n cloud_runner_logger_1.default.log(`Deleting ${element.StackName}`);\n const deleteStackInput = { StackName: element.StackName };\n await CF.deleteStack(deleteStackInput).promise();\n }\n }\n const logGroups = await task_service_1.TaskService.getLogGroups();\n for (const element of logGroups) {\n if (deleteResources &&\n (!OneDayOlderOnly || GarbageCollectionService.isOlderThan1day(new Date(element.creationTime)))) {\n cloud_runner_logger_1.default.log(`Deleting ${element.logGroupName}`);\n await cwl.deleteLogGroup({ logGroupName: element.logGroupName || '' }).promise();\n }\n }\n const locks = await task_service_1.TaskService.getLocks();\n for (const element of locks) {\n cloud_runner_logger_1.default.log(`Lock: ${element.Key}`);\n }\n }\n}\nexports.GarbageCollectionService = GarbageCollectionService;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TaskService = void 0;\nconst aws_sdk_1 = __importDefault(require(\"aws-sdk\"));\nconst input_1 = __importDefault(require(\"../../../../input\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../../../services/core/cloud-runner-logger\"));\nconst base_stack_formation_1 = require(\"../cloud-formations/base-stack-formation\");\nconst aws_task_runner_1 = __importDefault(require(\"../aws-task-runner\"));\nconst cloud_runner_1 = __importDefault(require(\"../../../cloud-runner\"));\nclass TaskService {\n static async watch() {\n // eslint-disable-next-line no-unused-vars\n const { output, shouldCleanup } = await aws_task_runner_1.default.streamLogsUntilTaskStops(process.env.cluster || ``, process.env.taskArn || ``, process.env.streamName || ``);\n return output;\n }\n static async getCloudFormationJobStacks() {\n const result = [];\n cloud_runner_logger_1.default.log(``);\n cloud_runner_logger_1.default.log(`List Cloud Formation Stacks`);\n process.env.AWS_REGION = input_1.default.region;\n const CF = new aws_sdk_1.default.CloudFormation();\n const stacks = (await CF.listStacks().promise()).StackSummaries?.filter((_x) => _x.StackStatus !== 'DELETE_COMPLETE' && _x.TemplateDescription !== base_stack_formation_1.BaseStackFormation.baseStackDecription) || [];\n cloud_runner_logger_1.default.log(``);\n cloud_runner_logger_1.default.log(`Cloud Formation Stacks ${stacks.length}`);\n for (const element of stacks) {\n const ageDate = new Date(Date.now() - element.CreationTime.getTime());\n cloud_runner_logger_1.default.log(`Task Stack ${element.StackName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);\n result.push(element);\n }\n const baseStacks = (await CF.listStacks().promise()).StackSummaries?.filter((_x) => _x.StackStatus !== 'DELETE_COMPLETE' && _x.TemplateDescription === base_stack_formation_1.BaseStackFormation.baseStackDecription) || [];\n cloud_runner_logger_1.default.log(``);\n cloud_runner_logger_1.default.log(`Base Stacks ${baseStacks.length}`);\n for (const element of baseStacks) {\n const ageDate = new Date(Date.now() - element.CreationTime.getTime());\n cloud_runner_logger_1.default.log(`Task Stack ${element.StackName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);\n result.push(element);\n }\n cloud_runner_logger_1.default.log(``);\n return result;\n }\n static async getTasks() {\n const result = [];\n cloud_runner_logger_1.default.log(``);\n cloud_runner_logger_1.default.log(`List Tasks`);\n process.env.AWS_REGION = input_1.default.region;\n const ecs = new aws_sdk_1.default.ECS();\n const clusters = (await ecs.listClusters().promise()).clusterArns || [];\n cloud_runner_logger_1.default.log(`Task Clusters ${clusters.length}`);\n for (const element of clusters) {\n const input = {\n cluster: element,\n };\n const list = (await ecs.listTasks(input).promise()).taskArns || [];\n if (list.length > 0) {\n const describeInput = { tasks: list, cluster: element };\n const describeList = (await ecs.describeTasks(describeInput).promise()).tasks || [];\n if (describeList.length === 0) {\n cloud_runner_logger_1.default.log(`No Tasks`);\n continue;\n }\n cloud_runner_logger_1.default.log(`Tasks ${describeList.length}`);\n for (const taskElement of describeList) {\n if (taskElement === undefined) {\n continue;\n }\n taskElement.overrides = {};\n taskElement.attachments = [];\n if (taskElement.createdAt === undefined) {\n cloud_runner_logger_1.default.log(`Skipping ${taskElement.taskDefinitionArn} no createdAt date`);\n continue;\n }\n result.push({ taskElement, element });\n }\n }\n }\n cloud_runner_logger_1.default.log(``);\n return result;\n }\n static async awsDescribeJob(job) {\n process.env.AWS_REGION = input_1.default.region;\n const CF = new aws_sdk_1.default.CloudFormation();\n const stack = (await CF.listStacks().promise()).StackSummaries?.find((_x) => _x.StackName === job) || undefined;\n const stackInfo = (await CF.describeStackResources({ StackName: job }).promise()) || undefined;\n const stackInfo2 = (await CF.describeStacks({ StackName: job }).promise()) || undefined;\n if (stack === undefined) {\n throw new Error('stack not defined');\n }\n const ageDate = new Date(Date.now() - stack.CreationTime.getTime());\n const message = `\n Task Stack ${stack.StackName}\n Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}\n ${JSON.stringify(stack, undefined, 4)}\n ${JSON.stringify(stackInfo, undefined, 4)}\n ${JSON.stringify(stackInfo2, undefined, 4)}\n `;\n cloud_runner_logger_1.default.log(message);\n return message;\n }\n static async getLogGroups() {\n const result = [];\n process.env.AWS_REGION = input_1.default.region;\n const ecs = new aws_sdk_1.default.CloudWatchLogs();\n let logStreamInput = {\n /* logGroupNamePrefix: 'game-ci' */\n };\n let logGroupsDescribe = await ecs.describeLogGroups(logStreamInput).promise();\n const logGroups = logGroupsDescribe.logGroups || [];\n while (logGroupsDescribe.nextToken) {\n logStreamInput = { /* logGroupNamePrefix: 'game-ci',*/ nextToken: logGroupsDescribe.nextToken };\n logGroupsDescribe = await ecs.describeLogGroups(logStreamInput).promise();\n logGroups.push(...(logGroupsDescribe?.logGroups || []));\n }\n cloud_runner_logger_1.default.log(`Log Groups ${logGroups.length}`);\n for (const element of logGroups) {\n if (element.creationTime === undefined) {\n cloud_runner_logger_1.default.log(`Skipping ${element.logGroupName} no createdAt date`);\n continue;\n }\n const ageDate = new Date(Date.now() - element.creationTime);\n cloud_runner_logger_1.default.log(`Task Stack ${element.logGroupName} - Age D${Math.floor(ageDate.getHours() / 24)} H${ageDate.getHours()} M${ageDate.getMinutes()}`);\n result.push(element);\n }\n return result;\n }\n static async getLocks() {\n process.env.AWS_REGION = input_1.default.region;\n const s3 = new aws_sdk_1.default.S3();\n const listRequest = {\n Bucket: cloud_runner_1.default.buildParameters.awsStackName,\n };\n const results = await s3.listObjects(listRequest).promise();\n return results.Contents || [];\n }\n}\nexports.TaskService = TaskService;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst docker_1 = __importDefault(require(\"../../../docker\"));\nconst __1 = require(\"../../..\");\nconst node_fs_1 = require(\"node:fs\");\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nconst cloud_runner_system_1 = require(\"../../services/core/cloud-runner-system\");\nconst fs = __importStar(require(\"node:fs\"));\nconst command_hook_service_1 = require(\"../../services/hooks/command-hook-service\");\nclass LocalDockerCloudRunner {\n listResources() {\n return new Promise((resolve) => resolve([]));\n }\n listWorkflow() {\n throw new Error('Method not implemented.');\n }\n watchWorkflow() {\n throw new Error('Method not implemented.');\n }\n garbageCollect(\n // eslint-disable-next-line no-unused-vars\n filter, \n // eslint-disable-next-line no-unused-vars\n previewOnly, \n // eslint-disable-next-line no-unused-vars\n olderThan, \n // eslint-disable-next-line no-unused-vars\n fullCache, \n // eslint-disable-next-line no-unused-vars\n baseDependencies) {\n return new Promise((result) => result(``));\n }\n async cleanupWorkflow(buildGuid, buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) {\n const { workspace } = __1.Action;\n if (fs.existsSync(`${workspace}/cloud-runner-cache/cache/build/build-${buildParameters.buildGuid}.tar${cloud_runner_1.default.buildParameters.useCompressionStrategy ? '.lz4' : ''}`)) {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`ls ${workspace}/cloud-runner-cache/cache/build/`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`rm -r ${workspace}/cloud-runner-cache/cache/build/build-${buildParameters.buildGuid}.tar${cloud_runner_1.default.buildParameters.useCompressionStrategy ? '.lz4' : ''}`);\n }\n }\n setupWorkflow(buildGuid, buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) {\n this.buildParameters = buildParameters;\n }\n async runTaskInWorkflow(buildGuid, image, commands, mountdir, workingdir, environment, secrets) {\n cloud_runner_logger_1.default.log(buildGuid);\n cloud_runner_logger_1.default.log(commands);\n const { workspace, actionFolder } = __1.Action;\n const content = [];\n for (const x of secrets) {\n content.push({ name: x.EnvironmentVariable, value: x.ParameterValue });\n }\n for (const x of environment) {\n content.push({ name: x.name, value: x.value });\n }\n // if (this.buildParameters?.cloudRunnerIntegrationTests) {\n // core.info(JSON.stringify(content, undefined, 4));\n // core.info(JSON.stringify(secrets, undefined, 4));\n // core.info(JSON.stringify(environment, undefined, 4));\n // }\n // eslint-disable-next-line unicorn/no-for-loop\n for (let index = 0; index < content.length; index++) {\n if (content[index] === undefined) {\n delete content[index];\n }\n }\n let myOutput = '';\n const sharedFolder = `/data/`;\n // core.info(JSON.stringify({ workspace, actionFolder, ...this.buildParameters, ...content }, undefined, 4));\n const entrypointFilePath = `start.sh`;\n const fileContents = `#!/bin/bash\nset -e\n\nmkdir -p /github/workspace/cloud-runner-cache\nmkdir -p /data/cache\ncp -a /github/workspace/cloud-runner-cache/. ${sharedFolder}\n${command_hook_service_1.CommandHookService.ApplyHooksToCommands(commands, this.buildParameters)}\ncp -a ${sharedFolder}. /github/workspace/cloud-runner-cache/\n`;\n (0, node_fs_1.writeFileSync)(`${workspace}/${entrypointFilePath}`, fileContents, {\n flag: 'w',\n });\n if (cloud_runner_1.default.buildParameters.cloudRunnerDebug) {\n cloud_runner_logger_1.default.log(`Running local-docker: \\n ${fileContents}`);\n }\n if (fs.existsSync(`${workspace}/cloud-runner-cache`)) {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`ls ${workspace}/cloud-runner-cache && du -sh ${workspace}/cloud-runner-cache`);\n }\n const exitCode = await docker_1.default.run(image, { workspace, actionFolder, ...this.buildParameters }, false, `chmod +x /github/workspace/${entrypointFilePath} && /github/workspace/${entrypointFilePath}`, content, {\n listeners: {\n stdout: (data) => {\n myOutput += data.toString();\n },\n stderr: (data) => {\n myOutput += `[LOCAL-DOCKER-ERROR]${data.toString()}`;\n },\n },\n }, true);\n // Docker doesn't exit on fail now so adding this to ensure behavior is unchanged\n // TODO: Is there a helpful way to consume the exit code or is it best to except\n if (exitCode !== 0) {\n throw new Error(`Build failed with exit code ${exitCode}`);\n }\n return myOutput;\n }\n}\nexports.default = LocalDockerCloudRunner;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst k8s = __importStar(require(\"@kubernetes/client-node\"));\nconst __1 = require(\"../../..\");\nconst core = __importStar(require(\"@actions/core\"));\nconst kubernetes_storage_1 = __importDefault(require(\"./kubernetes-storage\"));\nconst kubernetes_task_runner_1 = __importDefault(require(\"./kubernetes-task-runner\"));\nconst kubernetes_secret_1 = __importDefault(require(\"./kubernetes-secret\"));\nconst kubernetes_job_spec_factory_1 = __importDefault(require(\"./kubernetes-job-spec-factory\"));\nconst kubernetes_service_account_1 = __importDefault(require(\"./kubernetes-service-account\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nclass Kubernetes {\n // eslint-disable-next-line no-unused-vars\n constructor(buildParameters) {\n this.buildGuid = '';\n this.pvcName = '';\n this.secretName = '';\n this.jobName = '';\n this.podName = '';\n this.containerName = '';\n this.cleanupCronJobName = '';\n this.serviceAccountName = '';\n Kubernetes.Instance = this;\n this.kubeConfig = new k8s.KubeConfig();\n this.kubeConfig.loadFromDefault();\n this.kubeClient = this.kubeConfig.makeApiClient(k8s.CoreV1Api);\n this.kubeClientBatch = this.kubeConfig.makeApiClient(k8s.BatchV1Api);\n this.namespace = 'default';\n cloud_runner_logger_1.default.log('Loaded default Kubernetes configuration for this environment');\n }\n async listResources() {\n const pods = await this.kubeClient.listNamespacedPod(this.namespace);\n const serviceAccounts = await this.kubeClient.listNamespacedServiceAccount(this.namespace);\n const secrets = await this.kubeClient.listNamespacedSecret(this.namespace);\n const jobs = await this.kubeClientBatch.listNamespacedJob(this.namespace);\n return [\n ...pods.body.items.map((x) => {\n return { Name: x.metadata?.name || `` };\n }),\n ...serviceAccounts.body.items.map((x) => {\n return { Name: x.metadata?.name || `` };\n }),\n ...secrets.body.items.map((x) => {\n return { Name: x.metadata?.name || `` };\n }),\n ...jobs.body.items.map((x) => {\n return { Name: x.metadata?.name || `` };\n }),\n ];\n }\n listWorkflow() {\n throw new Error('Method not implemented.');\n }\n watchWorkflow() {\n throw new Error('Method not implemented.');\n }\n garbageCollect(\n // eslint-disable-next-line no-unused-vars\n filter, \n // eslint-disable-next-line no-unused-vars\n previewOnly, \n // eslint-disable-next-line no-unused-vars\n olderThan, \n // eslint-disable-next-line no-unused-vars\n fullCache, \n // eslint-disable-next-line no-unused-vars\n baseDependencies) {\n return new Promise((result) => result(``));\n }\n async setupWorkflow(buildGuid, buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) {\n try {\n this.buildParameters = buildParameters;\n this.cleanupCronJobName = `unity-builder-cronjob-${buildParameters.buildGuid}`;\n this.serviceAccountName = `service-account-${buildParameters.buildGuid}`;\n await kubernetes_service_account_1.default.createServiceAccount(this.serviceAccountName, this.namespace, this.kubeClient);\n }\n catch (error) {\n throw error;\n }\n }\n async runTaskInWorkflow(buildGuid, image, commands, mountdir, workingdir, environment, secrets) {\n try {\n cloud_runner_logger_1.default.log('Cloud Runner K8s workflow!');\n // Setup\n const id = __1.BuildParameters.shouldUseRetainedWorkspaceMode(this.buildParameters)\n ? cloud_runner_1.default.lockedWorkspace\n : this.buildParameters.buildGuid;\n this.pvcName = `unity-builder-pvc-${id}`;\n await kubernetes_storage_1.default.createPersistentVolumeClaim(this.buildParameters, this.pvcName, this.kubeClient, this.namespace);\n this.buildGuid = buildGuid;\n this.secretName = `build-credentials-${this.buildGuid}`;\n this.jobName = `unity-builder-job-${this.buildGuid}`;\n this.containerName = `main`;\n await kubernetes_secret_1.default.createSecret(secrets, this.secretName, this.namespace, this.kubeClient);\n let output = '';\n try {\n cloud_runner_logger_1.default.log('Job does not exist');\n await this.createJob(commands, image, mountdir, workingdir, environment, secrets);\n cloud_runner_logger_1.default.log('Watching pod until running');\n await kubernetes_task_runner_1.default.watchUntilPodRunning(this.kubeClient, this.podName, this.namespace);\n cloud_runner_logger_1.default.log('Pod running, streaming logs');\n cloud_runner_logger_1.default.log(`Starting logs follow for pod: ${this.podName} container: ${this.containerName} namespace: ${this.namespace} pvc: ${this.pvcName} ${cloud_runner_1.default.buildParameters.kubeVolumeSize}/${cloud_runner_1.default.buildParameters.containerCpu}/${cloud_runner_1.default.buildParameters.containerMemory}`);\n output += await kubernetes_task_runner_1.default.runTask(this.kubeConfig, this.kubeClient, this.jobName, this.podName, this.containerName, this.namespace);\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`error running k8s workflow ${error}`);\n await new Promise((resolve) => setTimeout(resolve, 3000));\n cloud_runner_logger_1.default.log(JSON.stringify((await this.kubeClient.listNamespacedEvent(this.namespace)).body.items\n .map((x) => {\n return {\n message: x.message || ``,\n name: x.metadata.name || ``,\n reason: x.reason || ``,\n };\n })\n .filter((x) => x.name.includes(this.podName)), undefined, 4));\n await this.cleanupTaskResources();\n throw error;\n }\n await this.cleanupTaskResources();\n return output;\n }\n catch (error) {\n cloud_runner_logger_1.default.log('Running job failed');\n core.error(JSON.stringify(error, undefined, 4));\n // await this.cleanupTaskResources();\n throw error;\n }\n }\n async createJob(commands, image, mountdir, workingdir, environment, secrets) {\n await this.createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets);\n const find = await Kubernetes.findPodFromJob(this.kubeClient, this.jobName, this.namespace);\n this.setPodNameAndContainerName(find);\n }\n async doesJobExist(name) {\n const jobs = await this.kubeClientBatch.listNamespacedJob(this.namespace);\n return jobs.body.items.some((x) => x.metadata?.name === name);\n }\n async doesFailedJobExist() {\n const podStatus = await this.kubeClient.readNamespacedPodStatus(this.podName, this.namespace);\n return podStatus.body.status?.phase === `Failed`;\n }\n async createNamespacedJob(commands, image, mountdir, workingdir, environment, secrets) {\n for (let index = 0; index < 3; index++) {\n try {\n const jobSpec = kubernetes_job_spec_factory_1.default.getJobSpec(commands, image, mountdir, workingdir, environment, secrets, this.buildGuid, this.buildParameters, this.secretName, this.pvcName, this.jobName, k8s, this.containerName);\n await new Promise((promise) => setTimeout(promise, 15000));\n const result = await this.kubeClientBatch.createNamespacedJob(this.namespace, jobSpec);\n cloud_runner_logger_1.default.log(`Build job created`);\n await new Promise((promise) => setTimeout(promise, 5000));\n cloud_runner_logger_1.default.log('Job created');\n return result.body.metadata?.name;\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`Error occured creating job: ${error}`);\n throw error;\n }\n }\n }\n setPodNameAndContainerName(pod) {\n this.podName = pod.metadata?.name || '';\n this.containerName = pod.status?.containerStatuses?.[0].name || this.containerName;\n }\n async cleanupTaskResources() {\n cloud_runner_logger_1.default.log('cleaning up');\n try {\n await this.kubeClientBatch.deleteNamespacedJob(this.jobName, this.namespace);\n await this.kubeClient.deleteNamespacedPod(this.podName, this.namespace);\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`Failed to cleanup`);\n if (error.response.body.reason !== `NotFound`) {\n cloud_runner_logger_1.default.log(`Wasn't a not found error: ${error.response.body.reason}`);\n throw error;\n }\n }\n try {\n await this.kubeClient.deleteNamespacedSecret(this.secretName, this.namespace);\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`Failed to cleanup secret`);\n cloud_runner_logger_1.default.log(error.response.body.reason);\n }\n cloud_runner_logger_1.default.log('cleaned up Secret, Job and Pod');\n cloud_runner_logger_1.default.log('cleaning up finished');\n }\n async cleanupWorkflow(buildGuid, buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) {\n if (__1.BuildParameters.shouldUseRetainedWorkspaceMode(buildParameters)) {\n return;\n }\n cloud_runner_logger_1.default.log(`deleting PVC`);\n try {\n await this.kubeClient.deleteNamespacedPersistentVolumeClaim(this.pvcName, this.namespace);\n await this.kubeClient.deleteNamespacedServiceAccount(this.serviceAccountName, this.namespace);\n cloud_runner_logger_1.default.log('cleaned up PVC and Service Account');\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`Cleanup failed ${JSON.stringify(error, undefined, 4)}`);\n throw error;\n }\n }\n static async findPodFromJob(kubeClient, jobName, namespace) {\n const namespacedPods = await kubeClient.listNamespacedPod(namespace);\n const pod = namespacedPods.body.items.find((x) => x.metadata?.labels?.['job-name'] === jobName);\n if (pod === undefined) {\n throw new Error(\"pod with job-name label doesn't exist\");\n }\n return pod;\n }\n}\nexports.default = Kubernetes;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst client_node_1 = require(\"@kubernetes/client-node\");\nconst command_hook_service_1 = require(\"../../services/hooks/command-hook-service\");\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nclass KubernetesJobSpecFactory {\n static getJobSpec(command, image, mountdir, workingDirectory, environment, secrets, buildGuid, buildParameters, secretName, pvcName, jobName, k8s, containerName) {\n const job = new k8s.V1Job();\n job.apiVersion = 'batch/v1';\n job.kind = 'Job';\n job.metadata = {\n name: jobName,\n labels: {\n app: 'unity-builder',\n buildGuid,\n },\n };\n job.spec = {\n ttlSecondsAfterFinished: 9999,\n backoffLimit: 0,\n template: {\n spec: {\n volumes: [\n {\n name: 'build-mount',\n persistentVolumeClaim: {\n claimName: pvcName,\n },\n },\n ],\n containers: [\n {\n ttlSecondsAfterFinished: 9999,\n name: containerName,\n image,\n command: ['/bin/sh'],\n args: [\n '-c',\n `${command_hook_service_1.CommandHookService.ApplyHooksToCommands(`${command}\\nsleep 2m`, cloud_runner_1.default.buildParameters)}`,\n ],\n workingDir: `${workingDirectory}`,\n resources: {\n requests: {\n memory: `${Number.parseInt(buildParameters.containerMemory) / 1024}G` || '750M',\n cpu: Number.parseInt(buildParameters.containerCpu) / 1024 || '1',\n },\n },\n env: [\n ...environment.map((x) => {\n const environmentVariable = new client_node_1.V1EnvVar();\n environmentVariable.name = x.name;\n environmentVariable.value = x.value;\n return environmentVariable;\n }),\n ...secrets.map((x) => {\n const secret = new client_node_1.V1EnvVarSource();\n secret.secretKeyRef = new client_node_1.V1SecretKeySelector();\n secret.secretKeyRef.key = x.ParameterKey;\n secret.secretKeyRef.name = secretName;\n const environmentVariable = new client_node_1.V1EnvVar();\n environmentVariable.name = x.EnvironmentVariable;\n environmentVariable.valueFrom = secret;\n return environmentVariable;\n }),\n ],\n volumeMounts: [\n {\n name: 'build-mount',\n mountPath: `${mountdir}`,\n },\n ],\n lifecycle: {\n preStop: {\n exec: {\n command: [\n 'bin/bash',\n '-c',\n `cd /data/builder/action/steps;\n chmod +x /return_license.sh;\n /return_license.sh;`,\n ],\n },\n },\n },\n },\n ],\n restartPolicy: 'Never',\n },\n },\n };\n job.spec.template.spec.containers[0].resources.requests[`ephemeral-storage`] = '10Gi';\n return job;\n }\n}\nexports.default = KubernetesJobSpecFactory;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nclass KubernetesPods {\n static async IsPodRunning(podName, namespace, kubeClient) {\n const pods = (await kubeClient.listNamespacedPod(namespace)).body.items.filter((x) => podName === x.metadata?.name);\n const running = pods.length > 0 && (pods[0].status?.phase === `Running` || pods[0].status?.phase === `Pending`);\n const phase = pods[0]?.status?.phase || 'undefined status';\n cloud_runner_logger_1.default.log(`Getting pod status: ${phase}`);\n if (phase === `Failed`) {\n throw new Error(`K8s pod failed`);\n }\n return running;\n }\n static async GetPodStatus(podName, namespace, kubeClient) {\n const pods = (await kubeClient.listNamespacedPod(namespace)).body.items.find((x) => podName === x.metadata?.name);\n const phase = pods?.status?.phase || 'undefined status';\n return phase;\n }\n}\nexports.default = KubernetesPods;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst k8s = __importStar(require(\"@kubernetes/client-node\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst base64 = __importStar(require(\"base-64\"));\nclass KubernetesSecret {\n static async createSecret(secrets, secretName, namespace, kubeClient) {\n try {\n const secret = new k8s.V1Secret();\n secret.apiVersion = 'v1';\n secret.kind = 'Secret';\n secret.type = 'Opaque';\n secret.metadata = {\n name: secretName,\n };\n secret.data = {};\n for (const buildSecret of secrets) {\n secret.data[buildSecret.ParameterKey] = base64.encode(buildSecret.ParameterValue);\n }\n cloud_runner_logger_1.default.log(`Creating secret: ${secretName}`);\n const existingSecrets = await kubeClient.listNamespacedSecret(namespace);\n const mappedSecrets = existingSecrets.body.items.map((x) => {\n return x.metadata?.name || `no name`;\n });\n cloud_runner_logger_1.default.log(`ExistsAlready: ${mappedSecrets.includes(secretName)} SecretsCount: ${mappedSecrets.length}`);\n await new Promise((promise) => setTimeout(promise, 15000));\n await kubeClient.createNamespacedSecret(namespace, secret);\n cloud_runner_logger_1.default.log('Created secret');\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`Created secret failed ${error}`);\n throw new Error(`Failed to create kubernetes secret`);\n }\n }\n}\nexports.default = KubernetesSecret;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst k8s = __importStar(require(\"@kubernetes/client-node\"));\nclass KubernetesServiceAccount {\n static async createServiceAccount(serviceAccountName, namespace, kubeClient) {\n const serviceAccount = new k8s.V1ServiceAccount();\n serviceAccount.apiVersion = 'v1';\n serviceAccount.kind = 'ServiceAccount';\n serviceAccount.metadata = {\n name: serviceAccountName,\n };\n serviceAccount.automountServiceAccountToken = false;\n return kubeClient.createNamespacedServiceAccount(namespace, serviceAccount);\n }\n}\nexports.default = KubernetesServiceAccount;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst async_wait_until_1 = require(\"async-wait-until\");\nconst core = __importStar(require(\"@actions/core\"));\nconst k8s = __importStar(require(\"@kubernetes/client-node\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst github_1 = __importDefault(require(\"../../../github\"));\nclass KubernetesStorage {\n static async createPersistentVolumeClaim(buildParameters, pvcName, kubeClient, namespace) {\n if (buildParameters.kubeVolume !== ``) {\n cloud_runner_logger_1.default.log(`Kube Volume was input was set ${buildParameters.kubeVolume} overriding ${pvcName}`);\n pvcName = buildParameters.kubeVolume;\n return;\n }\n const allPvc = (await kubeClient.listNamespacedPersistentVolumeClaim(namespace)).body.items;\n const pvcList = allPvc.map((x) => x.metadata?.name);\n cloud_runner_logger_1.default.log(`Current PVCs in namespace ${namespace}`);\n cloud_runner_logger_1.default.log(JSON.stringify(pvcList, undefined, 4));\n if (pvcList.includes(pvcName)) {\n cloud_runner_logger_1.default.log(`pvc ${pvcName} already exists`);\n if (github_1.default.githubInputEnabled) {\n core.setOutput('volume', pvcName);\n }\n return;\n }\n cloud_runner_logger_1.default.log(`Creating PVC ${pvcName} (does not exist)`);\n const result = await KubernetesStorage.createPVC(pvcName, buildParameters, kubeClient, namespace);\n await KubernetesStorage.handleResult(result, kubeClient, namespace, pvcName);\n }\n static async getPVCPhase(kubeClient, name, namespace) {\n try {\n return (await kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body.status?.phase;\n }\n catch (error) {\n core.error('Failed to get PVC phase');\n core.error(JSON.stringify(error, undefined, 4));\n throw error;\n }\n }\n static async watchUntilPVCNotPending(kubeClient, name, namespace) {\n try {\n cloud_runner_logger_1.default.log(`watch Until PVC Not Pending ${name} ${namespace}`);\n cloud_runner_logger_1.default.log(`${await this.getPVCPhase(kubeClient, name, namespace)}`);\n await (0, async_wait_until_1.waitUntil)(async () => {\n return (await this.getPVCPhase(kubeClient, name, namespace)) === 'Pending';\n }, {\n timeout: 750000,\n intervalBetweenAttempts: 15000,\n });\n }\n catch (error) {\n core.error('Failed to watch PVC');\n core.error(error.toString());\n core.error(`PVC Body: ${JSON.stringify((await kubeClient.readNamespacedPersistentVolumeClaim(name, namespace)).body, undefined, 4)}`);\n throw error;\n }\n }\n static async createPVC(pvcName, buildParameters, kubeClient, namespace) {\n const pvc = new k8s.V1PersistentVolumeClaim();\n pvc.apiVersion = 'v1';\n pvc.kind = 'PersistentVolumeClaim';\n pvc.metadata = {\n name: pvcName,\n };\n pvc.spec = {\n accessModes: ['ReadWriteOnce'],\n storageClassName: buildParameters.kubeStorageClass === '' ? 'standard' : buildParameters.kubeStorageClass,\n resources: {\n requests: {\n storage: buildParameters.kubeVolumeSize,\n },\n },\n };\n const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc);\n return result;\n }\n static async handleResult(result, kubeClient, namespace, pvcName) {\n const name = result.body.metadata?.name || '';\n cloud_runner_logger_1.default.log(`PVC ${name} created`);\n await this.watchUntilPVCNotPending(kubeClient, name, namespace);\n cloud_runner_logger_1.default.log(`PVC ${name} is ready and not pending`);\n core.setOutput('volume', pvcName);\n }\n}\nexports.default = KubernetesStorage;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nconst async_wait_until_1 = require(\"async-wait-until\");\nconst cloud_runner_system_1 = require(\"../../services/core/cloud-runner-system\");\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nconst kubernetes_pods_1 = __importDefault(require(\"./kubernetes-pods\"));\nconst follow_log_stream_service_1 = require(\"../../services/core/follow-log-stream-service\");\nclass KubernetesTaskRunner {\n static async runTask(kubeConfig, kubeClient, jobName, podName, containerName, namespace) {\n let output = '';\n let shouldReadLogs = true;\n let shouldCleanup = true;\n let sinceTime = ``;\n let retriesAfterFinish = 0;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n await new Promise((resolve) => setTimeout(resolve, 3000));\n const lastReceivedMessage = KubernetesTaskRunner.lastReceivedTimestamp > 0\n ? `\\nLast Log Message \"${this.lastReceivedMessage}\" ${this.lastReceivedTimestamp}`\n : ``;\n cloud_runner_logger_1.default.log(`Streaming logs from pod: ${podName} container: ${containerName} namespace: ${namespace} ${cloud_runner_1.default.buildParameters.kubeVolumeSize}/${cloud_runner_1.default.buildParameters.containerCpu}/${cloud_runner_1.default.buildParameters.containerMemory}\\n${lastReceivedMessage}`);\n if (KubernetesTaskRunner.lastReceivedTimestamp > 0) {\n const currentDate = new Date(KubernetesTaskRunner.lastReceivedTimestamp);\n const dateTimeIsoString = currentDate.toISOString();\n sinceTime = ` --since-time=\"${dateTimeIsoString}\"`;\n }\n let extraFlags = ``;\n extraFlags += (await kubernetes_pods_1.default.IsPodRunning(podName, namespace, kubeClient))\n ? ` -f -c ${containerName}`\n : ` --previous`;\n let lastMessageSeenIncludedInChunk = false;\n let lastMessageSeen = false;\n let logs;\n try {\n logs = await cloud_runner_system_1.CloudRunnerSystem.Run(`kubectl logs ${podName}${extraFlags} --timestamps${sinceTime}`, false, true);\n }\n catch (error) {\n await new Promise((resolve) => setTimeout(resolve, 3000));\n const continueStreaming = await kubernetes_pods_1.default.IsPodRunning(podName, namespace, kubeClient);\n cloud_runner_logger_1.default.log(`K8s logging error ${error} ${continueStreaming}`);\n if (continueStreaming) {\n continue;\n }\n if (retriesAfterFinish < KubernetesTaskRunner.maxRetry) {\n retriesAfterFinish++;\n continue;\n }\n throw error;\n }\n const splitLogs = logs.split(`\\n`);\n for (const chunk of splitLogs) {\n if (chunk.replace(/\\s/g, ``) === KubernetesTaskRunner.lastReceivedMessage.replace(/\\s/g, ``) &&\n KubernetesTaskRunner.lastReceivedMessage.replace(/\\s/g, ``) !== ``) {\n cloud_runner_logger_1.default.log(`Previous log message found ${chunk}`);\n lastMessageSeenIncludedInChunk = true;\n }\n }\n for (const chunk of splitLogs) {\n const newDate = Date.parse(`${chunk.toString().split(`Z `)[0]}Z`);\n if (chunk.replace(/\\s/g, ``) === KubernetesTaskRunner.lastReceivedMessage.replace(/\\s/g, ``)) {\n lastMessageSeen = true;\n }\n if (lastMessageSeenIncludedInChunk && !lastMessageSeen) {\n continue;\n }\n const message = cloud_runner_1.default.buildParameters.cloudRunnerDebug ? chunk : chunk.split(`Z `)[1];\n KubernetesTaskRunner.lastReceivedMessage = chunk;\n KubernetesTaskRunner.lastReceivedTimestamp = newDate;\n ({ shouldReadLogs, shouldCleanup, output } = follow_log_stream_service_1.FollowLogStreamService.handleIteration(message, shouldReadLogs, shouldCleanup, output));\n }\n if (follow_log_stream_service_1.FollowLogStreamService.DidReceiveEndOfTransmission) {\n cloud_runner_logger_1.default.log('end of log stream');\n break;\n }\n }\n return output;\n }\n static async watchUntilPodRunning(kubeClient, podName, namespace) {\n let success = false;\n let message = ``;\n cloud_runner_logger_1.default.log(`Watching ${podName} ${namespace}`);\n await (0, async_wait_until_1.waitUntil)(async () => {\n const status = await kubeClient.readNamespacedPodStatus(podName, namespace);\n const phase = status?.body.status?.phase;\n success = phase === 'Running';\n message = `Phase:${status.body.status?.phase} \\n Reason:${status.body.status?.conditions?.[0].reason || ''} \\n Message:${status.body.status?.conditions?.[0].message || ''}`;\n // CloudRunnerLogger.log(\n // JSON.stringify(\n // (await kubeClient.listNamespacedEvent(namespace)).body.items\n // .map((x) => {\n // return {\n // message: x.message || ``,\n // name: x.metadata.name || ``,\n // reason: x.reason || ``,\n // };\n // })\n // .filter((x) => x.name.includes(podName)),\n // undefined,\n // 4,\n // ),\n // );\n if (success || phase !== 'Pending')\n return true;\n return false;\n }, {\n timeout: 2000000,\n intervalBetweenAttempts: 15000,\n });\n if (!success) {\n cloud_runner_logger_1.default.log(message);\n }\n return success;\n }\n}\nKubernetesTaskRunner.lastReceivedTimestamp = 0;\nKubernetesTaskRunner.maxRetry = 3;\nKubernetesTaskRunner.lastReceivedMessage = ``;\nexports.default = KubernetesTaskRunner;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cloud_runner_system_1 = require(\"../../services/core/cloud-runner-system\");\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nclass LocalCloudRunner {\n listResources() {\n throw new Error('Method not implemented.');\n }\n listWorkflow() {\n throw new Error('Method not implemented.');\n }\n watchWorkflow() {\n throw new Error('Method not implemented.');\n }\n garbageCollect(\n // eslint-disable-next-line no-unused-vars\n filter, \n // eslint-disable-next-line no-unused-vars\n previewOnly, \n // eslint-disable-next-line no-unused-vars\n olderThan, \n // eslint-disable-next-line no-unused-vars\n fullCache, \n // eslint-disable-next-line no-unused-vars\n baseDependencies) {\n throw new Error('Method not implemented.');\n }\n cleanupWorkflow(\n // eslint-disable-next-line no-unused-vars\n buildGuid, \n // eslint-disable-next-line no-unused-vars\n buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) { }\n setupWorkflow(\n // eslint-disable-next-line no-unused-vars\n buildGuid, \n // eslint-disable-next-line no-unused-vars\n buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) { }\n async runTaskInWorkflow(buildGuid, image, commands, \n // eslint-disable-next-line no-unused-vars\n mountdir, \n // eslint-disable-next-line no-unused-vars\n workingdir, \n // eslint-disable-next-line no-unused-vars\n environment, \n // eslint-disable-next-line no-unused-vars\n secrets) {\n cloud_runner_logger_1.default.log(image);\n cloud_runner_logger_1.default.log(buildGuid);\n cloud_runner_logger_1.default.log(commands);\n return await cloud_runner_system_1.CloudRunnerSystem.Run(commands);\n }\n}\nexports.default = LocalCloudRunner;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cloud_runner_logger_1 = __importDefault(require(\"../../services/core/cloud-runner-logger\"));\nclass TestCloudRunner {\n listResources() {\n throw new Error('Method not implemented.');\n }\n listWorkflow() {\n throw new Error('Method not implemented.');\n }\n watchWorkflow() {\n throw new Error('Method not implemented.');\n }\n garbageCollect(\n // eslint-disable-next-line no-unused-vars\n filter, \n // eslint-disable-next-line no-unused-vars\n previewOnly) {\n throw new Error('Method not implemented.');\n }\n cleanupWorkflow(\n // eslint-disable-next-line no-unused-vars\n buildGuid, \n // eslint-disable-next-line no-unused-vars\n buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) { }\n setupWorkflow(\n // eslint-disable-next-line no-unused-vars\n buildGuid, \n // eslint-disable-next-line no-unused-vars\n buildParameters, \n // eslint-disable-next-line no-unused-vars\n branchName, \n // eslint-disable-next-line no-unused-vars\n defaultSecretsArray) { }\n async runTaskInWorkflow(commands, buildGuid, image, \n // eslint-disable-next-line no-unused-vars\n mountdir, \n // eslint-disable-next-line no-unused-vars\n workingdir, \n // eslint-disable-next-line no-unused-vars\n environment, \n // eslint-disable-next-line no-unused-vars\n secrets) {\n cloud_runner_logger_1.default.log(image);\n cloud_runner_logger_1.default.log(buildGuid);\n cloud_runner_logger_1.default.log(commands);\n return await new Promise((result) => {\n result(commands);\n });\n }\n}\nexports.default = TestCloudRunner;\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Caching = void 0;\nconst node_console_1 = require(\"node:console\");\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst cloud_runner_1 = __importDefault(require(\"../cloud-runner\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../services/core/cloud-runner-logger\"));\nconst cloud_runner_folders_1 = require(\"../options/cloud-runner-folders\");\nconst cloud_runner_system_1 = require(\"../services/core/cloud-runner-system\");\nconst lfs_hashing_1 = require(\"../services/utility/lfs-hashing\");\nconst remote_client_logger_1 = require(\"./remote-client-logger\");\nconst cli_1 = require(\"../../cli/cli\");\nconst cli_functions_repository_1 = require(\"../../cli/cli-functions-repository\");\n// eslint-disable-next-line github/no-then\nconst fileExists = async (fpath) => !!(await node_fs_1.default.promises.stat(fpath).catch(() => false));\nclass Caching {\n static async cachePush() {\n try {\n const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');\n cloud_runner_1.default.buildParameters = buildParameter;\n await Caching.PushToCache(cli_1.Cli.options['cachePushTo'], cli_1.Cli.options['cachePushFrom'], cli_1.Cli.options['artifactName'] || '');\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`${error}`);\n }\n }\n static async cachePull() {\n try {\n const buildParameter = JSON.parse(process.env.BUILD_PARAMETERS || '{}');\n cloud_runner_1.default.buildParameters = buildParameter;\n await Caching.PullFromCache(cli_1.Cli.options['cachePushFrom'], cli_1.Cli.options['cachePushTo'], cli_1.Cli.options['artifactName'] || '');\n }\n catch (error) {\n cloud_runner_logger_1.default.log(`${error}`);\n }\n }\n static async PushToCache(cacheFolder, sourceFolder, cacheArtifactName) {\n cloud_runner_logger_1.default.log(`Pushing to cache ${sourceFolder}`);\n cacheArtifactName = cacheArtifactName.replace(' ', '');\n const startPath = process.cwd();\n let compressionSuffix = '';\n if (cloud_runner_1.default.buildParameters.useCompressionStrategy === true) {\n compressionSuffix = `.lz4`;\n }\n cloud_runner_logger_1.default.log(`Compression: ${cloud_runner_1.default.buildParameters.useCompressionStrategy} ${compressionSuffix}`);\n try {\n if (!(await fileExists(cacheFolder))) {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cacheFolder}`);\n }\n process.chdir(node_path_1.default.resolve(sourceFolder, '..'));\n if (cloud_runner_1.default.buildParameters.cloudRunnerDebug === true) {\n cloud_runner_logger_1.default.log(`Hashed cache folder ${await lfs_hashing_1.LfsHashing.hashAllFiles(sourceFolder)} ${sourceFolder} ${node_path_1.default.basename(sourceFolder)}`);\n }\n const contents = await node_fs_1.default.promises.readdir(node_path_1.default.basename(sourceFolder));\n cloud_runner_logger_1.default.log(`There is ${contents.length} files/dir in the source folder ${node_path_1.default.basename(sourceFolder)}`);\n if (contents.length === 0) {\n cloud_runner_logger_1.default.log(`Did not push source folder to cache because it was empty ${node_path_1.default.basename(sourceFolder)}`);\n process.chdir(`${startPath}`);\n return;\n }\n await cloud_runner_system_1.CloudRunnerSystem.Run(`tar -cf ${cacheArtifactName}.tar${compressionSuffix} ${node_path_1.default.basename(sourceFolder)}`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`du ${cacheArtifactName}.tar${compressionSuffix}`);\n (0, node_console_1.assert)(await fileExists(`${cacheArtifactName}.tar${compressionSuffix}`), 'cache archive exists');\n (0, node_console_1.assert)(await fileExists(node_path_1.default.basename(sourceFolder)), 'source folder exists');\n await cloud_runner_system_1.CloudRunnerSystem.Run(`mv ${cacheArtifactName}.tar${compressionSuffix} ${cacheFolder}`);\n remote_client_logger_1.RemoteClientLogger.log(`moved cache entry ${cacheArtifactName} to ${cacheFolder}`);\n (0, node_console_1.assert)(await fileExists(`${node_path_1.default.join(cacheFolder, cacheArtifactName)}.tar${compressionSuffix}`), 'cache archive exists inside cache folder');\n }\n catch (error) {\n process.chdir(`${startPath}`);\n throw error;\n }\n process.chdir(`${startPath}`);\n }\n static async PullFromCache(cacheFolder, destinationFolder, cacheArtifactName = ``) {\n cloud_runner_logger_1.default.log(`Pulling from cache ${destinationFolder} ${cloud_runner_1.default.buildParameters.skipCache}`);\n if (`${cloud_runner_1.default.buildParameters.skipCache}` === `true`) {\n cloud_runner_logger_1.default.log(`Skipping cache debugSkipCache is true`);\n return;\n }\n cacheArtifactName = cacheArtifactName.replace(' ', '');\n let compressionSuffix = '';\n if (cloud_runner_1.default.buildParameters.useCompressionStrategy === true) {\n compressionSuffix = `.lz4`;\n }\n const startPath = process.cwd();\n remote_client_logger_1.RemoteClientLogger.log(`Caching for (lz4 ${compressionSuffix}) ${node_path_1.default.basename(destinationFolder)}`);\n try {\n if (!(await fileExists(cacheFolder))) {\n await node_fs_1.default.promises.mkdir(cacheFolder);\n }\n if (!(await fileExists(destinationFolder))) {\n await node_fs_1.default.promises.mkdir(destinationFolder);\n }\n const latestInBranch = await (await cloud_runner_system_1.CloudRunnerSystem.Run(`ls -t \"${cacheFolder}\" | grep .tar${compressionSuffix}$ | head -1`))\n .replace(/\\n/g, ``)\n .replace(`.tar${compressionSuffix}`, '');\n process.chdir(cacheFolder);\n const cacheSelection = cacheArtifactName !== `` && (await fileExists(`${cacheArtifactName}.tar${compressionSuffix}`))\n ? cacheArtifactName\n : latestInBranch;\n await cloud_runner_logger_1.default.log(`cache key ${cacheArtifactName} selection ${cacheSelection}`);\n if (await fileExists(`${cacheSelection}.tar${compressionSuffix}`)) {\n const resultsFolder = `results${cloud_runner_1.default.buildParameters.buildGuid}`;\n await cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${resultsFolder}`);\n remote_client_logger_1.RemoteClientLogger.log(`cache item exists ${cacheFolder}/${cacheSelection}.tar${compressionSuffix}`);\n const fullResultsFolder = node_path_1.default.join(cacheFolder, resultsFolder);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`tar -xf ${cacheSelection}.tar${compressionSuffix} -C ${fullResultsFolder}`);\n remote_client_logger_1.RemoteClientLogger.log(`cache item extracted to ${fullResultsFolder}`);\n (0, node_console_1.assert)(await fileExists(fullResultsFolder), `cache extraction results folder exists`);\n const destinationParentFolder = node_path_1.default.resolve(destinationFolder, '..');\n if (await fileExists(destinationFolder)) {\n await node_fs_1.default.promises.rmdir(destinationFolder, { recursive: true });\n }\n await cloud_runner_system_1.CloudRunnerSystem.Run(`mv \"${node_path_1.default.join(fullResultsFolder, node_path_1.default.basename(destinationFolder))}\" \"${destinationParentFolder}\"`);\n const contents = await node_fs_1.default.promises.readdir(node_path_1.default.join(destinationParentFolder, node_path_1.default.basename(destinationFolder)));\n cloud_runner_logger_1.default.log(`There is ${contents.length} files/dir in the cache pulled contents for ${node_path_1.default.basename(destinationFolder)}`);\n }\n else {\n remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheArtifactName} doesn't exist ${destinationFolder}`);\n if (cacheSelection !== ``) {\n remote_client_logger_1.RemoteClientLogger.logWarning(`cache item ${cacheArtifactName}.tar${compressionSuffix} doesn't exist ${destinationFolder}`);\n throw new Error(`Failed to get cache item, but cache hit was found: ${cacheSelection}`);\n }\n }\n }\n catch (error) {\n process.chdir(startPath);\n throw error;\n }\n process.chdir(startPath);\n }\n static async handleCachePurging() {\n if (process.env.PURGE_REMOTE_BUILDER_CACHE !== undefined) {\n remote_client_logger_1.RemoteClientLogger.log(`purging ${cloud_runner_folders_1.CloudRunnerFolders.purgeRemoteCaching}`);\n node_fs_1.default.promises.rmdir(cloud_runner_folders_1.CloudRunnerFolders.cacheFolder, { recursive: true });\n }\n }\n}\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`cache-push`, `push to cache`)\n], Caching, \"cachePush\", null);\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`cache-pull`, `pull from cache`)\n], Caching, \"cachePull\", null);\nexports.Caching = Caching;\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RemoteClient = void 0;\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst cloud_runner_1 = __importDefault(require(\"../cloud-runner\"));\nconst cloud_runner_folders_1 = require(\"../options/cloud-runner-folders\");\nconst caching_1 = require(\"./caching\");\nconst lfs_hashing_1 = require(\"../services/utility/lfs-hashing\");\nconst remote_client_logger_1 = require(\"./remote-client-logger\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst node_console_1 = require(\"node:console\");\nconst cloud_runner_logger_1 = __importDefault(require(\"../services/core/cloud-runner-logger\"));\nconst cli_functions_repository_1 = require(\"../../cli/cli-functions-repository\");\nconst cloud_runner_system_1 = require(\"../services/core/cloud-runner-system\");\nconst yaml_1 = __importDefault(require(\"yaml\"));\nconst github_1 = __importDefault(require(\"../../github\"));\nconst build_parameters_1 = __importDefault(require(\"../../build-parameters\"));\nclass RemoteClient {\n static async runRemoteClientJob() {\n cloud_runner_logger_1.default.log(`bootstrap game ci cloud runner...`);\n if (!(await RemoteClient.handleRetainedWorkspace())) {\n await RemoteClient.bootstrapRepository();\n }\n await RemoteClient.runCustomHookFiles(`before-build`);\n }\n static async runCustomHookFiles(hookLifecycle) {\n remote_client_logger_1.RemoteClientLogger.log(`RunCustomHookFiles: ${hookLifecycle}`);\n const gameCiCustomHooksPath = node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `game-ci`, `hooks`);\n try {\n const files = node_fs_1.default.readdirSync(gameCiCustomHooksPath);\n for (const file of files) {\n const fileContents = node_fs_1.default.readFileSync(node_path_1.default.join(gameCiCustomHooksPath, file), `utf8`);\n const fileContentsObject = yaml_1.default.parse(fileContents.toString());\n if (fileContentsObject.hook === hookLifecycle) {\n remote_client_logger_1.RemoteClientLogger.log(`Active Hook File ${file} \\n \\n file contents: \\n ${fileContents}`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(fileContentsObject.commands);\n }\n }\n }\n catch (error) {\n remote_client_logger_1.RemoteClientLogger.log(JSON.stringify(error, undefined, 4));\n }\n }\n static async bootstrapRepository() {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`mkdir -p ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.cacheFolderForCacheKeyFull)}`);\n await RemoteClient.cloneRepoWithoutLFSFiles();\n await RemoteClient.replaceLargePackageReferencesWithSharedReferences();\n await RemoteClient.sizeOfFolder('repo before lfs cache pull', cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute));\n const lfsHashes = await lfs_hashing_1.LfsHashing.createLFSHashFiles();\n if (node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.libraryFolderAbsolute)) {\n remote_client_logger_1.RemoteClientLogger.logWarning(`!Warning!: The Unity library was included in the git repository`);\n }\n await caching_1.Caching.PullFromCache(cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.lfsCacheFolderFull), cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.lfsFolderAbsolute), `${lfsHashes.lfsGuidSum}`);\n await RemoteClient.sizeOfFolder('repo after lfs cache pull', cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute);\n await RemoteClient.pullLatestLFS();\n await RemoteClient.sizeOfFolder('repo before lfs git pull', cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute);\n await caching_1.Caching.PushToCache(cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.lfsCacheFolderFull), cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.lfsFolderAbsolute), `${lfsHashes.lfsGuidSum}`);\n await caching_1.Caching.PullFromCache(cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.libraryCacheFolderFull), cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.libraryFolderAbsolute));\n await RemoteClient.sizeOfFolder('repo after library cache pull', cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute);\n await caching_1.Caching.handleCachePurging();\n }\n static async sizeOfFolder(message, folder) {\n if (cloud_runner_1.default.buildParameters.cloudRunnerDebug) {\n cloud_runner_logger_1.default.log(`Size of ${message}`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`du -sh ${folder}`);\n }\n }\n static async cloneRepoWithoutLFSFiles() {\n process.chdir(`${cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute}`);\n if (node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute) &&\n !node_fs_1.default.existsSync(node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.git`))) {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`rm -r ${cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute}`);\n cloud_runner_logger_1.default.log(`${cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute} repo exists, but no git folder, cleaning up`);\n }\n if (build_parameters_1.default.shouldUseRetainedWorkspaceMode(cloud_runner_1.default.buildParameters) &&\n node_fs_1.default.existsSync(node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.git`))) {\n process.chdir(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute);\n remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute} repo exists - skipping clone - retained workspace mode ${build_parameters_1.default.shouldUseRetainedWorkspaceMode(cloud_runner_1.default.buildParameters)}`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git fetch && git reset --hard ${cloud_runner_1.default.buildParameters.gitSha}`);\n return;\n }\n remote_client_logger_1.RemoteClientLogger.log(`Initializing source repository for cloning with caching of LFS files`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global advice.detachedHead false`);\n remote_client_logger_1.RemoteClientLogger.log(`Cloning the repository being built:`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.smudge \"git-lfs smudge --skip -- %f\"`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.process \"git-lfs filter-process --skip\"`);\n try {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git clone ${cloud_runner_folders_1.CloudRunnerFolders.targetBuildRepoUrl} ${node_path_1.default.basename(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute)}`);\n }\n catch (error) {\n throw error;\n }\n process.chdir(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs install`);\n (0, node_console_1.assert)(node_fs_1.default.existsSync(`.git`), 'git folder exists');\n remote_client_logger_1.RemoteClientLogger.log(`${cloud_runner_1.default.buildParameters.branch}`);\n if (cloud_runner_1.default.buildParameters.gitSha !== undefined) {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_1.default.buildParameters.gitSha}`);\n }\n else {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_1.default.buildParameters.branch}`);\n remote_client_logger_1.RemoteClientLogger.log(`buildParameter Git Sha is empty`);\n }\n (0, node_console_1.assert)(node_fs_1.default.existsSync(node_path_1.default.join(`.git`, `lfs`)), 'LFS folder should not exist before caching');\n remote_client_logger_1.RemoteClientLogger.log(`Checked out ${cloud_runner_1.default.buildParameters.branch}`);\n }\n static async replaceLargePackageReferencesWithSharedReferences() {\n cloud_runner_logger_1.default.log(`Use Shared Pkgs ${cloud_runner_1.default.buildParameters.useLargePackages}`);\n github_1.default.updateGitHubCheck(`Use Shared Pkgs ${cloud_runner_1.default.buildParameters.useLargePackages}`, ``);\n if (cloud_runner_1.default.buildParameters.useLargePackages) {\n const filePath = node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.projectPathAbsolute, `Packages/manifest.json`);\n let manifest = node_fs_1.default.readFileSync(filePath, 'utf8');\n manifest = manifest.replace(/LargeContent/g, '../../../LargeContent');\n node_fs_1.default.writeFileSync(filePath, manifest);\n cloud_runner_logger_1.default.log(`Package Manifest \\n ${manifest}`);\n github_1.default.updateGitHubCheck(`Package Manifest \\n ${manifest}`, ``);\n }\n }\n static async pullLatestLFS() {\n process.chdir(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.smudge \"git-lfs smudge -- %f\"`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git config --global filter.lfs.process \"git-lfs filter-process\"`);\n if (!cloud_runner_1.default.buildParameters.skipLfs) {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs pull`);\n remote_client_logger_1.RemoteClientLogger.log(`pulled latest LFS files`);\n (0, node_console_1.assert)(node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.lfsFolderAbsolute));\n }\n }\n static async handleRetainedWorkspace() {\n remote_client_logger_1.RemoteClientLogger.log(`Retained Workspace: ${build_parameters_1.default.shouldUseRetainedWorkspaceMode(cloud_runner_1.default.buildParameters)}`);\n if (build_parameters_1.default.shouldUseRetainedWorkspaceMode(cloud_runner_1.default.buildParameters) &&\n node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)) &&\n node_fs_1.default.existsSync(cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.git`)))) {\n cloud_runner_logger_1.default.log(`Retained Workspace Already Exists!`);\n process.chdir(cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute));\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git fetch`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs pull`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git reset --hard \"${cloud_runner_1.default.buildParameters.gitSha}\"`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git checkout ${cloud_runner_1.default.buildParameters.gitSha}`);\n return true;\n }\n return false;\n }\n}\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`remote-cli-pre-build`, `sets up a repository, usually before a game-ci build`)\n], RemoteClient, \"runRemoteClientJob\", null);\nexports.RemoteClient = RemoteClient;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RemoteClientLogger = void 0;\nconst cloud_runner_logger_1 = __importDefault(require(\"../services/core/cloud-runner-logger\"));\nclass RemoteClientLogger {\n static log(message) {\n cloud_runner_logger_1.default.log(`[Client] ${message}`);\n }\n static logCliError(message) {\n cloud_runner_logger_1.default.log(`[Client][Error] ${message}`);\n }\n static logCliDiagnostic(message) {\n cloud_runner_logger_1.default.log(`[Client][Diagnostic] ${message}`);\n }\n static logWarning(message) {\n cloud_runner_logger_1.default.logWarning(message);\n }\n}\nexports.RemoteClientLogger = RemoteClientLogger;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nclass CloudRunnerLogger {\n static setup() {\n this.timestamp = this.createTimestamp();\n this.globalTimestamp = this.timestamp;\n }\n static log(message) {\n core.info(message);\n }\n static logWarning(message) {\n core.warning(message);\n }\n static logLine(message) {\n core.info(`${message}\\n`);\n }\n static error(message) {\n core.error(message);\n }\n static logWithTime(message) {\n const newTimestamp = this.createTimestamp();\n core.info(`${message} (Since previous: ${this.calculateTimeDiff(newTimestamp, this.timestamp)}, Total time: ${this.calculateTimeDiff(newTimestamp, this.globalTimestamp)})`);\n this.timestamp = newTimestamp;\n }\n static calculateTimeDiff(x, y) {\n return Math.floor((x - y) / 1000);\n }\n static createTimestamp() {\n return Date.now();\n }\n}\nexports.default = CloudRunnerLogger;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CloudRunnerSystem = void 0;\nconst child_process_1 = require(\"child_process\");\nconst remote_client_logger_1 = require(\"../../remote-client/remote-client-logger\");\nclass CloudRunnerSystem {\n static async RunAndReadLines(command) {\n const result = await CloudRunnerSystem.Run(command, false, true);\n return result\n .split(`\\n`)\n .map((x) => x.replace(`\\r`, ``))\n .filter((x) => x !== ``)\n .map((x) => {\n const lineValues = x.split(` `);\n return lineValues[lineValues.length - 1];\n });\n }\n static async Run(command, suppressError = false, suppressLogs = false) {\n for (const element of command.split(`\\n`)) {\n if (!suppressLogs) {\n remote_client_logger_1.RemoteClientLogger.log(element);\n }\n }\n return await new Promise((promise, throwError) => {\n let output = '';\n const child = (0, child_process_1.exec)(command, (error, stdout, stderr) => {\n if (!suppressError && error) {\n remote_client_logger_1.RemoteClientLogger.log(error.toString());\n throwError(error);\n }\n if (stderr) {\n const diagnosticOutput = `${stderr.toString()}`;\n if (!suppressLogs) {\n remote_client_logger_1.RemoteClientLogger.logCliDiagnostic(diagnosticOutput);\n }\n output += diagnosticOutput;\n }\n const outputChunk = `${stdout}`;\n output += outputChunk;\n });\n child.on('close', (code) => {\n if (!suppressLogs) {\n remote_client_logger_1.RemoteClientLogger.log(`[${code}]`);\n }\n if (code !== 0 && !suppressError) {\n throwError(output);\n }\n const outputLines = output.split(`\\n`);\n for (const element of outputLines) {\n if (!suppressLogs) {\n remote_client_logger_1.RemoteClientLogger.log(element);\n }\n }\n promise(output);\n });\n });\n }\n}\nexports.CloudRunnerSystem = CloudRunnerSystem;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FollowLogStreamService = void 0;\nconst github_1 = __importDefault(require(\"../../../github\"));\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nconst cloud_runner_statics_1 = require(\"../../options/cloud-runner-statics\");\nconst cloud_runner_logger_1 = __importDefault(require(\"./cloud-runner-logger\"));\nconst core = __importStar(require(\"@actions/core\"));\nclass FollowLogStreamService {\n static Reset() {\n FollowLogStreamService.DidReceiveEndOfTransmission = false;\n }\n static handleIteration(message, shouldReadLogs, shouldCleanup, output) {\n if (message.includes(`---${cloud_runner_1.default.buildParameters.logId}`)) {\n cloud_runner_logger_1.default.log('End of log transmission received');\n FollowLogStreamService.DidReceiveEndOfTransmission = true;\n shouldReadLogs = false;\n }\n else if (message.includes('Rebuilding Library because the asset database could not be found!')) {\n github_1.default.updateGitHubCheck(`Library was not found, importing new Library`, ``);\n core.warning('LIBRARY NOT FOUND!');\n core.setOutput('library-found', 'false');\n }\n else if (message.includes('Build succeeded')) {\n github_1.default.updateGitHubCheck(`Build succeeded`, `Build succeeded`);\n core.setOutput('build-result', 'success');\n }\n else if (message.includes('Build fail')) {\n github_1.default.updateGitHubCheck(`Build failed\\n${FollowLogStreamService.errors}`, `Build failed`, `failure`, `completed`);\n core.setOutput('build-result', 'failed');\n core.setFailed('unity build failed');\n core.error('BUILD FAILED!');\n }\n else if (message.toLowerCase().includes('error ')) {\n core.error(message);\n FollowLogStreamService.errors += `\\n${message}`;\n }\n else if (message.toLowerCase().includes('error: ')) {\n core.error(message);\n FollowLogStreamService.errors += `\\n${message}`;\n }\n else if (message.toLowerCase().includes('command failed: ')) {\n FollowLogStreamService.errors += `\\n${message}`;\n }\n else if (message.toLowerCase().includes('invalid ')) {\n FollowLogStreamService.errors += `\\n${message}`;\n }\n else if (message.toLowerCase().includes('incompatible ')) {\n FollowLogStreamService.errors += `\\n${message}`;\n }\n else if (message.toLowerCase().includes('cannot be found')) {\n FollowLogStreamService.errors += `\\n${message}`;\n }\n if (cloud_runner_1.default.buildParameters.cloudRunnerDebug) {\n output += `${message}\\n`;\n }\n cloud_runner_logger_1.default.log(`[${cloud_runner_statics_1.CloudRunnerStatics.logPrefix}] ${message}`);\n return { shouldReadLogs, shouldCleanup, output };\n }\n}\nexports.FollowLogStreamService = FollowLogStreamService;\nFollowLogStreamService.errors = ``;\nFollowLogStreamService.DidReceiveEndOfTransmission = false;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SharedWorkspaceLocking = void 0;\nconst cloud_runner_system_1 = require(\"./cloud-runner-system\");\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"./cloud-runner-logger\"));\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nclass SharedWorkspaceLocking {\n static get workspaceBucketRoot() {\n return `s3://${cloud_runner_1.default.buildParameters.awsStackName}/`;\n }\n static get workspaceRoot() {\n return `${SharedWorkspaceLocking.workspaceBucketRoot}locks/`;\n }\n static async GetAllWorkspaces(buildParametersContext) {\n if (!(await SharedWorkspaceLocking.DoesCacheKeyTopLevelExist(buildParametersContext))) {\n return [];\n }\n return (await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/`))\n .map((x) => x.replace(`/`, ``))\n .filter((x) => x.endsWith(`_workspace`))\n .map((x) => x.split(`_`)[1]);\n }\n static async DoesCacheKeyTopLevelExist(buildParametersContext) {\n try {\n const rootLines = await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceBucketRoot}`);\n const lockFolderExists = rootLines.map((x) => x.replace(`/`, ``)).includes(`locks`);\n if (lockFolderExists) {\n const lines = await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}`);\n return lines.map((x) => x.replace(`/`, ``)).includes(buildParametersContext.cacheKey);\n }\n else {\n return false;\n }\n }\n catch {\n return false;\n }\n }\n static NewWorkspaceName() {\n return `${cloud_runner_1.default.retainedWorkspacePrefix}-${cloud_runner_1.default.buildParameters.buildGuid}`;\n }\n static async GetAllLocksForWorkspace(workspace, buildParametersContext) {\n if (!(await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext))) {\n return [];\n }\n return (await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/`))\n .map((x) => x.replace(`/`, ``))\n .filter((x) => x.includes(workspace) && x.endsWith(`_lock`));\n }\n static async GetLockedWorkspace(workspace, runId, buildParametersContext) {\n if (buildParametersContext.maxRetainedWorkspaces === 0) {\n return false;\n }\n if (await SharedWorkspaceLocking.DoesCacheKeyTopLevelExist(buildParametersContext)) {\n const workspaces = await SharedWorkspaceLocking.GetFreeWorkspaces(buildParametersContext);\n cloud_runner_logger_1.default.log(`run agent ${runId} is trying to access a workspace, free: ${JSON.stringify(workspaces)}`);\n for (const element of workspaces) {\n const lockResult = await SharedWorkspaceLocking.LockWorkspace(element, runId, buildParametersContext);\n cloud_runner_logger_1.default.log(`run agent: ${runId} try lock workspace: ${element} locking attempt result: ${lockResult}`);\n if (lockResult) {\n return true;\n }\n }\n }\n if (await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext)) {\n workspace = SharedWorkspaceLocking.NewWorkspaceName();\n cloud_runner_1.default.lockedWorkspace = workspace;\n }\n const createResult = await SharedWorkspaceLocking.CreateWorkspace(workspace, buildParametersContext);\n const lockResult = await SharedWorkspaceLocking.LockWorkspace(workspace, runId, buildParametersContext);\n cloud_runner_logger_1.default.log(`run agent ${runId} didn't find a free workspace so created: ${workspace} createWorkspaceSuccess: ${createResult} Lock:${lockResult}`);\n return createResult && lockResult;\n }\n static async DoesWorkspaceExist(workspace, buildParametersContext) {\n return ((await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext)).filter((x) => x.includes(workspace))\n .length > 0);\n }\n static async HasWorkspaceLock(workspace, runId, buildParametersContext) {\n const locks = (await SharedWorkspaceLocking.GetAllLocksForWorkspace(workspace, buildParametersContext))\n .map((x) => {\n return {\n name: x,\n timestamp: Number(x.split(`_`)[0]),\n };\n })\n .sort((x) => x.timestamp);\n const lockMatches = locks.filter((x) => x.name.includes(runId));\n const includesRunLock = lockMatches.length > 0 && locks.indexOf(lockMatches[0]) === 0;\n cloud_runner_logger_1.default.log(`Checking has workspace lock, runId: ${runId}, workspace: ${workspace}, success: ${includesRunLock} \\n- Num of locks created by Run Agent: ${lockMatches.length} Num of Locks: ${locks.length}, Time ordered index for Run Agent: ${locks.indexOf(lockMatches[0])} \\n \\n`);\n return includesRunLock;\n }\n static async GetFreeWorkspaces(buildParametersContext) {\n const result = [];\n const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext);\n for (const element of workspaces) {\n const isLocked = await SharedWorkspaceLocking.IsWorkspaceLocked(element, buildParametersContext);\n const isBelowMax = await SharedWorkspaceLocking.IsWorkspaceBelowMax(element, buildParametersContext);\n cloud_runner_logger_1.default.log(`workspace ${element} locked:${isLocked} below max:${isBelowMax}`);\n if (!isLocked && isBelowMax) {\n result.push(element);\n }\n }\n return result;\n }\n static async IsWorkspaceBelowMax(workspace, buildParametersContext) {\n const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext);\n if (workspace === ``) {\n return (workspaces.length < buildParametersContext.maxRetainedWorkspaces ||\n buildParametersContext.maxRetainedWorkspaces === 0);\n }\n const ordered = [];\n for (const ws of workspaces) {\n ordered.push({\n name: ws,\n timestamp: await SharedWorkspaceLocking.GetWorkspaceTimestamp(ws, buildParametersContext),\n });\n }\n ordered.sort((x) => x.timestamp);\n const matches = ordered.filter((x) => x.name.includes(workspace));\n const isWorkspaceBelowMax = matches.length > 0 &&\n (ordered.indexOf(matches[0]) < buildParametersContext.maxRetainedWorkspaces ||\n buildParametersContext.maxRetainedWorkspaces === 0);\n return isWorkspaceBelowMax;\n }\n static async GetWorkspaceTimestamp(workspace, buildParametersContext) {\n if (workspace.split(`_`).length > 0) {\n return Number(workspace.split(`_`)[1]);\n }\n if (!(await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext))) {\n throw new Error(\"Workspace doesn't exist, can't call get all locks\");\n }\n return (await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/`))\n .map((x) => x.replace(`/`, ``))\n .filter((x) => x.includes(workspace) && x.endsWith(`_workspace`))\n .map((x) => Number(x))[0];\n }\n static async IsWorkspaceLocked(workspace, buildParametersContext) {\n if (!(await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext))) {\n throw new Error(`workspace doesn't exist ${workspace}`);\n }\n const files = await SharedWorkspaceLocking.ReadLines(`aws s3 ls ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/`);\n const lockFilesExist = files.filter((x) => {\n return x.includes(workspace) && x.endsWith(`_lock`);\n }).length > 0;\n return lockFilesExist;\n }\n static async CreateWorkspace(workspace, buildParametersContext) {\n if (await SharedWorkspaceLocking.DoesWorkspaceExist(workspace, buildParametersContext)) {\n throw new Error(`${workspace} already exists`);\n }\n const timestamp = Date.now();\n const file = `${timestamp}_${workspace}_workspace`;\n node_fs_1.default.writeFileSync(file, '');\n await cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 cp ./${file} ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${file}`, false, true);\n node_fs_1.default.rmSync(file);\n const workspaces = await SharedWorkspaceLocking.GetAllWorkspaces(buildParametersContext);\n cloud_runner_logger_1.default.log(`All workspaces ${workspaces}`);\n if (!(await SharedWorkspaceLocking.IsWorkspaceBelowMax(workspace, buildParametersContext))) {\n cloud_runner_logger_1.default.log(`Workspace is above max ${workspaces} ${buildParametersContext.maxRetainedWorkspaces}`);\n await SharedWorkspaceLocking.CleanupWorkspace(workspace, buildParametersContext);\n return false;\n }\n return true;\n }\n static async LockWorkspace(workspace, runId, buildParametersContext) {\n const existingWorkspace = workspace.endsWith(`_workspace`);\n const ending = existingWorkspace ? workspace : `${workspace}_workspace`;\n const file = `${Date.now()}_${runId}_${ending}_lock`;\n node_fs_1.default.writeFileSync(file, '');\n await cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 cp ./${file} ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${file}`, false, true);\n node_fs_1.default.rmSync(file);\n const hasLock = await SharedWorkspaceLocking.HasWorkspaceLock(workspace, runId, buildParametersContext);\n if (hasLock) {\n cloud_runner_1.default.lockedWorkspace = workspace;\n }\n else {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 rm ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${file}`, false, true);\n }\n return hasLock;\n }\n static async ReleaseWorkspace(workspace, runId, buildParametersContext) {\n const files = await SharedWorkspaceLocking.GetAllLocksForWorkspace(workspace, buildParametersContext);\n const file = files.find((x) => x.includes(workspace) && x.endsWith(`_lock`) && x.includes(runId));\n cloud_runner_logger_1.default.log(`All Locks ${files} ${workspace} ${runId}`);\n cloud_runner_logger_1.default.log(`Deleting lock ${workspace}/${file}`);\n cloud_runner_logger_1.default.log(`rm ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${file}`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 rm ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey}/${file}`, false, true);\n return !(await SharedWorkspaceLocking.HasWorkspaceLock(workspace, runId, buildParametersContext));\n }\n static async CleanupWorkspace(workspace, buildParametersContext) {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`aws s3 rm ${SharedWorkspaceLocking.workspaceRoot}${buildParametersContext.cacheKey} --exclude \"*\" --include \"*_${workspace}_*\"`, false, true);\n }\n static async ReadLines(command) {\n return cloud_runner_system_1.CloudRunnerSystem.RunAndReadLines(command);\n }\n}\nexports.SharedWorkspaceLocking = SharedWorkspaceLocking;\nexports.default = SharedWorkspaceLocking;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TaskParameterSerializer = void 0;\nconst build_parameters_1 = __importDefault(require(\"../../../build-parameters\"));\nconst input_1 = __importDefault(require(\"../../../input\"));\nconst cloud_runner_options_1 = __importDefault(require(\"../../options/cloud-runner-options\"));\nconst cloud_runner_options_reader_1 = __importDefault(require(\"../../options/cloud-runner-options-reader\"));\nconst cloud_runner_query_override_1 = __importDefault(require(\"../../options/cloud-runner-query-override\"));\nconst command_hook_service_1 = require(\"../hooks/command-hook-service\");\nclass TaskParameterSerializer {\n static createCloudRunnerEnvironmentVariables(buildParameters) {\n const result = this.uniqBy([\n ...[\n { name: 'BUILD_TARGET', value: buildParameters.targetPlatform },\n { name: 'UNITY_VERSION', value: buildParameters.editorVersion },\n { name: 'GITHUB_TOKEN', value: process.env.GITHUB_TOKEN },\n ],\n ...TaskParameterSerializer.serializeFromObject(buildParameters),\n ...TaskParameterSerializer.serializeInput(),\n ...TaskParameterSerializer.serializeCloudRunnerOptions(),\n ...command_hook_service_1.CommandHookService.getSecrets(command_hook_service_1.CommandHookService.getHooks(buildParameters.commandHooks)),\n ]\n .filter((x) => !TaskParameterSerializer.blockedParameterNames.has(x.name) &&\n x.value !== '' &&\n x.value !== undefined &&\n x.value !== `undefined`)\n .map((x) => {\n x.name = `${TaskParameterSerializer.ToEnvVarFormat(x.name)}`;\n x.value = `${x.value}`;\n return x;\n }), (item) => item.name);\n return result;\n }\n // eslint-disable-next-line no-unused-vars\n static uniqBy(a, key) {\n const seen = {};\n return a.filter(function (item) {\n const k = key(item);\n return seen.hasOwnProperty(k) ? false : (seen[k] = true);\n });\n }\n static readBuildParameterFromEnvironment() {\n const buildParameters = new build_parameters_1.default();\n const keys = [\n ...new Set(Object.getOwnPropertyNames(process.env)\n .filter((x) => !this.blockedParameterNames.has(x) && x.startsWith(''))\n .map((x) => TaskParameterSerializer.UndoEnvVarFormat(x))),\n ];\n for (const element of keys) {\n if (element !== `customJob`) {\n buildParameters[element] = process.env[`${TaskParameterSerializer.ToEnvVarFormat(element)}`];\n }\n }\n return buildParameters;\n }\n static serializeInput() {\n return TaskParameterSerializer.serializeFromType(input_1.default);\n }\n static serializeCloudRunnerOptions() {\n return TaskParameterSerializer.serializeFromType(cloud_runner_options_1.default);\n }\n static ToEnvVarFormat(input) {\n return cloud_runner_options_1.default.ToEnvVarFormat(input);\n }\n static UndoEnvVarFormat(element) {\n return this.camelize(element.toLowerCase().replace(/_+/g, ' '));\n }\n static camelize(string) {\n return TaskParameterSerializer.uncapitalizeFirstLetter(string\n .replace(/(^\\w)|([A-Z])|(\\b\\w)/g, function (word, index) {\n return index === 0 ? word.toLowerCase() : word.toUpperCase();\n })\n .replace(/\\s+/g, ''));\n }\n static uncapitalizeFirstLetter(string) {\n return string.charAt(0).toLowerCase() + string.slice(1);\n }\n static serializeFromObject(buildParameters) {\n const array = [];\n const keys = Object.getOwnPropertyNames(buildParameters).filter((x) => !this.blockedParameterNames.has(x));\n for (const element of keys) {\n array.push({\n name: TaskParameterSerializer.ToEnvVarFormat(element),\n value: buildParameters[element],\n });\n }\n return array;\n }\n static serializeFromType(type) {\n const array = [];\n const input = cloud_runner_options_reader_1.default.GetProperties();\n for (const element of input) {\n if (typeof type[element] !== 'function' && array.filter((x) => x.name === element).length === 0) {\n array.push({\n name: element,\n value: `${type[element]}`,\n });\n }\n }\n return array;\n }\n static readDefaultSecrets() {\n let array = new Array();\n array = TaskParameterSerializer.tryAddInput(array, 'UNITY_SERIAL');\n array = TaskParameterSerializer.tryAddInput(array, 'UNITY_EMAIL');\n array = TaskParameterSerializer.tryAddInput(array, 'UNITY_PASSWORD');\n array = TaskParameterSerializer.tryAddInput(array, 'UNITY_LICENSE');\n array = TaskParameterSerializer.tryAddInput(array, 'GIT_PRIVATE_TOKEN');\n return array;\n }\n static getValue(key) {\n return cloud_runner_query_override_1.default.queryOverrides !== undefined &&\n cloud_runner_query_override_1.default.queryOverrides[key] !== undefined\n ? cloud_runner_query_override_1.default.queryOverrides[key]\n : process.env[key];\n }\n static tryAddInput(array, key) {\n const value = TaskParameterSerializer.getValue(key);\n if (value !== undefined && value !== '' && value !== 'null') {\n array.push({\n ParameterKey: key,\n EnvironmentVariable: key,\n ParameterValue: value,\n });\n }\n return array;\n }\n}\nexports.TaskParameterSerializer = TaskParameterSerializer;\nTaskParameterSerializer.blockedParameterNames = new Set([\n '0',\n 'length',\n 'prototype',\n '',\n 'unityVersion',\n 'CACHE_UNITY_INSTALLATION_ON_MAC',\n 'RUNNER_TEMP_PATH',\n 'NAME',\n 'CUSTOM_JOB',\n]);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CommandHookService = void 0;\nconst __1 = require(\"../../..\");\nconst yaml_1 = __importDefault(require(\"yaml\"));\nconst remote_client_logger_1 = require(\"../../remote-client/remote-client-logger\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst cloud_runner_options_1 = __importDefault(require(\"../../options/cloud-runner-options\"));\nconst fs = __importStar(require(\"node:fs\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../core/cloud-runner-logger\"));\n// import CloudRunnerLogger from './cloud-runner-logger';\nclass CommandHookService {\n static ApplyHooksToCommands(commands, buildParameters) {\n const hooks = CommandHookService.getHooks(buildParameters.commandHooks);\n cloud_runner_logger_1.default.log(`Applying hooks ${hooks.length}`);\n return `echo \"---\"\necho \"start cloud runner init\"\n${cloud_runner_options_1.default.cloudRunnerDebug ? `printenv` : `#`}\necho \"start of cloud runner job\"\n${hooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}\n${commands}\n${hooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}\necho \"end of cloud runner job\"\necho \"---${buildParameters.logId}\"`;\n }\n static getHooks(customCommandHooks) {\n const experimentHooks = customCommandHooks;\n let output = new Array();\n if (experimentHooks && experimentHooks !== '') {\n try {\n output = yaml_1.default.parse(experimentHooks);\n }\n catch (error) {\n throw error;\n }\n }\n return [\n ...output.filter((x) => x.hook !== undefined && x.hook.length > 0),\n ...CommandHookService.GetCustomHooksFromFiles(`before`),\n ...CommandHookService.GetCustomHooksFromFiles(`after`),\n ];\n }\n static GetCustomHooksFromFiles(hookLifecycle) {\n const results = [];\n // RemoteClientLogger.log(`GetCustomHookFiles: ${hookLifecycle}`);\n try {\n const gameCiCustomHooksPath = node_path_1.default.join(process.cwd(), `game-ci`, `command-hooks`);\n const files = fs.readdirSync(gameCiCustomHooksPath);\n for (const file of files) {\n if (!cloud_runner_options_1.default.commandHookFiles.includes(file.replace(`.yaml`, ``))) {\n continue;\n }\n const fileContents = fs.readFileSync(node_path_1.default.join(gameCiCustomHooksPath, file), `utf8`);\n const fileContentsObject = CommandHookService.ParseHooks(fileContents)[0];\n if (fileContentsObject.hook.includes(hookLifecycle)) {\n results.push(fileContentsObject);\n }\n }\n }\n catch (error) {\n remote_client_logger_1.RemoteClientLogger.log(`Failed Getting: ${hookLifecycle} \\n ${JSON.stringify(error, undefined, 4)}`);\n }\n // RemoteClientLogger.log(`Active Steps From Hooks: \\n ${JSON.stringify(results, undefined, 4)}`);\n return results;\n }\n static ConvertYamlSecrets(object) {\n if (object.secrets === undefined) {\n object.secrets = [];\n return;\n }\n object.secrets = object.secrets.map((x) => {\n return {\n ParameterKey: x.name,\n EnvironmentVariable: __1.Input.ToEnvVarFormat(x.name),\n ParameterValue: x.value,\n };\n });\n }\n static ParseHooks(hooks) {\n if (hooks === '') {\n return [];\n }\n // if (CloudRunner.buildParameters?.cloudRunnerIntegrationTests) {\n // CloudRunnerLogger.log(`Parsing build hooks: ${steps}`);\n // }\n const isArray = hooks.replace(/\\s/g, ``)[0] === `-`;\n const object = isArray ? yaml_1.default.parse(hooks) : [yaml_1.default.parse(hooks)];\n for (const hook of object) {\n CommandHookService.ConvertYamlSecrets(hook);\n if (hook.secrets === undefined) {\n hook.secrets = [];\n }\n }\n if (object === undefined) {\n throw new Error(`Failed to parse ${hooks}`);\n }\n return object;\n }\n static getSecrets(hooks) {\n const secrets = hooks.map((x) => x.secrets).filter((x) => x !== undefined && x.length > 0);\n // eslint-disable-next-line unicorn/no-array-reduce\n return secrets.length > 0 ? secrets.reduce((x, y) => [...x, ...y]) : [];\n }\n}\nexports.CommandHookService = CommandHookService;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerHookService = void 0;\nconst yaml_1 = __importDefault(require(\"yaml\"));\nconst cloud_runner_1 = __importDefault(require(\"../../cloud-runner\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst custom_workflow_1 = require(\"../../workflows/custom-workflow\");\nconst remote_client_logger_1 = require(\"../../remote-client/remote-client-logger\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst input_1 = __importDefault(require(\"../../../input\"));\nconst cloud_runner_options_1 = __importDefault(require(\"../../options/cloud-runner-options\"));\nclass ContainerHookService {\n static GetContainerHooksFromFiles(hookLifecycle) {\n const results = [];\n try {\n const gameCiCustomStepsPath = node_path_1.default.join(process.cwd(), `game-ci`, `container-hooks`);\n const files = node_fs_1.default.readdirSync(gameCiCustomStepsPath);\n for (const file of files) {\n if (!cloud_runner_options_1.default.containerHookFiles.includes(file.replace(`.yaml`, ``))) {\n // RemoteClientLogger.log(`Skipping CustomStepFile: ${file}`);\n continue;\n }\n const fileContents = node_fs_1.default.readFileSync(node_path_1.default.join(gameCiCustomStepsPath, file), `utf8`);\n const fileContentsObject = ContainerHookService.ParseContainerHooks(fileContents)[0];\n if (fileContentsObject.hook === hookLifecycle) {\n results.push(fileContentsObject);\n }\n }\n }\n catch (error) {\n remote_client_logger_1.RemoteClientLogger.log(`Failed Getting: ${hookLifecycle} \\n ${JSON.stringify(error, undefined, 4)}`);\n }\n // RemoteClientLogger.log(`Active Steps From Files: \\n ${JSON.stringify(results, undefined, 4)}`);\n const builtInContainerHooks = ContainerHookService.ParseContainerHooks(`- name: aws-s3-upload-build\n image: amazon/aws-cli\n hook: after\n commands: |\n aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile default\n aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile default\n aws configure set region $AWS_DEFAULT_REGION --profile default\n aws s3 cp /data/cache/$CACHE_KEY/build/build-${cloud_runner_1.default.buildParameters.buildGuid}.tar${cloud_runner_1.default.buildParameters.useCompressionStrategy ? '.lz4' : ''} s3://${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/$CACHE_KEY/build/build-$BUILD_GUID.tar${cloud_runner_1.default.buildParameters.useCompressionStrategy ? '.lz4' : ''}\n rm /data/cache/$CACHE_KEY/build/build-${cloud_runner_1.default.buildParameters.buildGuid}.tar${cloud_runner_1.default.buildParameters.useCompressionStrategy ? '.lz4' : ''}\n secrets:\n - name: awsAccessKeyId\n value: ${process.env.AWS_ACCESS_KEY_ID || ``}\n - name: awsSecretAccessKey\n value: ${process.env.AWS_SECRET_ACCESS_KEY || ``}\n - name: awsDefaultRegion\n value: ${process.env.AWS_REGION || ``}\n- name: aws-s3-pull-build\n image: amazon/aws-cli\n commands: |\n aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile default\n aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile default\n aws configure set region $AWS_DEFAULT_REGION --profile default\n aws s3 ls ${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/ || true\n aws s3 ls ${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/$CACHE_KEY/build || true\n mkdir -p /data/cache/$CACHE_KEY/build/\n aws s3 cp s3://${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/$CACHE_KEY/build/build-$BUILD_GUID_TARGET.tar${cloud_runner_1.default.buildParameters.useCompressionStrategy ? '.lz4' : ''} /data/cache/$CACHE_KEY/build/build-$BUILD_GUID_TARGET.tar${cloud_runner_1.default.buildParameters.useCompressionStrategy ? '.lz4' : ''}\n secrets:\n - name: AWS_ACCESS_KEY_ID\n - name: AWS_SECRET_ACCESS_KEY\n - name: AWS_DEFAULT_REGION\n - name: BUILD_GUID_TARGET\n- name: steam-deploy-client\n image: steamcmd/steamcmd\n commands: |\n apt-get update\n apt-get install -y curl tar coreutils git tree > /dev/null\n curl -s https://gist.githubusercontent.com/frostebite/1d56f5505b36b403b64193b7a6e54cdc/raw/fa6639ed4ef750c4268ea319d63aa80f52712ffb/deploy-client-steam.sh | bash\n secrets:\n - name: STEAM_USERNAME\n - name: STEAM_PASSWORD\n - name: STEAM_APPID\n - name: STEAM_SSFN_FILE_NAME\n - name: STEAM_SSFN_FILE_CONTENTS\n - name: STEAM_CONFIG_VDF_1\n - name: STEAM_CONFIG_VDF_2\n - name: STEAM_CONFIG_VDF_3\n - name: STEAM_CONFIG_VDF_4\n - name: BUILD_GUID_TARGET\n - name: RELEASE_BRANCH\n- name: steam-deploy-project\n image: steamcmd/steamcmd\n commands: |\n apt-get update\n apt-get install -y curl tar coreutils git tree > /dev/null\n curl -s https://gist.githubusercontent.com/frostebite/969da6a41002a0e901174124b643709f/raw/02403e53fb292026cba81ddcf4ff35fc1eba111d/steam-deploy-project.sh | bash\n secrets:\n - name: STEAM_USERNAME\n - name: STEAM_PASSWORD\n - name: STEAM_APPID\n - name: STEAM_SSFN_FILE_NAME\n - name: STEAM_SSFN_FILE_CONTENTS\n - name: STEAM_CONFIG_VDF_1\n - name: STEAM_CONFIG_VDF_2\n - name: STEAM_CONFIG_VDF_3\n - name: STEAM_CONFIG_VDF_4\n - name: BUILD_GUID_2\n - name: RELEASE_BRANCH\n- name: aws-s3-upload-cache\n image: amazon/aws-cli\n hook: after\n commands: |\n aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile default\n aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile default\n aws configure set region $AWS_DEFAULT_REGION --profile default\n aws s3 cp --recursive /data/cache/$CACHE_KEY/lfs s3://${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/$CACHE_KEY/lfs\n rm -r /data/cache/$CACHE_KEY/lfs\n aws s3 cp --recursive /data/cache/$CACHE_KEY/Library s3://${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/$CACHE_KEY/Library\n rm -r /data/cache/$CACHE_KEY/Library\n secrets:\n - name: AWS_ACCESS_KEY_ID\n value: ${process.env.AWS_ACCESS_KEY_ID || ``}\n - name: AWS_SECRET_ACCESS_KEY\n value: ${process.env.AWS_SECRET_ACCESS_KEY || ``}\n - name: AWS_DEFAULT_REGION\n value: ${process.env.AWS_REGION || ``}\n- name: aws-s3-pull-cache\n image: amazon/aws-cli\n hook: before\n commands: |\n aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID --profile default\n aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY --profile default\n aws configure set region $AWS_DEFAULT_REGION --profile default\n mkdir -p /data/cache/$CACHE_KEY/Library/\n mkdir -p /data/cache/$CACHE_KEY/lfs/\n aws s3 ls ${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/ || true\n aws s3 ls ${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/$CACHE_KEY/ || true\n BUCKET1=\"${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/$CACHE_KEY/Library/\"\n aws s3 ls $BUCKET1 || true\n OBJECT1=\"$(aws s3 ls $BUCKET1 | sort | tail -n 1 | awk '{print $4}' || '')\"\n aws s3 cp s3://$BUCKET1$OBJECT1 /data/cache/$CACHE_KEY/Library/ || true\n BUCKET2=\"${cloud_runner_1.default.buildParameters.awsStackName}/cloud-runner-cache/$CACHE_KEY/lfs/\"\n aws s3 ls $BUCKET2 || true\n OBJECT2=\"$(aws s3 ls $BUCKET2 | sort | tail -n 1 | awk '{print $4}' || '')\"\n aws s3 cp s3://$BUCKET2$OBJECT2 /data/cache/$CACHE_KEY/lfs/ || true\n secrets:\n - name: AWS_ACCESS_KEY_ID\n value: ${process.env.AWS_ACCESS_KEY_ID || ``}\n - name: AWS_SECRET_ACCESS_KEY\n value: ${process.env.AWS_SECRET_ACCESS_KEY || ``}\n - name: AWS_DEFAULT_REGION\n value: ${process.env.AWS_REGION || ``}\n- name: debug-cache\n image: ubuntu\n hook: after\n commands: |\n apt-get update > /dev/null\n ${cloud_runner_options_1.default.cloudRunnerDebug ? `apt-get install -y tree > /dev/null` : `#`}\n ${cloud_runner_options_1.default.cloudRunnerDebug ? `tree -L 3 /data/cache` : `#`}\n secrets:\n - name: awsAccessKeyId\n value: ${process.env.AWS_ACCESS_KEY_ID || ``}\n - name: awsSecretAccessKey\n value: ${process.env.AWS_SECRET_ACCESS_KEY || ``}\n - name: awsDefaultRegion\n value: ${process.env.AWS_REGION || ``}`).filter((x) => cloud_runner_options_1.default.containerHookFiles.includes(x.name) && x.hook === hookLifecycle);\n if (builtInContainerHooks.length > 0) {\n results.push(...builtInContainerHooks);\n }\n return results;\n }\n static ConvertYamlSecrets(object) {\n if (object.secrets === undefined) {\n object.secrets = [];\n return;\n }\n object.secrets = object.secrets.map((x) => {\n return {\n ParameterKey: x.name,\n EnvironmentVariable: input_1.default.ToEnvVarFormat(x.name),\n ParameterValue: x.value,\n };\n });\n }\n static ParseContainerHooks(steps) {\n if (steps === '') {\n return [];\n }\n const isArray = steps.replace(/\\s/g, ``)[0] === `-`;\n const object = isArray ? yaml_1.default.parse(steps) : [yaml_1.default.parse(steps)];\n for (const step of object) {\n ContainerHookService.ConvertYamlSecrets(step);\n if (step.secrets === undefined) {\n step.secrets = [];\n }\n else {\n for (const secret of step.secrets) {\n if (secret.ParameterValue === undefined && process.env[secret.EnvironmentVariable] !== undefined) {\n if (cloud_runner_1.default.buildParameters?.cloudRunnerDebug) {\n // CloudRunnerLogger.log(`Injecting custom step ${step.name} from env var ${secret.ParameterKey}`);\n }\n secret.ParameterValue = process.env[secret.ParameterKey] || ``;\n }\n }\n }\n if (step.image === undefined) {\n step.image = `ubuntu`;\n }\n }\n if (object === undefined) {\n throw new Error(`Failed to parse ${steps}`);\n }\n return object;\n }\n static async RunPostBuildSteps(cloudRunnerStepState) {\n let output = ``;\n const steps = [\n ...ContainerHookService.ParseContainerHooks(cloud_runner_1.default.buildParameters.postBuildContainerHooks),\n ...ContainerHookService.GetContainerHooksFromFiles(`after`),\n ];\n if (steps.length > 0) {\n if (!cloud_runner_1.default.buildParameters.isCliMode)\n core.startGroup('post build steps');\n output += await custom_workflow_1.CustomWorkflow.runContainerJob(steps, cloudRunnerStepState.environment, cloudRunnerStepState.secrets);\n if (!cloud_runner_1.default.buildParameters.isCliMode)\n core.endGroup();\n }\n return output;\n }\n static async RunPreBuildSteps(cloudRunnerStepState) {\n let output = ``;\n const steps = [\n ...ContainerHookService.ParseContainerHooks(cloud_runner_1.default.buildParameters.preBuildContainerHooks),\n ...ContainerHookService.GetContainerHooksFromFiles(`before`),\n ];\n if (steps.length > 0) {\n if (!cloud_runner_1.default.buildParameters.isCliMode)\n core.startGroup('pre build steps');\n output += await custom_workflow_1.CustomWorkflow.runContainerJob(steps, cloudRunnerStepState.environment, cloudRunnerStepState.secrets);\n if (!cloud_runner_1.default.buildParameters.isCliMode)\n core.endGroup();\n }\n return output;\n }\n}\nexports.ContainerHookService = ContainerHookService;\n","\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LfsHashing = void 0;\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst cloud_runner_folders_1 = require(\"../../options/cloud-runner-folders\");\nconst cloud_runner_system_1 = require(\"../core/cloud-runner-system\");\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst cli_1 = require(\"../../../cli/cli\");\nconst cli_functions_repository_1 = require(\"../../../cli/cli-functions-repository\");\nclass LfsHashing {\n static async createLFSHashFiles() {\n await cloud_runner_system_1.CloudRunnerSystem.Run(`git lfs ls-files -l | cut -d ' ' -f1 | sort > .lfs-assets-guid`);\n await cloud_runner_system_1.CloudRunnerSystem.Run(`md5sum .lfs-assets-guid > .lfs-assets-guid-sum`);\n const lfsHashes = {\n lfsGuid: node_fs_1.default\n .readFileSync(`${node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid`)}`, 'utf8')\n .replace(/\\n/g, ``),\n lfsGuidSum: node_fs_1.default\n .readFileSync(`${node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute, `.lfs-assets-guid-sum`)}`, 'utf8')\n .replace(' .lfs-assets-guid', '')\n .replace(/\\n/g, ``),\n };\n return lfsHashes;\n }\n static async hashAllFiles(folder) {\n const startPath = process.cwd();\n process.chdir(folder);\n const result = await (await cloud_runner_system_1.CloudRunnerSystem.Run(`find -type f -exec md5sum \"{}\" + | sort | md5sum`))\n .replace(/\\n/g, '')\n .split(` `)[0];\n process.chdir(startPath);\n return result;\n }\n static async hash() {\n if (!cli_1.Cli.options) {\n return;\n }\n const folder = cli_1.Cli.options['cachePushFrom'];\n LfsHashing.hashAllFiles(folder);\n }\n}\n__decorate([\n (0, cli_functions_repository_1.CliFunction)(`hash`, `hash all folder contents`)\n], LfsHashing, \"hash\", null);\nexports.LfsHashing = LfsHashing;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncWorkflow = void 0;\nconst cloud_runner_environment_variable_1 = __importDefault(require(\"../options/cloud-runner-environment-variable\"));\nconst cloud_runner_logger_1 = __importDefault(require(\"../services/core/cloud-runner-logger\"));\nconst cloud_runner_folders_1 = require(\"../options/cloud-runner-folders\");\nconst cloud_runner_1 = __importDefault(require(\"../cloud-runner\"));\nclass AsyncWorkflow {\n static async runAsyncWorkflow(environmentVariables, secrets) {\n try {\n cloud_runner_logger_1.default.log(`Cloud Runner is running async mode`);\n const asyncEnvironmentVariable = new cloud_runner_environment_variable_1.default();\n asyncEnvironmentVariable.name = `ASYNC_WORKFLOW`;\n asyncEnvironmentVariable.value = `true`;\n let output = '';\n output += await cloud_runner_1.default.Provider.runTaskInWorkflow(cloud_runner_1.default.buildParameters.buildGuid, `ubuntu`, `apt-get update > /dev/null\napt-get install -y curl tar tree npm git git-lfs jq git > /dev/null\nmkdir /builder\nprintenv\ngit config --global advice.detachedHead false\ngit config --global filter.lfs.smudge \"git-lfs smudge --skip -- %f\"\ngit config --global filter.lfs.process \"git-lfs filter-process --skip\"\ngit clone -q -b ${cloud_runner_1.default.buildParameters.cloudRunnerBranch} ${cloud_runner_folders_1.CloudRunnerFolders.unityBuilderRepoUrl} /builder\ngit clone -q -b ${cloud_runner_1.default.buildParameters.branch} ${cloud_runner_folders_1.CloudRunnerFolders.targetBuildRepoUrl} /repo\ncd /repo\ncurl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\"\nunzip awscliv2.zip\n./aws/install\naws --version\nnode /builder/dist/index.js -m async-workflow`, `/${cloud_runner_folders_1.CloudRunnerFolders.buildVolumeFolder}`, `/${cloud_runner_folders_1.CloudRunnerFolders.buildVolumeFolder}/`, [...environmentVariables, asyncEnvironmentVariable], [\n ...secrets,\n ...[\n {\n ParameterKey: `AWS_ACCESS_KEY_ID`,\n EnvironmentVariable: `AWS_ACCESS_KEY_ID`,\n ParameterValue: process.env.AWS_ACCESS_KEY_ID || ``,\n },\n {\n ParameterKey: `AWS_SECRET_ACCESS_KEY`,\n EnvironmentVariable: `AWS_SECRET_ACCESS_KEY`,\n ParameterValue: process.env.AWS_SECRET_ACCESS_KEY || ``,\n },\n ],\n ]);\n return output;\n }\n catch (error) {\n throw error;\n }\n }\n}\nexports.AsyncWorkflow = AsyncWorkflow;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BuildAutomationWorkflow = void 0;\nconst cloud_runner_logger_1 = __importDefault(require(\"../services/core/cloud-runner-logger\"));\nconst cloud_runner_folders_1 = require(\"../options/cloud-runner-folders\");\nconst core = __importStar(require(\"@actions/core\"));\nconst command_hook_service_1 = require(\"../services/hooks/command-hook-service\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst cloud_runner_1 = __importDefault(require(\"../cloud-runner\"));\nconst container_hook_service_1 = require(\"../services/hooks/container-hook-service\");\nclass BuildAutomationWorkflow {\n async run(cloudRunnerStepState) {\n return await BuildAutomationWorkflow.standardBuildAutomation(cloudRunnerStepState.image, cloudRunnerStepState);\n }\n static async standardBuildAutomation(baseImage, cloudRunnerStepState) {\n // TODO accept post and pre build steps as yaml files in the repo\n cloud_runner_logger_1.default.log(`Cloud Runner is running standard build automation`);\n let output = '';\n output += await container_hook_service_1.ContainerHookService.RunPreBuildSteps(cloudRunnerStepState);\n cloud_runner_logger_1.default.logWithTime('Configurable pre build step(s) time');\n if (!cloud_runner_1.default.buildParameters.isCliMode)\n core.startGroup('build');\n cloud_runner_logger_1.default.log(baseImage);\n cloud_runner_logger_1.default.logLine(` `);\n cloud_runner_logger_1.default.logLine('Starting build automation job');\n output += await cloud_runner_1.default.Provider.runTaskInWorkflow(cloud_runner_1.default.buildParameters.buildGuid, baseImage.toString(), BuildAutomationWorkflow.BuildWorkflow, `/${cloud_runner_folders_1.CloudRunnerFolders.buildVolumeFolder}`, `/${cloud_runner_folders_1.CloudRunnerFolders.buildVolumeFolder}/`, cloudRunnerStepState.environment, cloudRunnerStepState.secrets);\n if (!cloud_runner_1.default.buildParameters.isCliMode)\n core.endGroup();\n cloud_runner_logger_1.default.logWithTime('Build time');\n output += await container_hook_service_1.ContainerHookService.RunPostBuildSteps(cloudRunnerStepState);\n cloud_runner_logger_1.default.logWithTime('Configurable post build step(s) time');\n cloud_runner_logger_1.default.log(`Cloud Runner finished running standard build automation`);\n return output;\n }\n static get BuildWorkflow() {\n const setupHooks = command_hook_service_1.CommandHookService.getHooks(cloud_runner_1.default.buildParameters.commandHooks).filter((x) => x.step?.includes(`setup`));\n const buildHooks = command_hook_service_1.CommandHookService.getHooks(cloud_runner_1.default.buildParameters.commandHooks).filter((x) => x.step?.includes(`build`));\n const builderPath = cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist', `index.js`));\n return `apt-get update > /dev/null\n apt-get install -y curl tar tree npm git-lfs jq git > /dev/null\n npm i -g n > /dev/null\n n 16.15.1 > /dev/null\n npm --version\n node --version\n ${setupHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}\n export GITHUB_WORKSPACE=\"${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.repoPathAbsolute)}\"\n df -H /data/\n ${BuildAutomationWorkflow.setupCommands(builderPath)}\n ${setupHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}\n ${buildHooks.filter((x) => x.hook.includes(`before`)).map((x) => x.commands) || ' '}\n ${BuildAutomationWorkflow.BuildCommands(builderPath)}\n ${buildHooks.filter((x) => x.hook.includes(`after`)).map((x) => x.commands) || ' '}`;\n }\n static setupCommands(builderPath) {\n const commands = `mkdir -p ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute)} && git clone -q -b ${cloud_runner_1.default.buildParameters.cloudRunnerBranch} ${cloud_runner_folders_1.CloudRunnerFolders.unityBuilderRepoUrl} \"${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute)}\" && chmod +x ${builderPath}`;\n const cloneBuilderCommands = `if [ -e \"${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.uniqueCloudRunnerJobFolderAbsolute)}\" ] && [ -e \"${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, `.git`))}\" ] ; then echo \"Builder Already Exists!\" && tree ${cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute}; else ${commands} ; fi`;\n return `export GIT_DISCOVERY_ACROSS_FILESYSTEM=1\n${cloneBuilderCommands}\nnode ${builderPath} -m remote-cli-pre-build`;\n }\n static BuildCommands(builderPath) {\n const distFolder = node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist');\n const ubuntuPlatformsFolder = node_path_1.default.join(cloud_runner_folders_1.CloudRunnerFolders.builderPathAbsolute, 'dist', 'platforms', 'ubuntu');\n return `echo \"game ci cloud runner initalized\"\n mkdir -p ${`${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.projectBuildFolderAbsolute)}/build`}\n cd ${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(cloud_runner_folders_1.CloudRunnerFolders.projectPathAbsolute)}\n cp -r \"${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(node_path_1.default.join(distFolder, 'default-build-script'))}\" \"/UnityBuilderAction\"\n cp -r \"${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(node_path_1.default.join(ubuntuPlatformsFolder, 'entrypoint.sh'))}\" \"/entrypoint.sh\"\n cp -r \"${cloud_runner_folders_1.CloudRunnerFolders.ToLinuxFolder(node_path_1.default.join(ubuntuPlatformsFolder, 'steps'))}\" \"/steps\"\n chmod -R +x \"/entrypoint.sh\"\n chmod -R +x \"/steps\"\n echo \"game ci start\"\n /entrypoint.sh\n echo \"game ci caching results\"\n chmod +x ${builderPath}\n node ${builderPath} -m remote-cli-post-build`;\n }\n}\nexports.BuildAutomationWorkflow = BuildAutomationWorkflow;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CustomWorkflow = void 0;\nconst cloud_runner_logger_1 = __importDefault(require(\"../services/core/cloud-runner-logger\"));\nconst cloud_runner_folders_1 = require(\"../options/cloud-runner-folders\");\nconst container_hook_service_1 = require(\"../services/hooks/container-hook-service\");\nconst cloud_runner_1 = __importDefault(require(\"../cloud-runner\"));\nclass CustomWorkflow {\n static async runContainerJobFromString(buildSteps, environmentVariables, secrets) {\n return await CustomWorkflow.runContainerJob(container_hook_service_1.ContainerHookService.ParseContainerHooks(buildSteps), environmentVariables, secrets);\n }\n static async runContainerJob(steps, environmentVariables, secrets) {\n try {\n let output = '';\n // if (CloudRunner.buildParameters?.cloudRunnerDebug) {\n // CloudRunnerLogger.log(`Custom Job Description \\n${JSON.stringify(buildSteps, undefined, 4)}`);\n // }\n for (const step of steps) {\n cloud_runner_logger_1.default.log(`Cloud Runner is running in custom job mode`);\n output += await cloud_runner_1.default.Provider.runTaskInWorkflow(cloud_runner_1.default.buildParameters.buildGuid, step.image, step.commands, `/${cloud_runner_folders_1.CloudRunnerFolders.buildVolumeFolder}`, `/${cloud_runner_folders_1.CloudRunnerFolders.projectPathAbsolute}/`, environmentVariables, [...secrets, ...step.secrets]);\n }\n return output;\n }\n catch (error) {\n throw error;\n }\n }\n}\nexports.CustomWorkflow = CustomWorkflow;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WorkflowCompositionRoot = void 0;\nconst cloud_runner_step_parameters_1 = require(\"../options/cloud-runner-step-parameters\");\nconst custom_workflow_1 = require(\"./custom-workflow\");\nconst build_automation_workflow_1 = require(\"./build-automation-workflow\");\nconst cloud_runner_1 = __importDefault(require(\"../cloud-runner\"));\nconst cloud_runner_options_1 = __importDefault(require(\"../options/cloud-runner-options\"));\nconst async_workflow_1 = require(\"./async-workflow\");\nclass WorkflowCompositionRoot {\n async run(cloudRunnerStepState) {\n try {\n if (cloud_runner_options_1.default.asyncCloudRunner &&\n !cloud_runner_1.default.isCloudRunnerAsyncEnvironment &&\n !cloud_runner_1.default.isCloudRunnerEnvironment) {\n return await async_workflow_1.AsyncWorkflow.runAsyncWorkflow(cloudRunnerStepState.environment, cloudRunnerStepState.secrets);\n }\n if (cloud_runner_1.default.buildParameters.customJob !== '') {\n return await custom_workflow_1.CustomWorkflow.runContainerJobFromString(cloud_runner_1.default.buildParameters.customJob, cloudRunnerStepState.environment, cloudRunnerStepState.secrets);\n }\n return await new build_automation_workflow_1.BuildAutomationWorkflow().run(new cloud_runner_step_parameters_1.CloudRunnerStepParameters(cloudRunnerStepState.image.toString(), cloudRunnerStepState.environment, cloudRunnerStepState.secrets));\n }\n catch (error) {\n throw error;\n }\n }\n}\nexports.WorkflowCompositionRoot = WorkflowCompositionRoot;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst image_environment_factory_1 = __importDefault(require(\"./image-environment-factory\"));\nconst node_fs_1 = require(\"node:fs\");\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst exec_1 = require(\"@actions/exec\");\nclass Docker {\n static async run(image, parameters, silent = false, overrideCommands = '', additionalVariables = [], options = {}, entrypointBash = false) {\n let runCommand = '';\n switch (process.platform) {\n case 'linux':\n runCommand = this.getLinuxCommand(image, parameters, overrideCommands, additionalVariables, entrypointBash);\n break;\n case 'win32':\n runCommand = this.getWindowsCommand(image, parameters);\n break;\n default:\n throw new Error(`Operation system, ${process.platform}, is not supported yet.`);\n }\n options.silent = silent;\n options.ignoreReturnCode = true;\n return await (0, exec_1.exec)(runCommand, undefined, options);\n }\n static getLinuxCommand(image, parameters, overrideCommands = '', additionalVariables = [], entrypointBash = false) {\n const { workspace, actionFolder, runnerTempPath, sshAgent, sshPublicKeysDirectoryPath, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, } = parameters;\n const githubHome = node_path_1.default.join(runnerTempPath, '_github_home');\n if (!(0, node_fs_1.existsSync)(githubHome))\n (0, node_fs_1.mkdirSync)(githubHome);\n const githubWorkflow = node_path_1.default.join(runnerTempPath, '_github_workflow');\n if (!(0, node_fs_1.existsSync)(githubWorkflow))\n (0, node_fs_1.mkdirSync)(githubWorkflow);\n const commandPrefix = image === `alpine` ? `/bin/sh` : `/bin/bash`;\n return `docker run \\\n --workdir ${dockerWorkspacePath} \\\n --rm \\\n ${image_environment_factory_1.default.getEnvVarString(parameters, additionalVariables)} \\\n --env GITHUB_WORKSPACE=${dockerWorkspacePath} \\\n --env GIT_CONFIG_EXTENSIONS \\\n ${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN=\"${gitPrivateToken}\"` : ''} \\\n ${sshAgent ? '--env SSH_AUTH_SOCK=/ssh-agent' : ''} \\\n --volume \"${githubHome}\":\"/root:z\" \\\n --volume \"${githubWorkflow}\":\"/github/workflow:z\" \\\n --volume \"${workspace}\":\"${dockerWorkspacePath}:z\" \\\n --volume \"${actionFolder}/default-build-script:/UnityBuilderAction:z\" \\\n --volume \"${actionFolder}/platforms/ubuntu/steps:/steps:z\" \\\n --volume \"${actionFolder}/platforms/ubuntu/entrypoint.sh:/entrypoint.sh:z\" \\\n --volume \"${actionFolder}/unity-config:/usr/share/unity3d/config/:z\" \\\n --volume \"${actionFolder}/BlankProject\":\"/BlankProject:z\" \\\n --cpus=${dockerCpuLimit} \\\n --memory=${dockerMemoryLimit} \\\n ${sshAgent ? `--volume ${sshAgent}:/ssh-agent` : ''} \\\n ${sshAgent && !sshPublicKeysDirectoryPath\n ? '--volume /home/runner/.ssh/known_hosts:/root/.ssh/known_hosts:ro'\n : ''} \\\n ${sshPublicKeysDirectoryPath ? `--volume ${sshPublicKeysDirectoryPath}:/root/.ssh:ro` : ''} \\\n ${entrypointBash ? `--entrypoint ${commandPrefix}` : ``} \\\n ${image} \\\n ${entrypointBash ? `-c` : `${commandPrefix} -c`} \\\n \"${overrideCommands !== '' ? overrideCommands : `/entrypoint.sh`}\"`;\n }\n static getWindowsCommand(image, parameters) {\n const { workspace, actionFolder, gitPrivateToken, dockerWorkspacePath, dockerCpuLimit, dockerMemoryLimit, dockerIsolationMode, } = parameters;\n return `docker run \\\n --workdir c:${dockerWorkspacePath} \\\n --rm \\\n ${image_environment_factory_1.default.getEnvVarString(parameters)} \\\n --env GITHUB_WORKSPACE=c:${dockerWorkspacePath} \\\n ${gitPrivateToken ? `--env GIT_PRIVATE_TOKEN=\"${gitPrivateToken}\"` : ''} \\\n --volume \"${workspace}\":\"c:${dockerWorkspacePath}\" \\\n --volume \"c:/regkeys\":\"c:/regkeys\" \\\n --volume \"C:/Program Files/Microsoft Visual Studio\":\"C:/Program Files/Microsoft Visual Studio\" \\\n --volume \"C:/Program Files (x86)/Microsoft Visual Studio\":\"C:/Program Files (x86)/Microsoft Visual Studio\" \\\n --volume \"C:/Program Files (x86)/Windows Kits\":\"C:/Program Files (x86)/Windows Kits\" \\\n --volume \"C:/ProgramData/Microsoft/VisualStudio\":\"C:/ProgramData/Microsoft/VisualStudio\" \\\n --volume \"${actionFolder}/default-build-script\":\"c:/UnityBuilderAction\" \\\n --volume \"${actionFolder}/platforms/windows\":\"c:/steps\" \\\n --volume \"${actionFolder}/BlankProject\":\"c:/BlankProject\" \\\n --cpus=${dockerCpuLimit} \\\n --memory=${dockerMemoryLimit} \\\n --isolation=${dockerIsolationMode} \\\n ${image} \\\n powershell c:/steps/entrypoint.ps1`;\n }\n}\nexports.default = Docker;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass NotImplementedException extends Error {\n constructor(message = '') {\n super(message);\n this.name = 'NotImplementedException';\n }\n}\nexports.default = NotImplementedException;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass ValidationError extends Error {\n constructor(message = '') {\n super(message);\n this.name = 'ValidationError';\n }\n}\nexports.default = ValidationError;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst cloud_runner_logger_1 = __importDefault(require(\"./cloud-runner/services/core/cloud-runner-logger\"));\nconst cloud_runner_1 = __importDefault(require(\"./cloud-runner/cloud-runner\"));\nconst cloud_runner_options_1 = __importDefault(require(\"./cloud-runner/options/cloud-runner-options\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst core_1 = require(\"@octokit/core\");\nclass GitHub {\n static get octokitDefaultToken() {\n return new core_1.Octokit({\n auth: process.env.GITHUB_TOKEN,\n });\n }\n static get octokitPAT() {\n return new core_1.Octokit({\n auth: cloud_runner_1.default.buildParameters.gitPrivateToken,\n });\n }\n static get sha() {\n return cloud_runner_1.default.buildParameters.gitSha;\n }\n static get checkName() {\n return `Cloud Runner (${cloud_runner_1.default.buildParameters.buildGuid})`;\n }\n static get nameReadable() {\n return GitHub.checkName;\n }\n static get checkRunId() {\n return cloud_runner_1.default.buildParameters.githubCheckId;\n }\n static get owner() {\n return cloud_runner_options_1.default.githubOwner;\n }\n static get repo() {\n return cloud_runner_options_1.default.githubRepoName;\n }\n static async createGitHubCheck(summary) {\n if (!cloud_runner_1.default.buildParameters.githubChecks) {\n return ``;\n }\n GitHub.startedDate = new Date().toISOString();\n cloud_runner_logger_1.default.log(`Creating inital github check`);\n const data = {\n owner: GitHub.owner,\n repo: GitHub.repo,\n name: GitHub.checkName,\n // eslint-disable-next-line camelcase\n head_sha: GitHub.sha,\n status: 'queued',\n // eslint-disable-next-line camelcase\n external_id: cloud_runner_1.default.buildParameters.buildGuid,\n // eslint-disable-next-line camelcase\n started_at: GitHub.startedDate,\n output: {\n title: GitHub.nameReadable,\n summary,\n text: '',\n images: [\n {\n alt: 'Game-CI',\n // eslint-disable-next-line camelcase\n image_url: 'https://game.ci/assets/images/game-ci-brand-logo-wordmark.svg',\n },\n ],\n },\n };\n const result = await GitHub.createGitHubCheckRequest(data);\n return result.data.id.toString();\n }\n static async updateGitHubCheck(longDescription, summary, result = `neutral`, status = `in_progress`) {\n if (`${cloud_runner_1.default.buildParameters.githubChecks}` !== `true`) {\n return;\n }\n cloud_runner_logger_1.default.log(`githubChecks: ${cloud_runner_1.default.buildParameters.githubChecks} checkRunId: ${GitHub.checkRunId} sha: ${GitHub.sha} async: ${cloud_runner_1.default.isCloudRunnerAsyncEnvironment}`);\n GitHub.longDescriptionContent += `\\n${longDescription}`;\n if (GitHub.result !== `success` && GitHub.result !== `failure`) {\n GitHub.result = result;\n }\n else {\n result = GitHub.result;\n }\n const data = {\n owner: GitHub.owner,\n repo: GitHub.repo,\n // eslint-disable-next-line camelcase\n check_run_id: GitHub.checkRunId,\n name: GitHub.checkName,\n // eslint-disable-next-line camelcase\n head_sha: GitHub.sha,\n // eslint-disable-next-line camelcase\n started_at: GitHub.startedDate,\n status,\n output: {\n title: GitHub.nameReadable,\n summary,\n text: GitHub.longDescriptionContent,\n annotations: [],\n },\n };\n if (status === `completed`) {\n if (GitHub.endedDate !== undefined) {\n GitHub.endedDate = new Date().toISOString();\n }\n // eslint-disable-next-line camelcase\n data.completed_at = GitHub.endedDate || GitHub.startedDate;\n data.conclusion = result;\n }\n await (cloud_runner_1.default.isCloudRunnerAsyncEnvironment\n ? GitHub.runUpdateAsyncChecksWorkflow(data, `update`)\n : GitHub.updateGitHubCheckRequest(data));\n }\n static async updateGitHubCheckRequest(data) {\n return await GitHub.octokitDefaultToken.request(`PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}`, data);\n }\n static async createGitHubCheckRequest(data) {\n return await GitHub.octokitDefaultToken.request(`POST /repos/{owner}/{repo}/check-runs`, data);\n }\n static async runUpdateAsyncChecksWorkflow(data, mode) {\n if (mode === `create`) {\n throw new Error(`Not supported: only use update`);\n }\n const workflowsResult = await GitHub.octokitPAT.request(`GET /repos/{owner}/{repo}/actions/workflows`, {\n owner: GitHub.owner,\n repo: GitHub.repo,\n });\n const workflows = workflowsResult.data.workflows;\n cloud_runner_logger_1.default.log(`Got ${workflows.length} workflows`);\n let selectedId = ``;\n for (let index = 0; index < workflowsResult.data.total_count; index++) {\n if (workflows[index].name === GitHub.asyncChecksApiWorkflowName) {\n selectedId = workflows[index].id.toString();\n }\n }\n if (selectedId === ``) {\n core.info(JSON.stringify(workflows));\n throw new Error(`no workflow with name \"${GitHub.asyncChecksApiWorkflowName}\"`);\n }\n await GitHub.octokitPAT.request(`POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches`, {\n owner: GitHub.owner,\n repo: GitHub.repo,\n // eslint-disable-next-line camelcase\n workflow_id: selectedId,\n ref: cloud_runner_options_1.default.branch,\n inputs: {\n checksObject: JSON.stringify({ data, mode }),\n },\n });\n }\n static async triggerWorkflowOnComplete(triggerWorkflowOnComplete) {\n const isLocalAsync = cloud_runner_1.default.buildParameters.asyncWorkflow && !cloud_runner_1.default.isCloudRunnerAsyncEnvironment;\n if (isLocalAsync) {\n return;\n }\n const workflowsResult = await GitHub.octokitPAT.request(`GET /repos/{owner}/{repo}/actions/workflows`, {\n owner: GitHub.owner,\n repo: GitHub.repo,\n });\n const workflows = workflowsResult.data.workflows;\n cloud_runner_logger_1.default.log(`Got ${workflows.length} workflows`);\n for (const element of triggerWorkflowOnComplete) {\n let selectedId = ``;\n for (let index = 0; index < workflowsResult.data.total_count; index++) {\n if (workflows[index].name === element) {\n selectedId = workflows[index].id.toString();\n }\n }\n if (selectedId === ``) {\n core.info(JSON.stringify(workflows));\n throw new Error(`no workflow with name \"${GitHub.asyncChecksApiWorkflowName}\"`);\n }\n await GitHub.octokitPAT.request(`POST /repos/{owner}/{repo}/actions/workflows/{workflow_id}/dispatches`, {\n owner: GitHub.owner,\n repo: GitHub.repo,\n // eslint-disable-next-line camelcase\n workflow_id: selectedId,\n ref: cloud_runner_options_1.default.branch,\n inputs: {\n buildGuid: cloud_runner_1.default.buildParameters.buildGuid,\n },\n });\n }\n }\n}\nGitHub.asyncChecksApiWorkflowName = `Async Checks API`;\nGitHub.githubInputEnabled = true;\nGitHub.longDescriptionContent = ``;\nGitHub.result = ``;\nexports.default = GitHub;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass ImageEnvironmentFactory {\n static getEnvVarString(parameters, additionalVariables = []) {\n const environmentVariables = ImageEnvironmentFactory.getEnvironmentVariables(parameters, additionalVariables);\n let string = '';\n for (const p of environmentVariables) {\n if (p.value === '' || p.value === undefined) {\n continue;\n }\n if (p.name !== 'ANDROID_KEYSTORE_BASE64' && p.value.toString().includes(`\\n`)) {\n string += `--env ${p.name} `;\n process.env[p.name] = p.value.toString();\n continue;\n }\n string += `--env ${p.name}=\"${p.value}\" `;\n }\n return string;\n }\n static getEnvironmentVariables(parameters, additionalVariables = []) {\n let environmentVariables = [\n { name: 'UNITY_EMAIL', value: process.env.UNITY_EMAIL },\n { name: 'UNITY_PASSWORD', value: process.env.UNITY_PASSWORD },\n { name: 'UNITY_SERIAL', value: parameters.unitySerial },\n {\n name: 'UNITY_LICENSING_SERVER',\n value: parameters.unityLicensingServer,\n },\n { name: 'UNITY_VERSION', value: parameters.editorVersion },\n {\n name: 'USYM_UPLOAD_AUTH_TOKEN',\n value: process.env.USYM_UPLOAD_AUTH_TOKEN,\n },\n { name: 'PROJECT_PATH', value: parameters.projectPath },\n { name: 'BUILD_TARGET', value: parameters.targetPlatform },\n { name: 'BUILD_NAME', value: parameters.buildName },\n { name: 'BUILD_PATH', value: parameters.buildPath },\n { name: 'BUILD_FILE', value: parameters.buildFile },\n { name: 'BUILD_METHOD', value: parameters.buildMethod },\n { name: 'MANUAL_EXIT', value: parameters.manualExit },\n { name: 'VERSION', value: parameters.buildVersion },\n { name: 'ANDROID_VERSION_CODE', value: parameters.androidVersionCode },\n { name: 'ANDROID_KEYSTORE_NAME', value: parameters.androidKeystoreName },\n {\n name: 'ANDROID_KEYSTORE_BASE64',\n value: parameters.androidKeystoreBase64,\n },\n { name: 'ANDROID_KEYSTORE_PASS', value: parameters.androidKeystorePass },\n { name: 'ANDROID_KEYALIAS_NAME', value: parameters.androidKeyaliasName },\n { name: 'ANDROID_KEYALIAS_PASS', value: parameters.androidKeyaliasPass },\n {\n name: 'ANDROID_TARGET_SDK_VERSION',\n value: parameters.androidTargetSdkVersion,\n },\n {\n name: 'ANDROID_SDK_MANAGER_PARAMETERS',\n value: parameters.androidSdkManagerParameters,\n },\n { name: 'ANDROID_EXPORT_TYPE', value: parameters.androidExportType },\n { name: 'ANDROID_SYMBOL_TYPE', value: parameters.androidSymbolType },\n { name: 'CUSTOM_PARAMETERS', value: parameters.customParameters },\n { name: 'RUN_AS_HOST_USER', value: parameters.runAsHostUser },\n { name: 'CHOWN_FILES_TO', value: parameters.chownFilesTo },\n { name: 'GITHUB_REF', value: process.env.GITHUB_REF },\n { name: 'GITHUB_SHA', value: process.env.GITHUB_SHA },\n { name: 'GITHUB_REPOSITORY', value: process.env.GITHUB_REPOSITORY },\n { name: 'GITHUB_ACTOR', value: process.env.GITHUB_ACTOR },\n { name: 'GITHUB_WORKFLOW', value: process.env.GITHUB_WORKFLOW },\n { name: 'GITHUB_HEAD_REF', value: process.env.GITHUB_HEAD_REF },\n { name: 'GITHUB_BASE_REF', value: process.env.GITHUB_BASE_REF },\n { name: 'GITHUB_EVENT_NAME', value: process.env.GITHUB_EVENT_NAME },\n { name: 'GITHUB_ACTION', value: process.env.GITHUB_ACTION },\n { name: 'GITHUB_EVENT_PATH', value: process.env.GITHUB_EVENT_PATH },\n { name: 'RUNNER_OS', value: process.env.RUNNER_OS },\n { name: 'RUNNER_TOOL_CACHE', value: process.env.RUNNER_TOOL_CACHE },\n { name: 'RUNNER_TEMP', value: process.env.RUNNER_TEMP },\n { name: 'RUNNER_WORKSPACE', value: process.env.RUNNER_WORKSPACE },\n ];\n if (parameters.providerStrategy === 'local-docker') {\n for (const element of additionalVariables) {\n if (environmentVariables.find((x) => element !== undefined && element.name !== undefined && x.name === element.name) === undefined) {\n environmentVariables.push(element);\n }\n }\n for (const variable of environmentVariables) {\n if (environmentVariables.find((x) => variable !== undefined && variable.name !== undefined && x.name === variable.name) === undefined) {\n environmentVariables = environmentVariables.filter((x) => x !== variable);\n }\n }\n }\n if (parameters.sshAgent) {\n environmentVariables.push({ name: 'SSH_AUTH_SOCK', value: '/ssh-agent' });\n }\n return environmentVariables;\n }\n}\nexports.default = ImageEnvironmentFactory;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst platform_1 = __importDefault(require(\"./platform\"));\nclass ImageTag {\n constructor(imageProperties) {\n const { editorVersion, targetPlatform, customImage, cloudRunnerBuilderPlatform, containerRegistryRepository, containerRegistryImageVersion, } = imageProperties;\n if (!ImageTag.versionPattern.test(editorVersion)) {\n throw new Error(`Invalid version \"${editorVersion}\".`);\n }\n // Todo we might as well skip this class for customImage.\n // Either\n this.customImage = customImage;\n // Or\n this.repository = containerRegistryRepository;\n this.editorVersion = editorVersion;\n this.targetPlatform = targetPlatform;\n this.cloudRunnerBuilderPlatform = cloudRunnerBuilderPlatform;\n const isCloudRunnerLocal = cloudRunnerBuilderPlatform === 'local' || cloudRunnerBuilderPlatform === undefined;\n this.builderPlatform = ImageTag.getTargetPlatformToTargetPlatformSuffixMap(targetPlatform, editorVersion);\n this.imagePlatformPrefix = ImageTag.getImagePlatformPrefixes(isCloudRunnerLocal ? process.platform : cloudRunnerBuilderPlatform);\n this.imageRollingVersion = Number(containerRegistryImageVersion); // Will automatically roll to the latest non-breaking version.\n }\n static get versionPattern() {\n return /^(20\\d{2}\\.\\d\\.\\w{3,4}|3)$/;\n }\n static get targetPlatformSuffixes() {\n return {\n generic: '',\n webgl: 'webgl',\n mac: 'mac-mono',\n windows: 'windows-mono',\n windowsIl2cpp: 'windows-il2cpp',\n wsaPlayer: 'universal-windows-platform',\n linux: 'base',\n linuxIl2cpp: 'linux-il2cpp',\n android: 'android',\n ios: 'ios',\n tvos: 'appletv',\n facebook: 'facebook',\n };\n }\n static getImagePlatformPrefixes(platform) {\n switch (platform) {\n case 'win32':\n return 'windows';\n case 'linux':\n return 'ubuntu';\n default:\n return '';\n }\n }\n static getTargetPlatformToTargetPlatformSuffixMap(platform, version) {\n const { generic, webgl, mac, windows, windowsIl2cpp, wsaPlayer, linux, linuxIl2cpp, android, ios, tvos, facebook } = ImageTag.targetPlatformSuffixes;\n const [major, minor] = version.split('.').map((digit) => Number(digit));\n // @see: https://docs.unity3d.com/ScriptReference/BuildTarget.html\n switch (platform) {\n case platform_1.default.types.StandaloneOSX:\n return mac;\n case platform_1.default.types.StandaloneWindows:\n case platform_1.default.types.StandaloneWindows64:\n // Can only build windows-il2cpp on a windows based system\n if (process.platform === 'win32') {\n // Unity versions before 2019.3 do not support il2cpp\n if (major >= 2020 || (major === 2019 && minor >= 3)) {\n return windowsIl2cpp;\n }\n else {\n throw new Error(`Windows-based builds are only supported on 2019.3.X+ versions of Unity.\n If you are trying to build for windows-mono, please use a Linux based OS.`);\n }\n }\n return windows;\n case platform_1.default.types.StandaloneLinux64: {\n // Unity versions before 2019.3 do not support il2cpp\n if (major >= 2020 || (major === 2019 && minor >= 3)) {\n return linuxIl2cpp;\n }\n return linux;\n }\n case platform_1.default.types.iOS:\n return ios;\n case platform_1.default.types.Android:\n return android;\n case platform_1.default.types.WebGL:\n return webgl;\n case platform_1.default.types.WSAPlayer:\n if (process.platform !== 'win32') {\n throw new Error(`WSAPlayer can only be built on a windows base OS`);\n }\n return wsaPlayer;\n case platform_1.default.types.PS4:\n return windows;\n case platform_1.default.types.XboxOne:\n return windows;\n case platform_1.default.types.tvOS:\n if (process.platform !== 'win32') {\n throw new Error(`tvOS can only be built on a windows base OS`);\n }\n return tvos;\n case platform_1.default.types.Switch:\n return windows;\n // Unsupported\n case platform_1.default.types.Lumin:\n return windows;\n case platform_1.default.types.BJM:\n return windows;\n case platform_1.default.types.Stadia:\n return windows;\n case platform_1.default.types.Facebook:\n return facebook;\n case platform_1.default.types.NoTarget:\n return generic;\n // Test specific\n case platform_1.default.types.Test:\n return generic;\n default:\n throw new Error(`\n Platform must be one of the ones described in the documentation.\n \"${platform}\" is currently not supported.`);\n }\n }\n get tag() {\n const versionAndPlatform = `${this.editorVersion}-${this.builderPlatform}`.replace(/-+$/, '');\n return `${this.imagePlatformPrefix}-${versionAndPlatform}-${this.imageRollingVersion}`;\n }\n get image() {\n return `${this.repository}`.replace(/^\\/+/, '');\n }\n toString() {\n const { image, tag, customImage } = this;\n if (customImage)\n return customImage;\n return `${image}:${tag}`;\n }\n}\nexports.default = ImageTag;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CloudRunner = exports.Versioning = exports.Unity = exports.Project = exports.Platform = exports.Output = exports.ImageTag = exports.Input = exports.Docker = exports.Cache = exports.BuildParameters = exports.Action = void 0;\nconst action_1 = __importDefault(require(\"./action\"));\nexports.Action = action_1.default;\nconst build_parameters_1 = __importDefault(require(\"./build-parameters\"));\nexports.BuildParameters = build_parameters_1.default;\nconst cache_1 = __importDefault(require(\"./cache\"));\nexports.Cache = cache_1.default;\nconst docker_1 = __importDefault(require(\"./docker\"));\nexports.Docker = docker_1.default;\nconst input_1 = __importDefault(require(\"./input\"));\nexports.Input = input_1.default;\nconst image_tag_1 = __importDefault(require(\"./image-tag\"));\nexports.ImageTag = image_tag_1.default;\nconst output_1 = __importDefault(require(\"./output\"));\nexports.Output = output_1.default;\nconst platform_1 = __importDefault(require(\"./platform\"));\nexports.Platform = platform_1.default;\nconst project_1 = __importDefault(require(\"./project\"));\nexports.Project = project_1.default;\nconst unity_1 = __importDefault(require(\"./unity\"));\nexports.Unity = unity_1.default;\nconst versioning_1 = __importDefault(require(\"./versioning\"));\nexports.Versioning = versioning_1.default;\nconst cloud_runner_1 = __importDefault(require(\"./cloud-runner/cloud-runner\"));\nexports.CloudRunner = cloud_runner_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ActionYamlReader = void 0;\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst yaml_1 = __importDefault(require(\"yaml\"));\nclass ActionYamlReader {\n constructor() {\n let filename = `action.yml`;\n if (!node_fs_1.default.existsSync(filename)) {\n filename = node_path_1.default.join(__dirname, `..`, filename);\n }\n this.actionYamlParsed = yaml_1.default.parse(node_fs_1.default.readFileSync(filename).toString());\n }\n GetActionYamlValue(key) {\n return this.actionYamlParsed.inputs[key]?.description || 'No description found in action.yml';\n }\n}\nexports.ActionYamlReader = ActionYamlReader;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GenericInputReader = void 0;\nconst cloud_runner_system_1 = require(\"../cloud-runner/services/core/cloud-runner-system\");\nconst cloud_runner_options_1 = __importDefault(require(\"../cloud-runner/options/cloud-runner-options\"));\nclass GenericInputReader {\n static async Run(command) {\n if (cloud_runner_options_1.default.providerStrategy === 'local') {\n return '';\n }\n return await cloud_runner_system_1.CloudRunnerSystem.Run(command, false, true);\n }\n}\nexports.GenericInputReader = GenericInputReader;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GitRepoReader = void 0;\nconst node_console_1 = require(\"node:console\");\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst cloud_runner_system_1 = require(\"../cloud-runner/services/core/cloud-runner-system\");\nconst cloud_runner_logger_1 = __importDefault(require(\"../cloud-runner/services/core/cloud-runner-logger\"));\nconst cloud_runner_options_1 = __importDefault(require(\"../cloud-runner/options/cloud-runner-options\"));\nconst input_1 = __importDefault(require(\"../input\"));\nclass GitRepoReader {\n static async GetRemote() {\n if (cloud_runner_options_1.default.providerStrategy === 'local') {\n return '';\n }\n (0, node_console_1.assert)(node_fs_1.default.existsSync(`.git`));\n const value = (await cloud_runner_system_1.CloudRunnerSystem.Run(`cd ${input_1.default.projectPath} && git remote -v`, false, true)).replace(/ /g, ``);\n cloud_runner_logger_1.default.log(`value ${value}`);\n (0, node_console_1.assert)(value.includes('github.com'));\n return value.split('github.com')[1].split('.git')[0].slice(1);\n }\n static async GetBranch() {\n if (cloud_runner_options_1.default.providerStrategy === 'local') {\n return '';\n }\n (0, node_console_1.assert)(node_fs_1.default.existsSync(`.git`));\n return (await cloud_runner_system_1.CloudRunnerSystem.Run(`cd ${input_1.default.projectPath} && git branch --show-current`, false, true))\n .split('\\n')[0]\n .replace(/ /g, ``)\n .replace('/head', '');\n }\n}\nexports.GitRepoReader = GitRepoReader;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GithubCliReader = void 0;\nconst cloud_runner_system_1 = require(\"../cloud-runner/services/core/cloud-runner-system\");\nconst core = __importStar(require(\"@actions/core\"));\nconst cloud_runner_options_1 = __importDefault(require(\"../cloud-runner/options/cloud-runner-options\"));\nclass GithubCliReader {\n static async GetGitHubAuthToken() {\n if (cloud_runner_options_1.default.providerStrategy === 'local') {\n return '';\n }\n try {\n const authStatus = await cloud_runner_system_1.CloudRunnerSystem.Run(`gh auth status`, true, true);\n if (authStatus.includes('You are not logged') || authStatus === '') {\n return '';\n }\n return (await cloud_runner_system_1.CloudRunnerSystem.Run(`gh auth status -t`, false, true))\n .split(`Token: `)[1]\n .replace(/ /g, '')\n .replace(/\\n/g, '');\n }\n catch (error) {\n core.info(error || 'Failed to get github auth token from gh cli');\n return '';\n }\n }\n}\nexports.GithubCliReader = GithubCliReader;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst node_path_1 = __importDefault(require(\"node:path\"));\nconst cli_1 = require(\"./cli/cli\");\nconst cloud_runner_query_override_1 = __importDefault(require(\"./cloud-runner/options/cloud-runner-query-override\"));\nconst platform_1 = __importDefault(require(\"./platform\"));\nconst github_1 = __importDefault(require(\"./github\"));\nconst node_os_1 = __importDefault(require(\"node:os\"));\nconst core = __importStar(require(\"@actions/core\"));\n/**\n * Input variables specified in workflows using \"with\" prop.\n *\n * Note that input is always passed as a string, even booleans.\n *\n * Todo: rename to UserInput and remove anything that is not direct input from the user / ci workflow\n */\nclass Input {\n static getInput(query) {\n if (github_1.default.githubInputEnabled) {\n const coreInput = core.getInput(query);\n if (coreInput && coreInput !== '') {\n return coreInput;\n }\n }\n const alternativeQuery = Input.ToEnvVarFormat(query);\n // Query input sources\n if (cli_1.Cli.query(query, alternativeQuery)) {\n return cli_1.Cli.query(query, alternativeQuery);\n }\n if (cloud_runner_query_override_1.default.query(query, alternativeQuery)) {\n return cloud_runner_query_override_1.default.query(query, alternativeQuery);\n }\n if (process.env[query] !== undefined) {\n return process.env[query];\n }\n if (alternativeQuery !== query && process.env[alternativeQuery] !== undefined) {\n return process.env[alternativeQuery];\n }\n }\n static get region() {\n return Input.getInput('region') || 'eu-west-2';\n }\n static get githubRepo() {\n return Input.getInput('GITHUB_REPOSITORY') || Input.getInput('GITHUB_REPO') || undefined;\n }\n static get branch() {\n if (Input.getInput(`GITHUB_REF`)) {\n return Input.getInput(`GITHUB_REF`).replace('refs/', '').replace(`head/`, '').replace(`heads/`, '');\n }\n else if (Input.getInput('branch')) {\n return Input.getInput('branch');\n }\n else {\n return '';\n }\n }\n static get gitSha() {\n if (Input.getInput(`GITHUB_SHA`)) {\n return Input.getInput(`GITHUB_SHA`);\n }\n else if (Input.getInput(`GitSHA`)) {\n return Input.getInput(`GitSHA`);\n }\n return '';\n }\n static get runNumber() {\n return Input.getInput('GITHUB_RUN_NUMBER') || '0';\n }\n static get targetPlatform() {\n return Input.getInput('targetPlatform') || platform_1.default.default;\n }\n static get unityVersion() {\n return Input.getInput('unityVersion') || 'auto';\n }\n static get customImage() {\n return Input.getInput('customImage') || '';\n }\n static get projectPath() {\n const input = Input.getInput('projectPath');\n let rawProjectPath;\n if (input) {\n rawProjectPath = input;\n }\n else if (node_fs_1.default.existsSync(node_path_1.default.join('test-project', 'ProjectSettings', 'ProjectVersion.txt')) &&\n !node_fs_1.default.existsSync(node_path_1.default.join('ProjectSettings', 'ProjectVersion.txt'))) {\n rawProjectPath = 'test-project';\n }\n else {\n rawProjectPath = '.';\n }\n return rawProjectPath.replace(/\\/$/, '');\n }\n static get runnerTempPath() {\n return Input.getInput('RUNNER_TEMP') || '';\n }\n static get buildName() {\n return Input.getInput('buildName') || Input.targetPlatform;\n }\n static get buildsPath() {\n return Input.getInput('buildsPath') || 'build';\n }\n static get unityLicensingServer() {\n return Input.getInput('unityLicensingServer') || '';\n }\n static get buildMethod() {\n return Input.getInput('buildMethod') || ''; // Processed in docker file\n }\n static get manualExit() {\n const input = Input.getInput('manualExit') || false;\n return input === 'true';\n }\n static get customParameters() {\n return Input.getInput('customParameters') || '';\n }\n static get versioningStrategy() {\n return Input.getInput('versioning') || 'Semantic';\n }\n static get specifiedVersion() {\n return Input.getInput('version') || '';\n }\n static get androidVersionCode() {\n return Input.getInput('androidVersionCode') || '';\n }\n static get androidExportType() {\n return Input.getInput('androidExportType') || 'androidPackage';\n }\n static get androidKeystoreName() {\n return Input.getInput('androidKeystoreName') || '';\n }\n static get androidKeystoreBase64() {\n return Input.getInput('androidKeystoreBase64') || '';\n }\n static get androidKeystorePass() {\n return Input.getInput('androidKeystorePass') || '';\n }\n static get androidKeyaliasName() {\n return Input.getInput('androidKeyaliasName') || '';\n }\n static get androidKeyaliasPass() {\n return Input.getInput('androidKeyaliasPass') || '';\n }\n static get androidTargetSdkVersion() {\n return Input.getInput('androidTargetSdkVersion') || '';\n }\n static get androidSymbolType() {\n return Input.getInput('androidSymbolType') || 'none';\n }\n static get sshAgent() {\n return Input.getInput('sshAgent') || '';\n }\n static get sshPublicKeysDirectoryPath() {\n return Input.getInput('sshPublicKeysDirectoryPath') || '';\n }\n static get gitPrivateToken() {\n return Input.getInput('gitPrivateToken');\n }\n static get runAsHostUser() {\n return Input.getInput('runAsHostUser') || 'false';\n }\n static get chownFilesTo() {\n return Input.getInput('chownFilesTo') || '';\n }\n static get allowDirtyBuild() {\n const input = Input.getInput('allowDirtyBuild') || false;\n return input === 'true';\n }\n static get cacheUnityInstallationOnMac() {\n const input = Input.getInput('cacheUnityInstallationOnMac') || false;\n return input === 'true';\n }\n static get unityHubVersionOnMac() {\n const input = Input.getInput('unityHubVersionOnMac') || '';\n return input !== '' ? input : '';\n }\n static get unitySerial() {\n return Input.getInput('UNITY_SERIAL');\n }\n static get unityLicense() {\n return Input.getInput('UNITY_LICENSE');\n }\n static get dockerWorkspacePath() {\n return Input.getInput('dockerWorkspacePath') || '/github/workspace';\n }\n static get dockerCpuLimit() {\n return Input.getInput('dockerCpuLimit') || node_os_1.default.cpus().length.toString();\n }\n static get dockerMemoryLimit() {\n const bytesInMegabyte = 1024 * 1024;\n let memoryMultiplier;\n switch (node_os_1.default.platform()) {\n case 'linux':\n memoryMultiplier = 0.95;\n break;\n case 'win32':\n memoryMultiplier = 0.8;\n break;\n default:\n memoryMultiplier = 0.75;\n break;\n }\n return (Input.getInput('dockerMemoryLimit') || `${Math.floor((node_os_1.default.totalmem() / bytesInMegabyte) * memoryMultiplier)}m`);\n }\n static get dockerIsolationMode() {\n return Input.getInput('dockerIsolationMode') || 'default';\n }\n static get containerRegistryRepository() {\n return Input.getInput('containerRegistryRepository');\n }\n static get containerRegistryImageVersion() {\n return Input.getInput('containerRegistryImageVersion');\n }\n static ToEnvVarFormat(input) {\n if (input.toUpperCase() === input) {\n return input;\n }\n return input\n .replace(/([A-Z])/g, ' $1')\n .trim()\n .toUpperCase()\n .replace(/ /g, '_');\n }\n}\nexports.default = Input;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exec_1 = require(\"@actions/exec\");\nclass MacBuilder {\n static async run(actionFolder, silent = false) {\n return await (0, exec_1.exec)('bash', [`${actionFolder}/platforms/mac/entrypoint.sh`], {\n silent,\n ignoreReturnCode: true,\n });\n }\n}\nexports.default = MacBuilder;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nclass Output {\n static async setBuildVersion(buildVersion) {\n core.setOutput('buildVersion', buildVersion);\n }\n static async setAndroidVersionCode(androidVersionCode) {\n core.setOutput('androidVersionCode', androidVersionCode);\n }\n static async setEngineExitCode(exitCode) {\n core.setOutput('engineExitCode', exitCode);\n }\n}\nexports.default = Output;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst core = __importStar(require(\"@actions/core\"));\nconst platform_setup_1 = require(\"./platform-setup/\");\nconst validate_windows_1 = __importDefault(require(\"./platform-validation/validate-windows\"));\nclass PlatformSetup {\n static async setup(buildParameters, actionFolder) {\n PlatformSetup.SetupShared(buildParameters, actionFolder);\n switch (process.platform) {\n case 'win32':\n validate_windows_1.default.validate(buildParameters);\n platform_setup_1.SetupWindows.setup(buildParameters);\n break;\n case 'darwin':\n await platform_setup_1.SetupMac.setup(buildParameters, actionFolder);\n break;\n // Add other baseOS's here\n }\n }\n static SetupShared(buildParameters, actionFolder) {\n const servicesConfigPath = `${actionFolder}/unity-config/services-config.json`;\n const servicesConfigPathTemplate = `${servicesConfigPath}.template`;\n if (!node_fs_1.default.existsSync(servicesConfigPathTemplate)) {\n core.error(`Missing services config ${servicesConfigPathTemplate}`);\n return;\n }\n let servicesConfig = node_fs_1.default.readFileSync(servicesConfigPathTemplate).toString();\n servicesConfig = servicesConfig.replace('%URL%', buildParameters.unityLicensingServer);\n node_fs_1.default.writeFileSync(servicesConfigPath, servicesConfig);\n platform_setup_1.SetupAndroid.setup(buildParameters);\n }\n}\nexports.default = PlatformSetup;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SetupAndroid = exports.SetupMac = exports.SetupWindows = void 0;\nconst setup_windows_1 = __importDefault(require(\"./setup-windows\"));\nexports.SetupWindows = setup_windows_1.default;\nconst setup_mac_1 = __importDefault(require(\"./setup-mac\"));\nexports.SetupMac = setup_mac_1.default;\nconst setup_android_1 = __importDefault(require(\"./setup-android\"));\nexports.SetupAndroid = setup_android_1.default;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst node_path_1 = __importDefault(require(\"node:path\"));\nclass SetupAndroid {\n static async setup(buildParameters) {\n const { targetPlatform, androidKeystoreBase64, androidKeystoreName, projectPath } = buildParameters;\n if (targetPlatform === 'Android' && androidKeystoreBase64 !== '' && androidKeystoreName !== '') {\n SetupAndroid.setupAndroidRun(androidKeystoreBase64, androidKeystoreName, projectPath);\n }\n }\n static setupAndroidRun(androidKeystoreBase64, androidKeystoreName, projectPath) {\n const decodedKeystore = Buffer.from(androidKeystoreBase64, 'base64').toString('binary');\n const githubWorkspace = process.env.GITHUB_WORKSPACE || '';\n node_fs_1.default.writeFileSync(node_path_1.default.join(githubWorkspace, projectPath, androidKeystoreName), decodedKeystore, 'binary');\n }\n}\nexports.default = SetupAndroid;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst unity_changeset_1 = require(\"unity-changeset\");\nconst exec_1 = require(\"@actions/exec\");\nconst cache_1 = require(\"@actions/cache\");\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nclass SetupMac {\n static async setup(buildParameters, actionFolder) {\n const unityEditorPath = `/Applications/Unity/Hub/Editor/${buildParameters.editorVersion}/Unity.app/Contents/MacOS/Unity`;\n if (!node_fs_1.default.existsSync(this.unityHubExecPath.replace(/\"/g, ''))) {\n await SetupMac.installUnityHub(buildParameters);\n }\n if (!node_fs_1.default.existsSync(unityEditorPath.replace(/\"/g, ''))) {\n await SetupMac.installUnity(buildParameters);\n }\n await SetupMac.setEnvironmentVariables(buildParameters, actionFolder);\n }\n static async installUnityHub(buildParameters, silent = false) {\n // Can't use quotes in the cache package so we need a different path\n const unityHubCachePath = `/Applications/Unity\\\\ Hub.app`;\n const targetHubVersion = buildParameters.unityHubVersionOnMac !== ''\n ? buildParameters.unityHubVersionOnMac\n : await SetupMac.getLatestUnityHubVersion();\n const restoreKey = `Cache-MacOS-UnityHub@${targetHubVersion}`;\n if (buildParameters.cacheUnityInstallationOnMac) {\n const cacheId = await (0, cache_1.restoreCache)([unityHubCachePath], restoreKey);\n if (cacheId) {\n // Cache restored successfully, unity hub is installed now\n return;\n }\n }\n const commandSuffix = buildParameters.unityHubVersionOnMac !== '' ? `@${buildParameters.unityHubVersionOnMac}` : '';\n const command = `brew install unity-hub${commandSuffix}`;\n // Ignoring return code because the log seems to overflow the internal buffer which triggers\n // a false error\n const errorCode = await (0, exec_1.exec)(command, undefined, {\n silent,\n ignoreReturnCode: true,\n });\n if (errorCode) {\n throw new Error(`There was an error installing the Unity Editor. See logs above for details.`);\n }\n if (buildParameters.cacheUnityInstallationOnMac) {\n await (0, cache_1.saveCache)([unityHubCachePath], restoreKey);\n }\n }\n /**\n * Gets the latest version of Unity Hub available on brew\n * @returns The latest version of Unity Hub available on brew\n */\n static async getLatestUnityHubVersion() {\n // Need to check if the latest version available is the same as the one we have cached\n const hubVersionCommand = `/bin/bash -c \"brew info unity-hub | grep -o '[0-9]\\\\+\\\\.[0-9]\\\\+\\\\.[0-9]\\\\+'\"`;\n const result = await (0, exec_1.getExecOutput)(hubVersionCommand, undefined, {\n silent: true,\n });\n if (result.exitCode === 0 && result.stdout !== '') {\n return result.stdout;\n }\n return '';\n }\n static getArchitectureParameters() {\n const architectureArgument = [];\n switch (process.arch) {\n case 'x64':\n architectureArgument.push('--architecture', 'x86_64');\n break;\n case 'arm64':\n architectureArgument.push('--architecture', 'arm64');\n break;\n default:\n throw new Error(`Unsupported architecture: ${process.arch}.`);\n }\n return architectureArgument;\n }\n static getModuleParametersForTargetPlatform(targetPlatform) {\n const moduleArgument = [];\n switch (targetPlatform) {\n case 'iOS':\n moduleArgument.push('--module', 'ios');\n break;\n case 'tvOS':\n moduleArgument.push('--module', 'tvos');\n break;\n case 'StandaloneOSX':\n moduleArgument.push('--module', 'mac-il2cpp');\n break;\n case 'Android':\n moduleArgument.push('--module', 'android');\n break;\n case 'WebGL':\n moduleArgument.push('--module', 'webgl');\n break;\n default:\n throw new Error(`Unsupported module for target platform: ${targetPlatform}.`);\n }\n return moduleArgument;\n }\n static async installUnity(buildParameters, silent = false) {\n const unityEditorPath = `/Applications/Unity/Hub/Editor/${buildParameters.editorVersion}`;\n const key = `Cache-MacOS-UnityEditor-With-Module-${buildParameters.targetPlatform}@${buildParameters.editorVersion}`;\n if (buildParameters.cacheUnityInstallationOnMac) {\n const cacheId = await (0, cache_1.restoreCache)([unityEditorPath], key);\n if (cacheId) {\n // Cache restored successfully, unity editor is installed now\n return;\n }\n }\n const unityChangeset = await (0, unity_changeset_1.getUnityChangeset)(buildParameters.editorVersion);\n const moduleArguments = SetupMac.getModuleParametersForTargetPlatform(buildParameters.targetPlatform);\n const architectureArguments = SetupMac.getArchitectureParameters();\n const execArguments = [\n '--',\n '--headless',\n 'install',\n ...['--version', buildParameters.editorVersion],\n ...['--changeset', unityChangeset.changeset],\n ...moduleArguments,\n ...architectureArguments,\n '--childModules',\n ];\n // Ignoring return code because the log seems to overflow the internal buffer which triggers\n // a false error\n const errorCode = await (0, exec_1.exec)(this.unityHubExecPath, execArguments, {\n silent,\n ignoreReturnCode: true,\n });\n if (errorCode) {\n throw new Error(`There was an error installing the Unity Editor. See logs above for details.`);\n }\n if (buildParameters.cacheUnityInstallationOnMac) {\n await (0, cache_1.saveCache)([unityEditorPath], key);\n }\n }\n static async setEnvironmentVariables(buildParameters, actionFolder) {\n // Need to set environment variables from here because we execute\n // the scripts on the host for mac\n process.env.ACTION_FOLDER = actionFolder;\n process.env.UNITY_VERSION = buildParameters.editorVersion;\n process.env.UNITY_SERIAL = buildParameters.unitySerial;\n process.env.UNITY_LICENSING_SERVER = buildParameters.unityLicensingServer;\n process.env.PROJECT_PATH = buildParameters.projectPath;\n process.env.BUILD_TARGET = buildParameters.targetPlatform;\n process.env.BUILD_NAME = buildParameters.buildName;\n process.env.BUILD_PATH = buildParameters.buildPath;\n process.env.BUILD_FILE = buildParameters.buildFile;\n process.env.BUILD_METHOD = buildParameters.buildMethod;\n process.env.VERSION = buildParameters.buildVersion;\n process.env.ANDROID_VERSION_CODE = buildParameters.androidVersionCode;\n process.env.ANDROID_KEYSTORE_NAME = buildParameters.androidKeystoreName;\n process.env.ANDROID_KEYSTORE_BASE64 = buildParameters.androidKeystoreBase64;\n process.env.ANDROID_KEYSTORE_PASS = buildParameters.androidKeystorePass;\n process.env.ANDROID_KEYALIAS_NAME = buildParameters.androidKeyaliasName;\n process.env.ANDROID_KEYALIAS_PASS = buildParameters.androidKeyaliasPass;\n process.env.ANDROID_TARGET_SDK_VERSION = buildParameters.androidTargetSdkVersion;\n process.env.ANDROID_SDK_MANAGER_PARAMETERS = buildParameters.androidSdkManagerParameters;\n process.env.ANDROID_EXPORT_TYPE = buildParameters.androidExportType;\n process.env.ANDROID_SYMBOL_TYPE = buildParameters.androidSymbolType;\n process.env.CUSTOM_PARAMETERS = buildParameters.customParameters;\n process.env.CHOWN_FILES_TO = buildParameters.chownFilesTo;\n process.env.MANUAL_EXIT = buildParameters.manualExit.toString();\n }\n}\nSetupMac.unityHubBasePath = `/Applications/\"Unity Hub.app\"`;\nSetupMac.unityHubExecPath = `${SetupMac.unityHubBasePath}/Contents/MacOS/\"Unity Hub\"`;\nexports.default = SetupMac;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst exec_1 = require(\"@actions/exec\");\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nclass SetupWindows {\n static async setup(buildParameters) {\n const { targetPlatform } = buildParameters;\n await SetupWindows.setupWindowsRun(targetPlatform);\n }\n static async setupWindowsRun(targetPlatform, silent = false) {\n if (!node_fs_1.default.existsSync('c:/regkeys')) {\n node_fs_1.default.mkdirSync('c:/regkeys');\n }\n // These all need the Windows 10 SDK\n switch (targetPlatform) {\n case 'StandaloneWindows':\n case 'StandaloneWindows64':\n case 'WSAPlayer':\n await this.generateWinSDKRegKeys(silent);\n break;\n }\n }\n static async generateWinSDKRegKeys(silent = false) {\n // Export registry keys that point to the Windows 10 SDK\n const exportWinSDKRegKeysCommand = 'reg export \"HKLM\\\\SOFTWARE\\\\WOW6432Node\\\\Microsoft\\\\Microsoft SDKs\\\\Windows\\\\v10.0\" c:/regkeys/winsdk.reg /y';\n await (0, exec_1.exec)(exportWinSDKRegKeysCommand, undefined, { silent });\n }\n}\nexports.default = SetupWindows;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nclass ValidateWindows {\n static validate(buildParameters) {\n ValidateWindows.validateWindowsPlatformRequirements(buildParameters.targetPlatform);\n if (!(process.env.UNITY_EMAIL && process.env.UNITY_PASSWORD)) {\n throw new Error(`Unity email and password must be set for Windows based builds to\n authenticate the license. Make sure to set them inside UNITY_EMAIL\n and UNITY_PASSWORD in Github Secrets and pass them into the environment.`);\n }\n }\n static validateWindowsPlatformRequirements(platform) {\n switch (platform) {\n case 'StandaloneWindows':\n case 'StandaloneWindows64':\n case 'WSAPlayer':\n this.checkForVisualStudio();\n this.checkForWin10SDK();\n break;\n case 'tvOS':\n this.checkForVisualStudio();\n break;\n }\n }\n static checkForWin10SDK() {\n // Check for Windows 10 SDK on runner\n const windows10SDKPathExists = node_fs_1.default.existsSync('C:/Program Files (x86)/Windows Kits');\n if (!windows10SDKPathExists) {\n throw new Error(`Windows 10 SDK not found in default location. Make sure\n the runner has a Windows 10 SDK installed in the default\n location.`);\n }\n }\n static checkForVisualStudio() {\n // Note: When upgrading to Server 2022, we will need to move to just \"program files\" since VS will be 64-bit\n const visualStudioInstallPathExists = node_fs_1.default.existsSync('C:/Program Files (x86)/Microsoft Visual Studio');\n const visualStudioDataPathExists = node_fs_1.default.existsSync('C:/ProgramData/Microsoft/VisualStudio');\n if (!visualStudioInstallPathExists || !visualStudioDataPathExists) {\n throw new Error(`Visual Studio not found at the default location.\n Make sure the runner has Visual Studio installed in the\n default location`);\n }\n }\n}\nexports.default = ValidateWindows;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass Platform {\n static get default() {\n return Platform.types.StandaloneWindows64;\n }\n static get types() {\n return {\n StandaloneOSX: 'StandaloneOSX',\n StandaloneWindows: 'StandaloneWindows',\n StandaloneWindows64: 'StandaloneWindows64',\n StandaloneLinux64: 'StandaloneLinux64',\n iOS: 'iOS',\n Android: 'Android',\n WebGL: 'WebGL',\n WSAPlayer: 'WSAPlayer',\n PS4: 'PS4',\n XboxOne: 'XboxOne',\n tvOS: 'tvOS',\n Switch: 'Switch',\n // Unsupported\n Lumin: 'Lumin',\n BJM: 'BJM',\n Stadia: 'Stadia',\n Facebook: 'Facebook',\n NoTarget: 'NoTarget',\n // Test specific\n Test: 'Test',\n };\n }\n static isWindows(platform) {\n switch (platform) {\n case Platform.types.StandaloneWindows:\n case Platform.types.StandaloneWindows64:\n return true;\n default:\n return false;\n }\n }\n static isAndroid(platform) {\n switch (platform) {\n case Platform.types.Android:\n return true;\n default:\n return false;\n }\n }\n}\nexports.default = Platform;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst input_1 = __importDefault(require(\"./input\"));\nconst unity_1 = __importDefault(require(\"./unity\"));\nconst action_1 = __importDefault(require(\"./action\"));\nclass Project {\n static get relativePath() {\n const { projectPath } = input_1.default;\n return `${projectPath}`;\n }\n static get absolutePath() {\n const { workspace } = action_1.default;\n return `${workspace}/${this.relativePath}`;\n }\n static get libraryFolder() {\n return `${this.relativePath}/${unity_1.default.libraryFolder}`;\n }\n}\nexports.default = Project;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst exec_1 = require(\"@actions/exec\");\nclass System {\n static async run(command, arguments_ = [], options = {}, shouldLog = true) {\n let result = '';\n let error = '';\n let debug = '';\n const listeners = {\n stdout: (dataBuffer) => {\n result += dataBuffer.toString();\n },\n stderr: (dataBuffer) => {\n error += dataBuffer.toString();\n },\n debug: (dataString) => {\n debug += dataString;\n },\n };\n const showOutput = () => {\n if (debug !== '' && shouldLog) {\n core.debug(debug);\n }\n if (result !== '' && shouldLog) {\n core.info(result);\n }\n if (error !== '' && shouldLog) {\n core.warning(error);\n }\n };\n const throwContextualError = (message) => {\n let commandAsString = command;\n if (Array.isArray(arguments_)) {\n commandAsString += ` ${arguments_.join(' ')}`;\n }\n else if (typeof arguments_ === 'string') {\n commandAsString += ` ${arguments_}`;\n }\n throw new Error(`Failed to run \"${commandAsString}\".\\n ${message}`);\n };\n try {\n if (command.trim() === '') {\n throw new Error(`Failed to execute empty command`);\n }\n const exitCode = await (0, exec_1.exec)(command, arguments_, { silent: true, listeners, ...options });\n showOutput();\n if (exitCode !== 0) {\n throwContextualError(`Command returned non-zero exit code.\\nError: ${error}`);\n }\n }\n catch (inCommandError) {\n showOutput();\n throwContextualError(`In-command error caught: ${inCommandError}`);\n }\n return result;\n }\n}\nexports.default = System;\n","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst node_fs_1 = __importDefault(require(\"node:fs\"));\nconst node_path_1 = __importDefault(require(\"node:path\"));\nclass UnityVersioning {\n static get versionPattern() {\n return /20\\d{2}\\.\\d\\.\\w{3,4}|3/;\n }\n static determineUnityVersion(projectPath, unityVersion) {\n if (unityVersion === 'auto') {\n return UnityVersioning.read(projectPath);\n }\n return unityVersion;\n }\n static read(projectPath) {\n const filePath = node_path_1.default.join(projectPath, 'ProjectSettings', 'ProjectVersion.txt');\n if (!node_fs_1.default.existsSync(filePath)) {\n throw new Error(`Project settings file not found at \"${filePath}\". Have you correctly set the projectPath?`);\n }\n return UnityVersioning.parse(node_fs_1.default.readFileSync(filePath, 'utf8'));\n }\n static parse(projectVersionTxt) {\n const matches = projectVersionTxt.match(UnityVersioning.versionPattern);\n if (!matches || matches.length === 0) {\n throw new Error(`Failed to parse version from \"${projectVersionTxt}\".`);\n }\n return matches[0];\n }\n}\nexports.default = UnityVersioning;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass Unity {\n static get libraryFolder() {\n return 'Library';\n }\n}\nexports.default = Unity;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst core = __importStar(require(\"@actions/core\"));\nconst not_implemented_exception_1 = __importDefault(require(\"./error/not-implemented-exception\"));\nconst validation_error_1 = __importDefault(require(\"./error/validation-error\"));\nconst input_1 = __importDefault(require(\"./input\"));\nconst system_1 = __importDefault(require(\"./system\"));\nclass Versioning {\n static get strategies() {\n return { None: 'None', Semantic: 'Semantic', Tag: 'Tag', Custom: 'Custom' };\n }\n static get grepCompatibleInputVersionRegex() {\n return '^v?([0-9]+\\\\.)*[0-9]+.*';\n }\n /**\n * Get the branch name of the (related) branch\n */\n static get branch() {\n return this.headRef || this.ref?.slice(11);\n }\n /**\n * For pull requests we can reliably use GITHUB_HEAD_REF\n */\n static get headRef() {\n return process.env.GITHUB_HEAD_REF;\n }\n /**\n * For branches GITHUB_REF will have format `refs/heads/feature-branch-1`\n */\n static get ref() {\n return process.env.GITHUB_REF;\n }\n /**\n * Maximum number of lines to print when logging the git diff\n */\n static get maxDiffLines() {\n return 60;\n }\n /**\n * Log up to maxDiffLines of the git diff.\n */\n static async logDiff() {\n const diffCommand = `git --no-pager diff | head -n ${this.maxDiffLines.toString()}`;\n await system_1.default.run('sh', undefined, {\n input: Buffer.from(diffCommand),\n silent: true,\n }, false);\n }\n /**\n * Regex to parse version description into separate fields\n */\n static get descriptionRegexes() {\n return [\n /^v?([\\d.]+)-(\\d+)-g(\\w+)-?(\\w+)*/g,\n /^v?([\\d.]+-\\w+)-(\\d+)-g(\\w+)-?(\\w+)*/g,\n /^v?([\\d.]+-\\w+\\.\\d+)-(\\d+)-g(\\w+)-?(\\w+)*/g,\n ];\n }\n static async determineBuildVersion(strategy, inputVersion) {\n // Validate input\n if (!Object.hasOwnProperty.call(this.strategies, strategy)) {\n throw new validation_error_1.default(`Versioning strategy should be one of ${Object.values(this.strategies).join(', ')}.`);\n }\n switch (strategy) {\n case this.strategies.None:\n return 'none';\n case this.strategies.Custom:\n return inputVersion;\n case this.strategies.Semantic:\n return await this.generateSemanticVersion();\n case this.strategies.Tag:\n return await this.generateTagVersion();\n default:\n throw new not_implemented_exception_1.default(`Strategy ${strategy} is not implemented.`);\n }\n }\n /**\n * Automatically generates a version based on SemVer out of the box.\n *\n * The version works as follows: `..` for example `0.1.2`.\n *\n * The latest tag dictates `.`\n * The number of commits since that tag dictates``.\n *\n * @See: https://semver.org/\n */\n static async generateSemanticVersion() {\n if (await this.isShallow()) {\n await this.fetch();\n }\n await this.logDiff();\n if ((await this.isDirty()) && !input_1.default.allowDirtyBuild) {\n throw new Error('Branch is dirty. Refusing to base semantic version on uncommitted changes');\n }\n if (!(await this.hasAnyVersionTags())) {\n const version = `0.0.${await this.getTotalNumberOfCommits()}`;\n core.info(`Generated version ${version} (no version tags found).`);\n return version;\n }\n const versionDescriptor = await this.parseSemanticVersion();\n if (versionDescriptor) {\n const { tag, commits, hash } = versionDescriptor;\n // Ensure 3 digits (commits should always be patch level)\n const [major, minor, patch] = `${tag}.${commits}`.split('.');\n const threeDigitVersion = /^\\d+$/.test(patch) ? `${major}.${minor}.${patch}` : `${major}.0.${minor}`;\n core.info(`Found semantic version ${threeDigitVersion} for ${this.branch}@${hash}`);\n return `${threeDigitVersion}`;\n }\n const version = `0.0.${await this.getTotalNumberOfCommits()}`;\n core.info(`Generated version ${version} (semantic version couldn't be determined).`);\n return version;\n }\n /**\n * Generate the proper version for unity based on an existing tag.\n */\n static async generateTagVersion() {\n let tag = await this.getTag();\n if (tag.charAt(0) === 'v') {\n tag = tag.slice(1);\n }\n return tag;\n }\n /**\n * Parses the versionDescription into their named parts.\n */\n static async parseSemanticVersion() {\n const description = await this.getVersionDescription();\n for (const descriptionRegex of Versioning.descriptionRegexes) {\n try {\n const [match, tag, commits, hash] = descriptionRegex.exec(description);\n return {\n match,\n tag,\n commits,\n hash,\n };\n }\n catch {\n continue;\n }\n }\n core.warning(`Failed to parse git describe output or version can not be determined through: \"${description}\".`);\n return false;\n }\n /**\n * Returns whether the repository is shallow.\n */\n static async isShallow() {\n const output = await this.git(['rev-parse', '--is-shallow-repository']);\n return output !== 'false\\n';\n }\n /**\n * Retrieves refs from the configured remote.\n *\n * Fetch unshallow for incomplete repository, but fall back to normal fetch.\n *\n * Note: `--all` should not be used, and would break fetching for push event.\n */\n static async fetch() {\n try {\n await this.git(['fetch', '--unshallow']);\n }\n catch (error) {\n core.warning(`Fetch --unshallow caught: ${error}`);\n await this.git(['fetch']);\n }\n }\n /**\n * Retrieves information about the branch.\n *\n * Format: `v0.12-24-gd2198ab`\n *\n * In this format v0.12 is the latest tag, 24 are the number of commits since, and gd2198ab\n * identifies the current commit.\n */\n static async getVersionDescription() {\n return this.git(['describe', '--long', '--tags', '--always', 'HEAD']);\n }\n /**\n * Returns whether there are uncommitted changes that are not ignored.\n */\n static async isDirty() {\n const output = await this.git(['status', '--porcelain']);\n const isDirty = output !== '';\n if (isDirty) {\n core.warning('Changes were made to the following files and folders:\\n');\n core.warning(output);\n }\n return isDirty;\n }\n /**\n * Get the tag if there is one pointing at HEAD\n */\n static async getTag() {\n return (await this.git(['tag', '--points-at', 'HEAD'])).trim();\n }\n /**\n * Whether the current tree has any version tags yet.\n *\n * Note: Currently this is run in all OSes, so the syntax must be cross-platform.\n */\n static async hasAnyVersionTags() {\n const numberOfTagsAsString = await system_1.default.run('sh', undefined, {\n input: Buffer.from(`git tag --list --merged HEAD | grep -E '${this.grepCompatibleInputVersionRegex}' | wc -l`),\n cwd: input_1.default.projectPath,\n silent: false,\n });\n const numberOfTags = Number.parseInt(numberOfTagsAsString, 10);\n return numberOfTags !== 0;\n }\n /**\n * Get the total number of commits on head.\n *\n */\n static async getTotalNumberOfCommits() {\n const numberOfCommitsAsString = await this.git(['rev-list', '--count', 'HEAD']);\n return Number.parseInt(numberOfCommitsAsString, 10);\n }\n /**\n * Run git in the specified project path\n */\n static async git(arguments_, options = {}) {\n return system_1.default.run('git', arguments_, { cwd: input_1.default.projectPath, ...options }, false);\n }\n}\nexports.default = Versioning;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.saveCache = exports.restoreCache = exports.isFeatureAvailable = exports.ReserveCacheError = exports.ValidationError = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst path = __importStar(require(\"path\"));\nconst utils = __importStar(require(\"./internal/cacheUtils\"));\nconst cacheHttpClient = __importStar(require(\"./internal/cacheHttpClient\"));\nconst tar_1 = require(\"./internal/tar\");\nclass ValidationError extends Error {\n constructor(message) {\n super(message);\n this.name = 'ValidationError';\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\nexports.ValidationError = ValidationError;\nclass ReserveCacheError extends Error {\n constructor(message) {\n super(message);\n this.name = 'ReserveCacheError';\n Object.setPrototypeOf(this, ReserveCacheError.prototype);\n }\n}\nexports.ReserveCacheError = ReserveCacheError;\nfunction checkPaths(paths) {\n if (!paths || paths.length === 0) {\n throw new ValidationError(`Path Validation Error: At least one directory or file path is required`);\n }\n}\nfunction checkKey(key) {\n if (key.length > 512) {\n throw new ValidationError(`Key Validation Error: ${key} cannot be larger than 512 characters.`);\n }\n const regex = /^[^,]*$/;\n if (!regex.test(key)) {\n throw new ValidationError(`Key Validation Error: ${key} cannot contain commas.`);\n }\n}\n/**\n * isFeatureAvailable to check the presence of Actions cache service\n *\n * @returns boolean return true if Actions cache service feature is available, otherwise false\n */\nfunction isFeatureAvailable() {\n return !!process.env['ACTIONS_CACHE_URL'];\n}\nexports.isFeatureAvailable = isFeatureAvailable;\n/**\n * Restores cache from keys\n *\n * @param paths a list of file paths to restore from the cache\n * @param primaryKey an explicit key for restoring the cache\n * @param restoreKeys an optional ordered list of keys to use for restoring the cache if no cache hit occurred for key\n * @param downloadOptions cache download options\n * @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform\n * @returns string returns the key for the cache hit, otherwise returns undefined\n */\nfunction restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArchive = false) {\n return __awaiter(this, void 0, void 0, function* () {\n checkPaths(paths);\n restoreKeys = restoreKeys || [];\n const keys = [primaryKey, ...restoreKeys];\n core.debug('Resolved Keys:');\n core.debug(JSON.stringify(keys));\n if (keys.length > 10) {\n throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`);\n }\n for (const key of keys) {\n checkKey(key);\n }\n const compressionMethod = yield utils.getCompressionMethod();\n let archivePath = '';\n try {\n // path are needed to compute version\n const cacheEntry = yield cacheHttpClient.getCacheEntry(keys, paths, {\n compressionMethod,\n enableCrossOsArchive\n });\n if (!(cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.archiveLocation)) {\n // Cache not found\n return undefined;\n }\n if (options === null || options === void 0 ? void 0 : options.lookupOnly) {\n core.info('Lookup only - skipping download');\n return cacheEntry.cacheKey;\n }\n archivePath = path.join(yield utils.createTempDirectory(), utils.getCacheFileName(compressionMethod));\n core.debug(`Archive Path: ${archivePath}`);\n // Download the cache from the cache entry\n yield cacheHttpClient.downloadCache(cacheEntry.archiveLocation, archivePath, options);\n if (core.isDebug()) {\n yield (0, tar_1.listTar)(archivePath, compressionMethod);\n }\n const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);\n core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);\n yield (0, tar_1.extractTar)(archivePath, compressionMethod);\n core.info('Cache restored successfully');\n return cacheEntry.cacheKey;\n }\n catch (error) {\n const typedError = error;\n if (typedError.name === ValidationError.name) {\n throw error;\n }\n else {\n // Supress all non-validation cache related errors because caching should be optional\n core.warning(`Failed to restore: ${error.message}`);\n }\n }\n finally {\n // Try to delete the archive to save space\n try {\n yield utils.unlinkFile(archivePath);\n }\n catch (error) {\n core.debug(`Failed to delete archive: ${error}`);\n }\n }\n return undefined;\n });\n}\nexports.restoreCache = restoreCache;\n/**\n * Saves a list of files with the specified key\n *\n * @param paths a list of file paths to be cached\n * @param key an explicit key for restoring the cache\n * @param enableCrossOsArchive an optional boolean enabled to save cache on windows which could be restored on any platform\n * @param options cache upload options\n * @returns number returns cacheId if the cache was saved successfully and throws an error if save fails\n */\nfunction saveCache(paths, key, options, enableCrossOsArchive = false) {\n var _a, _b, _c, _d, _e;\n return __awaiter(this, void 0, void 0, function* () {\n checkPaths(paths);\n checkKey(key);\n const compressionMethod = yield utils.getCompressionMethod();\n let cacheId = -1;\n const cachePaths = yield utils.resolvePaths(paths);\n core.debug('Cache Paths:');\n core.debug(`${JSON.stringify(cachePaths)}`);\n if (cachePaths.length === 0) {\n throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`);\n }\n const archiveFolder = yield utils.createTempDirectory();\n const archivePath = path.join(archiveFolder, utils.getCacheFileName(compressionMethod));\n core.debug(`Archive Path: ${archivePath}`);\n try {\n yield (0, tar_1.createTar)(archiveFolder, cachePaths, compressionMethod);\n if (core.isDebug()) {\n yield (0, tar_1.listTar)(archivePath, compressionMethod);\n }\n const fileSizeLimit = 10 * 1024 * 1024 * 1024; // 10GB per repo limit\n const archiveFileSize = utils.getArchiveFileSizeInBytes(archivePath);\n core.debug(`File Size: ${archiveFileSize}`);\n // For GHES, this check will take place in ReserveCache API with enterprise file size limit\n if (archiveFileSize > fileSizeLimit && !utils.isGhes()) {\n throw new Error(`Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the 10GB limit, not saving cache.`);\n }\n core.debug('Reserving Cache');\n const reserveCacheResponse = yield cacheHttpClient.reserveCache(key, paths, {\n compressionMethod,\n enableCrossOsArchive,\n cacheSize: archiveFileSize\n });\n if ((_a = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _a === void 0 ? void 0 : _a.cacheId) {\n cacheId = (_b = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.result) === null || _b === void 0 ? void 0 : _b.cacheId;\n }\n else if ((reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.statusCode) === 400) {\n throw new Error((_d = (_c = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`);\n }\n else {\n throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`);\n }\n core.debug(`Saving Cache (ID: ${cacheId})`);\n yield cacheHttpClient.saveCache(cacheId, archivePath, options);\n }\n catch (error) {\n const typedError = error;\n if (typedError.name === ValidationError.name) {\n throw error;\n }\n else if (typedError.name === ReserveCacheError.name) {\n core.info(`Failed to save: ${typedError.message}`);\n }\n else {\n core.warning(`Failed to save: ${typedError.message}`);\n }\n }\n finally {\n // Try to delete the archive to save space\n try {\n yield utils.unlinkFile(archivePath);\n }\n catch (error) {\n core.debug(`Failed to delete archive: ${error}`);\n }\n }\n return cacheId;\n });\n}\nexports.saveCache = saveCache;\n//# sourceMappingURL=cache.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.saveCache = exports.reserveCache = exports.downloadCache = exports.getCacheEntry = exports.getCacheVersion = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst crypto = __importStar(require(\"crypto\"));\nconst fs = __importStar(require(\"fs\"));\nconst url_1 = require(\"url\");\nconst utils = __importStar(require(\"./cacheUtils\"));\nconst downloadUtils_1 = require(\"./downloadUtils\");\nconst options_1 = require(\"../options\");\nconst requestUtils_1 = require(\"./requestUtils\");\nconst versionSalt = '1.0';\nfunction getCacheApiUrl(resource) {\n const baseUrl = process.env['ACTIONS_CACHE_URL'] || '';\n if (!baseUrl) {\n throw new Error('Cache Service Url not found, unable to restore cache.');\n }\n const url = `${baseUrl}_apis/artifactcache/${resource}`;\n core.debug(`Resource Url: ${url}`);\n return url;\n}\nfunction createAcceptHeader(type, apiVersion) {\n return `${type};api-version=${apiVersion}`;\n}\nfunction getRequestOptions() {\n const requestOptions = {\n headers: {\n Accept: createAcceptHeader('application/json', '6.0-preview.1')\n }\n };\n return requestOptions;\n}\nfunction createHttpClient() {\n const token = process.env['ACTIONS_RUNTIME_TOKEN'] || '';\n const bearerCredentialHandler = new auth_1.BearerCredentialHandler(token);\n return new http_client_1.HttpClient('actions/cache', [bearerCredentialHandler], getRequestOptions());\n}\nfunction getCacheVersion(paths, compressionMethod, enableCrossOsArchive = false) {\n const components = paths;\n // Add compression method to cache version to restore\n // compressed cache as per compression method\n if (compressionMethod) {\n components.push(compressionMethod);\n }\n // Only check for windows platforms if enableCrossOsArchive is false\n if (process.platform === 'win32' && !enableCrossOsArchive) {\n components.push('windows-only');\n }\n // Add salt to cache version to support breaking changes in cache entry\n components.push(versionSalt);\n return crypto.createHash('sha256').update(components.join('|')).digest('hex');\n}\nexports.getCacheVersion = getCacheVersion;\nfunction getCacheEntry(keys, paths, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const httpClient = createHttpClient();\n const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive);\n const resource = `cache?keys=${encodeURIComponent(keys.join(','))}&version=${version}`;\n const response = yield (0, requestUtils_1.retryTypedResponse)('getCacheEntry', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));\n // Cache not found\n if (response.statusCode === 204) {\n // List cache for primary key only if cache miss occurs\n if (core.isDebug()) {\n yield printCachesListForDiagnostics(keys[0], httpClient, version);\n }\n return null;\n }\n if (!(0, requestUtils_1.isSuccessStatusCode)(response.statusCode)) {\n throw new Error(`Cache service responded with ${response.statusCode}`);\n }\n const cacheResult = response.result;\n const cacheDownloadUrl = cacheResult === null || cacheResult === void 0 ? void 0 : cacheResult.archiveLocation;\n if (!cacheDownloadUrl) {\n // Cache achiveLocation not found. This should never happen, and hence bail out.\n throw new Error('Cache not found.');\n }\n core.setSecret(cacheDownloadUrl);\n core.debug(`Cache Result:`);\n core.debug(JSON.stringify(cacheResult));\n return cacheResult;\n });\n}\nexports.getCacheEntry = getCacheEntry;\nfunction printCachesListForDiagnostics(key, httpClient, version) {\n return __awaiter(this, void 0, void 0, function* () {\n const resource = `caches?key=${encodeURIComponent(key)}`;\n const response = yield (0, requestUtils_1.retryTypedResponse)('listCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); }));\n if (response.statusCode === 200) {\n const cacheListResult = response.result;\n const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount;\n if (totalCount && totalCount > 0) {\n core.debug(`No matching cache found for cache key '${key}', version '${version} and scope ${process.env['GITHUB_REF']}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key \\nOther caches with similar key:`);\n for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) {\n core.debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`);\n }\n }\n }\n });\n}\nfunction downloadCache(archiveLocation, archivePath, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const archiveUrl = new url_1.URL(archiveLocation);\n const downloadOptions = (0, options_1.getDownloadOptions)(options);\n if (archiveUrl.hostname.endsWith('.blob.core.windows.net')) {\n if (downloadOptions.useAzureSdk) {\n // Use Azure storage SDK to download caches hosted on Azure to improve speed and reliability.\n yield (0, downloadUtils_1.downloadCacheStorageSDK)(archiveLocation, archivePath, downloadOptions);\n }\n else if (downloadOptions.concurrentBlobDownloads) {\n // Use concurrent implementation with HttpClient to work around blob SDK issue\n yield (0, downloadUtils_1.downloadCacheHttpClientConcurrent)(archiveLocation, archivePath, downloadOptions);\n }\n else {\n // Otherwise, download using the Actions http-client.\n yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath);\n }\n }\n else {\n yield (0, downloadUtils_1.downloadCacheHttpClient)(archiveLocation, archivePath);\n }\n });\n}\nexports.downloadCache = downloadCache;\n// Reserve Cache\nfunction reserveCache(key, paths, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const httpClient = createHttpClient();\n const version = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive);\n const reserveCacheRequest = {\n key,\n version,\n cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize\n };\n const response = yield (0, requestUtils_1.retryTypedResponse)('reserveCache', () => __awaiter(this, void 0, void 0, function* () {\n return httpClient.postJson(getCacheApiUrl('caches'), reserveCacheRequest);\n }));\n return response;\n });\n}\nexports.reserveCache = reserveCache;\nfunction getContentRange(start, end) {\n // Format: `bytes start-end/filesize\n // start and end are inclusive\n // filesize can be *\n // For a 200 byte chunk starting at byte 0:\n // Content-Range: bytes 0-199/*\n return `bytes ${start}-${end}/*`;\n}\nfunction uploadChunk(httpClient, resourceUrl, openStream, start, end) {\n return __awaiter(this, void 0, void 0, function* () {\n core.debug(`Uploading chunk of size ${end - start + 1} bytes at offset ${start} with content range: ${getContentRange(start, end)}`);\n const additionalHeaders = {\n 'Content-Type': 'application/octet-stream',\n 'Content-Range': getContentRange(start, end)\n };\n const uploadChunkResponse = yield (0, requestUtils_1.retryHttpClientResponse)(`uploadChunk (start: ${start}, end: ${end})`, () => __awaiter(this, void 0, void 0, function* () {\n return httpClient.sendStream('PATCH', resourceUrl, openStream(), additionalHeaders);\n }));\n if (!(0, requestUtils_1.isSuccessStatusCode)(uploadChunkResponse.message.statusCode)) {\n throw new Error(`Cache service responded with ${uploadChunkResponse.message.statusCode} during upload chunk.`);\n }\n });\n}\nfunction uploadFile(httpClient, cacheId, archivePath, options) {\n return __awaiter(this, void 0, void 0, function* () {\n // Upload Chunks\n const fileSize = utils.getArchiveFileSizeInBytes(archivePath);\n const resourceUrl = getCacheApiUrl(`caches/${cacheId.toString()}`);\n const fd = fs.openSync(archivePath, 'r');\n const uploadOptions = (0, options_1.getUploadOptions)(options);\n const concurrency = utils.assertDefined('uploadConcurrency', uploadOptions.uploadConcurrency);\n const maxChunkSize = utils.assertDefined('uploadChunkSize', uploadOptions.uploadChunkSize);\n const parallelUploads = [...new Array(concurrency).keys()];\n core.debug('Awaiting all uploads');\n let offset = 0;\n try {\n yield Promise.all(parallelUploads.map(() => __awaiter(this, void 0, void 0, function* () {\n while (offset < fileSize) {\n const chunkSize = Math.min(fileSize - offset, maxChunkSize);\n const start = offset;\n const end = offset + chunkSize - 1;\n offset += maxChunkSize;\n yield uploadChunk(httpClient, resourceUrl, () => fs\n .createReadStream(archivePath, {\n fd,\n start,\n end,\n autoClose: false\n })\n .on('error', error => {\n throw new Error(`Cache upload failed because file read failed with ${error.message}`);\n }), start, end);\n }\n })));\n }\n finally {\n fs.closeSync(fd);\n }\n return;\n });\n}\nfunction commitCache(httpClient, cacheId, filesize) {\n return __awaiter(this, void 0, void 0, function* () {\n const commitCacheRequest = { size: filesize };\n return yield (0, requestUtils_1.retryTypedResponse)('commitCache', () => __awaiter(this, void 0, void 0, function* () {\n return httpClient.postJson(getCacheApiUrl(`caches/${cacheId.toString()}`), commitCacheRequest);\n }));\n });\n}\nfunction saveCache(cacheId, archivePath, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const httpClient = createHttpClient();\n core.debug('Upload cache');\n yield uploadFile(httpClient, cacheId, archivePath, options);\n // Commit Cache\n core.debug('Commiting cache');\n const cacheSize = utils.getArchiveFileSizeInBytes(archivePath);\n core.info(`Cache Size: ~${Math.round(cacheSize / (1024 * 1024))} MB (${cacheSize} B)`);\n const commitCacheResponse = yield commitCache(httpClient, cacheId, cacheSize);\n if (!(0, requestUtils_1.isSuccessStatusCode)(commitCacheResponse.statusCode)) {\n throw new Error(`Cache service responded with ${commitCacheResponse.statusCode} during commit cache.`);\n }\n core.info('Cache saved successfully');\n });\n}\nexports.saveCache = saveCache;\n//# sourceMappingURL=cacheHttpClient.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n 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); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isGhes = exports.assertDefined = exports.getGnuTarPathOnWindows = exports.getCacheFileName = exports.getCompressionMethod = exports.unlinkFile = exports.resolvePaths = exports.getArchiveFileSizeInBytes = exports.createTempDirectory = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst exec = __importStar(require(\"@actions/exec\"));\nconst glob = __importStar(require(\"@actions/glob\"));\nconst io = __importStar(require(\"@actions/io\"));\nconst fs = __importStar(require(\"fs\"));\nconst path = __importStar(require(\"path\"));\nconst semver = __importStar(require(\"semver\"));\nconst util = __importStar(require(\"util\"));\nconst uuid_1 = require(\"uuid\");\nconst constants_1 = require(\"./constants\");\n// From https://github.com/actions/toolkit/blob/main/packages/tool-cache/src/tool-cache.ts#L23\nfunction createTempDirectory() {\n return __awaiter(this, void 0, void 0, function* () {\n const IS_WINDOWS = process.platform === 'win32';\n let tempDirectory = process.env['RUNNER_TEMP'] || '';\n if (!tempDirectory) {\n let baseLocation;\n if (IS_WINDOWS) {\n // On Windows use the USERPROFILE env variable\n baseLocation = process.env['USERPROFILE'] || 'C:\\\\';\n }\n else {\n if (process.platform === 'darwin') {\n baseLocation = '/Users';\n }\n else {\n baseLocation = '/home';\n }\n }\n tempDirectory = path.join(baseLocation, 'actions', 'temp');\n }\n const dest = path.join(tempDirectory, (0, uuid_1.v4)());\n yield io.mkdirP(dest);\n return dest;\n });\n}\nexports.createTempDirectory = createTempDirectory;\nfunction getArchiveFileSizeInBytes(filePath) {\n return fs.statSync(filePath).size;\n}\nexports.getArchiveFileSizeInBytes = getArchiveFileSizeInBytes;\nfunction resolvePaths(patterns) {\n var _a, e_1, _b, _c;\n var _d;\n return __awaiter(this, void 0, void 0, function* () {\n const paths = [];\n const workspace = (_d = process.env['GITHUB_WORKSPACE']) !== null && _d !== void 0 ? _d : process.cwd();\n const globber = yield glob.create(patterns.join('\\n'), {\n implicitDescendants: false\n });\n try {\n for (var _e = true, _f = __asyncValues(globber.globGenerator()), _g; _g = yield _f.next(), _a = _g.done, !_a;) {\n _c = _g.value;\n _e = false;\n try {\n const file = _c;\n const relativeFile = path\n .relative(workspace, file)\n .replace(new RegExp(`\\\\${path.sep}`, 'g'), '/');\n core.debug(`Matched: ${relativeFile}`);\n // Paths are made relative so the tar entries are all relative to the root of the workspace.\n if (relativeFile === '') {\n // path.relative returns empty string if workspace and file are equal\n paths.push('.');\n }\n else {\n paths.push(`${relativeFile}`);\n }\n }\n finally {\n _e = true;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (!_e && !_a && (_b = _f.return)) yield _b.call(_f);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return paths;\n });\n}\nexports.resolvePaths = resolvePaths;\nfunction unlinkFile(filePath) {\n return __awaiter(this, void 0, void 0, function* () {\n return util.promisify(fs.unlink)(filePath);\n });\n}\nexports.unlinkFile = unlinkFile;\nfunction getVersion(app, additionalArgs = []) {\n return __awaiter(this, void 0, void 0, function* () {\n let versionOutput = '';\n additionalArgs.push('--version');\n core.debug(`Checking ${app} ${additionalArgs.join(' ')}`);\n try {\n yield exec.exec(`${app}`, additionalArgs, {\n ignoreReturnCode: true,\n silent: true,\n listeners: {\n stdout: (data) => (versionOutput += data.toString()),\n stderr: (data) => (versionOutput += data.toString())\n }\n });\n }\n catch (err) {\n core.debug(err.message);\n }\n versionOutput = versionOutput.trim();\n core.debug(versionOutput);\n return versionOutput;\n });\n}\n// Use zstandard if possible to maximize cache performance\nfunction getCompressionMethod() {\n return __awaiter(this, void 0, void 0, function* () {\n const versionOutput = yield getVersion('zstd', ['--quiet']);\n const version = semver.clean(versionOutput);\n core.debug(`zstd version: ${version}`);\n if (versionOutput === '') {\n return constants_1.CompressionMethod.Gzip;\n }\n else {\n return constants_1.CompressionMethod.ZstdWithoutLong;\n }\n });\n}\nexports.getCompressionMethod = getCompressionMethod;\nfunction getCacheFileName(compressionMethod) {\n return compressionMethod === constants_1.CompressionMethod.Gzip\n ? constants_1.CacheFilename.Gzip\n : constants_1.CacheFilename.Zstd;\n}\nexports.getCacheFileName = getCacheFileName;\nfunction getGnuTarPathOnWindows() {\n return __awaiter(this, void 0, void 0, function* () {\n if (fs.existsSync(constants_1.GnuTarPathOnWindows)) {\n return constants_1.GnuTarPathOnWindows;\n }\n const versionOutput = yield getVersion('tar');\n return versionOutput.toLowerCase().includes('gnu tar') ? io.which('tar') : '';\n });\n}\nexports.getGnuTarPathOnWindows = getGnuTarPathOnWindows;\nfunction assertDefined(name, value) {\n if (value === undefined) {\n throw Error(`Expected ${name} but value was undefiend`);\n }\n return value;\n}\nexports.assertDefined = assertDefined;\nfunction isGhes() {\n const ghUrl = new URL(process.env['GITHUB_SERVER_URL'] || 'https://github.com');\n return ghUrl.hostname.toUpperCase() !== 'GITHUB.COM';\n}\nexports.isGhes = isGhes;\n//# sourceMappingURL=cacheUtils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ManifestFilename = exports.TarFilename = exports.SystemTarPathOnWindows = exports.GnuTarPathOnWindows = exports.SocketTimeout = exports.DefaultRetryDelay = exports.DefaultRetryAttempts = exports.ArchiveToolType = exports.CompressionMethod = exports.CacheFilename = void 0;\nvar CacheFilename;\n(function (CacheFilename) {\n CacheFilename[\"Gzip\"] = \"cache.tgz\";\n CacheFilename[\"Zstd\"] = \"cache.tzst\";\n})(CacheFilename = exports.CacheFilename || (exports.CacheFilename = {}));\nvar CompressionMethod;\n(function (CompressionMethod) {\n CompressionMethod[\"Gzip\"] = \"gzip\";\n // Long range mode was added to zstd in v1.3.2.\n // This enum is for earlier version of zstd that does not have --long support\n CompressionMethod[\"ZstdWithoutLong\"] = \"zstd-without-long\";\n CompressionMethod[\"Zstd\"] = \"zstd\";\n})(CompressionMethod = exports.CompressionMethod || (exports.CompressionMethod = {}));\nvar ArchiveToolType;\n(function (ArchiveToolType) {\n ArchiveToolType[\"GNU\"] = \"gnu\";\n ArchiveToolType[\"BSD\"] = \"bsd\";\n})(ArchiveToolType = exports.ArchiveToolType || (exports.ArchiveToolType = {}));\n// The default number of retry attempts.\nexports.DefaultRetryAttempts = 2;\n// The default delay in milliseconds between retry attempts.\nexports.DefaultRetryDelay = 5000;\n// Socket timeout in milliseconds during download. If no traffic is received\n// over the socket during this period, the socket is destroyed and the download\n// is aborted.\nexports.SocketTimeout = 5000;\n// The default path of GNUtar on hosted Windows runners\nexports.GnuTarPathOnWindows = `${process.env['PROGRAMFILES']}\\\\Git\\\\usr\\\\bin\\\\tar.exe`;\n// The default path of BSDtar on hosted Windows runners\nexports.SystemTarPathOnWindows = `${process.env['SYSTEMDRIVE']}\\\\Windows\\\\System32\\\\tar.exe`;\nexports.TarFilename = 'cache.tar';\nexports.ManifestFilename = 'manifest.txt';\n//# sourceMappingURL=constants.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.downloadCacheStorageSDK = exports.downloadCacheHttpClientConcurrent = exports.downloadCacheHttpClient = exports.DownloadProgress = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst http_client_1 = require(\"@actions/http-client\");\nconst storage_blob_1 = require(\"@azure/storage-blob\");\nconst buffer = __importStar(require(\"buffer\"));\nconst fs = __importStar(require(\"fs\"));\nconst stream = __importStar(require(\"stream\"));\nconst util = __importStar(require(\"util\"));\nconst utils = __importStar(require(\"./cacheUtils\"));\nconst constants_1 = require(\"./constants\");\nconst requestUtils_1 = require(\"./requestUtils\");\nconst abort_controller_1 = require(\"@azure/abort-controller\");\n/**\n * Pipes the body of a HTTP response to a stream\n *\n * @param response the HTTP response\n * @param output the writable stream\n */\nfunction pipeResponseToStream(response, output) {\n return __awaiter(this, void 0, void 0, function* () {\n const pipeline = util.promisify(stream.pipeline);\n yield pipeline(response.message, output);\n });\n}\n/**\n * Class for tracking the download state and displaying stats.\n */\nclass DownloadProgress {\n constructor(contentLength) {\n this.contentLength = contentLength;\n this.segmentIndex = 0;\n this.segmentSize = 0;\n this.segmentOffset = 0;\n this.receivedBytes = 0;\n this.displayedComplete = false;\n this.startTime = Date.now();\n }\n /**\n * Progress to the next segment. Only call this method when the previous segment\n * is complete.\n *\n * @param segmentSize the length of the next segment\n */\n nextSegment(segmentSize) {\n this.segmentOffset = this.segmentOffset + this.segmentSize;\n this.segmentIndex = this.segmentIndex + 1;\n this.segmentSize = segmentSize;\n this.receivedBytes = 0;\n core.debug(`Downloading segment at offset ${this.segmentOffset} with length ${this.segmentSize}...`);\n }\n /**\n * Sets the number of bytes received for the current segment.\n *\n * @param receivedBytes the number of bytes received\n */\n setReceivedBytes(receivedBytes) {\n this.receivedBytes = receivedBytes;\n }\n /**\n * Returns the total number of bytes transferred.\n */\n getTransferredBytes() {\n return this.segmentOffset + this.receivedBytes;\n }\n /**\n * Returns true if the download is complete.\n */\n isDone() {\n return this.getTransferredBytes() === this.contentLength;\n }\n /**\n * Prints the current download stats. Once the download completes, this will print one\n * last line and then stop.\n */\n display() {\n if (this.displayedComplete) {\n return;\n }\n const transferredBytes = this.segmentOffset + this.receivedBytes;\n const percentage = (100 * (transferredBytes / this.contentLength)).toFixed(1);\n const elapsedTime = Date.now() - this.startTime;\n const downloadSpeed = (transferredBytes /\n (1024 * 1024) /\n (elapsedTime / 1000)).toFixed(1);\n core.info(`Received ${transferredBytes} of ${this.contentLength} (${percentage}%), ${downloadSpeed} MBs/sec`);\n if (this.isDone()) {\n this.displayedComplete = true;\n }\n }\n /**\n * Returns a function used to handle TransferProgressEvents.\n */\n onProgress() {\n return (progress) => {\n this.setReceivedBytes(progress.loadedBytes);\n };\n }\n /**\n * Starts the timer that displays the stats.\n *\n * @param delayInMs the delay between each write\n */\n startDisplayTimer(delayInMs = 1000) {\n const displayCallback = () => {\n this.display();\n if (!this.isDone()) {\n this.timeoutHandle = setTimeout(displayCallback, delayInMs);\n }\n };\n this.timeoutHandle = setTimeout(displayCallback, delayInMs);\n }\n /**\n * Stops the timer that displays the stats. As this typically indicates the download\n * is complete, this will display one last line, unless the last line has already\n * been written.\n */\n stopDisplayTimer() {\n if (this.timeoutHandle) {\n clearTimeout(this.timeoutHandle);\n this.timeoutHandle = undefined;\n }\n this.display();\n }\n}\nexports.DownloadProgress = DownloadProgress;\n/**\n * Download the cache using the Actions toolkit http-client\n *\n * @param archiveLocation the URL for the cache\n * @param archivePath the local path where the cache is saved\n */\nfunction downloadCacheHttpClient(archiveLocation, archivePath) {\n return __awaiter(this, void 0, void 0, function* () {\n const writeStream = fs.createWriteStream(archivePath);\n const httpClient = new http_client_1.HttpClient('actions/cache');\n const downloadResponse = yield (0, requestUtils_1.retryHttpClientResponse)('downloadCache', () => __awaiter(this, void 0, void 0, function* () { return httpClient.get(archiveLocation); }));\n // Abort download if no traffic received over the socket.\n downloadResponse.message.socket.setTimeout(constants_1.SocketTimeout, () => {\n downloadResponse.message.destroy();\n core.debug(`Aborting download, socket timed out after ${constants_1.SocketTimeout} ms`);\n });\n yield pipeResponseToStream(downloadResponse, writeStream);\n // Validate download size.\n const contentLengthHeader = downloadResponse.message.headers['content-length'];\n if (contentLengthHeader) {\n const expectedLength = parseInt(contentLengthHeader);\n const actualLength = utils.getArchiveFileSizeInBytes(archivePath);\n if (actualLength !== expectedLength) {\n throw new Error(`Incomplete download. Expected file size: ${expectedLength}, actual file size: ${actualLength}`);\n }\n }\n else {\n core.debug('Unable to validate download, no Content-Length header');\n }\n });\n}\nexports.downloadCacheHttpClient = downloadCacheHttpClient;\n/**\n * Download the cache using the Actions toolkit http-client concurrently\n *\n * @param archiveLocation the URL for the cache\n * @param archivePath the local path where the cache is saved\n */\nfunction downloadCacheHttpClientConcurrent(archiveLocation, archivePath, options) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const archiveDescriptor = yield fs.promises.open(archivePath, 'w');\n const httpClient = new http_client_1.HttpClient('actions/cache', undefined, {\n socketTimeout: options.timeoutInMs,\n keepAlive: true\n });\n try {\n const res = yield (0, requestUtils_1.retryHttpClientResponse)('downloadCacheMetadata', () => __awaiter(this, void 0, void 0, function* () { return yield httpClient.request('HEAD', archiveLocation, null, {}); }));\n const lengthHeader = res.message.headers['content-length'];\n if (lengthHeader === undefined || lengthHeader === null) {\n throw new Error('Content-Length not found on blob response');\n }\n const length = parseInt(lengthHeader);\n if (Number.isNaN(length)) {\n throw new Error(`Could not interpret Content-Length: ${length}`);\n }\n const downloads = [];\n const blockSize = 4 * 1024 * 1024;\n for (let offset = 0; offset < length; offset += blockSize) {\n const count = Math.min(blockSize, length - offset);\n downloads.push({\n offset,\n promiseGetter: () => __awaiter(this, void 0, void 0, function* () {\n return yield downloadSegmentRetry(httpClient, archiveLocation, offset, count);\n })\n });\n }\n // reverse to use .pop instead of .shift\n downloads.reverse();\n let actives = 0;\n let bytesDownloaded = 0;\n const progress = new DownloadProgress(length);\n progress.startDisplayTimer();\n const progressFn = progress.onProgress();\n const activeDownloads = [];\n let nextDownload;\n const waitAndWrite = () => __awaiter(this, void 0, void 0, function* () {\n const segment = yield Promise.race(Object.values(activeDownloads));\n yield archiveDescriptor.write(segment.buffer, 0, segment.count, segment.offset);\n actives--;\n delete activeDownloads[segment.offset];\n bytesDownloaded += segment.count;\n progressFn({ loadedBytes: bytesDownloaded });\n });\n while ((nextDownload = downloads.pop())) {\n activeDownloads[nextDownload.offset] = nextDownload.promiseGetter();\n actives++;\n if (actives >= ((_a = options.downloadConcurrency) !== null && _a !== void 0 ? _a : 10)) {\n yield waitAndWrite();\n }\n }\n while (actives > 0) {\n yield waitAndWrite();\n }\n }\n finally {\n httpClient.dispose();\n yield archiveDescriptor.close();\n }\n });\n}\nexports.downloadCacheHttpClientConcurrent = downloadCacheHttpClientConcurrent;\nfunction downloadSegmentRetry(httpClient, archiveLocation, offset, count) {\n return __awaiter(this, void 0, void 0, function* () {\n const retries = 5;\n let failures = 0;\n while (true) {\n try {\n const timeout = 30000;\n const result = yield promiseWithTimeout(timeout, downloadSegment(httpClient, archiveLocation, offset, count));\n if (typeof result === 'string') {\n throw new Error('downloadSegmentRetry failed due to timeout');\n }\n return result;\n }\n catch (err) {\n if (failures >= retries) {\n throw err;\n }\n failures++;\n }\n }\n });\n}\nfunction downloadSegment(httpClient, archiveLocation, offset, count) {\n return __awaiter(this, void 0, void 0, function* () {\n const partRes = yield (0, requestUtils_1.retryHttpClientResponse)('downloadCachePart', () => __awaiter(this, void 0, void 0, function* () {\n return yield httpClient.get(archiveLocation, {\n Range: `bytes=${offset}-${offset + count - 1}`\n });\n }));\n if (!partRes.readBodyBuffer) {\n throw new Error('Expected HttpClientResponse to implement readBodyBuffer');\n }\n return {\n offset,\n count,\n buffer: yield partRes.readBodyBuffer()\n };\n });\n}\n/**\n * Download the cache using the Azure Storage SDK. Only call this method if the\n * URL points to an Azure Storage endpoint.\n *\n * @param archiveLocation the URL for the cache\n * @param archivePath the local path where the cache is saved\n * @param options the download options with the defaults set\n */\nfunction downloadCacheStorageSDK(archiveLocation, archivePath, options) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const client = new storage_blob_1.BlockBlobClient(archiveLocation, undefined, {\n retryOptions: {\n // Override the timeout used when downloading each 4 MB chunk\n // The default is 2 min / MB, which is way too slow\n tryTimeoutInMs: options.timeoutInMs\n }\n });\n const properties = yield client.getProperties();\n const contentLength = (_a = properties.contentLength) !== null && _a !== void 0 ? _a : -1;\n if (contentLength < 0) {\n // We should never hit this condition, but just in case fall back to downloading the\n // file as one large stream\n core.debug('Unable to determine content length, downloading file with http-client...');\n yield downloadCacheHttpClient(archiveLocation, archivePath);\n }\n else {\n // Use downloadToBuffer for faster downloads, since internally it splits the\n // file into 4 MB chunks which can then be parallelized and retried independently\n //\n // If the file exceeds the buffer maximum length (~1 GB on 32-bit systems and ~2 GB\n // on 64-bit systems), split the download into multiple segments\n // ~2 GB = 2147483647, beyond this, we start getting out of range error. So, capping it accordingly.\n // Updated segment size to 128MB = 134217728 bytes, to complete a segment faster and fail fast\n const maxSegmentSize = Math.min(134217728, buffer.constants.MAX_LENGTH);\n const downloadProgress = new DownloadProgress(contentLength);\n const fd = fs.openSync(archivePath, 'w');\n try {\n downloadProgress.startDisplayTimer();\n const controller = new abort_controller_1.AbortController();\n const abortSignal = controller.signal;\n while (!downloadProgress.isDone()) {\n const segmentStart = downloadProgress.segmentOffset + downloadProgress.segmentSize;\n const segmentSize = Math.min(maxSegmentSize, contentLength - segmentStart);\n downloadProgress.nextSegment(segmentSize);\n const result = yield promiseWithTimeout(options.segmentTimeoutInMs || 3600000, client.downloadToBuffer(segmentStart, segmentSize, {\n abortSignal,\n concurrency: options.downloadConcurrency,\n onProgress: downloadProgress.onProgress()\n }));\n if (result === 'timeout') {\n controller.abort();\n throw new Error('Aborting cache download as the download time exceeded the timeout.');\n }\n else if (Buffer.isBuffer(result)) {\n fs.writeFileSync(fd, result);\n }\n }\n }\n finally {\n downloadProgress.stopDisplayTimer();\n fs.closeSync(fd);\n }\n }\n });\n}\nexports.downloadCacheStorageSDK = downloadCacheStorageSDK;\nconst promiseWithTimeout = (timeoutMs, promise) => __awaiter(void 0, void 0, void 0, function* () {\n let timeoutHandle;\n const timeoutPromise = new Promise(resolve => {\n timeoutHandle = setTimeout(() => resolve('timeout'), timeoutMs);\n });\n return Promise.race([promise, timeoutPromise]).then(result => {\n clearTimeout(timeoutHandle);\n return result;\n });\n});\n//# sourceMappingURL=downloadUtils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.retryHttpClientResponse = exports.retryTypedResponse = exports.retry = exports.isRetryableStatusCode = exports.isServerErrorStatusCode = exports.isSuccessStatusCode = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst http_client_1 = require(\"@actions/http-client\");\nconst constants_1 = require(\"./constants\");\nfunction isSuccessStatusCode(statusCode) {\n if (!statusCode) {\n return false;\n }\n return statusCode >= 200 && statusCode < 300;\n}\nexports.isSuccessStatusCode = isSuccessStatusCode;\nfunction isServerErrorStatusCode(statusCode) {\n if (!statusCode) {\n return true;\n }\n return statusCode >= 500;\n}\nexports.isServerErrorStatusCode = isServerErrorStatusCode;\nfunction isRetryableStatusCode(statusCode) {\n if (!statusCode) {\n return false;\n }\n const retryableStatusCodes = [\n http_client_1.HttpCodes.BadGateway,\n http_client_1.HttpCodes.ServiceUnavailable,\n http_client_1.HttpCodes.GatewayTimeout\n ];\n return retryableStatusCodes.includes(statusCode);\n}\nexports.isRetryableStatusCode = isRetryableStatusCode;\nfunction sleep(milliseconds) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise(resolve => setTimeout(resolve, milliseconds));\n });\n}\nfunction retry(name, method, getStatusCode, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay, onError = undefined) {\n return __awaiter(this, void 0, void 0, function* () {\n let errorMessage = '';\n let attempt = 1;\n while (attempt <= maxAttempts) {\n let response = undefined;\n let statusCode = undefined;\n let isRetryable = false;\n try {\n response = yield method();\n }\n catch (error) {\n if (onError) {\n response = onError(error);\n }\n isRetryable = true;\n errorMessage = error.message;\n }\n if (response) {\n statusCode = getStatusCode(response);\n if (!isServerErrorStatusCode(statusCode)) {\n return response;\n }\n }\n if (statusCode) {\n isRetryable = isRetryableStatusCode(statusCode);\n errorMessage = `Cache service responded with ${statusCode}`;\n }\n core.debug(`${name} - Attempt ${attempt} of ${maxAttempts} failed with error: ${errorMessage}`);\n if (!isRetryable) {\n core.debug(`${name} - Error is not retryable`);\n break;\n }\n yield sleep(delay);\n attempt++;\n }\n throw Error(`${name} failed: ${errorMessage}`);\n });\n}\nexports.retry = retry;\nfunction retryTypedResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield retry(name, method, (response) => response.statusCode, maxAttempts, delay, \n // If the error object contains the statusCode property, extract it and return\n // an TypedResponse so it can be processed by the retry logic.\n (error) => {\n if (error instanceof http_client_1.HttpClientError) {\n return {\n statusCode: error.statusCode,\n result: null,\n headers: {},\n error\n };\n }\n else {\n return undefined;\n }\n });\n });\n}\nexports.retryTypedResponse = retryTypedResponse;\nfunction retryHttpClientResponse(name, method, maxAttempts = constants_1.DefaultRetryAttempts, delay = constants_1.DefaultRetryDelay) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield retry(name, method, (response) => response.message.statusCode, maxAttempts, delay);\n });\n}\nexports.retryHttpClientResponse = retryHttpClientResponse;\n//# sourceMappingURL=requestUtils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTar = exports.extractTar = exports.listTar = void 0;\nconst exec_1 = require(\"@actions/exec\");\nconst io = __importStar(require(\"@actions/io\"));\nconst fs_1 = require(\"fs\");\nconst path = __importStar(require(\"path\"));\nconst utils = __importStar(require(\"./cacheUtils\"));\nconst constants_1 = require(\"./constants\");\nconst IS_WINDOWS = process.platform === 'win32';\n// Returns tar path and type: BSD or GNU\nfunction getTarPath() {\n return __awaiter(this, void 0, void 0, function* () {\n switch (process.platform) {\n case 'win32': {\n const gnuTar = yield utils.getGnuTarPathOnWindows();\n const systemTar = constants_1.SystemTarPathOnWindows;\n if (gnuTar) {\n // Use GNUtar as default on windows\n return { path: gnuTar, type: constants_1.ArchiveToolType.GNU };\n }\n else if ((0, fs_1.existsSync)(systemTar)) {\n return { path: systemTar, type: constants_1.ArchiveToolType.BSD };\n }\n break;\n }\n case 'darwin': {\n const gnuTar = yield io.which('gtar', false);\n if (gnuTar) {\n // fix permission denied errors when extracting BSD tar archive with GNU tar - https://github.com/actions/cache/issues/527\n return { path: gnuTar, type: constants_1.ArchiveToolType.GNU };\n }\n else {\n return {\n path: yield io.which('tar', true),\n type: constants_1.ArchiveToolType.BSD\n };\n }\n }\n default:\n break;\n }\n // Default assumption is GNU tar is present in path\n return {\n path: yield io.which('tar', true),\n type: constants_1.ArchiveToolType.GNU\n };\n });\n}\n// Return arguments for tar as per tarPath, compressionMethod, method type and os\nfunction getTarArgs(tarPath, compressionMethod, type, archivePath = '') {\n return __awaiter(this, void 0, void 0, function* () {\n const args = [`\"${tarPath.path}\"`];\n const cacheFileName = utils.getCacheFileName(compressionMethod);\n const tarFile = 'cache.tar';\n const workingDirectory = getWorkingDirectory();\n // Speficic args for BSD tar on windows for workaround\n const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&\n compressionMethod !== constants_1.CompressionMethod.Gzip &&\n IS_WINDOWS;\n // Method specific args\n switch (type) {\n case 'create':\n args.push('--posix', '-cf', BSD_TAR_ZSTD\n ? tarFile\n : cacheFileName.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '--exclude', BSD_TAR_ZSTD\n ? tarFile\n : cacheFileName.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '-P', '-C', workingDirectory.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '--files-from', constants_1.ManifestFilename);\n break;\n case 'extract':\n args.push('-xf', BSD_TAR_ZSTD\n ? tarFile\n : archivePath.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '-P', '-C', workingDirectory.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'));\n break;\n case 'list':\n args.push('-tf', BSD_TAR_ZSTD\n ? tarFile\n : archivePath.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'), '-P');\n break;\n }\n // Platform specific args\n if (tarPath.type === constants_1.ArchiveToolType.GNU) {\n switch (process.platform) {\n case 'win32':\n args.push('--force-local');\n break;\n case 'darwin':\n args.push('--delay-directory-restore');\n break;\n }\n }\n return args;\n });\n}\n// Returns commands to run tar and compression program\nfunction getCommands(compressionMethod, type, archivePath = '') {\n return __awaiter(this, void 0, void 0, function* () {\n let args;\n const tarPath = yield getTarPath();\n const tarArgs = yield getTarArgs(tarPath, compressionMethod, type, archivePath);\n const compressionArgs = type !== 'create'\n ? yield getDecompressionProgram(tarPath, compressionMethod, archivePath)\n : yield getCompressionProgram(tarPath, compressionMethod);\n const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&\n compressionMethod !== constants_1.CompressionMethod.Gzip &&\n IS_WINDOWS;\n if (BSD_TAR_ZSTD && type !== 'create') {\n args = [[...compressionArgs].join(' '), [...tarArgs].join(' ')];\n }\n else {\n args = [[...tarArgs].join(' '), [...compressionArgs].join(' ')];\n }\n if (BSD_TAR_ZSTD) {\n return args;\n }\n return [args.join(' ')];\n });\n}\nfunction getWorkingDirectory() {\n var _a;\n return (_a = process.env['GITHUB_WORKSPACE']) !== null && _a !== void 0 ? _a : process.cwd();\n}\n// Common function for extractTar and listTar to get the compression method\nfunction getDecompressionProgram(tarPath, compressionMethod, archivePath) {\n return __awaiter(this, void 0, void 0, function* () {\n // -d: Decompress.\n // unzstd is equivalent to 'zstd -d'\n // --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.\n // Using 30 here because we also support 32-bit self-hosted runners.\n const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&\n compressionMethod !== constants_1.CompressionMethod.Gzip &&\n IS_WINDOWS;\n switch (compressionMethod) {\n case constants_1.CompressionMethod.Zstd:\n return BSD_TAR_ZSTD\n ? [\n 'zstd -d --long=30 --force -o',\n constants_1.TarFilename,\n archivePath.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/')\n ]\n : [\n '--use-compress-program',\n IS_WINDOWS ? '\"zstd -d --long=30\"' : 'unzstd --long=30'\n ];\n case constants_1.CompressionMethod.ZstdWithoutLong:\n return BSD_TAR_ZSTD\n ? [\n 'zstd -d --force -o',\n constants_1.TarFilename,\n archivePath.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/')\n ]\n : ['--use-compress-program', IS_WINDOWS ? '\"zstd -d\"' : 'unzstd'];\n default:\n return ['-z'];\n }\n });\n}\n// Used for creating the archive\n// -T#: Compress using # working thread. If # is 0, attempt to detect and use the number of physical CPU cores.\n// zstdmt is equivalent to 'zstd -T0'\n// --long=#: Enables long distance matching with # bits. Maximum is 30 (1GB) on 32-bit OS and 31 (2GB) on 64-bit.\n// Using 30 here because we also support 32-bit self-hosted runners.\n// Long range mode is added to zstd in v1.3.2 release, so we will not use --long in older version of zstd.\nfunction getCompressionProgram(tarPath, compressionMethod) {\n return __awaiter(this, void 0, void 0, function* () {\n const cacheFileName = utils.getCacheFileName(compressionMethod);\n const BSD_TAR_ZSTD = tarPath.type === constants_1.ArchiveToolType.BSD &&\n compressionMethod !== constants_1.CompressionMethod.Gzip &&\n IS_WINDOWS;\n switch (compressionMethod) {\n case constants_1.CompressionMethod.Zstd:\n return BSD_TAR_ZSTD\n ? [\n 'zstd -T0 --long=30 --force -o',\n cacheFileName.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'),\n constants_1.TarFilename\n ]\n : [\n '--use-compress-program',\n IS_WINDOWS ? '\"zstd -T0 --long=30\"' : 'zstdmt --long=30'\n ];\n case constants_1.CompressionMethod.ZstdWithoutLong:\n return BSD_TAR_ZSTD\n ? [\n 'zstd -T0 --force -o',\n cacheFileName.replace(new RegExp(`\\\\${path.sep}`, 'g'), '/'),\n constants_1.TarFilename\n ]\n : ['--use-compress-program', IS_WINDOWS ? '\"zstd -T0\"' : 'zstdmt'];\n default:\n return ['-z'];\n }\n });\n}\n// Executes all commands as separate processes\nfunction execCommands(commands, cwd) {\n return __awaiter(this, void 0, void 0, function* () {\n for (const command of commands) {\n try {\n yield (0, exec_1.exec)(command, undefined, {\n cwd,\n env: Object.assign(Object.assign({}, process.env), { MSYS: 'winsymlinks:nativestrict' })\n });\n }\n catch (error) {\n throw new Error(`${command.split(' ')[0]} failed with error: ${error === null || error === void 0 ? void 0 : error.message}`);\n }\n }\n });\n}\n// List the contents of a tar\nfunction listTar(archivePath, compressionMethod) {\n return __awaiter(this, void 0, void 0, function* () {\n const commands = yield getCommands(compressionMethod, 'list', archivePath);\n yield execCommands(commands);\n });\n}\nexports.listTar = listTar;\n// Extract a tar\nfunction extractTar(archivePath, compressionMethod) {\n return __awaiter(this, void 0, void 0, function* () {\n // Create directory to extract tar into\n const workingDirectory = getWorkingDirectory();\n yield io.mkdirP(workingDirectory);\n const commands = yield getCommands(compressionMethod, 'extract', archivePath);\n yield execCommands(commands);\n });\n}\nexports.extractTar = extractTar;\n// Create a tar\nfunction createTar(archiveFolder, sourceDirectories, compressionMethod) {\n return __awaiter(this, void 0, void 0, function* () {\n // Write source directories to manifest.txt to avoid command length limits\n (0, fs_1.writeFileSync)(path.join(archiveFolder, constants_1.ManifestFilename), sourceDirectories.join('\\n'));\n const commands = yield getCommands(compressionMethod, 'create');\n yield execCommands(commands, archiveFolder);\n });\n}\nexports.createTar = createTar;\n//# sourceMappingURL=tar.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getDownloadOptions = exports.getUploadOptions = void 0;\nconst core = __importStar(require(\"@actions/core\"));\n/**\n * Returns a copy of the upload options with defaults filled in.\n *\n * @param copy the original upload options\n */\nfunction getUploadOptions(copy) {\n const result = {\n uploadConcurrency: 4,\n uploadChunkSize: 32 * 1024 * 1024\n };\n if (copy) {\n if (typeof copy.uploadConcurrency === 'number') {\n result.uploadConcurrency = copy.uploadConcurrency;\n }\n if (typeof copy.uploadChunkSize === 'number') {\n result.uploadChunkSize = copy.uploadChunkSize;\n }\n }\n core.debug(`Upload concurrency: ${result.uploadConcurrency}`);\n core.debug(`Upload chunk size: ${result.uploadChunkSize}`);\n return result;\n}\nexports.getUploadOptions = getUploadOptions;\n/**\n * Returns a copy of the download options with defaults filled in.\n *\n * @param copy the original download options\n */\nfunction getDownloadOptions(copy) {\n const result = {\n useAzureSdk: false,\n concurrentBlobDownloads: true,\n downloadConcurrency: 8,\n timeoutInMs: 30000,\n segmentTimeoutInMs: 600000,\n lookupOnly: false\n };\n if (copy) {\n if (typeof copy.useAzureSdk === 'boolean') {\n result.useAzureSdk = copy.useAzureSdk;\n }\n if (typeof copy.concurrentBlobDownloads === 'boolean') {\n result.concurrentBlobDownloads = copy.concurrentBlobDownloads;\n }\n if (typeof copy.downloadConcurrency === 'number') {\n result.downloadConcurrency = copy.downloadConcurrency;\n }\n if (typeof copy.timeoutInMs === 'number') {\n result.timeoutInMs = copy.timeoutInMs;\n }\n if (typeof copy.segmentTimeoutInMs === 'number') {\n result.segmentTimeoutInMs = copy.segmentTimeoutInMs;\n }\n if (typeof copy.lookupOnly === 'boolean') {\n result.lookupOnly = copy.lookupOnly;\n }\n }\n const segmentDownloadTimeoutMins = process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS'];\n if (segmentDownloadTimeoutMins &&\n !isNaN(Number(segmentDownloadTimeoutMins)) &&\n isFinite(Number(segmentDownloadTimeoutMins))) {\n result.segmentTimeoutInMs = Number(segmentDownloadTimeoutMins) * 60 * 1000;\n }\n core.debug(`Use Azure SDK: ${result.useAzureSdk}`);\n core.debug(`Download concurrency: ${result.downloadConcurrency}`);\n core.debug(`Request timeout (ms): ${result.timeoutInMs}`);\n core.debug(`Cache segment download timeout mins env var: ${process.env['SEGMENT_DOWNLOAD_TIMEOUT_MINS']}`);\n core.debug(`Segment download timeout (ms): ${result.segmentTimeoutInMs}`);\n core.debug(`Lookup only: ${result.lookupOnly}`);\n return result;\n}\nexports.getDownloadOptions = getDownloadOptions;\n//# sourceMappingURL=options.js.map","exports = module.exports = SemVer\n\nvar debug\n/* istanbul ignore next */\nif (typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)) {\n debug = function () {\n var args = Array.prototype.slice.call(arguments, 0)\n args.unshift('SEMVER')\n console.log.apply(console, args)\n }\n} else {\n debug = function () {}\n}\n\n// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nexports.SEMVER_SPEC_VERSION = '2.0.0'\n\nvar MAX_LENGTH = 256\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n /* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nvar MAX_SAFE_COMPONENT_LENGTH = 16\n\nvar MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\n// The actual regexps go on exports.re\nvar re = exports.re = []\nvar safeRe = exports.safeRe = []\nvar src = exports.src = []\nvar t = exports.tokens = {}\nvar R = 0\n\nfunction tok (n) {\n t[n] = R++\n}\n\nvar LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nvar safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nfunction makeSafeRe (value) {\n for (var i = 0; i < safeRegexReplacements.length; i++) {\n var token = safeRegexReplacements[i][0]\n var max = safeRegexReplacements[i][1]\n value = value\n .split(token + '*').join(token + '{0,' + max + '}')\n .split(token + '+').join(token + '{1,' + max + '}')\n }\n return value\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ntok('NUMERICIDENTIFIER')\nsrc[t.NUMERICIDENTIFIER] = '0|[1-9]\\\\d*'\ntok('NUMERICIDENTIFIERLOOSE')\nsrc[t.NUMERICIDENTIFIERLOOSE] = '\\\\d+'\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ntok('NONNUMERICIDENTIFIER')\nsrc[t.NONNUMERICIDENTIFIER] = '\\\\d*[a-zA-Z-]' + LETTERDASHNUMBER + '*'\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ntok('MAINVERSION')\nsrc[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIER] + ')'\n\ntok('MAINVERSIONLOOSE')\nsrc[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\\\.' +\n '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ntok('PRERELEASEIDENTIFIER')\nsrc[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\ntok('PRERELEASEIDENTIFIERLOOSE')\nsrc[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +\n '|' + src[t.NONNUMERICIDENTIFIER] + ')'\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ntok('PRERELEASE')\nsrc[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'\n\ntok('PRERELEASELOOSE')\nsrc[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +\n '(?:\\\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ntok('BUILDIDENTIFIER')\nsrc[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + '+'\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ntok('BUILD')\nsrc[t.BUILD] = '(?:\\\\+(' + src[t.BUILDIDENTIFIER] +\n '(?:\\\\.' + src[t.BUILDIDENTIFIER] + ')*))'\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ntok('FULL')\ntok('FULLPLAIN')\nsrc[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +\n src[t.PRERELEASE] + '?' +\n src[t.BUILD] + '?'\n\nsrc[t.FULL] = '^' + src[t.FULLPLAIN] + '$'\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ntok('LOOSEPLAIN')\nsrc[t.LOOSEPLAIN] = '[v=\\\\s]*' + src[t.MAINVERSIONLOOSE] +\n src[t.PRERELEASELOOSE] + '?' +\n src[t.BUILD] + '?'\n\ntok('LOOSE')\nsrc[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'\n\ntok('GTLT')\nsrc[t.GTLT] = '((?:<|>)?=?)'\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ntok('XRANGEIDENTIFIERLOOSE')\nsrc[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\\\*'\ntok('XRANGEIDENTIFIER')\nsrc[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\\\*'\n\ntok('XRANGEPLAIN')\nsrc[t.XRANGEPLAIN] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIER] + ')' +\n '(?:' + src[t.PRERELEASE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGEPLAINLOOSE')\nsrc[t.XRANGEPLAINLOOSE] = '[v=\\\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:\\\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +\n '(?:' + src[t.PRERELEASELOOSE] + ')?' +\n src[t.BUILD] + '?' +\n ')?)?'\n\ntok('XRANGE')\nsrc[t.XRANGE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAIN] + '$'\ntok('XRANGELOOSE')\nsrc[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\\\s*' + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ntok('COERCE')\nsrc[t.COERCE] = '(^|[^\\\\d])' +\n '(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:\\\\.(\\\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +\n '(?:$|[^\\\\d])'\ntok('COERCERTL')\nre[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')\nsafeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), 'g')\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ntok('LONETILDE')\nsrc[t.LONETILDE] = '(?:~>?)'\n\ntok('TILDETRIM')\nsrc[t.TILDETRIM] = '(\\\\s*)' + src[t.LONETILDE] + '\\\\s+'\nre[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')\nsafeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), 'g')\nvar tildeTrimReplace = '$1~'\n\ntok('TILDE')\nsrc[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'\ntok('TILDELOOSE')\nsrc[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ntok('LONECARET')\nsrc[t.LONECARET] = '(?:\\\\^)'\n\ntok('CARETTRIM')\nsrc[t.CARETTRIM] = '(\\\\s*)' + src[t.LONECARET] + '\\\\s+'\nre[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')\nsafeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), 'g')\nvar caretTrimReplace = '$1^'\n\ntok('CARET')\nsrc[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'\ntok('CARETLOOSE')\nsrc[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ntok('COMPARATORLOOSE')\nsrc[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'\ntok('COMPARATOR')\nsrc[t.COMPARATOR] = '^' + src[t.GTLT] + '\\\\s*(' + src[t.FULLPLAIN] + ')$|^$'\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ntok('COMPARATORTRIM')\nsrc[t.COMPARATORTRIM] = '(\\\\s*)' + src[t.GTLT] +\n '\\\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'\n\n// this one has to use the /g flag\nre[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')\nsafeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), 'g')\nvar comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ntok('HYPHENRANGE')\nsrc[t.HYPHENRANGE] = '^\\\\s*(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAIN] + ')' +\n '\\\\s*$'\n\ntok('HYPHENRANGELOOSE')\nsrc[t.HYPHENRANGELOOSE] = '^\\\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s+-\\\\s+' +\n '(' + src[t.XRANGEPLAINLOOSE] + ')' +\n '\\\\s*$'\n\n// Star ranges basically just allow anything at all.\ntok('STAR')\nsrc[t.STAR] = '(<|>)?=?\\\\s*\\\\*'\n\n// Compile to actual regexp objects.\n// All are flag-free, unless they were created above with a flag.\nfor (var i = 0; i < R; i++) {\n debug(i, src[i])\n if (!re[i]) {\n re[i] = new RegExp(src[i])\n\n // Replace all greedy whitespace to prevent regex dos issues. These regex are\n // used internally via the safeRe object since all inputs in this library get\n // normalized first to trim and collapse all extra whitespace. The original\n // regexes are exported for userland consumption and lower level usage. A\n // future breaking change could export the safer regex only with a note that\n // all input should have extra whitespace removed.\n safeRe[i] = new RegExp(makeSafeRe(src[i]))\n }\n}\n\nexports.parse = parse\nfunction parse (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n if (version.length > MAX_LENGTH) {\n return null\n }\n\n var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]\n if (!r.test(version)) {\n return null\n }\n\n try {\n return new SemVer(version, options)\n } catch (er) {\n return null\n }\n}\n\nexports.valid = valid\nfunction valid (version, options) {\n var v = parse(version, options)\n return v ? v.version : null\n}\n\nexports.clean = clean\nfunction clean (version, options) {\n var s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\n\nexports.SemVer = SemVer\n\nfunction SemVer (version, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n if (version instanceof SemVer) {\n if (version.loose === options.loose) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')\n }\n\n if (!(this instanceof SemVer)) {\n return new SemVer(version, options)\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n\n var m = version.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL])\n\n if (!m) {\n throw new TypeError('Invalid Version: ' + version)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map(function (id) {\n if (/^[0-9]+$/.test(id)) {\n var num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n}\n\nSemVer.prototype.format = function () {\n this.version = this.major + '.' + this.minor + '.' + this.patch\n if (this.prerelease.length) {\n this.version += '-' + this.prerelease.join('.')\n }\n return this.version\n}\n\nSemVer.prototype.toString = function () {\n return this.version\n}\n\nSemVer.prototype.compare = function (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return this.compareMain(other) || this.comparePre(other)\n}\n\nSemVer.prototype.compareMain = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n}\n\nSemVer.prototype.comparePre = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n var i = 0\n do {\n var a = this.prerelease[i]\n var b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\nSemVer.prototype.compareBuild = function (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n var i = 0\n do {\n var a = this.build[i]\n var b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n}\n\n// preminor will bump the version up to the next minor release, and immediately\n// down to pre-release. premajor and prepatch work the same way.\nSemVer.prototype.inc = function (release, identifier) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier)\n this.inc('pre', identifier)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier)\n }\n this.inc('pre', identifier)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 \"pre\" would become 1.0.0-0 which is the wrong direction.\n case 'pre':\n if (this.prerelease.length === 0) {\n this.prerelease = [0]\n } else {\n var i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n this.prerelease.push(0)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n if (this.prerelease[0] === identifier) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = [identifier, 0]\n }\n } else {\n this.prerelease = [identifier, 0]\n }\n }\n break\n\n default:\n throw new Error('invalid increment argument: ' + release)\n }\n this.format()\n this.raw = this.version\n return this\n}\n\nexports.inc = inc\nfunction inc (version, release, loose, identifier) {\n if (typeof (loose) === 'string') {\n identifier = loose\n loose = undefined\n }\n\n try {\n return new SemVer(version, loose).inc(release, identifier).version\n } catch (er) {\n return null\n }\n}\n\nexports.diff = diff\nfunction diff (version1, version2) {\n if (eq(version1, version2)) {\n return null\n } else {\n var v1 = parse(version1)\n var v2 = parse(version2)\n var prefix = ''\n if (v1.prerelease.length || v2.prerelease.length) {\n prefix = 'pre'\n var defaultResult = 'prerelease'\n }\n for (var key in v1) {\n if (key === 'major' || key === 'minor' || key === 'patch') {\n if (v1[key] !== v2[key]) {\n return prefix + key\n }\n }\n }\n return defaultResult // may be undefined\n }\n}\n\nexports.compareIdentifiers = compareIdentifiers\n\nvar numeric = /^[0-9]+$/\nfunction compareIdentifiers (a, b) {\n var anum = numeric.test(a)\n var bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nexports.rcompareIdentifiers = rcompareIdentifiers\nfunction rcompareIdentifiers (a, b) {\n return compareIdentifiers(b, a)\n}\n\nexports.major = major\nfunction major (a, loose) {\n return new SemVer(a, loose).major\n}\n\nexports.minor = minor\nfunction minor (a, loose) {\n return new SemVer(a, loose).minor\n}\n\nexports.patch = patch\nfunction patch (a, loose) {\n return new SemVer(a, loose).patch\n}\n\nexports.compare = compare\nfunction compare (a, b, loose) {\n return new SemVer(a, loose).compare(new SemVer(b, loose))\n}\n\nexports.compareLoose = compareLoose\nfunction compareLoose (a, b) {\n return compare(a, b, true)\n}\n\nexports.compareBuild = compareBuild\nfunction compareBuild (a, b, loose) {\n var versionA = new SemVer(a, loose)\n var versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\n\nexports.rcompare = rcompare\nfunction rcompare (a, b, loose) {\n return compare(b, a, loose)\n}\n\nexports.sort = sort\nfunction sort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(a, b, loose)\n })\n}\n\nexports.rsort = rsort\nfunction rsort (list, loose) {\n return list.sort(function (a, b) {\n return exports.compareBuild(b, a, loose)\n })\n}\n\nexports.gt = gt\nfunction gt (a, b, loose) {\n return compare(a, b, loose) > 0\n}\n\nexports.lt = lt\nfunction lt (a, b, loose) {\n return compare(a, b, loose) < 0\n}\n\nexports.eq = eq\nfunction eq (a, b, loose) {\n return compare(a, b, loose) === 0\n}\n\nexports.neq = neq\nfunction neq (a, b, loose) {\n return compare(a, b, loose) !== 0\n}\n\nexports.gte = gte\nfunction gte (a, b, loose) {\n return compare(a, b, loose) >= 0\n}\n\nexports.lte = lte\nfunction lte (a, b, loose) {\n return compare(a, b, loose) <= 0\n}\n\nexports.cmp = cmp\nfunction cmp (a, op, b, loose) {\n switch (op) {\n case '===':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a === b\n\n case '!==':\n if (typeof a === 'object')\n a = a.version\n if (typeof b === 'object')\n b = b.version\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError('Invalid operator: ' + op)\n }\n}\n\nexports.Comparator = Comparator\nfunction Comparator (comp, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n if (!(this instanceof Comparator)) {\n return new Comparator(comp, options)\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n}\n\nvar ANY = {}\nComparator.prototype.parse = function (comp) {\n var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]\n var m = comp.match(r)\n\n if (!m) {\n throw new TypeError('Invalid comparator: ' + comp)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n}\n\nComparator.prototype.toString = function () {\n return this.value\n}\n\nComparator.prototype.test = function (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n}\n\nComparator.prototype.intersects = function (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n var rangeTmp\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n rangeTmp = new Range(comp.value, options)\n return satisfies(this.value, rangeTmp, options)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n rangeTmp = new Range(this.value, options)\n return satisfies(comp.semver, rangeTmp, options)\n }\n\n var sameDirectionIncreasing =\n (this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '>=' || comp.operator === '>')\n var sameDirectionDecreasing =\n (this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '<=' || comp.operator === '<')\n var sameSemVer = this.semver.version === comp.semver.version\n var differentDirectionsInclusive =\n (this.operator === '>=' || this.operator === '<=') &&\n (comp.operator === '>=' || comp.operator === '<=')\n var oppositeDirectionsLessThan =\n cmp(this.semver, '<', comp.semver, options) &&\n ((this.operator === '>=' || this.operator === '>') &&\n (comp.operator === '<=' || comp.operator === '<'))\n var oppositeDirectionsGreaterThan =\n cmp(this.semver, '>', comp.semver, options) &&\n ((this.operator === '<=' || this.operator === '<') &&\n (comp.operator === '>=' || comp.operator === '>'))\n\n return sameDirectionIncreasing || sameDirectionDecreasing ||\n (sameSemVer && differentDirectionsInclusive) ||\n oppositeDirectionsLessThan || oppositeDirectionsGreaterThan\n}\n\nexports.Range = Range\nfunction Range (range, options) {\n if (!options || typeof options !== 'object') {\n options = {\n loose: !!options,\n includePrerelease: false\n }\n }\n\n if (range instanceof Range) {\n if (range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n return new Range(range.value, options)\n }\n\n if (!(this instanceof Range)) {\n return new Range(range, options)\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range\n .trim()\n .split(/\\s+/)\n .join(' ')\n\n // First, split based on boolean or ||\n this.set = this.raw.split('||').map(function (range) {\n return this.parseRange(range.trim())\n }, this).filter(function (c) {\n // throw out any that are not relevant for whatever reason\n return c.length\n })\n\n if (!this.set.length) {\n throw new TypeError('Invalid SemVer Range: ' + this.raw)\n }\n\n this.format()\n}\n\nRange.prototype.format = function () {\n this.range = this.set.map(function (comps) {\n return comps.join(' ').trim()\n }).join('||').trim()\n return this.range\n}\n\nRange.prototype.toString = function () {\n return this.range\n}\n\nRange.prototype.parseRange = function (range) {\n var loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace)\n debug('hyphen replace', range)\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range, safeRe[t.COMPARATORTRIM])\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(safeRe[t.TILDETRIM], tildeTrimReplace)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(safeRe[t.CARETTRIM], caretTrimReplace)\n\n // normalize spaces\n range = range.split(/\\s+/).join(' ')\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR]\n var set = range.split(' ').map(function (comp) {\n return parseComparator(comp, this.options)\n }, this).join(' ').split(/\\s+/)\n if (this.options.loose) {\n // in loose mode, throw out any that are not valid comparators\n set = set.filter(function (comp) {\n return !!comp.match(compRe)\n })\n }\n set = set.map(function (comp) {\n return new Comparator(comp, this.options)\n }, this)\n\n return set\n}\n\nRange.prototype.intersects = function (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some(function (thisComparators) {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some(function (rangeComparators) {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every(function (thisComparator) {\n return rangeComparators.every(function (rangeComparator) {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n}\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nfunction isSatisfiable (comparators, options) {\n var result = true\n var remainingComparators = comparators.slice()\n var testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every(function (otherComparator) {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// Mostly just for testing and legacy API reasons\nexports.toComparators = toComparators\nfunction toComparators (range, options) {\n return new Range(range, options).set.map(function (comp) {\n return comp.map(function (c) {\n return c.value\n }).join(' ').trim().split(' ')\n })\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nfunction parseComparator (comp, options) {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nfunction isX (id) {\n return !id || id.toLowerCase() === 'x' || id === '*'\n}\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0\nfunction replaceTildes (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceTilde(comp, options)\n }).join(' ')\n}\n\nfunction replaceTilde (comp, options) {\n var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('tilde', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0\n// ^1.2.3 --> >=1.2.3 <2.0.0\n// ^1.2.0 --> >=1.2.0 <2.0.0\nfunction replaceCarets (comp, options) {\n return comp.trim().split(/\\s+/).map(function (comp) {\n return replaceCaret(comp, options)\n }).join(' ')\n}\n\nfunction replaceCaret (comp, options) {\n debug('caret', comp, options)\n var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET]\n return comp.replace(r, function (_, M, m, p, pr) {\n debug('caret', comp, _, M, m, p, pr)\n var ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'\n } else if (isX(p)) {\n if (M === '0') {\n ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'\n } else {\n ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p + '-' + pr +\n ' <' + (+M + 1) + '.0.0'\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + m + '.' + (+p + 1)\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + M + '.' + (+m + 1) + '.0'\n }\n } else {\n ret = '>=' + M + '.' + m + '.' + p +\n ' <' + (+M + 1) + '.0.0'\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nfunction replaceXRanges (comp, options) {\n debug('replaceXRanges', comp, options)\n return comp.split(/\\s+/).map(function (comp) {\n return replaceXRange(comp, options)\n }).join(' ')\n}\n\nfunction replaceXRange (comp, options) {\n comp = comp.trim()\n var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE]\n return comp.replace(r, function (ret, gtlt, M, m, p, pr) {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n var xM = isX(M)\n var xm = xM || isX(m)\n var xp = xm || isX(p)\n var anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n // >1.2.3 => >= 1.2.4\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n ret = gtlt + M + '.' + m + '.' + p + pr\n } else if (xm) {\n ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr\n } else if (xp) {\n ret = '>=' + M + '.' + m + '.0' + pr +\n ' <' + M + '.' + (+m + 1) + '.0' + pr\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nfunction replaceStars (comp, options) {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp.trim().replace(safeRe[t.STAR], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0\nfunction hyphenReplace ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = '>=' + fM + '.0.0'\n } else if (isX(fp)) {\n from = '>=' + fM + '.' + fm + '.0'\n } else {\n from = '>=' + from\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = '<' + (+tM + 1) + '.0.0'\n } else if (isX(tp)) {\n to = '<' + tM + '.' + (+tm + 1) + '.0'\n } else if (tpr) {\n to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr\n } else {\n to = '<=' + to\n }\n\n return (from + ' ' + to).trim()\n}\n\n// if ANY of the sets match ALL of its comparators, then pass\nRange.prototype.test = function (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (var i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n}\n\nfunction testSet (set, version, options) {\n for (var i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n var allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n\nexports.satisfies = satisfies\nfunction satisfies (version, range, options) {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\n\nexports.maxSatisfying = maxSatisfying\nfunction maxSatisfying (versions, range, options) {\n var max = null\n var maxSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\n\nexports.minSatisfying = minSatisfying\nfunction minSatisfying (versions, range, options) {\n var min = null\n var minSV = null\n try {\n var rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach(function (v) {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\n\nexports.minVersion = minVersion\nfunction minVersion (range, loose) {\n range = new Range(range, loose)\n\n var minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n comparators.forEach(function (comparator) {\n // Clone to avoid manipulating the comparator's semver object.\n var compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!minver || gt(minver, compver)) {\n minver = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error('Unexpected operation: ' + comparator.operator)\n }\n })\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\n\nexports.validRange = validRange\nfunction validRange (range, options) {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\n\n// Determine if version is less than all the versions possible in the range\nexports.ltr = ltr\nfunction ltr (version, range, options) {\n return outside(version, range, '<', options)\n}\n\n// Determine if version is greater than all the versions possible in the range.\nexports.gtr = gtr\nfunction gtr (version, range, options) {\n return outside(version, range, '>', options)\n}\n\nexports.outside = outside\nfunction outside (version, range, hilo, options) {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n var gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisifes the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (var i = 0; i < range.set.length; ++i) {\n var comparators = range.set[i]\n\n var high = null\n var low = null\n\n comparators.forEach(function (comparator) {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nexports.prerelease = prerelease\nfunction prerelease (version, options) {\n var parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\n\nexports.intersects = intersects\nfunction intersects (r1, r2, options) {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2)\n}\n\nexports.coerce = coerce\nfunction coerce (version, options) {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n var match = null\n if (!options.rtl) {\n match = version.match(safeRe[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n var next\n while ((next = safeRe[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n safeRe[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n return parse(match[2] +\n '.' + (match[3] || '0') +\n '.' + (match[4] || '0'), options)\n}\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In node.js\n// this is pretty straight-forward - we use the crypto API.\n\nvar crypto = require('crypto');\n\nmodule.exports = function nodeRNG() {\n return crypto.randomBytes(16);\n};\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.issue = exports.issueCommand = void 0;\nconst os = __importStar(require(\"os\"));\nconst utils_1 = require(\"./utils\");\n/**\n * Commands\n *\n * Command Format:\n * ::name key=value,key=value::message\n *\n * Examples:\n * ::warning::This is the message\n * ::set-env name=MY_VAR::some value\n */\nfunction issueCommand(command, properties, message) {\n const cmd = new Command(command, properties, message);\n process.stdout.write(cmd.toString() + os.EOL);\n}\nexports.issueCommand = issueCommand;\nfunction issue(name, message = '') {\n issueCommand(name, {}, message);\n}\nexports.issue = issue;\nconst CMD_STRING = '::';\nclass Command {\n constructor(command, properties, message) {\n if (!command) {\n command = 'missing.command';\n }\n this.command = command;\n this.properties = properties;\n this.message = message;\n }\n toString() {\n let cmdStr = CMD_STRING + this.command;\n if (this.properties && Object.keys(this.properties).length > 0) {\n cmdStr += ' ';\n let first = true;\n for (const key in this.properties) {\n if (this.properties.hasOwnProperty(key)) {\n const val = this.properties[key];\n if (val) {\n if (first) {\n first = false;\n }\n else {\n cmdStr += ',';\n }\n cmdStr += `${key}=${escapeProperty(val)}`;\n }\n }\n }\n }\n cmdStr += `${CMD_STRING}${escapeData(this.message)}`;\n return cmdStr;\n }\n}\nfunction escapeData(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A');\n}\nfunction escapeProperty(s) {\n return utils_1.toCommandValue(s)\n .replace(/%/g, '%25')\n .replace(/\\r/g, '%0D')\n .replace(/\\n/g, '%0A')\n .replace(/:/g, '%3A')\n .replace(/,/g, '%2C');\n}\n//# sourceMappingURL=command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getIDToken = exports.getState = exports.saveState = exports.group = exports.endGroup = exports.startGroup = exports.info = exports.notice = exports.warning = exports.error = exports.debug = exports.isDebug = exports.setFailed = exports.setCommandEcho = exports.setOutput = exports.getBooleanInput = exports.getMultilineInput = exports.getInput = exports.addPath = exports.setSecret = exports.exportVariable = exports.ExitCode = void 0;\nconst command_1 = require(\"./command\");\nconst file_command_1 = require(\"./file-command\");\nconst utils_1 = require(\"./utils\");\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst oidc_utils_1 = require(\"./oidc-utils\");\n/**\n * The code to exit an action\n */\nvar ExitCode;\n(function (ExitCode) {\n /**\n * A code indicating that the action was successful\n */\n ExitCode[ExitCode[\"Success\"] = 0] = \"Success\";\n /**\n * A code indicating that the action was a failure\n */\n ExitCode[ExitCode[\"Failure\"] = 1] = \"Failure\";\n})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));\n//-----------------------------------------------------------------------\n// Variables\n//-----------------------------------------------------------------------\n/**\n * Sets env variable for this action and future actions in the job\n * @param name the name of the variable to set\n * @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction exportVariable(name, val) {\n const convertedVal = utils_1.toCommandValue(val);\n process.env[name] = convertedVal;\n const filePath = process.env['GITHUB_ENV'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('ENV', file_command_1.prepareKeyValueMessage(name, val));\n }\n command_1.issueCommand('set-env', { name }, convertedVal);\n}\nexports.exportVariable = exportVariable;\n/**\n * Registers a secret which will get masked from logs\n * @param secret value of the secret\n */\nfunction setSecret(secret) {\n command_1.issueCommand('add-mask', {}, secret);\n}\nexports.setSecret = setSecret;\n/**\n * Prepends inputPath to the PATH (for this action and future actions)\n * @param inputPath\n */\nfunction addPath(inputPath) {\n const filePath = process.env['GITHUB_PATH'] || '';\n if (filePath) {\n file_command_1.issueFileCommand('PATH', inputPath);\n }\n else {\n command_1.issueCommand('add-path', {}, inputPath);\n }\n process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;\n}\nexports.addPath = addPath;\n/**\n * Gets the value of an input.\n * Unless trimWhitespace is set to false in InputOptions, the value is also trimmed.\n * Returns an empty string if the value is not defined.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string\n */\nfunction getInput(name, options) {\n const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';\n if (options && options.required && !val) {\n throw new Error(`Input required and not supplied: ${name}`);\n }\n if (options && options.trimWhitespace === false) {\n return val;\n }\n return val.trim();\n}\nexports.getInput = getInput;\n/**\n * Gets the values of an multiline input. Each value is also trimmed.\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns string[]\n *\n */\nfunction getMultilineInput(name, options) {\n const inputs = getInput(name, options)\n .split('\\n')\n .filter(x => x !== '');\n if (options && options.trimWhitespace === false) {\n return inputs;\n }\n return inputs.map(input => input.trim());\n}\nexports.getMultilineInput = getMultilineInput;\n/**\n * Gets the input value of the boolean type in the YAML 1.2 \"core schema\" specification.\n * Support boolean input list: `true | True | TRUE | false | False | FALSE` .\n * The return value is also in boolean type.\n * ref: https://yaml.org/spec/1.2/spec.html#id2804923\n *\n * @param name name of the input to get\n * @param options optional. See InputOptions.\n * @returns boolean\n */\nfunction getBooleanInput(name, options) {\n const trueValue = ['true', 'True', 'TRUE'];\n const falseValue = ['false', 'False', 'FALSE'];\n const val = getInput(name, options);\n if (trueValue.includes(val))\n return true;\n if (falseValue.includes(val))\n return false;\n throw new TypeError(`Input does not meet YAML 1.2 \"Core Schema\" specification: ${name}\\n` +\n `Support boolean input list: \\`true | True | TRUE | false | False | FALSE\\``);\n}\nexports.getBooleanInput = getBooleanInput;\n/**\n * Sets the value of an output.\n *\n * @param name name of the output to set\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction setOutput(name, value) {\n const filePath = process.env['GITHUB_OUTPUT'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('OUTPUT', file_command_1.prepareKeyValueMessage(name, value));\n }\n process.stdout.write(os.EOL);\n command_1.issueCommand('set-output', { name }, utils_1.toCommandValue(value));\n}\nexports.setOutput = setOutput;\n/**\n * Enables or disables the echoing of commands into stdout for the rest of the step.\n * Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.\n *\n */\nfunction setCommandEcho(enabled) {\n command_1.issue('echo', enabled ? 'on' : 'off');\n}\nexports.setCommandEcho = setCommandEcho;\n//-----------------------------------------------------------------------\n// Results\n//-----------------------------------------------------------------------\n/**\n * Sets the action status to failed.\n * When the action exits it will be with an exit code of 1\n * @param message add error issue message\n */\nfunction setFailed(message) {\n process.exitCode = ExitCode.Failure;\n error(message);\n}\nexports.setFailed = setFailed;\n//-----------------------------------------------------------------------\n// Logging Commands\n//-----------------------------------------------------------------------\n/**\n * Gets whether Actions Step Debug is on or not\n */\nfunction isDebug() {\n return process.env['RUNNER_DEBUG'] === '1';\n}\nexports.isDebug = isDebug;\n/**\n * Writes debug message to user log\n * @param message debug message\n */\nfunction debug(message) {\n command_1.issueCommand('debug', {}, message);\n}\nexports.debug = debug;\n/**\n * Adds an error issue\n * @param message error issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction error(message, properties = {}) {\n command_1.issueCommand('error', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.error = error;\n/**\n * Adds a warning issue\n * @param message warning issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction warning(message, properties = {}) {\n command_1.issueCommand('warning', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.warning = warning;\n/**\n * Adds a notice issue\n * @param message notice issue message. Errors will be converted to string via toString()\n * @param properties optional properties to add to the annotation.\n */\nfunction notice(message, properties = {}) {\n command_1.issueCommand('notice', utils_1.toCommandProperties(properties), message instanceof Error ? message.toString() : message);\n}\nexports.notice = notice;\n/**\n * Writes info to log with console.log.\n * @param message info message\n */\nfunction info(message) {\n process.stdout.write(message + os.EOL);\n}\nexports.info = info;\n/**\n * Begin an output group.\n *\n * Output until the next `groupEnd` will be foldable in this group\n *\n * @param name The name of the output group\n */\nfunction startGroup(name) {\n command_1.issue('group', name);\n}\nexports.startGroup = startGroup;\n/**\n * End an output group.\n */\nfunction endGroup() {\n command_1.issue('endgroup');\n}\nexports.endGroup = endGroup;\n/**\n * Wrap an asynchronous function call in a group.\n *\n * Returns the same type as the function itself.\n *\n * @param name The name of the group\n * @param fn The function to wrap in the group\n */\nfunction group(name, fn) {\n return __awaiter(this, void 0, void 0, function* () {\n startGroup(name);\n let result;\n try {\n result = yield fn();\n }\n finally {\n endGroup();\n }\n return result;\n });\n}\nexports.group = group;\n//-----------------------------------------------------------------------\n// Wrapper action state\n//-----------------------------------------------------------------------\n/**\n * Saves state for current action, the state can only be retrieved by this action's post job execution.\n *\n * @param name name of the state to store\n * @param value value to store. Non-string values will be converted to a string via JSON.stringify\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction saveState(name, value) {\n const filePath = process.env['GITHUB_STATE'] || '';\n if (filePath) {\n return file_command_1.issueFileCommand('STATE', file_command_1.prepareKeyValueMessage(name, value));\n }\n command_1.issueCommand('save-state', { name }, utils_1.toCommandValue(value));\n}\nexports.saveState = saveState;\n/**\n * Gets the value of an state set by this action's main execution.\n *\n * @param name name of the state to get\n * @returns string\n */\nfunction getState(name) {\n return process.env[`STATE_${name}`] || '';\n}\nexports.getState = getState;\nfunction getIDToken(aud) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield oidc_utils_1.OidcClient.getIDToken(aud);\n });\n}\nexports.getIDToken = getIDToken;\n/**\n * Summary exports\n */\nvar summary_1 = require(\"./summary\");\nObject.defineProperty(exports, \"summary\", { enumerable: true, get: function () { return summary_1.summary; } });\n/**\n * @deprecated use core.summary\n */\nvar summary_2 = require(\"./summary\");\nObject.defineProperty(exports, \"markdownSummary\", { enumerable: true, get: function () { return summary_2.markdownSummary; } });\n/**\n * Path exports\n */\nvar path_utils_1 = require(\"./path-utils\");\nObject.defineProperty(exports, \"toPosixPath\", { enumerable: true, get: function () { return path_utils_1.toPosixPath; } });\nObject.defineProperty(exports, \"toWin32Path\", { enumerable: true, get: function () { return path_utils_1.toWin32Path; } });\nObject.defineProperty(exports, \"toPlatformPath\", { enumerable: true, get: function () { return path_utils_1.toPlatformPath; } });\n//# sourceMappingURL=core.js.map","\"use strict\";\n// For internal use, subject to change.\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareKeyValueMessage = exports.issueFileCommand = void 0;\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nconst fs = __importStar(require(\"fs\"));\nconst os = __importStar(require(\"os\"));\nconst uuid_1 = require(\"uuid\");\nconst utils_1 = require(\"./utils\");\nfunction issueFileCommand(command, message) {\n const filePath = process.env[`GITHUB_${command}`];\n if (!filePath) {\n throw new Error(`Unable to find environment variable for file command ${command}`);\n }\n if (!fs.existsSync(filePath)) {\n throw new Error(`Missing file at path: ${filePath}`);\n }\n fs.appendFileSync(filePath, `${utils_1.toCommandValue(message)}${os.EOL}`, {\n encoding: 'utf8'\n });\n}\nexports.issueFileCommand = issueFileCommand;\nfunction prepareKeyValueMessage(key, value) {\n const delimiter = `ghadelimiter_${uuid_1.v4()}`;\n const convertedValue = utils_1.toCommandValue(value);\n // These should realistically never happen, but just in case someone finds a\n // way to exploit uuid generation let's not allow keys or values that contain\n // the delimiter.\n if (key.includes(delimiter)) {\n throw new Error(`Unexpected input: name should not contain the delimiter \"${delimiter}\"`);\n }\n if (convertedValue.includes(delimiter)) {\n throw new Error(`Unexpected input: value should not contain the delimiter \"${delimiter}\"`);\n }\n return `${key}<<${delimiter}${os.EOL}${convertedValue}${os.EOL}${delimiter}`;\n}\nexports.prepareKeyValueMessage = prepareKeyValueMessage;\n//# sourceMappingURL=file-command.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OidcClient = void 0;\nconst http_client_1 = require(\"@actions/http-client\");\nconst auth_1 = require(\"@actions/http-client/lib/auth\");\nconst core_1 = require(\"./core\");\nclass OidcClient {\n static createHttpClient(allowRetry = true, maxRetry = 10) {\n const requestOptions = {\n allowRetries: allowRetry,\n maxRetries: maxRetry\n };\n return new http_client_1.HttpClient('actions/oidc-client', [new auth_1.BearerCredentialHandler(OidcClient.getRequestToken())], requestOptions);\n }\n static getRequestToken() {\n const token = process.env['ACTIONS_ID_TOKEN_REQUEST_TOKEN'];\n if (!token) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_TOKEN env variable');\n }\n return token;\n }\n static getIDTokenUrl() {\n const runtimeUrl = process.env['ACTIONS_ID_TOKEN_REQUEST_URL'];\n if (!runtimeUrl) {\n throw new Error('Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable');\n }\n return runtimeUrl;\n }\n static getCall(id_token_url) {\n var _a;\n return __awaiter(this, void 0, void 0, function* () {\n const httpclient = OidcClient.createHttpClient();\n const res = yield httpclient\n .getJson(id_token_url)\n .catch(error => {\n throw new Error(`Failed to get ID Token. \\n \n Error Code : ${error.statusCode}\\n \n Error Message: ${error.result.message}`);\n });\n const id_token = (_a = res.result) === null || _a === void 0 ? void 0 : _a.value;\n if (!id_token) {\n throw new Error('Response json body do not have ID Token field');\n }\n return id_token;\n });\n }\n static getIDToken(audience) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n // New ID Token is requested from action service\n let id_token_url = OidcClient.getIDTokenUrl();\n if (audience) {\n const encodedAudience = encodeURIComponent(audience);\n id_token_url = `${id_token_url}&audience=${encodedAudience}`;\n }\n core_1.debug(`ID token url is ${id_token_url}`);\n const id_token = yield OidcClient.getCall(id_token_url);\n core_1.setSecret(id_token);\n return id_token;\n }\n catch (error) {\n throw new Error(`Error message: ${error.message}`);\n }\n });\n }\n}\nexports.OidcClient = OidcClient;\n//# sourceMappingURL=oidc-utils.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toPlatformPath = exports.toWin32Path = exports.toPosixPath = void 0;\nconst path = __importStar(require(\"path\"));\n/**\n * toPosixPath converts the given path to the posix form. On Windows, \\\\ will be\n * replaced with /.\n *\n * @param pth. Path to transform.\n * @return string Posix path.\n */\nfunction toPosixPath(pth) {\n return pth.replace(/[\\\\]/g, '/');\n}\nexports.toPosixPath = toPosixPath;\n/**\n * toWin32Path converts the given path to the win32 form. On Linux, / will be\n * replaced with \\\\.\n *\n * @param pth. Path to transform.\n * @return string Win32 path.\n */\nfunction toWin32Path(pth) {\n return pth.replace(/[/]/g, '\\\\');\n}\nexports.toWin32Path = toWin32Path;\n/**\n * toPlatformPath converts the given path to a platform-specific path. It does\n * this by replacing instances of / and \\ with the platform-specific path\n * separator.\n *\n * @param pth The path to platformize.\n * @return string The platform-specific path.\n */\nfunction toPlatformPath(pth) {\n return pth.replace(/[/\\\\]/g, path.sep);\n}\nexports.toPlatformPath = toPlatformPath;\n//# sourceMappingURL=path-utils.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.summary = exports.markdownSummary = exports.SUMMARY_DOCS_URL = exports.SUMMARY_ENV_VAR = void 0;\nconst os_1 = require(\"os\");\nconst fs_1 = require(\"fs\");\nconst { access, appendFile, writeFile } = fs_1.promises;\nexports.SUMMARY_ENV_VAR = 'GITHUB_STEP_SUMMARY';\nexports.SUMMARY_DOCS_URL = 'https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary';\nclass Summary {\n constructor() {\n this._buffer = '';\n }\n /**\n * Finds the summary file path from the environment, rejects if env var is not found or file does not exist\n * Also checks r/w permissions.\n *\n * @returns step summary file path\n */\n filePath() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._filePath) {\n return this._filePath;\n }\n const pathFromEnv = process.env[exports.SUMMARY_ENV_VAR];\n if (!pathFromEnv) {\n throw new Error(`Unable to find environment variable for $${exports.SUMMARY_ENV_VAR}. Check if your runtime environment supports job summaries.`);\n }\n try {\n yield access(pathFromEnv, fs_1.constants.R_OK | fs_1.constants.W_OK);\n }\n catch (_a) {\n throw new Error(`Unable to access summary file: '${pathFromEnv}'. Check if the file has correct read/write permissions.`);\n }\n this._filePath = pathFromEnv;\n return this._filePath;\n });\n }\n /**\n * Wraps content in an HTML tag, adding any HTML attributes\n *\n * @param {string} tag HTML tag to wrap\n * @param {string | null} content content within the tag\n * @param {[attribute: string]: string} attrs key-value list of HTML attributes to add\n *\n * @returns {string} content wrapped in HTML element\n */\n wrap(tag, content, attrs = {}) {\n const htmlAttrs = Object.entries(attrs)\n .map(([key, value]) => ` ${key}=\"${value}\"`)\n .join('');\n if (!content) {\n return `<${tag}${htmlAttrs}>`;\n }\n return `<${tag}${htmlAttrs}>${content}`;\n }\n /**\n * Writes text in the buffer to the summary buffer file and empties buffer. Will append by default.\n *\n * @param {SummaryWriteOptions} [options] (optional) options for write operation\n *\n * @returns {Promise} summary instance\n */\n write(options) {\n return __awaiter(this, void 0, void 0, function* () {\n const overwrite = !!(options === null || options === void 0 ? void 0 : options.overwrite);\n const filePath = yield this.filePath();\n const writeFunc = overwrite ? writeFile : appendFile;\n yield writeFunc(filePath, this._buffer, { encoding: 'utf8' });\n return this.emptyBuffer();\n });\n }\n /**\n * Clears the summary buffer and wipes the summary file\n *\n * @returns {Summary} summary instance\n */\n clear() {\n return __awaiter(this, void 0, void 0, function* () {\n return this.emptyBuffer().write({ overwrite: true });\n });\n }\n /**\n * Returns the current summary buffer as a string\n *\n * @returns {string} string of summary buffer\n */\n stringify() {\n return this._buffer;\n }\n /**\n * If the summary buffer is empty\n *\n * @returns {boolen} true if the buffer is empty\n */\n isEmptyBuffer() {\n return this._buffer.length === 0;\n }\n /**\n * Resets the summary buffer without writing to summary file\n *\n * @returns {Summary} summary instance\n */\n emptyBuffer() {\n this._buffer = '';\n return this;\n }\n /**\n * Adds raw text to the summary buffer\n *\n * @param {string} text content to add\n * @param {boolean} [addEOL=false] (optional) append an EOL to the raw text (default: false)\n *\n * @returns {Summary} summary instance\n */\n addRaw(text, addEOL = false) {\n this._buffer += text;\n return addEOL ? this.addEOL() : this;\n }\n /**\n * Adds the operating system-specific end-of-line marker to the buffer\n *\n * @returns {Summary} summary instance\n */\n addEOL() {\n return this.addRaw(os_1.EOL);\n }\n /**\n * Adds an HTML codeblock to the summary buffer\n *\n * @param {string} code content to render within fenced code block\n * @param {string} lang (optional) language to syntax highlight code\n *\n * @returns {Summary} summary instance\n */\n addCodeBlock(code, lang) {\n const attrs = Object.assign({}, (lang && { lang }));\n const element = this.wrap('pre', this.wrap('code', code), attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML list to the summary buffer\n *\n * @param {string[]} items list of items to render\n * @param {boolean} [ordered=false] (optional) if the rendered list should be ordered or not (default: false)\n *\n * @returns {Summary} summary instance\n */\n addList(items, ordered = false) {\n const tag = ordered ? 'ol' : 'ul';\n const listItems = items.map(item => this.wrap('li', item)).join('');\n const element = this.wrap(tag, listItems);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML table to the summary buffer\n *\n * @param {SummaryTableCell[]} rows table rows\n *\n * @returns {Summary} summary instance\n */\n addTable(rows) {\n const tableBody = rows\n .map(row => {\n const cells = row\n .map(cell => {\n if (typeof cell === 'string') {\n return this.wrap('td', cell);\n }\n const { header, data, colspan, rowspan } = cell;\n const tag = header ? 'th' : 'td';\n const attrs = Object.assign(Object.assign({}, (colspan && { colspan })), (rowspan && { rowspan }));\n return this.wrap(tag, data, attrs);\n })\n .join('');\n return this.wrap('tr', cells);\n })\n .join('');\n const element = this.wrap('table', tableBody);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds a collapsable HTML details element to the summary buffer\n *\n * @param {string} label text for the closed state\n * @param {string} content collapsable content\n *\n * @returns {Summary} summary instance\n */\n addDetails(label, content) {\n const element = this.wrap('details', this.wrap('summary', label) + content);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML image tag to the summary buffer\n *\n * @param {string} src path to the image you to embed\n * @param {string} alt text description of the image\n * @param {SummaryImageOptions} options (optional) addition image attributes\n *\n * @returns {Summary} summary instance\n */\n addImage(src, alt, options) {\n const { width, height } = options || {};\n const attrs = Object.assign(Object.assign({}, (width && { width })), (height && { height }));\n const element = this.wrap('img', null, Object.assign({ src, alt }, attrs));\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML section heading element\n *\n * @param {string} text heading text\n * @param {number | string} [level=1] (optional) the heading level, default: 1\n *\n * @returns {Summary} summary instance\n */\n addHeading(text, level) {\n const tag = `h${level}`;\n const allowedTag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'].includes(tag)\n ? tag\n : 'h1';\n const element = this.wrap(allowedTag, text);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML thematic break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addSeparator() {\n const element = this.wrap('hr', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML line break (
) to the summary buffer\n *\n * @returns {Summary} summary instance\n */\n addBreak() {\n const element = this.wrap('br', null);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML blockquote to the summary buffer\n *\n * @param {string} text quote text\n * @param {string} cite (optional) citation url\n *\n * @returns {Summary} summary instance\n */\n addQuote(text, cite) {\n const attrs = Object.assign({}, (cite && { cite }));\n const element = this.wrap('blockquote', text, attrs);\n return this.addRaw(element).addEOL();\n }\n /**\n * Adds an HTML anchor tag to the summary buffer\n *\n * @param {string} text link text/content\n * @param {string} href hyperlink\n *\n * @returns {Summary} summary instance\n */\n addLink(text, href) {\n const element = this.wrap('a', text, { href });\n return this.addRaw(element).addEOL();\n }\n}\nconst _summary = new Summary();\n/**\n * @deprecated use `core.summary`\n */\nexports.markdownSummary = _summary;\nexports.summary = _summary;\n//# sourceMappingURL=summary.js.map","\"use strict\";\n// We use any as a valid input type\n/* eslint-disable @typescript-eslint/no-explicit-any */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toCommandProperties = exports.toCommandValue = void 0;\n/**\n * Sanitizes an input into a string so it can be passed into issueCommand safely\n * @param input input to sanitize into a string\n */\nfunction toCommandValue(input) {\n if (input === null || input === undefined) {\n return '';\n }\n else if (typeof input === 'string' || input instanceof String) {\n return input;\n }\n return JSON.stringify(input);\n}\nexports.toCommandValue = toCommandValue;\n/**\n *\n * @param annotationProperties\n * @returns The command properties to send with the actual annotation command\n * See IssueCommandProperties: https://github.com/actions/runner/blob/main/src/Runner.Worker/ActionCommandManager.cs#L646\n */\nfunction toCommandProperties(annotationProperties) {\n if (!Object.keys(annotationProperties).length) {\n return {};\n }\n return {\n title: annotationProperties.title,\n file: annotationProperties.file,\n line: annotationProperties.startLine,\n endLine: annotationProperties.endLine,\n col: annotationProperties.startColumn,\n endColumn: annotationProperties.endColumn\n };\n}\nexports.toCommandProperties = toCommandProperties;\n//# sourceMappingURL=utils.js.map","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getExecOutput = exports.exec = void 0;\nconst string_decoder_1 = require(\"string_decoder\");\nconst tr = __importStar(require(\"./toolrunner\"));\n/**\n * Exec a command.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code\n */\nfunction exec(commandLine, args, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const commandArgs = tr.argStringToArray(commandLine);\n if (commandArgs.length === 0) {\n throw new Error(`Parameter 'commandLine' cannot be null or empty.`);\n }\n // Path to tool to execute should be first arg\n const toolPath = commandArgs[0];\n args = commandArgs.slice(1).concat(args || []);\n const runner = new tr.ToolRunner(toolPath, args, options);\n return runner.exec();\n });\n}\nexports.exec = exec;\n/**\n * Exec a command and get the output.\n * Output will be streamed to the live console.\n * Returns promise with the exit code and collected stdout and stderr\n *\n * @param commandLine command to execute (can include additional args). Must be correctly escaped.\n * @param args optional arguments for tool. Escaping is handled by the lib.\n * @param options optional exec options. See ExecOptions\n * @returns Promise exit code, stdout, and stderr\n */\nfunction getExecOutput(commandLine, args, options) {\n var _a, _b;\n return __awaiter(this, void 0, void 0, function* () {\n let stdout = '';\n let stderr = '';\n //Using string decoder covers the case where a mult-byte character is split\n const stdoutDecoder = new string_decoder_1.StringDecoder('utf8');\n const stderrDecoder = new string_decoder_1.StringDecoder('utf8');\n const originalStdoutListener = (_a = options === null || options === void 0 ? void 0 : options.listeners) === null || _a === void 0 ? void 0 : _a.stdout;\n const originalStdErrListener = (_b = options === null || options === void 0 ? void 0 : options.listeners) === null || _b === void 0 ? void 0 : _b.stderr;\n const stdErrListener = (data) => {\n stderr += stderrDecoder.write(data);\n if (originalStdErrListener) {\n originalStdErrListener(data);\n }\n };\n const stdOutListener = (data) => {\n stdout += stdoutDecoder.write(data);\n if (originalStdoutListener) {\n originalStdoutListener(data);\n }\n };\n const listeners = Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.listeners), { stdout: stdOutListener, stderr: stdErrListener });\n const exitCode = yield exec(commandLine, args, Object.assign(Object.assign({}, options), { listeners }));\n //flush any remaining characters\n stdout += stdoutDecoder.end();\n stderr += stderrDecoder.end();\n return {\n exitCode,\n stdout,\n stderr\n };\n });\n}\nexports.getExecOutput = getExecOutput;\n//# sourceMappingURL=exec.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.argStringToArray = exports.ToolRunner = void 0;\nconst os = __importStar(require(\"os\"));\nconst events = __importStar(require(\"events\"));\nconst child = __importStar(require(\"child_process\"));\nconst path = __importStar(require(\"path\"));\nconst io = __importStar(require(\"@actions/io\"));\nconst ioUtil = __importStar(require(\"@actions/io/lib/io-util\"));\nconst timers_1 = require(\"timers\");\n/* eslint-disable @typescript-eslint/unbound-method */\nconst IS_WINDOWS = process.platform === 'win32';\n/*\n * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.\n */\nclass ToolRunner extends events.EventEmitter {\n constructor(toolPath, args, options) {\n super();\n if (!toolPath) {\n throw new Error(\"Parameter 'toolPath' cannot be null or empty.\");\n }\n this.toolPath = toolPath;\n this.args = args || [];\n this.options = options || {};\n }\n _debug(message) {\n if (this.options.listeners && this.options.listeners.debug) {\n this.options.listeners.debug(message);\n }\n }\n _getCommandString(options, noPrefix) {\n const toolPath = this._getSpawnFileName();\n const args = this._getSpawnArgs(options);\n let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool\n if (IS_WINDOWS) {\n // Windows + cmd file\n if (this._isCmdFile()) {\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows + verbatim\n else if (options.windowsVerbatimArguments) {\n cmd += `\"${toolPath}\"`;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n // Windows (regular)\n else {\n cmd += this._windowsQuoteCmdArg(toolPath);\n for (const a of args) {\n cmd += ` ${this._windowsQuoteCmdArg(a)}`;\n }\n }\n }\n else {\n // OSX/Linux - this can likely be improved with some form of quoting.\n // creating processes on Unix is fundamentally different than Windows.\n // on Unix, execvp() takes an arg array.\n cmd += toolPath;\n for (const a of args) {\n cmd += ` ${a}`;\n }\n }\n return cmd;\n }\n _processLineBuffer(data, strBuffer, onLine) {\n try {\n let s = strBuffer + data.toString();\n let n = s.indexOf(os.EOL);\n while (n > -1) {\n const line = s.substring(0, n);\n onLine(line);\n // the rest of the string ...\n s = s.substring(n + os.EOL.length);\n n = s.indexOf(os.EOL);\n }\n return s;\n }\n catch (err) {\n // streaming lines to console is best effort. Don't fail a build.\n this._debug(`error processing line. Failed with error ${err}`);\n return '';\n }\n }\n _getSpawnFileName() {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n return process.env['COMSPEC'] || 'cmd.exe';\n }\n }\n return this.toolPath;\n }\n _getSpawnArgs(options) {\n if (IS_WINDOWS) {\n if (this._isCmdFile()) {\n let argline = `/D /S /C \"${this._windowsQuoteCmdArg(this.toolPath)}`;\n for (const a of this.args) {\n argline += ' ';\n argline += options.windowsVerbatimArguments\n ? a\n : this._windowsQuoteCmdArg(a);\n }\n argline += '\"';\n return [argline];\n }\n }\n return this.args;\n }\n _endsWith(str, end) {\n return str.endsWith(end);\n }\n _isCmdFile() {\n const upperToolPath = this.toolPath.toUpperCase();\n return (this._endsWith(upperToolPath, '.CMD') ||\n this._endsWith(upperToolPath, '.BAT'));\n }\n _windowsQuoteCmdArg(arg) {\n // for .exe, apply the normal quoting rules that libuv applies\n if (!this._isCmdFile()) {\n return this._uvQuoteCmdArg(arg);\n }\n // otherwise apply quoting rules specific to the cmd.exe command line parser.\n // the libuv rules are generic and are not designed specifically for cmd.exe\n // command line parser.\n //\n // for a detailed description of the cmd.exe command line parser, refer to\n // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912\n // need quotes for empty arg\n if (!arg) {\n return '\"\"';\n }\n // determine whether the arg needs to be quoted\n const cmdSpecialChars = [\n ' ',\n '\\t',\n '&',\n '(',\n ')',\n '[',\n ']',\n '{',\n '}',\n '^',\n '=',\n ';',\n '!',\n \"'\",\n '+',\n ',',\n '`',\n '~',\n '|',\n '<',\n '>',\n '\"'\n ];\n let needsQuotes = false;\n for (const char of arg) {\n if (cmdSpecialChars.some(x => x === char)) {\n needsQuotes = true;\n break;\n }\n }\n // short-circuit if quotes not needed\n if (!needsQuotes) {\n return arg;\n }\n // the following quoting rules are very similar to the rules that by libuv applies.\n //\n // 1) wrap the string in quotes\n //\n // 2) double-up quotes - i.e. \" => \"\"\n //\n // this is different from the libuv quoting rules. libuv replaces \" with \\\", which unfortunately\n // doesn't work well with a cmd.exe command line.\n //\n // note, replacing \" with \"\" also works well if the arg is passed to a downstream .NET console app.\n // for example, the command line:\n // foo.exe \"myarg:\"\"my val\"\"\"\n // is parsed by a .NET console app into an arg array:\n // [ \"myarg:\\\"my val\\\"\" ]\n // which is the same end result when applying libuv quoting rules. although the actual\n // command line from libuv quoting rules would look like:\n // foo.exe \"myarg:\\\"my val\\\"\"\n //\n // 3) double-up slashes that precede a quote,\n // e.g. hello \\world => \"hello \\world\"\n // hello\\\"world => \"hello\\\\\"\"world\"\n // hello\\\\\"world => \"hello\\\\\\\\\"\"world\"\n // hello world\\ => \"hello world\\\\\"\n //\n // technically this is not required for a cmd.exe command line, or the batch argument parser.\n // the reasons for including this as a .cmd quoting rule are:\n //\n // a) this is optimized for the scenario where the argument is passed from the .cmd file to an\n // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.\n //\n // b) it's what we've been doing previously (by deferring to node default behavior) and we\n // haven't heard any complaints about that aspect.\n //\n // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be\n // escaped when used on the command line directly - even though within a .cmd file % can be escaped\n // by using %%.\n //\n // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts\n // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.\n //\n // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would\n // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the\n // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args\n // to an external program.\n //\n // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.\n // % can be escaped within a .cmd file.\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\'; // double the slash\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\"'; // double the quote\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse\n .split('')\n .reverse()\n .join('');\n }\n _uvQuoteCmdArg(arg) {\n // Tool runner wraps child_process.spawn() and needs to apply the same quoting as\n // Node in certain cases where the undocumented spawn option windowsVerbatimArguments\n // is used.\n //\n // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,\n // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),\n // pasting copyright notice from Node within this function:\n //\n // Copyright Joyent, Inc. and other Node contributors. All rights reserved.\n //\n // Permission is hereby granted, free of charge, to any person obtaining a copy\n // of this software and associated documentation files (the \"Software\"), to\n // deal in the Software without restriction, including without limitation the\n // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n // sell copies of the Software, and to permit persons to whom the Software is\n // furnished to do so, subject to the following conditions:\n //\n // The above copyright notice and this permission notice shall be included in\n // all copies or substantial portions of the Software.\n //\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n // IN THE SOFTWARE.\n if (!arg) {\n // Need double quotation for empty argument\n return '\"\"';\n }\n if (!arg.includes(' ') && !arg.includes('\\t') && !arg.includes('\"')) {\n // No quotation needed\n return arg;\n }\n if (!arg.includes('\"') && !arg.includes('\\\\')) {\n // No embedded double quotes or backslashes, so I can just wrap\n // quote marks around the whole thing.\n return `\"${arg}\"`;\n }\n // Expected input/output:\n // input : hello\"world\n // output: \"hello\\\"world\"\n // input : hello\"\"world\n // output: \"hello\\\"\\\"world\"\n // input : hello\\world\n // output: hello\\world\n // input : hello\\\\world\n // output: hello\\\\world\n // input : hello\\\"world\n // output: \"hello\\\\\\\"world\"\n // input : hello\\\\\"world\n // output: \"hello\\\\\\\\\\\"world\"\n // input : hello world\\\n // output: \"hello world\\\\\" - note the comment in libuv actually reads \"hello world\\\"\n // but it appears the comment is wrong, it should be \"hello world\\\\\"\n let reverse = '\"';\n let quoteHit = true;\n for (let i = arg.length; i > 0; i--) {\n // walk the string in reverse\n reverse += arg[i - 1];\n if (quoteHit && arg[i - 1] === '\\\\') {\n reverse += '\\\\';\n }\n else if (arg[i - 1] === '\"') {\n quoteHit = true;\n reverse += '\\\\';\n }\n else {\n quoteHit = false;\n }\n }\n reverse += '\"';\n return reverse\n .split('')\n .reverse()\n .join('');\n }\n _cloneExecOptions(options) {\n options = options || {};\n const result = {\n cwd: options.cwd || process.cwd(),\n env: options.env || process.env,\n silent: options.silent || false,\n windowsVerbatimArguments: options.windowsVerbatimArguments || false,\n failOnStdErr: options.failOnStdErr || false,\n ignoreReturnCode: options.ignoreReturnCode || false,\n delay: options.delay || 10000\n };\n result.outStream = options.outStream || process.stdout;\n result.errStream = options.errStream || process.stderr;\n return result;\n }\n _getSpawnOptions(options, toolPath) {\n options = options || {};\n const result = {};\n result.cwd = options.cwd;\n result.env = options.env;\n result['windowsVerbatimArguments'] =\n options.windowsVerbatimArguments || this._isCmdFile();\n if (options.windowsVerbatimArguments) {\n result.argv0 = `\"${toolPath}\"`;\n }\n return result;\n }\n /**\n * Exec a tool.\n * Output will be streamed to the live console.\n * Returns promise with return code\n *\n * @param tool path to tool to exec\n * @param options optional exec options. See ExecOptions\n * @returns number\n */\n exec() {\n return __awaiter(this, void 0, void 0, function* () {\n // root the tool path if it is unrooted and contains relative pathing\n if (!ioUtil.isRooted(this.toolPath) &&\n (this.toolPath.includes('/') ||\n (IS_WINDOWS && this.toolPath.includes('\\\\')))) {\n // prefer options.cwd if it is specified, however options.cwd may also need to be rooted\n this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);\n }\n // if the tool is only a file name, then resolve it from the PATH\n // otherwise verify it exists (add extension on Windows if necessary)\n this.toolPath = yield io.which(this.toolPath, true);\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n this._debug(`exec tool: ${this.toolPath}`);\n this._debug('arguments:');\n for (const arg of this.args) {\n this._debug(` ${arg}`);\n }\n const optionsNonNull = this._cloneExecOptions(this.options);\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);\n }\n const state = new ExecState(optionsNonNull, this.toolPath);\n state.on('debug', (message) => {\n this._debug(message);\n });\n if (this.options.cwd && !(yield ioUtil.exists(this.options.cwd))) {\n return reject(new Error(`The cwd: ${this.options.cwd} does not exist!`));\n }\n const fileName = this._getSpawnFileName();\n const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));\n let stdbuffer = '';\n if (cp.stdout) {\n cp.stdout.on('data', (data) => {\n if (this.options.listeners && this.options.listeners.stdout) {\n this.options.listeners.stdout(data);\n }\n if (!optionsNonNull.silent && optionsNonNull.outStream) {\n optionsNonNull.outStream.write(data);\n }\n stdbuffer = this._processLineBuffer(data, stdbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.stdline) {\n this.options.listeners.stdline(line);\n }\n });\n });\n }\n let errbuffer = '';\n if (cp.stderr) {\n cp.stderr.on('data', (data) => {\n state.processStderr = true;\n if (this.options.listeners && this.options.listeners.stderr) {\n this.options.listeners.stderr(data);\n }\n if (!optionsNonNull.silent &&\n optionsNonNull.errStream &&\n optionsNonNull.outStream) {\n const s = optionsNonNull.failOnStdErr\n ? optionsNonNull.errStream\n : optionsNonNull.outStream;\n s.write(data);\n }\n errbuffer = this._processLineBuffer(data, errbuffer, (line) => {\n if (this.options.listeners && this.options.listeners.errline) {\n this.options.listeners.errline(line);\n }\n });\n });\n }\n cp.on('error', (err) => {\n state.processError = err.message;\n state.processExited = true;\n state.processClosed = true;\n state.CheckComplete();\n });\n cp.on('exit', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n cp.on('close', (code) => {\n state.processExitCode = code;\n state.processExited = true;\n state.processClosed = true;\n this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);\n state.CheckComplete();\n });\n state.on('done', (error, exitCode) => {\n if (stdbuffer.length > 0) {\n this.emit('stdline', stdbuffer);\n }\n if (errbuffer.length > 0) {\n this.emit('errline', errbuffer);\n }\n cp.removeAllListeners();\n if (error) {\n reject(error);\n }\n else {\n resolve(exitCode);\n }\n });\n if (this.options.input) {\n if (!cp.stdin) {\n throw new Error('child process missing stdin');\n }\n cp.stdin.end(this.options.input);\n }\n }));\n });\n }\n}\nexports.ToolRunner = ToolRunner;\n/**\n * Convert an arg string to an array of args. Handles escaping\n *\n * @param argString string of arguments\n * @returns string[] array of arguments\n */\nfunction argStringToArray(argString) {\n const args = [];\n let inQuotes = false;\n let escaped = false;\n let arg = '';\n function append(c) {\n // we only escape double quotes.\n if (escaped && c !== '\"') {\n arg += '\\\\';\n }\n arg += c;\n escaped = false;\n }\n for (let i = 0; i < argString.length; i++) {\n const c = argString.charAt(i);\n if (c === '\"') {\n if (!escaped) {\n inQuotes = !inQuotes;\n }\n else {\n append(c);\n }\n continue;\n }\n if (c === '\\\\' && escaped) {\n append(c);\n continue;\n }\n if (c === '\\\\' && inQuotes) {\n escaped = true;\n continue;\n }\n if (c === ' ' && !inQuotes) {\n if (arg.length > 0) {\n args.push(arg);\n arg = '';\n }\n continue;\n }\n append(c);\n }\n if (arg.length > 0) {\n args.push(arg.trim());\n }\n return args;\n}\nexports.argStringToArray = argStringToArray;\nclass ExecState extends events.EventEmitter {\n constructor(options, toolPath) {\n super();\n this.processClosed = false; // tracks whether the process has exited and stdio is closed\n this.processError = '';\n this.processExitCode = 0;\n this.processExited = false; // tracks whether the process has exited\n this.processStderr = false; // tracks whether stderr was written to\n this.delay = 10000; // 10 seconds\n this.done = false;\n this.timeout = null;\n if (!toolPath) {\n throw new Error('toolPath must not be empty');\n }\n this.options = options;\n this.toolPath = toolPath;\n if (options.delay) {\n this.delay = options.delay;\n }\n }\n CheckComplete() {\n if (this.done) {\n return;\n }\n if (this.processClosed) {\n this._setResult();\n }\n else if (this.processExited) {\n this.timeout = timers_1.setTimeout(ExecState.HandleTimeout, this.delay, this);\n }\n }\n _debug(message) {\n this.emit('debug', message);\n }\n _setResult() {\n // determine whether there is an error\n let error;\n if (this.processExited) {\n if (this.processError) {\n 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}`);\n }\n else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {\n error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);\n }\n else if (this.processStderr && this.options.failOnStdErr) {\n error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);\n }\n }\n // clear the timeout\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.done = true;\n this.emit('done', error, this.processExitCode);\n }\n static HandleTimeout(state) {\n if (state.done) {\n return;\n }\n if (!state.processClosed && state.processExited) {\n const message = `The STDIO streams did not close within ${state.delay /\n 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.`;\n state._debug(message);\n }\n state._setResult();\n }\n}\n//# sourceMappingURL=toolrunner.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.create = void 0;\nconst internal_globber_1 = require(\"./internal-globber\");\n/**\n * Constructs a globber\n *\n * @param patterns Patterns separated by newlines\n * @param options Glob options\n */\nfunction create(patterns, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield internal_globber_1.DefaultGlobber.create(patterns, options);\n });\n}\nexports.create = create;\n//# sourceMappingURL=glob.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getOptions = void 0;\nconst core = __importStar(require(\"@actions/core\"));\n/**\n * Returns a copy with defaults filled in.\n */\nfunction getOptions(copy) {\n const result = {\n followSymbolicLinks: true,\n implicitDescendants: true,\n omitBrokenSymbolicLinks: true\n };\n if (copy) {\n if (typeof copy.followSymbolicLinks === 'boolean') {\n result.followSymbolicLinks = copy.followSymbolicLinks;\n core.debug(`followSymbolicLinks '${result.followSymbolicLinks}'`);\n }\n if (typeof copy.implicitDescendants === 'boolean') {\n result.implicitDescendants = copy.implicitDescendants;\n core.debug(`implicitDescendants '${result.implicitDescendants}'`);\n }\n if (typeof copy.omitBrokenSymbolicLinks === 'boolean') {\n result.omitBrokenSymbolicLinks = copy.omitBrokenSymbolicLinks;\n core.debug(`omitBrokenSymbolicLinks '${result.omitBrokenSymbolicLinks}'`);\n }\n }\n return result;\n}\nexports.getOptions = getOptions;\n//# sourceMappingURL=internal-glob-options-helper.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __asyncValues = (this && this.__asyncValues) || function (o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n 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); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n};\nvar __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }\nvar __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultGlobber = void 0;\nconst core = __importStar(require(\"@actions/core\"));\nconst fs = __importStar(require(\"fs\"));\nconst globOptionsHelper = __importStar(require(\"./internal-glob-options-helper\"));\nconst path = __importStar(require(\"path\"));\nconst patternHelper = __importStar(require(\"./internal-pattern-helper\"));\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst internal_pattern_1 = require(\"./internal-pattern\");\nconst internal_search_state_1 = require(\"./internal-search-state\");\nconst IS_WINDOWS = process.platform === 'win32';\nclass DefaultGlobber {\n constructor(options) {\n this.patterns = [];\n this.searchPaths = [];\n this.options = globOptionsHelper.getOptions(options);\n }\n getSearchPaths() {\n // Return a copy\n return this.searchPaths.slice();\n }\n glob() {\n var e_1, _a;\n return __awaiter(this, void 0, void 0, function* () {\n const result = [];\n try {\n for (var _b = __asyncValues(this.globGenerator()), _c; _c = yield _b.next(), !_c.done;) {\n const itemPath = _c.value;\n result.push(itemPath);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return result;\n });\n }\n globGenerator() {\n return __asyncGenerator(this, arguments, function* globGenerator_1() {\n // Fill in defaults options\n const options = globOptionsHelper.getOptions(this.options);\n // Implicit descendants?\n const patterns = [];\n for (const pattern of this.patterns) {\n patterns.push(pattern);\n if (options.implicitDescendants &&\n (pattern.trailingSeparator ||\n pattern.segments[pattern.segments.length - 1] !== '**')) {\n patterns.push(new internal_pattern_1.Pattern(pattern.negate, true, pattern.segments.concat('**')));\n }\n }\n // Push the search paths\n const stack = [];\n for (const searchPath of patternHelper.getSearchPaths(patterns)) {\n core.debug(`Search path '${searchPath}'`);\n // Exists?\n try {\n // Intentionally using lstat. Detection for broken symlink\n // will be performed later (if following symlinks).\n yield __await(fs.promises.lstat(searchPath));\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n continue;\n }\n throw err;\n }\n stack.unshift(new internal_search_state_1.SearchState(searchPath, 1));\n }\n // Search\n const traversalChain = []; // used to detect cycles\n while (stack.length) {\n // Pop\n const item = stack.pop();\n // Match?\n const match = patternHelper.match(patterns, item.path);\n const partialMatch = !!match || patternHelper.partialMatch(patterns, item.path);\n if (!match && !partialMatch) {\n continue;\n }\n // Stat\n const stats = yield __await(DefaultGlobber.stat(item, options, traversalChain)\n // Broken symlink, or symlink cycle detected, or no longer exists\n );\n // Broken symlink, or symlink cycle detected, or no longer exists\n if (!stats) {\n continue;\n }\n // Directory\n if (stats.isDirectory()) {\n // Matched\n if (match & internal_match_kind_1.MatchKind.Directory) {\n yield yield __await(item.path);\n }\n // Descend?\n else if (!partialMatch) {\n continue;\n }\n // Push the child items in reverse\n const childLevel = item.level + 1;\n const childItems = (yield __await(fs.promises.readdir(item.path))).map(x => new internal_search_state_1.SearchState(path.join(item.path, x), childLevel));\n stack.push(...childItems.reverse());\n }\n // File\n else if (match & internal_match_kind_1.MatchKind.File) {\n yield yield __await(item.path);\n }\n }\n });\n }\n /**\n * Constructs a DefaultGlobber\n */\n static create(patterns, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const result = new DefaultGlobber(options);\n if (IS_WINDOWS) {\n patterns = patterns.replace(/\\r\\n/g, '\\n');\n patterns = patterns.replace(/\\r/g, '\\n');\n }\n const lines = patterns.split('\\n').map(x => x.trim());\n for (const line of lines) {\n // Empty or comment\n if (!line || line.startsWith('#')) {\n continue;\n }\n // Pattern\n else {\n result.patterns.push(new internal_pattern_1.Pattern(line));\n }\n }\n result.searchPaths.push(...patternHelper.getSearchPaths(result.patterns));\n return result;\n });\n }\n static stat(item, options, traversalChain) {\n return __awaiter(this, void 0, void 0, function* () {\n // Note:\n // `stat` returns info about the target of a symlink (or symlink chain)\n // `lstat` returns info about a symlink itself\n let stats;\n if (options.followSymbolicLinks) {\n try {\n // Use `stat` (following symlinks)\n stats = yield fs.promises.stat(item.path);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n if (options.omitBrokenSymbolicLinks) {\n core.debug(`Broken symlink '${item.path}'`);\n return undefined;\n }\n throw new Error(`No information found for the path '${item.path}'. This may indicate a broken symbolic link.`);\n }\n throw err;\n }\n }\n else {\n // Use `lstat` (not following symlinks)\n stats = yield fs.promises.lstat(item.path);\n }\n // Note, isDirectory() returns false for the lstat of a symlink\n if (stats.isDirectory() && options.followSymbolicLinks) {\n // Get the realpath\n const realPath = yield fs.promises.realpath(item.path);\n // Fixup the traversal chain to match the item level\n while (traversalChain.length >= item.level) {\n traversalChain.pop();\n }\n // Test for a cycle\n if (traversalChain.some((x) => x === realPath)) {\n core.debug(`Symlink cycle detected for path '${item.path}' and realpath '${realPath}'`);\n return undefined;\n }\n // Update the traversal chain\n traversalChain.push(realPath);\n }\n return stats;\n });\n }\n}\nexports.DefaultGlobber = DefaultGlobber;\n//# sourceMappingURL=internal-globber.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MatchKind = void 0;\n/**\n * Indicates whether a pattern matches a path\n */\nvar MatchKind;\n(function (MatchKind) {\n /** Not matched */\n MatchKind[MatchKind[\"None\"] = 0] = \"None\";\n /** Matched if the path is a directory */\n MatchKind[MatchKind[\"Directory\"] = 1] = \"Directory\";\n /** Matched if the path is a regular file */\n MatchKind[MatchKind[\"File\"] = 2] = \"File\";\n /** Matched */\n MatchKind[MatchKind[\"All\"] = 3] = \"All\";\n})(MatchKind = exports.MatchKind || (exports.MatchKind = {}));\n//# sourceMappingURL=internal-match-kind.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.safeTrimTrailingSeparator = exports.normalizeSeparators = exports.hasRoot = exports.hasAbsoluteRoot = exports.ensureAbsoluteRoot = exports.dirname = void 0;\nconst path = __importStar(require(\"path\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Similar to path.dirname except normalizes the path separators and slightly better handling for Windows UNC paths.\n *\n * For example, on Linux/macOS:\n * - `/ => /`\n * - `/hello => /`\n *\n * For example, on Windows:\n * - `C:\\ => C:\\`\n * - `C:\\hello => C:\\`\n * - `C: => C:`\n * - `C:hello => C:`\n * - `\\ => \\`\n * - `\\hello => \\`\n * - `\\\\hello => \\\\hello`\n * - `\\\\hello\\world => \\\\hello\\world`\n */\nfunction dirname(p) {\n // Normalize slashes and trim unnecessary trailing slash\n p = safeTrimTrailingSeparator(p);\n // Windows UNC root, e.g. \\\\hello or \\\\hello\\world\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+(\\\\[^\\\\]+)?$/.test(p)) {\n return p;\n }\n // Get dirname\n let result = path.dirname(p);\n // Trim trailing slash for Windows UNC root, e.g. \\\\hello\\world\\\n if (IS_WINDOWS && /^\\\\\\\\[^\\\\]+\\\\[^\\\\]+\\\\$/.test(result)) {\n result = safeTrimTrailingSeparator(result);\n }\n return result;\n}\nexports.dirname = dirname;\n/**\n * Roots the path if not already rooted. On Windows, relative roots like `\\`\n * or `C:` are expanded based on the current working directory.\n */\nfunction ensureAbsoluteRoot(root, itemPath) {\n assert_1.default(root, `ensureAbsoluteRoot parameter 'root' must not be empty`);\n assert_1.default(itemPath, `ensureAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Already rooted\n if (hasAbsoluteRoot(itemPath)) {\n return itemPath;\n }\n // Windows\n if (IS_WINDOWS) {\n // Check for itemPath like C: or C:foo\n if (itemPath.match(/^[A-Z]:[^\\\\/]|^[A-Z]:$/i)) {\n let cwd = process.cwd();\n assert_1.default(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n // Drive letter matches cwd? Expand to cwd\n if (itemPath[0].toUpperCase() === cwd[0].toUpperCase()) {\n // Drive only, e.g. C:\n if (itemPath.length === 2) {\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}`;\n }\n // Drive + path, e.g. C:foo\n else {\n if (!cwd.endsWith('\\\\')) {\n cwd += '\\\\';\n }\n // Preserve specified drive letter case (upper or lower)\n return `${itemPath[0]}:\\\\${cwd.substr(3)}${itemPath.substr(2)}`;\n }\n }\n // Different drive\n else {\n return `${itemPath[0]}:\\\\${itemPath.substr(2)}`;\n }\n }\n // Check for itemPath like \\ or \\foo\n else if (normalizeSeparators(itemPath).match(/^\\\\$|^\\\\[^\\\\]/)) {\n const cwd = process.cwd();\n assert_1.default(cwd.match(/^[A-Z]:\\\\/i), `Expected current directory to start with an absolute drive root. Actual '${cwd}'`);\n return `${cwd[0]}:\\\\${itemPath.substr(1)}`;\n }\n }\n assert_1.default(hasAbsoluteRoot(root), `ensureAbsoluteRoot parameter 'root' must have an absolute root`);\n // Otherwise ensure root ends with a separator\n if (root.endsWith('/') || (IS_WINDOWS && root.endsWith('\\\\'))) {\n // Intentionally empty\n }\n else {\n // Append separator\n root += path.sep;\n }\n return root + itemPath;\n}\nexports.ensureAbsoluteRoot = ensureAbsoluteRoot;\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\\\hello\\share` and `C:\\hello` (and using alternate separator).\n */\nfunction hasAbsoluteRoot(itemPath) {\n assert_1.default(itemPath, `hasAbsoluteRoot parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\\\hello\\share or C:\\hello\n return itemPath.startsWith('\\\\\\\\') || /^[A-Z]:\\\\/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\nexports.hasAbsoluteRoot = hasAbsoluteRoot;\n/**\n * On Linux/macOS, true if path starts with `/`. On Windows, true for paths like:\n * `\\`, `\\hello`, `\\\\hello\\share`, `C:`, and `C:\\hello` (and using alternate separator).\n */\nfunction hasRoot(itemPath) {\n assert_1.default(itemPath, `isRooted parameter 'itemPath' must not be empty`);\n // Normalize separators\n itemPath = normalizeSeparators(itemPath);\n // Windows\n if (IS_WINDOWS) {\n // E.g. \\ or \\hello or \\\\hello\n // E.g. C: or C:\\hello\n return itemPath.startsWith('\\\\') || /^[A-Z]:/i.test(itemPath);\n }\n // E.g. /hello\n return itemPath.startsWith('/');\n}\nexports.hasRoot = hasRoot;\n/**\n * Removes redundant slashes and converts `/` to `\\` on Windows\n */\nfunction normalizeSeparators(p) {\n p = p || '';\n // Windows\n if (IS_WINDOWS) {\n // Convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // Remove redundant slashes\n const isUnc = /^\\\\\\\\+[^\\\\]/.test(p); // e.g. \\\\hello\n return (isUnc ? '\\\\' : '') + p.replace(/\\\\\\\\+/g, '\\\\'); // preserve leading \\\\ for UNC\n }\n // Remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\nexports.normalizeSeparators = normalizeSeparators;\n/**\n * Normalizes the path separators and trims the trailing separator (when safe).\n * For example, `/foo/ => /foo` but `/ => /`\n */\nfunction safeTrimTrailingSeparator(p) {\n // Short-circuit if empty\n if (!p) {\n return '';\n }\n // Normalize separators\n p = normalizeSeparators(p);\n // No trailing slash\n if (!p.endsWith(path.sep)) {\n return p;\n }\n // Check '/' on Linux/macOS and '\\' on Windows\n if (p === path.sep) {\n return p;\n }\n // On Windows check if drive root. E.g. C:\\\n if (IS_WINDOWS && /^[A-Z]:\\\\$/i.test(p)) {\n return p;\n }\n // Otherwise trim trailing slash\n return p.substr(0, p.length - 1);\n}\nexports.safeTrimTrailingSeparator = safeTrimTrailingSeparator;\n//# sourceMappingURL=internal-path-helper.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Path = void 0;\nconst path = __importStar(require(\"path\"));\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Helper class for parsing paths into segments\n */\nclass Path {\n /**\n * Constructs a Path\n * @param itemPath Path or array of segments\n */\n constructor(itemPath) {\n this.segments = [];\n // String\n if (typeof itemPath === 'string') {\n assert_1.default(itemPath, `Parameter 'itemPath' must not be empty`);\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n // Not rooted\n if (!pathHelper.hasRoot(itemPath)) {\n this.segments = itemPath.split(path.sep);\n }\n // Rooted\n else {\n // Add all segments, while not at the root\n let remaining = itemPath;\n let dir = pathHelper.dirname(remaining);\n while (dir !== remaining) {\n // Add the segment\n const basename = path.basename(remaining);\n this.segments.unshift(basename);\n // Truncate the last segment\n remaining = dir;\n dir = pathHelper.dirname(remaining);\n }\n // Remainder is the root\n this.segments.unshift(remaining);\n }\n }\n // Array\n else {\n // Must not be empty\n assert_1.default(itemPath.length > 0, `Parameter 'itemPath' must not be an empty array`);\n // Each segment\n for (let i = 0; i < itemPath.length; i++) {\n let segment = itemPath[i];\n // Must not be empty\n assert_1.default(segment, `Parameter 'itemPath' must not contain any empty segments`);\n // Normalize slashes\n segment = pathHelper.normalizeSeparators(itemPath[i]);\n // Root segment\n if (i === 0 && pathHelper.hasRoot(segment)) {\n segment = pathHelper.safeTrimTrailingSeparator(segment);\n assert_1.default(segment === pathHelper.dirname(segment), `Parameter 'itemPath' root segment contains information for multiple segments`);\n this.segments.push(segment);\n }\n // All other segments\n else {\n // Must not contain slash\n assert_1.default(!segment.includes(path.sep), `Parameter 'itemPath' contains unexpected path separators`);\n this.segments.push(segment);\n }\n }\n }\n }\n /**\n * Converts the path to it's string representation\n */\n toString() {\n // First segment\n let result = this.segments[0];\n // All others\n let skipSlash = result.endsWith(path.sep) || (IS_WINDOWS && /^[A-Z]:$/i.test(result));\n for (let i = 1; i < this.segments.length; i++) {\n if (skipSlash) {\n skipSlash = false;\n }\n else {\n result += path.sep;\n }\n result += this.segments[i];\n }\n return result;\n }\n}\nexports.Path = Path;\n//# sourceMappingURL=internal-path.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.partialMatch = exports.match = exports.getSearchPaths = void 0;\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst IS_WINDOWS = process.platform === 'win32';\n/**\n * Given an array of patterns, returns an array of paths to search.\n * Duplicates and paths under other included paths are filtered out.\n */\nfunction getSearchPaths(patterns) {\n // Ignore negate patterns\n patterns = patterns.filter(x => !x.negate);\n // Create a map of all search paths\n const searchPathMap = {};\n for (const pattern of patterns) {\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n searchPathMap[key] = 'candidate';\n }\n const result = [];\n for (const pattern of patterns) {\n // Check if already included\n const key = IS_WINDOWS\n ? pattern.searchPath.toUpperCase()\n : pattern.searchPath;\n if (searchPathMap[key] === 'included') {\n continue;\n }\n // Check for an ancestor search path\n let foundAncestor = false;\n let tempKey = key;\n let parent = pathHelper.dirname(tempKey);\n while (parent !== tempKey) {\n if (searchPathMap[parent]) {\n foundAncestor = true;\n break;\n }\n tempKey = parent;\n parent = pathHelper.dirname(tempKey);\n }\n // Include the search pattern in the result\n if (!foundAncestor) {\n result.push(pattern.searchPath);\n searchPathMap[key] = 'included';\n }\n }\n return result;\n}\nexports.getSearchPaths = getSearchPaths;\n/**\n * Matches the patterns against the path\n */\nfunction match(patterns, itemPath) {\n let result = internal_match_kind_1.MatchKind.None;\n for (const pattern of patterns) {\n if (pattern.negate) {\n result &= ~pattern.match(itemPath);\n }\n else {\n result |= pattern.match(itemPath);\n }\n }\n return result;\n}\nexports.match = match;\n/**\n * Checks whether to descend further into the directory\n */\nfunction partialMatch(patterns, itemPath) {\n return patterns.some(x => !x.negate && x.partialMatch(itemPath));\n}\nexports.partialMatch = partialMatch;\n//# sourceMappingURL=internal-pattern-helper.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Pattern = void 0;\nconst os = __importStar(require(\"os\"));\nconst path = __importStar(require(\"path\"));\nconst pathHelper = __importStar(require(\"./internal-path-helper\"));\nconst assert_1 = __importDefault(require(\"assert\"));\nconst minimatch_1 = require(\"minimatch\");\nconst internal_match_kind_1 = require(\"./internal-match-kind\");\nconst internal_path_1 = require(\"./internal-path\");\nconst IS_WINDOWS = process.platform === 'win32';\nclass Pattern {\n constructor(patternOrNegate, isImplicitPattern = false, segments, homedir) {\n /**\n * Indicates whether matches should be excluded from the result set\n */\n this.negate = false;\n // Pattern overload\n let pattern;\n if (typeof patternOrNegate === 'string') {\n pattern = patternOrNegate.trim();\n }\n // Segments overload\n else {\n // Convert to pattern\n segments = segments || [];\n assert_1.default(segments.length, `Parameter 'segments' must not empty`);\n const root = Pattern.getLiteral(segments[0]);\n assert_1.default(root && pathHelper.hasAbsoluteRoot(root), `Parameter 'segments' first element must be a root path`);\n pattern = new internal_path_1.Path(segments).toString().trim();\n if (patternOrNegate) {\n pattern = `!${pattern}`;\n }\n }\n // Negate\n while (pattern.startsWith('!')) {\n this.negate = !this.negate;\n pattern = pattern.substr(1).trim();\n }\n // Normalize slashes and ensures absolute root\n pattern = Pattern.fixupPattern(pattern, homedir);\n // Segments\n this.segments = new internal_path_1.Path(pattern).segments;\n // Trailing slash indicates the pattern should only match directories, not regular files\n this.trailingSeparator = pathHelper\n .normalizeSeparators(pattern)\n .endsWith(path.sep);\n pattern = pathHelper.safeTrimTrailingSeparator(pattern);\n // Search path (literal path prior to the first glob segment)\n let foundGlob = false;\n const searchSegments = this.segments\n .map(x => Pattern.getLiteral(x))\n .filter(x => !foundGlob && !(foundGlob = x === ''));\n this.searchPath = new internal_path_1.Path(searchSegments).toString();\n // Root RegExp (required when determining partial match)\n this.rootRegExp = new RegExp(Pattern.regExpEscape(searchSegments[0]), IS_WINDOWS ? 'i' : '');\n this.isImplicitPattern = isImplicitPattern;\n // Create minimatch\n const minimatchOptions = {\n dot: true,\n nobrace: true,\n nocase: IS_WINDOWS,\n nocomment: true,\n noext: true,\n nonegate: true\n };\n pattern = IS_WINDOWS ? pattern.replace(/\\\\/g, '/') : pattern;\n this.minimatch = new minimatch_1.Minimatch(pattern, minimatchOptions);\n }\n /**\n * Matches the pattern against the specified path\n */\n match(itemPath) {\n // Last segment is globstar?\n if (this.segments[this.segments.length - 1] === '**') {\n // Normalize slashes\n itemPath = pathHelper.normalizeSeparators(itemPath);\n // Append a trailing slash. Otherwise Minimatch will not match the directory immediately\n // preceding the globstar. For example, given the pattern `/foo/**`, Minimatch returns\n // false for `/foo` but returns true for `/foo/`. Append a trailing slash to handle that quirk.\n if (!itemPath.endsWith(path.sep) && this.isImplicitPattern === false) {\n // Note, this is safe because the constructor ensures the pattern has an absolute root.\n // For example, formats like C: and C:foo on Windows are resolved to an absolute root.\n itemPath = `${itemPath}${path.sep}`;\n }\n }\n else {\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n }\n // Match\n if (this.minimatch.match(itemPath)) {\n return this.trailingSeparator ? internal_match_kind_1.MatchKind.Directory : internal_match_kind_1.MatchKind.All;\n }\n return internal_match_kind_1.MatchKind.None;\n }\n /**\n * Indicates whether the pattern may match descendants of the specified path\n */\n partialMatch(itemPath) {\n // Normalize slashes and trim unnecessary trailing slash\n itemPath = pathHelper.safeTrimTrailingSeparator(itemPath);\n // matchOne does not handle root path correctly\n if (pathHelper.dirname(itemPath) === itemPath) {\n return this.rootRegExp.test(itemPath);\n }\n return this.minimatch.matchOne(itemPath.split(IS_WINDOWS ? /\\\\+/ : /\\/+/), this.minimatch.set[0], true);\n }\n /**\n * Escapes glob patterns within a path\n */\n static globEscape(s) {\n return (IS_WINDOWS ? s : s.replace(/\\\\/g, '\\\\\\\\')) // escape '\\' on Linux/macOS\n .replace(/(\\[)(?=[^/]+\\])/g, '[[]') // escape '[' when ']' follows within the path segment\n .replace(/\\?/g, '[?]') // escape '?'\n .replace(/\\*/g, '[*]'); // escape '*'\n }\n /**\n * Normalizes slashes and ensures absolute root\n */\n static fixupPattern(pattern, homedir) {\n // Empty\n assert_1.default(pattern, 'pattern cannot be empty');\n // Must not contain `.` segment, unless first segment\n // Must not contain `..` segment\n const literalSegments = new internal_path_1.Path(pattern).segments.map(x => Pattern.getLiteral(x));\n assert_1.default(literalSegments.every((x, i) => (x !== '.' || i === 0) && x !== '..'), `Invalid pattern '${pattern}'. Relative pathing '.' and '..' is not allowed.`);\n // Must not contain globs in root, e.g. Windows UNC path \\\\foo\\b*r\n assert_1.default(!pathHelper.hasRoot(pattern) || literalSegments[0], `Invalid pattern '${pattern}'. Root segment must not contain globs.`);\n // Normalize slashes\n pattern = pathHelper.normalizeSeparators(pattern);\n // Replace leading `.` segment\n if (pattern === '.' || pattern.startsWith(`.${path.sep}`)) {\n pattern = Pattern.globEscape(process.cwd()) + pattern.substr(1);\n }\n // Replace leading `~` segment\n else if (pattern === '~' || pattern.startsWith(`~${path.sep}`)) {\n homedir = homedir || os.homedir();\n assert_1.default(homedir, 'Unable to determine HOME directory');\n assert_1.default(pathHelper.hasAbsoluteRoot(homedir), `Expected HOME directory to be a rooted path. Actual '${homedir}'`);\n pattern = Pattern.globEscape(homedir) + pattern.substr(1);\n }\n // Replace relative drive root, e.g. pattern is C: or C:foo\n else if (IS_WINDOWS &&\n (pattern.match(/^[A-Z]:$/i) || pattern.match(/^[A-Z]:[^\\\\]/i))) {\n let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', pattern.substr(0, 2));\n if (pattern.length > 2 && !root.endsWith('\\\\')) {\n root += '\\\\';\n }\n pattern = Pattern.globEscape(root) + pattern.substr(2);\n }\n // Replace relative root, e.g. pattern is \\ or \\foo\n else if (IS_WINDOWS && (pattern === '\\\\' || pattern.match(/^\\\\[^\\\\]/))) {\n let root = pathHelper.ensureAbsoluteRoot('C:\\\\dummy-root', '\\\\');\n if (!root.endsWith('\\\\')) {\n root += '\\\\';\n }\n pattern = Pattern.globEscape(root) + pattern.substr(1);\n }\n // Otherwise ensure absolute root\n else {\n pattern = pathHelper.ensureAbsoluteRoot(Pattern.globEscape(process.cwd()), pattern);\n }\n return pathHelper.normalizeSeparators(pattern);\n }\n /**\n * Attempts to unescape a pattern segment to create a literal path segment.\n * Otherwise returns empty string.\n */\n static getLiteral(segment) {\n let literal = '';\n for (let i = 0; i < segment.length; i++) {\n const c = segment[i];\n // Escape\n if (c === '\\\\' && !IS_WINDOWS && i + 1 < segment.length) {\n literal += segment[++i];\n continue;\n }\n // Wildcard\n else if (c === '*' || c === '?') {\n return '';\n }\n // Character set\n else if (c === '[' && i + 1 < segment.length) {\n let set = '';\n let closed = -1;\n for (let i2 = i + 1; i2 < segment.length; i2++) {\n const c2 = segment[i2];\n // Escape\n if (c2 === '\\\\' && !IS_WINDOWS && i2 + 1 < segment.length) {\n set += segment[++i2];\n continue;\n }\n // Closed\n else if (c2 === ']') {\n closed = i2;\n break;\n }\n // Otherwise\n else {\n set += c2;\n }\n }\n // Closed?\n if (closed >= 0) {\n // Cannot convert\n if (set.length > 1) {\n return '';\n }\n // Convert to literal\n if (set) {\n literal += set;\n i = closed;\n continue;\n }\n }\n // Otherwise fall thru\n }\n // Append\n literal += c;\n }\n return literal;\n }\n /**\n * Escapes regexp special characters\n * https://javascript.info/regexp-escaping\n */\n static regExpEscape(s) {\n return s.replace(/[[\\\\^$.|?*+()]/g, '\\\\$&');\n }\n}\nexports.Pattern = Pattern;\n//# sourceMappingURL=internal-pattern.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SearchState = void 0;\nclass SearchState {\n constructor(path, level) {\n this.path = path;\n this.level = level;\n }\n}\nexports.SearchState = SearchState;\n//# sourceMappingURL=internal-search-state.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PersonalAccessTokenCredentialHandler = exports.BearerCredentialHandler = exports.BasicCredentialHandler = void 0;\nclass BasicCredentialHandler {\n constructor(username, password) {\n this.username = username;\n this.password = password;\n }\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`${this.username}:${this.password}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BasicCredentialHandler = BasicCredentialHandler;\nclass BearerCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Bearer ${this.token}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.BearerCredentialHandler = BearerCredentialHandler;\nclass PersonalAccessTokenCredentialHandler {\n constructor(token) {\n this.token = token;\n }\n // currently implements pre-authorization\n // TODO: support preAuth = false where it hooks on 401\n prepareRequest(options) {\n if (!options.headers) {\n throw Error('The request has no headers');\n }\n options.headers['Authorization'] = `Basic ${Buffer.from(`PAT:${this.token}`).toString('base64')}`;\n }\n // This handler cannot handle 401\n canHandleAuthentication() {\n return false;\n }\n handleAuthentication() {\n return __awaiter(this, void 0, void 0, function* () {\n throw new Error('not implemented');\n });\n }\n}\nexports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;\n//# sourceMappingURL=auth.js.map","\"use strict\";\n/* eslint-disable @typescript-eslint/no-explicit-any */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HttpClient = exports.isHttps = exports.HttpClientResponse = exports.HttpClientError = exports.getProxyUrl = exports.MediaTypes = exports.Headers = exports.HttpCodes = void 0;\nconst http = __importStar(require(\"http\"));\nconst https = __importStar(require(\"https\"));\nconst pm = __importStar(require(\"./proxy\"));\nconst tunnel = __importStar(require(\"tunnel\"));\nvar HttpCodes;\n(function (HttpCodes) {\n HttpCodes[HttpCodes[\"OK\"] = 200] = \"OK\";\n HttpCodes[HttpCodes[\"MultipleChoices\"] = 300] = \"MultipleChoices\";\n HttpCodes[HttpCodes[\"MovedPermanently\"] = 301] = \"MovedPermanently\";\n HttpCodes[HttpCodes[\"ResourceMoved\"] = 302] = \"ResourceMoved\";\n HttpCodes[HttpCodes[\"SeeOther\"] = 303] = \"SeeOther\";\n HttpCodes[HttpCodes[\"NotModified\"] = 304] = \"NotModified\";\n HttpCodes[HttpCodes[\"UseProxy\"] = 305] = \"UseProxy\";\n HttpCodes[HttpCodes[\"SwitchProxy\"] = 306] = \"SwitchProxy\";\n HttpCodes[HttpCodes[\"TemporaryRedirect\"] = 307] = \"TemporaryRedirect\";\n HttpCodes[HttpCodes[\"PermanentRedirect\"] = 308] = \"PermanentRedirect\";\n HttpCodes[HttpCodes[\"BadRequest\"] = 400] = \"BadRequest\";\n HttpCodes[HttpCodes[\"Unauthorized\"] = 401] = \"Unauthorized\";\n HttpCodes[HttpCodes[\"PaymentRequired\"] = 402] = \"PaymentRequired\";\n HttpCodes[HttpCodes[\"Forbidden\"] = 403] = \"Forbidden\";\n HttpCodes[HttpCodes[\"NotFound\"] = 404] = \"NotFound\";\n HttpCodes[HttpCodes[\"MethodNotAllowed\"] = 405] = \"MethodNotAllowed\";\n HttpCodes[HttpCodes[\"NotAcceptable\"] = 406] = \"NotAcceptable\";\n HttpCodes[HttpCodes[\"ProxyAuthenticationRequired\"] = 407] = \"ProxyAuthenticationRequired\";\n HttpCodes[HttpCodes[\"RequestTimeout\"] = 408] = \"RequestTimeout\";\n HttpCodes[HttpCodes[\"Conflict\"] = 409] = \"Conflict\";\n HttpCodes[HttpCodes[\"Gone\"] = 410] = \"Gone\";\n HttpCodes[HttpCodes[\"TooManyRequests\"] = 429] = \"TooManyRequests\";\n HttpCodes[HttpCodes[\"InternalServerError\"] = 500] = \"InternalServerError\";\n HttpCodes[HttpCodes[\"NotImplemented\"] = 501] = \"NotImplemented\";\n HttpCodes[HttpCodes[\"BadGateway\"] = 502] = \"BadGateway\";\n HttpCodes[HttpCodes[\"ServiceUnavailable\"] = 503] = \"ServiceUnavailable\";\n HttpCodes[HttpCodes[\"GatewayTimeout\"] = 504] = \"GatewayTimeout\";\n})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));\nvar Headers;\n(function (Headers) {\n Headers[\"Accept\"] = \"accept\";\n Headers[\"ContentType\"] = \"content-type\";\n})(Headers = exports.Headers || (exports.Headers = {}));\nvar MediaTypes;\n(function (MediaTypes) {\n MediaTypes[\"ApplicationJson\"] = \"application/json\";\n})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));\n/**\n * Returns the proxy URL, depending upon the supplied url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\nfunction getProxyUrl(serverUrl) {\n const proxyUrl = pm.getProxyUrl(new URL(serverUrl));\n return proxyUrl ? proxyUrl.href : '';\n}\nexports.getProxyUrl = getProxyUrl;\nconst HttpRedirectCodes = [\n HttpCodes.MovedPermanently,\n HttpCodes.ResourceMoved,\n HttpCodes.SeeOther,\n HttpCodes.TemporaryRedirect,\n HttpCodes.PermanentRedirect\n];\nconst HttpResponseRetryCodes = [\n HttpCodes.BadGateway,\n HttpCodes.ServiceUnavailable,\n HttpCodes.GatewayTimeout\n];\nconst RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];\nconst ExponentialBackoffCeiling = 10;\nconst ExponentialBackoffTimeSlice = 5;\nclass HttpClientError extends Error {\n constructor(message, statusCode) {\n super(message);\n this.name = 'HttpClientError';\n this.statusCode = statusCode;\n Object.setPrototypeOf(this, HttpClientError.prototype);\n }\n}\nexports.HttpClientError = HttpClientError;\nclass HttpClientResponse {\n constructor(message) {\n this.message = message;\n }\n readBody() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let output = Buffer.alloc(0);\n this.message.on('data', (chunk) => {\n output = Buffer.concat([output, chunk]);\n });\n this.message.on('end', () => {\n resolve(output.toString());\n });\n }));\n });\n }\n readBodyBuffer() {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n const chunks = [];\n this.message.on('data', (chunk) => {\n chunks.push(chunk);\n });\n this.message.on('end', () => {\n resolve(Buffer.concat(chunks));\n });\n }));\n });\n }\n}\nexports.HttpClientResponse = HttpClientResponse;\nfunction isHttps(requestUrl) {\n const parsedUrl = new URL(requestUrl);\n return parsedUrl.protocol === 'https:';\n}\nexports.isHttps = isHttps;\nclass HttpClient {\n constructor(userAgent, handlers, requestOptions) {\n this._ignoreSslError = false;\n this._allowRedirects = true;\n this._allowRedirectDowngrade = false;\n this._maxRedirects = 50;\n this._allowRetries = false;\n this._maxRetries = 1;\n this._keepAlive = false;\n this._disposed = false;\n this.userAgent = userAgent;\n this.handlers = handlers || [];\n this.requestOptions = requestOptions;\n if (requestOptions) {\n if (requestOptions.ignoreSslError != null) {\n this._ignoreSslError = requestOptions.ignoreSslError;\n }\n this._socketTimeout = requestOptions.socketTimeout;\n if (requestOptions.allowRedirects != null) {\n this._allowRedirects = requestOptions.allowRedirects;\n }\n if (requestOptions.allowRedirectDowngrade != null) {\n this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;\n }\n if (requestOptions.maxRedirects != null) {\n this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);\n }\n if (requestOptions.keepAlive != null) {\n this._keepAlive = requestOptions.keepAlive;\n }\n if (requestOptions.allowRetries != null) {\n this._allowRetries = requestOptions.allowRetries;\n }\n if (requestOptions.maxRetries != null) {\n this._maxRetries = requestOptions.maxRetries;\n }\n }\n }\n options(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});\n });\n }\n get(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('GET', requestUrl, null, additionalHeaders || {});\n });\n }\n del(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('DELETE', requestUrl, null, additionalHeaders || {});\n });\n }\n post(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('POST', requestUrl, data, additionalHeaders || {});\n });\n }\n patch(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PATCH', requestUrl, data, additionalHeaders || {});\n });\n }\n put(requestUrl, data, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('PUT', requestUrl, data, additionalHeaders || {});\n });\n }\n head(requestUrl, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request('HEAD', requestUrl, null, additionalHeaders || {});\n });\n }\n sendStream(verb, requestUrl, stream, additionalHeaders) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.request(verb, requestUrl, stream, additionalHeaders);\n });\n }\n /**\n * Gets a typed object from an endpoint\n * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise\n */\n getJson(requestUrl, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n const res = yield this.get(requestUrl, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n postJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.post(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n putJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.put(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n patchJson(requestUrl, obj, additionalHeaders = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const data = JSON.stringify(obj, null, 2);\n additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);\n additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);\n const res = yield this.patch(requestUrl, data, additionalHeaders);\n return this._processResponse(res, this.requestOptions);\n });\n }\n /**\n * Makes a raw http request.\n * All other methods such as get, post, patch, and request ultimately call this.\n * Prefer get, del, post and patch\n */\n request(verb, requestUrl, data, headers) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this._disposed) {\n throw new Error('Client has already been disposed.');\n }\n const parsedUrl = new URL(requestUrl);\n let info = this._prepareRequest(verb, parsedUrl, headers);\n // Only perform retries on reads since writes may not be idempotent.\n const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb)\n ? this._maxRetries + 1\n : 1;\n let numTries = 0;\n let response;\n do {\n response = yield this.requestRaw(info, data);\n // Check if it's an authentication challenge\n if (response &&\n response.message &&\n response.message.statusCode === HttpCodes.Unauthorized) {\n let authenticationHandler;\n for (const handler of this.handlers) {\n if (handler.canHandleAuthentication(response)) {\n authenticationHandler = handler;\n break;\n }\n }\n if (authenticationHandler) {\n return authenticationHandler.handleAuthentication(this, info, data);\n }\n else {\n // We have received an unauthorized response but have no handlers to handle it.\n // Let the response return to the caller.\n return response;\n }\n }\n let redirectsRemaining = this._maxRedirects;\n while (response.message.statusCode &&\n HttpRedirectCodes.includes(response.message.statusCode) &&\n this._allowRedirects &&\n redirectsRemaining > 0) {\n const redirectUrl = response.message.headers['location'];\n if (!redirectUrl) {\n // if there's no location to redirect to, we won't\n break;\n }\n const parsedRedirectUrl = new URL(redirectUrl);\n if (parsedUrl.protocol === 'https:' &&\n parsedUrl.protocol !== parsedRedirectUrl.protocol &&\n !this._allowRedirectDowngrade) {\n throw new Error('Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.');\n }\n // we need to finish reading the response before reassigning response\n // which will leak the open socket.\n yield response.readBody();\n // strip authorization header if redirected to a different hostname\n if (parsedRedirectUrl.hostname !== parsedUrl.hostname) {\n for (const header in headers) {\n // header names are case insensitive\n if (header.toLowerCase() === 'authorization') {\n delete headers[header];\n }\n }\n }\n // let's make the request with the new redirectUrl\n info = this._prepareRequest(verb, parsedRedirectUrl, headers);\n response = yield this.requestRaw(info, data);\n redirectsRemaining--;\n }\n if (!response.message.statusCode ||\n !HttpResponseRetryCodes.includes(response.message.statusCode)) {\n // If not a retry code, return immediately instead of retrying\n return response;\n }\n numTries += 1;\n if (numTries < maxTries) {\n yield response.readBody();\n yield this._performExponentialBackoff(numTries);\n }\n } while (numTries < maxTries);\n return response;\n });\n }\n /**\n * Needs to be called if keepAlive is set to true in request options.\n */\n dispose() {\n if (this._agent) {\n this._agent.destroy();\n }\n this._disposed = true;\n }\n /**\n * Raw request.\n * @param info\n * @param data\n */\n requestRaw(info, data) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => {\n function callbackForResult(err, res) {\n if (err) {\n reject(err);\n }\n else if (!res) {\n // If `err` is not passed, then `res` must be passed.\n reject(new Error('Unknown error'));\n }\n else {\n resolve(res);\n }\n }\n this.requestRawWithCallback(info, data, callbackForResult);\n });\n });\n }\n /**\n * Raw request with callback.\n * @param info\n * @param data\n * @param onResult\n */\n requestRawWithCallback(info, data, onResult) {\n if (typeof data === 'string') {\n if (!info.options.headers) {\n info.options.headers = {};\n }\n info.options.headers['Content-Length'] = Buffer.byteLength(data, 'utf8');\n }\n let callbackCalled = false;\n function handleResult(err, res) {\n if (!callbackCalled) {\n callbackCalled = true;\n onResult(err, res);\n }\n }\n const req = info.httpModule.request(info.options, (msg) => {\n const res = new HttpClientResponse(msg);\n handleResult(undefined, res);\n });\n let socket;\n req.on('socket', sock => {\n socket = sock;\n });\n // If we ever get disconnected, we want the socket to timeout eventually\n req.setTimeout(this._socketTimeout || 3 * 60000, () => {\n if (socket) {\n socket.end();\n }\n handleResult(new Error(`Request timeout: ${info.options.path}`));\n });\n req.on('error', function (err) {\n // err has statusCode property\n // res should have headers\n handleResult(err);\n });\n if (data && typeof data === 'string') {\n req.write(data, 'utf8');\n }\n if (data && typeof data !== 'string') {\n data.on('close', function () {\n req.end();\n });\n data.pipe(req);\n }\n else {\n req.end();\n }\n }\n /**\n * Gets an http agent. This function is useful when you need an http agent that handles\n * routing through a proxy server - depending upon the url and proxy environment variables.\n * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com\n */\n getAgent(serverUrl) {\n const parsedUrl = new URL(serverUrl);\n return this._getAgent(parsedUrl);\n }\n _prepareRequest(method, requestUrl, headers) {\n const info = {};\n info.parsedUrl = requestUrl;\n const usingSsl = info.parsedUrl.protocol === 'https:';\n info.httpModule = usingSsl ? https : http;\n const defaultPort = usingSsl ? 443 : 80;\n info.options = {};\n info.options.host = info.parsedUrl.hostname;\n info.options.port = info.parsedUrl.port\n ? parseInt(info.parsedUrl.port)\n : defaultPort;\n info.options.path =\n (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');\n info.options.method = method;\n info.options.headers = this._mergeHeaders(headers);\n if (this.userAgent != null) {\n info.options.headers['user-agent'] = this.userAgent;\n }\n info.options.agent = this._getAgent(info.parsedUrl);\n // gives handlers an opportunity to participate\n if (this.handlers) {\n for (const handler of this.handlers) {\n handler.prepareRequest(info.options);\n }\n }\n return info;\n }\n _mergeHeaders(headers) {\n if (this.requestOptions && this.requestOptions.headers) {\n return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers || {}));\n }\n return lowercaseKeys(headers || {});\n }\n _getExistingOrDefaultHeader(additionalHeaders, header, _default) {\n let clientHeader;\n if (this.requestOptions && this.requestOptions.headers) {\n clientHeader = lowercaseKeys(this.requestOptions.headers)[header];\n }\n return additionalHeaders[header] || clientHeader || _default;\n }\n _getAgent(parsedUrl) {\n let agent;\n const proxyUrl = pm.getProxyUrl(parsedUrl);\n const useProxy = proxyUrl && proxyUrl.hostname;\n if (this._keepAlive && useProxy) {\n agent = this._proxyAgent;\n }\n if (this._keepAlive && !useProxy) {\n agent = this._agent;\n }\n // if agent is already assigned use that agent.\n if (agent) {\n return agent;\n }\n const usingSsl = parsedUrl.protocol === 'https:';\n let maxSockets = 100;\n if (this.requestOptions) {\n maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;\n }\n // This is `useProxy` again, but we need to check `proxyURl` directly for TypeScripts's flow analysis.\n if (proxyUrl && proxyUrl.hostname) {\n const agentOptions = {\n maxSockets,\n keepAlive: this._keepAlive,\n proxy: Object.assign(Object.assign({}, ((proxyUrl.username || proxyUrl.password) && {\n proxyAuth: `${proxyUrl.username}:${proxyUrl.password}`\n })), { host: proxyUrl.hostname, port: proxyUrl.port })\n };\n let tunnelAgent;\n const overHttps = proxyUrl.protocol === 'https:';\n if (usingSsl) {\n tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;\n }\n else {\n tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;\n }\n agent = tunnelAgent(agentOptions);\n this._proxyAgent = agent;\n }\n // if reusing agent across request and tunneling agent isn't assigned create a new agent\n if (this._keepAlive && !agent) {\n const options = { keepAlive: this._keepAlive, maxSockets };\n agent = usingSsl ? new https.Agent(options) : new http.Agent(options);\n this._agent = agent;\n }\n // if not using private agent and tunnel agent isn't setup then use global agent\n if (!agent) {\n agent = usingSsl ? https.globalAgent : http.globalAgent;\n }\n if (usingSsl && this._ignoreSslError) {\n // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process\n // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options\n // we have to cast it to any and change it directly\n agent.options = Object.assign(agent.options || {}, {\n rejectUnauthorized: false\n });\n }\n return agent;\n }\n _performExponentialBackoff(retryNumber) {\n return __awaiter(this, void 0, void 0, function* () {\n retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);\n const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);\n return new Promise(resolve => setTimeout(() => resolve(), ms));\n });\n }\n _processResponse(res, options) {\n return __awaiter(this, void 0, void 0, function* () {\n return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n const statusCode = res.message.statusCode || 0;\n const response = {\n statusCode,\n result: null,\n headers: {}\n };\n // not found leads to null obj returned\n if (statusCode === HttpCodes.NotFound) {\n resolve(response);\n }\n // get the result from the body\n function dateTimeDeserializer(key, value) {\n if (typeof value === 'string') {\n const a = new Date(value);\n if (!isNaN(a.valueOf())) {\n return a;\n }\n }\n return value;\n }\n let obj;\n let contents;\n try {\n contents = yield res.readBody();\n if (contents && contents.length > 0) {\n if (options && options.deserializeDates) {\n obj = JSON.parse(contents, dateTimeDeserializer);\n }\n else {\n obj = JSON.parse(contents);\n }\n response.result = obj;\n }\n response.headers = res.message.headers;\n }\n catch (err) {\n // Invalid resource (contents not json); leaving result obj null\n }\n // note that 3xx redirects are handled by the http layer.\n if (statusCode > 299) {\n let msg;\n // if exception/error in body, attempt to get better error\n if (obj && obj.message) {\n msg = obj.message;\n }\n else if (contents && contents.length > 0) {\n // it may be the case that the exception is in the body message as string\n msg = contents;\n }\n else {\n msg = `Failed request: (${statusCode})`;\n }\n const err = new HttpClientError(msg, statusCode);\n err.result = response.result;\n reject(err);\n }\n else {\n resolve(response);\n }\n }));\n });\n }\n}\nexports.HttpClient = HttpClient;\nconst lowercaseKeys = (obj) => Object.keys(obj).reduce((c, k) => ((c[k.toLowerCase()] = obj[k]), c), {});\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.checkBypass = exports.getProxyUrl = void 0;\nfunction getProxyUrl(reqUrl) {\n const usingSsl = reqUrl.protocol === 'https:';\n if (checkBypass(reqUrl)) {\n return undefined;\n }\n const proxyVar = (() => {\n if (usingSsl) {\n return process.env['https_proxy'] || process.env['HTTPS_PROXY'];\n }\n else {\n return process.env['http_proxy'] || process.env['HTTP_PROXY'];\n }\n })();\n if (proxyVar) {\n try {\n return new URL(proxyVar);\n }\n catch (_a) {\n if (!proxyVar.startsWith('http://') && !proxyVar.startsWith('https://'))\n return new URL(`http://${proxyVar}`);\n }\n }\n else {\n return undefined;\n }\n}\nexports.getProxyUrl = getProxyUrl;\nfunction checkBypass(reqUrl) {\n if (!reqUrl.hostname) {\n return false;\n }\n const reqHost = reqUrl.hostname;\n if (isLoopbackAddress(reqHost)) {\n return true;\n }\n const noProxy = process.env['no_proxy'] || process.env['NO_PROXY'] || '';\n if (!noProxy) {\n return false;\n }\n // Determine the request port\n let reqPort;\n if (reqUrl.port) {\n reqPort = Number(reqUrl.port);\n }\n else if (reqUrl.protocol === 'http:') {\n reqPort = 80;\n }\n else if (reqUrl.protocol === 'https:') {\n reqPort = 443;\n }\n // Format the request hostname and hostname with port\n const upperReqHosts = [reqUrl.hostname.toUpperCase()];\n if (typeof reqPort === 'number') {\n upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);\n }\n // Compare request host against noproxy\n for (const upperNoProxyItem of noProxy\n .split(',')\n .map(x => x.trim().toUpperCase())\n .filter(x => x)) {\n if (upperNoProxyItem === '*' ||\n upperReqHosts.some(x => x === upperNoProxyItem ||\n x.endsWith(`.${upperNoProxyItem}`) ||\n (upperNoProxyItem.startsWith('.') &&\n x.endsWith(`${upperNoProxyItem}`)))) {\n return true;\n }\n }\n return false;\n}\nexports.checkBypass = checkBypass;\nfunction isLoopbackAddress(host) {\n const hostLower = host.toLowerCase();\n return (hostLower === 'localhost' ||\n hostLower.startsWith('127.') ||\n hostLower.startsWith('[::1]') ||\n hostLower.startsWith('[0:0:0:0:0:0:0:1]'));\n}\n//# sourceMappingURL=proxy.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar _a;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.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;\nconst fs = __importStar(require(\"fs\"));\nconst path = __importStar(require(\"path\"));\n_a = fs.promises\n// export const {open} = 'fs'\n, 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;\n// export const {open} = 'fs'\nexports.IS_WINDOWS = process.platform === 'win32';\n// See https://github.com/nodejs/node/blob/d0153aee367422d0858105abec186da4dff0a0c5/deps/uv/include/uv/win.h#L691\nexports.UV_FS_O_EXLOCK = 0x10000000;\nexports.READONLY = fs.constants.O_RDONLY;\nfunction exists(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n yield exports.stat(fsPath);\n }\n catch (err) {\n if (err.code === 'ENOENT') {\n return false;\n }\n throw err;\n }\n return true;\n });\n}\nexports.exists = exists;\nfunction isDirectory(fsPath, useStat = false) {\n return __awaiter(this, void 0, void 0, function* () {\n const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);\n return stats.isDirectory();\n });\n}\nexports.isDirectory = isDirectory;\n/**\n * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:\n * \\, \\hello, \\\\hello\\share, C:, and C:\\hello (and corresponding alternate separator cases).\n */\nfunction isRooted(p) {\n p = normalizeSeparators(p);\n if (!p) {\n throw new Error('isRooted() parameter \"p\" cannot be empty');\n }\n if (exports.IS_WINDOWS) {\n return (p.startsWith('\\\\') || /^[A-Z]:/i.test(p) // e.g. \\ or \\hello or \\\\hello\n ); // e.g. C: or C:\\hello\n }\n return p.startsWith('/');\n}\nexports.isRooted = isRooted;\n/**\n * Best effort attempt to determine whether a file exists and is executable.\n * @param filePath file path to check\n * @param extensions additional file extensions to try\n * @return if file exists and is executable, returns the file path. otherwise empty string.\n */\nfunction tryGetExecutablePath(filePath, extensions) {\n return __awaiter(this, void 0, void 0, function* () {\n let stats = undefined;\n try {\n // test file exists\n stats = yield exports.stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (exports.IS_WINDOWS) {\n // on Windows, test for valid extension\n const upperExt = path.extname(filePath).toUpperCase();\n if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {\n return filePath;\n }\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n // try each extension\n const originalFilePath = filePath;\n for (const extension of extensions) {\n filePath = originalFilePath + extension;\n stats = undefined;\n try {\n stats = yield exports.stat(filePath);\n }\n catch (err) {\n if (err.code !== 'ENOENT') {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);\n }\n }\n if (stats && stats.isFile()) {\n if (exports.IS_WINDOWS) {\n // preserve the case of the actual file (since an extension was appended)\n try {\n const directory = path.dirname(filePath);\n const upperName = path.basename(filePath).toUpperCase();\n for (const actualName of yield exports.readdir(directory)) {\n if (upperName === actualName.toUpperCase()) {\n filePath = path.join(directory, actualName);\n break;\n }\n }\n }\n catch (err) {\n // eslint-disable-next-line no-console\n console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);\n }\n return filePath;\n }\n else {\n if (isUnixExecutable(stats)) {\n return filePath;\n }\n }\n }\n }\n return '';\n });\n}\nexports.tryGetExecutablePath = tryGetExecutablePath;\nfunction normalizeSeparators(p) {\n p = p || '';\n if (exports.IS_WINDOWS) {\n // convert slashes on Windows\n p = p.replace(/\\//g, '\\\\');\n // remove redundant slashes\n return p.replace(/\\\\\\\\+/g, '\\\\');\n }\n // remove redundant slashes\n return p.replace(/\\/\\/+/g, '/');\n}\n// on Mac/Linux, test the execute bit\n// R W X R W X R W X\n// 256 128 64 32 16 8 4 2 1\nfunction isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}\n// Get the path of cmd.exe in windows\nfunction getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}\nexports.getCmdPath = getCmdPath;\n//# sourceMappingURL=io-util.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findInPath = exports.which = exports.mkdirP = exports.rmRF = exports.mv = exports.cp = void 0;\nconst assert_1 = require(\"assert\");\nconst path = __importStar(require(\"path\"));\nconst ioUtil = __importStar(require(\"./io-util\"));\n/**\n * Copies a file or folder.\n * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See CopyOptions.\n */\nfunction cp(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const { force, recursive, copySourceDirectory } = readCopyOptions(options);\n const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;\n // Dest is an existing file, but not forcing\n if (destStat && destStat.isFile() && !force) {\n return;\n }\n // If dest is an existing directory, should copy inside.\n const newDest = destStat && destStat.isDirectory() && copySourceDirectory\n ? path.join(dest, path.basename(source))\n : dest;\n if (!(yield ioUtil.exists(source))) {\n throw new Error(`no such file or directory: ${source}`);\n }\n const sourceStat = yield ioUtil.stat(source);\n if (sourceStat.isDirectory()) {\n if (!recursive) {\n throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);\n }\n else {\n yield cpDirRecursive(source, newDest, 0, force);\n }\n }\n else {\n if (path.relative(source, newDest) === '') {\n // a file cannot be copied to itself\n throw new Error(`'${newDest}' and '${source}' are the same file`);\n }\n yield copyFile(source, newDest, force);\n }\n });\n}\nexports.cp = cp;\n/**\n * Moves a path.\n *\n * @param source source path\n * @param dest destination path\n * @param options optional. See MoveOptions.\n */\nfunction mv(source, dest, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n if (yield ioUtil.exists(dest)) {\n let destExists = true;\n if (yield ioUtil.isDirectory(dest)) {\n // If dest is directory copy src into dest\n dest = path.join(dest, path.basename(source));\n destExists = yield ioUtil.exists(dest);\n }\n if (destExists) {\n if (options.force == null || options.force) {\n yield rmRF(dest);\n }\n else {\n throw new Error('Destination already exists');\n }\n }\n }\n yield mkdirP(path.dirname(dest));\n yield ioUtil.rename(source, dest);\n });\n}\nexports.mv = mv;\n/**\n * Remove a path recursively with force\n *\n * @param inputPath path to remove\n */\nfunction rmRF(inputPath) {\n return __awaiter(this, void 0, void 0, function* () {\n if (ioUtil.IS_WINDOWS) {\n // Check for invalid characters\n // https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file\n if (/[*\"<>|]/.test(inputPath)) {\n throw new Error('File path must not contain `*`, `\"`, `<`, `>` or `|` on Windows');\n }\n }\n try {\n // note if path does not exist, error is silent\n yield ioUtil.rm(inputPath, {\n force: true,\n maxRetries: 3,\n recursive: true,\n retryDelay: 300\n });\n }\n catch (err) {\n throw new Error(`File was unable to be removed ${err}`);\n }\n });\n}\nexports.rmRF = rmRF;\n/**\n * Make a directory. Creates the full path with folders in between\n * Will throw if it fails\n *\n * @param fsPath path to create\n * @returns Promise\n */\nfunction mkdirP(fsPath) {\n return __awaiter(this, void 0, void 0, function* () {\n assert_1.ok(fsPath, 'a path argument must be provided');\n yield ioUtil.mkdir(fsPath, { recursive: true });\n });\n}\nexports.mkdirP = mkdirP;\n/**\n * Returns path of a tool had the tool actually been invoked. Resolves via paths.\n * If you check and the tool does not exist, it will throw.\n *\n * @param tool name of the tool\n * @param check whether to check if tool exists\n * @returns Promise path to tool\n */\nfunction which(tool, check) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // recursive when check=true\n if (check) {\n const result = yield which(tool, false);\n if (!result) {\n if (ioUtil.IS_WINDOWS) {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);\n }\n else {\n throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);\n }\n }\n return result;\n }\n const matches = yield findInPath(tool);\n if (matches && matches.length > 0) {\n return matches[0];\n }\n return '';\n });\n}\nexports.which = which;\n/**\n * Returns a list of all occurrences of the given tool on the system path.\n *\n * @returns Promise the paths of the tool\n */\nfunction findInPath(tool) {\n return __awaiter(this, void 0, void 0, function* () {\n if (!tool) {\n throw new Error(\"parameter 'tool' is required\");\n }\n // build the list of extensions to try\n const extensions = [];\n if (ioUtil.IS_WINDOWS && process.env['PATHEXT']) {\n for (const extension of process.env['PATHEXT'].split(path.delimiter)) {\n if (extension) {\n extensions.push(extension);\n }\n }\n }\n // if it's rooted, return it if exists. otherwise return empty.\n if (ioUtil.isRooted(tool)) {\n const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);\n if (filePath) {\n return [filePath];\n }\n return [];\n }\n // if any path separators, return empty\n if (tool.includes(path.sep)) {\n return [];\n }\n // build the list of directories\n //\n // Note, technically \"where\" checks the current directory on Windows. From a toolkit perspective,\n // it feels like we should not do this. Checking the current directory seems like more of a use\n // case of a shell, and the which() function exposed by the toolkit should strive for consistency\n // across platforms.\n const directories = [];\n if (process.env.PATH) {\n for (const p of process.env.PATH.split(path.delimiter)) {\n if (p) {\n directories.push(p);\n }\n }\n }\n // find all matches\n const matches = [];\n for (const directory of directories) {\n const filePath = yield ioUtil.tryGetExecutablePath(path.join(directory, tool), extensions);\n if (filePath) {\n matches.push(filePath);\n }\n }\n return matches;\n });\n}\nexports.findInPath = findInPath;\nfunction readCopyOptions(options) {\n const force = options.force == null ? true : options.force;\n const recursive = Boolean(options.recursive);\n const copySourceDirectory = options.copySourceDirectory == null\n ? true\n : Boolean(options.copySourceDirectory);\n return { force, recursive, copySourceDirectory };\n}\nfunction cpDirRecursive(sourceDir, destDir, currentDepth, force) {\n return __awaiter(this, void 0, void 0, function* () {\n // Ensure there is not a run away recursive copy\n if (currentDepth >= 255)\n return;\n currentDepth++;\n yield mkdirP(destDir);\n const files = yield ioUtil.readdir(sourceDir);\n for (const fileName of files) {\n const srcFile = `${sourceDir}/${fileName}`;\n const destFile = `${destDir}/${fileName}`;\n const srcFileStat = yield ioUtil.lstat(srcFile);\n if (srcFileStat.isDirectory()) {\n // Recurse\n yield cpDirRecursive(srcFile, destFile, currentDepth, force);\n }\n else {\n yield copyFile(srcFile, destFile, force);\n }\n }\n // Change the mode for the newly created directory\n yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);\n });\n}\n// Buffered file copy\nfunction copyFile(srcFile, destFile, force) {\n return __awaiter(this, void 0, void 0, function* () {\n if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {\n // unlink/re-link it\n try {\n yield ioUtil.lstat(destFile);\n yield ioUtil.unlink(destFile);\n }\n catch (e) {\n // Try to override file permission\n if (e.code === 'EPERM') {\n yield ioUtil.chmod(destFile, '0666');\n yield ioUtil.unlink(destFile);\n }\n // other errors = it doesn't exist, no work to do\n }\n // Copy over symlink\n const symlinkFull = yield ioUtil.readlink(srcFile);\n yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);\n }\n else if (!(yield ioUtil.exists(destFile)) || force) {\n yield ioUtil.copyFile(srcFile, destFile);\n }\n });\n}\n//# sourceMappingURL=io.js.map","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/// \nconst listenersMap = new WeakMap();\nconst abortedMap = new WeakMap();\n/**\n * An aborter instance implements AbortSignal interface, can abort HTTP requests.\n *\n * - Call AbortSignal.none to create a new AbortSignal instance that cannot be cancelled.\n * Use `AbortSignal.none` when you are required to pass a cancellation token but the operation\n * cannot or will not ever be cancelled.\n *\n * @example\n * Abort without timeout\n * ```ts\n * await doAsyncWork(AbortSignal.none);\n * ```\n */\nclass AbortSignal {\n constructor() {\n /**\n * onabort event listener.\n */\n this.onabort = null;\n listenersMap.set(this, []);\n abortedMap.set(this, false);\n }\n /**\n * Status of whether aborted or not.\n *\n * @readonly\n */\n get aborted() {\n if (!abortedMap.has(this)) {\n throw new TypeError(\"Expected `this` to be an instance of AbortSignal.\");\n }\n return abortedMap.get(this);\n }\n /**\n * Creates a new AbortSignal instance that will never be aborted.\n *\n * @readonly\n */\n static get none() {\n return new AbortSignal();\n }\n /**\n * Added new \"abort\" event listener, only support \"abort\" event.\n *\n * @param _type - Only support \"abort\" event\n * @param listener - The listener to be added\n */\n addEventListener(\n // tslint:disable-next-line:variable-name\n _type, listener) {\n if (!listenersMap.has(this)) {\n throw new TypeError(\"Expected `this` to be an instance of AbortSignal.\");\n }\n const listeners = listenersMap.get(this);\n listeners.push(listener);\n }\n /**\n * Remove \"abort\" event listener, only support \"abort\" event.\n *\n * @param _type - Only support \"abort\" event\n * @param listener - The listener to be removed\n */\n removeEventListener(\n // tslint:disable-next-line:variable-name\n _type, listener) {\n if (!listenersMap.has(this)) {\n throw new TypeError(\"Expected `this` to be an instance of AbortSignal.\");\n }\n const listeners = listenersMap.get(this);\n const index = listeners.indexOf(listener);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n }\n /**\n * Dispatches a synthetic event to the AbortSignal.\n */\n dispatchEvent(_event) {\n throw new Error(\"This is a stub dispatchEvent implementation that should not be used. It only exists for type-checking purposes.\");\n }\n}\n/**\n * Helper to trigger an abort event immediately, the onabort and all abort event listeners will be triggered.\n * Will try to trigger abort event for all linked AbortSignal nodes.\n *\n * - If there is a timeout, the timer will be cancelled.\n * - If aborted is true, nothing will happen.\n *\n * @internal\n */\n// eslint-disable-next-line @azure/azure-sdk/ts-use-interface-parameters\nfunction abortSignal(signal) {\n if (signal.aborted) {\n return;\n }\n if (signal.onabort) {\n signal.onabort.call(signal);\n }\n const listeners = listenersMap.get(signal);\n if (listeners) {\n // Create a copy of listeners so mutations to the array\n // (e.g. via removeListener calls) don't affect the listeners\n // we invoke.\n listeners.slice().forEach((listener) => {\n listener.call(signal, { type: \"abort\" });\n });\n }\n abortedMap.set(signal, true);\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * This error is thrown when an asynchronous operation has been aborted.\n * Check for this error by testing the `name` that the name property of the\n * error matches `\"AbortError\"`.\n *\n * @example\n * ```ts\n * const controller = new AbortController();\n * controller.abort();\n * try {\n * doAsyncWork(controller.signal)\n * } catch (e) {\n * if (e.name === 'AbortError') {\n * // handle abort error here.\n * }\n * }\n * ```\n */\nclass AbortError extends Error {\n constructor(message) {\n super(message);\n this.name = \"AbortError\";\n }\n}\n/**\n * An AbortController provides an AbortSignal and the associated controls to signal\n * that an asynchronous operation should be aborted.\n *\n * @example\n * Abort an operation when another event fires\n * ```ts\n * const controller = new AbortController();\n * const signal = controller.signal;\n * doAsyncWork(signal);\n * button.addEventListener('click', () => controller.abort());\n * ```\n *\n * @example\n * Share aborter cross multiple operations in 30s\n * ```ts\n * // Upload the same data to 2 different data centers at the same time,\n * // abort another when any of them is finished\n * const controller = AbortController.withTimeout(30 * 1000);\n * doAsyncWork(controller.signal).then(controller.abort);\n * doAsyncWork(controller.signal).then(controller.abort);\n *```\n *\n * @example\n * Cascaded aborting\n * ```ts\n * // All operations can't take more than 30 seconds\n * const aborter = Aborter.timeout(30 * 1000);\n *\n * // Following 2 operations can't take more than 25 seconds\n * await doAsyncWork(aborter.withTimeout(25 * 1000));\n * await doAsyncWork(aborter.withTimeout(25 * 1000));\n * ```\n */\nclass AbortController {\n // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\n constructor(parentSignals) {\n this._signal = new AbortSignal();\n if (!parentSignals) {\n return;\n }\n // coerce parentSignals into an array\n if (!Array.isArray(parentSignals)) {\n // eslint-disable-next-line prefer-rest-params\n parentSignals = arguments;\n }\n for (const parentSignal of parentSignals) {\n // if the parent signal has already had abort() called,\n // then call abort on this signal as well.\n if (parentSignal.aborted) {\n this.abort();\n }\n else {\n // when the parent signal aborts, this signal should as well.\n parentSignal.addEventListener(\"abort\", () => {\n this.abort();\n });\n }\n }\n }\n /**\n * The AbortSignal associated with this controller that will signal aborted\n * when the abort method is called on this controller.\n *\n * @readonly\n */\n get signal() {\n return this._signal;\n }\n /**\n * Signal that any operations passed this controller's associated abort signal\n * to cancel any remaining work and throw an `AbortError`.\n */\n abort() {\n abortSignal(this._signal);\n }\n /**\n * Creates a new AbortSignal instance that will abort after the provided ms.\n * @param ms - Elapsed time in milliseconds to trigger an abort.\n */\n static timeout(ms) {\n const signal = new AbortSignal();\n const timer = setTimeout(abortSignal, ms, signal);\n // Prevent the active Timer from keeping the Node.js event loop active.\n if (typeof timer.unref === \"function\") {\n timer.unref();\n }\n return signal;\n }\n}\n\nexports.AbortController = AbortController;\nexports.AbortError = AbortError;\nexports.AbortSignal = AbortSignal;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar coreUtil = require('@azure/core-util');\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * A static-key-based credential that supports updating\n * the underlying key value.\n */\nclass AzureKeyCredential {\n /**\n * The value of the key to be used in authentication\n */\n get key() {\n return this._key;\n }\n /**\n * Create an instance of an AzureKeyCredential for use\n * with a service client.\n *\n * @param key - The initial value of the key to use in authentication\n */\n constructor(key) {\n if (!key) {\n throw new Error(\"key must be a non-empty string\");\n }\n this._key = key;\n }\n /**\n * Change the value of the key.\n *\n * Updates will take effect upon the next request after\n * updating the key value.\n *\n * @param newKey - The new key value to be used\n */\n update(newKey) {\n this._key = newKey;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A static name/key-based credential that supports updating\n * the underlying name and key values.\n */\nclass AzureNamedKeyCredential {\n /**\n * The value of the key to be used in authentication.\n */\n get key() {\n return this._key;\n }\n /**\n * The value of the name to be used in authentication.\n */\n get name() {\n return this._name;\n }\n /**\n * Create an instance of an AzureNamedKeyCredential for use\n * with a service client.\n *\n * @param name - The initial value of the name to use in authentication.\n * @param key - The initial value of the key to use in authentication.\n */\n constructor(name, key) {\n if (!name || !key) {\n throw new TypeError(\"name and key must be non-empty strings\");\n }\n this._name = name;\n this._key = key;\n }\n /**\n * Change the value of the key.\n *\n * Updates will take effect upon the next request after\n * updating the key value.\n *\n * @param newName - The new name value to be used.\n * @param newKey - The new key value to be used.\n */\n update(newName, newKey) {\n if (!newName || !newKey) {\n throw new TypeError(\"newName and newKey must be non-empty strings\");\n }\n this._name = newName;\n this._key = newKey;\n }\n}\n/**\n * Tests an object to determine whether it implements NamedKeyCredential.\n *\n * @param credential - The assumed NamedKeyCredential to be tested.\n */\nfunction isNamedKeyCredential(credential) {\n return (coreUtil.isObjectWithProperties(credential, [\"name\", \"key\"]) &&\n typeof credential.key === \"string\" &&\n typeof credential.name === \"string\");\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A static-signature-based credential that supports updating\n * the underlying signature value.\n */\nclass AzureSASCredential {\n /**\n * The value of the shared access signature to be used in authentication\n */\n get signature() {\n return this._signature;\n }\n /**\n * Create an instance of an AzureSASCredential for use\n * with a service client.\n *\n * @param signature - The initial value of the shared access signature to use in authentication\n */\n constructor(signature) {\n if (!signature) {\n throw new Error(\"shared access signature must be a non-empty string\");\n }\n this._signature = signature;\n }\n /**\n * Change the value of the signature.\n *\n * Updates will take effect upon the next request after\n * updating the signature value.\n *\n * @param newSignature - The new shared access signature value to be used\n */\n update(newSignature) {\n if (!newSignature) {\n throw new Error(\"shared access signature must be a non-empty string\");\n }\n this._signature = newSignature;\n }\n}\n/**\n * Tests an object to determine whether it implements SASCredential.\n *\n * @param credential - The assumed SASCredential to be tested.\n */\nfunction isSASCredential(credential) {\n return (coreUtil.isObjectWithProperties(credential, [\"signature\"]) && typeof credential.signature === \"string\");\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Tests an object to determine whether it implements TokenCredential.\n *\n * @param credential - The assumed TokenCredential to be tested.\n */\nfunction isTokenCredential(credential) {\n // Check for an object with a 'getToken' function and possibly with\n // a 'signRequest' function. We do this check to make sure that\n // a ServiceClientCredentials implementor (like TokenClientCredentials\n // in ms-rest-nodeauth) doesn't get mistaken for a TokenCredential if\n // it doesn't actually implement TokenCredential also.\n const castCredential = credential;\n return (castCredential &&\n typeof castCredential.getToken === \"function\" &&\n (castCredential.signRequest === undefined || castCredential.getToken.length > 0));\n}\n\nexports.AzureKeyCredential = AzureKeyCredential;\nexports.AzureNamedKeyCredential = AzureNamedKeyCredential;\nexports.AzureSASCredential = AzureSASCredential;\nexports.isNamedKeyCredential = isNamedKeyCredential;\nexports.isSASCredential = isSASCredential;\nexports.isTokenCredential = isTokenCredential;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar uuid = require('uuid');\nvar util = require('util');\nvar tslib = require('tslib');\nvar xml2js = require('xml2js');\nvar coreUtil = require('@azure/core-util');\nvar logger$1 = require('@azure/logger');\nvar coreAuth = require('@azure/core-auth');\nvar os = require('os');\nvar http = require('http');\nvar https = require('https');\nvar abortController = require('@azure/abort-controller');\nvar tunnel = require('tunnel');\nvar stream = require('stream');\nvar FormData = require('form-data');\nvar node_fetch = require('node-fetch');\nvar coreTracing = require('@azure/core-tracing');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar xml2js__namespace = /*#__PURE__*/_interopNamespace(xml2js);\nvar os__namespace = /*#__PURE__*/_interopNamespace(os);\nvar http__namespace = /*#__PURE__*/_interopNamespace(http);\nvar https__namespace = /*#__PURE__*/_interopNamespace(https);\nvar tunnel__namespace = /*#__PURE__*/_interopNamespace(tunnel);\nvar FormData__default = /*#__PURE__*/_interopDefaultLegacy(FormData);\nvar node_fetch__default = /*#__PURE__*/_interopDefaultLegacy(node_fetch);\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * A collection of HttpHeaders that can be sent with a HTTP request.\n */\nfunction getHeaderKey(headerName) {\n return headerName.toLowerCase();\n}\nfunction isHttpHeadersLike(object) {\n if (object && typeof object === \"object\") {\n const castObject = object;\n if (typeof castObject.rawHeaders === \"function\" &&\n typeof castObject.clone === \"function\" &&\n typeof castObject.get === \"function\" &&\n typeof castObject.set === \"function\" &&\n typeof castObject.contains === \"function\" &&\n typeof castObject.remove === \"function\" &&\n typeof castObject.headersArray === \"function\" &&\n typeof castObject.headerValues === \"function\" &&\n typeof castObject.headerNames === \"function\" &&\n typeof castObject.toJson === \"function\") {\n return true;\n }\n }\n return false;\n}\n/**\n * A collection of HTTP header key/value pairs.\n */\nclass HttpHeaders {\n constructor(rawHeaders) {\n this._headersMap = {};\n if (rawHeaders) {\n for (const headerName in rawHeaders) {\n this.set(headerName, rawHeaders[headerName]);\n }\n }\n }\n /**\n * Set a header in this collection with the provided name and value. The name is\n * case-insensitive.\n * @param headerName - The name of the header to set. This value is case-insensitive.\n * @param headerValue - The value of the header to set.\n */\n set(headerName, headerValue) {\n this._headersMap[getHeaderKey(headerName)] = {\n name: headerName,\n value: headerValue.toString(),\n };\n }\n /**\n * Get the header value for the provided header name, or undefined if no header exists in this\n * collection with the provided name.\n * @param headerName - The name of the header.\n */\n get(headerName) {\n const header = this._headersMap[getHeaderKey(headerName)];\n return !header ? undefined : header.value;\n }\n /**\n * Get whether or not this header collection contains a header entry for the provided header name.\n */\n contains(headerName) {\n return !!this._headersMap[getHeaderKey(headerName)];\n }\n /**\n * Remove the header with the provided headerName. Return whether or not the header existed and\n * was removed.\n * @param headerName - The name of the header to remove.\n */\n remove(headerName) {\n const result = this.contains(headerName);\n delete this._headersMap[getHeaderKey(headerName)];\n return result;\n }\n /**\n * Get the headers that are contained this collection as an object.\n */\n rawHeaders() {\n return this.toJson({ preserveCase: true });\n }\n /**\n * Get the headers that are contained in this collection as an array.\n */\n headersArray() {\n const headers = [];\n for (const headerKey in this._headersMap) {\n headers.push(this._headersMap[headerKey]);\n }\n return headers;\n }\n /**\n * Get the header names that are contained in this collection.\n */\n headerNames() {\n const headerNames = [];\n const headers = this.headersArray();\n for (let i = 0; i < headers.length; ++i) {\n headerNames.push(headers[i].name);\n }\n return headerNames;\n }\n /**\n * Get the header values that are contained in this collection.\n */\n headerValues() {\n const headerValues = [];\n const headers = this.headersArray();\n for (let i = 0; i < headers.length; ++i) {\n headerValues.push(headers[i].value);\n }\n return headerValues;\n }\n /**\n * Get the JSON object representation of this HTTP header collection.\n */\n toJson(options = {}) {\n const result = {};\n if (options.preserveCase) {\n for (const headerKey in this._headersMap) {\n const header = this._headersMap[headerKey];\n result[header.name] = header.value;\n }\n }\n else {\n for (const headerKey in this._headersMap) {\n const header = this._headersMap[headerKey];\n result[getHeaderKey(header.name)] = header.value;\n }\n }\n return result;\n }\n /**\n * Get the string representation of this HTTP header collection.\n */\n toString() {\n return JSON.stringify(this.toJson({ preserveCase: true }));\n }\n /**\n * Create a deep clone/copy of this HttpHeaders collection.\n */\n clone() {\n const resultPreservingCasing = {};\n for (const headerKey in this._headersMap) {\n const header = this._headersMap[headerKey];\n resultPreservingCasing[header.name] = header.value;\n }\n return new HttpHeaders(resultPreservingCasing);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Encodes a string in base64 format.\n * @param value - The string to encode\n */\nfunction encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}\n/**\n * Encodes a byte array in base64 format.\n * @param value - The Uint8Aray to encode\n */\nfunction encodeByteArray(value) {\n // Buffer.from accepts | -- the TypeScript definition is off here\n // https://nodejs.org/api/buffer.html#buffer_class_method_buffer_from_arraybuffer_byteoffset_length\n const bufferValue = value instanceof Buffer ? value : Buffer.from(value.buffer);\n return bufferValue.toString(\"base64\");\n}\n/**\n * Decodes a base64 string into a byte array.\n * @param value - The base64 string to decode\n */\nfunction decodeString(value) {\n return Buffer.from(value, \"base64\");\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * A set of constants used internally when processing requests.\n */\nconst Constants = {\n /**\n * The core-http version\n */\n coreHttpVersion: \"3.0.2\",\n /**\n * Specifies HTTP.\n */\n HTTP: \"http:\",\n /**\n * Specifies HTTPS.\n */\n HTTPS: \"https:\",\n /**\n * Specifies HTTP Proxy.\n */\n HTTP_PROXY: \"HTTP_PROXY\",\n /**\n * Specifies HTTPS Proxy.\n */\n HTTPS_PROXY: \"HTTPS_PROXY\",\n /**\n * Specifies NO Proxy.\n */\n NO_PROXY: \"NO_PROXY\",\n /**\n * Specifies ALL Proxy.\n */\n ALL_PROXY: \"ALL_PROXY\",\n HttpConstants: {\n /**\n * Http Verbs\n */\n HttpVerbs: {\n PUT: \"PUT\",\n GET: \"GET\",\n DELETE: \"DELETE\",\n POST: \"POST\",\n MERGE: \"MERGE\",\n HEAD: \"HEAD\",\n PATCH: \"PATCH\",\n },\n StatusCodes: {\n TooManyRequests: 429,\n ServiceUnavailable: 503,\n },\n },\n /**\n * Defines constants for use with HTTP headers.\n */\n HeaderConstants: {\n /**\n * The Authorization header.\n */\n AUTHORIZATION: \"authorization\",\n AUTHORIZATION_SCHEME: \"Bearer\",\n /**\n * The Retry-After response-header field can be used with a 503 (Service\n * Unavailable) or 349 (Too Many Requests) responses to indicate how long\n * the service is expected to be unavailable to the requesting client.\n */\n RETRY_AFTER: \"Retry-After\",\n /**\n * The UserAgent header.\n */\n USER_AGENT: \"User-Agent\",\n },\n};\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Default key used to access the XML attributes.\n */\nconst XML_ATTRKEY = \"$\";\n/**\n * Default key used to access the XML value content.\n */\nconst XML_CHARKEY = \"_\";\n\n// Copyright (c) Microsoft Corporation.\nconst 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;\n/**\n * Encodes an URI.\n *\n * @param uri - The URI to be encoded.\n * @returns The encoded URI.\n */\nfunction encodeUri(uri) {\n return encodeURIComponent(uri)\n .replace(/!/g, \"%21\")\n .replace(/\"/g, \"%27\")\n .replace(/\\(/g, \"%28\")\n .replace(/\\)/g, \"%29\")\n .replace(/\\*/g, \"%2A\");\n}\n/**\n * Returns a stripped version of the Http Response which only contains body,\n * headers and the status.\n *\n * @param response - The Http Response\n * @returns The stripped version of Http Response.\n */\nfunction stripResponse(response) {\n const strippedResponse = {};\n strippedResponse.body = response.bodyAsText;\n strippedResponse.headers = response.headers;\n strippedResponse.status = response.status;\n return strippedResponse;\n}\n/**\n * Returns a stripped version of the Http Request that does not contain the\n * Authorization header.\n *\n * @param request - The Http Request object\n * @returns The stripped version of Http Request.\n */\nfunction stripRequest(request) {\n const strippedRequest = request.clone();\n if (strippedRequest.headers) {\n strippedRequest.headers.remove(\"authorization\");\n }\n return strippedRequest;\n}\n/**\n * Validates the given uuid as a string\n *\n * @param uuid - The uuid as a string that needs to be validated\n * @returns True if the uuid is valid; false otherwise.\n */\nfunction isValidUuid(uuid) {\n return validUuidRegex.test(uuid);\n}\n/**\n * Generated UUID\n *\n * @returns RFC4122 v4 UUID.\n */\nfunction generateUuid() {\n return uuid.v4();\n}\n/**\n * Executes an array of promises sequentially. Inspiration of this method is here:\n * https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html. An awesome blog on promises!\n *\n * @param promiseFactories - An array of promise factories(A function that return a promise)\n * @param kickstart - Input to the first promise that is used to kickstart the promise chain.\n * If not provided then the promise chain starts with undefined.\n * @returns A chain of resolved or rejected promises\n */\nfunction executePromisesSequentially(promiseFactories, kickstart) {\n let result = Promise.resolve(kickstart);\n promiseFactories.forEach((promiseFactory) => {\n result = result.then(promiseFactory);\n });\n return result;\n}\n/**\n * Converts a Promise to a callback.\n * @param promise - The Promise to be converted to a callback\n * @returns A function that takes the callback `(cb: Function) => void`\n * @deprecated generated code should instead depend on responseToBody\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction promiseToCallback(promise) {\n if (typeof promise.then !== \"function\") {\n throw new Error(\"The provided input is not a Promise.\");\n }\n // eslint-disable-next-line @typescript-eslint/ban-types\n return (cb) => {\n promise\n .then((data) => {\n // eslint-disable-next-line promise/no-callback-in-promise\n return cb(undefined, data);\n })\n .catch((err) => {\n // eslint-disable-next-line promise/no-callback-in-promise\n cb(err);\n });\n };\n}\n/**\n * Converts a Promise to a service callback.\n * @param promise - The Promise of HttpOperationResponse to be converted to a service callback\n * @returns A function that takes the service callback (cb: ServiceCallback): void\n */\nfunction promiseToServiceCallback(promise) {\n if (typeof promise.then !== \"function\") {\n throw new Error(\"The provided input is not a Promise.\");\n }\n return (cb) => {\n promise\n .then((data) => {\n return process.nextTick(cb, undefined, data.parsedBody, data.request, data);\n })\n .catch((err) => {\n process.nextTick(cb, err);\n });\n };\n}\nfunction prepareXMLRootList(obj, elementName, xmlNamespaceKey, xmlNamespace) {\n if (!Array.isArray(obj)) {\n obj = [obj];\n }\n if (!xmlNamespaceKey || !xmlNamespace) {\n return { [elementName]: obj };\n }\n const result = { [elementName]: obj };\n result[XML_ATTRKEY] = { [xmlNamespaceKey]: xmlNamespace };\n return result;\n}\n/**\n * Applies the properties on the prototype of sourceCtors to the prototype of targetCtor\n * @param targetCtor - The target object on which the properties need to be applied.\n * @param sourceCtors - An array of source objects from which the properties need to be taken.\n */\nfunction applyMixins(targetCtorParam, sourceCtors) {\n const castTargetCtorParam = targetCtorParam;\n sourceCtors.forEach((sourceCtor) => {\n Object.getOwnPropertyNames(sourceCtor.prototype).forEach((name) => {\n castTargetCtorParam.prototype[name] = sourceCtor.prototype[name];\n });\n });\n}\nconst validateISODuration = /^(-|\\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;\n/**\n * Indicates whether the given string is in ISO 8601 format.\n * @param value - The value to be validated for ISO 8601 duration format.\n * @returns `true` if valid, `false` otherwise.\n */\nfunction isDuration(value) {\n return validateISODuration.test(value);\n}\n/**\n * Replace all of the instances of searchValue in value with the provided replaceValue.\n * @param value - The value to search and replace in.\n * @param searchValue - The value to search for in the value argument.\n * @param replaceValue - The value to replace searchValue with in the value argument.\n * @returns The value where each instance of searchValue was replaced with replacedValue.\n */\nfunction replaceAll(value, searchValue, replaceValue) {\n return !value || !searchValue ? value : value.split(searchValue).join(replaceValue || \"\");\n}\n/**\n * Determines whether the given entity is a basic/primitive type\n * (string, number, boolean, null, undefined).\n * @param value - Any entity\n * @returns true is it is primitive type, false otherwise.\n */\nfunction isPrimitiveType(value) {\n return (typeof value !== \"object\" && typeof value !== \"function\") || value === null;\n}\nfunction getEnvironmentValue(name) {\n if (process.env[name]) {\n return process.env[name];\n }\n else if (process.env[name.toLowerCase()]) {\n return process.env[name.toLowerCase()];\n }\n return undefined;\n}\n/**\n * @internal\n * @returns true when input is an object type that is not null, Array, RegExp, or Date.\n */\nfunction isObject(input) {\n return (typeof input === \"object\" &&\n input !== null &&\n !Array.isArray(input) &&\n !(input instanceof RegExp) &&\n !(input instanceof Date));\n}\n\n// Copyright (c) Microsoft Corporation.\n// This file contains utility code to serialize and deserialize network operations according to `OperationSpec` objects generated by AutoRest.TypeScript from OpenAPI specifications.\n/**\n * Used to map raw response objects to final shapes.\n * Helps packing and unpacking Dates and other encoded types that are not intrinsic to JSON.\n * Also allows pulling values from headers, as well as inserting default values and constants.\n */\nclass Serializer {\n constructor(\n /**\n * The provided model mapper.\n */\n modelMappers = {}, \n /**\n * Whether the contents are XML or not.\n */\n isXML) {\n this.modelMappers = modelMappers;\n this.isXML = isXML;\n }\n /**\n * Validates constraints, if any. This function will throw if the provided value does not respect those constraints.\n * @param mapper - The definition of data models.\n * @param value - The value.\n * @param objectName - Name of the object. Used in the error messages.\n * @deprecated Removing the constraints validation on client side.\n */\n validateConstraints(mapper, value, objectName) {\n const failValidation = (constraintName, constraintValue) => {\n throw new Error(`\"${objectName}\" with value \"${value}\" should satisfy the constraint \"${constraintName}\": ${constraintValue}.`);\n };\n if (mapper.constraints && value != undefined) {\n const valueAsNumber = value;\n const { ExclusiveMaximum, ExclusiveMinimum, InclusiveMaximum, InclusiveMinimum, MaxItems, MaxLength, MinItems, MinLength, MultipleOf, Pattern, UniqueItems, } = mapper.constraints;\n if (ExclusiveMaximum != undefined && valueAsNumber >= ExclusiveMaximum) {\n failValidation(\"ExclusiveMaximum\", ExclusiveMaximum);\n }\n if (ExclusiveMinimum != undefined && valueAsNumber <= ExclusiveMinimum) {\n failValidation(\"ExclusiveMinimum\", ExclusiveMinimum);\n }\n if (InclusiveMaximum != undefined && valueAsNumber > InclusiveMaximum) {\n failValidation(\"InclusiveMaximum\", InclusiveMaximum);\n }\n if (InclusiveMinimum != undefined && valueAsNumber < InclusiveMinimum) {\n failValidation(\"InclusiveMinimum\", InclusiveMinimum);\n }\n const valueAsArray = value;\n if (MaxItems != undefined && valueAsArray.length > MaxItems) {\n failValidation(\"MaxItems\", MaxItems);\n }\n if (MaxLength != undefined && valueAsArray.length > MaxLength) {\n failValidation(\"MaxLength\", MaxLength);\n }\n if (MinItems != undefined && valueAsArray.length < MinItems) {\n failValidation(\"MinItems\", MinItems);\n }\n if (MinLength != undefined && valueAsArray.length < MinLength) {\n failValidation(\"MinLength\", MinLength);\n }\n if (MultipleOf != undefined && valueAsNumber % MultipleOf !== 0) {\n failValidation(\"MultipleOf\", MultipleOf);\n }\n if (Pattern) {\n const pattern = typeof Pattern === \"string\" ? new RegExp(Pattern) : Pattern;\n if (typeof value !== \"string\" || value.match(pattern) === null) {\n failValidation(\"Pattern\", Pattern);\n }\n }\n if (UniqueItems &&\n valueAsArray.some((item, i, ar) => ar.indexOf(item) !== i)) {\n failValidation(\"UniqueItems\", UniqueItems);\n }\n }\n }\n /**\n * Serialize the given object based on its metadata defined in the mapper.\n *\n * @param mapper - The mapper which defines the metadata of the serializable object.\n * @param object - A valid Javascript object to be serialized.\n * @param objectName - Name of the serialized object.\n * @param options - additional options to deserialization.\n * @returns A valid serialized Javascript object.\n */\n serialize(mapper, object, objectName, options = {}) {\n var _a, _b, _c;\n const updatedOptions = {\n rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : \"\",\n includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,\n xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY,\n };\n let payload = {};\n const mapperType = mapper.type.name;\n if (!objectName) {\n objectName = mapper.serializedName;\n }\n if (mapperType.match(/^Sequence$/i) !== null) {\n payload = [];\n }\n if (mapper.isConstant) {\n object = mapper.defaultValue;\n }\n // This table of allowed values should help explain\n // the mapper.required and mapper.nullable properties.\n // X means \"neither undefined or null are allowed\".\n // || required\n // || true | false\n // nullable || ==========================\n // true || null | undefined/null\n // false || X | undefined\n // undefined || X | undefined/null\n const { required, nullable } = mapper;\n if (required && nullable && object === undefined) {\n throw new Error(`${objectName} cannot be undefined.`);\n }\n if (required && !nullable && object == undefined) {\n throw new Error(`${objectName} cannot be null or undefined.`);\n }\n if (!required && nullable === false && object === null) {\n throw new Error(`${objectName} cannot be null.`);\n }\n if (object == undefined) {\n payload = object;\n }\n else {\n if (mapperType.match(/^any$/i) !== null) {\n payload = object;\n }\n else if (mapperType.match(/^(Number|String|Boolean|Object|Stream|Uuid)$/i) !== null) {\n payload = serializeBasicTypes(mapperType, objectName, object);\n }\n else if (mapperType.match(/^Enum$/i) !== null) {\n const enumMapper = mapper;\n payload = serializeEnumType(objectName, enumMapper.type.allowedValues, object);\n }\n else if (mapperType.match(/^(Date|DateTime|TimeSpan|DateTimeRfc1123|UnixTime)$/i) !== null) {\n payload = serializeDateTypes(mapperType, object, objectName);\n }\n else if (mapperType.match(/^ByteArray$/i) !== null) {\n payload = serializeByteArrayType(objectName, object);\n }\n else if (mapperType.match(/^Base64Url$/i) !== null) {\n payload = serializeBase64UrlType(objectName, object);\n }\n else if (mapperType.match(/^Sequence$/i) !== null) {\n payload = serializeSequenceType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);\n }\n else if (mapperType.match(/^Dictionary$/i) !== null) {\n payload = serializeDictionaryType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);\n }\n else if (mapperType.match(/^Composite$/i) !== null) {\n payload = serializeCompositeType(this, mapper, object, objectName, Boolean(this.isXML), updatedOptions);\n }\n }\n return payload;\n }\n /**\n * Deserialize the given object based on its metadata defined in the mapper.\n *\n * @param mapper - The mapper which defines the metadata of the serializable object.\n * @param responseBody - A valid Javascript entity to be deserialized.\n * @param objectName - Name of the deserialized object.\n * @param options - Controls behavior of XML parser and builder.\n * @returns A valid deserialized Javascript object.\n */\n deserialize(mapper, responseBody, objectName, options = {}) {\n var _a, _b, _c;\n const updatedOptions = {\n rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : \"\",\n includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,\n xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY,\n };\n if (responseBody == undefined) {\n if (this.isXML && mapper.type.name === \"Sequence\" && !mapper.xmlIsWrapped) {\n // Edge case for empty XML non-wrapped lists. xml2js can't distinguish\n // between the list being empty versus being missing,\n // so let's do the more user-friendly thing and return an empty list.\n responseBody = [];\n }\n // specifically check for undefined as default value can be a falsey value `0, \"\", false, null`\n if (mapper.defaultValue !== undefined) {\n responseBody = mapper.defaultValue;\n }\n return responseBody;\n }\n let payload;\n const mapperType = mapper.type.name;\n if (!objectName) {\n objectName = mapper.serializedName;\n }\n if (mapperType.match(/^Composite$/i) !== null) {\n payload = deserializeCompositeType(this, mapper, responseBody, objectName, updatedOptions);\n }\n else {\n if (this.isXML) {\n const xmlCharKey = updatedOptions.xmlCharKey;\n const castResponseBody = responseBody;\n /**\n * If the mapper specifies this as a non-composite type value but the responseBody contains\n * both header (\"$\" i.e., XML_ATTRKEY) and body (\"#\" i.e., XML_CHARKEY) properties,\n * then just reduce the responseBody value to the body (\"#\" i.e., XML_CHARKEY) property.\n */\n if (castResponseBody[XML_ATTRKEY] != undefined &&\n castResponseBody[xmlCharKey] != undefined) {\n responseBody = castResponseBody[xmlCharKey];\n }\n }\n if (mapperType.match(/^Number$/i) !== null) {\n payload = parseFloat(responseBody);\n if (isNaN(payload)) {\n payload = responseBody;\n }\n }\n else if (mapperType.match(/^Boolean$/i) !== null) {\n if (responseBody === \"true\") {\n payload = true;\n }\n else if (responseBody === \"false\") {\n payload = false;\n }\n else {\n payload = responseBody;\n }\n }\n else if (mapperType.match(/^(String|Enum|Object|Stream|Uuid|TimeSpan|any)$/i) !== null) {\n payload = responseBody;\n }\n else if (mapperType.match(/^(Date|DateTime|DateTimeRfc1123)$/i) !== null) {\n payload = new Date(responseBody);\n }\n else if (mapperType.match(/^UnixTime$/i) !== null) {\n payload = unixTimeToDate(responseBody);\n }\n else if (mapperType.match(/^ByteArray$/i) !== null) {\n payload = decodeString(responseBody);\n }\n else if (mapperType.match(/^Base64Url$/i) !== null) {\n payload = base64UrlToByteArray(responseBody);\n }\n else if (mapperType.match(/^Sequence$/i) !== null) {\n payload = deserializeSequenceType(this, mapper, responseBody, objectName, updatedOptions);\n }\n else if (mapperType.match(/^Dictionary$/i) !== null) {\n payload = deserializeDictionaryType(this, mapper, responseBody, objectName, updatedOptions);\n }\n }\n if (mapper.isConstant) {\n payload = mapper.defaultValue;\n }\n return payload;\n }\n}\nfunction trimEnd(str, ch) {\n let len = str.length;\n while (len - 1 >= 0 && str[len - 1] === ch) {\n --len;\n }\n return str.substr(0, len);\n}\nfunction bufferToBase64Url(buffer) {\n if (!buffer) {\n return undefined;\n }\n if (!(buffer instanceof Uint8Array)) {\n throw new Error(`Please provide an input of type Uint8Array for converting to Base64Url.`);\n }\n // Uint8Array to Base64.\n const str = encodeByteArray(buffer);\n // Base64 to Base64Url.\n return trimEnd(str, \"=\").replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\n}\nfunction base64UrlToByteArray(str) {\n if (!str) {\n return undefined;\n }\n if (str && typeof str.valueOf() !== \"string\") {\n throw new Error(\"Please provide an input of type string for converting to Uint8Array\");\n }\n // Base64Url to Base64.\n str = str.replace(/-/g, \"+\").replace(/_/g, \"/\");\n // Base64 to Uint8Array.\n return decodeString(str);\n}\nfunction splitSerializeName(prop) {\n const classes = [];\n let partialclass = \"\";\n if (prop) {\n const subwords = prop.split(\".\");\n for (const item of subwords) {\n if (item.charAt(item.length - 1) === \"\\\\\") {\n partialclass += item.substr(0, item.length - 1) + \".\";\n }\n else {\n partialclass += item;\n classes.push(partialclass);\n partialclass = \"\";\n }\n }\n }\n return classes;\n}\nfunction dateToUnixTime(d) {\n if (!d) {\n return undefined;\n }\n if (typeof d.valueOf() === \"string\") {\n d = new Date(d);\n }\n return Math.floor(d.getTime() / 1000);\n}\nfunction unixTimeToDate(n) {\n if (!n) {\n return undefined;\n }\n return new Date(n * 1000);\n}\nfunction serializeBasicTypes(typeName, objectName, value) {\n if (value !== null && value !== undefined) {\n if (typeName.match(/^Number$/i) !== null) {\n if (typeof value !== \"number\") {\n throw new Error(`${objectName} with value ${value} must be of type number.`);\n }\n }\n else if (typeName.match(/^String$/i) !== null) {\n if (typeof value.valueOf() !== \"string\") {\n throw new Error(`${objectName} with value \"${value}\" must be of type string.`);\n }\n }\n else if (typeName.match(/^Uuid$/i) !== null) {\n if (!(typeof value.valueOf() === \"string\" && isValidUuid(value))) {\n throw new Error(`${objectName} with value \"${value}\" must be of type string and a valid uuid.`);\n }\n }\n else if (typeName.match(/^Boolean$/i) !== null) {\n if (typeof value !== \"boolean\") {\n throw new Error(`${objectName} with value ${value} must be of type boolean.`);\n }\n }\n else if (typeName.match(/^Stream$/i) !== null) {\n const objectType = typeof value;\n if (objectType !== \"string\" &&\n objectType !== \"function\" &&\n !(value instanceof ArrayBuffer) &&\n !ArrayBuffer.isView(value) &&\n !((typeof Blob === \"function\" || typeof Blob === \"object\") && value instanceof Blob)) {\n throw new Error(`${objectName} must be a string, Blob, ArrayBuffer, ArrayBufferView, or a function returning NodeJS.ReadableStream.`);\n }\n }\n }\n return value;\n}\nfunction serializeEnumType(objectName, allowedValues, value) {\n if (!allowedValues) {\n throw new Error(`Please provide a set of allowedValues to validate ${objectName} as an Enum Type.`);\n }\n const isPresent = allowedValues.some((item) => {\n if (typeof item.valueOf() === \"string\") {\n return item.toLowerCase() === value.toLowerCase();\n }\n return item === value;\n });\n if (!isPresent) {\n throw new Error(`${value} is not a valid value for ${objectName}. The valid values are: ${JSON.stringify(allowedValues)}.`);\n }\n return value;\n}\nfunction serializeByteArrayType(objectName, value) {\n let returnValue = \"\";\n if (value != undefined) {\n if (!(value instanceof Uint8Array)) {\n throw new Error(`${objectName} must be of type Uint8Array.`);\n }\n returnValue = encodeByteArray(value);\n }\n return returnValue;\n}\nfunction serializeBase64UrlType(objectName, value) {\n let returnValue = \"\";\n if (value != undefined) {\n if (!(value instanceof Uint8Array)) {\n throw new Error(`${objectName} must be of type Uint8Array.`);\n }\n returnValue = bufferToBase64Url(value) || \"\";\n }\n return returnValue;\n}\nfunction serializeDateTypes(typeName, value, objectName) {\n if (value != undefined) {\n if (typeName.match(/^Date$/i) !== null) {\n if (!(value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value))))) {\n throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`);\n }\n value =\n value instanceof Date\n ? value.toISOString().substring(0, 10)\n : new Date(value).toISOString().substring(0, 10);\n }\n else if (typeName.match(/^DateTime$/i) !== null) {\n if (!(value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value))))) {\n throw new Error(`${objectName} must be an instanceof Date or a string in ISO8601 format.`);\n }\n value = value instanceof Date ? value.toISOString() : new Date(value).toISOString();\n }\n else if (typeName.match(/^DateTimeRfc1123$/i) !== null) {\n if (!(value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value))))) {\n throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123 format.`);\n }\n value = value instanceof Date ? value.toUTCString() : new Date(value).toUTCString();\n }\n else if (typeName.match(/^UnixTime$/i) !== null) {\n if (!(value instanceof Date ||\n (typeof value.valueOf() === \"string\" && !isNaN(Date.parse(value))))) {\n throw new Error(`${objectName} must be an instanceof Date or a string in RFC-1123/ISO8601 format ` +\n `for it to be serialized in UnixTime/Epoch format.`);\n }\n value = dateToUnixTime(value);\n }\n else if (typeName.match(/^TimeSpan$/i) !== null) {\n if (!isDuration(value)) {\n throw new Error(`${objectName} must be a string in ISO 8601 format. Instead was \"${value}\".`);\n }\n }\n }\n return value;\n}\nfunction serializeSequenceType(serializer, mapper, object, objectName, isXml, options) {\n if (!Array.isArray(object)) {\n throw new Error(`${objectName} must be of type Array.`);\n }\n const elementType = mapper.type.element;\n if (!elementType || typeof elementType !== \"object\") {\n throw new Error(`element\" metadata for an Array must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}.`);\n }\n const tempArray = [];\n for (let i = 0; i < object.length; i++) {\n const serializedValue = serializer.serialize(elementType, object[i], objectName, options);\n if (isXml && elementType.xmlNamespace) {\n const xmlnsKey = elementType.xmlNamespacePrefix\n ? `xmlns:${elementType.xmlNamespacePrefix}`\n : \"xmlns\";\n if (elementType.type.name === \"Composite\") {\n tempArray[i] = Object.assign({}, serializedValue);\n tempArray[i][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace };\n }\n else {\n tempArray[i] = {};\n tempArray[i][options.xmlCharKey] = serializedValue;\n tempArray[i][XML_ATTRKEY] = { [xmlnsKey]: elementType.xmlNamespace };\n }\n }\n else {\n tempArray[i] = serializedValue;\n }\n }\n return tempArray;\n}\nfunction serializeDictionaryType(serializer, mapper, object, objectName, isXml, options) {\n if (typeof object !== \"object\") {\n throw new Error(`${objectName} must be of type object.`);\n }\n const valueType = mapper.type.value;\n if (!valueType || typeof valueType !== \"object\") {\n throw new Error(`\"value\" metadata for a Dictionary must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}.`);\n }\n const tempDictionary = {};\n for (const key of Object.keys(object)) {\n const serializedValue = serializer.serialize(valueType, object[key], objectName, options);\n // If the element needs an XML namespace we need to add it within the $ property\n tempDictionary[key] = getXmlObjectValue(valueType, serializedValue, isXml, options);\n }\n // Add the namespace to the root element if needed\n if (isXml && mapper.xmlNamespace) {\n const xmlnsKey = mapper.xmlNamespacePrefix ? `xmlns:${mapper.xmlNamespacePrefix}` : \"xmlns\";\n const result = tempDictionary;\n result[XML_ATTRKEY] = { [xmlnsKey]: mapper.xmlNamespace };\n return result;\n }\n return tempDictionary;\n}\n/**\n * Resolves the additionalProperties property from a referenced mapper.\n * @param serializer - The serializer containing the entire set of mappers.\n * @param mapper - The composite mapper to resolve.\n * @param objectName - Name of the object being serialized.\n */\nfunction resolveAdditionalProperties(serializer, mapper, objectName) {\n const additionalProperties = mapper.type.additionalProperties;\n if (!additionalProperties && mapper.type.className) {\n const modelMapper = resolveReferencedMapper(serializer, mapper, objectName);\n return modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.additionalProperties;\n }\n return additionalProperties;\n}\n/**\n * Finds the mapper referenced by `className`.\n * @param serializer - The serializer containing the entire set of mappers\n * @param mapper - The composite mapper to resolve\n * @param objectName - Name of the object being serialized\n */\nfunction resolveReferencedMapper(serializer, mapper, objectName) {\n const className = mapper.type.className;\n if (!className) {\n throw new Error(`Class name for model \"${objectName}\" is not provided in the mapper \"${JSON.stringify(mapper, undefined, 2)}\".`);\n }\n return serializer.modelMappers[className];\n}\n/**\n * Resolves a composite mapper's modelProperties.\n * @param serializer - The serializer containing the entire set of mappers\n * @param mapper - The composite mapper to resolve\n */\nfunction resolveModelProperties(serializer, mapper, objectName) {\n let modelProps = mapper.type.modelProperties;\n if (!modelProps) {\n const modelMapper = resolveReferencedMapper(serializer, mapper, objectName);\n if (!modelMapper) {\n throw new Error(`mapper() cannot be null or undefined for model \"${mapper.type.className}\".`);\n }\n modelProps = modelMapper === null || modelMapper === void 0 ? void 0 : modelMapper.type.modelProperties;\n if (!modelProps) {\n throw new Error(`modelProperties cannot be null or undefined in the ` +\n `mapper \"${JSON.stringify(modelMapper)}\" of type \"${mapper.type.className}\" for object \"${objectName}\".`);\n }\n }\n return modelProps;\n}\nfunction serializeCompositeType(serializer, mapper, object, objectName, isXml, options) {\n if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {\n mapper = getPolymorphicMapper(serializer, mapper, object, \"clientName\");\n }\n if (object != undefined) {\n const payload = {};\n const modelProps = resolveModelProperties(serializer, mapper, objectName);\n for (const key of Object.keys(modelProps)) {\n const propertyMapper = modelProps[key];\n if (propertyMapper.readOnly) {\n continue;\n }\n let propName;\n let parentObject = payload;\n if (serializer.isXML) {\n if (propertyMapper.xmlIsWrapped) {\n propName = propertyMapper.xmlName;\n }\n else {\n propName = propertyMapper.xmlElementName || propertyMapper.xmlName;\n }\n }\n else {\n const paths = splitSerializeName(propertyMapper.serializedName);\n propName = paths.pop();\n for (const pathName of paths) {\n const childObject = parentObject[pathName];\n if (childObject == undefined &&\n (object[key] != undefined || propertyMapper.defaultValue !== undefined)) {\n parentObject[pathName] = {};\n }\n parentObject = parentObject[pathName];\n }\n }\n if (parentObject != undefined) {\n if (isXml && mapper.xmlNamespace) {\n const xmlnsKey = mapper.xmlNamespacePrefix\n ? `xmlns:${mapper.xmlNamespacePrefix}`\n : \"xmlns\";\n parentObject[XML_ATTRKEY] = Object.assign(Object.assign({}, parentObject[XML_ATTRKEY]), { [xmlnsKey]: mapper.xmlNamespace });\n }\n const propertyObjectName = propertyMapper.serializedName !== \"\"\n ? objectName + \".\" + propertyMapper.serializedName\n : objectName;\n let toSerialize = object[key];\n const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper);\n if (polymorphicDiscriminator &&\n polymorphicDiscriminator.clientName === key &&\n toSerialize == undefined) {\n toSerialize = mapper.serializedName;\n }\n const serializedValue = serializer.serialize(propertyMapper, toSerialize, propertyObjectName, options);\n if (serializedValue !== undefined && propName != undefined) {\n const value = getXmlObjectValue(propertyMapper, serializedValue, isXml, options);\n if (isXml && propertyMapper.xmlIsAttribute) {\n // XML_ATTRKEY, i.e., $ is the key attributes are kept under in xml2js.\n // This keeps things simple while preventing name collision\n // with names in user documents.\n parentObject[XML_ATTRKEY] = parentObject[XML_ATTRKEY] || {};\n parentObject[XML_ATTRKEY][propName] = serializedValue;\n }\n else if (isXml && propertyMapper.xmlIsWrapped) {\n parentObject[propName] = { [propertyMapper.xmlElementName]: value };\n }\n else {\n parentObject[propName] = value;\n }\n }\n }\n }\n const additionalPropertiesMapper = resolveAdditionalProperties(serializer, mapper, objectName);\n if (additionalPropertiesMapper) {\n const propNames = Object.keys(modelProps);\n for (const clientPropName in object) {\n const isAdditionalProperty = propNames.every((pn) => pn !== clientPropName);\n if (isAdditionalProperty) {\n payload[clientPropName] = serializer.serialize(additionalPropertiesMapper, object[clientPropName], objectName + '[\"' + clientPropName + '\"]', options);\n }\n }\n }\n return payload;\n }\n return object;\n}\nfunction getXmlObjectValue(propertyMapper, serializedValue, isXml, options) {\n if (!isXml || !propertyMapper.xmlNamespace) {\n return serializedValue;\n }\n const xmlnsKey = propertyMapper.xmlNamespacePrefix\n ? `xmlns:${propertyMapper.xmlNamespacePrefix}`\n : \"xmlns\";\n const xmlNamespace = { [xmlnsKey]: propertyMapper.xmlNamespace };\n if ([\"Composite\"].includes(propertyMapper.type.name)) {\n if (serializedValue[XML_ATTRKEY]) {\n return serializedValue;\n }\n else {\n const result = Object.assign({}, serializedValue);\n result[XML_ATTRKEY] = xmlNamespace;\n return result;\n }\n }\n const result = {};\n result[options.xmlCharKey] = serializedValue;\n result[XML_ATTRKEY] = xmlNamespace;\n return result;\n}\nfunction isSpecialXmlProperty(propertyName, options) {\n return [XML_ATTRKEY, options.xmlCharKey].includes(propertyName);\n}\nfunction deserializeCompositeType(serializer, mapper, responseBody, objectName, options) {\n var _a, _b;\n const xmlCharKey = (_a = options.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;\n if (getPolymorphicDiscriminatorRecursively(serializer, mapper)) {\n mapper = getPolymorphicMapper(serializer, mapper, responseBody, \"serializedName\");\n }\n const modelProps = resolveModelProperties(serializer, mapper, objectName);\n let instance = {};\n const handledPropertyNames = [];\n for (const key of Object.keys(modelProps)) {\n const propertyMapper = modelProps[key];\n const paths = splitSerializeName(modelProps[key].serializedName);\n handledPropertyNames.push(paths[0]);\n const { serializedName, xmlName, xmlElementName } = propertyMapper;\n let propertyObjectName = objectName;\n if (serializedName !== \"\" && serializedName !== undefined) {\n propertyObjectName = objectName + \".\" + serializedName;\n }\n const headerCollectionPrefix = propertyMapper.headerCollectionPrefix;\n if (headerCollectionPrefix) {\n const dictionary = {};\n for (const headerKey of Object.keys(responseBody)) {\n if (headerKey.startsWith(headerCollectionPrefix)) {\n dictionary[headerKey.substring(headerCollectionPrefix.length)] = serializer.deserialize(propertyMapper.type.value, responseBody[headerKey], propertyObjectName, options);\n }\n handledPropertyNames.push(headerKey);\n }\n instance[key] = dictionary;\n }\n else if (serializer.isXML) {\n if (propertyMapper.xmlIsAttribute && responseBody[XML_ATTRKEY]) {\n instance[key] = serializer.deserialize(propertyMapper, responseBody[XML_ATTRKEY][xmlName], propertyObjectName, options);\n }\n else if (propertyMapper.xmlIsMsText) {\n if (responseBody[xmlCharKey] !== undefined) {\n instance[key] = responseBody[xmlCharKey];\n }\n else if (typeof responseBody === \"string\") {\n // The special case where xml parser parses \"content\" into JSON of\n // `{ name: \"content\"}` instead of `{ name: { \"_\": \"content\" }}`\n instance[key] = responseBody;\n }\n }\n else {\n const propertyName = xmlElementName || xmlName || serializedName;\n if (propertyMapper.xmlIsWrapped) {\n /* a list of wrapped by \n For the xml example below\n \n ...\n ...\n \n the responseBody has\n {\n Cors: {\n CorsRule: [{...}, {...}]\n }\n }\n xmlName is \"Cors\" and xmlElementName is\"CorsRule\".\n */\n const wrapped = responseBody[xmlName];\n const elementList = (_b = wrapped === null || wrapped === void 0 ? void 0 : wrapped[xmlElementName]) !== null && _b !== void 0 ? _b : [];\n instance[key] = serializer.deserialize(propertyMapper, elementList, propertyObjectName, options);\n handledPropertyNames.push(xmlName);\n }\n else {\n const property = responseBody[propertyName];\n instance[key] = serializer.deserialize(propertyMapper, property, propertyObjectName, options);\n handledPropertyNames.push(propertyName);\n }\n }\n }\n else {\n // deserialize the property if it is present in the provided responseBody instance\n let propertyInstance;\n let res = responseBody;\n // traversing the object step by step.\n for (const item of paths) {\n if (!res)\n break;\n res = res[item];\n }\n propertyInstance = res;\n const polymorphicDiscriminator = mapper.type.polymorphicDiscriminator;\n // checking that the model property name (key)(ex: \"fishtype\") and the\n // clientName of the polymorphicDiscriminator {metadata} (ex: \"fishtype\")\n // instead of the serializedName of the polymorphicDiscriminator (ex: \"fish.type\")\n // is a better approach. The generator is not consistent with escaping '\\.' in the\n // serializedName of the property (ex: \"fish\\.type\") that is marked as polymorphic discriminator\n // and the serializedName of the metadata polymorphicDiscriminator (ex: \"fish.type\"). However,\n // the clientName transformation of the polymorphicDiscriminator (ex: \"fishtype\") and\n // the transformation of model property name (ex: \"fishtype\") is done consistently.\n // Hence, it is a safer bet to rely on the clientName of the polymorphicDiscriminator.\n if (polymorphicDiscriminator &&\n key === polymorphicDiscriminator.clientName &&\n propertyInstance == undefined) {\n propertyInstance = mapper.serializedName;\n }\n let serializedValue;\n // paging\n if (Array.isArray(responseBody[key]) && modelProps[key].serializedName === \"\") {\n propertyInstance = responseBody[key];\n const arrayInstance = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options);\n // Copy over any properties that have already been added into the instance, where they do\n // not exist on the newly de-serialized array\n for (const [k, v] of Object.entries(instance)) {\n if (!Object.prototype.hasOwnProperty.call(arrayInstance, k)) {\n arrayInstance[k] = v;\n }\n }\n instance = arrayInstance;\n }\n else if (propertyInstance !== undefined || propertyMapper.defaultValue !== undefined) {\n serializedValue = serializer.deserialize(propertyMapper, propertyInstance, propertyObjectName, options);\n instance[key] = serializedValue;\n }\n }\n }\n const additionalPropertiesMapper = mapper.type.additionalProperties;\n if (additionalPropertiesMapper) {\n const isAdditionalProperty = (responsePropName) => {\n for (const clientPropName in modelProps) {\n const paths = splitSerializeName(modelProps[clientPropName].serializedName);\n if (paths[0] === responsePropName) {\n return false;\n }\n }\n return true;\n };\n for (const responsePropName in responseBody) {\n if (isAdditionalProperty(responsePropName)) {\n instance[responsePropName] = serializer.deserialize(additionalPropertiesMapper, responseBody[responsePropName], objectName + '[\"' + responsePropName + '\"]', options);\n }\n }\n }\n else if (responseBody) {\n for (const key of Object.keys(responseBody)) {\n if (instance[key] === undefined &&\n !handledPropertyNames.includes(key) &&\n !isSpecialXmlProperty(key, options)) {\n instance[key] = responseBody[key];\n }\n }\n }\n return instance;\n}\nfunction deserializeDictionaryType(serializer, mapper, responseBody, objectName, options) {\n const value = mapper.type.value;\n if (!value || typeof value !== \"object\") {\n throw new Error(`\"value\" metadata for a Dictionary must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}`);\n }\n if (responseBody) {\n const tempDictionary = {};\n for (const key of Object.keys(responseBody)) {\n tempDictionary[key] = serializer.deserialize(value, responseBody[key], objectName, options);\n }\n return tempDictionary;\n }\n return responseBody;\n}\nfunction deserializeSequenceType(serializer, mapper, responseBody, objectName, options) {\n const element = mapper.type.element;\n if (!element || typeof element !== \"object\") {\n throw new Error(`element\" metadata for an Array must be defined in the ` +\n `mapper and it must of type \"object\" in ${objectName}`);\n }\n if (responseBody) {\n if (!Array.isArray(responseBody)) {\n // xml2js will interpret a single element array as just the element, so force it to be an array\n responseBody = [responseBody];\n }\n const tempArray = [];\n for (let i = 0; i < responseBody.length; i++) {\n tempArray[i] = serializer.deserialize(element, responseBody[i], `${objectName}[${i}]`, options);\n }\n return tempArray;\n }\n return responseBody;\n}\nfunction getPolymorphicMapper(serializer, mapper, object, polymorphicPropertyName) {\n const polymorphicDiscriminator = getPolymorphicDiscriminatorRecursively(serializer, mapper);\n if (polymorphicDiscriminator) {\n const discriminatorName = polymorphicDiscriminator[polymorphicPropertyName];\n if (discriminatorName != undefined) {\n const discriminatorValue = object[discriminatorName];\n if (discriminatorValue != undefined) {\n const typeName = mapper.type.uberParent || mapper.type.className;\n const indexDiscriminator = discriminatorValue === typeName\n ? discriminatorValue\n : typeName + \".\" + discriminatorValue;\n const polymorphicMapper = serializer.modelMappers.discriminators[indexDiscriminator];\n if (polymorphicMapper) {\n mapper = polymorphicMapper;\n }\n }\n }\n }\n return mapper;\n}\nfunction getPolymorphicDiscriminatorRecursively(serializer, mapper) {\n return (mapper.type.polymorphicDiscriminator ||\n getPolymorphicDiscriminatorSafely(serializer, mapper.type.uberParent) ||\n getPolymorphicDiscriminatorSafely(serializer, mapper.type.className));\n}\nfunction getPolymorphicDiscriminatorSafely(serializer, typeName) {\n return (typeName &&\n serializer.modelMappers[typeName] &&\n serializer.modelMappers[typeName].type.polymorphicDiscriminator);\n}\n/**\n * Utility function that serializes an object that might contain binary information into a plain object, array or a string.\n */\nfunction serializeObject(toSerialize) {\n const castToSerialize = toSerialize;\n if (toSerialize == undefined)\n return undefined;\n if (toSerialize instanceof Uint8Array) {\n toSerialize = encodeByteArray(toSerialize);\n return toSerialize;\n }\n else if (toSerialize instanceof Date) {\n return toSerialize.toISOString();\n }\n else if (Array.isArray(toSerialize)) {\n const array = [];\n for (let i = 0; i < toSerialize.length; i++) {\n array.push(serializeObject(toSerialize[i]));\n }\n return array;\n }\n else if (typeof toSerialize === \"object\") {\n const dictionary = {};\n for (const property in toSerialize) {\n dictionary[property] = serializeObject(castToSerialize[property]);\n }\n return dictionary;\n }\n return toSerialize;\n}\n/**\n * Utility function to create a K:V from a list of strings\n */\nfunction strEnum(o) {\n const result = {};\n for (const key of o) {\n result[key] = key;\n }\n return result;\n}\n/**\n * String enum containing the string types of property mappers.\n */\n// eslint-disable-next-line @typescript-eslint/no-redeclare\nconst MapperType = strEnum([\n \"Base64Url\",\n \"Boolean\",\n \"ByteArray\",\n \"Composite\",\n \"Date\",\n \"DateTime\",\n \"DateTimeRfc1123\",\n \"Dictionary\",\n \"Enum\",\n \"Number\",\n \"Object\",\n \"Sequence\",\n \"String\",\n \"Stream\",\n \"TimeSpan\",\n \"UnixTime\",\n]);\n\n// Copyright (c) Microsoft Corporation.\nfunction isWebResourceLike(object) {\n if (object && typeof object === \"object\") {\n const castObject = object;\n if (typeof castObject.url === \"string\" &&\n typeof castObject.method === \"string\" &&\n typeof castObject.headers === \"object\" &&\n isHttpHeadersLike(castObject.headers) &&\n typeof castObject.validateRequestProperties === \"function\" &&\n typeof castObject.prepare === \"function\" &&\n typeof castObject.clone === \"function\") {\n return true;\n }\n }\n return false;\n}\n/**\n * Creates a new WebResource object.\n *\n * This class provides an abstraction over a REST call by being library / implementation agnostic and wrapping the necessary\n * properties to initiate a request.\n */\nclass WebResource {\n constructor(url, method, body, query, headers, streamResponseBody, withCredentials, abortSignal, timeout, onUploadProgress, onDownloadProgress, proxySettings, keepAlive, decompressResponse, streamResponseStatusCodes) {\n this.streamResponseBody = streamResponseBody;\n this.streamResponseStatusCodes = streamResponseStatusCodes;\n this.url = url || \"\";\n this.method = method || \"GET\";\n this.headers = isHttpHeadersLike(headers) ? headers : new HttpHeaders(headers);\n this.body = body;\n this.query = query;\n this.formData = undefined;\n this.withCredentials = withCredentials || false;\n this.abortSignal = abortSignal;\n this.timeout = timeout || 0;\n this.onUploadProgress = onUploadProgress;\n this.onDownloadProgress = onDownloadProgress;\n this.proxySettings = proxySettings;\n this.keepAlive = keepAlive;\n this.decompressResponse = decompressResponse;\n this.requestId = this.headers.get(\"x-ms-client-request-id\") || generateUuid();\n }\n /**\n * Validates that the required properties such as method, url, headers[\"Content-Type\"],\n * headers[\"accept-language\"] are defined. It will throw an error if one of the above\n * mentioned properties are not defined.\n */\n validateRequestProperties() {\n if (!this.method) {\n throw new Error(\"WebResource.method is required.\");\n }\n if (!this.url) {\n throw new Error(\"WebResource.url is required.\");\n }\n }\n /**\n * Prepares the request.\n * @param options - Options to provide for preparing the request.\n * @returns Returns the prepared WebResource (HTTP Request) object that needs to be given to the request pipeline.\n */\n prepare(options) {\n if (!options) {\n throw new Error(\"options object is required\");\n }\n if (options.method === undefined ||\n options.method === null ||\n typeof options.method.valueOf() !== \"string\") {\n throw new Error(\"options.method must be a string.\");\n }\n if (options.url && options.pathTemplate) {\n throw new Error(\"options.url and options.pathTemplate are mutually exclusive. Please provide exactly one of them.\");\n }\n if ((options.pathTemplate === undefined ||\n options.pathTemplate === null ||\n typeof options.pathTemplate.valueOf() !== \"string\") &&\n (options.url === undefined ||\n options.url === null ||\n typeof options.url.valueOf() !== \"string\")) {\n throw new Error(\"Please provide exactly one of options.pathTemplate or options.url.\");\n }\n // set the url if it is provided.\n if (options.url) {\n if (typeof options.url !== \"string\") {\n throw new Error('options.url must be of type \"string\".');\n }\n this.url = options.url;\n }\n // set the method\n if (options.method) {\n const validMethods = [\"GET\", \"PUT\", \"HEAD\", \"DELETE\", \"OPTIONS\", \"POST\", \"PATCH\", \"TRACE\"];\n if (validMethods.indexOf(options.method.toUpperCase()) === -1) {\n throw new Error('The provided method \"' +\n options.method +\n '\" is invalid. Supported HTTP methods are: ' +\n JSON.stringify(validMethods));\n }\n }\n this.method = options.method.toUpperCase();\n // construct the url if path template is provided\n if (options.pathTemplate) {\n const { pathTemplate, pathParameters } = options;\n if (typeof pathTemplate !== \"string\") {\n throw new Error('options.pathTemplate must be of type \"string\".');\n }\n if (!options.baseUrl) {\n options.baseUrl = \"https://management.azure.com\";\n }\n const baseUrl = options.baseUrl;\n let url = baseUrl +\n (baseUrl.endsWith(\"/\") ? \"\" : \"/\") +\n (pathTemplate.startsWith(\"/\") ? pathTemplate.slice(1) : pathTemplate);\n const segments = url.match(/({[\\w-]*\\s*[\\w-]*})/gi);\n if (segments && segments.length) {\n if (!pathParameters) {\n throw new Error(`pathTemplate: ${pathTemplate} has been provided. Hence, options.pathParameters must also be provided.`);\n }\n segments.forEach(function (item) {\n const pathParamName = item.slice(1, -1);\n const pathParam = pathParameters[pathParamName];\n if (pathParam === null ||\n pathParam === undefined ||\n !(typeof pathParam === \"string\" || typeof pathParam === \"object\")) {\n const stringifiedPathParameters = JSON.stringify(pathParameters, undefined, 2);\n throw new Error(`pathTemplate: ${pathTemplate} contains the path parameter ${pathParamName}` +\n ` however, it is not present in parameters: ${stringifiedPathParameters}.` +\n `The value of the path parameter can either be a \"string\" of the form { ${pathParamName}: \"some sample value\" } or ` +\n `it can be an \"object\" of the form { \"${pathParamName}\": { value: \"some sample value\", skipUrlEncoding: true } }.`);\n }\n if (typeof pathParam.valueOf() === \"string\") {\n url = url.replace(item, encodeURIComponent(pathParam));\n }\n if (typeof pathParam.valueOf() === \"object\") {\n if (!pathParam.value) {\n throw new Error(`options.pathParameters[${pathParamName}] is of type \"object\" but it does not contain a \"value\" property.`);\n }\n if (pathParam.skipUrlEncoding) {\n url = url.replace(item, pathParam.value);\n }\n else {\n url = url.replace(item, encodeURIComponent(pathParam.value));\n }\n }\n });\n }\n this.url = url;\n }\n // append query parameters to the url if they are provided. They can be provided with pathTemplate or url option.\n if (options.queryParameters) {\n const queryParameters = options.queryParameters;\n if (typeof queryParameters !== \"object\") {\n throw new Error(`options.queryParameters must be of type object. It should be a JSON object ` +\n `of \"query-parameter-name\" as the key and the \"query-parameter-value\" as the value. ` +\n `The \"query-parameter-value\" may be fo type \"string\" or an \"object\" of the form { value: \"query-parameter-value\", skipUrlEncoding: true }.`);\n }\n // append question mark if it is not present in the url\n if (this.url && this.url.indexOf(\"?\") === -1) {\n this.url += \"?\";\n }\n // construct queryString\n const queryParams = [];\n // We need to populate this.query as a dictionary if the request is being used for Sway's validateRequest().\n this.query = {};\n for (const queryParamName in queryParameters) {\n const queryParam = queryParameters[queryParamName];\n if (queryParam) {\n if (typeof queryParam === \"string\") {\n queryParams.push(queryParamName + \"=\" + encodeURIComponent(queryParam));\n this.query[queryParamName] = encodeURIComponent(queryParam);\n }\n else if (typeof queryParam === \"object\") {\n if (!queryParam.value) {\n throw new Error(`options.queryParameters[${queryParamName}] is of type \"object\" but it does not contain a \"value\" property.`);\n }\n if (queryParam.skipUrlEncoding) {\n queryParams.push(queryParamName + \"=\" + queryParam.value);\n this.query[queryParamName] = queryParam.value;\n }\n else {\n queryParams.push(queryParamName + \"=\" + encodeURIComponent(queryParam.value));\n this.query[queryParamName] = encodeURIComponent(queryParam.value);\n }\n }\n }\n } // end-of-for\n // append the queryString\n this.url += queryParams.join(\"&\");\n }\n // add headers to the request if they are provided\n if (options.headers) {\n const headers = options.headers;\n for (const headerName of Object.keys(options.headers)) {\n this.headers.set(headerName, headers[headerName]);\n }\n }\n // ensure accept-language is set correctly\n if (!this.headers.get(\"accept-language\")) {\n this.headers.set(\"accept-language\", \"en-US\");\n }\n // ensure the request-id is set correctly\n if (!this.headers.get(\"x-ms-client-request-id\") && !options.disableClientRequestId) {\n this.headers.set(\"x-ms-client-request-id\", this.requestId);\n }\n // default\n if (!this.headers.get(\"Content-Type\")) {\n this.headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n }\n // set the request body. request.js automatically sets the Content-Length request header, so we need not set it explicitly\n this.body = options.body;\n if (options.body !== undefined && options.body !== null) {\n // body as a stream special case. set the body as-is and check for some special request headers specific to sending a stream.\n if (options.bodyIsStream) {\n if (!this.headers.get(\"Transfer-Encoding\")) {\n this.headers.set(\"Transfer-Encoding\", \"chunked\");\n }\n if (this.headers.get(\"Content-Type\") !== \"application/octet-stream\") {\n this.headers.set(\"Content-Type\", \"application/octet-stream\");\n }\n }\n else {\n if (options.serializationMapper) {\n this.body = new Serializer(options.mappers).serialize(options.serializationMapper, options.body, \"requestBody\");\n }\n if (!options.disableJsonStringifyOnBody) {\n this.body = JSON.stringify(options.body);\n }\n }\n }\n if (options.spanOptions) {\n this.spanOptions = options.spanOptions;\n }\n if (options.tracingContext) {\n this.tracingContext = options.tracingContext;\n }\n this.abortSignal = options.abortSignal;\n this.onDownloadProgress = options.onDownloadProgress;\n this.onUploadProgress = options.onUploadProgress;\n return this;\n }\n /**\n * Clone this WebResource HTTP request object.\n * @returns The clone of this WebResource HTTP request object.\n */\n clone() {\n const result = new WebResource(this.url, this.method, this.body, this.query, this.headers && this.headers.clone(), this.streamResponseBody, this.withCredentials, this.abortSignal, this.timeout, this.onUploadProgress, this.onDownloadProgress, this.proxySettings, this.keepAlive, this.decompressResponse, this.streamResponseStatusCodes);\n if (this.formData) {\n result.formData = this.formData;\n }\n if (this.operationSpec) {\n result.operationSpec = this.operationSpec;\n }\n if (this.shouldDeserialize) {\n result.shouldDeserialize = this.shouldDeserialize;\n }\n if (this.operationResponseGetter) {\n result.operationResponseGetter = this.operationResponseGetter;\n }\n return result;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A class that handles the query portion of a URLBuilder.\n */\nclass URLQuery {\n constructor() {\n this._rawQuery = {};\n }\n /**\n * Get whether or not there any query parameters in this URLQuery.\n */\n any() {\n return Object.keys(this._rawQuery).length > 0;\n }\n /**\n * Get the keys of the query string.\n */\n keys() {\n return Object.keys(this._rawQuery);\n }\n /**\n * Set a query parameter with the provided name and value. If the parameterValue is undefined or\n * empty, then this will attempt to remove an existing query parameter with the provided\n * parameterName.\n */\n set(parameterName, parameterValue) {\n const caseParameterValue = parameterValue;\n if (parameterName) {\n if (caseParameterValue !== undefined && caseParameterValue !== null) {\n const newValue = Array.isArray(caseParameterValue)\n ? caseParameterValue\n : caseParameterValue.toString();\n this._rawQuery[parameterName] = newValue;\n }\n else {\n delete this._rawQuery[parameterName];\n }\n }\n }\n /**\n * Get the value of the query parameter with the provided name. If no parameter exists with the\n * provided parameter name, then undefined will be returned.\n */\n get(parameterName) {\n return parameterName ? this._rawQuery[parameterName] : undefined;\n }\n /**\n * Get the string representation of this query. The return value will not start with a \"?\".\n */\n toString() {\n let result = \"\";\n for (const parameterName in this._rawQuery) {\n if (result) {\n result += \"&\";\n }\n const parameterValue = this._rawQuery[parameterName];\n if (Array.isArray(parameterValue)) {\n const parameterStrings = [];\n for (const parameterValueElement of parameterValue) {\n parameterStrings.push(`${parameterName}=${parameterValueElement}`);\n }\n result += parameterStrings.join(\"&\");\n }\n else {\n result += `${parameterName}=${parameterValue}`;\n }\n }\n return result;\n }\n /**\n * Parse a URLQuery from the provided text.\n */\n static parse(text) {\n const result = new URLQuery();\n if (text) {\n if (text.startsWith(\"?\")) {\n text = text.substring(1);\n }\n let currentState = \"ParameterName\";\n let parameterName = \"\";\n let parameterValue = \"\";\n for (let i = 0; i < text.length; ++i) {\n const currentCharacter = text[i];\n switch (currentState) {\n case \"ParameterName\":\n switch (currentCharacter) {\n case \"=\":\n currentState = \"ParameterValue\";\n break;\n case \"&\":\n parameterName = \"\";\n parameterValue = \"\";\n break;\n default:\n parameterName += currentCharacter;\n break;\n }\n break;\n case \"ParameterValue\":\n switch (currentCharacter) {\n case \"&\":\n result.set(parameterName, parameterValue);\n parameterName = \"\";\n parameterValue = \"\";\n currentState = \"ParameterName\";\n break;\n default:\n parameterValue += currentCharacter;\n break;\n }\n break;\n default:\n throw new Error(\"Unrecognized URLQuery parse state: \" + currentState);\n }\n }\n if (currentState === \"ParameterValue\") {\n result.set(parameterName, parameterValue);\n }\n }\n return result;\n }\n}\n/**\n * A class that handles creating, modifying, and parsing URLs.\n */\nclass URLBuilder {\n /**\n * Set the scheme/protocol for this URL. If the provided scheme contains other parts of a URL\n * (such as a host, port, path, or query), those parts will be added to this URL as well.\n */\n setScheme(scheme) {\n if (!scheme) {\n this._scheme = undefined;\n }\n else {\n this.set(scheme, \"SCHEME\");\n }\n }\n /**\n * Get the scheme that has been set in this URL.\n */\n getScheme() {\n return this._scheme;\n }\n /**\n * Set the host for this URL. If the provided host contains other parts of a URL (such as a\n * port, path, or query), those parts will be added to this URL as well.\n */\n setHost(host) {\n if (!host) {\n this._host = undefined;\n }\n else {\n this.set(host, \"SCHEME_OR_HOST\");\n }\n }\n /**\n * Get the host that has been set in this URL.\n */\n getHost() {\n return this._host;\n }\n /**\n * Set the port for this URL. If the provided port contains other parts of a URL (such as a\n * path or query), those parts will be added to this URL as well.\n */\n setPort(port) {\n if (port === undefined || port === null || port === \"\") {\n this._port = undefined;\n }\n else {\n this.set(port.toString(), \"PORT\");\n }\n }\n /**\n * Get the port that has been set in this URL.\n */\n getPort() {\n return this._port;\n }\n /**\n * Set the path for this URL. If the provided path contains a query, then it will be added to\n * this URL as well.\n */\n setPath(path) {\n if (!path) {\n this._path = undefined;\n }\n else {\n const schemeIndex = path.indexOf(\"://\");\n if (schemeIndex !== -1) {\n const schemeStart = path.lastIndexOf(\"/\", schemeIndex);\n // Make sure to only grab the URL part of the path before setting the state back to SCHEME\n // this will handle cases such as \"/a/b/c/https://microsoft.com\" => \"https://microsoft.com\"\n this.set(schemeStart === -1 ? path : path.substr(schemeStart + 1), \"SCHEME\");\n }\n else {\n this.set(path, \"PATH\");\n }\n }\n }\n /**\n * Append the provided path to this URL's existing path. If the provided path contains a query,\n * then it will be added to this URL as well.\n */\n appendPath(path) {\n if (path) {\n let currentPath = this.getPath();\n if (currentPath) {\n if (!currentPath.endsWith(\"/\")) {\n currentPath += \"/\";\n }\n if (path.startsWith(\"/\")) {\n path = path.substring(1);\n }\n path = currentPath + path;\n }\n this.set(path, \"PATH\");\n }\n }\n /**\n * Get the path that has been set in this URL.\n */\n getPath() {\n return this._path;\n }\n /**\n * Set the query in this URL.\n */\n setQuery(query) {\n if (!query) {\n this._query = undefined;\n }\n else {\n this._query = URLQuery.parse(query);\n }\n }\n /**\n * Set a query parameter with the provided name and value in this URL's query. If the provided\n * query parameter value is undefined or empty, then the query parameter will be removed if it\n * existed.\n */\n setQueryParameter(queryParameterName, queryParameterValue) {\n if (queryParameterName) {\n if (!this._query) {\n this._query = new URLQuery();\n }\n this._query.set(queryParameterName, queryParameterValue);\n }\n }\n /**\n * Get the value of the query parameter with the provided query parameter name. If no query\n * parameter exists with the provided name, then undefined will be returned.\n */\n getQueryParameterValue(queryParameterName) {\n return this._query ? this._query.get(queryParameterName) : undefined;\n }\n /**\n * Get the query in this URL.\n */\n getQuery() {\n return this._query ? this._query.toString() : undefined;\n }\n /**\n * Set the parts of this URL by parsing the provided text using the provided startState.\n */\n set(text, startState) {\n const tokenizer = new URLTokenizer(text, startState);\n while (tokenizer.next()) {\n const token = tokenizer.current();\n let tokenPath;\n if (token) {\n switch (token.type) {\n case \"SCHEME\":\n this._scheme = token.text || undefined;\n break;\n case \"HOST\":\n this._host = token.text || undefined;\n break;\n case \"PORT\":\n this._port = token.text || undefined;\n break;\n case \"PATH\":\n tokenPath = token.text || undefined;\n if (!this._path || this._path === \"/\" || tokenPath !== \"/\") {\n this._path = tokenPath;\n }\n break;\n case \"QUERY\":\n this._query = URLQuery.parse(token.text);\n break;\n default:\n throw new Error(`Unrecognized URLTokenType: ${token.type}`);\n }\n }\n }\n }\n /**\n * Serializes the URL as a string.\n * @returns the URL as a string.\n */\n toString() {\n let result = \"\";\n if (this._scheme) {\n result += `${this._scheme}://`;\n }\n if (this._host) {\n result += this._host;\n }\n if (this._port) {\n result += `:${this._port}`;\n }\n if (this._path) {\n if (!this._path.startsWith(\"/\")) {\n result += \"/\";\n }\n result += this._path;\n }\n if (this._query && this._query.any()) {\n result += `?${this._query.toString()}`;\n }\n return result;\n }\n /**\n * If the provided searchValue is found in this URLBuilder, then replace it with the provided\n * replaceValue.\n */\n replaceAll(searchValue, replaceValue) {\n if (searchValue) {\n this.setScheme(replaceAll(this.getScheme(), searchValue, replaceValue));\n this.setHost(replaceAll(this.getHost(), searchValue, replaceValue));\n this.setPort(replaceAll(this.getPort(), searchValue, replaceValue));\n this.setPath(replaceAll(this.getPath(), searchValue, replaceValue));\n this.setQuery(replaceAll(this.getQuery(), searchValue, replaceValue));\n }\n }\n /**\n * Parses a given string URL into a new {@link URLBuilder}.\n */\n static parse(text) {\n const result = new URLBuilder();\n result.set(text, \"SCHEME_OR_HOST\");\n return result;\n }\n}\nclass URLToken {\n constructor(text, type) {\n this.text = text;\n this.type = type;\n }\n static scheme(text) {\n return new URLToken(text, \"SCHEME\");\n }\n static host(text) {\n return new URLToken(text, \"HOST\");\n }\n static port(text) {\n return new URLToken(text, \"PORT\");\n }\n static path(text) {\n return new URLToken(text, \"PATH\");\n }\n static query(text) {\n return new URLToken(text, \"QUERY\");\n }\n}\n/**\n * Get whether or not the provided character (single character string) is an alphanumeric (letter or\n * digit) character.\n */\nfunction isAlphaNumericCharacter(character) {\n const characterCode = character.charCodeAt(0);\n return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ ||\n (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ ||\n (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */);\n}\n/**\n * A class that tokenizes URL strings.\n */\nclass URLTokenizer {\n constructor(_text, state) {\n this._text = _text;\n this._textLength = _text ? _text.length : 0;\n this._currentState = state !== undefined && state !== null ? state : \"SCHEME_OR_HOST\";\n this._currentIndex = 0;\n }\n /**\n * Get the current URLToken this URLTokenizer is pointing at, or undefined if the URLTokenizer\n * hasn't started or has finished tokenizing.\n */\n current() {\n return this._currentToken;\n }\n /**\n * Advance to the next URLToken and return whether or not a URLToken was found.\n */\n next() {\n if (!hasCurrentCharacter(this)) {\n this._currentToken = undefined;\n }\n else {\n switch (this._currentState) {\n case \"SCHEME\":\n nextScheme(this);\n break;\n case \"SCHEME_OR_HOST\":\n nextSchemeOrHost(this);\n break;\n case \"HOST\":\n nextHost(this);\n break;\n case \"PORT\":\n nextPort(this);\n break;\n case \"PATH\":\n nextPath(this);\n break;\n case \"QUERY\":\n nextQuery(this);\n break;\n default:\n throw new Error(`Unrecognized URLTokenizerState: ${this._currentState}`);\n }\n }\n return !!this._currentToken;\n }\n}\n/**\n * Read the remaining characters from this Tokenizer's character stream.\n */\nfunction readRemaining(tokenizer) {\n let result = \"\";\n if (tokenizer._currentIndex < tokenizer._textLength) {\n result = tokenizer._text.substring(tokenizer._currentIndex);\n tokenizer._currentIndex = tokenizer._textLength;\n }\n return result;\n}\n/**\n * Whether or not this URLTokenizer has a current character.\n */\nfunction hasCurrentCharacter(tokenizer) {\n return tokenizer._currentIndex < tokenizer._textLength;\n}\n/**\n * Get the character in the text string at the current index.\n */\nfunction getCurrentCharacter(tokenizer) {\n return tokenizer._text[tokenizer._currentIndex];\n}\n/**\n * Advance to the character in text that is \"step\" characters ahead. If no step value is provided,\n * then step will default to 1.\n */\nfunction nextCharacter(tokenizer, step) {\n if (hasCurrentCharacter(tokenizer)) {\n if (!step) {\n step = 1;\n }\n tokenizer._currentIndex += step;\n }\n}\n/**\n * Starting with the current character, peek \"charactersToPeek\" number of characters ahead in this\n * Tokenizer's stream of characters.\n */\nfunction peekCharacters(tokenizer, charactersToPeek) {\n let endIndex = tokenizer._currentIndex + charactersToPeek;\n if (tokenizer._textLength < endIndex) {\n endIndex = tokenizer._textLength;\n }\n return tokenizer._text.substring(tokenizer._currentIndex, endIndex);\n}\n/**\n * Read characters from this Tokenizer until the end of the stream or until the provided condition\n * is false when provided the current character.\n */\nfunction readWhile(tokenizer, condition) {\n let result = \"\";\n while (hasCurrentCharacter(tokenizer)) {\n const currentCharacter = getCurrentCharacter(tokenizer);\n if (!condition(currentCharacter)) {\n break;\n }\n else {\n result += currentCharacter;\n nextCharacter(tokenizer);\n }\n }\n return result;\n}\n/**\n * Read characters from this Tokenizer until a non-alphanumeric character or the end of the\n * character stream is reached.\n */\nfunction readWhileLetterOrDigit(tokenizer) {\n return readWhile(tokenizer, (character) => isAlphaNumericCharacter(character));\n}\n/**\n * Read characters from this Tokenizer until one of the provided terminating characters is read or\n * the end of the character stream is reached.\n */\nfunction readUntilCharacter(tokenizer, ...terminatingCharacters) {\n return readWhile(tokenizer, (character) => terminatingCharacters.indexOf(character) === -1);\n}\nfunction nextScheme(tokenizer) {\n const scheme = readWhileLetterOrDigit(tokenizer);\n tokenizer._currentToken = URLToken.scheme(scheme);\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentState = \"DONE\";\n }\n else {\n tokenizer._currentState = \"HOST\";\n }\n}\nfunction nextSchemeOrHost(tokenizer) {\n const schemeOrHost = readUntilCharacter(tokenizer, \":\", \"/\", \"?\");\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentToken = URLToken.host(schemeOrHost);\n tokenizer._currentState = \"DONE\";\n }\n else if (getCurrentCharacter(tokenizer) === \":\") {\n if (peekCharacters(tokenizer, 3) === \"://\") {\n tokenizer._currentToken = URLToken.scheme(schemeOrHost);\n tokenizer._currentState = \"HOST\";\n }\n else {\n tokenizer._currentToken = URLToken.host(schemeOrHost);\n tokenizer._currentState = \"PORT\";\n }\n }\n else {\n tokenizer._currentToken = URLToken.host(schemeOrHost);\n if (getCurrentCharacter(tokenizer) === \"/\") {\n tokenizer._currentState = \"PATH\";\n }\n else {\n tokenizer._currentState = \"QUERY\";\n }\n }\n}\nfunction nextHost(tokenizer) {\n if (peekCharacters(tokenizer, 3) === \"://\") {\n nextCharacter(tokenizer, 3);\n }\n const host = readUntilCharacter(tokenizer, \":\", \"/\", \"?\");\n tokenizer._currentToken = URLToken.host(host);\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentState = \"DONE\";\n }\n else if (getCurrentCharacter(tokenizer) === \":\") {\n tokenizer._currentState = \"PORT\";\n }\n else if (getCurrentCharacter(tokenizer) === \"/\") {\n tokenizer._currentState = \"PATH\";\n }\n else {\n tokenizer._currentState = \"QUERY\";\n }\n}\nfunction nextPort(tokenizer) {\n if (getCurrentCharacter(tokenizer) === \":\") {\n nextCharacter(tokenizer);\n }\n const port = readUntilCharacter(tokenizer, \"/\", \"?\");\n tokenizer._currentToken = URLToken.port(port);\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentState = \"DONE\";\n }\n else if (getCurrentCharacter(tokenizer) === \"/\") {\n tokenizer._currentState = \"PATH\";\n }\n else {\n tokenizer._currentState = \"QUERY\";\n }\n}\nfunction nextPath(tokenizer) {\n const path = readUntilCharacter(tokenizer, \"?\");\n tokenizer._currentToken = URLToken.path(path);\n if (!hasCurrentCharacter(tokenizer)) {\n tokenizer._currentState = \"DONE\";\n }\n else {\n tokenizer._currentState = \"QUERY\";\n }\n}\nfunction nextQuery(tokenizer) {\n if (getCurrentCharacter(tokenizer) === \"?\") {\n nextCharacter(tokenizer);\n }\n const query = readRemaining(tokenizer);\n tokenizer._currentToken = URLToken.query(query);\n tokenizer._currentState = \"DONE\";\n}\n\n// Copyright (c) Microsoft Corporation.\nfunction createProxyAgent(requestUrl, proxySettings, headers) {\n const host = URLBuilder.parse(proxySettings.host).getHost();\n if (!host) {\n throw new Error(\"Expecting a non-empty host in proxy settings.\");\n }\n if (!isValidPort(proxySettings.port)) {\n throw new Error(\"Expecting a valid port number in the range of [0, 65535] in proxy settings.\");\n }\n const tunnelOptions = {\n proxy: {\n host: host,\n port: proxySettings.port,\n headers: (headers && headers.rawHeaders()) || {},\n },\n };\n if (proxySettings.username && proxySettings.password) {\n tunnelOptions.proxy.proxyAuth = `${proxySettings.username}:${proxySettings.password}`;\n }\n else if (proxySettings.username) {\n tunnelOptions.proxy.proxyAuth = `${proxySettings.username}`;\n }\n const isRequestHttps = isUrlHttps(requestUrl);\n const isProxyHttps = isUrlHttps(proxySettings.host);\n const proxyAgent = {\n isHttps: isRequestHttps,\n agent: createTunnel(isRequestHttps, isProxyHttps, tunnelOptions),\n };\n return proxyAgent;\n}\nfunction isUrlHttps(url) {\n const urlScheme = URLBuilder.parse(url).getScheme() || \"\";\n return urlScheme.toLowerCase() === \"https\";\n}\nfunction createTunnel(isRequestHttps, isProxyHttps, tunnelOptions) {\n if (isRequestHttps && isProxyHttps) {\n return tunnel__namespace.httpsOverHttps(tunnelOptions);\n }\n else if (isRequestHttps && !isProxyHttps) {\n return tunnel__namespace.httpsOverHttp(tunnelOptions);\n }\n else if (!isRequestHttps && isProxyHttps) {\n return tunnel__namespace.httpOverHttps(tunnelOptions);\n }\n else {\n return tunnel__namespace.httpOverHttp(tunnelOptions);\n }\n}\nfunction isValidPort(port) {\n // any port in 0-65535 range is valid (RFC 793) even though almost all implementations\n // will reserve 0 for a specific purpose, and a range of numbers for ephemeral ports\n return 0 <= port && port <= 65535;\n}\n\n// Copyright (c) Microsoft Corporation.\nconst RedactedString = \"REDACTED\";\nconst defaultAllowedHeaderNames = [\n \"x-ms-client-request-id\",\n \"x-ms-return-client-request-id\",\n \"x-ms-useragent\",\n \"x-ms-correlation-request-id\",\n \"x-ms-request-id\",\n \"client-request-id\",\n \"ms-cv\",\n \"return-client-request-id\",\n \"traceparent\",\n \"Access-Control-Allow-Credentials\",\n \"Access-Control-Allow-Headers\",\n \"Access-Control-Allow-Methods\",\n \"Access-Control-Allow-Origin\",\n \"Access-Control-Expose-Headers\",\n \"Access-Control-Max-Age\",\n \"Access-Control-Request-Headers\",\n \"Access-Control-Request-Method\",\n \"Origin\",\n \"Accept\",\n \"Accept-Encoding\",\n \"Cache-Control\",\n \"Connection\",\n \"Content-Length\",\n \"Content-Type\",\n \"Date\",\n \"ETag\",\n \"Expires\",\n \"If-Match\",\n \"If-Modified-Since\",\n \"If-None-Match\",\n \"If-Unmodified-Since\",\n \"Last-Modified\",\n \"Pragma\",\n \"Request-Id\",\n \"Retry-After\",\n \"Server\",\n \"Transfer-Encoding\",\n \"User-Agent\",\n \"WWW-Authenticate\",\n];\nconst defaultAllowedQueryParameters = [\"api-version\"];\nclass Sanitizer {\n constructor({ allowedHeaderNames = [], allowedQueryParameters = [] } = {}) {\n allowedHeaderNames = Array.isArray(allowedHeaderNames)\n ? defaultAllowedHeaderNames.concat(allowedHeaderNames)\n : defaultAllowedHeaderNames;\n allowedQueryParameters = Array.isArray(allowedQueryParameters)\n ? defaultAllowedQueryParameters.concat(allowedQueryParameters)\n : defaultAllowedQueryParameters;\n this.allowedHeaderNames = new Set(allowedHeaderNames.map((n) => n.toLowerCase()));\n this.allowedQueryParameters = new Set(allowedQueryParameters.map((p) => p.toLowerCase()));\n }\n sanitize(obj) {\n const seen = new Set();\n return JSON.stringify(obj, (key, value) => {\n // Ensure Errors include their interesting non-enumerable members\n if (value instanceof Error) {\n return Object.assign(Object.assign({}, value), { name: value.name, message: value.message });\n }\n if (key === \"_headersMap\") {\n return this.sanitizeHeaders(value);\n }\n else if (key === \"url\") {\n return this.sanitizeUrl(value);\n }\n else if (key === \"query\") {\n return this.sanitizeQuery(value);\n }\n else if (key === \"body\") {\n // Don't log the request body\n return undefined;\n }\n else if (key === \"response\") {\n // Don't log response again\n return undefined;\n }\n else if (key === \"operationSpec\") {\n // When using sendOperationRequest, the request carries a massive\n // field with the autorest spec. No need to log it.\n return undefined;\n }\n else if (Array.isArray(value) || isObject(value)) {\n if (seen.has(value)) {\n return \"[Circular]\";\n }\n seen.add(value);\n }\n return value;\n }, 2);\n }\n sanitizeHeaders(value) {\n return this.sanitizeObject(value, this.allowedHeaderNames, (v, k) => v[k].value);\n }\n sanitizeQuery(value) {\n return this.sanitizeObject(value, this.allowedQueryParameters, (v, k) => v[k]);\n }\n sanitizeObject(value, allowedKeys, accessor) {\n if (typeof value !== \"object\" || value === null) {\n return value;\n }\n const sanitized = {};\n for (const k of Object.keys(value)) {\n if (allowedKeys.has(k.toLowerCase())) {\n sanitized[k] = accessor(value, k);\n }\n else {\n sanitized[k] = RedactedString;\n }\n }\n return sanitized;\n }\n sanitizeUrl(value) {\n if (typeof value !== \"string\" || value === null) {\n return value;\n }\n const urlBuilder = URLBuilder.parse(value);\n const queryString = urlBuilder.getQuery();\n if (!queryString) {\n return value;\n }\n const query = URLQuery.parse(queryString);\n for (const k of query.keys()) {\n if (!this.allowedQueryParameters.has(k.toLowerCase())) {\n query.set(k, RedactedString);\n }\n }\n urlBuilder.setQuery(query.toString());\n return urlBuilder.toString();\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nconst custom = util.inspect.custom;\n\n// Copyright (c) Microsoft Corporation.\nconst errorSanitizer = new Sanitizer();\n/**\n * An error resulting from an HTTP request to a service endpoint.\n */\nclass RestError extends Error {\n constructor(message, code, statusCode, request, response) {\n super(message);\n this.name = \"RestError\";\n this.code = code;\n this.statusCode = statusCode;\n this.request = request;\n this.response = response;\n Object.setPrototypeOf(this, RestError.prototype);\n }\n /**\n * Logging method for util.inspect in Node\n */\n [custom]() {\n return `RestError: ${this.message} \\n ${errorSanitizer.sanitize(this)}`;\n }\n}\n/**\n * A constant string to identify errors that may arise when making an HTTP request that indicates an issue with the transport layer (e.g. the hostname of the URL cannot be resolved via DNS.)\n */\nRestError.REQUEST_SEND_ERROR = \"REQUEST_SEND_ERROR\";\n/**\n * A constant string to identify errors that may arise from parsing an incoming HTTP response. Usually indicates a malformed HTTP body, such as an encoded JSON payload that is incomplete.\n */\nRestError.PARSE_ERROR = \"PARSE_ERROR\";\n\n// Copyright (c) Microsoft Corporation.\nconst logger = logger$1.createClientLogger(\"core-http\");\n\n// Copyright (c) Microsoft Corporation.\nfunction getCachedAgent(isHttps, agentCache) {\n return isHttps ? agentCache.httpsAgent : agentCache.httpAgent;\n}\nclass ReportTransform extends stream.Transform {\n constructor(progressCallback) {\n super();\n this.progressCallback = progressCallback;\n this.loadedBytes = 0;\n }\n _transform(chunk, _encoding, callback) {\n this.push(chunk);\n this.loadedBytes += chunk.length;\n this.progressCallback({ loadedBytes: this.loadedBytes });\n callback(undefined);\n }\n}\nfunction isReadableStream(body) {\n return body && typeof body.pipe === \"function\";\n}\nfunction isStreamComplete(stream, aborter) {\n return new Promise((resolve) => {\n stream.once(\"close\", () => {\n aborter === null || aborter === void 0 ? void 0 : aborter.abort();\n resolve();\n });\n stream.once(\"end\", resolve);\n stream.once(\"error\", resolve);\n });\n}\n/**\n * Transforms a set of headers into the key/value pair defined by {@link HttpHeadersLike}\n */\nfunction parseHeaders(headers) {\n const httpHeaders = new HttpHeaders();\n headers.forEach((value, key) => {\n httpHeaders.set(key, value);\n });\n return httpHeaders;\n}\n/**\n * An HTTP client that uses `node-fetch`.\n */\nclass NodeFetchHttpClient {\n constructor() {\n // a mapping of proxy settings string `${host}:${port}:${username}:${password}` to agent\n this.proxyAgentMap = new Map();\n this.keepAliveAgents = {};\n }\n /**\n * Provides minimum viable error handling and the logic that executes the abstract methods.\n * @param httpRequest - Object representing the outgoing HTTP request.\n * @returns An object representing the incoming HTTP response.\n */\n async sendRequest(httpRequest) {\n var _a;\n if (!httpRequest && typeof httpRequest !== \"object\") {\n throw new Error(\"'httpRequest' (WebResourceLike) cannot be null or undefined and must be of type object.\");\n }\n const abortController$1 = new abortController.AbortController();\n let abortListener;\n if (httpRequest.abortSignal) {\n if (httpRequest.abortSignal.aborted) {\n throw new abortController.AbortError(\"The operation was aborted.\");\n }\n abortListener = (event) => {\n if (event.type === \"abort\") {\n abortController$1.abort();\n }\n };\n httpRequest.abortSignal.addEventListener(\"abort\", abortListener);\n }\n if (httpRequest.timeout) {\n setTimeout(() => {\n abortController$1.abort();\n }, httpRequest.timeout);\n }\n if (httpRequest.formData) {\n const formData = httpRequest.formData;\n const requestForm = new FormData__default[\"default\"]();\n const appendFormValue = (key, value) => {\n // value function probably returns a stream so we can provide a fresh stream on each retry\n if (typeof value === \"function\") {\n value = value();\n }\n if (value &&\n Object.prototype.hasOwnProperty.call(value, \"value\") &&\n Object.prototype.hasOwnProperty.call(value, \"options\")) {\n requestForm.append(key, value.value, value.options);\n }\n else {\n requestForm.append(key, value);\n }\n };\n for (const formKey of Object.keys(formData)) {\n const formValue = formData[formKey];\n if (Array.isArray(formValue)) {\n for (let j = 0; j < formValue.length; j++) {\n appendFormValue(formKey, formValue[j]);\n }\n }\n else {\n appendFormValue(formKey, formValue);\n }\n }\n httpRequest.body = requestForm;\n httpRequest.formData = undefined;\n const contentType = httpRequest.headers.get(\"Content-Type\");\n if (contentType && contentType.indexOf(\"multipart/form-data\") !== -1) {\n if (typeof requestForm.getBoundary === \"function\") {\n httpRequest.headers.set(\"Content-Type\", `multipart/form-data; boundary=${requestForm.getBoundary()}`);\n }\n else {\n // browser will automatically apply a suitable content-type header\n httpRequest.headers.remove(\"Content-Type\");\n }\n }\n }\n let body = httpRequest.body\n ? typeof httpRequest.body === \"function\"\n ? httpRequest.body()\n : httpRequest.body\n : undefined;\n if (httpRequest.onUploadProgress && httpRequest.body) {\n const onUploadProgress = httpRequest.onUploadProgress;\n const uploadReportStream = new ReportTransform(onUploadProgress);\n if (isReadableStream(body)) {\n body.pipe(uploadReportStream);\n }\n else {\n uploadReportStream.end(body);\n }\n body = uploadReportStream;\n }\n const platformSpecificRequestInit = await this.prepareRequest(httpRequest);\n const requestInit = Object.assign({ body: body, headers: httpRequest.headers.rawHeaders(), method: httpRequest.method, \n // the types for RequestInit are from the browser, which expects AbortSignal to\n // have `reason` and `throwIfAborted`, but these don't exist on our polyfill\n // for Node.\n signal: abortController$1.signal, redirect: \"manual\" }, platformSpecificRequestInit);\n let operationResponse;\n try {\n const response = await this.fetch(httpRequest.url, requestInit);\n const headers = parseHeaders(response.headers);\n const streaming = ((_a = httpRequest.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(response.status)) ||\n httpRequest.streamResponseBody;\n operationResponse = {\n headers: headers,\n request: httpRequest,\n status: response.status,\n readableStreamBody: streaming\n ? response.body\n : undefined,\n bodyAsText: !streaming ? await response.text() : undefined,\n };\n const onDownloadProgress = httpRequest.onDownloadProgress;\n if (onDownloadProgress) {\n const responseBody = response.body || undefined;\n if (isReadableStream(responseBody)) {\n const downloadReportStream = new ReportTransform(onDownloadProgress);\n responseBody.pipe(downloadReportStream);\n operationResponse.readableStreamBody = downloadReportStream;\n }\n else {\n const length = parseInt(headers.get(\"Content-Length\")) || undefined;\n if (length) {\n // Calling callback for non-stream response for consistency with browser\n onDownloadProgress({ loadedBytes: length });\n }\n }\n }\n await this.processRequest(operationResponse);\n return operationResponse;\n }\n catch (error) {\n const fetchError = error;\n if (fetchError.code === \"ENOTFOUND\") {\n throw new RestError(fetchError.message, RestError.REQUEST_SEND_ERROR, undefined, httpRequest);\n }\n else if (fetchError.type === \"aborted\") {\n throw new abortController.AbortError(\"The operation was aborted.\");\n }\n throw fetchError;\n }\n finally {\n // clean up event listener\n if (httpRequest.abortSignal && abortListener) {\n let uploadStreamDone = Promise.resolve();\n if (isReadableStream(body)) {\n uploadStreamDone = isStreamComplete(body);\n }\n let downloadStreamDone = Promise.resolve();\n if (isReadableStream(operationResponse === null || operationResponse === void 0 ? void 0 : operationResponse.readableStreamBody)) {\n downloadStreamDone = isStreamComplete(operationResponse.readableStreamBody, abortController$1);\n }\n Promise.all([uploadStreamDone, downloadStreamDone])\n .then(() => {\n var _a;\n (_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.removeEventListener(\"abort\", abortListener);\n return;\n })\n .catch((e) => {\n logger.warning(\"Error when cleaning up abortListener on httpRequest\", e);\n });\n }\n }\n }\n getOrCreateAgent(httpRequest) {\n var _a;\n const isHttps = isUrlHttps(httpRequest.url);\n // At the moment, proxy settings and keepAlive are mutually\n // exclusive because the 'tunnel' library currently lacks the\n // ability to create a proxy with keepAlive turned on.\n if (httpRequest.proxySettings) {\n const { host, port, username, password } = httpRequest.proxySettings;\n const key = `${host}:${port}:${username}:${password}`;\n const proxyAgents = (_a = this.proxyAgentMap.get(key)) !== null && _a !== void 0 ? _a : {};\n let agent = getCachedAgent(isHttps, proxyAgents);\n if (agent) {\n return agent;\n }\n const tunnel = createProxyAgent(httpRequest.url, httpRequest.proxySettings, httpRequest.headers);\n agent = tunnel.agent;\n if (tunnel.isHttps) {\n proxyAgents.httpsAgent = tunnel.agent;\n }\n else {\n proxyAgents.httpAgent = tunnel.agent;\n }\n this.proxyAgentMap.set(key, proxyAgents);\n return agent;\n }\n else if (httpRequest.keepAlive) {\n let agent = getCachedAgent(isHttps, this.keepAliveAgents);\n if (agent) {\n return agent;\n }\n const agentOptions = {\n keepAlive: httpRequest.keepAlive,\n };\n if (isHttps) {\n agent = this.keepAliveAgents.httpsAgent = new https__namespace.Agent(agentOptions);\n }\n else {\n agent = this.keepAliveAgents.httpAgent = new http__namespace.Agent(agentOptions);\n }\n return agent;\n }\n else {\n return isHttps ? https__namespace.globalAgent : http__namespace.globalAgent;\n }\n }\n /**\n * Uses `node-fetch` to perform the request.\n */\n // eslint-disable-next-line @azure/azure-sdk/ts-apisurface-standardized-verbs\n async fetch(input, init) {\n return node_fetch__default[\"default\"](input, init);\n }\n /**\n * Prepares a request based on the provided web resource.\n */\n async prepareRequest(httpRequest) {\n const requestInit = {};\n // Set the http(s) agent\n requestInit.agent = this.getOrCreateAgent(httpRequest);\n requestInit.compress = httpRequest.decompressResponse;\n return requestInit;\n }\n /**\n * Process an HTTP response.\n */\n async processRequest(_operationResponse) {\n /* no_op */\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * The different levels of logs that can be used with the HttpPipelineLogger.\n */\nexports.HttpPipelineLogLevel = void 0;\n(function (HttpPipelineLogLevel) {\n /**\n * A log level that indicates that no logs will be logged.\n */\n HttpPipelineLogLevel[HttpPipelineLogLevel[\"OFF\"] = 0] = \"OFF\";\n /**\n * An error log.\n */\n HttpPipelineLogLevel[HttpPipelineLogLevel[\"ERROR\"] = 1] = \"ERROR\";\n /**\n * A warning log.\n */\n HttpPipelineLogLevel[HttpPipelineLogLevel[\"WARNING\"] = 2] = \"WARNING\";\n /**\n * An information log.\n */\n HttpPipelineLogLevel[HttpPipelineLogLevel[\"INFO\"] = 3] = \"INFO\";\n})(exports.HttpPipelineLogLevel || (exports.HttpPipelineLogLevel = {}));\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Converts an OperationOptions to a RequestOptionsBase\n *\n * @param opts - OperationOptions object to convert to RequestOptionsBase\n */\nfunction operationOptionsToRequestOptionsBase(opts) {\n const { requestOptions, tracingOptions } = opts, additionalOptions = tslib.__rest(opts, [\"requestOptions\", \"tracingOptions\"]);\n let result = additionalOptions;\n if (requestOptions) {\n result = Object.assign(Object.assign({}, result), requestOptions);\n }\n if (tracingOptions) {\n result.tracingContext = tracingOptions.tracingContext;\n // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.\n result.spanOptions = tracingOptions === null || tracingOptions === void 0 ? void 0 : tracingOptions.spanOptions;\n }\n return result;\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * The base class from which all request policies derive.\n */\nclass BaseRequestPolicy {\n /**\n * The main method to implement that manipulates a request/response.\n */\n constructor(\n /**\n * The next policy in the pipeline. Each policy is responsible for executing the next one if the request is to continue through the pipeline.\n */\n _nextPolicy, \n /**\n * The options that can be passed to a given request policy.\n */\n _options) {\n this._nextPolicy = _nextPolicy;\n this._options = _options;\n }\n /**\n * Get whether or not a log with the provided log level should be logged.\n * @param logLevel - The log level of the log that will be logged.\n * @returns Whether or not a log with the provided log level should be logged.\n */\n shouldLog(logLevel) {\n return this._options.shouldLog(logLevel);\n }\n /**\n * Attempt to log the provided message to the provided logger. If no logger was provided or if\n * the log level does not meat the logger's threshold, then nothing will be logged.\n * @param logLevel - The log level of this log.\n * @param message - The message of this log.\n */\n log(logLevel, message) {\n this._options.log(logLevel, message);\n }\n}\n/**\n * Optional properties that can be used when creating a RequestPolicy.\n */\nclass RequestPolicyOptions {\n constructor(_logger) {\n this._logger = _logger;\n }\n /**\n * Get whether or not a log with the provided log level should be logged.\n * @param logLevel - The log level of the log that will be logged.\n * @returns Whether or not a log with the provided log level should be logged.\n */\n shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }\n /**\n * Attempt to log the provided message to the provided logger. If no logger was provided or if\n * the log level does not meet the logger's threshold, then nothing will be logged.\n * @param logLevel - The log level of this log.\n * @param message - The message of this log.\n */\n log(logLevel, message) {\n if (this._logger && this.shouldLog(logLevel)) {\n this._logger.log(logLevel, message);\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Note: The reason we re-define all of the xml2js default settings (version 2.0) here is because the default settings object exposed\n// by the xm2js library is mutable. See https://github.com/Leonidas-from-XIV/node-xml2js/issues/536\n// By creating a new copy of the settings each time we instantiate the parser,\n// we are safeguarding against the possibility of the default settings being mutated elsewhere unintentionally.\nconst xml2jsDefaultOptionsV2 = {\n explicitCharkey: false,\n trim: false,\n normalize: false,\n normalizeTags: false,\n attrkey: XML_ATTRKEY,\n explicitArray: true,\n ignoreAttrs: false,\n mergeAttrs: false,\n explicitRoot: true,\n validator: undefined,\n xmlns: false,\n explicitChildren: false,\n preserveChildrenOrder: false,\n childkey: \"$$\",\n charsAsChildren: false,\n includeWhiteChars: false,\n async: false,\n strict: true,\n attrNameProcessors: undefined,\n attrValueProcessors: undefined,\n tagNameProcessors: undefined,\n valueProcessors: undefined,\n rootName: \"root\",\n xmldec: {\n version: \"1.0\",\n encoding: \"UTF-8\",\n standalone: true,\n },\n doctype: undefined,\n renderOpts: {\n pretty: true,\n indent: \" \",\n newline: \"\\n\",\n },\n headless: false,\n chunkSize: 10000,\n emptyTag: \"\",\n cdata: false,\n};\n// The xml2js settings for general XML parsing operations.\nconst xml2jsParserSettings = Object.assign({}, xml2jsDefaultOptionsV2);\nxml2jsParserSettings.explicitArray = false;\n// The xml2js settings for general XML building operations.\nconst xml2jsBuilderSettings = Object.assign({}, xml2jsDefaultOptionsV2);\nxml2jsBuilderSettings.explicitArray = false;\nxml2jsBuilderSettings.renderOpts = {\n pretty: false,\n};\n/**\n * Converts given JSON object to XML string\n * @param obj - JSON object to be converted into XML string\n * @param opts - Options that govern the parsing of given JSON object\n */\nfunction stringifyXML(obj, opts = {}) {\n var _a;\n xml2jsBuilderSettings.rootName = opts.rootName;\n xml2jsBuilderSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;\n const builder = new xml2js__namespace.Builder(xml2jsBuilderSettings);\n return builder.buildObject(obj);\n}\n/**\n * Converts given XML string into JSON\n * @param str - String containing the XML content to be parsed into JSON\n * @param opts - Options that govern the parsing of given xml string\n */\nfunction parseXML(str, opts = {}) {\n var _a;\n xml2jsParserSettings.explicitRoot = !!opts.includeRoot;\n xml2jsParserSettings.charkey = (_a = opts.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;\n const xmlParser = new xml2js__namespace.Parser(xml2jsParserSettings);\n return new Promise((resolve, reject) => {\n if (!str) {\n reject(new Error(\"Document is empty\"));\n }\n else {\n xmlParser.parseString(str, (err, res) => {\n if (err) {\n reject(err);\n }\n else {\n resolve(res);\n }\n });\n }\n });\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Create a new serialization RequestPolicyCreator that will serialized HTTP request bodies as they\n * pass through the HTTP pipeline.\n */\nfunction deserializationPolicy(deserializationContentTypes, parsingOptions) {\n return {\n create: (nextPolicy, options) => {\n return new DeserializationPolicy(nextPolicy, options, deserializationContentTypes, parsingOptions);\n },\n };\n}\nconst defaultJsonContentTypes = [\"application/json\", \"text/json\"];\nconst defaultXmlContentTypes = [\"application/xml\", \"application/atom+xml\"];\nconst DefaultDeserializationOptions = {\n expectedContentTypes: {\n json: defaultJsonContentTypes,\n xml: defaultXmlContentTypes,\n },\n};\n/**\n * A RequestPolicy that will deserialize HTTP response bodies and headers as they pass through the\n * HTTP pipeline.\n */\nclass DeserializationPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, requestPolicyOptions, deserializationContentTypes, parsingOptions = {}) {\n var _a;\n super(nextPolicy, requestPolicyOptions);\n this.jsonContentTypes =\n (deserializationContentTypes && deserializationContentTypes.json) || defaultJsonContentTypes;\n this.xmlContentTypes =\n (deserializationContentTypes && deserializationContentTypes.xml) || defaultXmlContentTypes;\n this.xmlCharKey = (_a = parsingOptions.xmlCharKey) !== null && _a !== void 0 ? _a : XML_CHARKEY;\n }\n async sendRequest(request) {\n return this._nextPolicy.sendRequest(request).then((response) => deserializeResponseBody(this.jsonContentTypes, this.xmlContentTypes, response, {\n xmlCharKey: this.xmlCharKey,\n }));\n }\n}\nfunction getOperationResponse(parsedResponse) {\n let result;\n const request = parsedResponse.request;\n const operationSpec = request.operationSpec;\n if (operationSpec) {\n const operationResponseGetter = request.operationResponseGetter;\n if (!operationResponseGetter) {\n result = operationSpec.responses[parsedResponse.status];\n }\n else {\n result = operationResponseGetter(operationSpec, parsedResponse);\n }\n }\n return result;\n}\nfunction shouldDeserializeResponse(parsedResponse) {\n const shouldDeserialize = parsedResponse.request.shouldDeserialize;\n let result;\n if (shouldDeserialize === undefined) {\n result = true;\n }\n else if (typeof shouldDeserialize === \"boolean\") {\n result = shouldDeserialize;\n }\n else {\n result = shouldDeserialize(parsedResponse);\n }\n return result;\n}\n/**\n * Given a particular set of content types to parse as either JSON or XML, consumes the HTTP response to produce the result object defined by the request's {@link OperationSpec}.\n * @param jsonContentTypes - Response content types to parse the body as JSON.\n * @param xmlContentTypes - Response content types to parse the body as XML.\n * @param response - HTTP Response from the pipeline.\n * @param options - Options to the serializer, mostly for configuring the XML parser if needed.\n * @returns A parsed {@link HttpOperationResponse} object that can be returned by the {@link ServiceClient}.\n */\nfunction deserializeResponseBody(jsonContentTypes, xmlContentTypes, response, options = {}) {\n var _a, _b, _c;\n const updatedOptions = {\n rootName: (_a = options.rootName) !== null && _a !== void 0 ? _a : \"\",\n includeRoot: (_b = options.includeRoot) !== null && _b !== void 0 ? _b : false,\n xmlCharKey: (_c = options.xmlCharKey) !== null && _c !== void 0 ? _c : XML_CHARKEY,\n };\n return parse(jsonContentTypes, xmlContentTypes, response, updatedOptions).then((parsedResponse) => {\n if (!shouldDeserializeResponse(parsedResponse)) {\n return parsedResponse;\n }\n const operationSpec = parsedResponse.request.operationSpec;\n if (!operationSpec || !operationSpec.responses) {\n return parsedResponse;\n }\n const responseSpec = getOperationResponse(parsedResponse);\n const { error, shouldReturnResponse } = handleErrorResponse(parsedResponse, operationSpec, responseSpec);\n if (error) {\n throw error;\n }\n else if (shouldReturnResponse) {\n return parsedResponse;\n }\n // An operation response spec does exist for current status code, so\n // use it to deserialize the response.\n if (responseSpec) {\n if (responseSpec.bodyMapper) {\n let valueToDeserialize = parsedResponse.parsedBody;\n if (operationSpec.isXML && responseSpec.bodyMapper.type.name === MapperType.Sequence) {\n valueToDeserialize =\n typeof valueToDeserialize === \"object\"\n ? valueToDeserialize[responseSpec.bodyMapper.xmlElementName]\n : [];\n }\n try {\n parsedResponse.parsedBody = operationSpec.serializer.deserialize(responseSpec.bodyMapper, valueToDeserialize, \"operationRes.parsedBody\", options);\n }\n catch (innerError) {\n const restError = new RestError(`Error ${innerError} occurred in deserializing the responseBody - ${parsedResponse.bodyAsText}`, undefined, parsedResponse.status, parsedResponse.request, parsedResponse);\n throw restError;\n }\n }\n else if (operationSpec.httpMethod === \"HEAD\") {\n // head methods never have a body, but we return a boolean to indicate presence/absence of the resource\n parsedResponse.parsedBody = response.status >= 200 && response.status < 300;\n }\n if (responseSpec.headersMapper) {\n parsedResponse.parsedHeaders = operationSpec.serializer.deserialize(responseSpec.headersMapper, parsedResponse.headers.toJson(), \"operationRes.parsedHeaders\", options);\n }\n }\n return parsedResponse;\n });\n}\nfunction isOperationSpecEmpty(operationSpec) {\n const expectedStatusCodes = Object.keys(operationSpec.responses);\n return (expectedStatusCodes.length === 0 ||\n (expectedStatusCodes.length === 1 && expectedStatusCodes[0] === \"default\"));\n}\nfunction handleErrorResponse(parsedResponse, operationSpec, responseSpec) {\n var _a;\n const isSuccessByStatus = 200 <= parsedResponse.status && parsedResponse.status < 300;\n const isExpectedStatusCode = isOperationSpecEmpty(operationSpec)\n ? isSuccessByStatus\n : !!responseSpec;\n if (isExpectedStatusCode) {\n if (responseSpec) {\n if (!responseSpec.isError) {\n return { error: null, shouldReturnResponse: false };\n }\n }\n else {\n return { error: null, shouldReturnResponse: false };\n }\n }\n const errorResponseSpec = responseSpec !== null && responseSpec !== void 0 ? responseSpec : operationSpec.responses.default;\n const streaming = ((_a = parsedResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(parsedResponse.status)) ||\n parsedResponse.request.streamResponseBody;\n const initialErrorMessage = streaming\n ? `Unexpected status code: ${parsedResponse.status}`\n : parsedResponse.bodyAsText;\n const error = new RestError(initialErrorMessage, undefined, parsedResponse.status, parsedResponse.request, parsedResponse);\n // If the item failed but there's no error spec or default spec to deserialize the error,\n // we should fail so we just throw the parsed response\n if (!errorResponseSpec) {\n throw error;\n }\n const defaultBodyMapper = errorResponseSpec.bodyMapper;\n const defaultHeadersMapper = errorResponseSpec.headersMapper;\n try {\n // If error response has a body, try to deserialize it using default body mapper.\n // Then try to extract error code & message from it\n if (parsedResponse.parsedBody) {\n const parsedBody = parsedResponse.parsedBody;\n let parsedError;\n if (defaultBodyMapper) {\n let valueToDeserialize = parsedBody;\n if (operationSpec.isXML && defaultBodyMapper.type.name === MapperType.Sequence) {\n valueToDeserialize =\n typeof parsedBody === \"object\" ? parsedBody[defaultBodyMapper.xmlElementName] : [];\n }\n parsedError = operationSpec.serializer.deserialize(defaultBodyMapper, valueToDeserialize, \"error.response.parsedBody\");\n }\n const internalError = parsedBody.error || parsedError || parsedBody;\n error.code = internalError.code;\n if (internalError.message) {\n error.message = internalError.message;\n }\n if (defaultBodyMapper) {\n error.response.parsedBody = parsedError;\n }\n }\n // If error response has headers, try to deserialize it using default header mapper\n if (parsedResponse.headers && defaultHeadersMapper) {\n error.response.parsedHeaders = operationSpec.serializer.deserialize(defaultHeadersMapper, parsedResponse.headers.toJson(), \"operationRes.parsedHeaders\");\n }\n }\n catch (defaultError) {\n error.message = `Error \"${defaultError.message}\" occurred in deserializing the responseBody - \"${parsedResponse.bodyAsText}\" for the default response.`;\n }\n return { error, shouldReturnResponse: false };\n}\nfunction parse(jsonContentTypes, xmlContentTypes, operationResponse, opts) {\n var _a;\n const errorHandler = (err) => {\n const msg = `Error \"${err}\" occurred while parsing the response body - ${operationResponse.bodyAsText}.`;\n const errCode = err.code || RestError.PARSE_ERROR;\n const e = new RestError(msg, errCode, operationResponse.status, operationResponse.request, operationResponse);\n return Promise.reject(e);\n };\n const streaming = ((_a = operationResponse.request.streamResponseStatusCodes) === null || _a === void 0 ? void 0 : _a.has(operationResponse.status)) ||\n operationResponse.request.streamResponseBody;\n if (!streaming && operationResponse.bodyAsText) {\n const text = operationResponse.bodyAsText;\n const contentType = operationResponse.headers.get(\"Content-Type\") || \"\";\n const contentComponents = !contentType\n ? []\n : contentType.split(\";\").map((component) => component.toLowerCase());\n if (contentComponents.length === 0 ||\n contentComponents.some((component) => jsonContentTypes.indexOf(component) !== -1)) {\n return new Promise((resolve) => {\n operationResponse.parsedBody = JSON.parse(text);\n resolve(operationResponse);\n }).catch(errorHandler);\n }\n else if (contentComponents.some((component) => xmlContentTypes.indexOf(component) !== -1)) {\n return parseXML(text, opts)\n .then((body) => {\n operationResponse.parsedBody = body;\n return operationResponse;\n })\n .catch(errorHandler);\n }\n }\n return Promise.resolve(operationResponse);\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * By default, HTTP connections are maintained for future requests.\n */\nconst DefaultKeepAliveOptions = {\n enable: true,\n};\n/**\n * Creates a policy that controls whether HTTP connections are maintained on future requests.\n * @param keepAliveOptions - Keep alive options. By default, HTTP connections are maintained for future requests.\n * @returns An instance of the {@link KeepAlivePolicy}\n */\nfunction keepAlivePolicy(keepAliveOptions) {\n return {\n create: (nextPolicy, options) => {\n return new KeepAlivePolicy(nextPolicy, options, keepAliveOptions || DefaultKeepAliveOptions);\n },\n };\n}\n/**\n * KeepAlivePolicy is a policy used to control keep alive settings for every request.\n */\nclass KeepAlivePolicy extends BaseRequestPolicy {\n /**\n * Creates an instance of KeepAlivePolicy.\n *\n * @param nextPolicy -\n * @param options -\n * @param keepAliveOptions -\n */\n constructor(nextPolicy, options, keepAliveOptions) {\n super(nextPolicy, options);\n this.keepAliveOptions = keepAliveOptions;\n }\n /**\n * Sends out request.\n *\n * @param request -\n * @returns\n */\n async sendRequest(request) {\n request.keepAlive = this.keepAliveOptions.enable;\n return this._nextPolicy.sendRequest(request);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Methods that are allowed to follow redirects 301 and 302\n */\nconst allowedRedirect = [\"GET\", \"HEAD\"];\nconst DefaultRedirectOptions = {\n handleRedirects: true,\n maxRetries: 20,\n};\n/**\n * Creates a redirect policy, which sends a repeats the request to a new destination if a response arrives with a \"location\" header, and a status code between 300 and 307.\n * @param maximumRetries - Maximum number of redirects to follow.\n * @returns An instance of the {@link RedirectPolicy}\n */\nfunction redirectPolicy(maximumRetries = 20) {\n return {\n create: (nextPolicy, options) => {\n return new RedirectPolicy(nextPolicy, options, maximumRetries);\n },\n };\n}\n/**\n * Resends the request to a new destination if a response arrives with a \"location\" header, and a status code between 300 and 307.\n */\nclass RedirectPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, maxRetries = 20) {\n super(nextPolicy, options);\n this.maxRetries = maxRetries;\n }\n sendRequest(request) {\n return this._nextPolicy\n .sendRequest(request)\n .then((response) => handleRedirect(this, response, 0));\n }\n}\nfunction handleRedirect(policy, response, currentRetries) {\n const { request, status } = response;\n const locationHeader = response.headers.get(\"location\");\n if (locationHeader &&\n (status === 300 ||\n (status === 301 && allowedRedirect.includes(request.method)) ||\n (status === 302 && allowedRedirect.includes(request.method)) ||\n (status === 303 && request.method === \"POST\") ||\n status === 307) &&\n (!policy.maxRetries || currentRetries < policy.maxRetries)) {\n const builder = URLBuilder.parse(request.url);\n builder.setPath(locationHeader);\n request.url = builder.toString();\n // POST request with Status code 303 should be converted into a\n // redirected GET request if the redirect url is present in the location header\n if (status === 303) {\n request.method = \"GET\";\n delete request.body;\n }\n return policy._nextPolicy\n .sendRequest(request)\n .then((res) => handleRedirect(policy, res, currentRetries + 1));\n }\n return Promise.resolve(response);\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nconst DEFAULT_CLIENT_RETRY_COUNT = 3;\n// intervals are in ms\nconst DEFAULT_CLIENT_RETRY_INTERVAL = 1000 * 30;\nconst DEFAULT_CLIENT_MAX_RETRY_INTERVAL = 1000 * 90;\nconst DEFAULT_CLIENT_MIN_RETRY_INTERVAL = 1000 * 3;\nfunction isNumber(n) {\n return typeof n === \"number\";\n}\n/**\n * @internal\n * Determines if the operation should be retried.\n *\n * @param retryLimit - Specifies the max number of retries.\n * @param predicate - Initial chekck on whether to retry based on given responses or errors\n * @param retryData - The retry data.\n * @returns True if the operation qualifies for a retry; false otherwise.\n */\nfunction shouldRetry(retryLimit, predicate, retryData, response, error) {\n if (!predicate(response, error)) {\n return false;\n }\n return retryData.retryCount < retryLimit;\n}\n/**\n * @internal\n * Updates the retry data for the next attempt.\n *\n * @param retryOptions - specifies retry interval, and its lower bound and upper bound.\n * @param retryData - The retry data.\n * @param err - The operation\"s error, if any.\n */\nfunction updateRetryData(retryOptions, retryData = { retryCount: 0, retryInterval: 0 }, err) {\n if (err) {\n if (retryData.error) {\n err.innerError = retryData.error;\n }\n retryData.error = err;\n }\n // Adjust retry count\n retryData.retryCount++;\n // Adjust retry interval\n let incrementDelta = Math.pow(2, retryData.retryCount - 1) - 1;\n const boundedRandDelta = retryOptions.retryInterval * 0.8 +\n Math.floor(Math.random() * (retryOptions.retryInterval * 0.4));\n incrementDelta *= boundedRandDelta;\n retryData.retryInterval = Math.min(retryOptions.minRetryInterval + incrementDelta, retryOptions.maxRetryInterval);\n return retryData;\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Policy that retries the request as many times as configured for as long as the max retry time interval specified, each retry waiting longer to begin than the last time.\n * @param retryCount - Maximum number of retries.\n * @param retryInterval - Base time between retries.\n * @param maxRetryInterval - Maximum time to wait between retries.\n */\nfunction exponentialRetryPolicy(retryCount, retryInterval, maxRetryInterval) {\n return {\n create: (nextPolicy, options) => {\n return new ExponentialRetryPolicy(nextPolicy, options, retryCount, retryInterval, maxRetryInterval);\n },\n };\n}\n/**\n * Describes the Retry Mode type. Currently supporting only Exponential.\n */\nexports.RetryMode = void 0;\n(function (RetryMode) {\n /**\n * Currently supported retry mode.\n * Each time a retry happens, it will take exponentially more time than the last time.\n */\n RetryMode[RetryMode[\"Exponential\"] = 0] = \"Exponential\";\n})(exports.RetryMode || (exports.RetryMode = {}));\nconst DefaultRetryOptions = {\n maxRetries: DEFAULT_CLIENT_RETRY_COUNT,\n retryDelayInMs: DEFAULT_CLIENT_RETRY_INTERVAL,\n maxRetryDelayInMs: DEFAULT_CLIENT_MAX_RETRY_INTERVAL,\n};\n/**\n * Instantiates a new \"ExponentialRetryPolicyFilter\" instance.\n */\nclass ExponentialRetryPolicy extends BaseRequestPolicy {\n /**\n * @param nextPolicy - The next RequestPolicy in the pipeline chain.\n * @param options - The options for this RequestPolicy.\n * @param retryCount - The client retry count.\n * @param retryInterval - The client retry interval, in milliseconds.\n * @param minRetryInterval - The minimum retry interval, in milliseconds.\n * @param maxRetryInterval - The maximum retry interval, in milliseconds.\n */\n constructor(nextPolicy, options, retryCount, retryInterval, maxRetryInterval) {\n super(nextPolicy, options);\n this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT;\n this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL;\n this.maxRetryInterval = isNumber(maxRetryInterval)\n ? maxRetryInterval\n : DEFAULT_CLIENT_MAX_RETRY_INTERVAL;\n }\n sendRequest(request) {\n return this._nextPolicy\n .sendRequest(request.clone())\n .then((response) => retry$1(this, request, response))\n .catch((error) => retry$1(this, request, error.response, undefined, error));\n }\n}\nasync function retry$1(policy, request, response, retryData, requestError) {\n function shouldPolicyRetry(responseParam) {\n const statusCode = responseParam === null || responseParam === void 0 ? void 0 : responseParam.status;\n if (statusCode === 503 && (response === null || response === void 0 ? void 0 : response.headers.get(Constants.HeaderConstants.RETRY_AFTER))) {\n return false;\n }\n if (statusCode === undefined ||\n (statusCode < 500 && statusCode !== 408) ||\n statusCode === 501 ||\n statusCode === 505) {\n return false;\n }\n return true;\n }\n retryData = updateRetryData({\n retryInterval: policy.retryInterval,\n minRetryInterval: 0,\n maxRetryInterval: policy.maxRetryInterval,\n }, retryData, requestError);\n const isAborted = request.abortSignal && request.abortSignal.aborted;\n if (!isAborted && shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, response)) {\n logger.info(`Retrying request in ${retryData.retryInterval}`);\n try {\n await coreUtil.delay(retryData.retryInterval);\n const res = await policy._nextPolicy.sendRequest(request.clone());\n return retry$1(policy, request, res, retryData);\n }\n catch (err) {\n return retry$1(policy, request, response, retryData, err);\n }\n }\n else if (isAborted || requestError || !response) {\n // If the operation failed in the end, return all errors instead of just the last one\n const err = retryData.error ||\n new RestError(\"Failed to send the request.\", RestError.REQUEST_SEND_ERROR, response && response.status, response && response.request, response);\n throw err;\n }\n else {\n return response;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Creates a policy that logs information about the outgoing request and the incoming responses.\n * @param loggingOptions - Logging options.\n * @returns An instance of the {@link LogPolicy}\n */\nfunction logPolicy(loggingOptions = {}) {\n return {\n create: (nextPolicy, options) => {\n return new LogPolicy(nextPolicy, options, loggingOptions);\n },\n };\n}\n/**\n * A policy that logs information about the outgoing request and the incoming responses.\n */\nclass LogPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, { logger: logger$1 = logger.info, allowedHeaderNames = [], allowedQueryParameters = [], } = {}) {\n super(nextPolicy, options);\n this.logger = logger$1;\n this.sanitizer = new Sanitizer({ allowedHeaderNames, allowedQueryParameters });\n }\n /**\n * Header names whose values will be logged when logging is enabled. Defaults to\n * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers\n * specified in this field will be added to that list. Any other values will\n * be written to logs as \"REDACTED\".\n * @deprecated Pass these into the constructor instead.\n */\n get allowedHeaderNames() {\n return this.sanitizer.allowedHeaderNames;\n }\n /**\n * Header names whose values will be logged when logging is enabled. Defaults to\n * Date, traceparent, x-ms-client-request-id, and x-ms-request id. Any headers\n * specified in this field will be added to that list. Any other values will\n * be written to logs as \"REDACTED\".\n * @deprecated Pass these into the constructor instead.\n */\n set allowedHeaderNames(allowedHeaderNames) {\n this.sanitizer.allowedHeaderNames = allowedHeaderNames;\n }\n /**\n * Query string names whose values will be logged when logging is enabled. By default no\n * query string values are logged.\n * @deprecated Pass these into the constructor instead.\n */\n get allowedQueryParameters() {\n return this.sanitizer.allowedQueryParameters;\n }\n /**\n * Query string names whose values will be logged when logging is enabled. By default no\n * query string values are logged.\n * @deprecated Pass these into the constructor instead.\n */\n set allowedQueryParameters(allowedQueryParameters) {\n this.sanitizer.allowedQueryParameters = allowedQueryParameters;\n }\n sendRequest(request) {\n if (!this.logger.enabled)\n return this._nextPolicy.sendRequest(request);\n this.logRequest(request);\n return this._nextPolicy.sendRequest(request).then((response) => this.logResponse(response));\n }\n logRequest(request) {\n this.logger(`Request: ${this.sanitizer.sanitize(request)}`);\n }\n logResponse(response) {\n this.logger(`Response status code: ${response.status}`);\n this.logger(`Headers: ${this.sanitizer.sanitize(response.headers)}`);\n return response;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Get the path to this parameter's value as a dotted string (a.b.c).\n * @param parameter - The parameter to get the path string for.\n * @returns The path to this parameter's value as a dotted string.\n */\nfunction getPathStringFromParameter(parameter) {\n return getPathStringFromParameterPath(parameter.parameterPath, parameter.mapper);\n}\nfunction getPathStringFromParameterPath(parameterPath, mapper) {\n let result;\n if (typeof parameterPath === \"string\") {\n result = parameterPath;\n }\n else if (Array.isArray(parameterPath)) {\n result = parameterPath.join(\".\");\n }\n else {\n result = mapper.serializedName;\n }\n return result;\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Gets the list of status codes for streaming responses.\n * @internal\n */\nfunction getStreamResponseStatusCodes(operationSpec) {\n const result = new Set();\n for (const statusCode in operationSpec.responses) {\n const operationResponse = operationSpec.responses[statusCode];\n if (operationResponse.bodyMapper &&\n operationResponse.bodyMapper.type.name === MapperType.Stream) {\n result.add(Number(statusCode));\n }\n }\n return result;\n}\n\n// Copyright (c) Microsoft Corporation.\nfunction getDefaultUserAgentKey() {\n return Constants.HeaderConstants.USER_AGENT;\n}\nfunction getPlatformSpecificData() {\n const runtimeInfo = {\n key: \"Node\",\n value: process.version,\n };\n const osInfo = {\n key: \"OS\",\n value: `(${os__namespace.arch()}-${os__namespace.type()}-${os__namespace.release()})`,\n };\n return [runtimeInfo, osInfo];\n}\n\n// Copyright (c) Microsoft Corporation.\nfunction getRuntimeInfo() {\n const msRestRuntime = {\n key: \"core-http\",\n value: Constants.coreHttpVersion,\n };\n return [msRestRuntime];\n}\nfunction getUserAgentString(telemetryInfo, keySeparator = \" \", valueSeparator = \"/\") {\n return telemetryInfo\n .map((info) => {\n const value = info.value ? `${valueSeparator}${info.value}` : \"\";\n return `${info.key}${value}`;\n })\n .join(keySeparator);\n}\nconst getDefaultUserAgentHeaderName = getDefaultUserAgentKey;\n/**\n * The default approach to generate user agents.\n * Uses static information from this package, plus system information available from the runtime.\n */\nfunction getDefaultUserAgentValue() {\n const runtimeInfo = getRuntimeInfo();\n const platformSpecificData = getPlatformSpecificData();\n const userAgent = getUserAgentString(runtimeInfo.concat(platformSpecificData));\n return userAgent;\n}\n/**\n * Returns a policy that adds the user agent header to outgoing requests based on the given {@link TelemetryInfo}.\n * @param userAgentData - Telemetry information.\n * @returns A new {@link UserAgentPolicy}.\n */\nfunction userAgentPolicy(userAgentData) {\n const key = !userAgentData || userAgentData.key === undefined || userAgentData.key === null\n ? getDefaultUserAgentKey()\n : userAgentData.key;\n const value = !userAgentData || userAgentData.value === undefined || userAgentData.value === null\n ? getDefaultUserAgentValue()\n : userAgentData.value;\n return {\n create: (nextPolicy, options) => {\n return new UserAgentPolicy(nextPolicy, options, key, value);\n },\n };\n}\n/**\n * A policy that adds the user agent header to outgoing requests based on the given {@link TelemetryInfo}.\n */\nclass UserAgentPolicy extends BaseRequestPolicy {\n constructor(_nextPolicy, _options, headerKey, headerValue) {\n super(_nextPolicy, _options);\n this._nextPolicy = _nextPolicy;\n this._options = _options;\n this.headerKey = headerKey;\n this.headerValue = headerValue;\n }\n sendRequest(request) {\n this.addUserAgentHeader(request);\n return this._nextPolicy.sendRequest(request);\n }\n /**\n * Adds the user agent header to the outgoing request.\n */\n addUserAgentHeader(request) {\n if (!request.headers) {\n request.headers = new HttpHeaders();\n }\n if (!request.headers.get(this.headerKey) && this.headerValue) {\n request.headers.set(this.headerKey, this.headerValue);\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * The format that will be used to join an array of values together for a query parameter value.\n */\nexports.QueryCollectionFormat = void 0;\n(function (QueryCollectionFormat) {\n /**\n * CSV: Each pair of segments joined by a single comma.\n */\n QueryCollectionFormat[\"Csv\"] = \",\";\n /**\n * SSV: Each pair of segments joined by a single space character.\n */\n QueryCollectionFormat[\"Ssv\"] = \" \";\n /**\n * TSV: Each pair of segments joined by a single tab character.\n */\n QueryCollectionFormat[\"Tsv\"] = \"\\t\";\n /**\n * Pipes: Each pair of segments joined by a single pipe character.\n */\n QueryCollectionFormat[\"Pipes\"] = \"|\";\n /**\n * Denotes this is an array of values that should be passed to the server in multiple key/value pairs, e.g. `?queryParam=value1&queryParam=value2`\n */\n QueryCollectionFormat[\"Multi\"] = \"Multi\";\n})(exports.QueryCollectionFormat || (exports.QueryCollectionFormat = {}));\n\n// Copyright (c) Microsoft Corporation.\n// Default options for the cycler if none are provided\nconst DEFAULT_CYCLER_OPTIONS = {\n forcedRefreshWindowInMs: 1000,\n retryIntervalInMs: 3000,\n refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry\n};\n/**\n * Converts an an unreliable access token getter (which may resolve with null)\n * into an AccessTokenGetter by retrying the unreliable getter in a regular\n * interval.\n *\n * @param getAccessToken - a function that produces a promise of an access\n * token that may fail by returning null\n * @param retryIntervalInMs - the time (in milliseconds) to wait between retry\n * attempts\n * @param timeoutInMs - the timestamp after which the refresh attempt will fail,\n * throwing an exception\n * @returns - a promise that, if it resolves, will resolve with an access token\n */\nasync function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) {\n // This wrapper handles exceptions gracefully as long as we haven't exceeded\n // the timeout.\n async function tryGetAccessToken() {\n if (Date.now() < timeoutInMs) {\n try {\n return await getAccessToken();\n }\n catch (_a) {\n return null;\n }\n }\n else {\n const finalToken = await getAccessToken();\n // Timeout is up, so throw if it's still null\n if (finalToken === null) {\n throw new Error(\"Failed to refresh access token.\");\n }\n return finalToken;\n }\n }\n let token = await tryGetAccessToken();\n while (token === null) {\n await coreUtil.delay(retryIntervalInMs);\n token = await tryGetAccessToken();\n }\n return token;\n}\n/**\n * Creates a token cycler from a credential, scopes, and optional settings.\n *\n * A token cycler represents a way to reliably retrieve a valid access token\n * from a TokenCredential. It will handle initializing the token, refreshing it\n * when it nears expiration, and synchronizes refresh attempts to avoid\n * concurrency hazards.\n *\n * @param credential - the underlying TokenCredential that provides the access\n * token\n * @param scopes - the scopes to request authorization for\n * @param tokenCyclerOptions - optionally override default settings for the cycler\n *\n * @returns - a function that reliably produces a valid access token\n */\nfunction createTokenCycler(credential, scopes, tokenCyclerOptions) {\n let refreshWorker = null;\n let token = null;\n const options = Object.assign(Object.assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions);\n /**\n * This little holder defines several predicates that we use to construct\n * the rules of refreshing the token.\n */\n const cycler = {\n /**\n * Produces true if a refresh job is currently in progress.\n */\n get isRefreshing() {\n return refreshWorker !== null;\n },\n /**\n * Produces true if the cycler SHOULD refresh (we are within the refresh\n * window and not already refreshing)\n */\n get shouldRefresh() {\n var _a;\n return (!cycler.isRefreshing &&\n ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now());\n },\n /**\n * Produces true if the cycler MUST refresh (null or nearly-expired\n * token).\n */\n get mustRefresh() {\n return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now());\n },\n };\n /**\n * Starts a refresh job or returns the existing job if one is already\n * running.\n */\n function refresh(getTokenOptions) {\n var _a;\n if (!cycler.isRefreshing) {\n // We bind `scopes` here to avoid passing it around a lot\n const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions);\n // Take advantage of promise chaining to insert an assignment to `token`\n // before the refresh can be considered done.\n refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs, \n // If we don't have a token, then we should timeout immediately\n (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now())\n .then((_token) => {\n refreshWorker = null;\n token = _token;\n return token;\n })\n .catch((reason) => {\n // We also should reset the refresher if we enter a failed state. All\n // existing awaiters will throw, but subsequent requests will start a\n // new retry chain.\n refreshWorker = null;\n token = null;\n throw reason;\n });\n }\n return refreshWorker;\n }\n return async (tokenOptions) => {\n //\n // Simple rules:\n // - If we MUST refresh, then return the refresh task, blocking\n // the pipeline until a token is available.\n // - If we SHOULD refresh, then run refresh but don't return it\n // (we can still use the cached token).\n // - Return the token, since it's fine if we didn't return in\n // step 1.\n //\n if (cycler.mustRefresh)\n return refresh(tokenOptions);\n if (cycler.shouldRefresh) {\n refresh(tokenOptions);\n }\n return token;\n };\n}\n// #endregion\n/**\n * Creates a new factory for a RequestPolicy that applies a bearer token to\n * the requests' `Authorization` headers.\n *\n * @param credential - The TokenCredential implementation that can supply the bearer token.\n * @param scopes - The scopes for which the bearer token applies.\n */\nfunction bearerTokenAuthenticationPolicy(credential, scopes) {\n // This simple function encapsulates the entire process of reliably retrieving the token\n const getToken = createTokenCycler(credential, scopes /* , options */);\n class BearerTokenAuthenticationPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options) {\n super(nextPolicy, options);\n }\n async sendRequest(webResource) {\n if (!webResource.url.toLowerCase().startsWith(\"https://\")) {\n throw new Error(\"Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.\");\n }\n const { token } = await getToken({\n abortSignal: webResource.abortSignal,\n tracingOptions: {\n tracingContext: webResource.tracingContext,\n },\n });\n webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`);\n return this._nextPolicy.sendRequest(webResource);\n }\n }\n return {\n create: (nextPolicy, options) => {\n return new BearerTokenAuthenticationPolicy(nextPolicy, options);\n },\n };\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Returns a request policy factory that can be used to create an instance of\n * {@link DisableResponseDecompressionPolicy}.\n */\nfunction disableResponseDecompressionPolicy() {\n return {\n create: (nextPolicy, options) => {\n return new DisableResponseDecompressionPolicy(nextPolicy, options);\n },\n };\n}\n/**\n * A policy to disable response decompression according to Accept-Encoding header\n * https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding\n */\nclass DisableResponseDecompressionPolicy extends BaseRequestPolicy {\n /**\n * Creates an instance of DisableResponseDecompressionPolicy.\n *\n * @param nextPolicy -\n * @param options -\n */\n // The parent constructor is protected.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor */\n constructor(nextPolicy, options) {\n super(nextPolicy, options);\n }\n /**\n * Sends out request.\n *\n * @param request -\n * @returns\n */\n async sendRequest(request) {\n request.decompressResponse = false;\n return this._nextPolicy.sendRequest(request);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Creates a policy that assigns a unique request id to outgoing requests.\n * @param requestIdHeaderName - The name of the header to use when assigning the unique id to the request.\n */\nfunction generateClientRequestIdPolicy(requestIdHeaderName = \"x-ms-client-request-id\") {\n return {\n create: (nextPolicy, options) => {\n return new GenerateClientRequestIdPolicy(nextPolicy, options, requestIdHeaderName);\n },\n };\n}\nclass GenerateClientRequestIdPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, _requestIdHeaderName) {\n super(nextPolicy, options);\n this._requestIdHeaderName = _requestIdHeaderName;\n }\n sendRequest(request) {\n if (!request.headers.contains(this._requestIdHeaderName)) {\n request.headers.set(this._requestIdHeaderName, request.requestId);\n }\n return this._nextPolicy.sendRequest(request);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nlet cachedHttpClient;\nfunction getCachedDefaultHttpClient() {\n if (!cachedHttpClient) {\n cachedHttpClient = new NodeFetchHttpClient();\n }\n return cachedHttpClient;\n}\n\n// Copyright (c) Microsoft Corporation.\nfunction ndJsonPolicy() {\n return {\n create: (nextPolicy, options) => {\n return new NdJsonPolicy(nextPolicy, options);\n },\n };\n}\n/**\n * NdJsonPolicy that formats a JSON array as newline-delimited JSON\n */\nclass NdJsonPolicy extends BaseRequestPolicy {\n /**\n * Creates an instance of KeepAlivePolicy.\n */\n constructor(nextPolicy, options) {\n super(nextPolicy, options);\n }\n /**\n * Sends a request.\n */\n async sendRequest(request) {\n // There currently isn't a good way to bypass the serializer\n if (typeof request.body === \"string\" && request.body.startsWith(\"[\")) {\n const body = JSON.parse(request.body);\n if (Array.isArray(body)) {\n request.body = body.map((item) => JSON.stringify(item) + \"\\n\").join(\"\");\n }\n }\n return this._nextPolicy.sendRequest(request);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Stores the patterns specified in NO_PROXY environment variable.\n * @internal\n */\nconst globalNoProxyList = [];\nlet noProxyListLoaded = false;\n/** A cache of whether a host should bypass the proxy. */\nconst globalBypassedMap = new Map();\nfunction loadEnvironmentProxyValue() {\n if (!process) {\n return undefined;\n }\n const httpsProxy = getEnvironmentValue(Constants.HTTPS_PROXY);\n const allProxy = getEnvironmentValue(Constants.ALL_PROXY);\n const httpProxy = getEnvironmentValue(Constants.HTTP_PROXY);\n return httpsProxy || allProxy || httpProxy;\n}\n/**\n * Check whether the host of a given `uri` matches any pattern in the no proxy list.\n * If there's a match, any request sent to the same host shouldn't have the proxy settings set.\n * This implementation is a port of https://github.com/Azure/azure-sdk-for-net/blob/8cca811371159e527159c7eb65602477898683e2/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs#L210\n */\nfunction isBypassed(uri, noProxyList, bypassedMap) {\n if (noProxyList.length === 0) {\n return false;\n }\n const host = URLBuilder.parse(uri).getHost();\n if (bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.has(host)) {\n return bypassedMap.get(host);\n }\n let isBypassedFlag = false;\n for (const pattern of noProxyList) {\n if (pattern[0] === \".\") {\n // This should match either domain it self or any subdomain or host\n // .foo.com will match foo.com it self or *.foo.com\n if (host.endsWith(pattern)) {\n isBypassedFlag = true;\n }\n else {\n if (host.length === pattern.length - 1 && host === pattern.slice(1)) {\n isBypassedFlag = true;\n }\n }\n }\n else {\n if (host === pattern) {\n isBypassedFlag = true;\n }\n }\n }\n bypassedMap === null || bypassedMap === void 0 ? void 0 : bypassedMap.set(host, isBypassedFlag);\n return isBypassedFlag;\n}\n/**\n * @internal\n */\nfunction loadNoProxy() {\n const noProxy = getEnvironmentValue(Constants.NO_PROXY);\n noProxyListLoaded = true;\n if (noProxy) {\n return noProxy\n .split(\",\")\n .map((item) => item.trim())\n .filter((item) => item.length);\n }\n return [];\n}\n/**\n * Converts a given URL of a proxy server into `ProxySettings` or attempts to retrieve `ProxySettings` from the current environment if one is not passed.\n * @param proxyUrl - URL of the proxy\n * @returns The default proxy settings, or undefined.\n */\nfunction getDefaultProxySettings(proxyUrl) {\n if (!proxyUrl) {\n proxyUrl = loadEnvironmentProxyValue();\n if (!proxyUrl) {\n return undefined;\n }\n }\n const { username, password, urlWithoutAuth } = extractAuthFromUrl(proxyUrl);\n const parsedUrl = URLBuilder.parse(urlWithoutAuth);\n const schema = parsedUrl.getScheme() ? parsedUrl.getScheme() + \"://\" : \"\";\n return {\n host: schema + parsedUrl.getHost(),\n port: Number.parseInt(parsedUrl.getPort() || \"80\"),\n username,\n password,\n };\n}\n/**\n * A policy that allows one to apply proxy settings to all requests.\n * If not passed static settings, they will be retrieved from the HTTPS_PROXY\n * or HTTP_PROXY environment variables.\n * @param proxySettings - ProxySettings to use on each request.\n * @param options - additional settings, for example, custom NO_PROXY patterns\n */\nfunction proxyPolicy(proxySettings, options) {\n if (!proxySettings) {\n proxySettings = getDefaultProxySettings();\n }\n if (!noProxyListLoaded) {\n globalNoProxyList.push(...loadNoProxy());\n }\n return {\n create: (nextPolicy, requestPolicyOptions) => {\n return new ProxyPolicy(nextPolicy, requestPolicyOptions, proxySettings, options === null || options === void 0 ? void 0 : options.customNoProxyList);\n },\n };\n}\nfunction extractAuthFromUrl(url) {\n const atIndex = url.indexOf(\"@\");\n if (atIndex === -1) {\n return { urlWithoutAuth: url };\n }\n const schemeIndex = url.indexOf(\"://\");\n const authStart = schemeIndex !== -1 ? schemeIndex + 3 : 0;\n const auth = url.substring(authStart, atIndex);\n const colonIndex = auth.indexOf(\":\");\n const hasPassword = colonIndex !== -1;\n const username = hasPassword ? auth.substring(0, colonIndex) : auth;\n const password = hasPassword ? auth.substring(colonIndex + 1) : undefined;\n const urlWithoutAuth = url.substring(0, authStart) + url.substring(atIndex + 1);\n return {\n username,\n password,\n urlWithoutAuth,\n };\n}\nclass ProxyPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, proxySettings, customNoProxyList) {\n super(nextPolicy, options);\n this.proxySettings = proxySettings;\n this.customNoProxyList = customNoProxyList;\n }\n sendRequest(request) {\n var _a;\n if (!request.proxySettings &&\n !isBypassed(request.url, (_a = this.customNoProxyList) !== null && _a !== void 0 ? _a : globalNoProxyList, this.customNoProxyList ? undefined : globalBypassedMap)) {\n request.proxySettings = this.proxySettings;\n }\n return this._nextPolicy.sendRequest(request);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nfunction rpRegistrationPolicy(retryTimeout = 30) {\n return {\n create: (nextPolicy, options) => {\n return new RPRegistrationPolicy(nextPolicy, options, retryTimeout);\n },\n };\n}\nclass RPRegistrationPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, _retryTimeout = 30) {\n super(nextPolicy, options);\n this._retryTimeout = _retryTimeout;\n }\n sendRequest(request) {\n return this._nextPolicy\n .sendRequest(request.clone())\n .then((response) => registerIfNeeded(this, request, response));\n }\n}\nfunction registerIfNeeded(policy, request, response) {\n if (response.status === 409) {\n const rpName = checkRPNotRegisteredError(response.bodyAsText);\n if (rpName) {\n const urlPrefix = extractSubscriptionUrl(request.url);\n return (registerRP(policy, urlPrefix, rpName, request)\n // Autoregistration of ${provider} failed for some reason. We will not return this error\n // instead will return the initial response with 409 status code back to the user.\n // do nothing here as we are returning the original response at the end of this method.\n .catch(() => false)\n .then((registrationStatus) => {\n if (registrationStatus) {\n // Retry the original request. We have to change the x-ms-client-request-id\n // otherwise Azure endpoint will return the initial 409 (cached) response.\n request.headers.set(\"x-ms-client-request-id\", generateUuid());\n return policy._nextPolicy.sendRequest(request.clone());\n }\n return response;\n }));\n }\n }\n return Promise.resolve(response);\n}\n/**\n * Reuses the headers of the original request and url (if specified).\n * @param originalRequest - The original request\n * @param reuseUrlToo - Should the url from the original request be reused as well. Default false.\n * @returns A new request object with desired headers.\n */\nfunction getRequestEssentials(originalRequest, reuseUrlToo = false) {\n const reqOptions = originalRequest.clone();\n if (reuseUrlToo) {\n reqOptions.url = originalRequest.url;\n }\n // We have to change the x-ms-client-request-id otherwise Azure endpoint\n // will return the initial 409 (cached) response.\n reqOptions.headers.set(\"x-ms-client-request-id\", generateUuid());\n // Set content-type to application/json\n reqOptions.headers.set(\"Content-Type\", \"application/json; charset=utf-8\");\n return reqOptions;\n}\n/**\n * Validates the error code and message associated with 409 response status code. If it matches to that of\n * RP not registered then it returns the name of the RP else returns undefined.\n * @param body - The response body received after making the original request.\n * @returns The name of the RP if condition is satisfied else undefined.\n */\nfunction checkRPNotRegisteredError(body) {\n let result, responseBody;\n if (body) {\n try {\n responseBody = JSON.parse(body);\n }\n catch (err) {\n // do nothing;\n }\n if (responseBody &&\n responseBody.error &&\n responseBody.error.message &&\n responseBody.error.code &&\n responseBody.error.code === \"MissingSubscriptionRegistration\") {\n const matchRes = responseBody.error.message.match(/.*'(.*)'/i);\n if (matchRes) {\n result = matchRes.pop();\n }\n }\n }\n return result;\n}\n/**\n * Extracts the first part of the URL, just after subscription:\n * https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/\n * @param url - The original request url\n * @returns The url prefix as explained above.\n */\nfunction extractSubscriptionUrl(url) {\n let result;\n const matchRes = url.match(/.*\\/subscriptions\\/[a-f0-9-]+\\//gi);\n if (matchRes && matchRes[0]) {\n result = matchRes[0];\n }\n else {\n throw new Error(`Unable to extract subscriptionId from the given url - ${url}.`);\n }\n return result;\n}\n/**\n * Registers the given provider.\n * @param policy - The RPRegistrationPolicy this function is being called against.\n * @param urlPrefix - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/\n * @param provider - The provider name to be registered.\n * @param originalRequest - The original request sent by the user that returned a 409 response\n * with a message that the provider is not registered.\n */\nasync function registerRP(policy, urlPrefix, provider, originalRequest) {\n const postUrl = `${urlPrefix}providers/${provider}/register?api-version=2016-02-01`;\n const getUrl = `${urlPrefix}providers/${provider}?api-version=2016-02-01`;\n const reqOptions = getRequestEssentials(originalRequest);\n reqOptions.method = \"POST\";\n reqOptions.url = postUrl;\n const response = await policy._nextPolicy.sendRequest(reqOptions);\n if (response.status !== 200) {\n throw new Error(`Autoregistration of ${provider} failed. Please try registering manually.`);\n }\n return getRegistrationStatus(policy, getUrl, originalRequest);\n}\n/**\n * Polls the registration status of the provider that was registered. Polling happens at an interval of 30 seconds.\n * Polling will happen till the registrationState property of the response body is \"Registered\".\n * @param policy - The RPRegistrationPolicy this function is being called against.\n * @param url - The request url for polling\n * @param originalRequest - The original request sent by the user that returned a 409 response\n * with a message that the provider is not registered.\n * @returns True if RP Registration is successful.\n */\nasync function getRegistrationStatus(policy, url, originalRequest) {\n const reqOptions = getRequestEssentials(originalRequest);\n reqOptions.url = url;\n reqOptions.method = \"GET\";\n const res = await policy._nextPolicy.sendRequest(reqOptions);\n const obj = res.parsedBody;\n if (res.parsedBody && obj.registrationState && obj.registrationState === \"Registered\") {\n return true;\n }\n else {\n await coreUtil.delay(policy._retryTimeout * 1000);\n return getRegistrationStatus(policy, url, originalRequest);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Creates a policy that signs outgoing requests by calling to the provided `authenticationProvider`'s `signRequest` method.\n * @param authenticationProvider - The authentication provider.\n * @returns An instance of the {@link SigningPolicy}.\n */\nfunction signingPolicy(authenticationProvider) {\n return {\n create: (nextPolicy, options) => {\n return new SigningPolicy(nextPolicy, options, authenticationProvider);\n },\n };\n}\n/**\n * A policy that signs outgoing requests by calling to the provided `authenticationProvider`'s `signRequest` method.\n */\nclass SigningPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, authenticationProvider) {\n super(nextPolicy, options);\n this.authenticationProvider = authenticationProvider;\n }\n signRequest(request) {\n return this.authenticationProvider.signRequest(request);\n }\n sendRequest(request) {\n return this.signRequest(request).then((nextRequest) => this._nextPolicy.sendRequest(nextRequest));\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A policy that retries when there's a system error, identified by the codes \"ETIMEDOUT\", \"ESOCKETTIMEDOUT\", \"ECONNREFUSED\", \"ECONNRESET\" or \"ENOENT\".\n * @param retryCount - Maximum number of retries.\n * @param retryInterval - The client retry interval, in milliseconds.\n * @param minRetryInterval - The minimum retry interval, in milliseconds.\n * @param maxRetryInterval - The maximum retry interval, in milliseconds.\n * @returns An instance of the {@link SystemErrorRetryPolicy}\n */\nfunction systemErrorRetryPolicy(retryCount, retryInterval, minRetryInterval, maxRetryInterval) {\n return {\n create: (nextPolicy, options) => {\n return new SystemErrorRetryPolicy(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval);\n },\n };\n}\n/**\n * A policy that retries when there's a system error, identified by the codes \"ETIMEDOUT\", \"ESOCKETTIMEDOUT\", \"ECONNREFUSED\", \"ECONNRESET\" or \"ENOENT\".\n * @param retryCount - The client retry count.\n * @param retryInterval - The client retry interval, in milliseconds.\n * @param minRetryInterval - The minimum retry interval, in milliseconds.\n * @param maxRetryInterval - The maximum retry interval, in milliseconds.\n */\nclass SystemErrorRetryPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, retryCount, retryInterval, minRetryInterval, maxRetryInterval) {\n super(nextPolicy, options);\n this.retryCount = isNumber(retryCount) ? retryCount : DEFAULT_CLIENT_RETRY_COUNT;\n this.retryInterval = isNumber(retryInterval) ? retryInterval : DEFAULT_CLIENT_RETRY_INTERVAL;\n this.minRetryInterval = isNumber(minRetryInterval)\n ? minRetryInterval\n : DEFAULT_CLIENT_MIN_RETRY_INTERVAL;\n this.maxRetryInterval = isNumber(maxRetryInterval)\n ? maxRetryInterval\n : DEFAULT_CLIENT_MAX_RETRY_INTERVAL;\n }\n sendRequest(request) {\n return this._nextPolicy\n .sendRequest(request.clone())\n .catch((error) => retry(this, request, error.response, error));\n }\n}\nasync function retry(policy, request, operationResponse, err, retryData) {\n retryData = updateRetryData(policy, retryData, err);\n function shouldPolicyRetry(_response, error) {\n if (error &&\n error.code &&\n (error.code === \"ETIMEDOUT\" ||\n error.code === \"ESOCKETTIMEDOUT\" ||\n error.code === \"ECONNREFUSED\" ||\n error.code === \"ECONNRESET\" ||\n error.code === \"ENOENT\")) {\n return true;\n }\n return false;\n }\n if (shouldRetry(policy.retryCount, shouldPolicyRetry, retryData, operationResponse, err)) {\n // If previous operation ended with an error and the policy allows a retry, do that\n try {\n await coreUtil.delay(retryData.retryInterval);\n return policy._nextPolicy.sendRequest(request.clone());\n }\n catch (nestedErr) {\n return retry(policy, request, operationResponse, nestedErr, retryData);\n }\n }\n else {\n if (err) {\n // If the operation failed in the end, return all errors instead of just the last one\n return Promise.reject(retryData.error);\n }\n return operationResponse;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Maximum number of retries for the throttling retry policy\n */\nconst DEFAULT_CLIENT_MAX_RETRY_COUNT = 3;\n\n// Copyright (c) Microsoft Corporation.\nconst StatusCodes = Constants.HttpConstants.StatusCodes;\n/**\n * Creates a policy that re-sends the request if the response indicates the request failed because of throttling reasons.\n * For example, if the response contains a `Retry-After` header, it will retry sending the request based on the value of that header.\n *\n * To learn more, please refer to\n * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits,\n * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and\n * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors\n * @returns\n */\nfunction throttlingRetryPolicy() {\n return {\n create: (nextPolicy, options) => {\n return new ThrottlingRetryPolicy(nextPolicy, options);\n },\n };\n}\nconst StandardAbortMessage = \"The operation was aborted.\";\n/**\n * Creates a policy that re-sends the request if the response indicates the request failed because of throttling reasons.\n * For example, if the response contains a `Retry-After` header, it will retry sending the request based on the value of that header.\n *\n * To learn more, please refer to\n * https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits,\n * https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits and\n * https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/troubleshooting-throttling-errors\n */\nclass ThrottlingRetryPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, _handleResponse) {\n super(nextPolicy, options);\n this.numberOfRetries = 0;\n this._handleResponse = _handleResponse || this._defaultResponseHandler;\n }\n async sendRequest(httpRequest) {\n const response = await this._nextPolicy.sendRequest(httpRequest.clone());\n if (response.status !== StatusCodes.TooManyRequests &&\n response.status !== StatusCodes.ServiceUnavailable) {\n return response;\n }\n else {\n return this._handleResponse(httpRequest, response);\n }\n }\n async _defaultResponseHandler(httpRequest, httpResponse) {\n var _a;\n const retryAfterHeader = httpResponse.headers.get(Constants.HeaderConstants.RETRY_AFTER);\n if (retryAfterHeader) {\n const delayInMs = ThrottlingRetryPolicy.parseRetryAfterHeader(retryAfterHeader);\n if (delayInMs) {\n this.numberOfRetries += 1;\n await coreUtil.delay(delayInMs, {\n abortSignal: httpRequest.abortSignal,\n abortErrorMsg: StandardAbortMessage,\n });\n if ((_a = httpRequest.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {\n throw new abortController.AbortError(StandardAbortMessage);\n }\n if (this.numberOfRetries < DEFAULT_CLIENT_MAX_RETRY_COUNT) {\n return this.sendRequest(httpRequest);\n }\n else {\n return this._nextPolicy.sendRequest(httpRequest);\n }\n }\n }\n return httpResponse;\n }\n static parseRetryAfterHeader(headerValue) {\n const retryAfterInSeconds = Number(headerValue);\n if (Number.isNaN(retryAfterInSeconds)) {\n return ThrottlingRetryPolicy.parseDateRetryAfterHeader(headerValue);\n }\n else {\n return retryAfterInSeconds * 1000;\n }\n }\n static parseDateRetryAfterHeader(headerValue) {\n try {\n const now = Date.now();\n const date = Date.parse(headerValue);\n const diff = date - now;\n return Number.isNaN(diff) ? undefined : diff;\n }\n catch (error) {\n return undefined;\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nconst createSpan = coreTracing.createSpanFunction({\n packagePrefix: \"\",\n namespace: \"\",\n});\n/**\n * Creates a policy that wraps outgoing requests with a tracing span.\n * @param tracingOptions - Tracing options.\n * @returns An instance of the {@link TracingPolicy} class.\n */\nfunction tracingPolicy(tracingOptions = {}) {\n return {\n create(nextPolicy, options) {\n return new TracingPolicy(nextPolicy, options, tracingOptions);\n },\n };\n}\n/**\n * A policy that wraps outgoing requests with a tracing span.\n */\nclass TracingPolicy extends BaseRequestPolicy {\n constructor(nextPolicy, options, tracingOptions) {\n super(nextPolicy, options);\n this.userAgent = tracingOptions.userAgent;\n }\n async sendRequest(request) {\n if (!request.tracingContext) {\n return this._nextPolicy.sendRequest(request);\n }\n const span = this.tryCreateSpan(request);\n if (!span) {\n return this._nextPolicy.sendRequest(request);\n }\n try {\n const response = await this._nextPolicy.sendRequest(request);\n this.tryProcessResponse(span, response);\n return response;\n }\n catch (err) {\n this.tryProcessError(span, err);\n throw err;\n }\n }\n tryCreateSpan(request) {\n var _a;\n try {\n // Passing spanOptions as part of tracingOptions to maintain compatibility @azure/core-tracing@preview.13 and earlier.\n // We can pass this as a separate parameter once we upgrade to the latest core-tracing.\n const { span } = createSpan(`HTTP ${request.method}`, {\n tracingOptions: {\n spanOptions: Object.assign(Object.assign({}, request.spanOptions), { kind: coreTracing.SpanKind.CLIENT }),\n tracingContext: request.tracingContext,\n },\n });\n // If the span is not recording, don't do any more work.\n if (!span.isRecording()) {\n span.end();\n return undefined;\n }\n const namespaceFromContext = (_a = request.tracingContext) === null || _a === void 0 ? void 0 : _a.getValue(Symbol.for(\"az.namespace\"));\n if (typeof namespaceFromContext === \"string\") {\n span.setAttribute(\"az.namespace\", namespaceFromContext);\n }\n span.setAttributes({\n \"http.method\": request.method,\n \"http.url\": request.url,\n requestId: request.requestId,\n });\n if (this.userAgent) {\n span.setAttribute(\"http.user_agent\", this.userAgent);\n }\n // set headers\n const spanContext = span.spanContext();\n const traceParentHeader = coreTracing.getTraceParentHeader(spanContext);\n if (traceParentHeader && coreTracing.isSpanContextValid(spanContext)) {\n request.headers.set(\"traceparent\", traceParentHeader);\n const traceState = spanContext.traceState && spanContext.traceState.serialize();\n // if tracestate is set, traceparent MUST be set, so only set tracestate after traceparent\n if (traceState) {\n request.headers.set(\"tracestate\", traceState);\n }\n }\n return span;\n }\n catch (error) {\n logger.warning(`Skipping creating a tracing span due to an error: ${error.message}`);\n return undefined;\n }\n }\n tryProcessError(span, err) {\n try {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: err.message,\n });\n if (err.statusCode) {\n span.setAttribute(\"http.status_code\", err.statusCode);\n }\n span.end();\n }\n catch (error) {\n logger.warning(`Skipping tracing span processing due to an error: ${error.message}`);\n }\n }\n tryProcessResponse(span, response) {\n try {\n span.setAttribute(\"http.status_code\", response.status);\n const serviceRequestId = response.headers.get(\"x-ms-request-id\");\n if (serviceRequestId) {\n span.setAttribute(\"serviceRequestId\", serviceRequestId);\n }\n span.setStatus({\n code: coreTracing.SpanStatusCode.OK,\n });\n span.end();\n }\n catch (error) {\n logger.warning(`Skipping tracing span processing due to an error: ${error.message}`);\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * ServiceClient sends service requests and receives responses.\n */\nclass ServiceClient {\n /**\n * The ServiceClient constructor\n * @param credentials - The credentials used for authentication with the service.\n * @param options - The service client options that govern the behavior of the client.\n */\n constructor(credentials, \n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options */\n options) {\n if (!options) {\n options = {};\n }\n this._withCredentials = options.withCredentials || false;\n this._httpClient = options.httpClient || getCachedDefaultHttpClient();\n this._requestPolicyOptions = new RequestPolicyOptions(options.httpPipelineLogger);\n let requestPolicyFactories;\n if (Array.isArray(options.requestPolicyFactories)) {\n logger.info(\"ServiceClient: using custom request policies\");\n requestPolicyFactories = options.requestPolicyFactories;\n }\n else {\n let authPolicyFactory = undefined;\n if (coreAuth.isTokenCredential(credentials)) {\n logger.info(\"ServiceClient: creating bearer token authentication policy from provided credentials\");\n // Create a wrapped RequestPolicyFactory here so that we can provide the\n // correct scope to the BearerTokenAuthenticationPolicy at the first time\n // one is requested. This is needed because generated ServiceClient\n // implementations do not set baseUri until after ServiceClient's constructor\n // is finished, leaving baseUri empty at the time when it is needed to\n // build the correct scope name.\n const wrappedPolicyFactory = () => {\n let bearerTokenPolicyFactory = undefined;\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const serviceClient = this;\n const serviceClientOptions = options;\n return {\n create(nextPolicy, createOptions) {\n const credentialScopes = getCredentialScopes(serviceClientOptions, serviceClient.baseUri);\n if (!credentialScopes) {\n throw new Error(`When using credential, the ServiceClient must contain a baseUri or a credentialScopes in ServiceClientOptions. Unable to create a bearerTokenAuthenticationPolicy`);\n }\n if (bearerTokenPolicyFactory === undefined || bearerTokenPolicyFactory === null) {\n bearerTokenPolicyFactory = bearerTokenAuthenticationPolicy(credentials, credentialScopes);\n }\n return bearerTokenPolicyFactory.create(nextPolicy, createOptions);\n },\n };\n };\n authPolicyFactory = wrappedPolicyFactory();\n }\n else if (credentials && typeof credentials.signRequest === \"function\") {\n logger.info(\"ServiceClient: creating signing policy from provided credentials\");\n authPolicyFactory = signingPolicy(credentials);\n }\n else if (credentials !== undefined && credentials !== null) {\n throw new Error(\"The credentials argument must implement the TokenCredential interface\");\n }\n logger.info(\"ServiceClient: using default request policies\");\n requestPolicyFactories = createDefaultRequestPolicyFactories(authPolicyFactory, options);\n if (options.requestPolicyFactories) {\n // options.requestPolicyFactories can also be a function that manipulates\n // the default requestPolicyFactories array\n const newRequestPolicyFactories = options.requestPolicyFactories(requestPolicyFactories);\n if (newRequestPolicyFactories) {\n requestPolicyFactories = newRequestPolicyFactories;\n }\n }\n }\n this._requestPolicyFactories = requestPolicyFactories;\n }\n /**\n * Send the provided httpRequest.\n */\n sendRequest(options) {\n if (options === null || options === undefined || typeof options !== \"object\") {\n throw new Error(\"options cannot be null or undefined and it must be of type object.\");\n }\n let httpRequest;\n try {\n if (isWebResourceLike(options)) {\n options.validateRequestProperties();\n httpRequest = options;\n }\n else {\n httpRequest = new WebResource();\n httpRequest = httpRequest.prepare(options);\n }\n }\n catch (error) {\n return Promise.reject(error);\n }\n let httpPipeline = this._httpClient;\n if (this._requestPolicyFactories && this._requestPolicyFactories.length > 0) {\n for (let i = this._requestPolicyFactories.length - 1; i >= 0; --i) {\n httpPipeline = this._requestPolicyFactories[i].create(httpPipeline, this._requestPolicyOptions);\n }\n }\n return httpPipeline.sendRequest(httpRequest);\n }\n /**\n * Send an HTTP request that is populated using the provided OperationSpec.\n * @param operationArguments - The arguments that the HTTP request's templated values will be populated from.\n * @param operationSpec - The OperationSpec to use to populate the httpRequest.\n * @param callback - The callback to call when the response is received.\n */\n async sendOperationRequest(operationArguments, operationSpec, callback) {\n var _a;\n if (typeof operationArguments.options === \"function\") {\n callback = operationArguments.options;\n operationArguments.options = undefined;\n }\n const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions;\n const httpRequest = new WebResource();\n let result;\n try {\n const baseUri = operationSpec.baseUrl || this.baseUri;\n if (!baseUri) {\n throw new Error(\"If operationSpec.baseUrl is not specified, then the ServiceClient must have a baseUri string property that contains the base URL to use.\");\n }\n httpRequest.method = operationSpec.httpMethod;\n httpRequest.operationSpec = operationSpec;\n const requestUrl = URLBuilder.parse(baseUri);\n if (operationSpec.path) {\n requestUrl.appendPath(operationSpec.path);\n }\n if (operationSpec.urlParameters && operationSpec.urlParameters.length > 0) {\n for (const urlParameter of operationSpec.urlParameters) {\n let urlParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, urlParameter, operationSpec.serializer);\n urlParameterValue = operationSpec.serializer.serialize(urlParameter.mapper, urlParameterValue, getPathStringFromParameter(urlParameter), serializerOptions);\n if (!urlParameter.skipEncoding) {\n urlParameterValue = encodeURIComponent(urlParameterValue);\n }\n requestUrl.replaceAll(`{${urlParameter.mapper.serializedName || getPathStringFromParameter(urlParameter)}}`, urlParameterValue);\n }\n }\n if (operationSpec.queryParameters && operationSpec.queryParameters.length > 0) {\n for (const queryParameter of operationSpec.queryParameters) {\n let queryParameterValue = getOperationArgumentValueFromParameter(this, operationArguments, queryParameter, operationSpec.serializer);\n if (queryParameterValue !== undefined && queryParameterValue !== null) {\n queryParameterValue = operationSpec.serializer.serialize(queryParameter.mapper, queryParameterValue, getPathStringFromParameter(queryParameter), serializerOptions);\n if (queryParameter.collectionFormat !== undefined &&\n queryParameter.collectionFormat !== null) {\n if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Multi) {\n if (queryParameterValue.length === 0) {\n // The collection is empty, no need to try serializing the current queryParam\n continue;\n }\n else {\n for (const index in queryParameterValue) {\n const item = queryParameterValue[index];\n queryParameterValue[index] =\n item === undefined || item === null ? \"\" : item.toString();\n }\n }\n }\n else if (queryParameter.collectionFormat === exports.QueryCollectionFormat.Ssv ||\n queryParameter.collectionFormat === exports.QueryCollectionFormat.Tsv) {\n queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat);\n }\n }\n if (!queryParameter.skipEncoding) {\n if (Array.isArray(queryParameterValue)) {\n for (const index in queryParameterValue) {\n if (queryParameterValue[index] !== undefined &&\n queryParameterValue[index] !== null) {\n queryParameterValue[index] = encodeURIComponent(queryParameterValue[index]);\n }\n }\n }\n else {\n queryParameterValue = encodeURIComponent(queryParameterValue);\n }\n }\n if (queryParameter.collectionFormat !== undefined &&\n queryParameter.collectionFormat !== null &&\n queryParameter.collectionFormat !== exports.QueryCollectionFormat.Multi &&\n queryParameter.collectionFormat !== exports.QueryCollectionFormat.Ssv &&\n queryParameter.collectionFormat !== exports.QueryCollectionFormat.Tsv) {\n queryParameterValue = queryParameterValue.join(queryParameter.collectionFormat);\n }\n requestUrl.setQueryParameter(queryParameter.mapper.serializedName || getPathStringFromParameter(queryParameter), queryParameterValue);\n }\n }\n }\n httpRequest.url = requestUrl.toString();\n const contentType = operationSpec.contentType || this.requestContentType;\n if (contentType && operationSpec.requestBody) {\n httpRequest.headers.set(\"Content-Type\", contentType);\n }\n if (operationSpec.headerParameters) {\n for (const headerParameter of operationSpec.headerParameters) {\n let headerValue = getOperationArgumentValueFromParameter(this, operationArguments, headerParameter, operationSpec.serializer);\n if (headerValue !== undefined && headerValue !== null) {\n headerValue = operationSpec.serializer.serialize(headerParameter.mapper, headerValue, getPathStringFromParameter(headerParameter), serializerOptions);\n const headerCollectionPrefix = headerParameter.mapper\n .headerCollectionPrefix;\n if (headerCollectionPrefix) {\n for (const key of Object.keys(headerValue)) {\n httpRequest.headers.set(headerCollectionPrefix + key, headerValue[key]);\n }\n }\n else {\n httpRequest.headers.set(headerParameter.mapper.serializedName ||\n getPathStringFromParameter(headerParameter), headerValue);\n }\n }\n }\n }\n const options = operationArguments.options;\n if (options) {\n if (options.customHeaders) {\n for (const customHeaderName in options.customHeaders) {\n httpRequest.headers.set(customHeaderName, options.customHeaders[customHeaderName]);\n }\n }\n if (options.abortSignal) {\n httpRequest.abortSignal = options.abortSignal;\n }\n if (options.timeout) {\n httpRequest.timeout = options.timeout;\n }\n if (options.onUploadProgress) {\n httpRequest.onUploadProgress = options.onUploadProgress;\n }\n if (options.onDownloadProgress) {\n httpRequest.onDownloadProgress = options.onDownloadProgress;\n }\n if (options.spanOptions) {\n // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.\n httpRequest.spanOptions = options.spanOptions;\n }\n if (options.tracingContext) {\n httpRequest.tracingContext = options.tracingContext;\n }\n if (options.shouldDeserialize !== undefined && options.shouldDeserialize !== null) {\n httpRequest.shouldDeserialize = options.shouldDeserialize;\n }\n }\n httpRequest.withCredentials = this._withCredentials;\n serializeRequestBody(this, httpRequest, operationArguments, operationSpec);\n if (httpRequest.streamResponseStatusCodes === undefined) {\n httpRequest.streamResponseStatusCodes = getStreamResponseStatusCodes(operationSpec);\n }\n let rawResponse;\n let sendRequestError;\n try {\n rawResponse = await this.sendRequest(httpRequest);\n }\n catch (error) {\n sendRequestError = error;\n }\n if (sendRequestError) {\n if (sendRequestError.response) {\n sendRequestError.details = flattenResponse(sendRequestError.response, operationSpec.responses[sendRequestError.statusCode] ||\n operationSpec.responses[\"default\"]);\n }\n result = Promise.reject(sendRequestError);\n }\n else {\n result = Promise.resolve(flattenResponse(rawResponse, operationSpec.responses[rawResponse.status]));\n }\n }\n catch (error) {\n result = Promise.reject(error);\n }\n const cb = callback;\n if (cb) {\n result\n .then((res) => cb(null, res._response.parsedBody, res._response.request, res._response))\n .catch((err) => cb(err));\n }\n return result;\n }\n}\nfunction serializeRequestBody(serviceClient, httpRequest, operationArguments, operationSpec) {\n var _a, _b, _c, _d, _e, _f;\n const serializerOptions = (_b = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions) !== null && _b !== void 0 ? _b : {};\n const updatedOptions = {\n rootName: (_c = serializerOptions.rootName) !== null && _c !== void 0 ? _c : \"\",\n includeRoot: (_d = serializerOptions.includeRoot) !== null && _d !== void 0 ? _d : false,\n xmlCharKey: (_e = serializerOptions.xmlCharKey) !== null && _e !== void 0 ? _e : XML_CHARKEY,\n };\n const xmlCharKey = serializerOptions.xmlCharKey;\n if (operationSpec.requestBody && operationSpec.requestBody.mapper) {\n httpRequest.body = getOperationArgumentValueFromParameter(serviceClient, operationArguments, operationSpec.requestBody, operationSpec.serializer);\n const bodyMapper = operationSpec.requestBody.mapper;\n const { required, xmlName, xmlElementName, serializedName, xmlNamespace, xmlNamespacePrefix } = bodyMapper;\n const typeName = bodyMapper.type.name;\n try {\n if ((httpRequest.body !== undefined && httpRequest.body !== null) || required) {\n const requestBodyParameterPathString = getPathStringFromParameter(operationSpec.requestBody);\n httpRequest.body = operationSpec.serializer.serialize(bodyMapper, httpRequest.body, requestBodyParameterPathString, updatedOptions);\n const isStream = typeName === MapperType.Stream;\n if (operationSpec.isXML) {\n const xmlnsKey = xmlNamespacePrefix ? `xmlns:${xmlNamespacePrefix}` : \"xmlns\";\n const value = getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, httpRequest.body, updatedOptions);\n if (typeName === MapperType.Sequence) {\n httpRequest.body = stringifyXML(prepareXMLRootList(value, xmlElementName || xmlName || serializedName, xmlnsKey, xmlNamespace), {\n rootName: xmlName || serializedName,\n xmlCharKey,\n });\n }\n else if (!isStream) {\n httpRequest.body = stringifyXML(value, {\n rootName: xmlName || serializedName,\n xmlCharKey,\n });\n }\n }\n else if (typeName === MapperType.String &&\n (((_f = operationSpec.contentType) === null || _f === void 0 ? void 0 : _f.match(\"text/plain\")) || operationSpec.mediaType === \"text\")) {\n // the String serializer has validated that request body is a string\n // so just send the string.\n return;\n }\n else if (!isStream) {\n httpRequest.body = JSON.stringify(httpRequest.body);\n }\n }\n }\n catch (error) {\n throw new Error(`Error \"${error.message}\" occurred in serializing the payload - ${JSON.stringify(serializedName, undefined, \" \")}.`);\n }\n }\n else if (operationSpec.formDataParameters && operationSpec.formDataParameters.length > 0) {\n httpRequest.formData = {};\n for (const formDataParameter of operationSpec.formDataParameters) {\n const formDataParameterValue = getOperationArgumentValueFromParameter(serviceClient, operationArguments, formDataParameter, operationSpec.serializer);\n if (formDataParameterValue !== undefined && formDataParameterValue !== null) {\n const formDataParameterPropertyName = formDataParameter.mapper.serializedName || getPathStringFromParameter(formDataParameter);\n httpRequest.formData[formDataParameterPropertyName] = operationSpec.serializer.serialize(formDataParameter.mapper, formDataParameterValue, getPathStringFromParameter(formDataParameter), updatedOptions);\n }\n }\n }\n}\n/**\n * Adds an xml namespace to the xml serialized object if needed, otherwise it just returns the value itself\n */\nfunction getXmlValueWithNamespace(xmlNamespace, xmlnsKey, typeName, serializedValue, options) {\n // Composite and Sequence schemas already got their root namespace set during serialization\n // We just need to add xmlns to the other schema types\n if (xmlNamespace && ![\"Composite\", \"Sequence\", \"Dictionary\"].includes(typeName)) {\n const result = {};\n result[options.xmlCharKey] = serializedValue;\n result[XML_ATTRKEY] = { [xmlnsKey]: xmlNamespace };\n return result;\n }\n return serializedValue;\n}\nfunction getValueOrFunctionResult(value, defaultValueCreator) {\n let result;\n if (typeof value === \"string\") {\n result = value;\n }\n else {\n result = defaultValueCreator();\n if (typeof value === \"function\") {\n result = value(result);\n }\n }\n return result;\n}\nfunction createDefaultRequestPolicyFactories(authPolicyFactory, options) {\n const factories = [];\n if (options.generateClientRequestIdHeader) {\n factories.push(generateClientRequestIdPolicy(options.clientRequestIdHeaderName));\n }\n if (authPolicyFactory) {\n factories.push(authPolicyFactory);\n }\n const userAgentHeaderName = getValueOrFunctionResult(options.userAgentHeaderName, getDefaultUserAgentHeaderName);\n const userAgentHeaderValue = getValueOrFunctionResult(options.userAgent, getDefaultUserAgentValue);\n if (userAgentHeaderName && userAgentHeaderValue) {\n factories.push(userAgentPolicy({ key: userAgentHeaderName, value: userAgentHeaderValue }));\n }\n factories.push(redirectPolicy());\n factories.push(rpRegistrationPolicy(options.rpRegistrationRetryTimeout));\n if (!options.noRetryPolicy) {\n factories.push(exponentialRetryPolicy());\n factories.push(systemErrorRetryPolicy());\n factories.push(throttlingRetryPolicy());\n }\n factories.push(deserializationPolicy(options.deserializationContentTypes));\n if (coreUtil.isNode) {\n factories.push(proxyPolicy(options.proxySettings));\n }\n factories.push(logPolicy({ logger: logger.info }));\n return factories;\n}\n/**\n * Creates an HTTP pipeline based on the given options.\n * @param pipelineOptions - Defines options that are used to configure policies in the HTTP pipeline for an SDK client.\n * @param authPolicyFactory - An optional authentication policy factory to use for signing requests.\n * @returns A set of options that can be passed to create a new {@link ServiceClient}.\n */\nfunction createPipelineFromOptions(pipelineOptions, authPolicyFactory) {\n const requestPolicyFactories = [];\n if (pipelineOptions.sendStreamingJson) {\n requestPolicyFactories.push(ndJsonPolicy());\n }\n let userAgentValue = undefined;\n if (pipelineOptions.userAgentOptions && pipelineOptions.userAgentOptions.userAgentPrefix) {\n const userAgentInfo = [];\n userAgentInfo.push(pipelineOptions.userAgentOptions.userAgentPrefix);\n // Add the default user agent value if it isn't already specified\n // by the userAgentPrefix option.\n const defaultUserAgentInfo = getDefaultUserAgentValue();\n if (userAgentInfo.indexOf(defaultUserAgentInfo) === -1) {\n userAgentInfo.push(defaultUserAgentInfo);\n }\n userAgentValue = userAgentInfo.join(\" \");\n }\n const keepAliveOptions = Object.assign(Object.assign({}, DefaultKeepAliveOptions), pipelineOptions.keepAliveOptions);\n const retryOptions = Object.assign(Object.assign({}, DefaultRetryOptions), pipelineOptions.retryOptions);\n const redirectOptions = Object.assign(Object.assign({}, DefaultRedirectOptions), pipelineOptions.redirectOptions);\n if (coreUtil.isNode) {\n requestPolicyFactories.push(proxyPolicy(pipelineOptions.proxyOptions));\n }\n const deserializationOptions = Object.assign(Object.assign({}, DefaultDeserializationOptions), pipelineOptions.deserializationOptions);\n const loggingOptions = Object.assign({}, pipelineOptions.loggingOptions);\n requestPolicyFactories.push(tracingPolicy({ userAgent: userAgentValue }), keepAlivePolicy(keepAliveOptions), userAgentPolicy({ value: userAgentValue }), generateClientRequestIdPolicy(), deserializationPolicy(deserializationOptions.expectedContentTypes), throttlingRetryPolicy(), systemErrorRetryPolicy(), exponentialRetryPolicy(retryOptions.maxRetries, retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs));\n if (redirectOptions.handleRedirects) {\n requestPolicyFactories.push(redirectPolicy(redirectOptions.maxRetries));\n }\n if (authPolicyFactory) {\n requestPolicyFactories.push(authPolicyFactory);\n }\n requestPolicyFactories.push(logPolicy(loggingOptions));\n if (coreUtil.isNode && pipelineOptions.decompressResponse === false) {\n requestPolicyFactories.push(disableResponseDecompressionPolicy());\n }\n return {\n httpClient: pipelineOptions.httpClient,\n requestPolicyFactories,\n };\n}\nfunction getOperationArgumentValueFromParameter(serviceClient, operationArguments, parameter, serializer) {\n return getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameter.parameterPath, parameter.mapper, serializer);\n}\nfunction getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, parameterPath, parameterMapper, serializer) {\n var _a;\n let value;\n if (typeof parameterPath === \"string\") {\n parameterPath = [parameterPath];\n }\n const serializerOptions = (_a = operationArguments.options) === null || _a === void 0 ? void 0 : _a.serializerOptions;\n if (Array.isArray(parameterPath)) {\n if (parameterPath.length > 0) {\n if (parameterMapper.isConstant) {\n value = parameterMapper.defaultValue;\n }\n else {\n let propertySearchResult = getPropertyFromParameterPath(operationArguments, parameterPath);\n if (!propertySearchResult.propertyFound) {\n propertySearchResult = getPropertyFromParameterPath(serviceClient, parameterPath);\n }\n let useDefaultValue = false;\n if (!propertySearchResult.propertyFound) {\n useDefaultValue =\n parameterMapper.required ||\n (parameterPath[0] === \"options\" && parameterPath.length === 2);\n }\n value = useDefaultValue ? parameterMapper.defaultValue : propertySearchResult.propertyValue;\n }\n // Serialize just for validation purposes.\n const parameterPathString = getPathStringFromParameterPath(parameterPath, parameterMapper);\n serializer.serialize(parameterMapper, value, parameterPathString, serializerOptions);\n }\n }\n else {\n if (parameterMapper.required) {\n value = {};\n }\n for (const propertyName in parameterPath) {\n const propertyMapper = parameterMapper.type.modelProperties[propertyName];\n const propertyPath = parameterPath[propertyName];\n const propertyValue = getOperationArgumentValueFromParameterPath(serviceClient, operationArguments, propertyPath, propertyMapper, serializer);\n // Serialize just for validation purposes.\n const propertyPathString = getPathStringFromParameterPath(propertyPath, propertyMapper);\n serializer.serialize(propertyMapper, propertyValue, propertyPathString, serializerOptions);\n if (propertyValue !== undefined && propertyValue !== null) {\n if (!value) {\n value = {};\n }\n value[propertyName] = propertyValue;\n }\n }\n }\n return value;\n}\nfunction getPropertyFromParameterPath(parent, parameterPath) {\n const result = { propertyFound: false };\n let i = 0;\n for (; i < parameterPath.length; ++i) {\n const parameterPathPart = parameterPath[i];\n // Make sure to check inherited properties too, so don't use hasOwnProperty().\n if (parent !== undefined && parent !== null && parameterPathPart in parent) {\n parent = parent[parameterPathPart];\n }\n else {\n break;\n }\n }\n if (i === parameterPath.length) {\n result.propertyValue = parent;\n result.propertyFound = true;\n }\n return result;\n}\n/**\n * Parses an {@link HttpOperationResponse} into a normalized HTTP response object ({@link RestResponse}).\n * @param _response - Wrapper object for http response.\n * @param responseSpec - Mappers for how to parse the response properties.\n * @returns - A normalized response object.\n */\nfunction flattenResponse(_response, responseSpec) {\n const parsedHeaders = _response.parsedHeaders;\n const bodyMapper = responseSpec && responseSpec.bodyMapper;\n const addOperationResponse = (obj) => {\n return Object.defineProperty(obj, \"_response\", {\n value: _response,\n });\n };\n if (bodyMapper) {\n const typeName = bodyMapper.type.name;\n if (typeName === \"Stream\") {\n return addOperationResponse(Object.assign(Object.assign({}, parsedHeaders), { blobBody: _response.blobBody, readableStreamBody: _response.readableStreamBody }));\n }\n const modelProperties = (typeName === \"Composite\" && bodyMapper.type.modelProperties) || {};\n const isPageableResponse = Object.keys(modelProperties).some((k) => modelProperties[k].serializedName === \"\");\n if (typeName === \"Sequence\" || isPageableResponse) {\n const arrayResponse = [...(_response.parsedBody || [])];\n for (const key of Object.keys(modelProperties)) {\n if (modelProperties[key].serializedName) {\n arrayResponse[key] = _response.parsedBody[key];\n }\n }\n if (parsedHeaders) {\n for (const key of Object.keys(parsedHeaders)) {\n arrayResponse[key] = parsedHeaders[key];\n }\n }\n addOperationResponse(arrayResponse);\n return arrayResponse;\n }\n if (typeName === \"Composite\" || typeName === \"Dictionary\") {\n return addOperationResponse(Object.assign(Object.assign({}, parsedHeaders), _response.parsedBody));\n }\n }\n if (bodyMapper ||\n _response.request.method === \"HEAD\" ||\n isPrimitiveType(_response.parsedBody)) {\n // primitive body types and HEAD booleans\n return addOperationResponse(Object.assign(Object.assign({}, parsedHeaders), { body: _response.parsedBody }));\n }\n return addOperationResponse(Object.assign(Object.assign({}, parsedHeaders), _response.parsedBody));\n}\nfunction getCredentialScopes(options, baseUri) {\n if (options === null || options === void 0 ? void 0 : options.credentialScopes) {\n return options.credentialScopes;\n }\n if (baseUri) {\n return `${baseUri}/.default`;\n }\n return undefined;\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * This function is only here for compatibility. Use createSpanFunction in core-tracing.\n *\n * @deprecated This function is only here for compatibility. Use createSpanFunction in core-tracing.\n * @hidden\n\n * @param spanConfig - The name of the operation being performed.\n * @param tracingOptions - The options for the underlying http request.\n */\nfunction createSpanFunction(args) {\n return coreTracing.createSpanFunction(args);\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Defines the default token refresh buffer duration.\n */\nconst TokenRefreshBufferMs = 2 * 60 * 1000; // 2 Minutes\n/**\n * Provides an {@link AccessTokenCache} implementation which clears\n * the cached {@link AccessToken}'s after the expiresOnTimestamp has\n * passed.\n *\n * @deprecated No longer used in the bearer authorization policy.\n */\nclass ExpiringAccessTokenCache {\n /**\n * Constructs an instance of {@link ExpiringAccessTokenCache} with\n * an optional expiration buffer time.\n */\n constructor(tokenRefreshBufferMs = TokenRefreshBufferMs) {\n this.cachedToken = undefined;\n this.tokenRefreshBufferMs = tokenRefreshBufferMs;\n }\n /**\n * Saves an access token into the internal in-memory cache.\n * @param accessToken - Access token or undefined to clear the cache.\n */\n setCachedToken(accessToken) {\n this.cachedToken = accessToken;\n }\n /**\n * Returns the cached access token, or `undefined` if one is not cached or the cached one is expiring soon.\n */\n getCachedToken() {\n if (this.cachedToken &&\n Date.now() + this.tokenRefreshBufferMs >= this.cachedToken.expiresOnTimestamp) {\n this.cachedToken = undefined;\n }\n return this.cachedToken;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Helps the core-http token authentication policies with requesting a new token if we're not currently waiting for a new token.\n *\n * @deprecated No longer used in the bearer authorization policy.\n */\nclass AccessTokenRefresher {\n constructor(credential, scopes, requiredMillisecondsBeforeNewRefresh = 30000) {\n this.credential = credential;\n this.scopes = scopes;\n this.requiredMillisecondsBeforeNewRefresh = requiredMillisecondsBeforeNewRefresh;\n this.lastCalled = 0;\n }\n /**\n * Returns true if the required milliseconds(defaulted to 30000) have been passed signifying\n * that we are ready for a new refresh.\n */\n isReady() {\n // We're only ready for a new refresh if the required milliseconds have passed.\n return (!this.lastCalled || Date.now() - this.lastCalled > this.requiredMillisecondsBeforeNewRefresh);\n }\n /**\n * Stores the time in which it is called,\n * then requests a new token,\n * then sets this.promise to undefined,\n * then returns the token.\n */\n async getToken(options) {\n this.lastCalled = Date.now();\n const token = await this.credential.getToken(this.scopes, options);\n this.promise = undefined;\n return token || undefined;\n }\n /**\n * Requests a new token if we're not currently waiting for a new token.\n * Returns null if the required time between each call hasn't been reached.\n */\n refresh(options) {\n if (!this.promise) {\n this.promise = this.getToken(options);\n }\n return this.promise;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nconst HeaderConstants = Constants.HeaderConstants;\nconst DEFAULT_AUTHORIZATION_SCHEME = \"Basic\";\n/**\n * A simple {@link ServiceClientCredential} that authenticates with a username and a password.\n */\nclass BasicAuthenticationCredentials {\n /**\n * Creates a new BasicAuthenticationCredentials object.\n *\n * @param userName - User name.\n * @param password - Password.\n * @param authorizationScheme - The authorization scheme.\n */\n constructor(userName, password, authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME) {\n /**\n * Authorization scheme. Defaults to \"Basic\".\n * More information about authorization schemes is available here: https://developer.mozilla.org/docs/Web/HTTP/Authentication#authentication_schemes\n */\n this.authorizationScheme = DEFAULT_AUTHORIZATION_SCHEME;\n if (userName === null || userName === undefined || typeof userName.valueOf() !== \"string\") {\n throw new Error(\"userName cannot be null or undefined and must be of type string.\");\n }\n if (password === null || password === undefined || typeof password.valueOf() !== \"string\") {\n throw new Error(\"password cannot be null or undefined and must be of type string.\");\n }\n this.userName = userName;\n this.password = password;\n this.authorizationScheme = authorizationScheme;\n }\n /**\n * Signs a request with the Authentication header.\n *\n * @param webResource - The WebResourceLike to be signed.\n * @returns The signed request object.\n */\n signRequest(webResource) {\n const credentials = `${this.userName}:${this.password}`;\n const encodedCredentials = `${this.authorizationScheme} ${encodeString(credentials)}`;\n if (!webResource.headers)\n webResource.headers = new HttpHeaders();\n webResource.headers.set(HeaderConstants.AUTHORIZATION, encodedCredentials);\n return Promise.resolve(webResource);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Authenticates to a service using an API key.\n */\nclass ApiKeyCredentials {\n /**\n * @param options - Specifies the options to be provided for auth. Either header or query needs to be provided.\n */\n constructor(options) {\n if (!options || (options && !options.inHeader && !options.inQuery)) {\n throw new Error(`options cannot be null or undefined. Either \"inHeader\" or \"inQuery\" property of the options object needs to be provided.`);\n }\n this.inHeader = options.inHeader;\n this.inQuery = options.inQuery;\n }\n /**\n * Signs a request with the values provided in the inHeader and inQuery parameter.\n *\n * @param webResource - The WebResourceLike to be signed.\n * @returns The signed request object.\n */\n signRequest(webResource) {\n if (!webResource) {\n return Promise.reject(new Error(`webResource cannot be null or undefined and must be of type \"object\".`));\n }\n if (this.inHeader) {\n if (!webResource.headers) {\n webResource.headers = new HttpHeaders();\n }\n for (const headerName in this.inHeader) {\n webResource.headers.set(headerName, this.inHeader[headerName]);\n }\n }\n if (this.inQuery) {\n if (!webResource.url) {\n return Promise.reject(new Error(`url cannot be null in the request object.`));\n }\n if (webResource.url.indexOf(\"?\") < 0) {\n webResource.url += \"?\";\n }\n for (const key in this.inQuery) {\n if (!webResource.url.endsWith(\"?\")) {\n webResource.url += \"&\";\n }\n webResource.url += `${key}=${this.inQuery[key]}`;\n }\n }\n return Promise.resolve(webResource);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A {@link TopicCredentials} object used for Azure Event Grid.\n */\nclass TopicCredentials extends ApiKeyCredentials {\n /**\n * Creates a new EventGrid TopicCredentials object.\n *\n * @param topicKey - The EventGrid topic key\n */\n constructor(topicKey) {\n if (!topicKey || (topicKey && typeof topicKey !== \"string\")) {\n throw new Error(\"topicKey cannot be null or undefined and must be of type string.\");\n }\n const options = {\n inHeader: {\n \"aeg-sas-key\": topicKey,\n },\n };\n super(options);\n }\n}\n\nObject.defineProperty(exports, 'delay', {\n enumerable: true,\n get: function () { return coreUtil.delay; }\n});\nObject.defineProperty(exports, 'isNode', {\n enumerable: true,\n get: function () { return coreUtil.isNode; }\n});\nObject.defineProperty(exports, 'isTokenCredential', {\n enumerable: true,\n get: function () { return coreAuth.isTokenCredential; }\n});\nexports.AccessTokenRefresher = AccessTokenRefresher;\nexports.ApiKeyCredentials = ApiKeyCredentials;\nexports.BaseRequestPolicy = BaseRequestPolicy;\nexports.BasicAuthenticationCredentials = BasicAuthenticationCredentials;\nexports.Constants = Constants;\nexports.DefaultHttpClient = NodeFetchHttpClient;\nexports.ExpiringAccessTokenCache = ExpiringAccessTokenCache;\nexports.HttpHeaders = HttpHeaders;\nexports.MapperType = MapperType;\nexports.RequestPolicyOptions = RequestPolicyOptions;\nexports.RestError = RestError;\nexports.Serializer = Serializer;\nexports.ServiceClient = ServiceClient;\nexports.TopicCredentials = TopicCredentials;\nexports.URLBuilder = URLBuilder;\nexports.URLQuery = URLQuery;\nexports.WebResource = WebResource;\nexports.XML_ATTRKEY = XML_ATTRKEY;\nexports.XML_CHARKEY = XML_CHARKEY;\nexports.applyMixins = applyMixins;\nexports.bearerTokenAuthenticationPolicy = bearerTokenAuthenticationPolicy;\nexports.createPipelineFromOptions = createPipelineFromOptions;\nexports.createSpanFunction = createSpanFunction;\nexports.deserializationPolicy = deserializationPolicy;\nexports.deserializeResponseBody = deserializeResponseBody;\nexports.disableResponseDecompressionPolicy = disableResponseDecompressionPolicy;\nexports.encodeUri = encodeUri;\nexports.executePromisesSequentially = executePromisesSequentially;\nexports.exponentialRetryPolicy = exponentialRetryPolicy;\nexports.flattenResponse = flattenResponse;\nexports.generateClientRequestIdPolicy = generateClientRequestIdPolicy;\nexports.generateUuid = generateUuid;\nexports.getDefaultProxySettings = getDefaultProxySettings;\nexports.getDefaultUserAgentValue = getDefaultUserAgentValue;\nexports.isDuration = isDuration;\nexports.isValidUuid = isValidUuid;\nexports.keepAlivePolicy = keepAlivePolicy;\nexports.logPolicy = logPolicy;\nexports.operationOptionsToRequestOptionsBase = operationOptionsToRequestOptionsBase;\nexports.parseXML = parseXML;\nexports.promiseToCallback = promiseToCallback;\nexports.promiseToServiceCallback = promiseToServiceCallback;\nexports.proxyPolicy = proxyPolicy;\nexports.redirectPolicy = redirectPolicy;\nexports.serializeObject = serializeObject;\nexports.signingPolicy = signingPolicy;\nexports.stringifyXML = stringifyXML;\nexports.stripRequest = stripRequest;\nexports.stripResponse = stripResponse;\nexports.systemErrorRetryPolicy = systemErrorRetryPolicy;\nexports.throttlingRetryPolicy = throttlingRetryPolicy;\nexports.tracingPolicy = tracingPolicy;\nexports.userAgentPolicy = userAgentPolicy;\n//# sourceMappingURL=index.js.map\n","var CombinedStream = require('combined-stream');\nvar util = require('util');\nvar path = require('path');\nvar http = require('http');\nvar https = require('https');\nvar parseUrl = require('url').parse;\nvar fs = require('fs');\nvar Stream = require('stream').Stream;\nvar mime = require('mime-types');\nvar asynckit = require('asynckit');\nvar populate = require('./populate.js');\n\n// Public API\nmodule.exports = FormData;\n\n// make it a Stream\nutil.inherits(FormData, CombinedStream);\n\n/**\n * Create readable \"multipart/form-data\" streams.\n * Can be used to submit forms\n * and file uploads to other web applications.\n *\n * @constructor\n * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream\n */\nfunction FormData(options) {\n if (!(this instanceof FormData)) {\n return new FormData(options);\n }\n\n this._overheadLength = 0;\n this._valueLength = 0;\n this._valuesToMeasure = [];\n\n CombinedStream.call(this);\n\n options = options || {};\n for (var option in options) {\n this[option] = options[option];\n }\n}\n\nFormData.LINE_BREAK = '\\r\\n';\nFormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n\nFormData.prototype.append = function(field, value, options) {\n\n options = options || {};\n\n // allow filename as single option\n if (typeof options == 'string') {\n options = {filename: options};\n }\n\n var append = CombinedStream.prototype.append.bind(this);\n\n // all that streamy business can't handle numbers\n if (typeof value == 'number') {\n value = '' + value;\n }\n\n // https://github.com/felixge/node-form-data/issues/38\n if (util.isArray(value)) {\n // Please convert your array into string\n // the way web server expects it\n this._error(new Error('Arrays are not supported.'));\n return;\n }\n\n var header = this._multiPartHeader(field, value, options);\n var footer = this._multiPartFooter();\n\n append(header);\n append(value);\n append(footer);\n\n // pass along options.knownLength\n this._trackLength(header, value, options);\n};\n\nFormData.prototype._trackLength = function(header, value, options) {\n var valueLength = 0;\n\n // used w/ getLengthSync(), when length is known.\n // e.g. for streaming directly from a remote server,\n // w/ a known file a size, and not wanting to wait for\n // incoming file to finish to get its size.\n if (options.knownLength != null) {\n valueLength += +options.knownLength;\n } else if (Buffer.isBuffer(value)) {\n valueLength = value.length;\n } else if (typeof value === 'string') {\n valueLength = Buffer.byteLength(value);\n }\n\n this._valueLength += valueLength;\n\n // @check why add CRLF? does this account for custom/multiple CRLFs?\n this._overheadLength +=\n Buffer.byteLength(header) +\n FormData.LINE_BREAK.length;\n\n // empty or either doesn't have path or not an http response or not a stream\n if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) && !(value instanceof Stream))) {\n return;\n }\n\n // no need to bother with the length\n if (!options.knownLength) {\n this._valuesToMeasure.push(value);\n }\n};\n\nFormData.prototype._lengthRetriever = function(value, callback) {\n\n if (value.hasOwnProperty('fd')) {\n\n // take read range into a account\n // `end` = Infinity –> read file till the end\n //\n // TODO: Looks like there is bug in Node fs.createReadStream\n // it doesn't respect `end` options without `start` options\n // Fix it when node fixes it.\n // https://github.com/joyent/node/issues/7819\n if (value.end != undefined && value.end != Infinity && value.start != undefined) {\n\n // when end specified\n // no need to calculate range\n // inclusive, starts with 0\n callback(null, value.end + 1 - (value.start ? value.start : 0));\n\n // not that fast snoopy\n } else {\n // still need to fetch file size from fs\n fs.stat(value.path, function(err, stat) {\n\n var fileSize;\n\n if (err) {\n callback(err);\n return;\n }\n\n // update final size based on the range options\n fileSize = stat.size - (value.start ? value.start : 0);\n callback(null, fileSize);\n });\n }\n\n // or http response\n } else if (value.hasOwnProperty('httpVersion')) {\n callback(null, +value.headers['content-length']);\n\n // or request stream http://github.com/mikeal/request\n } else if (value.hasOwnProperty('httpModule')) {\n // wait till response come back\n value.on('response', function(response) {\n value.pause();\n callback(null, +response.headers['content-length']);\n });\n value.resume();\n\n // something else\n } else {\n callback('Unknown stream');\n }\n};\n\nFormData.prototype._multiPartHeader = function(field, value, options) {\n // custom header specified (as string)?\n // it becomes responsible for boundary\n // (e.g. to handle extra CRLFs on .NET servers)\n if (typeof options.header == 'string') {\n return options.header;\n }\n\n var contentDisposition = this._getContentDisposition(value, options);\n var contentType = this._getContentType(value, options);\n\n var contents = '';\n var headers = {\n // add custom disposition as third element or keep it two elements if not\n 'Content-Disposition': ['form-data', 'name=\"' + field + '\"'].concat(contentDisposition || []),\n // if no content type. allow it to be empty array\n 'Content-Type': [].concat(contentType || [])\n };\n\n // allow custom headers.\n if (typeof options.header == 'object') {\n populate(headers, options.header);\n }\n\n var header;\n for (var prop in headers) {\n if (!headers.hasOwnProperty(prop)) continue;\n header = headers[prop];\n\n // skip nullish headers.\n if (header == null) {\n continue;\n }\n\n // convert all headers to arrays.\n if (!Array.isArray(header)) {\n header = [header];\n }\n\n // add non-empty headers.\n if (header.length) {\n contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;\n }\n }\n\n return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;\n};\n\nFormData.prototype._getContentDisposition = function(value, options) {\n\n var filename\n , contentDisposition\n ;\n\n if (typeof options.filepath === 'string') {\n // custom filepath for relative paths\n filename = path.normalize(options.filepath).replace(/\\\\/g, '/');\n } else if (options.filename || value.name || value.path) {\n // custom filename take precedence\n // formidable and the browser add a name property\n // fs- and request- streams have path property\n filename = path.basename(options.filename || value.name || value.path);\n } else if (value.readable && value.hasOwnProperty('httpVersion')) {\n // or try http response\n filename = path.basename(value.client._httpMessage.path || '');\n }\n\n if (filename) {\n contentDisposition = 'filename=\"' + filename + '\"';\n }\n\n return contentDisposition;\n};\n\nFormData.prototype._getContentType = function(value, options) {\n\n // use custom content-type above all\n var contentType = options.contentType;\n\n // or try `name` from formidable, browser\n if (!contentType && value.name) {\n contentType = mime.lookup(value.name);\n }\n\n // or try `path` from fs-, request- streams\n if (!contentType && value.path) {\n contentType = mime.lookup(value.path);\n }\n\n // or if it's http-reponse\n if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {\n contentType = value.headers['content-type'];\n }\n\n // or guess it from the filepath or filename\n if (!contentType && (options.filepath || options.filename)) {\n contentType = mime.lookup(options.filepath || options.filename);\n }\n\n // fallback to the default content type if `value` is not simple value\n if (!contentType && typeof value == 'object') {\n contentType = FormData.DEFAULT_CONTENT_TYPE;\n }\n\n return contentType;\n};\n\nFormData.prototype._multiPartFooter = function() {\n return function(next) {\n var footer = FormData.LINE_BREAK;\n\n var lastPart = (this._streams.length === 0);\n if (lastPart) {\n footer += this._lastBoundary();\n }\n\n next(footer);\n }.bind(this);\n};\n\nFormData.prototype._lastBoundary = function() {\n return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;\n};\n\nFormData.prototype.getHeaders = function(userHeaders) {\n var header;\n var formHeaders = {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()\n };\n\n for (header in userHeaders) {\n if (userHeaders.hasOwnProperty(header)) {\n formHeaders[header.toLowerCase()] = userHeaders[header];\n }\n }\n\n return formHeaders;\n};\n\nFormData.prototype.setBoundary = function(boundary) {\n this._boundary = boundary;\n};\n\nFormData.prototype.getBoundary = function() {\n if (!this._boundary) {\n this._generateBoundary();\n }\n\n return this._boundary;\n};\n\nFormData.prototype.getBuffer = function() {\n var dataBuffer = new Buffer.alloc( 0 );\n var boundary = this.getBoundary();\n\n // Create the form content. Add Line breaks to the end of data.\n for (var i = 0, len = this._streams.length; i < len; i++) {\n if (typeof this._streams[i] !== 'function') {\n\n // Add content to the buffer.\n if(Buffer.isBuffer(this._streams[i])) {\n dataBuffer = Buffer.concat( [dataBuffer, this._streams[i]]);\n }else {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(this._streams[i])]);\n }\n\n // Add break after content.\n if (typeof this._streams[i] !== 'string' || this._streams[i].substring( 2, boundary.length + 2 ) !== boundary) {\n dataBuffer = Buffer.concat( [dataBuffer, Buffer.from(FormData.LINE_BREAK)] );\n }\n }\n }\n\n // Add the footer and return the Buffer object.\n return Buffer.concat( [dataBuffer, Buffer.from(this._lastBoundary())] );\n};\n\nFormData.prototype._generateBoundary = function() {\n // This generates a 50 character boundary similar to those used by Firefox.\n // They are optimized for boyer-moore parsing.\n var boundary = '--------------------------';\n for (var i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n\n this._boundary = boundary;\n};\n\n// Note: getLengthSync DOESN'T calculate streams length\n// As workaround one can calculate file size manually\n// and add it as knownLength option\nFormData.prototype.getLengthSync = function() {\n var knownLength = this._overheadLength + this._valueLength;\n\n // Don't get confused, there are 3 \"internal\" streams for each keyval pair\n // so it basically checks if there is any value added to the form\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n // https://github.com/form-data/form-data/issues/40\n if (!this.hasKnownLength()) {\n // Some async length retrievers are present\n // therefore synchronous length calculation is false.\n // Please use getLength(callback) to get proper length\n this._error(new Error('Cannot calculate proper length in synchronous way.'));\n }\n\n return knownLength;\n};\n\n// Public API to check if length of added values is known\n// https://github.com/form-data/form-data/issues/196\n// https://github.com/form-data/form-data/issues/262\nFormData.prototype.hasKnownLength = function() {\n var hasKnownLength = true;\n\n if (this._valuesToMeasure.length) {\n hasKnownLength = false;\n }\n\n return hasKnownLength;\n};\n\nFormData.prototype.getLength = function(cb) {\n var knownLength = this._overheadLength + this._valueLength;\n\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n if (!this._valuesToMeasure.length) {\n process.nextTick(cb.bind(this, null, knownLength));\n return;\n }\n\n asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {\n if (err) {\n cb(err);\n return;\n }\n\n values.forEach(function(length) {\n knownLength += length;\n });\n\n cb(null, knownLength);\n });\n};\n\nFormData.prototype.submit = function(params, cb) {\n var request\n , options\n , defaults = {method: 'post'}\n ;\n\n // parse provided url if it's string\n // or treat it as options object\n if (typeof params == 'string') {\n\n params = parseUrl(params);\n options = populate({\n port: params.port,\n path: params.pathname,\n host: params.hostname,\n protocol: params.protocol\n }, defaults);\n\n // use custom params\n } else {\n\n options = populate(params, defaults);\n // if no port provided use default one\n if (!options.port) {\n options.port = options.protocol == 'https:' ? 443 : 80;\n }\n }\n\n // put that good code in getHeaders to some use\n options.headers = this.getHeaders(params.headers);\n\n // https if specified, fallback to http in any other case\n if (options.protocol == 'https:') {\n request = https.request(options);\n } else {\n request = http.request(options);\n }\n\n // get content length and fire away\n this.getLength(function(err, length) {\n if (err && err !== 'Unknown stream') {\n this._error(err);\n return;\n }\n\n // add content length\n if (length) {\n request.setHeader('Content-Length', length);\n }\n\n this.pipe(request);\n if (cb) {\n var onResponse;\n\n var callback = function (error, responce) {\n request.removeListener('error', callback);\n request.removeListener('response', onResponse);\n\n return cb.call(this, error, responce);\n };\n\n onResponse = callback.bind(this, null);\n\n request.on('error', callback);\n request.on('response', onResponse);\n }\n }.bind(this));\n\n return request;\n};\n\nFormData.prototype._error = function(err) {\n if (!this.error) {\n this.error = err;\n this.pause();\n this.emit('error', err);\n }\n};\n\nFormData.prototype.toString = function () {\n return '[object FormData]';\n};\n","// populates missing values\nmodule.exports = function(dst, src) {\n\n Object.keys(src).forEach(function(prop)\n {\n dst[prop] = dst[prop] || src[prop];\n });\n\n return dst;\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\nObject.defineProperty(exports, \"NIL\", {\n enumerable: true,\n get: function () {\n return _nil.default;\n }\n});\nObject.defineProperty(exports, \"version\", {\n enumerable: true,\n get: function () {\n return _version.default;\n }\n});\nObject.defineProperty(exports, \"validate\", {\n enumerable: true,\n get: function () {\n return _validate.default;\n }\n});\nObject.defineProperty(exports, \"stringify\", {\n enumerable: true,\n get: function () {\n return _stringify.default;\n }\n});\nObject.defineProperty(exports, \"parse\", {\n enumerable: true,\n get: function () {\n return _parse.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nvar _nil = _interopRequireDefault(require(\"./nil.js\"));\n\nvar _version = _interopRequireDefault(require(\"./version.js\"));\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = '00000000-0000-0000-0000-000000000000';\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction parse(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n let v;\n const arr = new Uint8Array(16); // Parse ########-....-....-....-............\n\n arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;\n arr[1] = v >>> 16 & 0xff;\n arr[2] = v >>> 8 & 0xff;\n arr[3] = v & 0xff; // Parse ........-####-....-....-............\n\n arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;\n arr[5] = v & 0xff; // Parse ........-....-####-....-............\n\n arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;\n arr[7] = v & 0xff; // Parse ........-....-....-####-............\n\n arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;\n arr[9] = v & 0xff; // Parse ........-....-....-....-############\n // (Use \"/\" to avoid 32-bit truncation when bit-shifting high-order bytes)\n\n arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000 & 0xff;\n arr[11] = v / 0x100000000 & 0xff;\n arr[12] = v >>> 24 & 0xff;\n arr[13] = v >>> 16 & 0xff;\n arr[14] = v >>> 8 & 0xff;\n arr[15] = v & 0xff;\n return arr;\n}\n\nvar _default = parse;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst rnds8Pool = new Uint8Array(256); // # of random values to pre-allocate\n\nlet poolPtr = rnds8Pool.length;\n\nfunction rng() {\n if (poolPtr > rnds8Pool.length - 16) {\n _crypto.default.randomFillSync(rnds8Pool);\n\n poolPtr = 0;\n }\n\n return rnds8Pool.slice(poolPtr, poolPtr += 16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nconst byteToHex = [];\n\nfor (let i = 0; i < 256; ++i) {\n byteToHex.push((i + 0x100).toString(16).substr(1));\n}\n\nfunction stringify(arr, offset = 0) {\n // Note: Be careful editing this code! It's been tuned for performance\n // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434\n const uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one\n // of the following:\n // - One or more input array values don't map to a hex octet (leading to\n // \"undefined\" in the uuid)\n // - Invalid input values for the RFC `version` or `variant` fields\n\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Stringified UUID is invalid');\n }\n\n return uuid;\n}\n\nvar _default = stringify;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nlet _nodeId;\n\nlet _clockseq; // Previous uuid creation time\n\n\nlet _lastMSecs = 0;\nlet _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n let i = buf && offset || 0;\n const b = buf || new Array(16);\n options = options || {};\n let node = options.node || _nodeId;\n let clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n const seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n let msecs = options.msecs !== undefined ? options.msecs : Date.now(); // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n\n let nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n const tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (let n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf || (0, _stringify.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nvar _parse = _interopRequireDefault(require(\"./parse.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n const bytes = [];\n\n for (let i = 0; i < str.length; ++i) {\n bytes.push(str.charCodeAt(i));\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n function generateUUID(value, namespace, buf, offset) {\n if (typeof value === 'string') {\n value = stringToBytes(value);\n }\n\n if (typeof namespace === 'string') {\n namespace = (0, _parse.default)(namespace);\n }\n\n if (namespace.length !== 16) {\n throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)');\n } // Compute hash of namespace and value, Per 4.3\n // Future: Use spread syntax when supported on all platforms, e.g. `bytes =\n // hashfunc([...namespace, ... value])`\n\n\n let bytes = new Uint8Array(16 + value.length);\n bytes.set(namespace);\n bytes.set(value, namespace.length);\n bytes = hashfunc(bytes);\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = bytes[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(bytes);\n } // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name; // eslint-disable-next-line no-empty\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _stringify = _interopRequireDefault(require(\"./stringify.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n options = options || {};\n\n const rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n offset = offset || 0;\n\n for (let i = 0; i < 16; ++i) {\n buf[offset + i] = rnds[i];\n }\n\n return buf;\n }\n\n return (0, _stringify.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _regex = _interopRequireDefault(require(\"./regex.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction validate(uuid) {\n return typeof uuid === 'string' && _regex.default.test(uuid);\n}\n\nvar _default = validate;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _validate = _interopRequireDefault(require(\"./validate.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction version(uuid) {\n if (!(0, _validate.default)(uuid)) {\n throw TypeError('Invalid UUID');\n }\n\n return parseInt(uuid.substr(14, 1), 16);\n}\n\nvar _default = version;\nexports.default = _default;","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar logger$1 = require('@azure/logger');\nvar abortController = require('@azure/abort-controller');\nvar coreUtil = require('@azure/core-util');\n\n// Copyright (c) Microsoft Corporation.\n/**\n * The `@azure/logger` configuration for this package.\n * @internal\n */\nconst logger = logger$1.createClientLogger(\"core-lro\");\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * The default time interval to wait before sending the next polling request.\n */\nconst POLL_INTERVAL_IN_MS = 2000;\n/**\n * The closed set of terminal states.\n */\nconst terminalStates = [\"succeeded\", \"canceled\", \"failed\"];\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Deserializes the state\n */\nfunction deserializeState(serializedState) {\n try {\n return JSON.parse(serializedState).state;\n }\n catch (e) {\n throw new Error(`Unable to deserialize input state: ${serializedState}`);\n }\n}\nfunction setStateError(inputs) {\n const { state, stateProxy, isOperationError } = inputs;\n return (error) => {\n if (isOperationError(error)) {\n stateProxy.setError(state, error);\n stateProxy.setFailed(state);\n }\n throw error;\n };\n}\nfunction appendReadableErrorMessage(currentMessage, innerMessage) {\n let message = currentMessage;\n if (message.slice(-1) !== \".\") {\n message = message + \".\";\n }\n return message + \" \" + innerMessage;\n}\nfunction simplifyError(err) {\n let message = err.message;\n let code = err.code;\n let curErr = err;\n while (curErr.innererror) {\n curErr = curErr.innererror;\n code = curErr.code;\n message = appendReadableErrorMessage(message, curErr.message);\n }\n return {\n code,\n message,\n };\n}\nfunction processOperationStatus(result) {\n const { state, stateProxy, status, isDone, processResult, getError, response, setErrorAsResult } = result;\n switch (status) {\n case \"succeeded\": {\n stateProxy.setSucceeded(state);\n break;\n }\n case \"failed\": {\n const err = getError === null || getError === void 0 ? void 0 : getError(response);\n let postfix = \"\";\n if (err) {\n const { code, message } = simplifyError(err);\n postfix = `. ${code}. ${message}`;\n }\n const errStr = `The long-running operation has failed${postfix}`;\n stateProxy.setError(state, new Error(errStr));\n stateProxy.setFailed(state);\n logger.warning(errStr);\n break;\n }\n case \"canceled\": {\n stateProxy.setCanceled(state);\n break;\n }\n }\n if ((isDone === null || isDone === void 0 ? void 0 : isDone(response, state)) ||\n (isDone === undefined &&\n [\"succeeded\", \"canceled\"].concat(setErrorAsResult ? [] : [\"failed\"]).includes(status))) {\n stateProxy.setResult(state, buildResult({\n response,\n state,\n processResult,\n }));\n }\n}\nfunction buildResult(inputs) {\n const { processResult, response, state } = inputs;\n return processResult ? processResult(response, state) : response;\n}\n/**\n * Initiates the long-running operation.\n */\nasync function initOperation(inputs) {\n const { init, stateProxy, processResult, getOperationStatus, withOperationLocation, setErrorAsResult, } = inputs;\n const { operationLocation, resourceLocation, metadata, response } = await init();\n if (operationLocation)\n withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false);\n const config = {\n metadata,\n operationLocation,\n resourceLocation,\n };\n logger.verbose(`LRO: Operation description:`, config);\n const state = stateProxy.initState(config);\n const status = getOperationStatus({ response, state, operationLocation });\n processOperationStatus({ state, status, stateProxy, response, setErrorAsResult, processResult });\n return state;\n}\nasync function pollOperationHelper(inputs) {\n const { poll, state, stateProxy, operationLocation, getOperationStatus, getResourceLocation, isOperationError, options, } = inputs;\n const response = await poll(operationLocation, options).catch(setStateError({\n state,\n stateProxy,\n isOperationError,\n }));\n const status = getOperationStatus(response, state);\n logger.verbose(`LRO: Status:\\n\\tPolling from: ${state.config.operationLocation}\\n\\tOperation status: ${status}\\n\\tPolling status: ${terminalStates.includes(status) ? \"Stopped\" : \"Running\"}`);\n if (status === \"succeeded\") {\n const resourceLocation = getResourceLocation(response, state);\n if (resourceLocation !== undefined) {\n return {\n response: await poll(resourceLocation).catch(setStateError({ state, stateProxy, isOperationError })),\n status,\n };\n }\n }\n return { response, status };\n}\n/** Polls the long-running operation. */\nasync function pollOperation(inputs) {\n const { poll, state, stateProxy, options, getOperationStatus, getResourceLocation, getOperationLocation, isOperationError, withOperationLocation, getPollingInterval, processResult, getError, updateState, setDelay, isDone, setErrorAsResult, } = inputs;\n const { operationLocation } = state.config;\n if (operationLocation !== undefined) {\n const { response, status } = await pollOperationHelper({\n poll,\n getOperationStatus,\n state,\n stateProxy,\n operationLocation,\n getResourceLocation,\n isOperationError,\n options,\n });\n processOperationStatus({\n status,\n response,\n state,\n stateProxy,\n isDone,\n processResult,\n getError,\n setErrorAsResult,\n });\n if (!terminalStates.includes(status)) {\n const intervalInMs = getPollingInterval === null || getPollingInterval === void 0 ? void 0 : getPollingInterval(response);\n if (intervalInMs)\n setDelay(intervalInMs);\n const location = getOperationLocation === null || getOperationLocation === void 0 ? void 0 : getOperationLocation(response, state);\n if (location !== undefined) {\n const isUpdated = operationLocation !== location;\n state.config.operationLocation = location;\n withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(location, isUpdated);\n }\n else\n withOperationLocation === null || withOperationLocation === void 0 ? void 0 : withOperationLocation(operationLocation, false);\n }\n updateState === null || updateState === void 0 ? void 0 : updateState(state, response);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nfunction getOperationLocationPollingUrl(inputs) {\n const { azureAsyncOperation, operationLocation } = inputs;\n return operationLocation !== null && operationLocation !== void 0 ? operationLocation : azureAsyncOperation;\n}\nfunction getLocationHeader(rawResponse) {\n return rawResponse.headers[\"location\"];\n}\nfunction getOperationLocationHeader(rawResponse) {\n return rawResponse.headers[\"operation-location\"];\n}\nfunction getAzureAsyncOperationHeader(rawResponse) {\n return rawResponse.headers[\"azure-asyncoperation\"];\n}\nfunction findResourceLocation(inputs) {\n var _a;\n const { location, requestMethod, requestPath, resourceLocationConfig } = inputs;\n switch (requestMethod) {\n case \"PUT\": {\n return requestPath;\n }\n case \"DELETE\": {\n return undefined;\n }\n case \"PATCH\": {\n return (_a = getDefault()) !== null && _a !== void 0 ? _a : requestPath;\n }\n default: {\n return getDefault();\n }\n }\n function getDefault() {\n switch (resourceLocationConfig) {\n case \"azure-async-operation\": {\n return undefined;\n }\n case \"original-uri\": {\n return requestPath;\n }\n case \"location\":\n default: {\n return location;\n }\n }\n }\n}\nfunction inferLroMode(inputs) {\n const { rawResponse, requestMethod, requestPath, resourceLocationConfig } = inputs;\n const operationLocation = getOperationLocationHeader(rawResponse);\n const azureAsyncOperation = getAzureAsyncOperationHeader(rawResponse);\n const pollingUrl = getOperationLocationPollingUrl({ operationLocation, azureAsyncOperation });\n const location = getLocationHeader(rawResponse);\n const normalizedRequestMethod = requestMethod === null || requestMethod === void 0 ? void 0 : requestMethod.toLocaleUpperCase();\n if (pollingUrl !== undefined) {\n return {\n mode: \"OperationLocation\",\n operationLocation: pollingUrl,\n resourceLocation: findResourceLocation({\n requestMethod: normalizedRequestMethod,\n location,\n requestPath,\n resourceLocationConfig,\n }),\n };\n }\n else if (location !== undefined) {\n return {\n mode: \"ResourceLocation\",\n operationLocation: location,\n };\n }\n else if (normalizedRequestMethod === \"PUT\" && requestPath) {\n return {\n mode: \"Body\",\n operationLocation: requestPath,\n };\n }\n else {\n return undefined;\n }\n}\nfunction transformStatus(inputs) {\n const { status, statusCode } = inputs;\n if (typeof status !== \"string\" && status !== undefined) {\n throw new Error(`Polling was unsuccessful. Expected status to have a string value or no value but it has instead: ${status}. This doesn't necessarily indicate the operation has failed. Check your Azure subscription or resource status for more information.`);\n }\n switch (status === null || status === void 0 ? void 0 : status.toLocaleLowerCase()) {\n case undefined:\n return toOperationStatus(statusCode);\n case \"succeeded\":\n return \"succeeded\";\n case \"failed\":\n return \"failed\";\n case \"running\":\n case \"accepted\":\n case \"started\":\n case \"canceling\":\n case \"cancelling\":\n return \"running\";\n case \"canceled\":\n case \"cancelled\":\n return \"canceled\";\n default: {\n logger.verbose(`LRO: unrecognized operation status: ${status}`);\n return status;\n }\n }\n}\nfunction getStatus(rawResponse) {\n var _a;\n const { status } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};\n return transformStatus({ status, statusCode: rawResponse.statusCode });\n}\nfunction getProvisioningState(rawResponse) {\n var _a, _b;\n const { properties, provisioningState } = (_a = rawResponse.body) !== null && _a !== void 0 ? _a : {};\n const status = (_b = properties === null || properties === void 0 ? void 0 : properties.provisioningState) !== null && _b !== void 0 ? _b : provisioningState;\n return transformStatus({ status, statusCode: rawResponse.statusCode });\n}\nfunction toOperationStatus(statusCode) {\n if (statusCode === 202) {\n return \"running\";\n }\n else if (statusCode < 300) {\n return \"succeeded\";\n }\n else {\n return \"failed\";\n }\n}\nfunction parseRetryAfter({ rawResponse }) {\n const retryAfter = rawResponse.headers[\"retry-after\"];\n if (retryAfter !== undefined) {\n // Retry-After header value is either in HTTP date format, or in seconds\n const retryAfterInSeconds = parseInt(retryAfter);\n return isNaN(retryAfterInSeconds)\n ? calculatePollingIntervalFromDate(new Date(retryAfter))\n : retryAfterInSeconds * 1000;\n }\n return undefined;\n}\nfunction getErrorFromResponse(response) {\n const error = response.flatResponse.error;\n if (!error) {\n logger.warning(`The long-running operation failed but there is no error property in the response's body`);\n return;\n }\n if (!error.code || !error.message) {\n logger.warning(`The long-running operation failed but the error property in the response's body doesn't contain code or message`);\n return;\n }\n return error;\n}\nfunction calculatePollingIntervalFromDate(retryAfterDate) {\n const timeNow = Math.floor(new Date().getTime());\n const retryAfterTime = retryAfterDate.getTime();\n if (timeNow < retryAfterTime) {\n return retryAfterTime - timeNow;\n }\n return undefined;\n}\nfunction getStatusFromInitialResponse(inputs) {\n const { response, state, operationLocation } = inputs;\n function helper() {\n var _a;\n const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a[\"mode\"];\n switch (mode) {\n case undefined:\n return toOperationStatus(response.rawResponse.statusCode);\n case \"Body\":\n return getOperationStatus(response, state);\n default:\n return \"running\";\n }\n }\n const status = helper();\n return status === \"running\" && operationLocation === undefined ? \"succeeded\" : status;\n}\n/**\n * Initiates the long-running operation.\n */\nasync function initHttpOperation(inputs) {\n const { stateProxy, resourceLocationConfig, processResult, lro, setErrorAsResult } = inputs;\n return initOperation({\n init: async () => {\n const response = await lro.sendInitialRequest();\n const config = inferLroMode({\n rawResponse: response.rawResponse,\n requestPath: lro.requestPath,\n requestMethod: lro.requestMethod,\n resourceLocationConfig,\n });\n return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}));\n },\n stateProxy,\n processResult: processResult\n ? ({ flatResponse }, state) => processResult(flatResponse, state)\n : ({ flatResponse }) => flatResponse,\n getOperationStatus: getStatusFromInitialResponse,\n setErrorAsResult,\n });\n}\nfunction getOperationLocation({ rawResponse }, state) {\n var _a;\n const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a[\"mode\"];\n switch (mode) {\n case \"OperationLocation\": {\n return getOperationLocationPollingUrl({\n operationLocation: getOperationLocationHeader(rawResponse),\n azureAsyncOperation: getAzureAsyncOperationHeader(rawResponse),\n });\n }\n case \"ResourceLocation\": {\n return getLocationHeader(rawResponse);\n }\n case \"Body\":\n default: {\n return undefined;\n }\n }\n}\nfunction getOperationStatus({ rawResponse }, state) {\n var _a;\n const mode = (_a = state.config.metadata) === null || _a === void 0 ? void 0 : _a[\"mode\"];\n switch (mode) {\n case \"OperationLocation\": {\n return getStatus(rawResponse);\n }\n case \"ResourceLocation\": {\n return toOperationStatus(rawResponse.statusCode);\n }\n case \"Body\": {\n return getProvisioningState(rawResponse);\n }\n default:\n throw new Error(`Internal error: Unexpected operation mode: ${mode}`);\n }\n}\nfunction getResourceLocation({ flatResponse }, state) {\n if (typeof flatResponse === \"object\") {\n const resourceLocation = flatResponse.resourceLocation;\n if (resourceLocation !== undefined) {\n state.config.resourceLocation = resourceLocation;\n }\n }\n return state.config.resourceLocation;\n}\nfunction isOperationError(e) {\n return e.name === \"RestError\";\n}\n/** Polls the long-running operation. */\nasync function pollHttpOperation(inputs) {\n const { lro, stateProxy, options, processResult, updateState, setDelay, state, setErrorAsResult, } = inputs;\n return pollOperation({\n state,\n stateProxy,\n setDelay,\n processResult: processResult\n ? ({ flatResponse }, inputState) => processResult(flatResponse, inputState)\n : ({ flatResponse }) => flatResponse,\n getError: getErrorFromResponse,\n updateState,\n getPollingInterval: parseRetryAfter,\n getOperationLocation,\n getOperationStatus,\n isOperationError,\n getResourceLocation,\n options,\n /**\n * The expansion here is intentional because `lro` could be an object that\n * references an inner this, so we need to preserve a reference to it.\n */\n poll: async (location, inputOptions) => lro.sendPollRequest(location, inputOptions),\n setErrorAsResult,\n });\n}\n\n// Copyright (c) Microsoft Corporation.\nconst createStateProxy$1 = () => ({\n /**\n * The state at this point is created to be of type OperationState.\n * It will be updated later to be of type TState when the\n * customer-provided callback, `updateState`, is called during polling.\n */\n initState: (config) => ({ status: \"running\", config }),\n setCanceled: (state) => (state.status = \"canceled\"),\n setError: (state, error) => (state.error = error),\n setResult: (state, result) => (state.result = result),\n setRunning: (state) => (state.status = \"running\"),\n setSucceeded: (state) => (state.status = \"succeeded\"),\n setFailed: (state) => (state.status = \"failed\"),\n getError: (state) => state.error,\n getResult: (state) => state.result,\n isCanceled: (state) => state.status === \"canceled\",\n isFailed: (state) => state.status === \"failed\",\n isRunning: (state) => state.status === \"running\",\n isSucceeded: (state) => state.status === \"succeeded\",\n});\n/**\n * Returns a poller factory.\n */\nfunction buildCreatePoller(inputs) {\n const { getOperationLocation, getStatusFromInitialResponse, getStatusFromPollResponse, isOperationError, getResourceLocation, getPollingInterval, getError, resolveOnUnsuccessful, } = inputs;\n return async ({ init, poll }, options) => {\n const { processResult, updateState, withOperationLocation: withOperationLocationCallback, intervalInMs = POLL_INTERVAL_IN_MS, restoreFrom, } = options || {};\n const stateProxy = createStateProxy$1();\n const withOperationLocation = withOperationLocationCallback\n ? (() => {\n let called = false;\n return (operationLocation, isUpdated) => {\n if (isUpdated)\n withOperationLocationCallback(operationLocation);\n else if (!called)\n withOperationLocationCallback(operationLocation);\n called = true;\n };\n })()\n : undefined;\n const state = restoreFrom\n ? deserializeState(restoreFrom)\n : await initOperation({\n init,\n stateProxy,\n processResult,\n getOperationStatus: getStatusFromInitialResponse,\n withOperationLocation,\n setErrorAsResult: !resolveOnUnsuccessful,\n });\n let resultPromise;\n const abortController$1 = new abortController.AbortController();\n const handlers = new Map();\n const handleProgressEvents = async () => handlers.forEach((h) => h(state));\n const cancelErrMsg = \"Operation was canceled\";\n let currentPollIntervalInMs = intervalInMs;\n const poller = {\n getOperationState: () => state,\n getResult: () => state.result,\n isDone: () => [\"succeeded\", \"failed\", \"canceled\"].includes(state.status),\n isStopped: () => resultPromise === undefined,\n stopPolling: () => {\n abortController$1.abort();\n },\n toString: () => JSON.stringify({\n state,\n }),\n onProgress: (callback) => {\n const s = Symbol();\n handlers.set(s, callback);\n return () => handlers.delete(s);\n },\n pollUntilDone: (pollOptions) => (resultPromise !== null && resultPromise !== void 0 ? resultPromise : (resultPromise = (async () => {\n const { abortSignal: inputAbortSignal } = pollOptions || {};\n const { signal: abortSignal } = inputAbortSignal\n ? new abortController.AbortController([inputAbortSignal, abortController$1.signal])\n : abortController$1;\n if (!poller.isDone()) {\n await poller.poll({ abortSignal });\n while (!poller.isDone()) {\n await coreUtil.delay(currentPollIntervalInMs, { abortSignal });\n await poller.poll({ abortSignal });\n }\n }\n if (resolveOnUnsuccessful) {\n return poller.getResult();\n }\n else {\n switch (state.status) {\n case \"succeeded\":\n return poller.getResult();\n case \"canceled\":\n throw new Error(cancelErrMsg);\n case \"failed\":\n throw state.error;\n case \"notStarted\":\n case \"running\":\n throw new Error(`Polling completed without succeeding or failing`);\n }\n }\n })().finally(() => {\n resultPromise = undefined;\n }))),\n async poll(pollOptions) {\n if (resolveOnUnsuccessful) {\n if (poller.isDone())\n return;\n }\n else {\n switch (state.status) {\n case \"succeeded\":\n return;\n case \"canceled\":\n throw new Error(cancelErrMsg);\n case \"failed\":\n throw state.error;\n }\n }\n await pollOperation({\n poll,\n state,\n stateProxy,\n getOperationLocation,\n isOperationError,\n withOperationLocation,\n getPollingInterval,\n getOperationStatus: getStatusFromPollResponse,\n getResourceLocation,\n processResult,\n getError,\n updateState,\n options: pollOptions,\n setDelay: (pollIntervalInMs) => {\n currentPollIntervalInMs = pollIntervalInMs;\n },\n setErrorAsResult: !resolveOnUnsuccessful,\n });\n await handleProgressEvents();\n if (!resolveOnUnsuccessful) {\n switch (state.status) {\n case \"canceled\":\n throw new Error(cancelErrMsg);\n case \"failed\":\n throw state.error;\n }\n }\n },\n };\n return poller;\n };\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Creates a poller that can be used to poll a long-running operation.\n * @param lro - Description of the long-running operation\n * @param options - options to configure the poller\n * @returns an initialized poller\n */\nasync function createHttpPoller(lro, options) {\n const { resourceLocationConfig, intervalInMs, processResult, restoreFrom, updateState, withOperationLocation, resolveOnUnsuccessful = false, } = options || {};\n return buildCreatePoller({\n getStatusFromInitialResponse,\n getStatusFromPollResponse: getOperationStatus,\n isOperationError,\n getOperationLocation,\n getResourceLocation,\n getPollingInterval: parseRetryAfter,\n getError: getErrorFromResponse,\n resolveOnUnsuccessful,\n })({\n init: async () => {\n const response = await lro.sendInitialRequest();\n const config = inferLroMode({\n rawResponse: response.rawResponse,\n requestPath: lro.requestPath,\n requestMethod: lro.requestMethod,\n resourceLocationConfig,\n });\n return Object.assign({ response, operationLocation: config === null || config === void 0 ? void 0 : config.operationLocation, resourceLocation: config === null || config === void 0 ? void 0 : config.resourceLocation }, ((config === null || config === void 0 ? void 0 : config.mode) ? { metadata: { mode: config.mode } } : {}));\n },\n poll: lro.sendPollRequest,\n }, {\n intervalInMs,\n withOperationLocation,\n restoreFrom,\n updateState,\n processResult: processResult\n ? ({ flatResponse }, state) => processResult(flatResponse, state)\n : ({ flatResponse }) => flatResponse,\n });\n}\n\n// Copyright (c) Microsoft Corporation.\nconst createStateProxy = () => ({\n initState: (config) => ({ config, isStarted: true }),\n setCanceled: (state) => (state.isCancelled = true),\n setError: (state, error) => (state.error = error),\n setResult: (state, result) => (state.result = result),\n setRunning: (state) => (state.isStarted = true),\n setSucceeded: (state) => (state.isCompleted = true),\n setFailed: () => {\n /** empty body */\n },\n getError: (state) => state.error,\n getResult: (state) => state.result,\n isCanceled: (state) => !!state.isCancelled,\n isFailed: (state) => !!state.error,\n isRunning: (state) => !!state.isStarted,\n isSucceeded: (state) => Boolean(state.isCompleted && !state.isCancelled && !state.error),\n});\nclass GenericPollOperation {\n constructor(state, lro, setErrorAsResult, lroResourceLocationConfig, processResult, updateState, isDone) {\n this.state = state;\n this.lro = lro;\n this.setErrorAsResult = setErrorAsResult;\n this.lroResourceLocationConfig = lroResourceLocationConfig;\n this.processResult = processResult;\n this.updateState = updateState;\n this.isDone = isDone;\n }\n setPollerConfig(pollerConfig) {\n this.pollerConfig = pollerConfig;\n }\n async update(options) {\n var _a;\n const stateProxy = createStateProxy();\n if (!this.state.isStarted) {\n this.state = Object.assign(Object.assign({}, this.state), (await initHttpOperation({\n lro: this.lro,\n stateProxy,\n resourceLocationConfig: this.lroResourceLocationConfig,\n processResult: this.processResult,\n setErrorAsResult: this.setErrorAsResult,\n })));\n }\n const updateState = this.updateState;\n const isDone = this.isDone;\n if (!this.state.isCompleted && this.state.error === undefined) {\n await pollHttpOperation({\n lro: this.lro,\n state: this.state,\n stateProxy,\n processResult: this.processResult,\n updateState: updateState\n ? (state, { rawResponse }) => updateState(state, rawResponse)\n : undefined,\n isDone: isDone\n ? ({ flatResponse }, state) => isDone(flatResponse, state)\n : undefined,\n options,\n setDelay: (intervalInMs) => {\n this.pollerConfig.intervalInMs = intervalInMs;\n },\n setErrorAsResult: this.setErrorAsResult,\n });\n }\n (_a = options === null || options === void 0 ? void 0 : options.fireProgress) === null || _a === void 0 ? void 0 : _a.call(options, this.state);\n return this;\n }\n async cancel() {\n logger.error(\"`cancelOperation` is deprecated because it wasn't implemented\");\n return this;\n }\n /**\n * Serializes the Poller operation.\n */\n toString() {\n return JSON.stringify({\n state: this.state,\n });\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * When a poller is manually stopped through the `stopPolling` method,\n * the poller will be rejected with an instance of the PollerStoppedError.\n */\nclass PollerStoppedError extends Error {\n constructor(message) {\n super(message);\n this.name = \"PollerStoppedError\";\n Object.setPrototypeOf(this, PollerStoppedError.prototype);\n }\n}\n/**\n * When the operation is cancelled, the poller will be rejected with an instance\n * of the PollerCancelledError.\n */\nclass PollerCancelledError extends Error {\n constructor(message) {\n super(message);\n this.name = \"PollerCancelledError\";\n Object.setPrototypeOf(this, PollerCancelledError.prototype);\n }\n}\n/**\n * A class that represents the definition of a program that polls through consecutive requests\n * until it reaches a state of completion.\n *\n * A poller can be executed manually, by polling request by request by calling to the `poll()` method repeatedly, until its operation is completed.\n * It also provides a way to wait until the operation completes, by calling `pollUntilDone()` and waiting until the operation finishes.\n * Pollers can also request the cancellation of the ongoing process to whom is providing the underlying long running operation.\n *\n * ```ts\n * const poller = new MyPoller();\n *\n * // Polling just once:\n * await poller.poll();\n *\n * // We can try to cancel the request here, by calling:\n * //\n * // await poller.cancelOperation();\n * //\n *\n * // Getting the final result:\n * const result = await poller.pollUntilDone();\n * ```\n *\n * The Poller is defined by two types, a type representing the state of the poller, which\n * must include a basic set of properties from `PollOperationState`,\n * and a return type defined by `TResult`, which can be anything.\n *\n * The Poller class implements the `PollerLike` interface, which allows poller implementations to avoid having\n * to export the Poller's class directly, and instead only export the already instantiated poller with the PollerLike type.\n *\n * ```ts\n * class Client {\n * public async makePoller: PollerLike {\n * const poller = new MyPoller({});\n * // It might be preferred to return the poller after the first request is made,\n * // so that some information can be obtained right away.\n * await poller.poll();\n * return poller;\n * }\n * }\n *\n * const poller: PollerLike = myClient.makePoller();\n * ```\n *\n * A poller can be created through its constructor, then it can be polled until it's completed.\n * At any point in time, the state of the poller can be obtained without delay through the getOperationState method.\n * At any point in time, the intermediate forms of the result type can be requested without delay.\n * Once the underlying operation is marked as completed, the poller will stop and the final value will be returned.\n *\n * ```ts\n * const poller = myClient.makePoller();\n * const state: MyOperationState = poller.getOperationState();\n *\n * // The intermediate result can be obtained at any time.\n * const result: MyResult | undefined = poller.getResult();\n *\n * // The final result can only be obtained after the poller finishes.\n * const result: MyResult = await poller.pollUntilDone();\n * ```\n *\n */\n// eslint-disable-next-line no-use-before-define\nclass Poller {\n /**\n * A poller needs to be initialized by passing in at least the basic properties of the `PollOperation`.\n *\n * When writing an implementation of a Poller, this implementation needs to deal with the initialization\n * of any custom state beyond the basic definition of the poller. The basic poller assumes that the poller's\n * operation has already been defined, at least its basic properties. The code below shows how to approach\n * the definition of the constructor of a new custom poller.\n *\n * ```ts\n * export class MyPoller extends Poller {\n * constructor({\n * // Anything you might need outside of the basics\n * }) {\n * let state: MyOperationState = {\n * privateProperty: private,\n * publicProperty: public,\n * };\n *\n * const operation = {\n * state,\n * update,\n * cancel,\n * toString\n * }\n *\n * // Sending the operation to the parent's constructor.\n * super(operation);\n *\n * // You can assign more local properties here.\n * }\n * }\n * ```\n *\n * Inside of this constructor, a new promise is created. This will be used to\n * tell the user when the poller finishes (see `pollUntilDone()`). The promise's\n * resolve and reject methods are also used internally to control when to resolve\n * or reject anyone waiting for the poller to finish.\n *\n * The constructor of a custom implementation of a poller is where any serialized version of\n * a previous poller's operation should be deserialized into the operation sent to the\n * base constructor. For example:\n *\n * ```ts\n * export class MyPoller extends Poller {\n * constructor(\n * baseOperation: string | undefined\n * ) {\n * let state: MyOperationState = {};\n * if (baseOperation) {\n * state = {\n * ...JSON.parse(baseOperation).state,\n * ...state\n * };\n * }\n * const operation = {\n * state,\n * // ...\n * }\n * super(operation);\n * }\n * }\n * ```\n *\n * @param operation - Must contain the basic properties of `PollOperation`.\n */\n constructor(operation) {\n /** controls whether to throw an error if the operation failed or was canceled. */\n this.resolveOnUnsuccessful = false;\n this.stopped = true;\n this.pollProgressCallbacks = [];\n this.operation = operation;\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n // This prevents the UnhandledPromiseRejectionWarning in node.js from being thrown.\n // The above warning would get thrown if `poller.poll` is called, it returns an error,\n // and pullUntilDone did not have a .catch or await try/catch on it's return value.\n this.promise.catch(() => {\n /* intentionally blank */\n });\n }\n /**\n * Starts a loop that will break only if the poller is done\n * or if the poller is stopped.\n */\n async startPolling(pollOptions = {}) {\n if (this.stopped) {\n this.stopped = false;\n }\n while (!this.isStopped() && !this.isDone()) {\n await this.poll(pollOptions);\n await this.delay();\n }\n }\n /**\n * pollOnce does one polling, by calling to the update method of the underlying\n * poll operation to make any relevant change effective.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n async pollOnce(options = {}) {\n if (!this.isDone()) {\n this.operation = await this.operation.update({\n abortSignal: options.abortSignal,\n fireProgress: this.fireProgress.bind(this),\n });\n }\n this.processUpdatedState();\n }\n /**\n * fireProgress calls the functions passed in via onProgress the method of the poller.\n *\n * It loops over all of the callbacks received from onProgress, and executes them, sending them\n * the current operation state.\n *\n * @param state - The current operation state.\n */\n fireProgress(state) {\n for (const callback of this.pollProgressCallbacks) {\n callback(state);\n }\n }\n /**\n * Invokes the underlying operation's cancel method.\n */\n async cancelOnce(options = {}) {\n this.operation = await this.operation.cancel(options);\n }\n /**\n * Returns a promise that will resolve once a single polling request finishes.\n * It does this by calling the update method of the Poller's operation.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n poll(options = {}) {\n if (!this.pollOncePromise) {\n this.pollOncePromise = this.pollOnce(options);\n const clearPollOncePromise = () => {\n this.pollOncePromise = undefined;\n };\n this.pollOncePromise.then(clearPollOncePromise, clearPollOncePromise).catch(this.reject);\n }\n return this.pollOncePromise;\n }\n processUpdatedState() {\n if (this.operation.state.error) {\n this.stopped = true;\n if (!this.resolveOnUnsuccessful) {\n this.reject(this.operation.state.error);\n throw this.operation.state.error;\n }\n }\n if (this.operation.state.isCancelled) {\n this.stopped = true;\n if (!this.resolveOnUnsuccessful) {\n const error = new PollerCancelledError(\"Operation was canceled\");\n this.reject(error);\n throw error;\n }\n }\n if (this.isDone() && this.resolve) {\n // If the poller has finished polling, this means we now have a result.\n // However, it can be the case that TResult is instantiated to void, so\n // we are not expecting a result anyway. To assert that we might not\n // have a result eventually after finishing polling, we cast the result\n // to TResult.\n this.resolve(this.getResult());\n }\n }\n /**\n * Returns a promise that will resolve once the underlying operation is completed.\n */\n async pollUntilDone(pollOptions = {}) {\n if (this.stopped) {\n this.startPolling(pollOptions).catch(this.reject);\n }\n // This is needed because the state could have been updated by\n // `cancelOperation`, e.g. the operation is canceled or an error occurred.\n this.processUpdatedState();\n return this.promise;\n }\n /**\n * Invokes the provided callback after each polling is completed,\n * sending the current state of the poller's operation.\n *\n * It returns a method that can be used to stop receiving updates on the given callback function.\n */\n onProgress(callback) {\n this.pollProgressCallbacks.push(callback);\n return () => {\n this.pollProgressCallbacks = this.pollProgressCallbacks.filter((c) => c !== callback);\n };\n }\n /**\n * Returns true if the poller has finished polling.\n */\n isDone() {\n const state = this.operation.state;\n return Boolean(state.isCompleted || state.isCancelled || state.error);\n }\n /**\n * Stops the poller from continuing to poll.\n */\n stopPolling() {\n if (!this.stopped) {\n this.stopped = true;\n if (this.reject) {\n this.reject(new PollerStoppedError(\"This poller is already stopped\"));\n }\n }\n }\n /**\n * Returns true if the poller is stopped.\n */\n isStopped() {\n return this.stopped;\n }\n /**\n * Attempts to cancel the underlying operation.\n *\n * It only optionally receives an object with an abortSignal property, from \\@azure/abort-controller's AbortSignalLike.\n *\n * If it's called again before it finishes, it will throw an error.\n *\n * @param options - Optional properties passed to the operation's update method.\n */\n cancelOperation(options = {}) {\n if (!this.cancelPromise) {\n this.cancelPromise = this.cancelOnce(options);\n }\n else if (options.abortSignal) {\n throw new Error(\"A cancel request is currently pending\");\n }\n return this.cancelPromise;\n }\n /**\n * Returns the state of the operation.\n *\n * Even though TState will be the same type inside any of the methods of any extension of the Poller class,\n * implementations of the pollers can customize what's shared with the public by writing their own\n * version of the `getOperationState` method, and by defining two types, one representing the internal state of the poller\n * and a public type representing a safe to share subset of the properties of the internal state.\n * Their definition of getOperationState can then return their public type.\n *\n * Example:\n *\n * ```ts\n * // Let's say we have our poller's operation state defined as:\n * interface MyOperationState extends PollOperationState {\n * privateProperty?: string;\n * publicProperty?: string;\n * }\n *\n * // To allow us to have a true separation of public and private state, we have to define another interface:\n * interface PublicState extends PollOperationState {\n * publicProperty?: string;\n * }\n *\n * // Then, we define our Poller as follows:\n * export class MyPoller extends Poller {\n * // ... More content is needed here ...\n *\n * public getOperationState(): PublicState {\n * const state: PublicState = this.operation.state;\n * return {\n * // Properties from PollOperationState\n * isStarted: state.isStarted,\n * isCompleted: state.isCompleted,\n * isCancelled: state.isCancelled,\n * error: state.error,\n * result: state.result,\n *\n * // The only other property needed by PublicState.\n * publicProperty: state.publicProperty\n * }\n * }\n * }\n * ```\n *\n * You can see this in the tests of this repository, go to the file:\n * `../test/utils/testPoller.ts`\n * and look for the getOperationState implementation.\n */\n getOperationState() {\n return this.operation.state;\n }\n /**\n * Returns the result value of the operation,\n * regardless of the state of the poller.\n * It can return undefined or an incomplete form of the final TResult value\n * depending on the implementation.\n */\n getResult() {\n const state = this.operation.state;\n return state.result;\n }\n /**\n * Returns a serialized version of the poller's operation\n * by invoking the operation's toString method.\n */\n toString() {\n return this.operation.toString();\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * The LRO Engine, a class that performs polling.\n */\nclass LroEngine extends Poller {\n constructor(lro, options) {\n const { intervalInMs = POLL_INTERVAL_IN_MS, resumeFrom, resolveOnUnsuccessful = false, isDone, lroResourceLocationConfig, processResult, updateState, } = options || {};\n const state = resumeFrom\n ? deserializeState(resumeFrom)\n : {};\n const operation = new GenericPollOperation(state, lro, !resolveOnUnsuccessful, lroResourceLocationConfig, processResult, updateState, isDone);\n super(operation);\n this.resolveOnUnsuccessful = resolveOnUnsuccessful;\n this.config = { intervalInMs: intervalInMs };\n operation.setPollerConfig(this.config);\n }\n /**\n * The method used by the poller to wait before attempting to update its operation.\n */\n delay() {\n return new Promise((resolve) => setTimeout(() => resolve(), this.config.intervalInMs));\n }\n}\n\nexports.LroEngine = LroEngine;\nexports.Poller = Poller;\nexports.PollerCancelledError = PollerCancelledError;\nexports.PollerStoppedError = PollerStoppedError;\nexports.createHttpPoller = createHttpPoller;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar tslib = require('tslib');\n\n// Copyright (c) Microsoft Corporation.\n/**\n * returns an async iterator that iterates over results. It also has a `byPage`\n * method that returns pages of items at once.\n *\n * @param pagedResult - an object that specifies how to get pages.\n * @returns a paged async iterator that iterates over results.\n */\nfunction getPagedAsyncIterator(pagedResult) {\n var _a;\n const iter = getItemAsyncIterator(pagedResult);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (_a = pagedResult === null || pagedResult === void 0 ? void 0 : pagedResult.byPage) !== null && _a !== void 0 ? _a : ((settings) => {\n const { continuationToken, maxPageSize } = settings !== null && settings !== void 0 ? settings : {};\n return getPageAsyncIterator(pagedResult, {\n pageLink: continuationToken,\n maxPageSize,\n });\n }),\n };\n}\nfunction getItemAsyncIterator(pagedResult) {\n return tslib.__asyncGenerator(this, arguments, function* getItemAsyncIterator_1() {\n var e_1, _a, e_2, _b;\n const pages = getPageAsyncIterator(pagedResult);\n const firstVal = yield tslib.__await(pages.next());\n // if the result does not have an array shape, i.e. TPage = TElement, then we return it as is\n if (!Array.isArray(firstVal.value)) {\n // can extract elements from this page\n const { toElements } = pagedResult;\n if (toElements) {\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(toElements(firstVal.value))));\n try {\n for (var pages_1 = tslib.__asyncValues(pages), pages_1_1; pages_1_1 = yield tslib.__await(pages_1.next()), !pages_1_1.done;) {\n const page = pages_1_1.value;\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(toElements(page))));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (pages_1_1 && !pages_1_1.done && (_a = pages_1.return)) yield tslib.__await(_a.call(pages_1));\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n else {\n yield yield tslib.__await(firstVal.value);\n // `pages` is of type `AsyncIterableIterator` but TPage = TElement in this case\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(pages)));\n }\n }\n else {\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(firstVal.value)));\n try {\n for (var pages_2 = tslib.__asyncValues(pages), pages_2_1; pages_2_1 = yield tslib.__await(pages_2.next()), !pages_2_1.done;) {\n const page = pages_2_1.value;\n // pages is of type `AsyncIterableIterator` so `page` is of type `TPage`. In this branch,\n // it must be the case that `TPage = TElement[]`\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (pages_2_1 && !pages_2_1.done && (_b = pages_2.return)) yield tslib.__await(_b.call(pages_2));\n }\n finally { if (e_2) throw e_2.error; }\n }\n }\n });\n}\nfunction getPageAsyncIterator(pagedResult, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* getPageAsyncIterator_1() {\n const { pageLink, maxPageSize } = options;\n let response = yield tslib.__await(pagedResult.getPage(pageLink !== null && pageLink !== void 0 ? pageLink : pagedResult.firstPageLink, maxPageSize));\n if (!response) {\n return yield tslib.__await(void 0);\n }\n yield yield tslib.__await(response.page);\n while (response.nextPageLink) {\n response = yield tslib.__await(pagedResult.getPage(response.nextPageLink, maxPageSize));\n if (!response) {\n return yield tslib.__await(void 0);\n }\n yield yield tslib.__await(response.page);\n }\n });\n}\n\nexports.getPagedAsyncIterator = getPagedAsyncIterator;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar api = require('@opentelemetry/api');\n\n// Copyright (c) Microsoft Corporation.\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(exports.SpanKind || (exports.SpanKind = {}));\n/**\n * Return the span if one exists\n *\n * @param context - context to get span from\n */\nfunction getSpan(context) {\n return api.trace.getSpan(context);\n}\n/**\n * Set the span on a context\n *\n * @param context - context to use as parent\n * @param span - span to set active\n */\nfunction setSpan(context, span) {\n return api.trace.setSpan(context, span);\n}\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context - context to set active span on\n * @param spanContext - span context to be wrapped\n */\nfunction setSpanContext(context, spanContext) {\n return api.trace.setSpanContext(context, spanContext);\n}\n/**\n * Get the span context of the span if it exists.\n *\n * @param context - context to get values from\n */\nfunction getSpanContext(context) {\n return api.trace.getSpanContext(context);\n}\n/**\n * Returns true of the given {@link SpanContext} is valid.\n * A valid {@link SpanContext} is one which has a valid trace ID and span ID as per the spec.\n *\n * @param context - the {@link SpanContext} to validate.\n *\n * @returns true if the {@link SpanContext} is valid, false otherwise.\n */\nfunction isSpanContextValid(context) {\n return api.trace.isSpanContextValid(context);\n}\nfunction getTracer(name, version) {\n return api.trace.getTracer(name || \"azure/core-tracing\", version);\n}\n/** Entrypoint for context API */\nconst context = api.context;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(exports.SpanStatusCode || (exports.SpanStatusCode = {}));\n\n// Copyright (c) Microsoft Corporation.\nfunction isTracingDisabled() {\n var _a;\n if (typeof process === \"undefined\") {\n // not supported in browser for now without polyfills\n return false;\n }\n const azureTracingDisabledValue = (_a = process.env.AZURE_TRACING_DISABLED) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n if (azureTracingDisabledValue === \"false\" || azureTracingDisabledValue === \"0\") {\n return false;\n }\n return Boolean(azureTracingDisabledValue);\n}\n/**\n * Creates a function that can be used to create spans using the global tracer.\n *\n * Usage:\n *\n * ```typescript\n * // once\n * const createSpan = createSpanFunction({ packagePrefix: \"Azure.Data.AppConfiguration\", namespace: \"Microsoft.AppConfiguration\" });\n *\n * // in each operation\n * const span = createSpan(\"deleteConfigurationSetting\", operationOptions);\n * // code...\n * span.end();\n * ```\n *\n * @hidden\n * @param args - allows configuration of the prefix for each span as well as the az.namespace field.\n */\nfunction createSpanFunction(args) {\n return function (operationName, operationOptions) {\n const tracer = getTracer();\n const tracingOptions = (operationOptions === null || operationOptions === void 0 ? void 0 : operationOptions.tracingOptions) || {};\n const spanOptions = Object.assign({ kind: exports.SpanKind.INTERNAL }, tracingOptions.spanOptions);\n const spanName = args.packagePrefix ? `${args.packagePrefix}.${operationName}` : operationName;\n let span;\n if (isTracingDisabled()) {\n span = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);\n }\n else {\n span = tracer.startSpan(spanName, spanOptions, tracingOptions.tracingContext);\n }\n if (args.namespace) {\n span.setAttribute(\"az.namespace\", args.namespace);\n }\n let newSpanOptions = tracingOptions.spanOptions || {};\n if (span.isRecording() && args.namespace) {\n newSpanOptions = Object.assign(Object.assign({}, tracingOptions.spanOptions), { attributes: Object.assign(Object.assign({}, spanOptions.attributes), { \"az.namespace\": args.namespace }) });\n }\n const newTracingOptions = Object.assign(Object.assign({}, tracingOptions), { spanOptions: newSpanOptions, tracingContext: setSpan(tracingOptions.tracingContext || context.active(), span) });\n const newOperationOptions = Object.assign(Object.assign({}, operationOptions), { tracingOptions: newTracingOptions });\n return {\n span,\n updatedOptions: newOperationOptions\n };\n };\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nconst VERSION = \"00\";\n/**\n * Generates a `SpanContext` given a `traceparent` header value.\n * @param traceParent - Serialized span context data as a `traceparent` header value.\n * @returns The `SpanContext` generated from the `traceparent` value.\n */\nfunction extractSpanContextFromTraceParentHeader(traceParentHeader) {\n const parts = traceParentHeader.split(\"-\");\n if (parts.length !== 4) {\n return;\n }\n const [version, traceId, spanId, traceOptions] = parts;\n if (version !== VERSION) {\n return;\n }\n const traceFlags = parseInt(traceOptions, 16);\n const spanContext = {\n spanId,\n traceId,\n traceFlags\n };\n return spanContext;\n}\n/**\n * Generates a `traceparent` value given a span context.\n * @param spanContext - Contains context for a specific span.\n * @returns The `spanContext` represented as a `traceparent` value.\n */\nfunction getTraceParentHeader(spanContext) {\n const missingFields = [];\n if (!spanContext.traceId) {\n missingFields.push(\"traceId\");\n }\n if (!spanContext.spanId) {\n missingFields.push(\"spanId\");\n }\n if (missingFields.length) {\n return;\n }\n const flags = spanContext.traceFlags || 0 /* NONE */;\n const hexFlags = flags.toString(16);\n const traceFlags = hexFlags.length === 1 ? `0${hexFlags}` : hexFlags;\n // https://www.w3.org/TR/trace-context/#traceparent-header-field-values\n return `${VERSION}-${spanContext.traceId}-${spanContext.spanId}-${traceFlags}`;\n}\n\nexports.context = context;\nexports.createSpanFunction = createSpanFunction;\nexports.extractSpanContextFromTraceParentHeader = extractSpanContextFromTraceParentHeader;\nexports.getSpan = getSpan;\nexports.getSpanContext = getSpanContext;\nexports.getTraceParentHeader = getTraceParentHeader;\nexports.getTracer = getTracer;\nexports.isSpanContextValid = isSpanContextValid;\nexports.setSpan = setSpan;\nexports.setSpanContext = setSpanContext;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar abortController = require('@azure/abort-controller');\nvar crypto = require('crypto');\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Creates an abortable promise.\n * @param buildPromise - A function that takes the resolve and reject functions as parameters.\n * @param options - The options for the abortable promise.\n * @returns A promise that can be aborted.\n */\nfunction createAbortablePromise(buildPromise, options) {\n const { cleanupBeforeAbort, abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {};\n return new Promise((resolve, reject) => {\n function rejectOnAbort() {\n reject(new abortController.AbortError(abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : \"The operation was aborted.\"));\n }\n function removeListeners() {\n abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.removeEventListener(\"abort\", onAbort);\n }\n function onAbort() {\n cleanupBeforeAbort === null || cleanupBeforeAbort === void 0 ? void 0 : cleanupBeforeAbort();\n removeListeners();\n rejectOnAbort();\n }\n if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) {\n return rejectOnAbort();\n }\n try {\n buildPromise((x) => {\n removeListeners();\n resolve(x);\n }, (x) => {\n removeListeners();\n reject(x);\n });\n }\n catch (err) {\n reject(err);\n }\n abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.addEventListener(\"abort\", onAbort);\n });\n}\n\n// Copyright (c) Microsoft Corporation.\nconst StandardAbortMessage = \"The delay was aborted.\";\n/**\n * A wrapper for setTimeout that resolves a promise after timeInMs milliseconds.\n * @param timeInMs - The number of milliseconds to be delayed.\n * @param options - The options for delay - currently abort options\n * @returns Promise that is resolved after timeInMs\n */\nfunction delay(timeInMs, options) {\n let token;\n const { abortSignal, abortErrorMsg } = options !== null && options !== void 0 ? options : {};\n return createAbortablePromise((resolve) => {\n token = setTimeout(resolve, timeInMs);\n }, {\n cleanupBeforeAbort: () => clearTimeout(token),\n abortSignal,\n abortErrorMsg: abortErrorMsg !== null && abortErrorMsg !== void 0 ? abortErrorMsg : StandardAbortMessage,\n });\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Returns a random integer value between a lower and upper bound,\n * inclusive of both bounds.\n * Note that this uses Math.random and isn't secure. If you need to use\n * this for any kind of security purpose, find a better source of random.\n * @param min - The smallest integer value allowed.\n * @param max - The largest integer value allowed.\n */\nfunction getRandomIntegerInclusive(min, max) {\n // Make sure inputs are integers.\n min = Math.ceil(min);\n max = Math.floor(max);\n // Pick a random offset from zero to the size of the range.\n // Since Math.random() can never return 1, we have to make the range one larger\n // in order to be inclusive of the maximum value after we take the floor.\n const offset = Math.floor(Math.random() * (max - min + 1));\n return offset + min;\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Helper to determine when an input is a generic JS object.\n * @returns true when input is an object type that is not null, Array, RegExp, or Date.\n */\nfunction isObject(input) {\n return (typeof input === \"object\" &&\n input !== null &&\n !Array.isArray(input) &&\n !(input instanceof RegExp) &&\n !(input instanceof Date));\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Typeguard for an error object shape (has name and message)\n * @param e - Something caught by a catch clause.\n */\nfunction isError(e) {\n if (isObject(e)) {\n const hasName = typeof e.name === \"string\";\n const hasMessage = typeof e.message === \"string\";\n return hasName && hasMessage;\n }\n return false;\n}\n/**\n * Given what is thought to be an error object, return the message if possible.\n * If the message is missing, returns a stringified version of the input.\n * @param e - Something thrown from a try block\n * @returns The error message or a string of the input\n */\nfunction getErrorMessage(e) {\n if (isError(e)) {\n return e.message;\n }\n else {\n let stringified;\n try {\n if (typeof e === \"object\" && e) {\n stringified = JSON.stringify(e);\n }\n else {\n stringified = String(e);\n }\n }\n catch (err) {\n stringified = \"[unable to stringify input]\";\n }\n return `Unknown error ${stringified}`;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Generates a SHA-256 HMAC signature.\n * @param key - The HMAC key represented as a base64 string, used to generate the cryptographic HMAC hash.\n * @param stringToSign - The data to be signed.\n * @param encoding - The textual encoding to use for the returned HMAC digest.\n */\nasync function computeSha256Hmac(key, stringToSign, encoding) {\n const decodedKey = Buffer.from(key, \"base64\");\n return crypto.createHmac(\"sha256\", decodedKey).update(stringToSign).digest(encoding);\n}\n/**\n * Generates a SHA-256 hash.\n * @param content - The data to be included in the hash.\n * @param encoding - The textual encoding to use for the returned hash.\n */\nasync function computeSha256Hash(content, encoding) {\n return crypto.createHash(\"sha256\").update(content).digest(encoding);\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Helper TypeGuard that checks if something is defined or not.\n * @param thing - Anything\n */\nfunction isDefined(thing) {\n return typeof thing !== \"undefined\" && thing !== null;\n}\n/**\n * Helper TypeGuard that checks if the input is an object with the specified properties.\n * @param thing - Anything.\n * @param properties - The name of the properties that should appear in the object.\n */\nfunction isObjectWithProperties(thing, properties) {\n if (!isDefined(thing) || typeof thing !== \"object\") {\n return false;\n }\n for (const property of properties) {\n if (!objectHasProperty(thing, property)) {\n return false;\n }\n }\n return true;\n}\n/**\n * Helper TypeGuard that checks if the input is an object with the specified property.\n * @param thing - Any object.\n * @param property - The name of the property that should appear in the object.\n */\nfunction objectHasProperty(thing, property) {\n return (isDefined(thing) && typeof thing === \"object\" && property in thing);\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/*\n * NOTE: When moving this file, please update \"react-native\" section in package.json.\n */\n/**\n * Generated Universally Unique Identifier\n *\n * @returns RFC4122 v4 UUID.\n */\nfunction generateUUID() {\n let uuid = \"\";\n for (let i = 0; i < 32; i++) {\n // Generate a random number between 0 and 15\n const randomNumber = Math.floor(Math.random() * 16);\n // Set the UUID version to 4 in the 13th position\n if (i === 12) {\n uuid += \"4\";\n }\n else if (i === 16) {\n // Set the UUID variant to \"10\" in the 17th position\n uuid += (randomNumber & 0x3) | 0x8;\n }\n else {\n // Add a random hexadecimal digit to the UUID string\n uuid += randomNumber.toString(16);\n }\n // Add hyphens to the UUID string at the appropriate positions\n if (i === 7 || i === 11 || i === 15 || i === 19) {\n uuid += \"-\";\n }\n }\n return uuid;\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nvar _a$1;\n// NOTE: This is a workaround until we can use `globalThis.crypto.randomUUID` in Node.js 19+.\nlet uuidFunction = typeof ((_a$1 = globalThis === null || globalThis === void 0 ? void 0 : globalThis.crypto) === null || _a$1 === void 0 ? void 0 : _a$1.randomUUID) === \"function\"\n ? globalThis.crypto.randomUUID.bind(globalThis.crypto)\n : crypto.randomUUID;\n// Not defined in earlier versions of Node.js 14\nif (!uuidFunction) {\n uuidFunction = generateUUID;\n}\n/**\n * Generated Universally Unique Identifier\n *\n * @returns RFC4122 v4 UUID.\n */\nfunction randomUUID() {\n return uuidFunction();\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nvar _a, _b, _c, _d;\n/**\n * A constant that indicates whether the environment the code is running is a Web Browser.\n */\n// eslint-disable-next-line @azure/azure-sdk/ts-no-window\nconst isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\n/**\n * A constant that indicates whether the environment the code is running is a Web Worker.\n */\nconst isWebWorker = typeof self === \"object\" &&\n typeof (self === null || self === void 0 ? void 0 : self.importScripts) === \"function\" &&\n (((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === \"DedicatedWorkerGlobalScope\" ||\n ((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === \"ServiceWorkerGlobalScope\" ||\n ((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === \"SharedWorkerGlobalScope\");\n/**\n * A constant that indicates whether the environment the code is running is Node.JS.\n */\nconst isNode = typeof process !== \"undefined\" && Boolean(process.version) && Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node);\n/**\n * A constant that indicates whether the environment the code is running is Deno.\n */\nconst isDeno = typeof Deno !== \"undefined\" &&\n typeof Deno.version !== \"undefined\" &&\n typeof Deno.version.deno !== \"undefined\";\n/**\n * A constant that indicates whether the environment the code is running is Bun.sh.\n */\nconst isBun = typeof Bun !== \"undefined\" && typeof Bun.version !== \"undefined\";\n/**\n * A constant that indicates whether the environment the code is running is in React-Native.\n */\n// https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js\nconst isReactNative = typeof navigator !== \"undefined\" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === \"ReactNative\";\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * The helper that transforms bytes with specific character encoding into string\n * @param bytes - the uint8array bytes\n * @param format - the format we use to encode the byte\n * @returns a string of the encoded string\n */\nfunction uint8ArrayToString(bytes, format) {\n switch (format) {\n case \"utf-8\":\n return uint8ArrayToUtf8String(bytes);\n case \"base64\":\n return uint8ArrayToBase64(bytes);\n case \"base64url\":\n return uint8ArrayToBase64Url(bytes);\n }\n}\n/**\n * The helper that transforms string to specific character encoded bytes array.\n * @param value - the string to be converted\n * @param format - the format we use to decode the value\n * @returns a uint8array\n */\nfunction stringToUint8Array(value, format) {\n switch (format) {\n case \"utf-8\":\n return utf8StringToUint8Array(value);\n case \"base64\":\n return base64ToUint8Array(value);\n case \"base64url\":\n return base64UrlToUint8Array(value);\n }\n}\n/**\n * Decodes a Uint8Array into a Base64 string.\n * @internal\n */\nfunction uint8ArrayToBase64(bytes) {\n return Buffer.from(bytes).toString(\"base64\");\n}\n/**\n * Decodes a Uint8Array into a Base64Url string.\n * @internal\n */\nfunction uint8ArrayToBase64Url(bytes) {\n return Buffer.from(bytes).toString(\"base64url\");\n}\n/**\n * Decodes a Uint8Array into a javascript string.\n * @internal\n */\nfunction uint8ArrayToUtf8String(bytes) {\n return Buffer.from(bytes).toString(\"utf-8\");\n}\n/**\n * Encodes a JavaScript string into a Uint8Array.\n * @internal\n */\nfunction utf8StringToUint8Array(value) {\n return Buffer.from(value);\n}\n/**\n * Encodes a Base64 string into a Uint8Array.\n * @internal\n */\nfunction base64ToUint8Array(value) {\n return Buffer.from(value, \"base64\");\n}\n/**\n * Encodes a Base64Url string into a Uint8Array.\n * @internal\n */\nfunction base64UrlToUint8Array(value) {\n return Buffer.from(value, \"base64url\");\n}\n\nexports.computeSha256Hash = computeSha256Hash;\nexports.computeSha256Hmac = computeSha256Hmac;\nexports.createAbortablePromise = createAbortablePromise;\nexports.delay = delay;\nexports.getErrorMessage = getErrorMessage;\nexports.getRandomIntegerInclusive = getRandomIntegerInclusive;\nexports.isBrowser = isBrowser;\nexports.isBun = isBun;\nexports.isDefined = isDefined;\nexports.isDeno = isDeno;\nexports.isError = isError;\nexports.isNode = isNode;\nexports.isObject = isObject;\nexports.isObjectWithProperties = isObjectWithProperties;\nexports.isReactNative = isReactNative;\nexports.isWebWorker = isWebWorker;\nexports.objectHasProperty = objectHasProperty;\nexports.randomUUID = randomUUID;\nexports.stringToUint8Array = stringToUint8Array;\nexports.uint8ArrayToString = uint8ArrayToString;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar os = require('os');\nvar util = require('util');\n\nfunction _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }\n\nvar util__default = /*#__PURE__*/_interopDefaultLegacy(util);\n\n// Copyright (c) Microsoft Corporation.\nfunction log(message, ...args) {\n process.stderr.write(`${util__default[\"default\"].format(message, ...args)}${os.EOL}`);\n}\n\n// Copyright (c) Microsoft Corporation.\nconst debugEnvVariable = (typeof process !== \"undefined\" && process.env && process.env.DEBUG) || undefined;\nlet enabledString;\nlet enabledNamespaces = [];\nlet skippedNamespaces = [];\nconst debuggers = [];\nif (debugEnvVariable) {\n enable(debugEnvVariable);\n}\nconst debugObj = Object.assign((namespace) => {\n return createDebugger(namespace);\n}, {\n enable,\n enabled,\n disable,\n log,\n});\nfunction enable(namespaces) {\n enabledString = namespaces;\n enabledNamespaces = [];\n skippedNamespaces = [];\n const wildcard = /\\*/g;\n const namespaceList = namespaces.split(\",\").map((ns) => ns.trim().replace(wildcard, \".*?\"));\n for (const ns of namespaceList) {\n if (ns.startsWith(\"-\")) {\n skippedNamespaces.push(new RegExp(`^${ns.substr(1)}$`));\n }\n else {\n enabledNamespaces.push(new RegExp(`^${ns}$`));\n }\n }\n for (const instance of debuggers) {\n instance.enabled = enabled(instance.namespace);\n }\n}\nfunction enabled(namespace) {\n if (namespace.endsWith(\"*\")) {\n return true;\n }\n for (const skipped of skippedNamespaces) {\n if (skipped.test(namespace)) {\n return false;\n }\n }\n for (const enabledNamespace of enabledNamespaces) {\n if (enabledNamespace.test(namespace)) {\n return true;\n }\n }\n return false;\n}\nfunction disable() {\n const result = enabledString || \"\";\n enable(\"\");\n return result;\n}\nfunction createDebugger(namespace) {\n const newDebugger = Object.assign(debug, {\n enabled: enabled(namespace),\n destroy,\n log: debugObj.log,\n namespace,\n extend,\n });\n function debug(...args) {\n if (!newDebugger.enabled) {\n return;\n }\n if (args.length > 0) {\n args[0] = `${namespace} ${args[0]}`;\n }\n newDebugger.log(...args);\n }\n debuggers.push(newDebugger);\n return newDebugger;\n}\nfunction destroy() {\n const index = debuggers.indexOf(this);\n if (index >= 0) {\n debuggers.splice(index, 1);\n return true;\n }\n return false;\n}\nfunction extend(namespace) {\n const newDebugger = createDebugger(`${this.namespace}:${namespace}`);\n newDebugger.log = this.log;\n return newDebugger;\n}\nvar debug = debugObj;\n\n// Copyright (c) Microsoft Corporation.\nconst registeredLoggers = new Set();\nconst logLevelFromEnv = (typeof process !== \"undefined\" && process.env && process.env.AZURE_LOG_LEVEL) || undefined;\nlet azureLogLevel;\n/**\n * The AzureLogger provides a mechanism for overriding where logs are output to.\n * By default, logs are sent to stderr.\n * Override the `log` method to redirect logs to another location.\n */\nconst AzureLogger = debug(\"azure\");\nAzureLogger.log = (...args) => {\n debug.log(...args);\n};\nconst AZURE_LOG_LEVELS = [\"verbose\", \"info\", \"warning\", \"error\"];\nif (logLevelFromEnv) {\n // avoid calling setLogLevel because we don't want a mis-set environment variable to crash\n if (isAzureLogLevel(logLevelFromEnv)) {\n setLogLevel(logLevelFromEnv);\n }\n else {\n console.error(`AZURE_LOG_LEVEL set to unknown log level '${logLevelFromEnv}'; logging is not enabled. Acceptable values: ${AZURE_LOG_LEVELS.join(\", \")}.`);\n }\n}\n/**\n * Immediately enables logging at the specified log level. If no level is specified, logging is disabled.\n * @param level - The log level to enable for logging.\n * Options from most verbose to least verbose are:\n * - verbose\n * - info\n * - warning\n * - error\n */\nfunction setLogLevel(level) {\n if (level && !isAzureLogLevel(level)) {\n throw new Error(`Unknown log level '${level}'. Acceptable values: ${AZURE_LOG_LEVELS.join(\",\")}`);\n }\n azureLogLevel = level;\n const enabledNamespaces = [];\n for (const logger of registeredLoggers) {\n if (shouldEnable(logger)) {\n enabledNamespaces.push(logger.namespace);\n }\n }\n debug.enable(enabledNamespaces.join(\",\"));\n}\n/**\n * Retrieves the currently specified log level.\n */\nfunction getLogLevel() {\n return azureLogLevel;\n}\nconst levelMap = {\n verbose: 400,\n info: 300,\n warning: 200,\n error: 100,\n};\n/**\n * Creates a logger for use by the Azure SDKs that inherits from `AzureLogger`.\n * @param namespace - The name of the SDK package.\n * @hidden\n */\nfunction createClientLogger(namespace) {\n const clientRootLogger = AzureLogger.extend(namespace);\n patchLogMethod(AzureLogger, clientRootLogger);\n return {\n error: createLogger(clientRootLogger, \"error\"),\n warning: createLogger(clientRootLogger, \"warning\"),\n info: createLogger(clientRootLogger, \"info\"),\n verbose: createLogger(clientRootLogger, \"verbose\"),\n };\n}\nfunction patchLogMethod(parent, child) {\n child.log = (...args) => {\n parent.log(...args);\n };\n}\nfunction createLogger(parent, level) {\n const logger = Object.assign(parent.extend(level), {\n level,\n });\n patchLogMethod(parent, logger);\n if (shouldEnable(logger)) {\n const enabledNamespaces = debug.disable();\n debug.enable(enabledNamespaces + \",\" + logger.namespace);\n }\n registeredLoggers.add(logger);\n return logger;\n}\nfunction shouldEnable(logger) {\n return Boolean(azureLogLevel && levelMap[logger.level] <= levelMap[azureLogLevel]);\n}\nfunction isAzureLogLevel(logLevel) {\n return AZURE_LOG_LEVELS.includes(logLevel);\n}\n\nexports.AzureLogger = AzureLogger;\nexports.createClientLogger = createClientLogger;\nexports.getLogLevel = getLogLevel;\nexports.setLogLevel = setLogLevel;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar coreHttp = require('@azure/core-http');\nvar tslib = require('tslib');\nvar coreTracing = require('@azure/core-tracing');\nvar logger$1 = require('@azure/logger');\nvar abortController = require('@azure/abort-controller');\nvar os = require('os');\nvar crypto = require('crypto');\nvar stream = require('stream');\nrequire('@azure/core-paging');\nvar coreLro = require('@azure/core-lro');\nvar events = require('events');\nvar fs = require('fs');\nvar util = require('util');\n\nfunction _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n}\n\nvar coreHttp__namespace = /*#__PURE__*/_interopNamespace(coreHttp);\nvar os__namespace = /*#__PURE__*/_interopNamespace(os);\nvar fs__namespace = /*#__PURE__*/_interopNamespace(fs);\nvar util__namespace = /*#__PURE__*/_interopNamespace(util);\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\nconst BlobServiceProperties = {\n serializedName: \"BlobServiceProperties\",\n xmlName: \"StorageServiceProperties\",\n type: {\n name: \"Composite\",\n className: \"BlobServiceProperties\",\n modelProperties: {\n blobAnalyticsLogging: {\n serializedName: \"Logging\",\n xmlName: \"Logging\",\n type: {\n name: \"Composite\",\n className: \"Logging\"\n }\n },\n hourMetrics: {\n serializedName: \"HourMetrics\",\n xmlName: \"HourMetrics\",\n type: {\n name: \"Composite\",\n className: \"Metrics\"\n }\n },\n minuteMetrics: {\n serializedName: \"MinuteMetrics\",\n xmlName: \"MinuteMetrics\",\n type: {\n name: \"Composite\",\n className: \"Metrics\"\n }\n },\n cors: {\n serializedName: \"Cors\",\n xmlName: \"Cors\",\n xmlIsWrapped: true,\n xmlElementName: \"CorsRule\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"CorsRule\"\n }\n }\n }\n },\n defaultServiceVersion: {\n serializedName: \"DefaultServiceVersion\",\n xmlName: \"DefaultServiceVersion\",\n type: {\n name: \"String\"\n }\n },\n deleteRetentionPolicy: {\n serializedName: \"DeleteRetentionPolicy\",\n xmlName: \"DeleteRetentionPolicy\",\n type: {\n name: \"Composite\",\n className: \"RetentionPolicy\"\n }\n },\n staticWebsite: {\n serializedName: \"StaticWebsite\",\n xmlName: \"StaticWebsite\",\n type: {\n name: \"Composite\",\n className: \"StaticWebsite\"\n }\n }\n }\n }\n};\nconst Logging = {\n serializedName: \"Logging\",\n type: {\n name: \"Composite\",\n className: \"Logging\",\n modelProperties: {\n version: {\n serializedName: \"Version\",\n required: true,\n xmlName: \"Version\",\n type: {\n name: \"String\"\n }\n },\n deleteProperty: {\n serializedName: \"Delete\",\n required: true,\n xmlName: \"Delete\",\n type: {\n name: \"Boolean\"\n }\n },\n read: {\n serializedName: \"Read\",\n required: true,\n xmlName: \"Read\",\n type: {\n name: \"Boolean\"\n }\n },\n write: {\n serializedName: \"Write\",\n required: true,\n xmlName: \"Write\",\n type: {\n name: \"Boolean\"\n }\n },\n retentionPolicy: {\n serializedName: \"RetentionPolicy\",\n xmlName: \"RetentionPolicy\",\n type: {\n name: \"Composite\",\n className: \"RetentionPolicy\"\n }\n }\n }\n }\n};\nconst RetentionPolicy = {\n serializedName: \"RetentionPolicy\",\n type: {\n name: \"Composite\",\n className: \"RetentionPolicy\",\n modelProperties: {\n enabled: {\n serializedName: \"Enabled\",\n required: true,\n xmlName: \"Enabled\",\n type: {\n name: \"Boolean\"\n }\n },\n days: {\n constraints: {\n InclusiveMinimum: 1\n },\n serializedName: \"Days\",\n xmlName: \"Days\",\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\nconst Metrics = {\n serializedName: \"Metrics\",\n type: {\n name: \"Composite\",\n className: \"Metrics\",\n modelProperties: {\n version: {\n serializedName: \"Version\",\n xmlName: \"Version\",\n type: {\n name: \"String\"\n }\n },\n enabled: {\n serializedName: \"Enabled\",\n required: true,\n xmlName: \"Enabled\",\n type: {\n name: \"Boolean\"\n }\n },\n includeAPIs: {\n serializedName: \"IncludeAPIs\",\n xmlName: \"IncludeAPIs\",\n type: {\n name: \"Boolean\"\n }\n },\n retentionPolicy: {\n serializedName: \"RetentionPolicy\",\n xmlName: \"RetentionPolicy\",\n type: {\n name: \"Composite\",\n className: \"RetentionPolicy\"\n }\n }\n }\n }\n};\nconst CorsRule = {\n serializedName: \"CorsRule\",\n type: {\n name: \"Composite\",\n className: \"CorsRule\",\n modelProperties: {\n allowedOrigins: {\n serializedName: \"AllowedOrigins\",\n required: true,\n xmlName: \"AllowedOrigins\",\n type: {\n name: \"String\"\n }\n },\n allowedMethods: {\n serializedName: \"AllowedMethods\",\n required: true,\n xmlName: \"AllowedMethods\",\n type: {\n name: \"String\"\n }\n },\n allowedHeaders: {\n serializedName: \"AllowedHeaders\",\n required: true,\n xmlName: \"AllowedHeaders\",\n type: {\n name: \"String\"\n }\n },\n exposedHeaders: {\n serializedName: \"ExposedHeaders\",\n required: true,\n xmlName: \"ExposedHeaders\",\n type: {\n name: \"String\"\n }\n },\n maxAgeInSeconds: {\n constraints: {\n InclusiveMinimum: 0\n },\n serializedName: \"MaxAgeInSeconds\",\n required: true,\n xmlName: \"MaxAgeInSeconds\",\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\nconst StaticWebsite = {\n serializedName: \"StaticWebsite\",\n type: {\n name: \"Composite\",\n className: \"StaticWebsite\",\n modelProperties: {\n enabled: {\n serializedName: \"Enabled\",\n required: true,\n xmlName: \"Enabled\",\n type: {\n name: \"Boolean\"\n }\n },\n indexDocument: {\n serializedName: \"IndexDocument\",\n xmlName: \"IndexDocument\",\n type: {\n name: \"String\"\n }\n },\n errorDocument404Path: {\n serializedName: \"ErrorDocument404Path\",\n xmlName: \"ErrorDocument404Path\",\n type: {\n name: \"String\"\n }\n },\n defaultIndexDocumentPath: {\n serializedName: \"DefaultIndexDocumentPath\",\n xmlName: \"DefaultIndexDocumentPath\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst StorageError = {\n serializedName: \"StorageError\",\n type: {\n name: \"Composite\",\n className: \"StorageError\",\n modelProperties: {\n message: {\n serializedName: \"Message\",\n xmlName: \"Message\",\n type: {\n name: \"String\"\n }\n },\n code: {\n serializedName: \"Code\",\n xmlName: \"Code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobServiceStatistics = {\n serializedName: \"BlobServiceStatistics\",\n xmlName: \"StorageServiceStats\",\n type: {\n name: \"Composite\",\n className: \"BlobServiceStatistics\",\n modelProperties: {\n geoReplication: {\n serializedName: \"GeoReplication\",\n xmlName: \"GeoReplication\",\n type: {\n name: \"Composite\",\n className: \"GeoReplication\"\n }\n }\n }\n }\n};\nconst GeoReplication = {\n serializedName: \"GeoReplication\",\n type: {\n name: \"Composite\",\n className: \"GeoReplication\",\n modelProperties: {\n status: {\n serializedName: \"Status\",\n required: true,\n xmlName: \"Status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"live\", \"bootstrap\", \"unavailable\"]\n }\n },\n lastSyncOn: {\n serializedName: \"LastSyncTime\",\n required: true,\n xmlName: \"LastSyncTime\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst ListContainersSegmentResponse = {\n serializedName: \"ListContainersSegmentResponse\",\n xmlName: \"EnumerationResults\",\n type: {\n name: \"Composite\",\n className: \"ListContainersSegmentResponse\",\n modelProperties: {\n serviceEndpoint: {\n serializedName: \"ServiceEndpoint\",\n required: true,\n xmlName: \"ServiceEndpoint\",\n xmlIsAttribute: true,\n type: {\n name: \"String\"\n }\n },\n prefix: {\n serializedName: \"Prefix\",\n xmlName: \"Prefix\",\n type: {\n name: \"String\"\n }\n },\n marker: {\n serializedName: \"Marker\",\n xmlName: \"Marker\",\n type: {\n name: \"String\"\n }\n },\n maxPageSize: {\n serializedName: \"MaxResults\",\n xmlName: \"MaxResults\",\n type: {\n name: \"Number\"\n }\n },\n containerItems: {\n serializedName: \"ContainerItems\",\n required: true,\n xmlName: \"Containers\",\n xmlIsWrapped: true,\n xmlElementName: \"Container\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"ContainerItem\"\n }\n }\n }\n },\n continuationToken: {\n serializedName: \"NextMarker\",\n xmlName: \"NextMarker\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerItem = {\n serializedName: \"ContainerItem\",\n xmlName: \"Container\",\n type: {\n name: \"Composite\",\n className: \"ContainerItem\",\n modelProperties: {\n name: {\n serializedName: \"Name\",\n required: true,\n xmlName: \"Name\",\n type: {\n name: \"String\"\n }\n },\n deleted: {\n serializedName: \"Deleted\",\n xmlName: \"Deleted\",\n type: {\n name: \"Boolean\"\n }\n },\n version: {\n serializedName: \"Version\",\n xmlName: \"Version\",\n type: {\n name: \"String\"\n }\n },\n properties: {\n serializedName: \"Properties\",\n xmlName: \"Properties\",\n type: {\n name: \"Composite\",\n className: \"ContainerProperties\"\n }\n },\n metadata: {\n serializedName: \"Metadata\",\n xmlName: \"Metadata\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n }\n }\n }\n }\n};\nconst ContainerProperties = {\n serializedName: \"ContainerProperties\",\n type: {\n name: \"Composite\",\n className: \"ContainerProperties\",\n modelProperties: {\n lastModified: {\n serializedName: \"Last-Modified\",\n required: true,\n xmlName: \"Last-Modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n etag: {\n serializedName: \"Etag\",\n required: true,\n xmlName: \"Etag\",\n type: {\n name: \"String\"\n }\n },\n leaseStatus: {\n serializedName: \"LeaseStatus\",\n xmlName: \"LeaseStatus\",\n type: {\n name: \"Enum\",\n allowedValues: [\"locked\", \"unlocked\"]\n }\n },\n leaseState: {\n serializedName: \"LeaseState\",\n xmlName: \"LeaseState\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"available\",\n \"leased\",\n \"expired\",\n \"breaking\",\n \"broken\"\n ]\n }\n },\n leaseDuration: {\n serializedName: \"LeaseDuration\",\n xmlName: \"LeaseDuration\",\n type: {\n name: \"Enum\",\n allowedValues: [\"infinite\", \"fixed\"]\n }\n },\n publicAccess: {\n serializedName: \"PublicAccess\",\n xmlName: \"PublicAccess\",\n type: {\n name: \"Enum\",\n allowedValues: [\"container\", \"blob\"]\n }\n },\n hasImmutabilityPolicy: {\n serializedName: \"HasImmutabilityPolicy\",\n xmlName: \"HasImmutabilityPolicy\",\n type: {\n name: \"Boolean\"\n }\n },\n hasLegalHold: {\n serializedName: \"HasLegalHold\",\n xmlName: \"HasLegalHold\",\n type: {\n name: \"Boolean\"\n }\n },\n defaultEncryptionScope: {\n serializedName: \"DefaultEncryptionScope\",\n xmlName: \"DefaultEncryptionScope\",\n type: {\n name: \"String\"\n }\n },\n preventEncryptionScopeOverride: {\n serializedName: \"DenyEncryptionScopeOverride\",\n xmlName: \"DenyEncryptionScopeOverride\",\n type: {\n name: \"Boolean\"\n }\n },\n deletedOn: {\n serializedName: \"DeletedTime\",\n xmlName: \"DeletedTime\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n remainingRetentionDays: {\n serializedName: \"RemainingRetentionDays\",\n xmlName: \"RemainingRetentionDays\",\n type: {\n name: \"Number\"\n }\n },\n isImmutableStorageWithVersioningEnabled: {\n serializedName: \"ImmutableStorageWithVersioningEnabled\",\n xmlName: \"ImmutableStorageWithVersioningEnabled\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\nconst KeyInfo = {\n serializedName: \"KeyInfo\",\n type: {\n name: \"Composite\",\n className: \"KeyInfo\",\n modelProperties: {\n startsOn: {\n serializedName: \"Start\",\n required: true,\n xmlName: \"Start\",\n type: {\n name: \"String\"\n }\n },\n expiresOn: {\n serializedName: \"Expiry\",\n required: true,\n xmlName: \"Expiry\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst UserDelegationKey = {\n serializedName: \"UserDelegationKey\",\n type: {\n name: \"Composite\",\n className: \"UserDelegationKey\",\n modelProperties: {\n signedObjectId: {\n serializedName: \"SignedOid\",\n required: true,\n xmlName: \"SignedOid\",\n type: {\n name: \"String\"\n }\n },\n signedTenantId: {\n serializedName: \"SignedTid\",\n required: true,\n xmlName: \"SignedTid\",\n type: {\n name: \"String\"\n }\n },\n signedStartsOn: {\n serializedName: \"SignedStart\",\n required: true,\n xmlName: \"SignedStart\",\n type: {\n name: \"String\"\n }\n },\n signedExpiresOn: {\n serializedName: \"SignedExpiry\",\n required: true,\n xmlName: \"SignedExpiry\",\n type: {\n name: \"String\"\n }\n },\n signedService: {\n serializedName: \"SignedService\",\n required: true,\n xmlName: \"SignedService\",\n type: {\n name: \"String\"\n }\n },\n signedVersion: {\n serializedName: \"SignedVersion\",\n required: true,\n xmlName: \"SignedVersion\",\n type: {\n name: \"String\"\n }\n },\n value: {\n serializedName: \"Value\",\n required: true,\n xmlName: \"Value\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst FilterBlobSegment = {\n serializedName: \"FilterBlobSegment\",\n xmlName: \"EnumerationResults\",\n type: {\n name: \"Composite\",\n className: \"FilterBlobSegment\",\n modelProperties: {\n serviceEndpoint: {\n serializedName: \"ServiceEndpoint\",\n required: true,\n xmlName: \"ServiceEndpoint\",\n xmlIsAttribute: true,\n type: {\n name: \"String\"\n }\n },\n where: {\n serializedName: \"Where\",\n required: true,\n xmlName: \"Where\",\n type: {\n name: \"String\"\n }\n },\n blobs: {\n serializedName: \"Blobs\",\n required: true,\n xmlName: \"Blobs\",\n xmlIsWrapped: true,\n xmlElementName: \"Blob\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"FilterBlobItem\"\n }\n }\n }\n },\n continuationToken: {\n serializedName: \"NextMarker\",\n xmlName: \"NextMarker\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst FilterBlobItem = {\n serializedName: \"FilterBlobItem\",\n xmlName: \"Blob\",\n type: {\n name: \"Composite\",\n className: \"FilterBlobItem\",\n modelProperties: {\n name: {\n serializedName: \"Name\",\n required: true,\n xmlName: \"Name\",\n type: {\n name: \"String\"\n }\n },\n containerName: {\n serializedName: \"ContainerName\",\n required: true,\n xmlName: \"ContainerName\",\n type: {\n name: \"String\"\n }\n },\n tags: {\n serializedName: \"Tags\",\n xmlName: \"Tags\",\n type: {\n name: \"Composite\",\n className: \"BlobTags\"\n }\n }\n }\n }\n};\nconst BlobTags = {\n serializedName: \"BlobTags\",\n xmlName: \"Tags\",\n type: {\n name: \"Composite\",\n className: \"BlobTags\",\n modelProperties: {\n blobTagSet: {\n serializedName: \"BlobTagSet\",\n required: true,\n xmlName: \"TagSet\",\n xmlIsWrapped: true,\n xmlElementName: \"Tag\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"BlobTag\"\n }\n }\n }\n }\n }\n }\n};\nconst BlobTag = {\n serializedName: \"BlobTag\",\n xmlName: \"Tag\",\n type: {\n name: \"Composite\",\n className: \"BlobTag\",\n modelProperties: {\n key: {\n serializedName: \"Key\",\n required: true,\n xmlName: \"Key\",\n type: {\n name: \"String\"\n }\n },\n value: {\n serializedName: \"Value\",\n required: true,\n xmlName: \"Value\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst SignedIdentifier = {\n serializedName: \"SignedIdentifier\",\n xmlName: \"SignedIdentifier\",\n type: {\n name: \"Composite\",\n className: \"SignedIdentifier\",\n modelProperties: {\n id: {\n serializedName: \"Id\",\n required: true,\n xmlName: \"Id\",\n type: {\n name: \"String\"\n }\n },\n accessPolicy: {\n serializedName: \"AccessPolicy\",\n xmlName: \"AccessPolicy\",\n type: {\n name: \"Composite\",\n className: \"AccessPolicy\"\n }\n }\n }\n }\n};\nconst AccessPolicy = {\n serializedName: \"AccessPolicy\",\n type: {\n name: \"Composite\",\n className: \"AccessPolicy\",\n modelProperties: {\n startsOn: {\n serializedName: \"Start\",\n xmlName: \"Start\",\n type: {\n name: \"String\"\n }\n },\n expiresOn: {\n serializedName: \"Expiry\",\n xmlName: \"Expiry\",\n type: {\n name: \"String\"\n }\n },\n permissions: {\n serializedName: \"Permission\",\n xmlName: \"Permission\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ListBlobsFlatSegmentResponse = {\n serializedName: \"ListBlobsFlatSegmentResponse\",\n xmlName: \"EnumerationResults\",\n type: {\n name: \"Composite\",\n className: \"ListBlobsFlatSegmentResponse\",\n modelProperties: {\n serviceEndpoint: {\n serializedName: \"ServiceEndpoint\",\n required: true,\n xmlName: \"ServiceEndpoint\",\n xmlIsAttribute: true,\n type: {\n name: \"String\"\n }\n },\n containerName: {\n serializedName: \"ContainerName\",\n required: true,\n xmlName: \"ContainerName\",\n xmlIsAttribute: true,\n type: {\n name: \"String\"\n }\n },\n prefix: {\n serializedName: \"Prefix\",\n xmlName: \"Prefix\",\n type: {\n name: \"String\"\n }\n },\n marker: {\n serializedName: \"Marker\",\n xmlName: \"Marker\",\n type: {\n name: \"String\"\n }\n },\n maxPageSize: {\n serializedName: \"MaxResults\",\n xmlName: \"MaxResults\",\n type: {\n name: \"Number\"\n }\n },\n segment: {\n serializedName: \"Segment\",\n xmlName: \"Blobs\",\n type: {\n name: \"Composite\",\n className: \"BlobFlatListSegment\"\n }\n },\n continuationToken: {\n serializedName: \"NextMarker\",\n xmlName: \"NextMarker\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobFlatListSegment = {\n serializedName: \"BlobFlatListSegment\",\n xmlName: \"Blobs\",\n type: {\n name: \"Composite\",\n className: \"BlobFlatListSegment\",\n modelProperties: {\n blobItems: {\n serializedName: \"BlobItems\",\n required: true,\n xmlName: \"BlobItems\",\n xmlElementName: \"Blob\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"BlobItemInternal\"\n }\n }\n }\n }\n }\n }\n};\nconst BlobItemInternal = {\n serializedName: \"BlobItemInternal\",\n xmlName: \"Blob\",\n type: {\n name: \"Composite\",\n className: \"BlobItemInternal\",\n modelProperties: {\n name: {\n serializedName: \"Name\",\n xmlName: \"Name\",\n type: {\n name: \"Composite\",\n className: \"BlobName\"\n }\n },\n deleted: {\n serializedName: \"Deleted\",\n required: true,\n xmlName: \"Deleted\",\n type: {\n name: \"Boolean\"\n }\n },\n snapshot: {\n serializedName: \"Snapshot\",\n required: true,\n xmlName: \"Snapshot\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"VersionId\",\n xmlName: \"VersionId\",\n type: {\n name: \"String\"\n }\n },\n isCurrentVersion: {\n serializedName: \"IsCurrentVersion\",\n xmlName: \"IsCurrentVersion\",\n type: {\n name: \"Boolean\"\n }\n },\n properties: {\n serializedName: \"Properties\",\n xmlName: \"Properties\",\n type: {\n name: \"Composite\",\n className: \"BlobPropertiesInternal\"\n }\n },\n metadata: {\n serializedName: \"Metadata\",\n xmlName: \"Metadata\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n }\n },\n blobTags: {\n serializedName: \"BlobTags\",\n xmlName: \"Tags\",\n type: {\n name: \"Composite\",\n className: \"BlobTags\"\n }\n },\n objectReplicationMetadata: {\n serializedName: \"ObjectReplicationMetadata\",\n xmlName: \"OrMetadata\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n }\n },\n hasVersionsOnly: {\n serializedName: \"HasVersionsOnly\",\n xmlName: \"HasVersionsOnly\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\nconst BlobName = {\n serializedName: \"BlobName\",\n type: {\n name: \"Composite\",\n className: \"BlobName\",\n modelProperties: {\n encoded: {\n serializedName: \"Encoded\",\n xmlName: \"Encoded\",\n xmlIsAttribute: true,\n type: {\n name: \"Boolean\"\n }\n },\n content: {\n serializedName: \"content\",\n xmlName: \"content\",\n xmlIsMsText: true,\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobPropertiesInternal = {\n serializedName: \"BlobPropertiesInternal\",\n xmlName: \"Properties\",\n type: {\n name: \"Composite\",\n className: \"BlobPropertiesInternal\",\n modelProperties: {\n createdOn: {\n serializedName: \"Creation-Time\",\n xmlName: \"Creation-Time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n lastModified: {\n serializedName: \"Last-Modified\",\n required: true,\n xmlName: \"Last-Modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n etag: {\n serializedName: \"Etag\",\n required: true,\n xmlName: \"Etag\",\n type: {\n name: \"String\"\n }\n },\n contentLength: {\n serializedName: \"Content-Length\",\n xmlName: \"Content-Length\",\n type: {\n name: \"Number\"\n }\n },\n contentType: {\n serializedName: \"Content-Type\",\n xmlName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n },\n contentEncoding: {\n serializedName: \"Content-Encoding\",\n xmlName: \"Content-Encoding\",\n type: {\n name: \"String\"\n }\n },\n contentLanguage: {\n serializedName: \"Content-Language\",\n xmlName: \"Content-Language\",\n type: {\n name: \"String\"\n }\n },\n contentMD5: {\n serializedName: \"Content-MD5\",\n xmlName: \"Content-MD5\",\n type: {\n name: \"ByteArray\"\n }\n },\n contentDisposition: {\n serializedName: \"Content-Disposition\",\n xmlName: \"Content-Disposition\",\n type: {\n name: \"String\"\n }\n },\n cacheControl: {\n serializedName: \"Cache-Control\",\n xmlName: \"Cache-Control\",\n type: {\n name: \"String\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n blobType: {\n serializedName: \"BlobType\",\n xmlName: \"BlobType\",\n type: {\n name: \"Enum\",\n allowedValues: [\"BlockBlob\", \"PageBlob\", \"AppendBlob\"]\n }\n },\n leaseStatus: {\n serializedName: \"LeaseStatus\",\n xmlName: \"LeaseStatus\",\n type: {\n name: \"Enum\",\n allowedValues: [\"locked\", \"unlocked\"]\n }\n },\n leaseState: {\n serializedName: \"LeaseState\",\n xmlName: \"LeaseState\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"available\",\n \"leased\",\n \"expired\",\n \"breaking\",\n \"broken\"\n ]\n }\n },\n leaseDuration: {\n serializedName: \"LeaseDuration\",\n xmlName: \"LeaseDuration\",\n type: {\n name: \"Enum\",\n allowedValues: [\"infinite\", \"fixed\"]\n }\n },\n copyId: {\n serializedName: \"CopyId\",\n xmlName: \"CopyId\",\n type: {\n name: \"String\"\n }\n },\n copyStatus: {\n serializedName: \"CopyStatus\",\n xmlName: \"CopyStatus\",\n type: {\n name: \"Enum\",\n allowedValues: [\"pending\", \"success\", \"aborted\", \"failed\"]\n }\n },\n copySource: {\n serializedName: \"CopySource\",\n xmlName: \"CopySource\",\n type: {\n name: \"String\"\n }\n },\n copyProgress: {\n serializedName: \"CopyProgress\",\n xmlName: \"CopyProgress\",\n type: {\n name: \"String\"\n }\n },\n copyCompletedOn: {\n serializedName: \"CopyCompletionTime\",\n xmlName: \"CopyCompletionTime\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n copyStatusDescription: {\n serializedName: \"CopyStatusDescription\",\n xmlName: \"CopyStatusDescription\",\n type: {\n name: \"String\"\n }\n },\n serverEncrypted: {\n serializedName: \"ServerEncrypted\",\n xmlName: \"ServerEncrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n incrementalCopy: {\n serializedName: \"IncrementalCopy\",\n xmlName: \"IncrementalCopy\",\n type: {\n name: \"Boolean\"\n }\n },\n destinationSnapshot: {\n serializedName: \"DestinationSnapshot\",\n xmlName: \"DestinationSnapshot\",\n type: {\n name: \"String\"\n }\n },\n deletedOn: {\n serializedName: \"DeletedTime\",\n xmlName: \"DeletedTime\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n remainingRetentionDays: {\n serializedName: \"RemainingRetentionDays\",\n xmlName: \"RemainingRetentionDays\",\n type: {\n name: \"Number\"\n }\n },\n accessTier: {\n serializedName: \"AccessTier\",\n xmlName: \"AccessTier\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"P4\",\n \"P6\",\n \"P10\",\n \"P15\",\n \"P20\",\n \"P30\",\n \"P40\",\n \"P50\",\n \"P60\",\n \"P70\",\n \"P80\",\n \"Hot\",\n \"Cool\",\n \"Archive\",\n \"Cold\"\n ]\n }\n },\n accessTierInferred: {\n serializedName: \"AccessTierInferred\",\n xmlName: \"AccessTierInferred\",\n type: {\n name: \"Boolean\"\n }\n },\n archiveStatus: {\n serializedName: \"ArchiveStatus\",\n xmlName: \"ArchiveStatus\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"rehydrate-pending-to-hot\",\n \"rehydrate-pending-to-cool\"\n ]\n }\n },\n customerProvidedKeySha256: {\n serializedName: \"CustomerProvidedKeySha256\",\n xmlName: \"CustomerProvidedKeySha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"EncryptionScope\",\n xmlName: \"EncryptionScope\",\n type: {\n name: \"String\"\n }\n },\n accessTierChangedOn: {\n serializedName: \"AccessTierChangeTime\",\n xmlName: \"AccessTierChangeTime\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n tagCount: {\n serializedName: \"TagCount\",\n xmlName: \"TagCount\",\n type: {\n name: \"Number\"\n }\n },\n expiresOn: {\n serializedName: \"Expiry-Time\",\n xmlName: \"Expiry-Time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isSealed: {\n serializedName: \"Sealed\",\n xmlName: \"Sealed\",\n type: {\n name: \"Boolean\"\n }\n },\n rehydratePriority: {\n serializedName: \"RehydratePriority\",\n xmlName: \"RehydratePriority\",\n type: {\n name: \"Enum\",\n allowedValues: [\"High\", \"Standard\"]\n }\n },\n lastAccessedOn: {\n serializedName: \"LastAccessTime\",\n xmlName: \"LastAccessTime\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n immutabilityPolicyExpiresOn: {\n serializedName: \"ImmutabilityPolicyUntilDate\",\n xmlName: \"ImmutabilityPolicyUntilDate\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n immutabilityPolicyMode: {\n serializedName: \"ImmutabilityPolicyMode\",\n xmlName: \"ImmutabilityPolicyMode\",\n type: {\n name: \"Enum\",\n allowedValues: [\"Mutable\", \"Unlocked\", \"Locked\"]\n }\n },\n legalHold: {\n serializedName: \"LegalHold\",\n xmlName: \"LegalHold\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\nconst ListBlobsHierarchySegmentResponse = {\n serializedName: \"ListBlobsHierarchySegmentResponse\",\n xmlName: \"EnumerationResults\",\n type: {\n name: \"Composite\",\n className: \"ListBlobsHierarchySegmentResponse\",\n modelProperties: {\n serviceEndpoint: {\n serializedName: \"ServiceEndpoint\",\n required: true,\n xmlName: \"ServiceEndpoint\",\n xmlIsAttribute: true,\n type: {\n name: \"String\"\n }\n },\n containerName: {\n serializedName: \"ContainerName\",\n required: true,\n xmlName: \"ContainerName\",\n xmlIsAttribute: true,\n type: {\n name: \"String\"\n }\n },\n prefix: {\n serializedName: \"Prefix\",\n xmlName: \"Prefix\",\n type: {\n name: \"String\"\n }\n },\n marker: {\n serializedName: \"Marker\",\n xmlName: \"Marker\",\n type: {\n name: \"String\"\n }\n },\n maxPageSize: {\n serializedName: \"MaxResults\",\n xmlName: \"MaxResults\",\n type: {\n name: \"Number\"\n }\n },\n delimiter: {\n serializedName: \"Delimiter\",\n xmlName: \"Delimiter\",\n type: {\n name: \"String\"\n }\n },\n segment: {\n serializedName: \"Segment\",\n xmlName: \"Blobs\",\n type: {\n name: \"Composite\",\n className: \"BlobHierarchyListSegment\"\n }\n },\n continuationToken: {\n serializedName: \"NextMarker\",\n xmlName: \"NextMarker\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobHierarchyListSegment = {\n serializedName: \"BlobHierarchyListSegment\",\n xmlName: \"Blobs\",\n type: {\n name: \"Composite\",\n className: \"BlobHierarchyListSegment\",\n modelProperties: {\n blobPrefixes: {\n serializedName: \"BlobPrefixes\",\n xmlName: \"BlobPrefixes\",\n xmlElementName: \"BlobPrefix\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"BlobPrefix\"\n }\n }\n }\n },\n blobItems: {\n serializedName: \"BlobItems\",\n required: true,\n xmlName: \"BlobItems\",\n xmlElementName: \"Blob\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"BlobItemInternal\"\n }\n }\n }\n }\n }\n }\n};\nconst BlobPrefix = {\n serializedName: \"BlobPrefix\",\n type: {\n name: \"Composite\",\n className: \"BlobPrefix\",\n modelProperties: {\n name: {\n serializedName: \"Name\",\n xmlName: \"Name\",\n type: {\n name: \"Composite\",\n className: \"BlobName\"\n }\n }\n }\n }\n};\nconst BlockLookupList = {\n serializedName: \"BlockLookupList\",\n xmlName: \"BlockList\",\n type: {\n name: \"Composite\",\n className: \"BlockLookupList\",\n modelProperties: {\n committed: {\n serializedName: \"Committed\",\n xmlName: \"Committed\",\n xmlElementName: \"Committed\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n uncommitted: {\n serializedName: \"Uncommitted\",\n xmlName: \"Uncommitted\",\n xmlElementName: \"Uncommitted\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n },\n latest: {\n serializedName: \"Latest\",\n xmlName: \"Latest\",\n xmlElementName: \"Latest\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"String\"\n }\n }\n }\n }\n }\n }\n};\nconst BlockList = {\n serializedName: \"BlockList\",\n type: {\n name: \"Composite\",\n className: \"BlockList\",\n modelProperties: {\n committedBlocks: {\n serializedName: \"CommittedBlocks\",\n xmlName: \"CommittedBlocks\",\n xmlIsWrapped: true,\n xmlElementName: \"Block\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Block\"\n }\n }\n }\n },\n uncommittedBlocks: {\n serializedName: \"UncommittedBlocks\",\n xmlName: \"UncommittedBlocks\",\n xmlIsWrapped: true,\n xmlElementName: \"Block\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"Block\"\n }\n }\n }\n }\n }\n }\n};\nconst Block = {\n serializedName: \"Block\",\n type: {\n name: \"Composite\",\n className: \"Block\",\n modelProperties: {\n name: {\n serializedName: \"Name\",\n required: true,\n xmlName: \"Name\",\n type: {\n name: \"String\"\n }\n },\n size: {\n serializedName: \"Size\",\n required: true,\n xmlName: \"Size\",\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\nconst PageList = {\n serializedName: \"PageList\",\n type: {\n name: \"Composite\",\n className: \"PageList\",\n modelProperties: {\n pageRange: {\n serializedName: \"PageRange\",\n xmlName: \"PageRange\",\n xmlElementName: \"PageRange\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"PageRange\"\n }\n }\n }\n },\n clearRange: {\n serializedName: \"ClearRange\",\n xmlName: \"ClearRange\",\n xmlElementName: \"ClearRange\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"ClearRange\"\n }\n }\n }\n },\n continuationToken: {\n serializedName: \"NextMarker\",\n xmlName: \"NextMarker\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageRange = {\n serializedName: \"PageRange\",\n xmlName: \"PageRange\",\n type: {\n name: \"Composite\",\n className: \"PageRange\",\n modelProperties: {\n start: {\n serializedName: \"Start\",\n required: true,\n xmlName: \"Start\",\n type: {\n name: \"Number\"\n }\n },\n end: {\n serializedName: \"End\",\n required: true,\n xmlName: \"End\",\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\nconst ClearRange = {\n serializedName: \"ClearRange\",\n xmlName: \"ClearRange\",\n type: {\n name: \"Composite\",\n className: \"ClearRange\",\n modelProperties: {\n start: {\n serializedName: \"Start\",\n required: true,\n xmlName: \"Start\",\n type: {\n name: \"Number\"\n }\n },\n end: {\n serializedName: \"End\",\n required: true,\n xmlName: \"End\",\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\nconst QueryRequest = {\n serializedName: \"QueryRequest\",\n xmlName: \"QueryRequest\",\n type: {\n name: \"Composite\",\n className: \"QueryRequest\",\n modelProperties: {\n queryType: {\n serializedName: \"QueryType\",\n required: true,\n xmlName: \"QueryType\",\n type: {\n name: \"String\"\n }\n },\n expression: {\n serializedName: \"Expression\",\n required: true,\n xmlName: \"Expression\",\n type: {\n name: \"String\"\n }\n },\n inputSerialization: {\n serializedName: \"InputSerialization\",\n xmlName: \"InputSerialization\",\n type: {\n name: \"Composite\",\n className: \"QuerySerialization\"\n }\n },\n outputSerialization: {\n serializedName: \"OutputSerialization\",\n xmlName: \"OutputSerialization\",\n type: {\n name: \"Composite\",\n className: \"QuerySerialization\"\n }\n }\n }\n }\n};\nconst QuerySerialization = {\n serializedName: \"QuerySerialization\",\n type: {\n name: \"Composite\",\n className: \"QuerySerialization\",\n modelProperties: {\n format: {\n serializedName: \"Format\",\n xmlName: \"Format\",\n type: {\n name: \"Composite\",\n className: \"QueryFormat\"\n }\n }\n }\n }\n};\nconst QueryFormat = {\n serializedName: \"QueryFormat\",\n type: {\n name: \"Composite\",\n className: \"QueryFormat\",\n modelProperties: {\n type: {\n serializedName: \"Type\",\n required: true,\n xmlName: \"Type\",\n type: {\n name: \"Enum\",\n allowedValues: [\"delimited\", \"json\", \"arrow\", \"parquet\"]\n }\n },\n delimitedTextConfiguration: {\n serializedName: \"DelimitedTextConfiguration\",\n xmlName: \"DelimitedTextConfiguration\",\n type: {\n name: \"Composite\",\n className: \"DelimitedTextConfiguration\"\n }\n },\n jsonTextConfiguration: {\n serializedName: \"JsonTextConfiguration\",\n xmlName: \"JsonTextConfiguration\",\n type: {\n name: \"Composite\",\n className: \"JsonTextConfiguration\"\n }\n },\n arrowConfiguration: {\n serializedName: \"ArrowConfiguration\",\n xmlName: \"ArrowConfiguration\",\n type: {\n name: \"Composite\",\n className: \"ArrowConfiguration\"\n }\n },\n parquetTextConfiguration: {\n serializedName: \"ParquetTextConfiguration\",\n xmlName: \"ParquetTextConfiguration\",\n type: {\n name: \"any\"\n }\n }\n }\n }\n};\nconst DelimitedTextConfiguration = {\n serializedName: \"DelimitedTextConfiguration\",\n xmlName: \"DelimitedTextConfiguration\",\n type: {\n name: \"Composite\",\n className: \"DelimitedTextConfiguration\",\n modelProperties: {\n columnSeparator: {\n serializedName: \"ColumnSeparator\",\n xmlName: \"ColumnSeparator\",\n type: {\n name: \"String\"\n }\n },\n fieldQuote: {\n serializedName: \"FieldQuote\",\n xmlName: \"FieldQuote\",\n type: {\n name: \"String\"\n }\n },\n recordSeparator: {\n serializedName: \"RecordSeparator\",\n xmlName: \"RecordSeparator\",\n type: {\n name: \"String\"\n }\n },\n escapeChar: {\n serializedName: \"EscapeChar\",\n xmlName: \"EscapeChar\",\n type: {\n name: \"String\"\n }\n },\n headersPresent: {\n serializedName: \"HeadersPresent\",\n xmlName: \"HasHeaders\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\nconst JsonTextConfiguration = {\n serializedName: \"JsonTextConfiguration\",\n xmlName: \"JsonTextConfiguration\",\n type: {\n name: \"Composite\",\n className: \"JsonTextConfiguration\",\n modelProperties: {\n recordSeparator: {\n serializedName: \"RecordSeparator\",\n xmlName: \"RecordSeparator\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ArrowConfiguration = {\n serializedName: \"ArrowConfiguration\",\n xmlName: \"ArrowConfiguration\",\n type: {\n name: \"Composite\",\n className: \"ArrowConfiguration\",\n modelProperties: {\n schema: {\n serializedName: \"Schema\",\n required: true,\n xmlName: \"Schema\",\n xmlIsWrapped: true,\n xmlElementName: \"Field\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"ArrowField\"\n }\n }\n }\n }\n }\n }\n};\nconst ArrowField = {\n serializedName: \"ArrowField\",\n xmlName: \"Field\",\n type: {\n name: \"Composite\",\n className: \"ArrowField\",\n modelProperties: {\n type: {\n serializedName: \"Type\",\n required: true,\n xmlName: \"Type\",\n type: {\n name: \"String\"\n }\n },\n name: {\n serializedName: \"Name\",\n xmlName: \"Name\",\n type: {\n name: \"String\"\n }\n },\n precision: {\n serializedName: \"Precision\",\n xmlName: \"Precision\",\n type: {\n name: \"Number\"\n }\n },\n scale: {\n serializedName: \"Scale\",\n xmlName: \"Scale\",\n type: {\n name: \"Number\"\n }\n }\n }\n }\n};\nconst ServiceSetPropertiesHeaders = {\n serializedName: \"Service_setPropertiesHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceSetPropertiesHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceSetPropertiesExceptionHeaders = {\n serializedName: \"Service_setPropertiesExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceSetPropertiesExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceGetPropertiesHeaders = {\n serializedName: \"Service_getPropertiesHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceGetPropertiesHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceGetPropertiesExceptionHeaders = {\n serializedName: \"Service_getPropertiesExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceGetPropertiesExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceGetStatisticsHeaders = {\n serializedName: \"Service_getStatisticsHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceGetStatisticsHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceGetStatisticsExceptionHeaders = {\n serializedName: \"Service_getStatisticsExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceGetStatisticsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceListContainersSegmentHeaders = {\n serializedName: \"Service_listContainersSegmentHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceListContainersSegmentHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceListContainersSegmentExceptionHeaders = {\n serializedName: \"Service_listContainersSegmentExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceListContainersSegmentExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceGetUserDelegationKeyHeaders = {\n serializedName: \"Service_getUserDelegationKeyHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceGetUserDelegationKeyHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceGetUserDelegationKeyExceptionHeaders = {\n serializedName: \"Service_getUserDelegationKeyExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceGetUserDelegationKeyExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceGetAccountInfoHeaders = {\n serializedName: \"Service_getAccountInfoHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceGetAccountInfoHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n skuName: {\n serializedName: \"x-ms-sku-name\",\n xmlName: \"x-ms-sku-name\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"Standard_LRS\",\n \"Standard_GRS\",\n \"Standard_RAGRS\",\n \"Standard_ZRS\",\n \"Premium_LRS\"\n ]\n }\n },\n accountKind: {\n serializedName: \"x-ms-account-kind\",\n xmlName: \"x-ms-account-kind\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"Storage\",\n \"BlobStorage\",\n \"StorageV2\",\n \"FileStorage\",\n \"BlockBlobStorage\"\n ]\n }\n },\n isHierarchicalNamespaceEnabled: {\n serializedName: \"x-ms-is-hns-enabled\",\n xmlName: \"x-ms-is-hns-enabled\",\n type: {\n name: \"Boolean\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceGetAccountInfoExceptionHeaders = {\n serializedName: \"Service_getAccountInfoExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceGetAccountInfoExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceSubmitBatchHeaders = {\n serializedName: \"Service_submitBatchHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceSubmitBatchHeaders\",\n modelProperties: {\n contentType: {\n serializedName: \"content-type\",\n xmlName: \"content-type\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceSubmitBatchExceptionHeaders = {\n serializedName: \"Service_submitBatchExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceSubmitBatchExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceFilterBlobsHeaders = {\n serializedName: \"Service_filterBlobsHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceFilterBlobsHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ServiceFilterBlobsExceptionHeaders = {\n serializedName: \"Service_filterBlobsExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ServiceFilterBlobsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerCreateHeaders = {\n serializedName: \"Container_createHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerCreateHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerCreateExceptionHeaders = {\n serializedName: \"Container_createExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerCreateExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerGetPropertiesHeaders = {\n serializedName: \"Container_getPropertiesHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerGetPropertiesHeaders\",\n modelProperties: {\n metadata: {\n serializedName: \"x-ms-meta\",\n xmlName: \"x-ms-meta\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n },\n headerCollectionPrefix: \"x-ms-meta-\"\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n leaseDuration: {\n serializedName: \"x-ms-lease-duration\",\n xmlName: \"x-ms-lease-duration\",\n type: {\n name: \"Enum\",\n allowedValues: [\"infinite\", \"fixed\"]\n }\n },\n leaseState: {\n serializedName: \"x-ms-lease-state\",\n xmlName: \"x-ms-lease-state\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"available\",\n \"leased\",\n \"expired\",\n \"breaking\",\n \"broken\"\n ]\n }\n },\n leaseStatus: {\n serializedName: \"x-ms-lease-status\",\n xmlName: \"x-ms-lease-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"locked\", \"unlocked\"]\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n blobPublicAccess: {\n serializedName: \"x-ms-blob-public-access\",\n xmlName: \"x-ms-blob-public-access\",\n type: {\n name: \"Enum\",\n allowedValues: [\"container\", \"blob\"]\n }\n },\n hasImmutabilityPolicy: {\n serializedName: \"x-ms-has-immutability-policy\",\n xmlName: \"x-ms-has-immutability-policy\",\n type: {\n name: \"Boolean\"\n }\n },\n hasLegalHold: {\n serializedName: \"x-ms-has-legal-hold\",\n xmlName: \"x-ms-has-legal-hold\",\n type: {\n name: \"Boolean\"\n }\n },\n defaultEncryptionScope: {\n serializedName: \"x-ms-default-encryption-scope\",\n xmlName: \"x-ms-default-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n denyEncryptionScopeOverride: {\n serializedName: \"x-ms-deny-encryption-scope-override\",\n xmlName: \"x-ms-deny-encryption-scope-override\",\n type: {\n name: \"Boolean\"\n }\n },\n isImmutableStorageWithVersioningEnabled: {\n serializedName: \"x-ms-immutable-storage-with-versioning-enabled\",\n xmlName: \"x-ms-immutable-storage-with-versioning-enabled\",\n type: {\n name: \"Boolean\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerGetPropertiesExceptionHeaders = {\n serializedName: \"Container_getPropertiesExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerGetPropertiesExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerDeleteHeaders = {\n serializedName: \"Container_deleteHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerDeleteHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerDeleteExceptionHeaders = {\n serializedName: \"Container_deleteExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerDeleteExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerSetMetadataHeaders = {\n serializedName: \"Container_setMetadataHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerSetMetadataHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerSetMetadataExceptionHeaders = {\n serializedName: \"Container_setMetadataExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerSetMetadataExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerGetAccessPolicyHeaders = {\n serializedName: \"Container_getAccessPolicyHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerGetAccessPolicyHeaders\",\n modelProperties: {\n blobPublicAccess: {\n serializedName: \"x-ms-blob-public-access\",\n xmlName: \"x-ms-blob-public-access\",\n type: {\n name: \"Enum\",\n allowedValues: [\"container\", \"blob\"]\n }\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerGetAccessPolicyExceptionHeaders = {\n serializedName: \"Container_getAccessPolicyExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerGetAccessPolicyExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerSetAccessPolicyHeaders = {\n serializedName: \"Container_setAccessPolicyHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerSetAccessPolicyHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerSetAccessPolicyExceptionHeaders = {\n serializedName: \"Container_setAccessPolicyExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerSetAccessPolicyExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerRestoreHeaders = {\n serializedName: \"Container_restoreHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerRestoreHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerRestoreExceptionHeaders = {\n serializedName: \"Container_restoreExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerRestoreExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerRenameHeaders = {\n serializedName: \"Container_renameHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerRenameHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerRenameExceptionHeaders = {\n serializedName: \"Container_renameExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerRenameExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerSubmitBatchHeaders = {\n serializedName: \"Container_submitBatchHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerSubmitBatchHeaders\",\n modelProperties: {\n contentType: {\n serializedName: \"content-type\",\n xmlName: \"content-type\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerSubmitBatchExceptionHeaders = {\n serializedName: \"Container_submitBatchExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerSubmitBatchExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerFilterBlobsHeaders = {\n serializedName: \"Container_filterBlobsHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerFilterBlobsHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst ContainerFilterBlobsExceptionHeaders = {\n serializedName: \"Container_filterBlobsExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerFilterBlobsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerAcquireLeaseHeaders = {\n serializedName: \"Container_acquireLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerAcquireLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n leaseId: {\n serializedName: \"x-ms-lease-id\",\n xmlName: \"x-ms-lease-id\",\n type: {\n name: \"String\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst ContainerAcquireLeaseExceptionHeaders = {\n serializedName: \"Container_acquireLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerAcquireLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerReleaseLeaseHeaders = {\n serializedName: \"Container_releaseLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerReleaseLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst ContainerReleaseLeaseExceptionHeaders = {\n serializedName: \"Container_releaseLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerReleaseLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerRenewLeaseHeaders = {\n serializedName: \"Container_renewLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerRenewLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n leaseId: {\n serializedName: \"x-ms-lease-id\",\n xmlName: \"x-ms-lease-id\",\n type: {\n name: \"String\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst ContainerRenewLeaseExceptionHeaders = {\n serializedName: \"Container_renewLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerRenewLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerBreakLeaseHeaders = {\n serializedName: \"Container_breakLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerBreakLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n leaseTime: {\n serializedName: \"x-ms-lease-time\",\n xmlName: \"x-ms-lease-time\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst ContainerBreakLeaseExceptionHeaders = {\n serializedName: \"Container_breakLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerBreakLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerChangeLeaseHeaders = {\n serializedName: \"Container_changeLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerChangeLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n leaseId: {\n serializedName: \"x-ms-lease-id\",\n xmlName: \"x-ms-lease-id\",\n type: {\n name: \"String\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst ContainerChangeLeaseExceptionHeaders = {\n serializedName: \"Container_changeLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerChangeLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerListBlobFlatSegmentHeaders = {\n serializedName: \"Container_listBlobFlatSegmentHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerListBlobFlatSegmentHeaders\",\n modelProperties: {\n contentType: {\n serializedName: \"content-type\",\n xmlName: \"content-type\",\n type: {\n name: \"String\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerListBlobFlatSegmentExceptionHeaders = {\n serializedName: \"Container_listBlobFlatSegmentExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerListBlobFlatSegmentExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerListBlobHierarchySegmentHeaders = {\n serializedName: \"Container_listBlobHierarchySegmentHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerListBlobHierarchySegmentHeaders\",\n modelProperties: {\n contentType: {\n serializedName: \"content-type\",\n xmlName: \"content-type\",\n type: {\n name: \"String\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerListBlobHierarchySegmentExceptionHeaders = {\n serializedName: \"Container_listBlobHierarchySegmentExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerListBlobHierarchySegmentExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst ContainerGetAccountInfoHeaders = {\n serializedName: \"Container_getAccountInfoHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerGetAccountInfoHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n skuName: {\n serializedName: \"x-ms-sku-name\",\n xmlName: \"x-ms-sku-name\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"Standard_LRS\",\n \"Standard_GRS\",\n \"Standard_RAGRS\",\n \"Standard_ZRS\",\n \"Premium_LRS\"\n ]\n }\n },\n accountKind: {\n serializedName: \"x-ms-account-kind\",\n xmlName: \"x-ms-account-kind\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"Storage\",\n \"BlobStorage\",\n \"StorageV2\",\n \"FileStorage\",\n \"BlockBlobStorage\"\n ]\n }\n }\n }\n }\n};\nconst ContainerGetAccountInfoExceptionHeaders = {\n serializedName: \"Container_getAccountInfoExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"ContainerGetAccountInfoExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobDownloadHeaders = {\n serializedName: \"Blob_downloadHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobDownloadHeaders\",\n modelProperties: {\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n createdOn: {\n serializedName: \"x-ms-creation-time\",\n xmlName: \"x-ms-creation-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n metadata: {\n serializedName: \"x-ms-meta\",\n xmlName: \"x-ms-meta\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n },\n headerCollectionPrefix: \"x-ms-meta-\"\n },\n objectReplicationPolicyId: {\n serializedName: \"x-ms-or-policy-id\",\n xmlName: \"x-ms-or-policy-id\",\n type: {\n name: \"String\"\n }\n },\n objectReplicationRules: {\n serializedName: \"x-ms-or\",\n xmlName: \"x-ms-or\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n },\n headerCollectionPrefix: \"x-ms-or-\"\n },\n contentLength: {\n serializedName: \"content-length\",\n xmlName: \"content-length\",\n type: {\n name: \"Number\"\n }\n },\n contentType: {\n serializedName: \"content-type\",\n xmlName: \"content-type\",\n type: {\n name: \"String\"\n }\n },\n contentRange: {\n serializedName: \"content-range\",\n xmlName: \"content-range\",\n type: {\n name: \"String\"\n }\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n contentEncoding: {\n serializedName: \"content-encoding\",\n xmlName: \"content-encoding\",\n type: {\n name: \"String\"\n }\n },\n cacheControl: {\n serializedName: \"cache-control\",\n xmlName: \"cache-control\",\n type: {\n name: \"String\"\n }\n },\n contentDisposition: {\n serializedName: \"content-disposition\",\n xmlName: \"content-disposition\",\n type: {\n name: \"String\"\n }\n },\n contentLanguage: {\n serializedName: \"content-language\",\n xmlName: \"content-language\",\n type: {\n name: \"String\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n blobType: {\n serializedName: \"x-ms-blob-type\",\n xmlName: \"x-ms-blob-type\",\n type: {\n name: \"Enum\",\n allowedValues: [\"BlockBlob\", \"PageBlob\", \"AppendBlob\"]\n }\n },\n copyCompletedOn: {\n serializedName: \"x-ms-copy-completion-time\",\n xmlName: \"x-ms-copy-completion-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n copyStatusDescription: {\n serializedName: \"x-ms-copy-status-description\",\n xmlName: \"x-ms-copy-status-description\",\n type: {\n name: \"String\"\n }\n },\n copyId: {\n serializedName: \"x-ms-copy-id\",\n xmlName: \"x-ms-copy-id\",\n type: {\n name: \"String\"\n }\n },\n copyProgress: {\n serializedName: \"x-ms-copy-progress\",\n xmlName: \"x-ms-copy-progress\",\n type: {\n name: \"String\"\n }\n },\n copySource: {\n serializedName: \"x-ms-copy-source\",\n xmlName: \"x-ms-copy-source\",\n type: {\n name: \"String\"\n }\n },\n copyStatus: {\n serializedName: \"x-ms-copy-status\",\n xmlName: \"x-ms-copy-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"pending\", \"success\", \"aborted\", \"failed\"]\n }\n },\n leaseDuration: {\n serializedName: \"x-ms-lease-duration\",\n xmlName: \"x-ms-lease-duration\",\n type: {\n name: \"Enum\",\n allowedValues: [\"infinite\", \"fixed\"]\n }\n },\n leaseState: {\n serializedName: \"x-ms-lease-state\",\n xmlName: \"x-ms-lease-state\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"available\",\n \"leased\",\n \"expired\",\n \"breaking\",\n \"broken\"\n ]\n }\n },\n leaseStatus: {\n serializedName: \"x-ms-lease-status\",\n xmlName: \"x-ms-lease-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"locked\", \"unlocked\"]\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n isCurrentVersion: {\n serializedName: \"x-ms-is-current-version\",\n xmlName: \"x-ms-is-current-version\",\n type: {\n name: \"Boolean\"\n }\n },\n acceptRanges: {\n serializedName: \"accept-ranges\",\n xmlName: \"accept-ranges\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n blobCommittedBlockCount: {\n serializedName: \"x-ms-blob-committed-block-count\",\n xmlName: \"x-ms-blob-committed-block-count\",\n type: {\n name: \"Number\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-server-encrypted\",\n xmlName: \"x-ms-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n blobContentMD5: {\n serializedName: \"x-ms-blob-content-md5\",\n xmlName: \"x-ms-blob-content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n tagCount: {\n serializedName: \"x-ms-tag-count\",\n xmlName: \"x-ms-tag-count\",\n type: {\n name: \"Number\"\n }\n },\n isSealed: {\n serializedName: \"x-ms-blob-sealed\",\n xmlName: \"x-ms-blob-sealed\",\n type: {\n name: \"Boolean\"\n }\n },\n lastAccessed: {\n serializedName: \"x-ms-last-access-time\",\n xmlName: \"x-ms-last-access-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n immutabilityPolicyExpiresOn: {\n serializedName: \"x-ms-immutability-policy-until-date\",\n xmlName: \"x-ms-immutability-policy-until-date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n immutabilityPolicyMode: {\n serializedName: \"x-ms-immutability-policy-mode\",\n xmlName: \"x-ms-immutability-policy-mode\",\n type: {\n name: \"Enum\",\n allowedValues: [\"Mutable\", \"Unlocked\", \"Locked\"]\n }\n },\n legalHold: {\n serializedName: \"x-ms-legal-hold\",\n xmlName: \"x-ms-legal-hold\",\n type: {\n name: \"Boolean\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n },\n contentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n }\n }\n }\n};\nconst BlobDownloadExceptionHeaders = {\n serializedName: \"Blob_downloadExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobDownloadExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobGetPropertiesHeaders = {\n serializedName: \"Blob_getPropertiesHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobGetPropertiesHeaders\",\n modelProperties: {\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n createdOn: {\n serializedName: \"x-ms-creation-time\",\n xmlName: \"x-ms-creation-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n metadata: {\n serializedName: \"x-ms-meta\",\n xmlName: \"x-ms-meta\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n },\n headerCollectionPrefix: \"x-ms-meta-\"\n },\n objectReplicationPolicyId: {\n serializedName: \"x-ms-or-policy-id\",\n xmlName: \"x-ms-or-policy-id\",\n type: {\n name: \"String\"\n }\n },\n objectReplicationRules: {\n serializedName: \"x-ms-or\",\n xmlName: \"x-ms-or\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n },\n headerCollectionPrefix: \"x-ms-or-\"\n },\n blobType: {\n serializedName: \"x-ms-blob-type\",\n xmlName: \"x-ms-blob-type\",\n type: {\n name: \"Enum\",\n allowedValues: [\"BlockBlob\", \"PageBlob\", \"AppendBlob\"]\n }\n },\n copyCompletedOn: {\n serializedName: \"x-ms-copy-completion-time\",\n xmlName: \"x-ms-copy-completion-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n copyStatusDescription: {\n serializedName: \"x-ms-copy-status-description\",\n xmlName: \"x-ms-copy-status-description\",\n type: {\n name: \"String\"\n }\n },\n copyId: {\n serializedName: \"x-ms-copy-id\",\n xmlName: \"x-ms-copy-id\",\n type: {\n name: \"String\"\n }\n },\n copyProgress: {\n serializedName: \"x-ms-copy-progress\",\n xmlName: \"x-ms-copy-progress\",\n type: {\n name: \"String\"\n }\n },\n copySource: {\n serializedName: \"x-ms-copy-source\",\n xmlName: \"x-ms-copy-source\",\n type: {\n name: \"String\"\n }\n },\n copyStatus: {\n serializedName: \"x-ms-copy-status\",\n xmlName: \"x-ms-copy-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"pending\", \"success\", \"aborted\", \"failed\"]\n }\n },\n isIncrementalCopy: {\n serializedName: \"x-ms-incremental-copy\",\n xmlName: \"x-ms-incremental-copy\",\n type: {\n name: \"Boolean\"\n }\n },\n destinationSnapshot: {\n serializedName: \"x-ms-copy-destination-snapshot\",\n xmlName: \"x-ms-copy-destination-snapshot\",\n type: {\n name: \"String\"\n }\n },\n leaseDuration: {\n serializedName: \"x-ms-lease-duration\",\n xmlName: \"x-ms-lease-duration\",\n type: {\n name: \"Enum\",\n allowedValues: [\"infinite\", \"fixed\"]\n }\n },\n leaseState: {\n serializedName: \"x-ms-lease-state\",\n xmlName: \"x-ms-lease-state\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"available\",\n \"leased\",\n \"expired\",\n \"breaking\",\n \"broken\"\n ]\n }\n },\n leaseStatus: {\n serializedName: \"x-ms-lease-status\",\n xmlName: \"x-ms-lease-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"locked\", \"unlocked\"]\n }\n },\n contentLength: {\n serializedName: \"content-length\",\n xmlName: \"content-length\",\n type: {\n name: \"Number\"\n }\n },\n contentType: {\n serializedName: \"content-type\",\n xmlName: \"content-type\",\n type: {\n name: \"String\"\n }\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n contentEncoding: {\n serializedName: \"content-encoding\",\n xmlName: \"content-encoding\",\n type: {\n name: \"String\"\n }\n },\n contentDisposition: {\n serializedName: \"content-disposition\",\n xmlName: \"content-disposition\",\n type: {\n name: \"String\"\n }\n },\n contentLanguage: {\n serializedName: \"content-language\",\n xmlName: \"content-language\",\n type: {\n name: \"String\"\n }\n },\n cacheControl: {\n serializedName: \"cache-control\",\n xmlName: \"cache-control\",\n type: {\n name: \"String\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n acceptRanges: {\n serializedName: \"accept-ranges\",\n xmlName: \"accept-ranges\",\n type: {\n name: \"String\"\n }\n },\n blobCommittedBlockCount: {\n serializedName: \"x-ms-blob-committed-block-count\",\n xmlName: \"x-ms-blob-committed-block-count\",\n type: {\n name: \"Number\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-server-encrypted\",\n xmlName: \"x-ms-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n accessTier: {\n serializedName: \"x-ms-access-tier\",\n xmlName: \"x-ms-access-tier\",\n type: {\n name: \"String\"\n }\n },\n accessTierInferred: {\n serializedName: \"x-ms-access-tier-inferred\",\n xmlName: \"x-ms-access-tier-inferred\",\n type: {\n name: \"Boolean\"\n }\n },\n archiveStatus: {\n serializedName: \"x-ms-archive-status\",\n xmlName: \"x-ms-archive-status\",\n type: {\n name: \"String\"\n }\n },\n accessTierChangedOn: {\n serializedName: \"x-ms-access-tier-change-time\",\n xmlName: \"x-ms-access-tier-change-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n isCurrentVersion: {\n serializedName: \"x-ms-is-current-version\",\n xmlName: \"x-ms-is-current-version\",\n type: {\n name: \"Boolean\"\n }\n },\n tagCount: {\n serializedName: \"x-ms-tag-count\",\n xmlName: \"x-ms-tag-count\",\n type: {\n name: \"Number\"\n }\n },\n expiresOn: {\n serializedName: \"x-ms-expiry-time\",\n xmlName: \"x-ms-expiry-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isSealed: {\n serializedName: \"x-ms-blob-sealed\",\n xmlName: \"x-ms-blob-sealed\",\n type: {\n name: \"Boolean\"\n }\n },\n rehydratePriority: {\n serializedName: \"x-ms-rehydrate-priority\",\n xmlName: \"x-ms-rehydrate-priority\",\n type: {\n name: \"Enum\",\n allowedValues: [\"High\", \"Standard\"]\n }\n },\n lastAccessed: {\n serializedName: \"x-ms-last-access-time\",\n xmlName: \"x-ms-last-access-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n immutabilityPolicyExpiresOn: {\n serializedName: \"x-ms-immutability-policy-until-date\",\n xmlName: \"x-ms-immutability-policy-until-date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n immutabilityPolicyMode: {\n serializedName: \"x-ms-immutability-policy-mode\",\n xmlName: \"x-ms-immutability-policy-mode\",\n type: {\n name: \"Enum\",\n allowedValues: [\"Mutable\", \"Unlocked\", \"Locked\"]\n }\n },\n legalHold: {\n serializedName: \"x-ms-legal-hold\",\n xmlName: \"x-ms-legal-hold\",\n type: {\n name: \"Boolean\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobGetPropertiesExceptionHeaders = {\n serializedName: \"Blob_getPropertiesExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobGetPropertiesExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobDeleteHeaders = {\n serializedName: \"Blob_deleteHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobDeleteHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobDeleteExceptionHeaders = {\n serializedName: \"Blob_deleteExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobDeleteExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobUndeleteHeaders = {\n serializedName: \"Blob_undeleteHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobUndeleteHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobUndeleteExceptionHeaders = {\n serializedName: \"Blob_undeleteExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobUndeleteExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetExpiryHeaders = {\n serializedName: \"Blob_setExpiryHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetExpiryHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst BlobSetExpiryExceptionHeaders = {\n serializedName: \"Blob_setExpiryExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetExpiryExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetHttpHeadersHeaders = {\n serializedName: \"Blob_setHttpHeadersHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetHttpHeadersHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetHttpHeadersExceptionHeaders = {\n serializedName: \"Blob_setHttpHeadersExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetHttpHeadersExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetImmutabilityPolicyHeaders = {\n serializedName: \"Blob_setImmutabilityPolicyHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetImmutabilityPolicyHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n immutabilityPolicyExpiry: {\n serializedName: \"x-ms-immutability-policy-until-date\",\n xmlName: \"x-ms-immutability-policy-until-date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n immutabilityPolicyMode: {\n serializedName: \"x-ms-immutability-policy-mode\",\n xmlName: \"x-ms-immutability-policy-mode\",\n type: {\n name: \"Enum\",\n allowedValues: [\"Mutable\", \"Unlocked\", \"Locked\"]\n }\n }\n }\n }\n};\nconst BlobSetImmutabilityPolicyExceptionHeaders = {\n serializedName: \"Blob_setImmutabilityPolicyExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetImmutabilityPolicyExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobDeleteImmutabilityPolicyHeaders = {\n serializedName: \"Blob_deleteImmutabilityPolicyHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobDeleteImmutabilityPolicyHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst BlobDeleteImmutabilityPolicyExceptionHeaders = {\n serializedName: \"Blob_deleteImmutabilityPolicyExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobDeleteImmutabilityPolicyExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetLegalHoldHeaders = {\n serializedName: \"Blob_setLegalHoldHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetLegalHoldHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n legalHold: {\n serializedName: \"x-ms-legal-hold\",\n xmlName: \"x-ms-legal-hold\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\nconst BlobSetLegalHoldExceptionHeaders = {\n serializedName: \"Blob_setLegalHoldExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetLegalHoldExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetMetadataHeaders = {\n serializedName: \"Blob_setMetadataHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetMetadataHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetMetadataExceptionHeaders = {\n serializedName: \"Blob_setMetadataExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetMetadataExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobAcquireLeaseHeaders = {\n serializedName: \"Blob_acquireLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobAcquireLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n leaseId: {\n serializedName: \"x-ms-lease-id\",\n xmlName: \"x-ms-lease-id\",\n type: {\n name: \"String\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst BlobAcquireLeaseExceptionHeaders = {\n serializedName: \"Blob_acquireLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobAcquireLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobReleaseLeaseHeaders = {\n serializedName: \"Blob_releaseLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobReleaseLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst BlobReleaseLeaseExceptionHeaders = {\n serializedName: \"Blob_releaseLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobReleaseLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobRenewLeaseHeaders = {\n serializedName: \"Blob_renewLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobRenewLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n leaseId: {\n serializedName: \"x-ms-lease-id\",\n xmlName: \"x-ms-lease-id\",\n type: {\n name: \"String\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst BlobRenewLeaseExceptionHeaders = {\n serializedName: \"Blob_renewLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobRenewLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobChangeLeaseHeaders = {\n serializedName: \"Blob_changeLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobChangeLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n leaseId: {\n serializedName: \"x-ms-lease-id\",\n xmlName: \"x-ms-lease-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst BlobChangeLeaseExceptionHeaders = {\n serializedName: \"Blob_changeLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobChangeLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobBreakLeaseHeaders = {\n serializedName: \"Blob_breakLeaseHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobBreakLeaseHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n leaseTime: {\n serializedName: \"x-ms-lease-time\",\n xmlName: \"x-ms-lease-time\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n }\n }\n};\nconst BlobBreakLeaseExceptionHeaders = {\n serializedName: \"Blob_breakLeaseExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobBreakLeaseExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobCreateSnapshotHeaders = {\n serializedName: \"Blob_createSnapshotHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobCreateSnapshotHeaders\",\n modelProperties: {\n snapshot: {\n serializedName: \"x-ms-snapshot\",\n xmlName: \"x-ms-snapshot\",\n type: {\n name: \"String\"\n }\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobCreateSnapshotExceptionHeaders = {\n serializedName: \"Blob_createSnapshotExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobCreateSnapshotExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobStartCopyFromURLHeaders = {\n serializedName: \"Blob_startCopyFromURLHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobStartCopyFromURLHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n copyId: {\n serializedName: \"x-ms-copy-id\",\n xmlName: \"x-ms-copy-id\",\n type: {\n name: \"String\"\n }\n },\n copyStatus: {\n serializedName: \"x-ms-copy-status\",\n xmlName: \"x-ms-copy-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"pending\", \"success\", \"aborted\", \"failed\"]\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobStartCopyFromURLExceptionHeaders = {\n serializedName: \"Blob_startCopyFromURLExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobStartCopyFromURLExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobCopyFromURLHeaders = {\n serializedName: \"Blob_copyFromURLHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobCopyFromURLHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n copyId: {\n serializedName: \"x-ms-copy-id\",\n xmlName: \"x-ms-copy-id\",\n type: {\n name: \"String\"\n }\n },\n copyStatus: {\n defaultValue: \"success\",\n isConstant: true,\n serializedName: \"x-ms-copy-status\",\n type: {\n name: \"String\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobCopyFromURLExceptionHeaders = {\n serializedName: \"Blob_copyFromURLExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobCopyFromURLExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobAbortCopyFromURLHeaders = {\n serializedName: \"Blob_abortCopyFromURLHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobAbortCopyFromURLHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobAbortCopyFromURLExceptionHeaders = {\n serializedName: \"Blob_abortCopyFromURLExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobAbortCopyFromURLExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetTierHeaders = {\n serializedName: \"Blob_setTierHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetTierHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetTierExceptionHeaders = {\n serializedName: \"Blob_setTierExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetTierExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobGetAccountInfoHeaders = {\n serializedName: \"Blob_getAccountInfoHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobGetAccountInfoHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n skuName: {\n serializedName: \"x-ms-sku-name\",\n xmlName: \"x-ms-sku-name\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"Standard_LRS\",\n \"Standard_GRS\",\n \"Standard_RAGRS\",\n \"Standard_ZRS\",\n \"Premium_LRS\"\n ]\n }\n },\n accountKind: {\n serializedName: \"x-ms-account-kind\",\n xmlName: \"x-ms-account-kind\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"Storage\",\n \"BlobStorage\",\n \"StorageV2\",\n \"FileStorage\",\n \"BlockBlobStorage\"\n ]\n }\n }\n }\n }\n};\nconst BlobGetAccountInfoExceptionHeaders = {\n serializedName: \"Blob_getAccountInfoExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobGetAccountInfoExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobQueryHeaders = {\n serializedName: \"Blob_queryHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobQueryHeaders\",\n modelProperties: {\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n metadata: {\n serializedName: \"x-ms-meta\",\n xmlName: \"x-ms-meta\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n }\n },\n contentLength: {\n serializedName: \"content-length\",\n xmlName: \"content-length\",\n type: {\n name: \"Number\"\n }\n },\n contentType: {\n serializedName: \"content-type\",\n xmlName: \"content-type\",\n type: {\n name: \"String\"\n }\n },\n contentRange: {\n serializedName: \"content-range\",\n xmlName: \"content-range\",\n type: {\n name: \"String\"\n }\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n contentEncoding: {\n serializedName: \"content-encoding\",\n xmlName: \"content-encoding\",\n type: {\n name: \"String\"\n }\n },\n cacheControl: {\n serializedName: \"cache-control\",\n xmlName: \"cache-control\",\n type: {\n name: \"String\"\n }\n },\n contentDisposition: {\n serializedName: \"content-disposition\",\n xmlName: \"content-disposition\",\n type: {\n name: \"String\"\n }\n },\n contentLanguage: {\n serializedName: \"content-language\",\n xmlName: \"content-language\",\n type: {\n name: \"String\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n blobType: {\n serializedName: \"x-ms-blob-type\",\n xmlName: \"x-ms-blob-type\",\n type: {\n name: \"Enum\",\n allowedValues: [\"BlockBlob\", \"PageBlob\", \"AppendBlob\"]\n }\n },\n copyCompletionTime: {\n serializedName: \"x-ms-copy-completion-time\",\n xmlName: \"x-ms-copy-completion-time\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n copyStatusDescription: {\n serializedName: \"x-ms-copy-status-description\",\n xmlName: \"x-ms-copy-status-description\",\n type: {\n name: \"String\"\n }\n },\n copyId: {\n serializedName: \"x-ms-copy-id\",\n xmlName: \"x-ms-copy-id\",\n type: {\n name: \"String\"\n }\n },\n copyProgress: {\n serializedName: \"x-ms-copy-progress\",\n xmlName: \"x-ms-copy-progress\",\n type: {\n name: \"String\"\n }\n },\n copySource: {\n serializedName: \"x-ms-copy-source\",\n xmlName: \"x-ms-copy-source\",\n type: {\n name: \"String\"\n }\n },\n copyStatus: {\n serializedName: \"x-ms-copy-status\",\n xmlName: \"x-ms-copy-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"pending\", \"success\", \"aborted\", \"failed\"]\n }\n },\n leaseDuration: {\n serializedName: \"x-ms-lease-duration\",\n xmlName: \"x-ms-lease-duration\",\n type: {\n name: \"Enum\",\n allowedValues: [\"infinite\", \"fixed\"]\n }\n },\n leaseState: {\n serializedName: \"x-ms-lease-state\",\n xmlName: \"x-ms-lease-state\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"available\",\n \"leased\",\n \"expired\",\n \"breaking\",\n \"broken\"\n ]\n }\n },\n leaseStatus: {\n serializedName: \"x-ms-lease-status\",\n xmlName: \"x-ms-lease-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"locked\", \"unlocked\"]\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n acceptRanges: {\n serializedName: \"accept-ranges\",\n xmlName: \"accept-ranges\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n blobCommittedBlockCount: {\n serializedName: \"x-ms-blob-committed-block-count\",\n xmlName: \"x-ms-blob-committed-block-count\",\n type: {\n name: \"Number\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-server-encrypted\",\n xmlName: \"x-ms-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n blobContentMD5: {\n serializedName: \"x-ms-blob-content-md5\",\n xmlName: \"x-ms-blob-content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n },\n contentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n }\n }\n }\n};\nconst BlobQueryExceptionHeaders = {\n serializedName: \"Blob_queryExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobQueryExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobGetTagsHeaders = {\n serializedName: \"Blob_getTagsHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobGetTagsHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobGetTagsExceptionHeaders = {\n serializedName: \"Blob_getTagsExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobGetTagsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetTagsHeaders = {\n serializedName: \"Blob_setTagsHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetTagsHeaders\",\n modelProperties: {\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlobSetTagsExceptionHeaders = {\n serializedName: \"Blob_setTagsExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlobSetTagsExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobCreateHeaders = {\n serializedName: \"PageBlob_createHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobCreateHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobCreateExceptionHeaders = {\n serializedName: \"PageBlob_createExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobCreateExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobUploadPagesHeaders = {\n serializedName: \"PageBlob_uploadPagesHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobUploadPagesHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobUploadPagesExceptionHeaders = {\n serializedName: \"PageBlob_uploadPagesExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobUploadPagesExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobClearPagesHeaders = {\n serializedName: \"PageBlob_clearPagesHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobClearPagesHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobClearPagesExceptionHeaders = {\n serializedName: \"PageBlob_clearPagesExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobClearPagesExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobUploadPagesFromURLHeaders = {\n serializedName: \"PageBlob_uploadPagesFromURLHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobUploadPagesFromURLHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobUploadPagesFromURLExceptionHeaders = {\n serializedName: \"PageBlob_uploadPagesFromURLExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobUploadPagesFromURLExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobGetPageRangesHeaders = {\n serializedName: \"PageBlob_getPageRangesHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobGetPageRangesHeaders\",\n modelProperties: {\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n blobContentLength: {\n serializedName: \"x-ms-blob-content-length\",\n xmlName: \"x-ms-blob-content-length\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobGetPageRangesExceptionHeaders = {\n serializedName: \"PageBlob_getPageRangesExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobGetPageRangesExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobGetPageRangesDiffHeaders = {\n serializedName: \"PageBlob_getPageRangesDiffHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobGetPageRangesDiffHeaders\",\n modelProperties: {\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n blobContentLength: {\n serializedName: \"x-ms-blob-content-length\",\n xmlName: \"x-ms-blob-content-length\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobGetPageRangesDiffExceptionHeaders = {\n serializedName: \"PageBlob_getPageRangesDiffExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobGetPageRangesDiffExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobResizeHeaders = {\n serializedName: \"PageBlob_resizeHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobResizeHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobResizeExceptionHeaders = {\n serializedName: \"PageBlob_resizeExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobResizeExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobUpdateSequenceNumberHeaders = {\n serializedName: \"PageBlob_updateSequenceNumberHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobUpdateSequenceNumberHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n blobSequenceNumber: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobUpdateSequenceNumberExceptionHeaders = {\n serializedName: \"PageBlob_updateSequenceNumberExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobUpdateSequenceNumberExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobCopyIncrementalHeaders = {\n serializedName: \"PageBlob_copyIncrementalHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobCopyIncrementalHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n copyId: {\n serializedName: \"x-ms-copy-id\",\n xmlName: \"x-ms-copy-id\",\n type: {\n name: \"String\"\n }\n },\n copyStatus: {\n serializedName: \"x-ms-copy-status\",\n xmlName: \"x-ms-copy-status\",\n type: {\n name: \"Enum\",\n allowedValues: [\"pending\", \"success\", \"aborted\", \"failed\"]\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst PageBlobCopyIncrementalExceptionHeaders = {\n serializedName: \"PageBlob_copyIncrementalExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"PageBlobCopyIncrementalExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst AppendBlobCreateHeaders = {\n serializedName: \"AppendBlob_createHeaders\",\n type: {\n name: \"Composite\",\n className: \"AppendBlobCreateHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst AppendBlobCreateExceptionHeaders = {\n serializedName: \"AppendBlob_createExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"AppendBlobCreateExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst AppendBlobAppendBlockHeaders = {\n serializedName: \"AppendBlob_appendBlockHeaders\",\n type: {\n name: \"Composite\",\n className: \"AppendBlobAppendBlockHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n blobAppendOffset: {\n serializedName: \"x-ms-blob-append-offset\",\n xmlName: \"x-ms-blob-append-offset\",\n type: {\n name: \"String\"\n }\n },\n blobCommittedBlockCount: {\n serializedName: \"x-ms-blob-committed-block-count\",\n xmlName: \"x-ms-blob-committed-block-count\",\n type: {\n name: \"Number\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst AppendBlobAppendBlockExceptionHeaders = {\n serializedName: \"AppendBlob_appendBlockExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"AppendBlobAppendBlockExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst AppendBlobAppendBlockFromUrlHeaders = {\n serializedName: \"AppendBlob_appendBlockFromUrlHeaders\",\n type: {\n name: \"Composite\",\n className: \"AppendBlobAppendBlockFromUrlHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n blobAppendOffset: {\n serializedName: \"x-ms-blob-append-offset\",\n xmlName: \"x-ms-blob-append-offset\",\n type: {\n name: \"String\"\n }\n },\n blobCommittedBlockCount: {\n serializedName: \"x-ms-blob-committed-block-count\",\n xmlName: \"x-ms-blob-committed-block-count\",\n type: {\n name: \"Number\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst AppendBlobAppendBlockFromUrlExceptionHeaders = {\n serializedName: \"AppendBlob_appendBlockFromUrlExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"AppendBlobAppendBlockFromUrlExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst AppendBlobSealHeaders = {\n serializedName: \"AppendBlob_sealHeaders\",\n type: {\n name: \"Composite\",\n className: \"AppendBlobSealHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isSealed: {\n serializedName: \"x-ms-blob-sealed\",\n xmlName: \"x-ms-blob-sealed\",\n type: {\n name: \"Boolean\"\n }\n }\n }\n }\n};\nconst AppendBlobSealExceptionHeaders = {\n serializedName: \"AppendBlob_sealExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"AppendBlobSealExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobUploadHeaders = {\n serializedName: \"BlockBlob_uploadHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobUploadHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobUploadExceptionHeaders = {\n serializedName: \"BlockBlob_uploadExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobUploadExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobPutBlobFromUrlHeaders = {\n serializedName: \"BlockBlob_putBlobFromUrlHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobPutBlobFromUrlHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobPutBlobFromUrlExceptionHeaders = {\n serializedName: \"BlockBlob_putBlobFromUrlExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobPutBlobFromUrlExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobStageBlockHeaders = {\n serializedName: \"BlockBlob_stageBlockHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobStageBlockHeaders\",\n modelProperties: {\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobStageBlockExceptionHeaders = {\n serializedName: \"BlockBlob_stageBlockExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobStageBlockExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobStageBlockFromURLHeaders = {\n serializedName: \"BlockBlob_stageBlockFromURLHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobStageBlockFromURLHeaders\",\n modelProperties: {\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobStageBlockFromURLExceptionHeaders = {\n serializedName: \"BlockBlob_stageBlockFromURLExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobStageBlockFromURLExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobCommitBlockListHeaders = {\n serializedName: \"BlockBlob_commitBlockListHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobCommitBlockListHeaders\",\n modelProperties: {\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n contentMD5: {\n serializedName: \"content-md5\",\n xmlName: \"content-md5\",\n type: {\n name: \"ByteArray\"\n }\n },\n xMsContentCrc64: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n versionId: {\n serializedName: \"x-ms-version-id\",\n xmlName: \"x-ms-version-id\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n isServerEncrypted: {\n serializedName: \"x-ms-request-server-encrypted\",\n xmlName: \"x-ms-request-server-encrypted\",\n type: {\n name: \"Boolean\"\n }\n },\n encryptionKeySha256: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n },\n encryptionScope: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobCommitBlockListExceptionHeaders = {\n serializedName: \"BlockBlob_commitBlockListExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobCommitBlockListExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobGetBlockListHeaders = {\n serializedName: \"BlockBlob_getBlockListHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobGetBlockListHeaders\",\n modelProperties: {\n lastModified: {\n serializedName: \"last-modified\",\n xmlName: \"last-modified\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n etag: {\n serializedName: \"etag\",\n xmlName: \"etag\",\n type: {\n name: \"String\"\n }\n },\n contentType: {\n serializedName: \"content-type\",\n xmlName: \"content-type\",\n type: {\n name: \"String\"\n }\n },\n blobContentLength: {\n serializedName: \"x-ms-blob-content-length\",\n xmlName: \"x-ms-blob-content-length\",\n type: {\n name: \"Number\"\n }\n },\n clientRequestId: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n },\n requestId: {\n serializedName: \"x-ms-request-id\",\n xmlName: \"x-ms-request-id\",\n type: {\n name: \"String\"\n }\n },\n version: {\n serializedName: \"x-ms-version\",\n xmlName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n },\n date: {\n serializedName: \"date\",\n xmlName: \"date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n },\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\nconst BlockBlobGetBlockListExceptionHeaders = {\n serializedName: \"BlockBlob_getBlockListExceptionHeaders\",\n type: {\n name: \"Composite\",\n className: \"BlockBlobGetBlockListExceptionHeaders\",\n modelProperties: {\n errorCode: {\n serializedName: \"x-ms-error-code\",\n xmlName: \"x-ms-error-code\",\n type: {\n name: \"String\"\n }\n }\n }\n }\n};\n\nvar Mappers = /*#__PURE__*/Object.freeze({\n __proto__: null,\n BlobServiceProperties: BlobServiceProperties,\n Logging: Logging,\n RetentionPolicy: RetentionPolicy,\n Metrics: Metrics,\n CorsRule: CorsRule,\n StaticWebsite: StaticWebsite,\n StorageError: StorageError,\n BlobServiceStatistics: BlobServiceStatistics,\n GeoReplication: GeoReplication,\n ListContainersSegmentResponse: ListContainersSegmentResponse,\n ContainerItem: ContainerItem,\n ContainerProperties: ContainerProperties,\n KeyInfo: KeyInfo,\n UserDelegationKey: UserDelegationKey,\n FilterBlobSegment: FilterBlobSegment,\n FilterBlobItem: FilterBlobItem,\n BlobTags: BlobTags,\n BlobTag: BlobTag,\n SignedIdentifier: SignedIdentifier,\n AccessPolicy: AccessPolicy,\n ListBlobsFlatSegmentResponse: ListBlobsFlatSegmentResponse,\n BlobFlatListSegment: BlobFlatListSegment,\n BlobItemInternal: BlobItemInternal,\n BlobName: BlobName,\n BlobPropertiesInternal: BlobPropertiesInternal,\n ListBlobsHierarchySegmentResponse: ListBlobsHierarchySegmentResponse,\n BlobHierarchyListSegment: BlobHierarchyListSegment,\n BlobPrefix: BlobPrefix,\n BlockLookupList: BlockLookupList,\n BlockList: BlockList,\n Block: Block,\n PageList: PageList,\n PageRange: PageRange,\n ClearRange: ClearRange,\n QueryRequest: QueryRequest,\n QuerySerialization: QuerySerialization,\n QueryFormat: QueryFormat,\n DelimitedTextConfiguration: DelimitedTextConfiguration,\n JsonTextConfiguration: JsonTextConfiguration,\n ArrowConfiguration: ArrowConfiguration,\n ArrowField: ArrowField,\n ServiceSetPropertiesHeaders: ServiceSetPropertiesHeaders,\n ServiceSetPropertiesExceptionHeaders: ServiceSetPropertiesExceptionHeaders,\n ServiceGetPropertiesHeaders: ServiceGetPropertiesHeaders,\n ServiceGetPropertiesExceptionHeaders: ServiceGetPropertiesExceptionHeaders,\n ServiceGetStatisticsHeaders: ServiceGetStatisticsHeaders,\n ServiceGetStatisticsExceptionHeaders: ServiceGetStatisticsExceptionHeaders,\n ServiceListContainersSegmentHeaders: ServiceListContainersSegmentHeaders,\n ServiceListContainersSegmentExceptionHeaders: ServiceListContainersSegmentExceptionHeaders,\n ServiceGetUserDelegationKeyHeaders: ServiceGetUserDelegationKeyHeaders,\n ServiceGetUserDelegationKeyExceptionHeaders: ServiceGetUserDelegationKeyExceptionHeaders,\n ServiceGetAccountInfoHeaders: ServiceGetAccountInfoHeaders,\n ServiceGetAccountInfoExceptionHeaders: ServiceGetAccountInfoExceptionHeaders,\n ServiceSubmitBatchHeaders: ServiceSubmitBatchHeaders,\n ServiceSubmitBatchExceptionHeaders: ServiceSubmitBatchExceptionHeaders,\n ServiceFilterBlobsHeaders: ServiceFilterBlobsHeaders,\n ServiceFilterBlobsExceptionHeaders: ServiceFilterBlobsExceptionHeaders,\n ContainerCreateHeaders: ContainerCreateHeaders,\n ContainerCreateExceptionHeaders: ContainerCreateExceptionHeaders,\n ContainerGetPropertiesHeaders: ContainerGetPropertiesHeaders,\n ContainerGetPropertiesExceptionHeaders: ContainerGetPropertiesExceptionHeaders,\n ContainerDeleteHeaders: ContainerDeleteHeaders,\n ContainerDeleteExceptionHeaders: ContainerDeleteExceptionHeaders,\n ContainerSetMetadataHeaders: ContainerSetMetadataHeaders,\n ContainerSetMetadataExceptionHeaders: ContainerSetMetadataExceptionHeaders,\n ContainerGetAccessPolicyHeaders: ContainerGetAccessPolicyHeaders,\n ContainerGetAccessPolicyExceptionHeaders: ContainerGetAccessPolicyExceptionHeaders,\n ContainerSetAccessPolicyHeaders: ContainerSetAccessPolicyHeaders,\n ContainerSetAccessPolicyExceptionHeaders: ContainerSetAccessPolicyExceptionHeaders,\n ContainerRestoreHeaders: ContainerRestoreHeaders,\n ContainerRestoreExceptionHeaders: ContainerRestoreExceptionHeaders,\n ContainerRenameHeaders: ContainerRenameHeaders,\n ContainerRenameExceptionHeaders: ContainerRenameExceptionHeaders,\n ContainerSubmitBatchHeaders: ContainerSubmitBatchHeaders,\n ContainerSubmitBatchExceptionHeaders: ContainerSubmitBatchExceptionHeaders,\n ContainerFilterBlobsHeaders: ContainerFilterBlobsHeaders,\n ContainerFilterBlobsExceptionHeaders: ContainerFilterBlobsExceptionHeaders,\n ContainerAcquireLeaseHeaders: ContainerAcquireLeaseHeaders,\n ContainerAcquireLeaseExceptionHeaders: ContainerAcquireLeaseExceptionHeaders,\n ContainerReleaseLeaseHeaders: ContainerReleaseLeaseHeaders,\n ContainerReleaseLeaseExceptionHeaders: ContainerReleaseLeaseExceptionHeaders,\n ContainerRenewLeaseHeaders: ContainerRenewLeaseHeaders,\n ContainerRenewLeaseExceptionHeaders: ContainerRenewLeaseExceptionHeaders,\n ContainerBreakLeaseHeaders: ContainerBreakLeaseHeaders,\n ContainerBreakLeaseExceptionHeaders: ContainerBreakLeaseExceptionHeaders,\n ContainerChangeLeaseHeaders: ContainerChangeLeaseHeaders,\n ContainerChangeLeaseExceptionHeaders: ContainerChangeLeaseExceptionHeaders,\n ContainerListBlobFlatSegmentHeaders: ContainerListBlobFlatSegmentHeaders,\n ContainerListBlobFlatSegmentExceptionHeaders: ContainerListBlobFlatSegmentExceptionHeaders,\n ContainerListBlobHierarchySegmentHeaders: ContainerListBlobHierarchySegmentHeaders,\n ContainerListBlobHierarchySegmentExceptionHeaders: ContainerListBlobHierarchySegmentExceptionHeaders,\n ContainerGetAccountInfoHeaders: ContainerGetAccountInfoHeaders,\n ContainerGetAccountInfoExceptionHeaders: ContainerGetAccountInfoExceptionHeaders,\n BlobDownloadHeaders: BlobDownloadHeaders,\n BlobDownloadExceptionHeaders: BlobDownloadExceptionHeaders,\n BlobGetPropertiesHeaders: BlobGetPropertiesHeaders,\n BlobGetPropertiesExceptionHeaders: BlobGetPropertiesExceptionHeaders,\n BlobDeleteHeaders: BlobDeleteHeaders,\n BlobDeleteExceptionHeaders: BlobDeleteExceptionHeaders,\n BlobUndeleteHeaders: BlobUndeleteHeaders,\n BlobUndeleteExceptionHeaders: BlobUndeleteExceptionHeaders,\n BlobSetExpiryHeaders: BlobSetExpiryHeaders,\n BlobSetExpiryExceptionHeaders: BlobSetExpiryExceptionHeaders,\n BlobSetHttpHeadersHeaders: BlobSetHttpHeadersHeaders,\n BlobSetHttpHeadersExceptionHeaders: BlobSetHttpHeadersExceptionHeaders,\n BlobSetImmutabilityPolicyHeaders: BlobSetImmutabilityPolicyHeaders,\n BlobSetImmutabilityPolicyExceptionHeaders: BlobSetImmutabilityPolicyExceptionHeaders,\n BlobDeleteImmutabilityPolicyHeaders: BlobDeleteImmutabilityPolicyHeaders,\n BlobDeleteImmutabilityPolicyExceptionHeaders: BlobDeleteImmutabilityPolicyExceptionHeaders,\n BlobSetLegalHoldHeaders: BlobSetLegalHoldHeaders,\n BlobSetLegalHoldExceptionHeaders: BlobSetLegalHoldExceptionHeaders,\n BlobSetMetadataHeaders: BlobSetMetadataHeaders,\n BlobSetMetadataExceptionHeaders: BlobSetMetadataExceptionHeaders,\n BlobAcquireLeaseHeaders: BlobAcquireLeaseHeaders,\n BlobAcquireLeaseExceptionHeaders: BlobAcquireLeaseExceptionHeaders,\n BlobReleaseLeaseHeaders: BlobReleaseLeaseHeaders,\n BlobReleaseLeaseExceptionHeaders: BlobReleaseLeaseExceptionHeaders,\n BlobRenewLeaseHeaders: BlobRenewLeaseHeaders,\n BlobRenewLeaseExceptionHeaders: BlobRenewLeaseExceptionHeaders,\n BlobChangeLeaseHeaders: BlobChangeLeaseHeaders,\n BlobChangeLeaseExceptionHeaders: BlobChangeLeaseExceptionHeaders,\n BlobBreakLeaseHeaders: BlobBreakLeaseHeaders,\n BlobBreakLeaseExceptionHeaders: BlobBreakLeaseExceptionHeaders,\n BlobCreateSnapshotHeaders: BlobCreateSnapshotHeaders,\n BlobCreateSnapshotExceptionHeaders: BlobCreateSnapshotExceptionHeaders,\n BlobStartCopyFromURLHeaders: BlobStartCopyFromURLHeaders,\n BlobStartCopyFromURLExceptionHeaders: BlobStartCopyFromURLExceptionHeaders,\n BlobCopyFromURLHeaders: BlobCopyFromURLHeaders,\n BlobCopyFromURLExceptionHeaders: BlobCopyFromURLExceptionHeaders,\n BlobAbortCopyFromURLHeaders: BlobAbortCopyFromURLHeaders,\n BlobAbortCopyFromURLExceptionHeaders: BlobAbortCopyFromURLExceptionHeaders,\n BlobSetTierHeaders: BlobSetTierHeaders,\n BlobSetTierExceptionHeaders: BlobSetTierExceptionHeaders,\n BlobGetAccountInfoHeaders: BlobGetAccountInfoHeaders,\n BlobGetAccountInfoExceptionHeaders: BlobGetAccountInfoExceptionHeaders,\n BlobQueryHeaders: BlobQueryHeaders,\n BlobQueryExceptionHeaders: BlobQueryExceptionHeaders,\n BlobGetTagsHeaders: BlobGetTagsHeaders,\n BlobGetTagsExceptionHeaders: BlobGetTagsExceptionHeaders,\n BlobSetTagsHeaders: BlobSetTagsHeaders,\n BlobSetTagsExceptionHeaders: BlobSetTagsExceptionHeaders,\n PageBlobCreateHeaders: PageBlobCreateHeaders,\n PageBlobCreateExceptionHeaders: PageBlobCreateExceptionHeaders,\n PageBlobUploadPagesHeaders: PageBlobUploadPagesHeaders,\n PageBlobUploadPagesExceptionHeaders: PageBlobUploadPagesExceptionHeaders,\n PageBlobClearPagesHeaders: PageBlobClearPagesHeaders,\n PageBlobClearPagesExceptionHeaders: PageBlobClearPagesExceptionHeaders,\n PageBlobUploadPagesFromURLHeaders: PageBlobUploadPagesFromURLHeaders,\n PageBlobUploadPagesFromURLExceptionHeaders: PageBlobUploadPagesFromURLExceptionHeaders,\n PageBlobGetPageRangesHeaders: PageBlobGetPageRangesHeaders,\n PageBlobGetPageRangesExceptionHeaders: PageBlobGetPageRangesExceptionHeaders,\n PageBlobGetPageRangesDiffHeaders: PageBlobGetPageRangesDiffHeaders,\n PageBlobGetPageRangesDiffExceptionHeaders: PageBlobGetPageRangesDiffExceptionHeaders,\n PageBlobResizeHeaders: PageBlobResizeHeaders,\n PageBlobResizeExceptionHeaders: PageBlobResizeExceptionHeaders,\n PageBlobUpdateSequenceNumberHeaders: PageBlobUpdateSequenceNumberHeaders,\n PageBlobUpdateSequenceNumberExceptionHeaders: PageBlobUpdateSequenceNumberExceptionHeaders,\n PageBlobCopyIncrementalHeaders: PageBlobCopyIncrementalHeaders,\n PageBlobCopyIncrementalExceptionHeaders: PageBlobCopyIncrementalExceptionHeaders,\n AppendBlobCreateHeaders: AppendBlobCreateHeaders,\n AppendBlobCreateExceptionHeaders: AppendBlobCreateExceptionHeaders,\n AppendBlobAppendBlockHeaders: AppendBlobAppendBlockHeaders,\n AppendBlobAppendBlockExceptionHeaders: AppendBlobAppendBlockExceptionHeaders,\n AppendBlobAppendBlockFromUrlHeaders: AppendBlobAppendBlockFromUrlHeaders,\n AppendBlobAppendBlockFromUrlExceptionHeaders: AppendBlobAppendBlockFromUrlExceptionHeaders,\n AppendBlobSealHeaders: AppendBlobSealHeaders,\n AppendBlobSealExceptionHeaders: AppendBlobSealExceptionHeaders,\n BlockBlobUploadHeaders: BlockBlobUploadHeaders,\n BlockBlobUploadExceptionHeaders: BlockBlobUploadExceptionHeaders,\n BlockBlobPutBlobFromUrlHeaders: BlockBlobPutBlobFromUrlHeaders,\n BlockBlobPutBlobFromUrlExceptionHeaders: BlockBlobPutBlobFromUrlExceptionHeaders,\n BlockBlobStageBlockHeaders: BlockBlobStageBlockHeaders,\n BlockBlobStageBlockExceptionHeaders: BlockBlobStageBlockExceptionHeaders,\n BlockBlobStageBlockFromURLHeaders: BlockBlobStageBlockFromURLHeaders,\n BlockBlobStageBlockFromURLExceptionHeaders: BlockBlobStageBlockFromURLExceptionHeaders,\n BlockBlobCommitBlockListHeaders: BlockBlobCommitBlockListHeaders,\n BlockBlobCommitBlockListExceptionHeaders: BlockBlobCommitBlockListExceptionHeaders,\n BlockBlobGetBlockListHeaders: BlockBlobGetBlockListHeaders,\n BlockBlobGetBlockListExceptionHeaders: BlockBlobGetBlockListExceptionHeaders\n});\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\nconst contentType = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/xml\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobServiceProperties = {\n parameterPath: \"blobServiceProperties\",\n mapper: BlobServiceProperties\n};\nconst accept = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/xml\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\nconst url = {\n parameterPath: \"url\",\n mapper: {\n serializedName: \"url\",\n required: true,\n xmlName: \"url\",\n type: {\n name: \"String\"\n }\n },\n skipEncoding: true\n};\nconst restype = {\n parameterPath: \"restype\",\n mapper: {\n defaultValue: \"service\",\n isConstant: true,\n serializedName: \"restype\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"properties\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst timeoutInSeconds = {\n parameterPath: [\"options\", \"timeoutInSeconds\"],\n mapper: {\n constraints: {\n InclusiveMinimum: 0\n },\n serializedName: \"timeout\",\n xmlName: \"timeout\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst version = {\n parameterPath: \"version\",\n mapper: {\n defaultValue: \"2023-01-03\",\n isConstant: true,\n serializedName: \"x-ms-version\",\n type: {\n name: \"String\"\n }\n }\n};\nconst requestId = {\n parameterPath: [\"options\", \"requestId\"],\n mapper: {\n serializedName: \"x-ms-client-request-id\",\n xmlName: \"x-ms-client-request-id\",\n type: {\n name: \"String\"\n }\n }\n};\nconst accept1 = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/xml\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp1 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"stats\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp2 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"list\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst prefix = {\n parameterPath: [\"options\", \"prefix\"],\n mapper: {\n serializedName: \"prefix\",\n xmlName: \"prefix\",\n type: {\n name: \"String\"\n }\n }\n};\nconst marker = {\n parameterPath: [\"options\", \"marker\"],\n mapper: {\n serializedName: \"marker\",\n xmlName: \"marker\",\n type: {\n name: \"String\"\n }\n }\n};\nconst maxPageSize = {\n parameterPath: [\"options\", \"maxPageSize\"],\n mapper: {\n constraints: {\n InclusiveMinimum: 1\n },\n serializedName: \"maxresults\",\n xmlName: \"maxresults\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst include = {\n parameterPath: [\"options\", \"include\"],\n mapper: {\n serializedName: \"include\",\n xmlName: \"include\",\n xmlElementName: \"ListContainersIncludeType\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Enum\",\n allowedValues: [\"metadata\", \"deleted\", \"system\"]\n }\n }\n }\n },\n collectionFormat: coreHttp.QueryCollectionFormat.Csv\n};\nconst keyInfo = {\n parameterPath: \"keyInfo\",\n mapper: KeyInfo\n};\nconst comp3 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"userdelegationkey\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst restype1 = {\n parameterPath: \"restype\",\n mapper: {\n defaultValue: \"account\",\n isConstant: true,\n serializedName: \"restype\",\n type: {\n name: \"String\"\n }\n }\n};\nconst body = {\n parameterPath: \"body\",\n mapper: {\n serializedName: \"body\",\n required: true,\n xmlName: \"body\",\n type: {\n name: \"Stream\"\n }\n }\n};\nconst comp4 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"batch\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst contentLength = {\n parameterPath: \"contentLength\",\n mapper: {\n serializedName: \"Content-Length\",\n required: true,\n xmlName: \"Content-Length\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst multipartContentType = {\n parameterPath: \"multipartContentType\",\n mapper: {\n serializedName: \"Content-Type\",\n required: true,\n xmlName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp5 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"blobs\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst where = {\n parameterPath: [\"options\", \"where\"],\n mapper: {\n serializedName: \"where\",\n xmlName: \"where\",\n type: {\n name: \"String\"\n }\n }\n};\nconst restype2 = {\n parameterPath: \"restype\",\n mapper: {\n defaultValue: \"container\",\n isConstant: true,\n serializedName: \"restype\",\n type: {\n name: \"String\"\n }\n }\n};\nconst metadata = {\n parameterPath: [\"options\", \"metadata\"],\n mapper: {\n serializedName: \"x-ms-meta\",\n xmlName: \"x-ms-meta\",\n type: {\n name: \"Dictionary\",\n value: { type: { name: \"String\" } }\n },\n headerCollectionPrefix: \"x-ms-meta-\"\n }\n};\nconst access = {\n parameterPath: [\"options\", \"access\"],\n mapper: {\n serializedName: \"x-ms-blob-public-access\",\n xmlName: \"x-ms-blob-public-access\",\n type: {\n name: \"Enum\",\n allowedValues: [\"container\", \"blob\"]\n }\n }\n};\nconst defaultEncryptionScope = {\n parameterPath: [\n \"options\",\n \"containerEncryptionScope\",\n \"defaultEncryptionScope\"\n ],\n mapper: {\n serializedName: \"x-ms-default-encryption-scope\",\n xmlName: \"x-ms-default-encryption-scope\",\n type: {\n name: \"String\"\n }\n }\n};\nconst preventEncryptionScopeOverride = {\n parameterPath: [\n \"options\",\n \"containerEncryptionScope\",\n \"preventEncryptionScopeOverride\"\n ],\n mapper: {\n serializedName: \"x-ms-deny-encryption-scope-override\",\n xmlName: \"x-ms-deny-encryption-scope-override\",\n type: {\n name: \"Boolean\"\n }\n }\n};\nconst leaseId = {\n parameterPath: [\"options\", \"leaseAccessConditions\", \"leaseId\"],\n mapper: {\n serializedName: \"x-ms-lease-id\",\n xmlName: \"x-ms-lease-id\",\n type: {\n name: \"String\"\n }\n }\n};\nconst ifModifiedSince = {\n parameterPath: [\"options\", \"modifiedAccessConditions\", \"ifModifiedSince\"],\n mapper: {\n serializedName: \"If-Modified-Since\",\n xmlName: \"If-Modified-Since\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n};\nconst ifUnmodifiedSince = {\n parameterPath: [\"options\", \"modifiedAccessConditions\", \"ifUnmodifiedSince\"],\n mapper: {\n serializedName: \"If-Unmodified-Since\",\n xmlName: \"If-Unmodified-Since\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n};\nconst comp6 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"metadata\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp7 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"acl\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst containerAcl = {\n parameterPath: [\"options\", \"containerAcl\"],\n mapper: {\n serializedName: \"containerAcl\",\n xmlName: \"SignedIdentifiers\",\n xmlIsWrapped: true,\n xmlElementName: \"SignedIdentifier\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Composite\",\n className: \"SignedIdentifier\"\n }\n }\n }\n }\n};\nconst comp8 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"undelete\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst deletedContainerName = {\n parameterPath: [\"options\", \"deletedContainerName\"],\n mapper: {\n serializedName: \"x-ms-deleted-container-name\",\n xmlName: \"x-ms-deleted-container-name\",\n type: {\n name: \"String\"\n }\n }\n};\nconst deletedContainerVersion = {\n parameterPath: [\"options\", \"deletedContainerVersion\"],\n mapper: {\n serializedName: \"x-ms-deleted-container-version\",\n xmlName: \"x-ms-deleted-container-version\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp9 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"rename\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sourceContainerName = {\n parameterPath: \"sourceContainerName\",\n mapper: {\n serializedName: \"x-ms-source-container-name\",\n required: true,\n xmlName: \"x-ms-source-container-name\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sourceLeaseId = {\n parameterPath: [\"options\", \"sourceLeaseId\"],\n mapper: {\n serializedName: \"x-ms-source-lease-id\",\n xmlName: \"x-ms-source-lease-id\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp10 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"lease\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst action = {\n parameterPath: \"action\",\n mapper: {\n defaultValue: \"acquire\",\n isConstant: true,\n serializedName: \"x-ms-lease-action\",\n type: {\n name: \"String\"\n }\n }\n};\nconst duration = {\n parameterPath: [\"options\", \"duration\"],\n mapper: {\n serializedName: \"x-ms-lease-duration\",\n xmlName: \"x-ms-lease-duration\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst proposedLeaseId = {\n parameterPath: [\"options\", \"proposedLeaseId\"],\n mapper: {\n serializedName: \"x-ms-proposed-lease-id\",\n xmlName: \"x-ms-proposed-lease-id\",\n type: {\n name: \"String\"\n }\n }\n};\nconst action1 = {\n parameterPath: \"action\",\n mapper: {\n defaultValue: \"release\",\n isConstant: true,\n serializedName: \"x-ms-lease-action\",\n type: {\n name: \"String\"\n }\n }\n};\nconst leaseId1 = {\n parameterPath: \"leaseId\",\n mapper: {\n serializedName: \"x-ms-lease-id\",\n required: true,\n xmlName: \"x-ms-lease-id\",\n type: {\n name: \"String\"\n }\n }\n};\nconst action2 = {\n parameterPath: \"action\",\n mapper: {\n defaultValue: \"renew\",\n isConstant: true,\n serializedName: \"x-ms-lease-action\",\n type: {\n name: \"String\"\n }\n }\n};\nconst action3 = {\n parameterPath: \"action\",\n mapper: {\n defaultValue: \"break\",\n isConstant: true,\n serializedName: \"x-ms-lease-action\",\n type: {\n name: \"String\"\n }\n }\n};\nconst breakPeriod = {\n parameterPath: [\"options\", \"breakPeriod\"],\n mapper: {\n serializedName: \"x-ms-lease-break-period\",\n xmlName: \"x-ms-lease-break-period\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst action4 = {\n parameterPath: \"action\",\n mapper: {\n defaultValue: \"change\",\n isConstant: true,\n serializedName: \"x-ms-lease-action\",\n type: {\n name: \"String\"\n }\n }\n};\nconst proposedLeaseId1 = {\n parameterPath: \"proposedLeaseId\",\n mapper: {\n serializedName: \"x-ms-proposed-lease-id\",\n required: true,\n xmlName: \"x-ms-proposed-lease-id\",\n type: {\n name: \"String\"\n }\n }\n};\nconst include1 = {\n parameterPath: [\"options\", \"include\"],\n mapper: {\n serializedName: \"include\",\n xmlName: \"include\",\n xmlElementName: \"ListBlobsIncludeItem\",\n type: {\n name: \"Sequence\",\n element: {\n type: {\n name: \"Enum\",\n allowedValues: [\n \"copy\",\n \"deleted\",\n \"metadata\",\n \"snapshots\",\n \"uncommittedblobs\",\n \"versions\",\n \"tags\",\n \"immutabilitypolicy\",\n \"legalhold\",\n \"deletedwithversions\"\n ]\n }\n }\n }\n },\n collectionFormat: coreHttp.QueryCollectionFormat.Csv\n};\nconst delimiter = {\n parameterPath: \"delimiter\",\n mapper: {\n serializedName: \"delimiter\",\n required: true,\n xmlName: \"delimiter\",\n type: {\n name: \"String\"\n }\n }\n};\nconst snapshot = {\n parameterPath: [\"options\", \"snapshot\"],\n mapper: {\n serializedName: \"snapshot\",\n xmlName: \"snapshot\",\n type: {\n name: \"String\"\n }\n }\n};\nconst versionId = {\n parameterPath: [\"options\", \"versionId\"],\n mapper: {\n serializedName: \"versionid\",\n xmlName: \"versionid\",\n type: {\n name: \"String\"\n }\n }\n};\nconst range = {\n parameterPath: [\"options\", \"range\"],\n mapper: {\n serializedName: \"x-ms-range\",\n xmlName: \"x-ms-range\",\n type: {\n name: \"String\"\n }\n }\n};\nconst rangeGetContentMD5 = {\n parameterPath: [\"options\", \"rangeGetContentMD5\"],\n mapper: {\n serializedName: \"x-ms-range-get-content-md5\",\n xmlName: \"x-ms-range-get-content-md5\",\n type: {\n name: \"Boolean\"\n }\n }\n};\nconst rangeGetContentCRC64 = {\n parameterPath: [\"options\", \"rangeGetContentCRC64\"],\n mapper: {\n serializedName: \"x-ms-range-get-content-crc64\",\n xmlName: \"x-ms-range-get-content-crc64\",\n type: {\n name: \"Boolean\"\n }\n }\n};\nconst encryptionKey = {\n parameterPath: [\"options\", \"cpkInfo\", \"encryptionKey\"],\n mapper: {\n serializedName: \"x-ms-encryption-key\",\n xmlName: \"x-ms-encryption-key\",\n type: {\n name: \"String\"\n }\n }\n};\nconst encryptionKeySha256 = {\n parameterPath: [\"options\", \"cpkInfo\", \"encryptionKeySha256\"],\n mapper: {\n serializedName: \"x-ms-encryption-key-sha256\",\n xmlName: \"x-ms-encryption-key-sha256\",\n type: {\n name: \"String\"\n }\n }\n};\nconst encryptionAlgorithm = {\n parameterPath: [\"options\", \"cpkInfo\", \"encryptionAlgorithm\"],\n mapper: {\n serializedName: \"x-ms-encryption-algorithm\",\n xmlName: \"x-ms-encryption-algorithm\",\n type: {\n name: \"String\"\n }\n }\n};\nconst ifMatch = {\n parameterPath: [\"options\", \"modifiedAccessConditions\", \"ifMatch\"],\n mapper: {\n serializedName: \"If-Match\",\n xmlName: \"If-Match\",\n type: {\n name: \"String\"\n }\n }\n};\nconst ifNoneMatch = {\n parameterPath: [\"options\", \"modifiedAccessConditions\", \"ifNoneMatch\"],\n mapper: {\n serializedName: \"If-None-Match\",\n xmlName: \"If-None-Match\",\n type: {\n name: \"String\"\n }\n }\n};\nconst ifTags = {\n parameterPath: [\"options\", \"modifiedAccessConditions\", \"ifTags\"],\n mapper: {\n serializedName: \"x-ms-if-tags\",\n xmlName: \"x-ms-if-tags\",\n type: {\n name: \"String\"\n }\n }\n};\nconst deleteSnapshots = {\n parameterPath: [\"options\", \"deleteSnapshots\"],\n mapper: {\n serializedName: \"x-ms-delete-snapshots\",\n xmlName: \"x-ms-delete-snapshots\",\n type: {\n name: \"Enum\",\n allowedValues: [\"include\", \"only\"]\n }\n }\n};\nconst blobDeleteType = {\n parameterPath: [\"options\", \"blobDeleteType\"],\n mapper: {\n serializedName: \"deletetype\",\n xmlName: \"deletetype\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp11 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"expiry\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst expiryOptions = {\n parameterPath: \"expiryOptions\",\n mapper: {\n serializedName: \"x-ms-expiry-option\",\n required: true,\n xmlName: \"x-ms-expiry-option\",\n type: {\n name: \"String\"\n }\n }\n};\nconst expiresOn = {\n parameterPath: [\"options\", \"expiresOn\"],\n mapper: {\n serializedName: \"x-ms-expiry-time\",\n xmlName: \"x-ms-expiry-time\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobCacheControl = {\n parameterPath: [\"options\", \"blobHttpHeaders\", \"blobCacheControl\"],\n mapper: {\n serializedName: \"x-ms-blob-cache-control\",\n xmlName: \"x-ms-blob-cache-control\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobContentType = {\n parameterPath: [\"options\", \"blobHttpHeaders\", \"blobContentType\"],\n mapper: {\n serializedName: \"x-ms-blob-content-type\",\n xmlName: \"x-ms-blob-content-type\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobContentMD5 = {\n parameterPath: [\"options\", \"blobHttpHeaders\", \"blobContentMD5\"],\n mapper: {\n serializedName: \"x-ms-blob-content-md5\",\n xmlName: \"x-ms-blob-content-md5\",\n type: {\n name: \"ByteArray\"\n }\n }\n};\nconst blobContentEncoding = {\n parameterPath: [\"options\", \"blobHttpHeaders\", \"blobContentEncoding\"],\n mapper: {\n serializedName: \"x-ms-blob-content-encoding\",\n xmlName: \"x-ms-blob-content-encoding\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobContentLanguage = {\n parameterPath: [\"options\", \"blobHttpHeaders\", \"blobContentLanguage\"],\n mapper: {\n serializedName: \"x-ms-blob-content-language\",\n xmlName: \"x-ms-blob-content-language\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobContentDisposition = {\n parameterPath: [\"options\", \"blobHttpHeaders\", \"blobContentDisposition\"],\n mapper: {\n serializedName: \"x-ms-blob-content-disposition\",\n xmlName: \"x-ms-blob-content-disposition\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp12 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"immutabilityPolicies\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst immutabilityPolicyExpiry = {\n parameterPath: [\"options\", \"immutabilityPolicyExpiry\"],\n mapper: {\n serializedName: \"x-ms-immutability-policy-until-date\",\n xmlName: \"x-ms-immutability-policy-until-date\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n};\nconst immutabilityPolicyMode = {\n parameterPath: [\"options\", \"immutabilityPolicyMode\"],\n mapper: {\n serializedName: \"x-ms-immutability-policy-mode\",\n xmlName: \"x-ms-immutability-policy-mode\",\n type: {\n name: \"Enum\",\n allowedValues: [\"Mutable\", \"Unlocked\", \"Locked\"]\n }\n }\n};\nconst comp13 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"legalhold\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst legalHold = {\n parameterPath: \"legalHold\",\n mapper: {\n serializedName: \"x-ms-legal-hold\",\n required: true,\n xmlName: \"x-ms-legal-hold\",\n type: {\n name: \"Boolean\"\n }\n }\n};\nconst encryptionScope = {\n parameterPath: [\"options\", \"encryptionScope\"],\n mapper: {\n serializedName: \"x-ms-encryption-scope\",\n xmlName: \"x-ms-encryption-scope\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp14 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"snapshot\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst tier = {\n parameterPath: [\"options\", \"tier\"],\n mapper: {\n serializedName: \"x-ms-access-tier\",\n xmlName: \"x-ms-access-tier\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"P4\",\n \"P6\",\n \"P10\",\n \"P15\",\n \"P20\",\n \"P30\",\n \"P40\",\n \"P50\",\n \"P60\",\n \"P70\",\n \"P80\",\n \"Hot\",\n \"Cool\",\n \"Archive\",\n \"Cold\"\n ]\n }\n }\n};\nconst rehydratePriority = {\n parameterPath: [\"options\", \"rehydratePriority\"],\n mapper: {\n serializedName: \"x-ms-rehydrate-priority\",\n xmlName: \"x-ms-rehydrate-priority\",\n type: {\n name: \"Enum\",\n allowedValues: [\"High\", \"Standard\"]\n }\n }\n};\nconst sourceIfModifiedSince = {\n parameterPath: [\n \"options\",\n \"sourceModifiedAccessConditions\",\n \"sourceIfModifiedSince\"\n ],\n mapper: {\n serializedName: \"x-ms-source-if-modified-since\",\n xmlName: \"x-ms-source-if-modified-since\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n};\nconst sourceIfUnmodifiedSince = {\n parameterPath: [\n \"options\",\n \"sourceModifiedAccessConditions\",\n \"sourceIfUnmodifiedSince\"\n ],\n mapper: {\n serializedName: \"x-ms-source-if-unmodified-since\",\n xmlName: \"x-ms-source-if-unmodified-since\",\n type: {\n name: \"DateTimeRfc1123\"\n }\n }\n};\nconst sourceIfMatch = {\n parameterPath: [\"options\", \"sourceModifiedAccessConditions\", \"sourceIfMatch\"],\n mapper: {\n serializedName: \"x-ms-source-if-match\",\n xmlName: \"x-ms-source-if-match\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sourceIfNoneMatch = {\n parameterPath: [\n \"options\",\n \"sourceModifiedAccessConditions\",\n \"sourceIfNoneMatch\"\n ],\n mapper: {\n serializedName: \"x-ms-source-if-none-match\",\n xmlName: \"x-ms-source-if-none-match\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sourceIfTags = {\n parameterPath: [\"options\", \"sourceModifiedAccessConditions\", \"sourceIfTags\"],\n mapper: {\n serializedName: \"x-ms-source-if-tags\",\n xmlName: \"x-ms-source-if-tags\",\n type: {\n name: \"String\"\n }\n }\n};\nconst copySource = {\n parameterPath: \"copySource\",\n mapper: {\n serializedName: \"x-ms-copy-source\",\n required: true,\n xmlName: \"x-ms-copy-source\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobTagsString = {\n parameterPath: [\"options\", \"blobTagsString\"],\n mapper: {\n serializedName: \"x-ms-tags\",\n xmlName: \"x-ms-tags\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sealBlob = {\n parameterPath: [\"options\", \"sealBlob\"],\n mapper: {\n serializedName: \"x-ms-seal-blob\",\n xmlName: \"x-ms-seal-blob\",\n type: {\n name: \"Boolean\"\n }\n }\n};\nconst legalHold1 = {\n parameterPath: [\"options\", \"legalHold\"],\n mapper: {\n serializedName: \"x-ms-legal-hold\",\n xmlName: \"x-ms-legal-hold\",\n type: {\n name: \"Boolean\"\n }\n }\n};\nconst xMsRequiresSync = {\n parameterPath: \"xMsRequiresSync\",\n mapper: {\n defaultValue: \"true\",\n isConstant: true,\n serializedName: \"x-ms-requires-sync\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sourceContentMD5 = {\n parameterPath: [\"options\", \"sourceContentMD5\"],\n mapper: {\n serializedName: \"x-ms-source-content-md5\",\n xmlName: \"x-ms-source-content-md5\",\n type: {\n name: \"ByteArray\"\n }\n }\n};\nconst copySourceAuthorization = {\n parameterPath: [\"options\", \"copySourceAuthorization\"],\n mapper: {\n serializedName: \"x-ms-copy-source-authorization\",\n xmlName: \"x-ms-copy-source-authorization\",\n type: {\n name: \"String\"\n }\n }\n};\nconst copySourceTags = {\n parameterPath: [\"options\", \"copySourceTags\"],\n mapper: {\n serializedName: \"x-ms-copy-source-tag-option\",\n xmlName: \"x-ms-copy-source-tag-option\",\n type: {\n name: \"Enum\",\n allowedValues: [\"REPLACE\", \"COPY\"]\n }\n }\n};\nconst comp15 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"copy\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst copyActionAbortConstant = {\n parameterPath: \"copyActionAbortConstant\",\n mapper: {\n defaultValue: \"abort\",\n isConstant: true,\n serializedName: \"x-ms-copy-action\",\n type: {\n name: \"String\"\n }\n }\n};\nconst copyId = {\n parameterPath: \"copyId\",\n mapper: {\n serializedName: \"copyid\",\n required: true,\n xmlName: \"copyid\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp16 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"tier\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst tier1 = {\n parameterPath: \"tier\",\n mapper: {\n serializedName: \"x-ms-access-tier\",\n required: true,\n xmlName: \"x-ms-access-tier\",\n type: {\n name: \"Enum\",\n allowedValues: [\n \"P4\",\n \"P6\",\n \"P10\",\n \"P15\",\n \"P20\",\n \"P30\",\n \"P40\",\n \"P50\",\n \"P60\",\n \"P70\",\n \"P80\",\n \"Hot\",\n \"Cool\",\n \"Archive\",\n \"Cold\"\n ]\n }\n }\n};\nconst queryRequest = {\n parameterPath: [\"options\", \"queryRequest\"],\n mapper: QueryRequest\n};\nconst comp17 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"query\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp18 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"tags\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst tags = {\n parameterPath: [\"options\", \"tags\"],\n mapper: BlobTags\n};\nconst transactionalContentMD5 = {\n parameterPath: [\"options\", \"transactionalContentMD5\"],\n mapper: {\n serializedName: \"Content-MD5\",\n xmlName: \"Content-MD5\",\n type: {\n name: \"ByteArray\"\n }\n }\n};\nconst transactionalContentCrc64 = {\n parameterPath: [\"options\", \"transactionalContentCrc64\"],\n mapper: {\n serializedName: \"x-ms-content-crc64\",\n xmlName: \"x-ms-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n }\n};\nconst blobType = {\n parameterPath: \"blobType\",\n mapper: {\n defaultValue: \"PageBlob\",\n isConstant: true,\n serializedName: \"x-ms-blob-type\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobContentLength = {\n parameterPath: \"blobContentLength\",\n mapper: {\n serializedName: \"x-ms-blob-content-length\",\n required: true,\n xmlName: \"x-ms-blob-content-length\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst blobSequenceNumber = {\n parameterPath: [\"options\", \"blobSequenceNumber\"],\n mapper: {\n serializedName: \"x-ms-blob-sequence-number\",\n xmlName: \"x-ms-blob-sequence-number\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst contentType1 = {\n parameterPath: [\"options\", \"contentType\"],\n mapper: {\n defaultValue: \"application/octet-stream\",\n isConstant: true,\n serializedName: \"Content-Type\",\n type: {\n name: \"String\"\n }\n }\n};\nconst body1 = {\n parameterPath: \"body\",\n mapper: {\n serializedName: \"body\",\n required: true,\n xmlName: \"body\",\n type: {\n name: \"Stream\"\n }\n }\n};\nconst accept2 = {\n parameterPath: \"accept\",\n mapper: {\n defaultValue: \"application/xml\",\n isConstant: true,\n serializedName: \"Accept\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp19 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"page\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst pageWrite = {\n parameterPath: \"pageWrite\",\n mapper: {\n defaultValue: \"update\",\n isConstant: true,\n serializedName: \"x-ms-page-write\",\n type: {\n name: \"String\"\n }\n }\n};\nconst ifSequenceNumberLessThanOrEqualTo = {\n parameterPath: [\n \"options\",\n \"sequenceNumberAccessConditions\",\n \"ifSequenceNumberLessThanOrEqualTo\"\n ],\n mapper: {\n serializedName: \"x-ms-if-sequence-number-le\",\n xmlName: \"x-ms-if-sequence-number-le\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst ifSequenceNumberLessThan = {\n parameterPath: [\n \"options\",\n \"sequenceNumberAccessConditions\",\n \"ifSequenceNumberLessThan\"\n ],\n mapper: {\n serializedName: \"x-ms-if-sequence-number-lt\",\n xmlName: \"x-ms-if-sequence-number-lt\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst ifSequenceNumberEqualTo = {\n parameterPath: [\n \"options\",\n \"sequenceNumberAccessConditions\",\n \"ifSequenceNumberEqualTo\"\n ],\n mapper: {\n serializedName: \"x-ms-if-sequence-number-eq\",\n xmlName: \"x-ms-if-sequence-number-eq\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst pageWrite1 = {\n parameterPath: \"pageWrite\",\n mapper: {\n defaultValue: \"clear\",\n isConstant: true,\n serializedName: \"x-ms-page-write\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sourceUrl = {\n parameterPath: \"sourceUrl\",\n mapper: {\n serializedName: \"x-ms-copy-source\",\n required: true,\n xmlName: \"x-ms-copy-source\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sourceRange = {\n parameterPath: \"sourceRange\",\n mapper: {\n serializedName: \"x-ms-source-range\",\n required: true,\n xmlName: \"x-ms-source-range\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sourceContentCrc64 = {\n parameterPath: [\"options\", \"sourceContentCrc64\"],\n mapper: {\n serializedName: \"x-ms-source-content-crc64\",\n xmlName: \"x-ms-source-content-crc64\",\n type: {\n name: \"ByteArray\"\n }\n }\n};\nconst range1 = {\n parameterPath: \"range\",\n mapper: {\n serializedName: \"x-ms-range\",\n required: true,\n xmlName: \"x-ms-range\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp20 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"pagelist\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst prevsnapshot = {\n parameterPath: [\"options\", \"prevsnapshot\"],\n mapper: {\n serializedName: \"prevsnapshot\",\n xmlName: \"prevsnapshot\",\n type: {\n name: \"String\"\n }\n }\n};\nconst prevSnapshotUrl = {\n parameterPath: [\"options\", \"prevSnapshotUrl\"],\n mapper: {\n serializedName: \"x-ms-previous-snapshot-url\",\n xmlName: \"x-ms-previous-snapshot-url\",\n type: {\n name: \"String\"\n }\n }\n};\nconst sequenceNumberAction = {\n parameterPath: \"sequenceNumberAction\",\n mapper: {\n serializedName: \"x-ms-sequence-number-action\",\n required: true,\n xmlName: \"x-ms-sequence-number-action\",\n type: {\n name: \"Enum\",\n allowedValues: [\"max\", \"update\", \"increment\"]\n }\n }\n};\nconst comp21 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"incrementalcopy\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobType1 = {\n parameterPath: \"blobType\",\n mapper: {\n defaultValue: \"AppendBlob\",\n isConstant: true,\n serializedName: \"x-ms-blob-type\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp22 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"appendblock\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst maxSize = {\n parameterPath: [\"options\", \"appendPositionAccessConditions\", \"maxSize\"],\n mapper: {\n serializedName: \"x-ms-blob-condition-maxsize\",\n xmlName: \"x-ms-blob-condition-maxsize\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst appendPosition = {\n parameterPath: [\n \"options\",\n \"appendPositionAccessConditions\",\n \"appendPosition\"\n ],\n mapper: {\n serializedName: \"x-ms-blob-condition-appendpos\",\n xmlName: \"x-ms-blob-condition-appendpos\",\n type: {\n name: \"Number\"\n }\n }\n};\nconst sourceRange1 = {\n parameterPath: [\"options\", \"sourceRange\"],\n mapper: {\n serializedName: \"x-ms-source-range\",\n xmlName: \"x-ms-source-range\",\n type: {\n name: \"String\"\n }\n }\n};\nconst comp23 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"seal\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blobType2 = {\n parameterPath: \"blobType\",\n mapper: {\n defaultValue: \"BlockBlob\",\n isConstant: true,\n serializedName: \"x-ms-blob-type\",\n type: {\n name: \"String\"\n }\n }\n};\nconst copySourceBlobProperties = {\n parameterPath: [\"options\", \"copySourceBlobProperties\"],\n mapper: {\n serializedName: \"x-ms-copy-source-blob-properties\",\n xmlName: \"x-ms-copy-source-blob-properties\",\n type: {\n name: \"Boolean\"\n }\n }\n};\nconst comp24 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"block\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blockId = {\n parameterPath: \"blockId\",\n mapper: {\n serializedName: \"blockid\",\n required: true,\n xmlName: \"blockid\",\n type: {\n name: \"String\"\n }\n }\n};\nconst blocks = {\n parameterPath: \"blocks\",\n mapper: BlockLookupList\n};\nconst comp25 = {\n parameterPath: \"comp\",\n mapper: {\n defaultValue: \"blocklist\",\n isConstant: true,\n serializedName: \"comp\",\n type: {\n name: \"String\"\n }\n }\n};\nconst listType = {\n parameterPath: \"listType\",\n mapper: {\n defaultValue: \"committed\",\n serializedName: \"blocklisttype\",\n required: true,\n xmlName: \"blocklisttype\",\n type: {\n name: \"Enum\",\n allowedValues: [\"committed\", \"uncommitted\", \"all\"]\n }\n }\n};\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n/** Class representing a Service. */\nclass Service {\n /**\n * Initialize a new instance of the class Service class.\n * @param client Reference to the service client\n */\n constructor(client) {\n this.client = client;\n }\n /**\n * Sets properties for a storage account's Blob service endpoint, including properties for Storage\n * Analytics and CORS (Cross-Origin Resource Sharing) rules\n * @param blobServiceProperties The StorageService properties.\n * @param options The options parameters.\n */\n setProperties(blobServiceProperties, options) {\n const operationArguments = {\n blobServiceProperties,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec);\n }\n /**\n * gets the properties of a storage account's Blob service, including properties for Storage Analytics\n * and CORS (Cross-Origin Resource Sharing) rules.\n * @param options The options parameters.\n */\n getProperties(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$2);\n }\n /**\n * Retrieves statistics related to replication for the Blob service. It is only available on the\n * secondary location endpoint when read-access geo-redundant replication is enabled for the storage\n * account.\n * @param options The options parameters.\n */\n getStatistics(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getStatisticsOperationSpec);\n }\n /**\n * The List Containers Segment operation returns a list of the containers under the specified account\n * @param options The options parameters.\n */\n listContainersSegment(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, listContainersSegmentOperationSpec);\n }\n /**\n * Retrieves a user delegation key for the Blob service. This is only a valid operation when using\n * bearer token authentication.\n * @param keyInfo Key information\n * @param options The options parameters.\n */\n getUserDelegationKey(keyInfo, options) {\n const operationArguments = {\n keyInfo,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getUserDelegationKeyOperationSpec);\n }\n /**\n * Returns the sku name and account kind\n * @param options The options parameters.\n */\n getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$2);\n }\n /**\n * The Batch operation allows multiple API calls to be embedded into a single HTTP request.\n * @param contentLength The length of the request.\n * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch\n * boundary. Example header value: multipart/mixed; boundary=batch_\n * @param body Initial data\n * @param options The options parameters.\n */\n submitBatch(contentLength, multipartContentType, body, options) {\n const operationArguments = {\n contentLength,\n multipartContentType,\n body,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec$1);\n }\n /**\n * The Filter Blobs operation enables callers to list blobs across all containers whose tags match a\n * given search expression. Filter blobs searches across all containers within a storage account but\n * can be scoped within the expression to a single container.\n * @param options The options parameters.\n */\n filterBlobs(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec$1);\n }\n}\n// Operation Specifications\nconst xmlSerializer$5 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);\nconst setPropertiesOperationSpec = {\n path: \"/\",\n httpMethod: \"PUT\",\n responses: {\n 202: {\n headersMapper: ServiceSetPropertiesHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ServiceSetPropertiesExceptionHeaders\n }\n },\n requestBody: blobServiceProperties,\n queryParameters: [\n restype,\n comp,\n timeoutInSeconds\n ],\n urlParameters: [url],\n headerParameters: [\n contentType,\n accept,\n version,\n requestId\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"xml\",\n serializer: xmlSerializer$5\n};\nconst getPropertiesOperationSpec$2 = {\n path: \"/\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: BlobServiceProperties,\n headersMapper: ServiceGetPropertiesHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ServiceGetPropertiesExceptionHeaders\n }\n },\n queryParameters: [\n restype,\n comp,\n timeoutInSeconds\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$5\n};\nconst getStatisticsOperationSpec = {\n path: \"/\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: BlobServiceStatistics,\n headersMapper: ServiceGetStatisticsHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ServiceGetStatisticsExceptionHeaders\n }\n },\n queryParameters: [\n restype,\n timeoutInSeconds,\n comp1\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$5\n};\nconst listContainersSegmentOperationSpec = {\n path: \"/\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: ListContainersSegmentResponse,\n headersMapper: ServiceListContainersSegmentHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ServiceListContainersSegmentExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n comp2,\n prefix,\n marker,\n maxPageSize,\n include\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$5\n};\nconst getUserDelegationKeyOperationSpec = {\n path: \"/\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: UserDelegationKey,\n headersMapper: ServiceGetUserDelegationKeyHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ServiceGetUserDelegationKeyExceptionHeaders\n }\n },\n requestBody: keyInfo,\n queryParameters: [\n restype,\n timeoutInSeconds,\n comp3\n ],\n urlParameters: [url],\n headerParameters: [\n contentType,\n accept,\n version,\n requestId\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"xml\",\n serializer: xmlSerializer$5\n};\nconst getAccountInfoOperationSpec$2 = {\n path: \"/\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n headersMapper: ServiceGetAccountInfoHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ServiceGetAccountInfoExceptionHeaders\n }\n },\n queryParameters: [comp, restype1],\n urlParameters: [url],\n headerParameters: [version, accept1],\n isXML: true,\n serializer: xmlSerializer$5\n};\nconst submitBatchOperationSpec$1 = {\n path: \"/\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: ServiceSubmitBatchHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ServiceSubmitBatchExceptionHeaders\n }\n },\n requestBody: body,\n queryParameters: [timeoutInSeconds, comp4],\n urlParameters: [url],\n headerParameters: [\n contentType,\n accept,\n version,\n requestId,\n contentLength,\n multipartContentType\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"xml\",\n serializer: xmlSerializer$5\n};\nconst filterBlobsOperationSpec$1 = {\n path: \"/\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: FilterBlobSegment,\n headersMapper: ServiceFilterBlobsHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ServiceFilterBlobsExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n marker,\n maxPageSize,\n comp5,\n where\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$5\n};\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n/** Class representing a Container. */\nclass Container {\n /**\n * Initialize a new instance of the class Container class.\n * @param client Reference to the service client\n */\n constructor(client) {\n this.client = client;\n }\n /**\n * creates a new container under the specified account. If the container with the same name already\n * exists, the operation fails\n * @param options The options parameters.\n */\n create(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, createOperationSpec$2);\n }\n /**\n * returns all user-defined metadata and system properties for the specified container. The data\n * returned does not include the container's list of blobs\n * @param options The options parameters.\n */\n getProperties(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec$1);\n }\n /**\n * operation marks the specified container for deletion. The container and any blobs contained within\n * it are later deleted during garbage collection\n * @param options The options parameters.\n */\n delete(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, deleteOperationSpec$1);\n }\n /**\n * operation sets one or more user-defined name-value pairs for the specified container.\n * @param options The options parameters.\n */\n setMetadata(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec$1);\n }\n /**\n * gets the permissions for the specified container. The permissions indicate whether container data\n * may be accessed publicly.\n * @param options The options parameters.\n */\n getAccessPolicy(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccessPolicyOperationSpec);\n }\n /**\n * sets the permissions for the specified container. The permissions indicate whether blobs in a\n * container may be accessed publicly.\n * @param options The options parameters.\n */\n setAccessPolicy(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setAccessPolicyOperationSpec);\n }\n /**\n * Restores a previously-deleted container.\n * @param options The options parameters.\n */\n restore(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, restoreOperationSpec);\n }\n /**\n * Renames an existing container.\n * @param sourceContainerName Required. Specifies the name of the container to rename.\n * @param options The options parameters.\n */\n rename(sourceContainerName, options) {\n const operationArguments = {\n sourceContainerName,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, renameOperationSpec);\n }\n /**\n * The Batch operation allows multiple API calls to be embedded into a single HTTP request.\n * @param contentLength The length of the request.\n * @param multipartContentType Required. The value of this header must be multipart/mixed with a batch\n * boundary. Example header value: multipart/mixed; boundary=batch_\n * @param body Initial data\n * @param options The options parameters.\n */\n submitBatch(contentLength, multipartContentType, body, options) {\n const operationArguments = {\n contentLength,\n multipartContentType,\n body,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, submitBatchOperationSpec);\n }\n /**\n * The Filter Blobs operation enables callers to list blobs in a container whose tags match a given\n * search expression. Filter blobs searches within the given container.\n * @param options The options parameters.\n */\n filterBlobs(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, filterBlobsOperationSpec);\n }\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param options The options parameters.\n */\n acquireLease(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec$1);\n }\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param leaseId Specifies the current lease ID on the resource.\n * @param options The options parameters.\n */\n releaseLease(leaseId, options) {\n const operationArguments = {\n leaseId,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec$1);\n }\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param leaseId Specifies the current lease ID on the resource.\n * @param options The options parameters.\n */\n renewLease(leaseId, options) {\n const operationArguments = {\n leaseId,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec$1);\n }\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param options The options parameters.\n */\n breakLease(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec$1);\n }\n /**\n * [Update] establishes and manages a lock on a container for delete operations. The lock duration can\n * be 15 to 60 seconds, or can be infinite\n * @param leaseId Specifies the current lease ID on the resource.\n * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400\n * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor\n * (String) for a list of valid GUID string formats.\n * @param options The options parameters.\n */\n changeLease(leaseId, proposedLeaseId, options) {\n const operationArguments = {\n leaseId,\n proposedLeaseId,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec$1);\n }\n /**\n * [Update] The List Blobs operation returns a list of the blobs under the specified container\n * @param options The options parameters.\n */\n listBlobFlatSegment(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, listBlobFlatSegmentOperationSpec);\n }\n /**\n * [Update] The List Blobs operation returns a list of the blobs under the specified container\n * @param delimiter When the request includes this parameter, the operation returns a BlobPrefix\n * element in the response body that acts as a placeholder for all blobs whose names begin with the\n * same substring up to the appearance of the delimiter character. The delimiter may be a single\n * character or a string.\n * @param options The options parameters.\n */\n listBlobHierarchySegment(delimiter, options) {\n const operationArguments = {\n delimiter,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, listBlobHierarchySegmentOperationSpec);\n }\n /**\n * Returns the sku name and account kind\n * @param options The options parameters.\n */\n getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec$1);\n }\n}\n// Operation Specifications\nconst xmlSerializer$4 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);\nconst createOperationSpec$2 = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: ContainerCreateHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerCreateExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, restype2],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n metadata,\n access,\n defaultEncryptionScope,\n preventEncryptionScopeOverride\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst getPropertiesOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n headersMapper: ContainerGetPropertiesHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerGetPropertiesExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, restype2],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst deleteOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"DELETE\",\n responses: {\n 202: {\n headersMapper: ContainerDeleteHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerDeleteExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, restype2],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst setMetadataOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: ContainerSetMetadataHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerSetMetadataExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp6\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n metadata,\n leaseId,\n ifModifiedSince\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst getAccessPolicyOperationSpec = {\n path: \"/{containerName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: {\n name: \"Sequence\",\n element: {\n type: { name: \"Composite\", className: \"SignedIdentifier\" }\n }\n },\n serializedName: \"SignedIdentifiers\",\n xmlName: \"SignedIdentifiers\",\n xmlIsWrapped: true,\n xmlElementName: \"SignedIdentifier\"\n },\n headersMapper: ContainerGetAccessPolicyHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerGetAccessPolicyExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp7\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst setAccessPolicyOperationSpec = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: ContainerSetAccessPolicyHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerSetAccessPolicyExceptionHeaders\n }\n },\n requestBody: containerAcl,\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp7\n ],\n urlParameters: [url],\n headerParameters: [\n contentType,\n accept,\n version,\n requestId,\n access,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"xml\",\n serializer: xmlSerializer$4\n};\nconst restoreOperationSpec = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: ContainerRestoreHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerRestoreExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp8\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n deletedContainerName,\n deletedContainerVersion\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst renameOperationSpec = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: ContainerRenameHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerRenameExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp9\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n sourceContainerName,\n sourceLeaseId\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst submitBatchOperationSpec = {\n path: \"/{containerName}\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: ContainerSubmitBatchHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerSubmitBatchExceptionHeaders\n }\n },\n requestBody: body,\n queryParameters: [\n timeoutInSeconds,\n comp4,\n restype2\n ],\n urlParameters: [url],\n headerParameters: [\n contentType,\n accept,\n version,\n requestId,\n contentLength,\n multipartContentType\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"xml\",\n serializer: xmlSerializer$4\n};\nconst filterBlobsOperationSpec = {\n path: \"/{containerName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: FilterBlobSegment,\n headersMapper: ContainerFilterBlobsHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerFilterBlobsExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n marker,\n maxPageSize,\n comp5,\n where,\n restype2\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst acquireLeaseOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: ContainerAcquireLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerAcquireLeaseExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp10\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n action,\n duration,\n proposedLeaseId\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst releaseLeaseOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: ContainerReleaseLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerReleaseLeaseExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp10\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n action1,\n leaseId1\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst renewLeaseOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: ContainerRenewLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerRenewLeaseExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp10\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n leaseId1,\n action2\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst breakLeaseOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 202: {\n headersMapper: ContainerBreakLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerBreakLeaseExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp10\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n action3,\n breakPeriod\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst changeLeaseOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: ContainerChangeLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerChangeLeaseExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n restype2,\n comp10\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n leaseId1,\n action4,\n proposedLeaseId1\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst listBlobFlatSegmentOperationSpec = {\n path: \"/{containerName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: ListBlobsFlatSegmentResponse,\n headersMapper: ContainerListBlobFlatSegmentHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerListBlobFlatSegmentExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n comp2,\n prefix,\n marker,\n maxPageSize,\n restype2,\n include1\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst listBlobHierarchySegmentOperationSpec = {\n path: \"/{containerName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: ListBlobsHierarchySegmentResponse,\n headersMapper: ContainerListBlobHierarchySegmentHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerListBlobHierarchySegmentExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n comp2,\n prefix,\n marker,\n maxPageSize,\n restype2,\n include1,\n delimiter\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$4\n};\nconst getAccountInfoOperationSpec$1 = {\n path: \"/{containerName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n headersMapper: ContainerGetAccountInfoHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: ContainerGetAccountInfoExceptionHeaders\n }\n },\n queryParameters: [comp, restype1],\n urlParameters: [url],\n headerParameters: [version, accept1],\n isXML: true,\n serializer: xmlSerializer$4\n};\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n/** Class representing a Blob. */\nclass Blob$1 {\n /**\n * Initialize a new instance of the class Blob class.\n * @param client Reference to the service client\n */\n constructor(client) {\n this.client = client;\n }\n /**\n * The Download operation reads or downloads a blob from the system, including its metadata and\n * properties. You can also call Download to read a snapshot.\n * @param options The options parameters.\n */\n download(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, downloadOperationSpec);\n }\n /**\n * The Get Properties operation returns all user-defined metadata, standard HTTP properties, and system\n * properties for the blob. It does not return the content of the blob.\n * @param options The options parameters.\n */\n getProperties(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getPropertiesOperationSpec);\n }\n /**\n * If the storage account's soft delete feature is disabled then, when a blob is deleted, it is\n * permanently removed from the storage account. If the storage account's soft delete feature is\n * enabled, then, when a blob is deleted, it is marked for deletion and becomes inaccessible\n * immediately. However, the blob service retains the blob or snapshot for the number of days specified\n * by the DeleteRetentionPolicy section of [Storage service properties]\n * (Set-Blob-Service-Properties.md). After the specified number of days has passed, the blob's data is\n * permanently removed from the storage account. Note that you continue to be charged for the\n * soft-deleted blob's storage until it is permanently removed. Use the List Blobs API and specify the\n * \"include=deleted\" query parameter to discover which blobs and snapshots have been soft deleted. You\n * can then use the Undelete Blob API to restore a soft-deleted blob. All other operations on a\n * soft-deleted blob or snapshot causes the service to return an HTTP status code of 404\n * (ResourceNotFound).\n * @param options The options parameters.\n */\n delete(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, deleteOperationSpec);\n }\n /**\n * Undelete a blob that was previously soft deleted\n * @param options The options parameters.\n */\n undelete(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, undeleteOperationSpec);\n }\n /**\n * Sets the time a blob will expire and be deleted.\n * @param expiryOptions Required. Indicates mode of the expiry time\n * @param options The options parameters.\n */\n setExpiry(expiryOptions, options) {\n const operationArguments = {\n expiryOptions,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setExpiryOperationSpec);\n }\n /**\n * The Set HTTP Headers operation sets system properties on the blob\n * @param options The options parameters.\n */\n setHttpHeaders(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setHttpHeadersOperationSpec);\n }\n /**\n * The Set Immutability Policy operation sets the immutability policy on the blob\n * @param options The options parameters.\n */\n setImmutabilityPolicy(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setImmutabilityPolicyOperationSpec);\n }\n /**\n * The Delete Immutability Policy operation deletes the immutability policy on the blob\n * @param options The options parameters.\n */\n deleteImmutabilityPolicy(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, deleteImmutabilityPolicyOperationSpec);\n }\n /**\n * The Set Legal Hold operation sets a legal hold on the blob.\n * @param legalHold Specified if a legal hold should be set on the blob.\n * @param options The options parameters.\n */\n setLegalHold(legalHold, options) {\n const operationArguments = {\n legalHold,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setLegalHoldOperationSpec);\n }\n /**\n * The Set Blob Metadata operation sets user-defined metadata for the specified blob as one or more\n * name-value pairs\n * @param options The options parameters.\n */\n setMetadata(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setMetadataOperationSpec);\n }\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param options The options parameters.\n */\n acquireLease(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, acquireLeaseOperationSpec);\n }\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param leaseId Specifies the current lease ID on the resource.\n * @param options The options parameters.\n */\n releaseLease(leaseId, options) {\n const operationArguments = {\n leaseId,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, releaseLeaseOperationSpec);\n }\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param leaseId Specifies the current lease ID on the resource.\n * @param options The options parameters.\n */\n renewLease(leaseId, options) {\n const operationArguments = {\n leaseId,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, renewLeaseOperationSpec);\n }\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param leaseId Specifies the current lease ID on the resource.\n * @param proposedLeaseId Proposed lease ID, in a GUID string format. The Blob service returns 400\n * (Invalid request) if the proposed lease ID is not in the correct format. See Guid Constructor\n * (String) for a list of valid GUID string formats.\n * @param options The options parameters.\n */\n changeLease(leaseId, proposedLeaseId, options) {\n const operationArguments = {\n leaseId,\n proposedLeaseId,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, changeLeaseOperationSpec);\n }\n /**\n * [Update] The Lease Blob operation establishes and manages a lock on a blob for write and delete\n * operations\n * @param options The options parameters.\n */\n breakLease(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, breakLeaseOperationSpec);\n }\n /**\n * The Create Snapshot operation creates a read-only snapshot of a blob\n * @param options The options parameters.\n */\n createSnapshot(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, createSnapshotOperationSpec);\n }\n /**\n * The Start Copy From URL operation copies a blob or an internet resource to a new blob.\n * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to\n * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would\n * appear in a request URI. The source blob must either be public or must be authenticated via a shared\n * access signature.\n * @param options The options parameters.\n */\n startCopyFromURL(copySource, options) {\n const operationArguments = {\n copySource,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, startCopyFromURLOperationSpec);\n }\n /**\n * The Copy From URL operation copies a blob or an internet resource to a new blob. It will not return\n * a response until the copy is complete.\n * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to\n * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would\n * appear in a request URI. The source blob must either be public or must be authenticated via a shared\n * access signature.\n * @param options The options parameters.\n */\n copyFromURL(copySource, options) {\n const operationArguments = {\n copySource,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, copyFromURLOperationSpec);\n }\n /**\n * The Abort Copy From URL operation aborts a pending Copy From URL operation, and leaves a destination\n * blob with zero length and full metadata.\n * @param copyId The copy identifier provided in the x-ms-copy-id header of the original Copy Blob\n * operation.\n * @param options The options parameters.\n */\n abortCopyFromURL(copyId, options) {\n const operationArguments = {\n copyId,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, abortCopyFromURLOperationSpec);\n }\n /**\n * The Set Tier operation sets the tier on a blob. The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant storage only). A\n * premium page blob's tier determines the allowed size, IOPS, and bandwidth of the blob. A block\n * blob's tier determines Hot/Cool/Archive storage type. This operation does not update the blob's\n * ETag.\n * @param tier Indicates the tier to be set on the blob.\n * @param options The options parameters.\n */\n setTier(tier, options) {\n const operationArguments = {\n tier,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setTierOperationSpec);\n }\n /**\n * Returns the sku name and account kind\n * @param options The options parameters.\n */\n getAccountInfo(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getAccountInfoOperationSpec);\n }\n /**\n * The Query operation enables users to select/project on blob data by providing simple query\n * expressions.\n * @param options The options parameters.\n */\n query(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, queryOperationSpec);\n }\n /**\n * The Get Tags operation enables users to get the tags associated with a blob.\n * @param options The options parameters.\n */\n getTags(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getTagsOperationSpec);\n }\n /**\n * The Set Tags operation enables users to set tags on a blob.\n * @param options The options parameters.\n */\n setTags(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setTagsOperationSpec);\n }\n}\n// Operation Specifications\nconst xmlSerializer$3 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);\nconst downloadOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: BlobDownloadHeaders\n },\n 206: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: BlobDownloadHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobDownloadExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n snapshot,\n versionId\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n range,\n rangeGetContentMD5,\n rangeGetContentCRC64,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst getPropertiesOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {\n headersMapper: BlobGetPropertiesHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobGetPropertiesExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n snapshot,\n versionId\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst deleteOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"DELETE\",\n responses: {\n 202: {\n headersMapper: BlobDeleteHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobDeleteExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n snapshot,\n versionId,\n blobDeleteType\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n ifMatch,\n ifNoneMatch,\n ifTags,\n deleteSnapshots\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst undeleteOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobUndeleteHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobUndeleteExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp8],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst setExpiryOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobSetExpiryHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobSetExpiryExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp11],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n expiryOptions,\n expiresOn\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst setHttpHeadersOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobSetHttpHeadersHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobSetHttpHeadersExceptionHeaders\n }\n },\n queryParameters: [comp, timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n ifMatch,\n ifNoneMatch,\n ifTags,\n blobCacheControl,\n blobContentType,\n blobContentMD5,\n blobContentEncoding,\n blobContentLanguage,\n blobContentDisposition\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst setImmutabilityPolicyOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobSetImmutabilityPolicyHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobSetImmutabilityPolicyExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp12],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifUnmodifiedSince,\n immutabilityPolicyExpiry,\n immutabilityPolicyMode\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst deleteImmutabilityPolicyOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"DELETE\",\n responses: {\n 200: {\n headersMapper: BlobDeleteImmutabilityPolicyHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobDeleteImmutabilityPolicyExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp12],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst setLegalHoldOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobSetLegalHoldHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobSetLegalHoldExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp13],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n legalHold\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst setMetadataOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobSetMetadataHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobSetMetadataExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp6],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n encryptionScope\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst acquireLeaseOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: BlobAcquireLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobAcquireLeaseExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp10],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n action,\n duration,\n proposedLeaseId,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst releaseLeaseOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobReleaseLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobReleaseLeaseExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp10],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n action1,\n leaseId1,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst renewLeaseOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobRenewLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobRenewLeaseExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp10],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n leaseId1,\n action2,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst changeLeaseOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobChangeLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobChangeLeaseExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp10],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n leaseId1,\n action4,\n proposedLeaseId1,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst breakLeaseOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 202: {\n headersMapper: BlobBreakLeaseHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobBreakLeaseExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp10],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n action3,\n breakPeriod,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst createSnapshotOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: BlobCreateSnapshotHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobCreateSnapshotExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp14],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n encryptionScope\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst startCopyFromURLOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 202: {\n headersMapper: BlobStartCopyFromURLHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobStartCopyFromURLExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n ifMatch,\n ifNoneMatch,\n ifTags,\n immutabilityPolicyExpiry,\n immutabilityPolicyMode,\n tier,\n rehydratePriority,\n sourceIfModifiedSince,\n sourceIfUnmodifiedSince,\n sourceIfMatch,\n sourceIfNoneMatch,\n sourceIfTags,\n copySource,\n blobTagsString,\n sealBlob,\n legalHold1\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst copyFromURLOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 202: {\n headersMapper: BlobCopyFromURLHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobCopyFromURLExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n ifMatch,\n ifNoneMatch,\n ifTags,\n immutabilityPolicyExpiry,\n immutabilityPolicyMode,\n encryptionScope,\n tier,\n sourceIfModifiedSince,\n sourceIfUnmodifiedSince,\n sourceIfMatch,\n sourceIfNoneMatch,\n copySource,\n blobTagsString,\n legalHold1,\n xMsRequiresSync,\n sourceContentMD5,\n copySourceAuthorization,\n copySourceTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst abortCopyFromURLOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 204: {\n headersMapper: BlobAbortCopyFromURLHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobAbortCopyFromURLExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n comp15,\n copyId\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n copyActionAbortConstant\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst setTierOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: BlobSetTierHeaders\n },\n 202: {\n headersMapper: BlobSetTierHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobSetTierExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n snapshot,\n versionId,\n comp16\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifTags,\n rehydratePriority,\n tier1\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst getAccountInfoOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n headersMapper: BlobGetAccountInfoHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobGetAccountInfoExceptionHeaders\n }\n },\n queryParameters: [comp, restype1],\n urlParameters: [url],\n headerParameters: [version, accept1],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst queryOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: BlobQueryHeaders\n },\n 206: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: BlobQueryHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobQueryExceptionHeaders\n }\n },\n requestBody: queryRequest,\n queryParameters: [\n timeoutInSeconds,\n snapshot,\n comp17\n ],\n urlParameters: [url],\n headerParameters: [\n contentType,\n accept,\n version,\n requestId,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"xml\",\n serializer: xmlSerializer$3\n};\nconst getTagsOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: BlobTags,\n headersMapper: BlobGetTagsHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobGetTagsExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n snapshot,\n versionId,\n comp18\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$3\n};\nconst setTagsOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 204: {\n headersMapper: BlobSetTagsHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlobSetTagsExceptionHeaders\n }\n },\n requestBody: tags,\n queryParameters: [\n timeoutInSeconds,\n versionId,\n comp18\n ],\n urlParameters: [url],\n headerParameters: [\n contentType,\n accept,\n version,\n requestId,\n leaseId,\n ifTags,\n transactionalContentMD5,\n transactionalContentCrc64\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"xml\",\n serializer: xmlSerializer$3\n};\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n/** Class representing a PageBlob. */\nclass PageBlob {\n /**\n * Initialize a new instance of the class PageBlob class.\n * @param client Reference to the service client\n */\n constructor(client) {\n this.client = client;\n }\n /**\n * The Create operation creates a new page blob.\n * @param contentLength The length of the request.\n * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The\n * page blob size must be aligned to a 512-byte boundary.\n * @param options The options parameters.\n */\n create(contentLength, blobContentLength, options) {\n const operationArguments = {\n contentLength,\n blobContentLength,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, createOperationSpec$1);\n }\n /**\n * The Upload Pages operation writes a range of pages to a page blob\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n uploadPages(contentLength, body, options) {\n const operationArguments = {\n contentLength,\n body,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, uploadPagesOperationSpec);\n }\n /**\n * The Clear Pages operation clears a set of pages from a page blob\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n clearPages(contentLength, options) {\n const operationArguments = {\n contentLength,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, clearPagesOperationSpec);\n }\n /**\n * The Upload Pages operation writes a range of pages to a page blob where the contents are read from a\n * URL\n * @param sourceUrl Specify a URL to the copy source.\n * @param sourceRange Bytes of source data in the specified range. The length of this range should\n * match the ContentLength header and x-ms-range/Range destination range header.\n * @param contentLength The length of the request.\n * @param range The range of bytes to which the source range would be written. The range should be 512\n * aligned and range-end is required.\n * @param options The options parameters.\n */\n uploadPagesFromURL(sourceUrl, sourceRange, contentLength, range, options) {\n const operationArguments = {\n sourceUrl,\n sourceRange,\n contentLength,\n range,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, uploadPagesFromURLOperationSpec);\n }\n /**\n * The Get Page Ranges operation returns the list of valid page ranges for a page blob or snapshot of a\n * page blob\n * @param options The options parameters.\n */\n getPageRanges(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getPageRangesOperationSpec);\n }\n /**\n * The Get Page Ranges Diff operation returns the list of valid page ranges for a page blob that were\n * changed between target blob and previous snapshot.\n * @param options The options parameters.\n */\n getPageRangesDiff(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getPageRangesDiffOperationSpec);\n }\n /**\n * Resize the Blob\n * @param blobContentLength This header specifies the maximum size for the page blob, up to 1 TB. The\n * page blob size must be aligned to a 512-byte boundary.\n * @param options The options parameters.\n */\n resize(blobContentLength, options) {\n const operationArguments = {\n blobContentLength,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, resizeOperationSpec);\n }\n /**\n * Update the sequence number of the blob\n * @param sequenceNumberAction Required if the x-ms-blob-sequence-number header is set for the request.\n * This property applies to page blobs only. This property indicates how the service should modify the\n * blob's sequence number\n * @param options The options parameters.\n */\n updateSequenceNumber(sequenceNumberAction, options) {\n const operationArguments = {\n sequenceNumberAction,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, updateSequenceNumberOperationSpec);\n }\n /**\n * The Copy Incremental operation copies a snapshot of the source page blob to a destination page blob.\n * The snapshot is copied such that only the differential changes between the previously copied\n * snapshot are transferred to the destination. The copied snapshots are complete copies of the\n * original snapshot and can be read or copied from as usual. This API is supported since REST version\n * 2016-05-31.\n * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to\n * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would\n * appear in a request URI. The source blob must either be public or must be authenticated via a shared\n * access signature.\n * @param options The options parameters.\n */\n copyIncremental(copySource, options) {\n const operationArguments = {\n copySource,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, copyIncrementalOperationSpec);\n }\n}\n// Operation Specifications\nconst xmlSerializer$2 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);\nconst serializer$2 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);\nconst createOperationSpec$1 = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: PageBlobCreateHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobCreateExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n contentLength,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n blobCacheControl,\n blobContentType,\n blobContentMD5,\n blobContentEncoding,\n blobContentLanguage,\n blobContentDisposition,\n immutabilityPolicyExpiry,\n immutabilityPolicyMode,\n encryptionScope,\n tier,\n blobTagsString,\n legalHold1,\n blobType,\n blobContentLength,\n blobSequenceNumber\n ],\n isXML: true,\n serializer: xmlSerializer$2\n};\nconst uploadPagesOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: PageBlobUploadPagesHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobUploadPagesExceptionHeaders\n }\n },\n requestBody: body1,\n queryParameters: [timeoutInSeconds, comp19],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n contentLength,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n range,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n encryptionScope,\n transactionalContentMD5,\n transactionalContentCrc64,\n contentType1,\n accept2,\n pageWrite,\n ifSequenceNumberLessThanOrEqualTo,\n ifSequenceNumberLessThan,\n ifSequenceNumberEqualTo\n ],\n mediaType: \"binary\",\n serializer: serializer$2\n};\nconst clearPagesOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: PageBlobClearPagesHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobClearPagesExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp19],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n contentLength,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n range,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n encryptionScope,\n ifSequenceNumberLessThanOrEqualTo,\n ifSequenceNumberLessThan,\n ifSequenceNumberEqualTo,\n pageWrite1\n ],\n isXML: true,\n serializer: xmlSerializer$2\n};\nconst uploadPagesFromURLOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: PageBlobUploadPagesFromURLHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobUploadPagesFromURLExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp19],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n contentLength,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n encryptionScope,\n sourceIfModifiedSince,\n sourceIfUnmodifiedSince,\n sourceIfMatch,\n sourceIfNoneMatch,\n sourceContentMD5,\n copySourceAuthorization,\n pageWrite,\n ifSequenceNumberLessThanOrEqualTo,\n ifSequenceNumberLessThan,\n ifSequenceNumberEqualTo,\n sourceUrl,\n sourceRange,\n sourceContentCrc64,\n range1\n ],\n isXML: true,\n serializer: xmlSerializer$2\n};\nconst getPageRangesOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: PageList,\n headersMapper: PageBlobGetPageRangesHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobGetPageRangesExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n marker,\n maxPageSize,\n snapshot,\n comp20\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n range,\n ifMatch,\n ifNoneMatch,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer$2\n};\nconst getPageRangesDiffOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: PageList,\n headersMapper: PageBlobGetPageRangesDiffHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobGetPageRangesDiffExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n marker,\n maxPageSize,\n snapshot,\n comp20,\n prevsnapshot\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n range,\n ifMatch,\n ifNoneMatch,\n ifTags,\n prevSnapshotUrl\n ],\n isXML: true,\n serializer: xmlSerializer$2\n};\nconst resizeOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: PageBlobResizeHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobResizeExceptionHeaders\n }\n },\n queryParameters: [comp, timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n encryptionScope,\n blobContentLength\n ],\n isXML: true,\n serializer: xmlSerializer$2\n};\nconst updateSequenceNumberOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: PageBlobUpdateSequenceNumberHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobUpdateSequenceNumberExceptionHeaders\n }\n },\n queryParameters: [comp, timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n ifMatch,\n ifNoneMatch,\n ifTags,\n blobSequenceNumber,\n sequenceNumberAction\n ],\n isXML: true,\n serializer: xmlSerializer$2\n};\nconst copyIncrementalOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 202: {\n headersMapper: PageBlobCopyIncrementalHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: PageBlobCopyIncrementalExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp21],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n ifModifiedSince,\n ifUnmodifiedSince,\n ifMatch,\n ifNoneMatch,\n ifTags,\n copySource\n ],\n isXML: true,\n serializer: xmlSerializer$2\n};\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n/** Class representing a AppendBlob. */\nclass AppendBlob {\n /**\n * Initialize a new instance of the class AppendBlob class.\n * @param client Reference to the service client\n */\n constructor(client) {\n this.client = client;\n }\n /**\n * The Create Append Blob operation creates a new append blob.\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n create(contentLength, options) {\n const operationArguments = {\n contentLength,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, createOperationSpec);\n }\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob. The\n * Append Block operation is permitted only if the blob was created with x-ms-blob-type set to\n * AppendBlob. Append Block is supported only on version 2015-02-21 version or later.\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n appendBlock(contentLength, body, options) {\n const operationArguments = {\n contentLength,\n body,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, appendBlockOperationSpec);\n }\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob where\n * the contents are read from a source url. The Append Block operation is permitted only if the blob\n * was created with x-ms-blob-type set to AppendBlob. Append Block is supported only on version\n * 2015-02-21 version or later.\n * @param sourceUrl Specify a URL to the copy source.\n * @param contentLength The length of the request.\n * @param options The options parameters.\n */\n appendBlockFromUrl(sourceUrl, contentLength, options) {\n const operationArguments = {\n sourceUrl,\n contentLength,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, appendBlockFromUrlOperationSpec);\n }\n /**\n * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version\n * 2019-12-12 version or later.\n * @param options The options parameters.\n */\n seal(options) {\n const operationArguments = {\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, sealOperationSpec);\n }\n}\n// Operation Specifications\nconst xmlSerializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);\nconst serializer$1 = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);\nconst createOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: AppendBlobCreateHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: AppendBlobCreateExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n contentLength,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n blobCacheControl,\n blobContentType,\n blobContentMD5,\n blobContentEncoding,\n blobContentLanguage,\n blobContentDisposition,\n immutabilityPolicyExpiry,\n immutabilityPolicyMode,\n encryptionScope,\n blobTagsString,\n legalHold1,\n blobType1\n ],\n isXML: true,\n serializer: xmlSerializer$1\n};\nconst appendBlockOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: AppendBlobAppendBlockHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: AppendBlobAppendBlockExceptionHeaders\n }\n },\n requestBody: body1,\n queryParameters: [timeoutInSeconds, comp22],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n contentLength,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n encryptionScope,\n transactionalContentMD5,\n transactionalContentCrc64,\n contentType1,\n accept2,\n maxSize,\n appendPosition\n ],\n mediaType: \"binary\",\n serializer: serializer$1\n};\nconst appendBlockFromUrlOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: AppendBlobAppendBlockFromUrlHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: AppendBlobAppendBlockFromUrlExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp22],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n contentLength,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n encryptionScope,\n sourceIfModifiedSince,\n sourceIfUnmodifiedSince,\n sourceIfMatch,\n sourceIfNoneMatch,\n sourceContentMD5,\n copySourceAuthorization,\n transactionalContentMD5,\n sourceUrl,\n sourceContentCrc64,\n maxSize,\n appendPosition,\n sourceRange1\n ],\n isXML: true,\n serializer: xmlSerializer$1\n};\nconst sealOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n headersMapper: AppendBlobSealHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: AppendBlobSealExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds, comp23],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n ifMatch,\n ifNoneMatch,\n appendPosition\n ],\n isXML: true,\n serializer: xmlSerializer$1\n};\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n/** Class representing a BlockBlob. */\nclass BlockBlob {\n /**\n * Initialize a new instance of the class BlockBlob class.\n * @param client Reference to the service client\n */\n constructor(client) {\n this.client = client;\n }\n /**\n * The Upload Block Blob operation updates the content of an existing block blob. Updating an existing\n * block blob overwrites any existing metadata on the blob. Partial updates are not supported with Put\n * Blob; the content of the existing blob is overwritten with the content of the new blob. To perform a\n * partial update of the content of a block blob, use the Put Block List operation.\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n upload(contentLength, body, options) {\n const operationArguments = {\n contentLength,\n body,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, uploadOperationSpec);\n }\n /**\n * The Put Blob from URL operation creates a new Block Blob where the contents of the blob are read\n * from a given URL. This API is supported beginning with the 2020-04-08 version. Partial updates are\n * not supported with Put Blob from URL; the content of an existing blob is overwritten with the\n * content of the new blob. To perform partial updates to a block blob’s contents using a source URL,\n * use the Put Block from URL API in conjunction with Put Block List.\n * @param contentLength The length of the request.\n * @param copySource Specifies the name of the source page blob snapshot. This value is a URL of up to\n * 2 KB in length that specifies a page blob snapshot. The value should be URL-encoded as it would\n * appear in a request URI. The source blob must either be public or must be authenticated via a shared\n * access signature.\n * @param options The options parameters.\n */\n putBlobFromUrl(contentLength, copySource, options) {\n const operationArguments = {\n contentLength,\n copySource,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, putBlobFromUrlOperationSpec);\n }\n /**\n * The Stage Block operation creates a new block to be committed as part of a blob\n * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string\n * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified\n * for the blockid parameter must be the same size for each block.\n * @param contentLength The length of the request.\n * @param body Initial data\n * @param options The options parameters.\n */\n stageBlock(blockId, contentLength, body, options) {\n const operationArguments = {\n blockId,\n contentLength,\n body,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, stageBlockOperationSpec);\n }\n /**\n * The Stage Block operation creates a new block to be committed as part of a blob where the contents\n * are read from a URL.\n * @param blockId A valid Base64 string value that identifies the block. Prior to encoding, the string\n * must be less than or equal to 64 bytes in size. For a given blob, the length of the value specified\n * for the blockid parameter must be the same size for each block.\n * @param contentLength The length of the request.\n * @param sourceUrl Specify a URL to the copy source.\n * @param options The options parameters.\n */\n stageBlockFromURL(blockId, contentLength, sourceUrl, options) {\n const operationArguments = {\n blockId,\n contentLength,\n sourceUrl,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, stageBlockFromURLOperationSpec);\n }\n /**\n * The Commit Block List operation writes a blob by specifying the list of block IDs that make up the\n * blob. In order to be written as part of a blob, a block must have been successfully written to the\n * server in a prior Put Block operation. You can call Put Block List to update a blob by uploading\n * only those blocks that have changed, then committing the new and existing blocks together. You can\n * do this by specifying whether to commit a block from the committed block list or from the\n * uncommitted block list, or to commit the most recently uploaded version of the block, whichever list\n * it may belong to.\n * @param blocks Blob Blocks.\n * @param options The options parameters.\n */\n commitBlockList(blocks, options) {\n const operationArguments = {\n blocks,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, commitBlockListOperationSpec);\n }\n /**\n * The Get Block List operation retrieves the list of blocks that have been uploaded as part of a block\n * blob\n * @param listType Specifies whether to return the list of committed blocks, the list of uncommitted\n * blocks, or both lists together.\n * @param options The options parameters.\n */\n getBlockList(listType, options) {\n const operationArguments = {\n listType,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, getBlockListOperationSpec);\n }\n}\n// Operation Specifications\nconst xmlSerializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ true);\nconst serializer = new coreHttp__namespace.Serializer(Mappers, /* isXml */ false);\nconst uploadOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: BlockBlobUploadHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlockBlobUploadExceptionHeaders\n }\n },\n requestBody: body1,\n queryParameters: [timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n contentLength,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n blobCacheControl,\n blobContentType,\n blobContentMD5,\n blobContentEncoding,\n blobContentLanguage,\n blobContentDisposition,\n immutabilityPolicyExpiry,\n immutabilityPolicyMode,\n encryptionScope,\n tier,\n blobTagsString,\n legalHold1,\n transactionalContentMD5,\n transactionalContentCrc64,\n contentType1,\n accept2,\n blobType2\n ],\n mediaType: \"binary\",\n serializer\n};\nconst putBlobFromUrlOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: BlockBlobPutBlobFromUrlHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlockBlobPutBlobFromUrlExceptionHeaders\n }\n },\n queryParameters: [timeoutInSeconds],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n contentLength,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n blobCacheControl,\n blobContentType,\n blobContentMD5,\n blobContentEncoding,\n blobContentLanguage,\n blobContentDisposition,\n encryptionScope,\n tier,\n sourceIfModifiedSince,\n sourceIfUnmodifiedSince,\n sourceIfMatch,\n sourceIfNoneMatch,\n sourceIfTags,\n copySource,\n blobTagsString,\n sourceContentMD5,\n copySourceAuthorization,\n copySourceTags,\n transactionalContentMD5,\n blobType2,\n copySourceBlobProperties\n ],\n isXML: true,\n serializer: xmlSerializer\n};\nconst stageBlockOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: BlockBlobStageBlockHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlockBlobStageBlockExceptionHeaders\n }\n },\n requestBody: body1,\n queryParameters: [\n timeoutInSeconds,\n comp24,\n blockId\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n contentLength,\n leaseId,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n encryptionScope,\n transactionalContentMD5,\n transactionalContentCrc64,\n contentType1,\n accept2\n ],\n mediaType: \"binary\",\n serializer\n};\nconst stageBlockFromURLOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: BlockBlobStageBlockFromURLHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlockBlobStageBlockFromURLExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n comp24,\n blockId\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n contentLength,\n leaseId,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n encryptionScope,\n sourceIfModifiedSince,\n sourceIfUnmodifiedSince,\n sourceIfMatch,\n sourceIfNoneMatch,\n sourceContentMD5,\n copySourceAuthorization,\n sourceUrl,\n sourceContentCrc64,\n sourceRange1\n ],\n isXML: true,\n serializer: xmlSerializer\n};\nconst commitBlockListOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: BlockBlobCommitBlockListHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlockBlobCommitBlockListExceptionHeaders\n }\n },\n requestBody: blocks,\n queryParameters: [timeoutInSeconds, comp25],\n urlParameters: [url],\n headerParameters: [\n contentType,\n accept,\n version,\n requestId,\n metadata,\n leaseId,\n ifModifiedSince,\n ifUnmodifiedSince,\n encryptionKey,\n encryptionKeySha256,\n encryptionAlgorithm,\n ifMatch,\n ifNoneMatch,\n ifTags,\n blobCacheControl,\n blobContentType,\n blobContentMD5,\n blobContentEncoding,\n blobContentLanguage,\n blobContentDisposition,\n immutabilityPolicyExpiry,\n immutabilityPolicyMode,\n encryptionScope,\n tier,\n blobTagsString,\n legalHold1,\n transactionalContentMD5,\n transactionalContentCrc64\n ],\n isXML: true,\n contentType: \"application/xml; charset=utf-8\",\n mediaType: \"xml\",\n serializer: xmlSerializer\n};\nconst getBlockListOperationSpec = {\n path: \"/{containerName}/{blob}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: BlockList,\n headersMapper: BlockBlobGetBlockListHeaders\n },\n default: {\n bodyMapper: StorageError,\n headersMapper: BlockBlobGetBlockListExceptionHeaders\n }\n },\n queryParameters: [\n timeoutInSeconds,\n snapshot,\n comp25,\n listType\n ],\n urlParameters: [url],\n headerParameters: [\n version,\n requestId,\n accept1,\n leaseId,\n ifTags\n ],\n isXML: true,\n serializer: xmlSerializer\n};\n\n// Copyright (c) Microsoft Corporation.\n/**\n * The `@azure/logger` configuration for this package.\n */\nconst logger = logger$1.createClientLogger(\"storage-blob\");\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nconst SDK_VERSION = \"12.15.0\";\nconst SERVICE_VERSION = \"2023-01-03\";\nconst BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES = 256 * 1024 * 1024; // 256MB\nconst BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES = 4000 * 1024 * 1024; // 4000MB\nconst BLOCK_BLOB_MAX_BLOCKS = 50000;\nconst DEFAULT_BLOCK_BUFFER_SIZE_BYTES = 8 * 1024 * 1024; // 8MB\nconst DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES = 4 * 1024 * 1024; // 4MB\nconst DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS = 5;\nconst REQUEST_TIMEOUT = 100 * 1000; // In ms\n/**\n * The OAuth scope to use with Azure Storage.\n */\nconst StorageOAuthScopes = \"https://storage.azure.com/.default\";\nconst URLConstants = {\n Parameters: {\n FORCE_BROWSER_NO_CACHE: \"_\",\n SIGNATURE: \"sig\",\n SNAPSHOT: \"snapshot\",\n VERSIONID: \"versionid\",\n TIMEOUT: \"timeout\",\n },\n};\nconst HTTPURLConnection = {\n HTTP_ACCEPTED: 202,\n HTTP_CONFLICT: 409,\n HTTP_NOT_FOUND: 404,\n HTTP_PRECON_FAILED: 412,\n HTTP_RANGE_NOT_SATISFIABLE: 416,\n};\nconst HeaderConstants = {\n AUTHORIZATION: \"Authorization\",\n AUTHORIZATION_SCHEME: \"Bearer\",\n CONTENT_ENCODING: \"Content-Encoding\",\n CONTENT_ID: \"Content-ID\",\n CONTENT_LANGUAGE: \"Content-Language\",\n CONTENT_LENGTH: \"Content-Length\",\n CONTENT_MD5: \"Content-Md5\",\n CONTENT_TRANSFER_ENCODING: \"Content-Transfer-Encoding\",\n CONTENT_TYPE: \"Content-Type\",\n COOKIE: \"Cookie\",\n DATE: \"date\",\n IF_MATCH: \"if-match\",\n IF_MODIFIED_SINCE: \"if-modified-since\",\n IF_NONE_MATCH: \"if-none-match\",\n IF_UNMODIFIED_SINCE: \"if-unmodified-since\",\n PREFIX_FOR_STORAGE: \"x-ms-\",\n RANGE: \"Range\",\n USER_AGENT: \"User-Agent\",\n X_MS_CLIENT_REQUEST_ID: \"x-ms-client-request-id\",\n X_MS_COPY_SOURCE: \"x-ms-copy-source\",\n X_MS_DATE: \"x-ms-date\",\n X_MS_ERROR_CODE: \"x-ms-error-code\",\n X_MS_VERSION: \"x-ms-version\",\n};\nconst ETagNone = \"\";\nconst ETagAny = \"*\";\nconst SIZE_1_MB = 1 * 1024 * 1024;\nconst BATCH_MAX_REQUEST = 256;\nconst BATCH_MAX_PAYLOAD_IN_BYTES = 4 * SIZE_1_MB;\nconst HTTP_LINE_ENDING = \"\\r\\n\";\nconst HTTP_VERSION_1_1 = \"HTTP/1.1\";\nconst EncryptionAlgorithmAES25 = \"AES256\";\nconst DevelopmentConnectionString = `DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://127.0.0.1:10000/devstoreaccount1;`;\nconst StorageBlobLoggingAllowedHeaderNames = [\n \"Access-Control-Allow-Origin\",\n \"Cache-Control\",\n \"Content-Length\",\n \"Content-Type\",\n \"Date\",\n \"Request-Id\",\n \"traceparent\",\n \"Transfer-Encoding\",\n \"User-Agent\",\n \"x-ms-client-request-id\",\n \"x-ms-date\",\n \"x-ms-error-code\",\n \"x-ms-request-id\",\n \"x-ms-return-client-request-id\",\n \"x-ms-version\",\n \"Accept-Ranges\",\n \"Content-Disposition\",\n \"Content-Encoding\",\n \"Content-Language\",\n \"Content-MD5\",\n \"Content-Range\",\n \"ETag\",\n \"Last-Modified\",\n \"Server\",\n \"Vary\",\n \"x-ms-content-crc64\",\n \"x-ms-copy-action\",\n \"x-ms-copy-completion-time\",\n \"x-ms-copy-id\",\n \"x-ms-copy-progress\",\n \"x-ms-copy-status\",\n \"x-ms-has-immutability-policy\",\n \"x-ms-has-legal-hold\",\n \"x-ms-lease-state\",\n \"x-ms-lease-status\",\n \"x-ms-range\",\n \"x-ms-request-server-encrypted\",\n \"x-ms-server-encrypted\",\n \"x-ms-snapshot\",\n \"x-ms-source-range\",\n \"If-Match\",\n \"If-Modified-Since\",\n \"If-None-Match\",\n \"If-Unmodified-Since\",\n \"x-ms-access-tier\",\n \"x-ms-access-tier-change-time\",\n \"x-ms-access-tier-inferred\",\n \"x-ms-account-kind\",\n \"x-ms-archive-status\",\n \"x-ms-blob-append-offset\",\n \"x-ms-blob-cache-control\",\n \"x-ms-blob-committed-block-count\",\n \"x-ms-blob-condition-appendpos\",\n \"x-ms-blob-condition-maxsize\",\n \"x-ms-blob-content-disposition\",\n \"x-ms-blob-content-encoding\",\n \"x-ms-blob-content-language\",\n \"x-ms-blob-content-length\",\n \"x-ms-blob-content-md5\",\n \"x-ms-blob-content-type\",\n \"x-ms-blob-public-access\",\n \"x-ms-blob-sequence-number\",\n \"x-ms-blob-type\",\n \"x-ms-copy-destination-snapshot\",\n \"x-ms-creation-time\",\n \"x-ms-default-encryption-scope\",\n \"x-ms-delete-snapshots\",\n \"x-ms-delete-type-permanent\",\n \"x-ms-deny-encryption-scope-override\",\n \"x-ms-encryption-algorithm\",\n \"x-ms-if-sequence-number-eq\",\n \"x-ms-if-sequence-number-le\",\n \"x-ms-if-sequence-number-lt\",\n \"x-ms-incremental-copy\",\n \"x-ms-lease-action\",\n \"x-ms-lease-break-period\",\n \"x-ms-lease-duration\",\n \"x-ms-lease-id\",\n \"x-ms-lease-time\",\n \"x-ms-page-write\",\n \"x-ms-proposed-lease-id\",\n \"x-ms-range-get-content-md5\",\n \"x-ms-rehydrate-priority\",\n \"x-ms-sequence-number-action\",\n \"x-ms-sku-name\",\n \"x-ms-source-content-md5\",\n \"x-ms-source-if-match\",\n \"x-ms-source-if-modified-since\",\n \"x-ms-source-if-none-match\",\n \"x-ms-source-if-unmodified-since\",\n \"x-ms-tag-count\",\n \"x-ms-encryption-key-sha256\",\n \"x-ms-if-tags\",\n \"x-ms-source-if-tags\",\n];\nconst StorageBlobLoggingAllowedQueryParameters = [\n \"comp\",\n \"maxresults\",\n \"rscc\",\n \"rscd\",\n \"rsce\",\n \"rscl\",\n \"rsct\",\n \"se\",\n \"si\",\n \"sip\",\n \"sp\",\n \"spr\",\n \"sr\",\n \"srt\",\n \"ss\",\n \"st\",\n \"sv\",\n \"include\",\n \"marker\",\n \"prefix\",\n \"copyid\",\n \"restype\",\n \"blockid\",\n \"blocklisttype\",\n \"delimiter\",\n \"prevsnapshot\",\n \"ske\",\n \"skoid\",\n \"sks\",\n \"skt\",\n \"sktid\",\n \"skv\",\n \"snapshot\",\n];\nconst BlobUsesCustomerSpecifiedEncryptionMsg = \"BlobUsesCustomerSpecifiedEncryption\";\nconst BlobDoesNotUseCustomerSpecifiedEncryption = \"BlobDoesNotUseCustomerSpecifiedEncryption\";\n/// List of ports used for path style addressing.\n/// Path style addressing means that storage account is put in URI's Path segment in instead of in host.\nconst PathStylePorts = [\n \"10000\",\n \"10001\",\n \"10002\",\n \"10003\",\n \"10004\",\n \"10100\",\n \"10101\",\n \"10102\",\n \"10103\",\n \"10104\",\n \"11000\",\n \"11001\",\n \"11002\",\n \"11003\",\n \"11004\",\n \"11100\",\n \"11101\",\n \"11102\",\n \"11103\",\n \"11104\",\n];\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Reserved URL characters must be properly escaped for Storage services like Blob or File.\n *\n * ## URL encode and escape strategy for JS SDKs\n *\n * When customers pass a URL string into XxxClient classes constructor, the URL string may already be URL encoded or not.\n * But before sending to Azure Storage server, the URL must be encoded. However, it's hard for a SDK to guess whether the URL\n * string has been encoded or not. We have 2 potential strategies, and chose strategy two for the XxxClient constructors.\n *\n * ### Strategy One: Assume the customer URL string is not encoded, and always encode URL string in SDK.\n *\n * This is what legacy V2 SDK does, simple and works for most of the cases.\n * - When customer URL string is \"http://account.blob.core.windows.net/con/b:\",\n * SDK will encode it to \"http://account.blob.core.windows.net/con/b%3A\" and send to server. A blob named \"b:\" will be created.\n * - When customer URL string is \"http://account.blob.core.windows.net/con/b%3A\",\n * SDK will encode it to \"http://account.blob.core.windows.net/con/b%253A\" and send to server. A blob named \"b%3A\" will be created.\n *\n * But this strategy will make it not possible to create a blob with \"?\" in it's name. Because when customer URL string is\n * \"http://account.blob.core.windows.net/con/blob?name\", the \"?name\" will be treated as URL paramter instead of blob name.\n * If customer URL string is \"http://account.blob.core.windows.net/con/blob%3Fname\", a blob named \"blob%3Fname\" will be created.\n * V2 SDK doesn't have this issue because it doesn't allow customer pass in a full URL, it accepts a separate blob name and encodeURIComponent for it.\n * We cannot accept a SDK cannot create a blob name with \"?\". So we implement strategy two:\n *\n * ### Strategy Two: SDK doesn't assume the URL has been encoded or not. It will just escape the special characters.\n *\n * This is what V10 Blob Go SDK does. It accepts a URL type in Go, and call url.EscapedPath() to escape the special chars unescaped.\n * - When customer URL string is \"http://account.blob.core.windows.net/con/b:\",\n * SDK will escape \":\" like \"http://account.blob.core.windows.net/con/b%3A\" and send to server. A blob named \"b:\" will be created.\n * - When customer URL string is \"http://account.blob.core.windows.net/con/b%3A\",\n * There is no special characters, so send \"http://account.blob.core.windows.net/con/b%3A\" to server. A blob named \"b:\" will be created.\n * - When customer URL string is \"http://account.blob.core.windows.net/con/b%253A\",\n * There is no special characters, so send \"http://account.blob.core.windows.net/con/b%253A\" to server. A blob named \"b%3A\" will be created.\n *\n * This strategy gives us flexibility to create with any special characters. But \"%\" will be treated as a special characters, if the URL string\n * is not encoded, there shouldn't a \"%\" in the URL string, otherwise the URL is not a valid URL.\n * If customer needs to create a blob with \"%\" in it's blob name, use \"%25\" instead of \"%\". Just like above 3rd sample.\n * And following URL strings are invalid:\n * - \"http://account.blob.core.windows.net/con/b%\"\n * - \"http://account.blob.core.windows.net/con/b%2\"\n * - \"http://account.blob.core.windows.net/con/b%G\"\n *\n * Another special character is \"?\", use \"%2F\" to represent a blob name with \"?\" in a URL string.\n *\n * ### Strategy for containerName, blobName or other specific XXXName parameters in methods such as `containerClient.getBlobClient(blobName)`\n *\n * We will apply strategy one, and call encodeURIComponent for these parameters like blobName. Because what customers passes in is a plain name instead of a URL.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-shares--directories--files--and-metadata\n *\n * @param url -\n */\nfunction escapeURLPath(url) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n let path = urlParsed.getPath();\n path = path || \"/\";\n path = escape(path);\n urlParsed.setPath(path);\n return urlParsed.toString();\n}\nfunction getProxyUriFromDevConnString(connectionString) {\n // Development Connection String\n // https://docs.microsoft.com/en-us/azure/storage/common/storage-configure-connection-string#connect-to-the-emulator-account-using-the-well-known-account-name-and-key\n let proxyUri = \"\";\n if (connectionString.search(\"DevelopmentStorageProxyUri=\") !== -1) {\n // CONNECTION_STRING=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://myProxyUri\n const matchCredentials = connectionString.split(\";\");\n for (const element of matchCredentials) {\n if (element.trim().startsWith(\"DevelopmentStorageProxyUri=\")) {\n proxyUri = element.trim().match(\"DevelopmentStorageProxyUri=(.*)\")[1];\n }\n }\n }\n return proxyUri;\n}\nfunction getValueInConnString(connectionString, argument) {\n const elements = connectionString.split(\";\");\n for (const element of elements) {\n if (element.trim().startsWith(argument)) {\n return element.trim().match(argument + \"=(.*)\")[1];\n }\n }\n return \"\";\n}\n/**\n * Extracts the parts of an Azure Storage account connection string.\n *\n * @param connectionString - Connection string.\n * @returns String key value pairs of the storage account's url and credentials.\n */\nfunction extractConnectionStringParts(connectionString) {\n let proxyUri = \"\";\n if (connectionString.startsWith(\"UseDevelopmentStorage=true\")) {\n // Development connection string\n proxyUri = getProxyUriFromDevConnString(connectionString);\n connectionString = DevelopmentConnectionString;\n }\n // Matching BlobEndpoint in the Account connection string\n let blobEndpoint = getValueInConnString(connectionString, \"BlobEndpoint\");\n // Slicing off '/' at the end if exists\n // (The methods that use `extractConnectionStringParts` expect the url to not have `/` at the end)\n blobEndpoint = blobEndpoint.endsWith(\"/\") ? blobEndpoint.slice(0, -1) : blobEndpoint;\n if (connectionString.search(\"DefaultEndpointsProtocol=\") !== -1 &&\n connectionString.search(\"AccountKey=\") !== -1) {\n // Account connection string\n let defaultEndpointsProtocol = \"\";\n let accountName = \"\";\n let accountKey = Buffer.from(\"accountKey\", \"base64\");\n let endpointSuffix = \"\";\n // Get account name and key\n accountName = getValueInConnString(connectionString, \"AccountName\");\n accountKey = Buffer.from(getValueInConnString(connectionString, \"AccountKey\"), \"base64\");\n if (!blobEndpoint) {\n // BlobEndpoint is not present in the Account connection string\n // Can be obtained from `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`\n defaultEndpointsProtocol = getValueInConnString(connectionString, \"DefaultEndpointsProtocol\");\n const protocol = defaultEndpointsProtocol.toLowerCase();\n if (protocol !== \"https\" && protocol !== \"http\") {\n throw new Error(\"Invalid DefaultEndpointsProtocol in the provided Connection String. Expecting 'https' or 'http'\");\n }\n endpointSuffix = getValueInConnString(connectionString, \"EndpointSuffix\");\n if (!endpointSuffix) {\n throw new Error(\"Invalid EndpointSuffix in the provided Connection String\");\n }\n blobEndpoint = `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`;\n }\n if (!accountName) {\n throw new Error(\"Invalid AccountName in the provided Connection String\");\n }\n else if (accountKey.length === 0) {\n throw new Error(\"Invalid AccountKey in the provided Connection String\");\n }\n return {\n kind: \"AccountConnString\",\n url: blobEndpoint,\n accountName,\n accountKey,\n proxyUri,\n };\n }\n else {\n // SAS connection string\n const accountSas = getValueInConnString(connectionString, \"SharedAccessSignature\");\n const accountName = getAccountNameFromUrl(blobEndpoint);\n if (!blobEndpoint) {\n throw new Error(\"Invalid BlobEndpoint in the provided SAS Connection String\");\n }\n else if (!accountSas) {\n throw new Error(\"Invalid SharedAccessSignature in the provided SAS Connection String\");\n }\n return { kind: \"SASConnString\", url: blobEndpoint, accountName, accountSas };\n }\n}\n/**\n * Internal escape method implemented Strategy Two mentioned in escapeURL() description.\n *\n * @param text -\n */\nfunction escape(text) {\n return encodeURIComponent(text)\n .replace(/%2F/g, \"/\") // Don't escape for \"/\"\n .replace(/'/g, \"%27\") // Escape for \"'\"\n .replace(/\\+/g, \"%20\")\n .replace(/%25/g, \"%\"); // Revert encoded \"%\"\n}\n/**\n * Append a string to URL path. Will remove duplicated \"/\" in front of the string\n * when URL path ends with a \"/\".\n *\n * @param url - Source URL string\n * @param name - String to be appended to URL\n * @returns An updated URL string\n */\nfunction appendToURLPath(url, name) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n let path = urlParsed.getPath();\n path = path ? (path.endsWith(\"/\") ? `${path}${name}` : `${path}/${name}`) : name;\n urlParsed.setPath(path);\n const normalizedUrl = new URL(urlParsed.toString());\n return normalizedUrl.toString();\n}\n/**\n * Set URL parameter name and value. If name exists in URL parameters, old value\n * will be replaced by name key. If not provide value, the parameter will be deleted.\n *\n * @param url - Source URL string\n * @param name - Parameter name\n * @param value - Parameter value\n * @returns An updated URL string\n */\nfunction setURLParameter(url, name, value) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n urlParsed.setQueryParameter(name, value);\n return urlParsed.toString();\n}\n/**\n * Get URL parameter by name.\n *\n * @param url -\n * @param name -\n */\nfunction getURLParameter(url, name) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n return urlParsed.getQueryParameterValue(name);\n}\n/**\n * Set URL host.\n *\n * @param url - Source URL string\n * @param host - New host string\n * @returns An updated URL string\n */\nfunction setURLHost(url, host) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n urlParsed.setHost(host);\n return urlParsed.toString();\n}\n/**\n * Get URL path from an URL string.\n *\n * @param url - Source URL string\n */\nfunction getURLPath(url) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n return urlParsed.getPath();\n}\n/**\n * Get URL scheme from an URL string.\n *\n * @param url - Source URL string\n */\nfunction getURLScheme(url) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n return urlParsed.getScheme();\n}\n/**\n * Get URL path and query from an URL string.\n *\n * @param url - Source URL string\n */\nfunction getURLPathAndQuery(url) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n const pathString = urlParsed.getPath();\n if (!pathString) {\n throw new RangeError(\"Invalid url without valid path.\");\n }\n let queryString = urlParsed.getQuery() || \"\";\n queryString = queryString.trim();\n if (queryString !== \"\") {\n queryString = queryString.startsWith(\"?\") ? queryString : `?${queryString}`; // Ensure query string start with '?'\n }\n return `${pathString}${queryString}`;\n}\n/**\n * Get URL query key value pairs from an URL string.\n *\n * @param url -\n */\nfunction getURLQueries(url) {\n let queryString = coreHttp.URLBuilder.parse(url).getQuery();\n if (!queryString) {\n return {};\n }\n queryString = queryString.trim();\n queryString = queryString.startsWith(\"?\") ? queryString.substr(1) : queryString;\n let querySubStrings = queryString.split(\"&\");\n querySubStrings = querySubStrings.filter((value) => {\n const indexOfEqual = value.indexOf(\"=\");\n const lastIndexOfEqual = value.lastIndexOf(\"=\");\n return (indexOfEqual > 0 && indexOfEqual === lastIndexOfEqual && lastIndexOfEqual < value.length - 1);\n });\n const queries = {};\n for (const querySubString of querySubStrings) {\n const splitResults = querySubString.split(\"=\");\n const key = splitResults[0];\n const value = splitResults[1];\n queries[key] = value;\n }\n return queries;\n}\n/**\n * Append a string to URL query.\n *\n * @param url - Source URL string.\n * @param queryParts - String to be appended to the URL query.\n * @returns An updated URL string.\n */\nfunction appendToURLQuery(url, queryParts) {\n const urlParsed = coreHttp.URLBuilder.parse(url);\n let query = urlParsed.getQuery();\n if (query) {\n query += \"&\" + queryParts;\n }\n else {\n query = queryParts;\n }\n urlParsed.setQuery(query);\n return urlParsed.toString();\n}\n/**\n * Rounds a date off to seconds.\n *\n * @param date -\n * @param withMilliseconds - If true, YYYY-MM-DDThh:mm:ss.fffffffZ will be returned;\n * If false, YYYY-MM-DDThh:mm:ssZ will be returned.\n * @returns Date string in ISO8061 format, with or without 7 milliseconds component\n */\nfunction truncatedISO8061Date(date, withMilliseconds = true) {\n // Date.toISOString() will return like \"2018-10-29T06:34:36.139Z\"\n const dateString = date.toISOString();\n return withMilliseconds\n ? dateString.substring(0, dateString.length - 1) + \"0000\" + \"Z\"\n : dateString.substring(0, dateString.length - 5) + \"Z\";\n}\n/**\n * Base64 encode.\n *\n * @param content -\n */\nfunction base64encode(content) {\n return !coreHttp.isNode ? btoa(content) : Buffer.from(content).toString(\"base64\");\n}\n/**\n * Generate a 64 bytes base64 block ID string.\n *\n * @param blockIndex -\n */\nfunction generateBlockID(blockIDPrefix, blockIndex) {\n // To generate a 64 bytes base64 string, source string should be 48\n const maxSourceStringLength = 48;\n // A blob can have a maximum of 100,000 uncommitted blocks at any given time\n const maxBlockIndexLength = 6;\n const maxAllowedBlockIDPrefixLength = maxSourceStringLength - maxBlockIndexLength;\n if (blockIDPrefix.length > maxAllowedBlockIDPrefixLength) {\n blockIDPrefix = blockIDPrefix.slice(0, maxAllowedBlockIDPrefixLength);\n }\n const res = blockIDPrefix +\n padStart(blockIndex.toString(), maxSourceStringLength - blockIDPrefix.length, \"0\");\n return base64encode(res);\n}\n/**\n * Delay specified time interval.\n *\n * @param timeInMs -\n * @param aborter -\n * @param abortError -\n */\nasync function delay(timeInMs, aborter, abortError) {\n return new Promise((resolve, reject) => {\n /* eslint-disable-next-line prefer-const */\n let timeout;\n const abortHandler = () => {\n if (timeout !== undefined) {\n clearTimeout(timeout);\n }\n reject(abortError);\n };\n const resolveHandler = () => {\n if (aborter !== undefined) {\n aborter.removeEventListener(\"abort\", abortHandler);\n }\n resolve();\n };\n timeout = setTimeout(resolveHandler, timeInMs);\n if (aborter !== undefined) {\n aborter.addEventListener(\"abort\", abortHandler);\n }\n });\n}\n/**\n * String.prototype.padStart()\n *\n * @param currentString -\n * @param targetLength -\n * @param padString -\n */\nfunction padStart(currentString, targetLength, padString = \" \") {\n // @ts-expect-error: TS doesn't know this code needs to run downlevel sometimes\n if (String.prototype.padStart) {\n return currentString.padStart(targetLength, padString);\n }\n padString = padString || \" \";\n if (currentString.length > targetLength) {\n return currentString;\n }\n else {\n targetLength = targetLength - currentString.length;\n if (targetLength > padString.length) {\n padString += padString.repeat(targetLength / padString.length);\n }\n return padString.slice(0, targetLength) + currentString;\n }\n}\n/**\n * If two strings are equal when compared case insensitive.\n *\n * @param str1 -\n * @param str2 -\n */\nfunction iEqual(str1, str2) {\n return str1.toLocaleLowerCase() === str2.toLocaleLowerCase();\n}\n/**\n * Extracts account name from the url\n * @param url - url to extract the account name from\n * @returns with the account name\n */\nfunction getAccountNameFromUrl(url) {\n const parsedUrl = coreHttp.URLBuilder.parse(url);\n let accountName;\n try {\n if (parsedUrl.getHost().split(\".\")[1] === \"blob\") {\n // `${defaultEndpointsProtocol}://${accountName}.blob.${endpointSuffix}`;\n accountName = parsedUrl.getHost().split(\".\")[0];\n }\n else if (isIpEndpointStyle(parsedUrl)) {\n // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/\n // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/\n // .getPath() -> /devstoreaccount1/\n accountName = parsedUrl.getPath().split(\"/\")[1];\n }\n else {\n // Custom domain case: \"https://customdomain.com/containername/blob\".\n accountName = \"\";\n }\n return accountName;\n }\n catch (error) {\n throw new Error(\"Unable to extract accountName with provided information.\");\n }\n}\nfunction isIpEndpointStyle(parsedUrl) {\n if (parsedUrl.getHost() === undefined) {\n return false;\n }\n const host = parsedUrl.getHost() + (parsedUrl.getPort() === undefined ? \"\" : \":\" + parsedUrl.getPort());\n // Case 1: Ipv6, use a broad regex to find out candidates whose host contains two ':'.\n // Case 2: localhost(:port), use broad regex to match port part.\n // Case 3: Ipv4, use broad regex which just check if host contains Ipv4.\n // For valid host please refer to https://man7.org/linux/man-pages/man7/hostname.7.html.\n return (/^.*:.*:.*$|^localhost(:[0-9]+)?$|^(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])(\\.(\\d|[1-9]\\d|1\\d\\d|2[0-4]\\d|25[0-5])){3}(:[0-9]+)?$/.test(host) ||\n (parsedUrl.getPort() !== undefined && PathStylePorts.includes(parsedUrl.getPort())));\n}\n/**\n * Convert Tags to encoded string.\n *\n * @param tags -\n */\nfunction toBlobTagsString(tags) {\n if (tags === undefined) {\n return undefined;\n }\n const tagPairs = [];\n for (const key in tags) {\n if (Object.prototype.hasOwnProperty.call(tags, key)) {\n const value = tags[key];\n tagPairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);\n }\n }\n return tagPairs.join(\"&\");\n}\n/**\n * Convert Tags type to BlobTags.\n *\n * @param tags -\n */\nfunction toBlobTags(tags) {\n if (tags === undefined) {\n return undefined;\n }\n const res = {\n blobTagSet: [],\n };\n for (const key in tags) {\n if (Object.prototype.hasOwnProperty.call(tags, key)) {\n const value = tags[key];\n res.blobTagSet.push({\n key,\n value,\n });\n }\n }\n return res;\n}\n/**\n * Covert BlobTags to Tags type.\n *\n * @param tags -\n */\nfunction toTags(tags) {\n if (tags === undefined) {\n return undefined;\n }\n const res = {};\n for (const blobTag of tags.blobTagSet) {\n res[blobTag.key] = blobTag.value;\n }\n return res;\n}\n/**\n * Convert BlobQueryTextConfiguration to QuerySerialization type.\n *\n * @param textConfiguration -\n */\nfunction toQuerySerialization(textConfiguration) {\n if (textConfiguration === undefined) {\n return undefined;\n }\n switch (textConfiguration.kind) {\n case \"csv\":\n return {\n format: {\n type: \"delimited\",\n delimitedTextConfiguration: {\n columnSeparator: textConfiguration.columnSeparator || \",\",\n fieldQuote: textConfiguration.fieldQuote || \"\",\n recordSeparator: textConfiguration.recordSeparator,\n escapeChar: textConfiguration.escapeCharacter || \"\",\n headersPresent: textConfiguration.hasHeaders || false,\n },\n },\n };\n case \"json\":\n return {\n format: {\n type: \"json\",\n jsonTextConfiguration: {\n recordSeparator: textConfiguration.recordSeparator,\n },\n },\n };\n case \"arrow\":\n return {\n format: {\n type: \"arrow\",\n arrowConfiguration: {\n schema: textConfiguration.schema,\n },\n },\n };\n case \"parquet\":\n return {\n format: {\n type: \"parquet\",\n },\n };\n default:\n throw Error(\"Invalid BlobQueryTextConfiguration.\");\n }\n}\nfunction parseObjectReplicationRecord(objectReplicationRecord) {\n if (!objectReplicationRecord) {\n return undefined;\n }\n if (\"policy-id\" in objectReplicationRecord) {\n // If the dictionary contains a key with policy id, we are not required to do any parsing since\n // the policy id should already be stored in the ObjectReplicationDestinationPolicyId.\n return undefined;\n }\n const orProperties = [];\n for (const key in objectReplicationRecord) {\n const ids = key.split(\"_\");\n const policyPrefix = \"or-\";\n if (ids[0].startsWith(policyPrefix)) {\n ids[0] = ids[0].substring(policyPrefix.length);\n }\n const rule = {\n ruleId: ids[1],\n replicationStatus: objectReplicationRecord[key],\n };\n const policyIndex = orProperties.findIndex((policy) => policy.policyId === ids[0]);\n if (policyIndex > -1) {\n orProperties[policyIndex].rules.push(rule);\n }\n else {\n orProperties.push({\n policyId: ids[0],\n rules: [rule],\n });\n }\n }\n return orProperties;\n}\n/**\n * Attach a TokenCredential to an object.\n *\n * @param thing -\n * @param credential -\n */\nfunction attachCredential(thing, credential) {\n thing.credential = credential;\n return thing;\n}\nfunction httpAuthorizationToString(httpAuthorization) {\n return httpAuthorization ? httpAuthorization.scheme + \" \" + httpAuthorization.value : undefined;\n}\nfunction BlobNameToString(name) {\n if (name.encoded) {\n return decodeURIComponent(name.content);\n }\n else {\n return name.content;\n }\n}\nfunction ConvertInternalResponseOfListBlobFlat(internalResponse) {\n return Object.assign(Object.assign({}, internalResponse), { segment: {\n blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {\n const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });\n return blobItem;\n }),\n } });\n}\nfunction ConvertInternalResponseOfListBlobHierarchy(internalResponse) {\n var _a;\n return Object.assign(Object.assign({}, internalResponse), { segment: {\n blobPrefixes: (_a = internalResponse.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {\n const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) });\n return blobPrefix;\n }),\n blobItems: internalResponse.segment.blobItems.map((blobItemInteral) => {\n const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name) });\n return blobItem;\n }),\n } });\n}\nfunction* ExtractPageRangeInfoItems(getPageRangesSegment) {\n let pageRange = [];\n let clearRange = [];\n if (getPageRangesSegment.pageRange)\n pageRange = getPageRangesSegment.pageRange;\n if (getPageRangesSegment.clearRange)\n clearRange = getPageRangesSegment.clearRange;\n let pageRangeIndex = 0;\n let clearRangeIndex = 0;\n while (pageRangeIndex < pageRange.length && clearRangeIndex < clearRange.length) {\n if (pageRange[pageRangeIndex].start < clearRange[clearRangeIndex].start) {\n yield {\n start: pageRange[pageRangeIndex].start,\n end: pageRange[pageRangeIndex].end,\n isClear: false,\n };\n ++pageRangeIndex;\n }\n else {\n yield {\n start: clearRange[clearRangeIndex].start,\n end: clearRange[clearRangeIndex].end,\n isClear: true,\n };\n ++clearRangeIndex;\n }\n }\n for (; pageRangeIndex < pageRange.length; ++pageRangeIndex) {\n yield {\n start: pageRange[pageRangeIndex].start,\n end: pageRange[pageRangeIndex].end,\n isClear: false,\n };\n }\n for (; clearRangeIndex < clearRange.length; ++clearRangeIndex) {\n yield {\n start: clearRange[clearRangeIndex].start,\n end: clearRange[clearRangeIndex].end,\n isClear: true,\n };\n }\n}\n/**\n * Escape the blobName but keep path separator ('/').\n */\nfunction EscapePath(blobName) {\n const split = blobName.split(\"/\");\n for (let i = 0; i < split.length; i++) {\n split[i] = encodeURIComponent(split[i]);\n }\n return split.join(\"/\");\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * StorageBrowserPolicy will handle differences between Node.js and browser runtime, including:\n *\n * 1. Browsers cache GET/HEAD requests by adding conditional headers such as 'IF_MODIFIED_SINCE'.\n * StorageBrowserPolicy is a policy used to add a timestamp query to GET/HEAD request URL\n * thus avoid the browser cache.\n *\n * 2. Remove cookie header for security\n *\n * 3. Remove content-length header to avoid browsers warning\n */\nclass StorageBrowserPolicy extends coreHttp.BaseRequestPolicy {\n /**\n * Creates an instance of StorageBrowserPolicy.\n * @param nextPolicy -\n * @param options -\n */\n // The base class has a protected constructor. Adding a public one to enable constructing of this class.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/\n constructor(nextPolicy, options) {\n super(nextPolicy, options);\n }\n /**\n * Sends out request.\n *\n * @param request -\n */\n async sendRequest(request) {\n if (coreHttp.isNode) {\n return this._nextPolicy.sendRequest(request);\n }\n if (request.method.toUpperCase() === \"GET\" || request.method.toUpperCase() === \"HEAD\") {\n request.url = setURLParameter(request.url, URLConstants.Parameters.FORCE_BROWSER_NO_CACHE, new Date().getTime().toString());\n }\n request.headers.remove(HeaderConstants.COOKIE);\n // According to XHR standards, content-length should be fully controlled by browsers\n request.headers.remove(HeaderConstants.CONTENT_LENGTH);\n return this._nextPolicy.sendRequest(request);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * StorageBrowserPolicyFactory is a factory class helping generating StorageBrowserPolicy objects.\n */\nclass StorageBrowserPolicyFactory {\n /**\n * Creates a StorageBrowserPolicyFactory object.\n *\n * @param nextPolicy -\n * @param options -\n */\n create(nextPolicy, options) {\n return new StorageBrowserPolicy(nextPolicy, options);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * RetryPolicy types.\n */\nexports.StorageRetryPolicyType = void 0;\n(function (StorageRetryPolicyType) {\n /**\n * Exponential retry. Retry time delay grows exponentially.\n */\n StorageRetryPolicyType[StorageRetryPolicyType[\"EXPONENTIAL\"] = 0] = \"EXPONENTIAL\";\n /**\n * Linear retry. Retry time delay grows linearly.\n */\n StorageRetryPolicyType[StorageRetryPolicyType[\"FIXED\"] = 1] = \"FIXED\";\n})(exports.StorageRetryPolicyType || (exports.StorageRetryPolicyType = {}));\n// Default values of StorageRetryOptions\nconst DEFAULT_RETRY_OPTIONS = {\n maxRetryDelayInMs: 120 * 1000,\n maxTries: 4,\n retryDelayInMs: 4 * 1000,\n retryPolicyType: exports.StorageRetryPolicyType.EXPONENTIAL,\n secondaryHost: \"\",\n tryTimeoutInMs: undefined, // Use server side default timeout strategy\n};\nconst RETRY_ABORT_ERROR = new abortController.AbortError(\"The operation was aborted.\");\n/**\n * Retry policy with exponential retry and linear retry implemented.\n */\nclass StorageRetryPolicy extends coreHttp.BaseRequestPolicy {\n /**\n * Creates an instance of RetryPolicy.\n *\n * @param nextPolicy -\n * @param options -\n * @param retryOptions -\n */\n constructor(nextPolicy, options, retryOptions = DEFAULT_RETRY_OPTIONS) {\n super(nextPolicy, options);\n // Initialize retry options\n this.retryOptions = {\n retryPolicyType: retryOptions.retryPolicyType\n ? retryOptions.retryPolicyType\n : DEFAULT_RETRY_OPTIONS.retryPolicyType,\n maxTries: retryOptions.maxTries && retryOptions.maxTries >= 1\n ? Math.floor(retryOptions.maxTries)\n : DEFAULT_RETRY_OPTIONS.maxTries,\n tryTimeoutInMs: retryOptions.tryTimeoutInMs && retryOptions.tryTimeoutInMs >= 0\n ? retryOptions.tryTimeoutInMs\n : DEFAULT_RETRY_OPTIONS.tryTimeoutInMs,\n retryDelayInMs: retryOptions.retryDelayInMs && retryOptions.retryDelayInMs >= 0\n ? Math.min(retryOptions.retryDelayInMs, retryOptions.maxRetryDelayInMs\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs)\n : DEFAULT_RETRY_OPTIONS.retryDelayInMs,\n maxRetryDelayInMs: retryOptions.maxRetryDelayInMs && retryOptions.maxRetryDelayInMs >= 0\n ? retryOptions.maxRetryDelayInMs\n : DEFAULT_RETRY_OPTIONS.maxRetryDelayInMs,\n secondaryHost: retryOptions.secondaryHost\n ? retryOptions.secondaryHost\n : DEFAULT_RETRY_OPTIONS.secondaryHost,\n };\n }\n /**\n * Sends request.\n *\n * @param request -\n */\n async sendRequest(request) {\n return this.attemptSendRequest(request, false, 1);\n }\n /**\n * Decide and perform next retry. Won't mutate request parameter.\n *\n * @param request -\n * @param secondaryHas404 - If attempt was against the secondary & it returned a StatusNotFound (404), then\n * the resource was not found. This may be due to replication delay. So, in this\n * case, we'll never try the secondary again for this operation.\n * @param attempt - How many retries has been attempted to performed, starting from 1, which includes\n * the attempt will be performed by this method call.\n */\n async attemptSendRequest(request, secondaryHas404, attempt) {\n const newRequest = request.clone();\n const isPrimaryRetry = secondaryHas404 ||\n !this.retryOptions.secondaryHost ||\n !(request.method === \"GET\" || request.method === \"HEAD\" || request.method === \"OPTIONS\") ||\n attempt % 2 === 1;\n if (!isPrimaryRetry) {\n newRequest.url = setURLHost(newRequest.url, this.retryOptions.secondaryHost);\n }\n // Set the server-side timeout query parameter \"timeout=[seconds]\"\n if (this.retryOptions.tryTimeoutInMs) {\n newRequest.url = setURLParameter(newRequest.url, URLConstants.Parameters.TIMEOUT, Math.floor(this.retryOptions.tryTimeoutInMs / 1000).toString());\n }\n let response;\n try {\n logger.info(`RetryPolicy: =====> Try=${attempt} ${isPrimaryRetry ? \"Primary\" : \"Secondary\"}`);\n response = await this._nextPolicy.sendRequest(newRequest);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response)) {\n return response;\n }\n secondaryHas404 = secondaryHas404 || (!isPrimaryRetry && response.status === 404);\n }\n catch (err) {\n logger.error(`RetryPolicy: Caught error, message: ${err.message}, code: ${err.code}`);\n if (!this.shouldRetry(isPrimaryRetry, attempt, response, err)) {\n throw err;\n }\n }\n await this.delay(isPrimaryRetry, attempt, request.abortSignal);\n return this.attemptSendRequest(request, secondaryHas404, ++attempt);\n }\n /**\n * Decide whether to retry according to last HTTP response and retry counters.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param response -\n * @param err -\n */\n shouldRetry(isPrimaryRetry, attempt, response, err) {\n if (attempt >= this.retryOptions.maxTries) {\n logger.info(`RetryPolicy: Attempt(s) ${attempt} >= maxTries ${this.retryOptions\n .maxTries}, no further try.`);\n return false;\n }\n // Handle network failures, you may need to customize the list when you implement\n // your own http client\n const retriableErrors = [\n \"ETIMEDOUT\",\n \"ESOCKETTIMEDOUT\",\n \"ECONNREFUSED\",\n \"ECONNRESET\",\n \"ENOENT\",\n \"ENOTFOUND\",\n \"TIMEOUT\",\n \"EPIPE\",\n \"REQUEST_SEND_ERROR\", // For default xhr based http client provided in ms-rest-js\n ];\n if (err) {\n for (const retriableError of retriableErrors) {\n if (err.name.toUpperCase().includes(retriableError) ||\n err.message.toUpperCase().includes(retriableError) ||\n (err.code && err.code.toString().toUpperCase() === retriableError)) {\n logger.info(`RetryPolicy: Network error ${retriableError} found, will retry.`);\n return true;\n }\n }\n }\n // If attempt was against the secondary & it returned a StatusNotFound (404), then\n // the resource was not found. This may be due to replication delay. So, in this\n // case, we'll never try the secondary again for this operation.\n if (response || err) {\n const statusCode = response ? response.status : err ? err.statusCode : 0;\n if (!isPrimaryRetry && statusCode === 404) {\n logger.info(`RetryPolicy: Secondary access with 404, will retry.`);\n return true;\n }\n // Server internal error or server timeout\n if (statusCode === 503 || statusCode === 500) {\n logger.info(`RetryPolicy: Will retry for status code ${statusCode}.`);\n return true;\n }\n }\n if ((err === null || err === void 0 ? void 0 : err.code) === \"PARSE_ERROR\" && (err === null || err === void 0 ? void 0 : err.message.startsWith(`Error \"Error: Unclosed root tag`))) {\n logger.info(\"RetryPolicy: Incomplete XML response likely due to service timeout, will retry.\");\n return true;\n }\n return false;\n }\n /**\n * Delay a calculated time between retries.\n *\n * @param isPrimaryRetry -\n * @param attempt -\n * @param abortSignal -\n */\n async delay(isPrimaryRetry, attempt, abortSignal) {\n let delayTimeInMs = 0;\n if (isPrimaryRetry) {\n switch (this.retryOptions.retryPolicyType) {\n case exports.StorageRetryPolicyType.EXPONENTIAL:\n delayTimeInMs = Math.min((Math.pow(2, attempt - 1) - 1) * this.retryOptions.retryDelayInMs, this.retryOptions.maxRetryDelayInMs);\n break;\n case exports.StorageRetryPolicyType.FIXED:\n delayTimeInMs = this.retryOptions.retryDelayInMs;\n break;\n }\n }\n else {\n delayTimeInMs = Math.random() * 1000;\n }\n logger.info(`RetryPolicy: Delay for ${delayTimeInMs}ms`);\n return delay(delayTimeInMs, abortSignal, RETRY_ABORT_ERROR);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * StorageRetryPolicyFactory is a factory class helping generating {@link StorageRetryPolicy} objects.\n */\nclass StorageRetryPolicyFactory {\n /**\n * Creates an instance of StorageRetryPolicyFactory.\n * @param retryOptions -\n */\n constructor(retryOptions) {\n this.retryOptions = retryOptions;\n }\n /**\n * Creates a StorageRetryPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n create(nextPolicy, options) {\n return new StorageRetryPolicy(nextPolicy, options, this.retryOptions);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Credential policy used to sign HTTP(S) requests before sending. This is an\n * abstract class.\n */\nclass CredentialPolicy extends coreHttp.BaseRequestPolicy {\n /**\n * Sends out request.\n *\n * @param request -\n */\n sendRequest(request) {\n return this._nextPolicy.sendRequest(this.signRequest(request));\n }\n /**\n * Child classes must implement this method with request signing. This method\n * will be executed in {@link sendRequest}.\n *\n * @param request -\n */\n signRequest(request) {\n // Child classes must override this method with request signing. This method\n // will be executed in sendRequest().\n return request;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * AnonymousCredentialPolicy is used with HTTP(S) requests that read public resources\n * or for use with Shared Access Signatures (SAS).\n */\nclass AnonymousCredentialPolicy extends CredentialPolicy {\n /**\n * Creates an instance of AnonymousCredentialPolicy.\n * @param nextPolicy -\n * @param options -\n */\n // The base class has a protected constructor. Adding a public one to enable constructing of this class.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/\n constructor(nextPolicy, options) {\n super(nextPolicy, options);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Credential is an abstract class for Azure Storage HTTP requests signing. This\n * class will host an credentialPolicyCreator factory which generates CredentialPolicy.\n */\nclass Credential {\n /**\n * Creates a RequestPolicy object.\n *\n * @param _nextPolicy -\n * @param _options -\n */\n create(_nextPolicy, _options) {\n throw new Error(\"Method should be implemented in children classes.\");\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * AnonymousCredential provides a credentialPolicyCreator member used to create\n * AnonymousCredentialPolicy objects. AnonymousCredentialPolicy is used with\n * HTTP(S) requests that read public resources or for use with Shared Access\n * Signatures (SAS).\n */\nclass AnonymousCredential extends Credential {\n /**\n * Creates an {@link AnonymousCredentialPolicy} object.\n *\n * @param nextPolicy -\n * @param options -\n */\n create(nextPolicy, options) {\n return new AnonymousCredentialPolicy(nextPolicy, options);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * TelemetryPolicy is a policy used to tag user-agent header for every requests.\n */\nclass TelemetryPolicy extends coreHttp.BaseRequestPolicy {\n /**\n * Creates an instance of TelemetryPolicy.\n * @param nextPolicy -\n * @param options -\n * @param telemetry -\n */\n constructor(nextPolicy, options, telemetry) {\n super(nextPolicy, options);\n this.telemetry = telemetry;\n }\n /**\n * Sends out request.\n *\n * @param request -\n */\n async sendRequest(request) {\n if (coreHttp.isNode) {\n if (!request.headers) {\n request.headers = new coreHttp.HttpHeaders();\n }\n if (!request.headers.get(HeaderConstants.USER_AGENT)) {\n request.headers.set(HeaderConstants.USER_AGENT, this.telemetry);\n }\n }\n return this._nextPolicy.sendRequest(request);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * TelemetryPolicyFactory is a factory class helping generating {@link TelemetryPolicy} objects.\n */\nclass TelemetryPolicyFactory {\n /**\n * Creates an instance of TelemetryPolicyFactory.\n * @param telemetry -\n */\n constructor(telemetry) {\n const userAgentInfo = [];\n if (coreHttp.isNode) {\n if (telemetry) {\n const telemetryString = telemetry.userAgentPrefix || \"\";\n if (telemetryString.length > 0 && userAgentInfo.indexOf(telemetryString) === -1) {\n userAgentInfo.push(telemetryString);\n }\n }\n // e.g. azsdk-js-storageblob/10.0.0\n const libInfo = `azsdk-js-storageblob/${SDK_VERSION}`;\n if (userAgentInfo.indexOf(libInfo) === -1) {\n userAgentInfo.push(libInfo);\n }\n // e.g. (NODE-VERSION 4.9.1; Windows_NT 10.0.16299)\n let runtimeInfo = `(NODE-VERSION ${process.version})`;\n if (os__namespace) {\n runtimeInfo = `(NODE-VERSION ${process.version}; ${os__namespace.type()} ${os__namespace.release()})`;\n }\n if (userAgentInfo.indexOf(runtimeInfo) === -1) {\n userAgentInfo.push(runtimeInfo);\n }\n }\n this.telemetryString = userAgentInfo.join(\" \");\n }\n /**\n * Creates a TelemetryPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n create(nextPolicy, options) {\n return new TelemetryPolicy(nextPolicy, options, this.telemetryString);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nconst _defaultHttpClient = new coreHttp.DefaultHttpClient();\nfunction getCachedDefaultHttpClient() {\n return _defaultHttpClient;\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A set of constants used internally when processing requests.\n */\nconst Constants = {\n DefaultScope: \"/.default\",\n /**\n * Defines constants for use with HTTP headers.\n */\n HeaderConstants: {\n /**\n * The Authorization header.\n */\n AUTHORIZATION: \"authorization\",\n },\n};\n// Default options for the cycler if none are provided\nconst DEFAULT_CYCLER_OPTIONS = {\n forcedRefreshWindowInMs: 1000,\n retryIntervalInMs: 3000,\n refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry\n};\n/**\n * Converts an an unreliable access token getter (which may resolve with null)\n * into an AccessTokenGetter by retrying the unreliable getter in a regular\n * interval.\n *\n * @param getAccessToken - a function that produces a promise of an access\n * token that may fail by returning null\n * @param retryIntervalInMs - the time (in milliseconds) to wait between retry\n * attempts\n * @param timeoutInMs - the timestamp after which the refresh attempt will fail,\n * throwing an exception\n * @returns - a promise that, if it resolves, will resolve with an access token\n */\nasync function beginRefresh(getAccessToken, retryIntervalInMs, timeoutInMs) {\n // This wrapper handles exceptions gracefully as long as we haven't exceeded\n // the timeout.\n async function tryGetAccessToken() {\n if (Date.now() < timeoutInMs) {\n try {\n return await getAccessToken();\n }\n catch (_a) {\n return null;\n }\n }\n else {\n const finalToken = await getAccessToken();\n // Timeout is up, so throw if it's still null\n if (finalToken === null) {\n throw new Error(\"Failed to refresh access token.\");\n }\n return finalToken;\n }\n }\n let token = await tryGetAccessToken();\n while (token === null) {\n await coreHttp.delay(retryIntervalInMs);\n token = await tryGetAccessToken();\n }\n return token;\n}\n/**\n * Creates a token cycler from a credential, scopes, and optional settings.\n *\n * A token cycler represents a way to reliably retrieve a valid access token\n * from a TokenCredential. It will handle initializing the token, refreshing it\n * when it nears expiration, and synchronizes refresh attempts to avoid\n * concurrency hazards.\n *\n * @param credential - the underlying TokenCredential that provides the access\n * token\n * @param scopes - the scopes to request authorization for\n * @param tokenCyclerOptions - optionally override default settings for the cycler\n *\n * @returns - a function that reliably produces a valid access token\n */\nfunction createTokenCycler(credential, scopes, tokenCyclerOptions) {\n let refreshWorker = null;\n let token = null;\n const options = Object.assign(Object.assign({}, DEFAULT_CYCLER_OPTIONS), tokenCyclerOptions);\n /**\n * This little holder defines several predicates that we use to construct\n * the rules of refreshing the token.\n */\n const cycler = {\n /**\n * Produces true if a refresh job is currently in progress.\n */\n get isRefreshing() {\n return refreshWorker !== null;\n },\n /**\n * Produces true if the cycler SHOULD refresh (we are within the refresh\n * window and not already refreshing)\n */\n get shouldRefresh() {\n var _a;\n return (!cycler.isRefreshing &&\n ((_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : 0) - options.refreshWindowInMs < Date.now());\n },\n /**\n * Produces true if the cycler MUST refresh (null or nearly-expired\n * token).\n */\n get mustRefresh() {\n return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now());\n },\n };\n /**\n * Starts a refresh job or returns the existing job if one is already\n * running.\n */\n function refresh(getTokenOptions) {\n var _a;\n if (!cycler.isRefreshing) {\n // We bind `scopes` here to avoid passing it around a lot\n const tryGetAccessToken = () => credential.getToken(scopes, getTokenOptions);\n // Take advantage of promise chaining to insert an assignment to `token`\n // before the refresh can be considered done.\n refreshWorker = beginRefresh(tryGetAccessToken, options.retryIntervalInMs, \n // If we don't have a token, then we should timeout immediately\n (_a = token === null || token === void 0 ? void 0 : token.expiresOnTimestamp) !== null && _a !== void 0 ? _a : Date.now())\n .then((_token) => {\n refreshWorker = null;\n token = _token;\n return token;\n })\n .catch((reason) => {\n // We also should reset the refresher if we enter a failed state. All\n // existing awaiters will throw, but subsequent requests will start a\n // new retry chain.\n refreshWorker = null;\n token = null;\n throw reason;\n });\n }\n return refreshWorker;\n }\n return async (tokenOptions) => {\n //\n // Simple rules:\n // - If we MUST refresh, then return the refresh task, blocking\n // the pipeline until a token is available.\n // - If we SHOULD refresh, then run refresh but don't return it\n // (we can still use the cached token).\n // - Return the token, since it's fine if we didn't return in\n // step 1.\n //\n if (cycler.mustRefresh)\n return refresh(tokenOptions);\n if (cycler.shouldRefresh) {\n refresh(tokenOptions);\n }\n return token;\n };\n}\n/**\n * We will retrieve the challenge only if the response status code was 401,\n * and if the response contained the header \"WWW-Authenticate\" with a non-empty value.\n */\nfunction getChallenge(response) {\n const challenge = response.headers.get(\"WWW-Authenticate\");\n if (response.status === 401 && challenge) {\n return challenge;\n }\n return;\n}\n/**\n * Converts: `Bearer a=\"b\" c=\"d\"`.\n * Into: `[ { a: 'b', c: 'd' }]`.\n *\n * @internal\n */\nfunction parseChallenge(challenge) {\n const bearerChallenge = challenge.slice(\"Bearer \".length);\n const challengeParts = `${bearerChallenge.trim()} `.split(\" \").filter((x) => x);\n const keyValuePairs = challengeParts.map((keyValue) => (([key, value]) => ({ [key]: value }))(keyValue.trim().split(\"=\")));\n // Key-value pairs to plain object:\n return keyValuePairs.reduce((a, b) => (Object.assign(Object.assign({}, a), b)), {});\n}\n// #endregion\n/**\n * Creates a new factory for a RequestPolicy that applies a bearer token to\n * the requests' `Authorization` headers.\n *\n * @param credential - The TokenCredential implementation that can supply the bearer token.\n * @param scopes - The scopes for which the bearer token applies.\n */\nfunction storageBearerTokenChallengeAuthenticationPolicy(credential, scopes) {\n // This simple function encapsulates the entire process of reliably retrieving the token\n let getToken = createTokenCycler(credential, scopes);\n class StorageBearerTokenChallengeAuthenticationPolicy extends coreHttp.BaseRequestPolicy {\n constructor(nextPolicy, options) {\n super(nextPolicy, options);\n }\n async sendRequest(webResource) {\n if (!webResource.url.toLowerCase().startsWith(\"https://\")) {\n throw new Error(\"Bearer token authentication is not permitted for non-TLS protected (non-https) URLs.\");\n }\n const getTokenInternal = getToken;\n const token = (await getTokenInternal({\n abortSignal: webResource.abortSignal,\n tracingOptions: {\n tracingContext: webResource.tracingContext,\n },\n })).token;\n webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${token}`);\n const response = await this._nextPolicy.sendRequest(webResource);\n if ((response === null || response === void 0 ? void 0 : response.status) === 401) {\n const challenge = getChallenge(response);\n if (challenge) {\n const challengeInfo = parseChallenge(challenge);\n const challengeScopes = challengeInfo.resource_id + Constants.DefaultScope;\n const parsedAuthUri = coreHttp.URLBuilder.parse(challengeInfo.authorization_uri);\n const pathSegments = parsedAuthUri.getPath().split(\"/\");\n const tenantId = pathSegments[1];\n const getTokenForChallenge = createTokenCycler(credential, challengeScopes);\n const tokenForChallenge = (await getTokenForChallenge({\n abortSignal: webResource.abortSignal,\n tracingOptions: {\n tracingContext: webResource.tracingContext,\n },\n tenantId: tenantId,\n })).token;\n getToken = getTokenForChallenge;\n webResource.headers.set(Constants.HeaderConstants.AUTHORIZATION, `Bearer ${tokenForChallenge}`);\n return this._nextPolicy.sendRequest(webResource);\n }\n }\n return response;\n }\n }\n return {\n create: (nextPolicy, options) => {\n return new StorageBearerTokenChallengeAuthenticationPolicy(nextPolicy, options);\n },\n };\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A helper to decide if a given argument satisfies the Pipeline contract\n * @param pipeline - An argument that may be a Pipeline\n * @returns true when the argument satisfies the Pipeline contract\n */\nfunction isPipelineLike(pipeline) {\n if (!pipeline || typeof pipeline !== \"object\") {\n return false;\n }\n const castPipeline = pipeline;\n return (Array.isArray(castPipeline.factories) &&\n typeof castPipeline.options === \"object\" &&\n typeof castPipeline.toServiceClientOptions === \"function\");\n}\n/**\n * A Pipeline class containing HTTP request policies.\n * You can create a default Pipeline by calling {@link newPipeline}.\n * Or you can create a Pipeline with your own policies by the constructor of Pipeline.\n *\n * Refer to {@link newPipeline} and provided policies before implementing your\n * customized Pipeline.\n */\nclass Pipeline {\n /**\n * Creates an instance of Pipeline. Customize HTTPClient by implementing IHttpClient interface.\n *\n * @param factories -\n * @param options -\n */\n constructor(factories, options = {}) {\n this.factories = factories;\n // when options.httpClient is not specified, passing in a DefaultHttpClient instance to\n // avoid each client creating its own http client.\n this.options = Object.assign(Object.assign({}, options), { httpClient: options.httpClient || getCachedDefaultHttpClient() });\n }\n /**\n * Transfer Pipeline object to ServiceClientOptions object which is required by\n * ServiceClient constructor.\n *\n * @returns The ServiceClientOptions object from this Pipeline.\n */\n toServiceClientOptions() {\n return {\n httpClient: this.options.httpClient,\n requestPolicyFactories: this.factories,\n };\n }\n}\n/**\n * Creates a new Pipeline object with Credential provided.\n *\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n * @param pipelineOptions - Optional. Options.\n * @returns A new Pipeline object.\n */\nfunction newPipeline(credential, pipelineOptions = {}) {\n var _a;\n if (credential === undefined) {\n credential = new AnonymousCredential();\n }\n // Order is important. Closer to the API at the top & closer to the network at the bottom.\n // The credential's policy factory must appear close to the wire so it can sign any\n // changes made by other factories (like UniqueRequestIDPolicyFactory)\n const telemetryPolicy = new TelemetryPolicyFactory(pipelineOptions.userAgentOptions);\n const factories = [\n coreHttp.tracingPolicy({ userAgent: telemetryPolicy.telemetryString }),\n coreHttp.keepAlivePolicy(pipelineOptions.keepAliveOptions),\n telemetryPolicy,\n coreHttp.generateClientRequestIdPolicy(),\n new StorageBrowserPolicyFactory(),\n new StorageRetryPolicyFactory(pipelineOptions.retryOptions),\n // Default deserializationPolicy is provided by protocol layer\n // Use customized XML char key of \"#\" so we could deserialize metadata\n // with \"_\" key\n coreHttp.deserializationPolicy(undefined, { xmlCharKey: \"#\" }),\n coreHttp.logPolicy({\n logger: logger.info,\n allowedHeaderNames: StorageBlobLoggingAllowedHeaderNames,\n allowedQueryParameters: StorageBlobLoggingAllowedQueryParameters,\n }),\n ];\n if (coreHttp.isNode) {\n // policies only available in Node.js runtime, not in browsers\n factories.push(coreHttp.proxyPolicy(pipelineOptions.proxyOptions));\n factories.push(coreHttp.disableResponseDecompressionPolicy());\n }\n factories.push(coreHttp.isTokenCredential(credential)\n ? attachCredential(storageBearerTokenChallengeAuthenticationPolicy(credential, (_a = pipelineOptions.audience) !== null && _a !== void 0 ? _a : StorageOAuthScopes), credential)\n : credential);\n return new Pipeline(factories, pipelineOptions);\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * StorageSharedKeyCredentialPolicy is a policy used to sign HTTP request with a shared key.\n */\nclass StorageSharedKeyCredentialPolicy extends CredentialPolicy {\n /**\n * Creates an instance of StorageSharedKeyCredentialPolicy.\n * @param nextPolicy -\n * @param options -\n * @param factory -\n */\n constructor(nextPolicy, options, factory) {\n super(nextPolicy, options);\n this.factory = factory;\n }\n /**\n * Signs request.\n *\n * @param request -\n */\n signRequest(request) {\n request.headers.set(HeaderConstants.X_MS_DATE, new Date().toUTCString());\n if (request.body &&\n (typeof request.body === \"string\" || request.body !== undefined) &&\n request.body.length > 0) {\n request.headers.set(HeaderConstants.CONTENT_LENGTH, Buffer.byteLength(request.body));\n }\n const stringToSign = [\n request.method.toUpperCase(),\n this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LANGUAGE),\n this.getHeaderValueToSign(request, HeaderConstants.CONTENT_ENCODING),\n this.getHeaderValueToSign(request, HeaderConstants.CONTENT_LENGTH),\n this.getHeaderValueToSign(request, HeaderConstants.CONTENT_MD5),\n this.getHeaderValueToSign(request, HeaderConstants.CONTENT_TYPE),\n this.getHeaderValueToSign(request, HeaderConstants.DATE),\n this.getHeaderValueToSign(request, HeaderConstants.IF_MODIFIED_SINCE),\n this.getHeaderValueToSign(request, HeaderConstants.IF_MATCH),\n this.getHeaderValueToSign(request, HeaderConstants.IF_NONE_MATCH),\n this.getHeaderValueToSign(request, HeaderConstants.IF_UNMODIFIED_SINCE),\n this.getHeaderValueToSign(request, HeaderConstants.RANGE),\n ].join(\"\\n\") +\n \"\\n\" +\n this.getCanonicalizedHeadersString(request) +\n this.getCanonicalizedResourceString(request);\n const signature = this.factory.computeHMACSHA256(stringToSign);\n request.headers.set(HeaderConstants.AUTHORIZATION, `SharedKey ${this.factory.accountName}:${signature}`);\n // console.log(`[URL]:${request.url}`);\n // console.log(`[HEADERS]:${request.headers.toString()}`);\n // console.log(`[STRING TO SIGN]:${JSON.stringify(stringToSign)}`);\n // console.log(`[KEY]: ${request.headers.get(HeaderConstants.AUTHORIZATION)}`);\n return request;\n }\n /**\n * Retrieve header value according to shared key sign rules.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key\n *\n * @param request -\n * @param headerName -\n */\n getHeaderValueToSign(request, headerName) {\n const value = request.headers.get(headerName);\n if (!value) {\n return \"\";\n }\n // When using version 2015-02-21 or later, if Content-Length is zero, then\n // set the Content-Length part of the StringToSign to an empty string.\n // https://docs.microsoft.com/en-us/rest/api/storageservices/authenticate-with-shared-key\n if (headerName === HeaderConstants.CONTENT_LENGTH && value === \"0\") {\n return \"\";\n }\n return value;\n }\n /**\n * To construct the CanonicalizedHeaders portion of the signature string, follow these steps:\n * 1. Retrieve all headers for the resource that begin with x-ms-, including the x-ms-date header.\n * 2. Convert each HTTP header name to lowercase.\n * 3. Sort the headers lexicographically by header name, in ascending order.\n * Each header may appear only once in the string.\n * 4. Replace any linear whitespace in the header value with a single space.\n * 5. Trim any whitespace around the colon in the header.\n * 6. Finally, append a new-line character to each canonicalized header in the resulting list.\n * Construct the CanonicalizedHeaders string by concatenating all headers in this list into a single string.\n *\n * @param request -\n */\n getCanonicalizedHeadersString(request) {\n let headersArray = request.headers.headersArray().filter((value) => {\n return value.name.toLowerCase().startsWith(HeaderConstants.PREFIX_FOR_STORAGE);\n });\n headersArray.sort((a, b) => {\n return a.name.toLowerCase().localeCompare(b.name.toLowerCase());\n });\n // Remove duplicate headers\n headersArray = headersArray.filter((value, index, array) => {\n if (index > 0 && value.name.toLowerCase() === array[index - 1].name.toLowerCase()) {\n return false;\n }\n return true;\n });\n let canonicalizedHeadersStringToSign = \"\";\n headersArray.forEach((header) => {\n canonicalizedHeadersStringToSign += `${header.name\n .toLowerCase()\n .trimRight()}:${header.value.trimLeft()}\\n`;\n });\n return canonicalizedHeadersStringToSign;\n }\n /**\n * Retrieves the webResource canonicalized resource string.\n *\n * @param request -\n */\n getCanonicalizedResourceString(request) {\n const path = getURLPath(request.url) || \"/\";\n let canonicalizedResourceString = \"\";\n canonicalizedResourceString += `/${this.factory.accountName}${path}`;\n const queries = getURLQueries(request.url);\n const lowercaseQueries = {};\n if (queries) {\n const queryKeys = [];\n for (const key in queries) {\n if (Object.prototype.hasOwnProperty.call(queries, key)) {\n const lowercaseKey = key.toLowerCase();\n lowercaseQueries[lowercaseKey] = queries[key];\n queryKeys.push(lowercaseKey);\n }\n }\n queryKeys.sort();\n for (const key of queryKeys) {\n canonicalizedResourceString += `\\n${key}:${decodeURIComponent(lowercaseQueries[key])}`;\n }\n }\n return canonicalizedResourceString;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * StorageSharedKeyCredential for account key authorization of Azure Storage service.\n */\nclass StorageSharedKeyCredential extends Credential {\n /**\n * Creates an instance of StorageSharedKeyCredential.\n * @param accountName -\n * @param accountKey -\n */\n constructor(accountName, accountKey) {\n super();\n this.accountName = accountName;\n this.accountKey = Buffer.from(accountKey, \"base64\");\n }\n /**\n * Creates a StorageSharedKeyCredentialPolicy object.\n *\n * @param nextPolicy -\n * @param options -\n */\n create(nextPolicy, options) {\n return new StorageSharedKeyCredentialPolicy(nextPolicy, options, this);\n }\n /**\n * Generates a hash signature for an HTTP request or for a SAS.\n *\n * @param stringToSign -\n */\n computeHMACSHA256(stringToSign) {\n return crypto.createHmac(\"sha256\", this.accountKey).update(stringToSign, \"utf8\").digest(\"base64\");\n }\n}\n\n/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\nconst packageName = \"azure-storage-blob\";\nconst packageVersion = \"12.15.0\";\nclass StorageClientContext extends coreHttp__namespace.ServiceClient {\n /**\n * Initializes a new instance of the StorageClientContext class.\n * @param url The URL of the service account, container, or blob that is the target of the desired\n * operation.\n * @param options The parameter options\n */\n constructor(url, options) {\n if (url === undefined) {\n throw new Error(\"'url' cannot be null\");\n }\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n if (!options.userAgent) {\n const defaultUserAgent = coreHttp__namespace.getDefaultUserAgentValue();\n options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;\n }\n super(undefined, options);\n this.requestContentType = \"application/json; charset=utf-8\";\n this.baseUri = options.endpoint || \"{url}\";\n // Parameter assignments\n this.url = url;\n // Assigning values to Constant parameters\n this.version = options.version || \"2023-01-03\";\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A StorageClient represents a based URL class for {@link BlobServiceClient}, {@link ContainerClient}\n * and etc.\n */\nclass StorageClient {\n /**\n * Creates an instance of StorageClient.\n * @param url - url to resource\n * @param pipeline - request policy pipeline.\n */\n constructor(url, pipeline) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.accountName = getAccountNameFromUrl(url);\n this.pipeline = pipeline;\n this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions());\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n this.credential = new AnonymousCredential();\n for (const factory of this.pipeline.factories) {\n if ((coreHttp.isNode && factory instanceof StorageSharedKeyCredential) ||\n factory instanceof AnonymousCredential) {\n this.credential = factory;\n }\n else if (coreHttp.isTokenCredential(factory.credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n this.credential = factory.credential;\n }\n }\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext;\n storageClientContext.requestContentType = undefined;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Creates a span using the global tracer.\n * @internal\n */\nconst createSpan = coreTracing.createSpanFunction({\n packagePrefix: \"Azure.Storage.Blob\",\n namespace: \"Microsoft.Storage\",\n});\n/**\n * @internal\n *\n * Adapt the tracing options from OperationOptions to what they need to be for\n * RequestOptionsBase (when we update to later OpenTelemetry versions this is now\n * two separate fields, not just one).\n */\nfunction convertTracingToRequestOptionsBase(options) {\n var _a, _b;\n return {\n // By passing spanOptions if they exist at runtime, we're backwards compatible with @azure/core-tracing@preview.13 and earlier.\n spanOptions: (_a = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _a === void 0 ? void 0 : _a.spanOptions,\n tracingContext: (_b = options === null || options === void 0 ? void 0 : options.tracingOptions) === null || _b === void 0 ? void 0 : _b.tracingContext,\n };\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a blob. Setting\n * a value to true means that any SAS which uses these permissions will grant permissions for that operation. Once all\n * the values are set, this should be serialized with toString and set as the permissions field on a\n * {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nclass BlobSASPermissions {\n constructor() {\n /**\n * Specifies Read access granted.\n */\n this.read = false;\n /**\n * Specifies Add access granted.\n */\n this.add = false;\n /**\n * Specifies Create access granted.\n */\n this.create = false;\n /**\n * Specifies Write access granted.\n */\n this.write = false;\n /**\n * Specifies Delete access granted.\n */\n this.delete = false;\n /**\n * Specifies Delete version access granted.\n */\n this.deleteVersion = false;\n /**\n * Specfies Tag access granted.\n */\n this.tag = false;\n /**\n * Specifies Move access granted.\n */\n this.move = false;\n /**\n * Specifies Execute access granted.\n */\n this.execute = false;\n /**\n * Specifies SetImmutabilityPolicy access granted.\n */\n this.setImmutabilityPolicy = false;\n /**\n * Specifies that Permanent Delete is permitted.\n */\n this.permanentDelete = false;\n }\n /**\n * Creates a {@link BlobSASPermissions} from the specified permissions string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid permission.\n *\n * @param permissions -\n */\n static parse(permissions) {\n const blobSASPermissions = new BlobSASPermissions();\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n blobSASPermissions.read = true;\n break;\n case \"a\":\n blobSASPermissions.add = true;\n break;\n case \"c\":\n blobSASPermissions.create = true;\n break;\n case \"w\":\n blobSASPermissions.write = true;\n break;\n case \"d\":\n blobSASPermissions.delete = true;\n break;\n case \"x\":\n blobSASPermissions.deleteVersion = true;\n break;\n case \"t\":\n blobSASPermissions.tag = true;\n break;\n case \"m\":\n blobSASPermissions.move = true;\n break;\n case \"e\":\n blobSASPermissions.execute = true;\n break;\n case \"i\":\n blobSASPermissions.setImmutabilityPolicy = true;\n break;\n case \"y\":\n blobSASPermissions.permanentDelete = true;\n break;\n default:\n throw new RangeError(`Invalid permission: ${char}`);\n }\n }\n return blobSASPermissions;\n }\n /**\n * Creates a {@link BlobSASPermissions} from a raw object which contains same keys as it\n * and boolean values for them.\n *\n * @param permissionLike -\n */\n static from(permissionLike) {\n const blobSASPermissions = new BlobSASPermissions();\n if (permissionLike.read) {\n blobSASPermissions.read = true;\n }\n if (permissionLike.add) {\n blobSASPermissions.add = true;\n }\n if (permissionLike.create) {\n blobSASPermissions.create = true;\n }\n if (permissionLike.write) {\n blobSASPermissions.write = true;\n }\n if (permissionLike.delete) {\n blobSASPermissions.delete = true;\n }\n if (permissionLike.deleteVersion) {\n blobSASPermissions.deleteVersion = true;\n }\n if (permissionLike.tag) {\n blobSASPermissions.tag = true;\n }\n if (permissionLike.move) {\n blobSASPermissions.move = true;\n }\n if (permissionLike.execute) {\n blobSASPermissions.execute = true;\n }\n if (permissionLike.setImmutabilityPolicy) {\n blobSASPermissions.setImmutabilityPolicy = true;\n }\n if (permissionLike.permanentDelete) {\n blobSASPermissions.permanentDelete = true;\n }\n return blobSASPermissions;\n }\n /**\n * Converts the given permissions to a string. Using this method will guarantee the permissions are in an\n * order accepted by the service.\n *\n * @returns A string which represents the BlobSASPermissions\n */\n toString() {\n const permissions = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.add) {\n permissions.push(\"a\");\n }\n if (this.create) {\n permissions.push(\"c\");\n }\n if (this.write) {\n permissions.push(\"w\");\n }\n if (this.delete) {\n permissions.push(\"d\");\n }\n if (this.deleteVersion) {\n permissions.push(\"x\");\n }\n if (this.tag) {\n permissions.push(\"t\");\n }\n if (this.move) {\n permissions.push(\"m\");\n }\n if (this.execute) {\n permissions.push(\"e\");\n }\n if (this.setImmutabilityPolicy) {\n permissions.push(\"i\");\n }\n if (this.permanentDelete) {\n permissions.push(\"y\");\n }\n return permissions.join(\"\");\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * This is a helper class to construct a string representing the permissions granted by a ServiceSAS to a container.\n * Setting a value to true means that any SAS which uses these permissions will grant permissions for that operation.\n * Once all the values are set, this should be serialized with toString and set as the permissions field on a\n * {@link BlobSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nclass ContainerSASPermissions {\n constructor() {\n /**\n * Specifies Read access granted.\n */\n this.read = false;\n /**\n * Specifies Add access granted.\n */\n this.add = false;\n /**\n * Specifies Create access granted.\n */\n this.create = false;\n /**\n * Specifies Write access granted.\n */\n this.write = false;\n /**\n * Specifies Delete access granted.\n */\n this.delete = false;\n /**\n * Specifies Delete version access granted.\n */\n this.deleteVersion = false;\n /**\n * Specifies List access granted.\n */\n this.list = false;\n /**\n * Specfies Tag access granted.\n */\n this.tag = false;\n /**\n * Specifies Move access granted.\n */\n this.move = false;\n /**\n * Specifies Execute access granted.\n */\n this.execute = false;\n /**\n * Specifies SetImmutabilityPolicy access granted.\n */\n this.setImmutabilityPolicy = false;\n /**\n * Specifies that Permanent Delete is permitted.\n */\n this.permanentDelete = false;\n /**\n * Specifies that Filter Blobs by Tags is permitted.\n */\n this.filterByTags = false;\n }\n /**\n * Creates an {@link ContainerSASPermissions} from the specified permissions string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid permission.\n *\n * @param permissions -\n */\n static parse(permissions) {\n const containerSASPermissions = new ContainerSASPermissions();\n for (const char of permissions) {\n switch (char) {\n case \"r\":\n containerSASPermissions.read = true;\n break;\n case \"a\":\n containerSASPermissions.add = true;\n break;\n case \"c\":\n containerSASPermissions.create = true;\n break;\n case \"w\":\n containerSASPermissions.write = true;\n break;\n case \"d\":\n containerSASPermissions.delete = true;\n break;\n case \"l\":\n containerSASPermissions.list = true;\n break;\n case \"t\":\n containerSASPermissions.tag = true;\n break;\n case \"x\":\n containerSASPermissions.deleteVersion = true;\n break;\n case \"m\":\n containerSASPermissions.move = true;\n break;\n case \"e\":\n containerSASPermissions.execute = true;\n break;\n case \"i\":\n containerSASPermissions.setImmutabilityPolicy = true;\n break;\n case \"y\":\n containerSASPermissions.permanentDelete = true;\n break;\n case \"f\":\n containerSASPermissions.filterByTags = true;\n break;\n default:\n throw new RangeError(`Invalid permission ${char}`);\n }\n }\n return containerSASPermissions;\n }\n /**\n * Creates a {@link ContainerSASPermissions} from a raw object which contains same keys as it\n * and boolean values for them.\n *\n * @param permissionLike -\n */\n static from(permissionLike) {\n const containerSASPermissions = new ContainerSASPermissions();\n if (permissionLike.read) {\n containerSASPermissions.read = true;\n }\n if (permissionLike.add) {\n containerSASPermissions.add = true;\n }\n if (permissionLike.create) {\n containerSASPermissions.create = true;\n }\n if (permissionLike.write) {\n containerSASPermissions.write = true;\n }\n if (permissionLike.delete) {\n containerSASPermissions.delete = true;\n }\n if (permissionLike.list) {\n containerSASPermissions.list = true;\n }\n if (permissionLike.deleteVersion) {\n containerSASPermissions.deleteVersion = true;\n }\n if (permissionLike.tag) {\n containerSASPermissions.tag = true;\n }\n if (permissionLike.move) {\n containerSASPermissions.move = true;\n }\n if (permissionLike.execute) {\n containerSASPermissions.execute = true;\n }\n if (permissionLike.setImmutabilityPolicy) {\n containerSASPermissions.setImmutabilityPolicy = true;\n }\n if (permissionLike.permanentDelete) {\n containerSASPermissions.permanentDelete = true;\n }\n if (permissionLike.filterByTags) {\n containerSASPermissions.filterByTags = true;\n }\n return containerSASPermissions;\n }\n /**\n * Converts the given permissions to a string. Using this method will guarantee the permissions are in an\n * order accepted by the service.\n *\n * The order of the characters should be as specified here to ensure correctness.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n */\n toString() {\n const permissions = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.add) {\n permissions.push(\"a\");\n }\n if (this.create) {\n permissions.push(\"c\");\n }\n if (this.write) {\n permissions.push(\"w\");\n }\n if (this.delete) {\n permissions.push(\"d\");\n }\n if (this.deleteVersion) {\n permissions.push(\"x\");\n }\n if (this.list) {\n permissions.push(\"l\");\n }\n if (this.tag) {\n permissions.push(\"t\");\n }\n if (this.move) {\n permissions.push(\"m\");\n }\n if (this.execute) {\n permissions.push(\"e\");\n }\n if (this.setImmutabilityPolicy) {\n permissions.push(\"i\");\n }\n if (this.permanentDelete) {\n permissions.push(\"y\");\n }\n if (this.filterByTags) {\n permissions.push(\"f\");\n }\n return permissions.join(\"\");\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * UserDelegationKeyCredential is only used for generation of user delegation SAS.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas\n */\nclass UserDelegationKeyCredential {\n /**\n * Creates an instance of UserDelegationKeyCredential.\n * @param accountName -\n * @param userDelegationKey -\n */\n constructor(accountName, userDelegationKey) {\n this.accountName = accountName;\n this.userDelegationKey = userDelegationKey;\n this.key = Buffer.from(userDelegationKey.value, \"base64\");\n }\n /**\n * Generates a hash signature for an HTTP request or for a SAS.\n *\n * @param stringToSign -\n */\n computeHMACSHA256(stringToSign) {\n // console.log(`stringToSign: ${JSON.stringify(stringToSign)}`);\n return crypto.createHmac(\"sha256\", this.key).update(stringToSign, \"utf8\").digest(\"base64\");\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Generate SasIPRange format string. For example:\n *\n * \"8.8.8.8\" or \"1.1.1.1-255.255.255.255\"\n *\n * @param ipRange -\n */\nfunction ipRangeToString(ipRange) {\n return ipRange.end ? `${ipRange.start}-${ipRange.end}` : ipRange.start;\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Protocols for generated SAS.\n */\nexports.SASProtocol = void 0;\n(function (SASProtocol) {\n /**\n * Protocol that allows HTTPS only\n */\n SASProtocol[\"Https\"] = \"https\";\n /**\n * Protocol that allows both HTTPS and HTTP\n */\n SASProtocol[\"HttpsAndHttp\"] = \"https,http\";\n})(exports.SASProtocol || (exports.SASProtocol = {}));\n/**\n * Represents the components that make up an Azure Storage SAS' query parameters. This type is not constructed directly\n * by the user; it is only generated by the {@link AccountSASSignatureValues} and {@link BlobSASSignatureValues}\n * types. Once generated, it can be encoded into a {@link String} and appended to a URL directly (though caution should\n * be taken here in case there are existing query parameters, which might affect the appropriate means of appending\n * these query parameters).\n *\n * NOTE: Instances of this class are immutable.\n */\nclass SASQueryParameters {\n constructor(version, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope) {\n this.version = version;\n this.signature = signature;\n if (permissionsOrOptions !== undefined && typeof permissionsOrOptions !== \"string\") {\n // SASQueryParametersOptions\n this.permissions = permissionsOrOptions.permissions;\n this.services = permissionsOrOptions.services;\n this.resourceTypes = permissionsOrOptions.resourceTypes;\n this.protocol = permissionsOrOptions.protocol;\n this.startsOn = permissionsOrOptions.startsOn;\n this.expiresOn = permissionsOrOptions.expiresOn;\n this.ipRangeInner = permissionsOrOptions.ipRange;\n this.identifier = permissionsOrOptions.identifier;\n this.encryptionScope = permissionsOrOptions.encryptionScope;\n this.resource = permissionsOrOptions.resource;\n this.cacheControl = permissionsOrOptions.cacheControl;\n this.contentDisposition = permissionsOrOptions.contentDisposition;\n this.contentEncoding = permissionsOrOptions.contentEncoding;\n this.contentLanguage = permissionsOrOptions.contentLanguage;\n this.contentType = permissionsOrOptions.contentType;\n if (permissionsOrOptions.userDelegationKey) {\n this.signedOid = permissionsOrOptions.userDelegationKey.signedObjectId;\n this.signedTenantId = permissionsOrOptions.userDelegationKey.signedTenantId;\n this.signedStartsOn = permissionsOrOptions.userDelegationKey.signedStartsOn;\n this.signedExpiresOn = permissionsOrOptions.userDelegationKey.signedExpiresOn;\n this.signedService = permissionsOrOptions.userDelegationKey.signedService;\n this.signedVersion = permissionsOrOptions.userDelegationKey.signedVersion;\n this.preauthorizedAgentObjectId = permissionsOrOptions.preauthorizedAgentObjectId;\n this.correlationId = permissionsOrOptions.correlationId;\n }\n }\n else {\n this.services = services;\n this.resourceTypes = resourceTypes;\n this.expiresOn = expiresOn;\n this.permissions = permissionsOrOptions;\n this.protocol = protocol;\n this.startsOn = startsOn;\n this.ipRangeInner = ipRange;\n this.encryptionScope = encryptionScope;\n this.identifier = identifier;\n this.resource = resource;\n this.cacheControl = cacheControl;\n this.contentDisposition = contentDisposition;\n this.contentEncoding = contentEncoding;\n this.contentLanguage = contentLanguage;\n this.contentType = contentType;\n if (userDelegationKey) {\n this.signedOid = userDelegationKey.signedObjectId;\n this.signedTenantId = userDelegationKey.signedTenantId;\n this.signedStartsOn = userDelegationKey.signedStartsOn;\n this.signedExpiresOn = userDelegationKey.signedExpiresOn;\n this.signedService = userDelegationKey.signedService;\n this.signedVersion = userDelegationKey.signedVersion;\n this.preauthorizedAgentObjectId = preauthorizedAgentObjectId;\n this.correlationId = correlationId;\n }\n }\n }\n /**\n * Optional. IP range allowed for this SAS.\n *\n * @readonly\n */\n get ipRange() {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }\n /**\n * Encodes all SAS query parameters into a string that can be appended to a URL.\n *\n */\n toString() {\n const params = [\n \"sv\",\n \"ss\",\n \"srt\",\n \"spr\",\n \"st\",\n \"se\",\n \"sip\",\n \"si\",\n \"ses\",\n \"skoid\",\n \"sktid\",\n \"skt\",\n \"ske\",\n \"sks\",\n \"skv\",\n \"sr\",\n \"sp\",\n \"sig\",\n \"rscc\",\n \"rscd\",\n \"rsce\",\n \"rscl\",\n \"rsct\",\n \"saoid\",\n \"scid\",\n ];\n const queries = [];\n for (const param of params) {\n switch (param) {\n case \"sv\":\n this.tryAppendQueryParameter(queries, param, this.version);\n break;\n case \"ss\":\n this.tryAppendQueryParameter(queries, param, this.services);\n break;\n case \"srt\":\n this.tryAppendQueryParameter(queries, param, this.resourceTypes);\n break;\n case \"spr\":\n this.tryAppendQueryParameter(queries, param, this.protocol);\n break;\n case \"st\":\n this.tryAppendQueryParameter(queries, param, this.startsOn ? truncatedISO8061Date(this.startsOn, false) : undefined);\n break;\n case \"se\":\n this.tryAppendQueryParameter(queries, param, this.expiresOn ? truncatedISO8061Date(this.expiresOn, false) : undefined);\n break;\n case \"sip\":\n this.tryAppendQueryParameter(queries, param, this.ipRange ? ipRangeToString(this.ipRange) : undefined);\n break;\n case \"si\":\n this.tryAppendQueryParameter(queries, param, this.identifier);\n break;\n case \"ses\":\n this.tryAppendQueryParameter(queries, param, this.encryptionScope);\n break;\n case \"skoid\": // Signed object ID\n this.tryAppendQueryParameter(queries, param, this.signedOid);\n break;\n case \"sktid\": // Signed tenant ID\n this.tryAppendQueryParameter(queries, param, this.signedTenantId);\n break;\n case \"skt\": // Signed key start time\n this.tryAppendQueryParameter(queries, param, this.signedStartsOn ? truncatedISO8061Date(this.signedStartsOn, false) : undefined);\n break;\n case \"ske\": // Signed key expiry time\n this.tryAppendQueryParameter(queries, param, this.signedExpiresOn ? truncatedISO8061Date(this.signedExpiresOn, false) : undefined);\n break;\n case \"sks\": // Signed key service\n this.tryAppendQueryParameter(queries, param, this.signedService);\n break;\n case \"skv\": // Signed key version\n this.tryAppendQueryParameter(queries, param, this.signedVersion);\n break;\n case \"sr\":\n this.tryAppendQueryParameter(queries, param, this.resource);\n break;\n case \"sp\":\n this.tryAppendQueryParameter(queries, param, this.permissions);\n break;\n case \"sig\":\n this.tryAppendQueryParameter(queries, param, this.signature);\n break;\n case \"rscc\":\n this.tryAppendQueryParameter(queries, param, this.cacheControl);\n break;\n case \"rscd\":\n this.tryAppendQueryParameter(queries, param, this.contentDisposition);\n break;\n case \"rsce\":\n this.tryAppendQueryParameter(queries, param, this.contentEncoding);\n break;\n case \"rscl\":\n this.tryAppendQueryParameter(queries, param, this.contentLanguage);\n break;\n case \"rsct\":\n this.tryAppendQueryParameter(queries, param, this.contentType);\n break;\n case \"saoid\":\n this.tryAppendQueryParameter(queries, param, this.preauthorizedAgentObjectId);\n break;\n case \"scid\":\n this.tryAppendQueryParameter(queries, param, this.correlationId);\n break;\n }\n }\n return queries.join(\"&\");\n }\n /**\n * A private helper method used to filter and append query key/value pairs into an array.\n *\n * @param queries -\n * @param key -\n * @param value -\n */\n tryAppendQueryParameter(queries, key, value) {\n if (!value) {\n return;\n }\n key = encodeURIComponent(key);\n value = encodeURIComponent(value);\n if (key.length > 0 && value.length > 0) {\n queries.push(`${key}=${value}`);\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nfunction generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) {\n const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;\n const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential\n ? sharedKeyCredentialOrUserDelegationKey\n : undefined;\n let userDelegationKeyCredential;\n if (sharedKeyCredential === undefined && accountName !== undefined) {\n userDelegationKeyCredential = new UserDelegationKeyCredential(accountName, sharedKeyCredentialOrUserDelegationKey);\n }\n if (sharedKeyCredential === undefined && userDelegationKeyCredential === undefined) {\n throw TypeError(\"Invalid sharedKeyCredential, userDelegationKey or accountName.\");\n }\n // Version 2020-12-06 adds support for encryptionscope in SAS.\n if (version >= \"2020-12-06\") {\n if (sharedKeyCredential !== undefined) {\n return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential);\n }\n else {\n return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential);\n }\n }\n // Version 2019-12-12 adds support for the blob tags permission.\n // Version 2018-11-09 adds support for the signed resource and signed blob snapshot time fields.\n // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas#constructing-the-signature-string\n if (version >= \"2018-11-09\") {\n if (sharedKeyCredential !== undefined) {\n return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential);\n }\n else {\n // Version 2020-02-10 delegation SAS signature construction includes preauthorizedAgentObjectId, agentObjectId, correlationId.\n if (version >= \"2020-02-10\") {\n return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential);\n }\n else {\n return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential);\n }\n }\n }\n if (version >= \"2015-04-05\") {\n if (sharedKeyCredential !== undefined) {\n return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential);\n }\n else {\n throw new RangeError(\"'version' must be >= '2018-11-09' when generating user delegation SAS using user delegation key.\");\n }\n }\n throw new RangeError(\"'version' must be >= '2015-04-05'.\");\n}\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n * IMPLEMENTATION FOR API VERSION FROM 2015-04-05 AND BEFORE 2018-11-09.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn and identifier.\n *\n * WARNING: When identifier is not provided, permissions and expiresOn are required.\n * You MUST assign value to identifier or expiresOn & permissions manually if you initial with\n * this constructor.\n *\n * @param blobSASSignatureValues -\n * @param sharedKeyCredential -\n */\nfunction generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n if (!blobSASSignatureValues.identifier &&\n !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.\");\n }\n let resource = \"c\";\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n blobSASSignatureValues.identifier,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : \"\",\n blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : \"\",\n blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : \"\",\n blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : \"\",\n blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : \"\",\n ].join(\"\\n\");\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType);\n}\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n * IMPLEMENTATION FOR API VERSION FROM 2018-11-09.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn and identifier.\n *\n * WARNING: When identifier is not provided, permissions and expiresOn are required.\n * You MUST assign value to identifier or expiresOn & permissions manually if you initial with\n * this constructor.\n *\n * @param blobSASSignatureValues -\n * @param sharedKeyCredential -\n */\nfunction generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n if (!blobSASSignatureValues.identifier &&\n !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n blobSASSignatureValues.identifier,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : \"\",\n blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : \"\",\n blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : \"\",\n blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : \"\",\n blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : \"\",\n ].join(\"\\n\");\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType);\n}\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n * IMPLEMENTATION FOR API VERSION FROM 2020-12-06.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn and identifier.\n *\n * WARNING: When identifier is not provided, permissions and expiresOn are required.\n * You MUST assign value to identifier or expiresOn & permissions manually if you initial with\n * this constructor.\n *\n * @param blobSASSignatureValues -\n * @param sharedKeyCredential -\n */\nfunction generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n if (!blobSASSignatureValues.identifier &&\n !(blobSASSignatureValues.permissions && blobSASSignatureValues.expiresOn)) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when 'identifier' is not provided.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(sharedKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n blobSASSignatureValues.identifier,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.encryptionScope,\n blobSASSignatureValues.cacheControl ? blobSASSignatureValues.cacheControl : \"\",\n blobSASSignatureValues.contentDisposition ? blobSASSignatureValues.contentDisposition : \"\",\n blobSASSignatureValues.contentEncoding ? blobSASSignatureValues.contentEncoding : \"\",\n blobSASSignatureValues.contentLanguage ? blobSASSignatureValues.contentLanguage : \"\",\n blobSASSignatureValues.contentType ? blobSASSignatureValues.contentType : \"\",\n ].join(\"\\n\");\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, undefined, undefined, undefined, blobSASSignatureValues.encryptionScope);\n}\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n * IMPLEMENTATION FOR API VERSION FROM 2018-11-09.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn.\n *\n * WARNING: identifier will be ignored, permissions and expiresOn are required.\n *\n * @param blobSASSignatureValues -\n * @param userDelegationKeyCredential -\n */\nfunction generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n // Stored access policies are not supported for a user delegation SAS.\n if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n userDelegationKeyCredential.userDelegationKey.signedObjectId,\n userDelegationKeyCredential.userDelegationKey.signedTenantId,\n userDelegationKeyCredential.userDelegationKey.signedStartsOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedExpiresOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedService,\n userDelegationKeyCredential.userDelegationKey.signedVersion,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.cacheControl,\n blobSASSignatureValues.contentDisposition,\n blobSASSignatureValues.contentEncoding,\n blobSASSignatureValues.contentLanguage,\n blobSASSignatureValues.contentType,\n ].join(\"\\n\");\n const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey);\n}\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n * IMPLEMENTATION FOR API VERSION FROM 2020-02-10.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn.\n *\n * WARNING: identifier will be ignored, permissions and expiresOn are required.\n *\n * @param blobSASSignatureValues -\n * @param userDelegationKeyCredential -\n */\nfunction generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n // Stored access policies are not supported for a user delegation SAS.\n if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n userDelegationKeyCredential.userDelegationKey.signedObjectId,\n userDelegationKeyCredential.userDelegationKey.signedTenantId,\n userDelegationKeyCredential.userDelegationKey.signedStartsOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedExpiresOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedService,\n userDelegationKeyCredential.userDelegationKey.signedVersion,\n blobSASSignatureValues.preauthorizedAgentObjectId,\n undefined,\n blobSASSignatureValues.correlationId,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.cacheControl,\n blobSASSignatureValues.contentDisposition,\n blobSASSignatureValues.contentEncoding,\n blobSASSignatureValues.contentLanguage,\n blobSASSignatureValues.contentType,\n ].join(\"\\n\");\n const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId);\n}\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n * IMPLEMENTATION FOR API VERSION FROM 2020-12-06.\n *\n * Creates an instance of SASQueryParameters.\n *\n * Only accepts required settings needed to create a SAS. For optional settings please\n * set corresponding properties directly, such as permissions, startsOn.\n *\n * WARNING: identifier will be ignored, permissions and expiresOn are required.\n *\n * @param blobSASSignatureValues -\n * @param userDelegationKeyCredential -\n */\nfunction generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential) {\n blobSASSignatureValues = SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues);\n // Stored access policies are not supported for a user delegation SAS.\n if (!blobSASSignatureValues.permissions || !blobSASSignatureValues.expiresOn) {\n throw new RangeError(\"Must provide 'permissions' and 'expiresOn' for Blob SAS generation when generating user delegation SAS.\");\n }\n let resource = \"c\";\n let timestamp = blobSASSignatureValues.snapshotTime;\n if (blobSASSignatureValues.blobName) {\n resource = \"b\";\n if (blobSASSignatureValues.snapshotTime) {\n resource = \"bs\";\n }\n else if (blobSASSignatureValues.versionId) {\n resource = \"bv\";\n timestamp = blobSASSignatureValues.versionId;\n }\n }\n // Calling parse and toString guarantees the proper ordering and throws on invalid characters.\n let verifiedPermissions;\n if (blobSASSignatureValues.permissions) {\n if (blobSASSignatureValues.blobName) {\n verifiedPermissions = BlobSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n else {\n verifiedPermissions = ContainerSASPermissions.parse(blobSASSignatureValues.permissions.toString()).toString();\n }\n }\n // Signature is generated on the un-url-encoded values.\n const stringToSign = [\n verifiedPermissions ? verifiedPermissions : \"\",\n blobSASSignatureValues.startsOn\n ? truncatedISO8061Date(blobSASSignatureValues.startsOn, false)\n : \"\",\n blobSASSignatureValues.expiresOn\n ? truncatedISO8061Date(blobSASSignatureValues.expiresOn, false)\n : \"\",\n getCanonicalName(userDelegationKeyCredential.accountName, blobSASSignatureValues.containerName, blobSASSignatureValues.blobName),\n userDelegationKeyCredential.userDelegationKey.signedObjectId,\n userDelegationKeyCredential.userDelegationKey.signedTenantId,\n userDelegationKeyCredential.userDelegationKey.signedStartsOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedStartsOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedExpiresOn\n ? truncatedISO8061Date(userDelegationKeyCredential.userDelegationKey.signedExpiresOn, false)\n : \"\",\n userDelegationKeyCredential.userDelegationKey.signedService,\n userDelegationKeyCredential.userDelegationKey.signedVersion,\n blobSASSignatureValues.preauthorizedAgentObjectId,\n undefined,\n blobSASSignatureValues.correlationId,\n blobSASSignatureValues.ipRange ? ipRangeToString(blobSASSignatureValues.ipRange) : \"\",\n blobSASSignatureValues.protocol ? blobSASSignatureValues.protocol : \"\",\n blobSASSignatureValues.version,\n resource,\n timestamp,\n blobSASSignatureValues.encryptionScope,\n blobSASSignatureValues.cacheControl,\n blobSASSignatureValues.contentDisposition,\n blobSASSignatureValues.contentEncoding,\n blobSASSignatureValues.contentLanguage,\n blobSASSignatureValues.contentType,\n ].join(\"\\n\");\n const signature = userDelegationKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(blobSASSignatureValues.version, signature, verifiedPermissions, undefined, undefined, blobSASSignatureValues.protocol, blobSASSignatureValues.startsOn, blobSASSignatureValues.expiresOn, blobSASSignatureValues.ipRange, blobSASSignatureValues.identifier, resource, blobSASSignatureValues.cacheControl, blobSASSignatureValues.contentDisposition, blobSASSignatureValues.contentEncoding, blobSASSignatureValues.contentLanguage, blobSASSignatureValues.contentType, userDelegationKeyCredential.userDelegationKey, blobSASSignatureValues.preauthorizedAgentObjectId, blobSASSignatureValues.correlationId, blobSASSignatureValues.encryptionScope);\n}\nfunction getCanonicalName(accountName, containerName, blobName) {\n // Container: \"/blob/account/containerName\"\n // Blob: \"/blob/account/containerName/blobName\"\n const elements = [`/blob/${accountName}/${containerName}`];\n if (blobName) {\n elements.push(`/${blobName}`);\n }\n return elements.join(\"\");\n}\nfunction SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) {\n const version = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION;\n if (blobSASSignatureValues.snapshotTime && version < \"2018-11-09\") {\n throw RangeError(\"'version' must be >= '2018-11-09' when providing 'snapshotTime'.\");\n }\n if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.snapshotTime) {\n throw RangeError(\"Must provide 'blobName' when providing 'snapshotTime'.\");\n }\n if (blobSASSignatureValues.versionId && version < \"2019-10-10\") {\n throw RangeError(\"'version' must be >= '2019-10-10' when providing 'versionId'.\");\n }\n if (blobSASSignatureValues.blobName === undefined && blobSASSignatureValues.versionId) {\n throw RangeError(\"Must provide 'blobName' when providing 'versionId'.\");\n }\n if (blobSASSignatureValues.permissions &&\n blobSASSignatureValues.permissions.setImmutabilityPolicy &&\n version < \"2020-08-04\") {\n throw RangeError(\"'version' must be >= '2020-08-04' when provided 'i' permission.\");\n }\n if (blobSASSignatureValues.permissions &&\n blobSASSignatureValues.permissions.deleteVersion &&\n version < \"2019-10-10\") {\n throw RangeError(\"'version' must be >= '2019-10-10' when providing 'x' permission.\");\n }\n if (blobSASSignatureValues.permissions &&\n blobSASSignatureValues.permissions.permanentDelete &&\n version < \"2019-10-10\") {\n throw RangeError(\"'version' must be >= '2019-10-10' when providing 'y' permission.\");\n }\n if (blobSASSignatureValues.permissions &&\n blobSASSignatureValues.permissions.tag &&\n version < \"2019-12-12\") {\n throw RangeError(\"'version' must be >= '2019-12-12' when providing 't' permission.\");\n }\n if (version < \"2020-02-10\" &&\n blobSASSignatureValues.permissions &&\n (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) {\n throw RangeError(\"'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission.\");\n }\n if (version < \"2021-04-10\" &&\n blobSASSignatureValues.permissions &&\n blobSASSignatureValues.permissions.filterByTags) {\n throw RangeError(\"'version' must be >= '2021-04-10' when providing the 'f' permission.\");\n }\n if (version < \"2020-02-10\" &&\n (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) {\n throw RangeError(\"'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'.\");\n }\n if (blobSASSignatureValues.encryptionScope && version < \"2020-12-06\") {\n throw RangeError(\"'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.\");\n }\n blobSASSignatureValues.version = version;\n return blobSASSignatureValues;\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A client that manages leases for a {@link ContainerClient} or a {@link BlobClient}.\n */\nclass BlobLeaseClient {\n /**\n * Creates an instance of BlobLeaseClient.\n * @param client - The client to make the lease operation requests.\n * @param leaseId - Initial proposed lease id.\n */\n constructor(client, leaseId) {\n const clientContext = new StorageClientContext(client.url, client.pipeline.toServiceClientOptions());\n this._url = client.url;\n if (client.name === undefined) {\n this._isContainer = true;\n this._containerOrBlobOperation = new Container(clientContext);\n }\n else {\n this._isContainer = false;\n this._containerOrBlobOperation = new Blob$1(clientContext);\n }\n if (!leaseId) {\n leaseId = coreHttp.generateUuid();\n }\n this._leaseId = leaseId;\n }\n /**\n * Gets the lease Id.\n *\n * @readonly\n */\n get leaseId() {\n return this._leaseId;\n }\n /**\n * Gets the url.\n *\n * @readonly\n */\n get url() {\n return this._url;\n }\n /**\n * Establishes and manages a lock on a container for delete operations, or on a blob\n * for write and delete operations.\n * The lock duration can be 15 to 60 seconds, or can be infinite.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param duration - Must be between 15 to 60 seconds, or infinite (-1)\n * @param options - option to configure lease management operations.\n * @returns Response data for acquire lease operation.\n */\n async acquireLease(duration, options = {}) {\n var _a, _b, _c, _d, _e, _f;\n const { span, updatedOptions } = createSpan(\"BlobLeaseClient-acquireLease\", options);\n if (this._isContainer &&\n ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||\n (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||\n ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {\n throw new RangeError(\"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\");\n }\n try {\n return await this._containerOrBlobOperation.acquireLease(Object.assign({ abortSignal: options.abortSignal, duration, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }), proposedLeaseId: this._leaseId }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * To change the ID of the lease.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param proposedLeaseId - the proposed new lease Id.\n * @param options - option to configure lease management operations.\n * @returns Response data for change lease operation.\n */\n async changeLease(proposedLeaseId, options = {}) {\n var _a, _b, _c, _d, _e, _f;\n const { span, updatedOptions } = createSpan(\"BlobLeaseClient-changeLease\", options);\n if (this._isContainer &&\n ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||\n (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||\n ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {\n throw new RangeError(\"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\");\n }\n try {\n const response = await this._containerOrBlobOperation.changeLease(this._leaseId, proposedLeaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n this._leaseId = proposedLeaseId;\n return response;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * To free the lease if it is no longer needed so that another client may\n * immediately acquire a lease against the container or the blob.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param options - option to configure lease management operations.\n * @returns Response data for release lease operation.\n */\n async releaseLease(options = {}) {\n var _a, _b, _c, _d, _e, _f;\n const { span, updatedOptions } = createSpan(\"BlobLeaseClient-releaseLease\", options);\n if (this._isContainer &&\n ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||\n (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||\n ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {\n throw new RangeError(\"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\");\n }\n try {\n return await this._containerOrBlobOperation.releaseLease(this._leaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * To renew the lease.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param options - Optional option to configure lease management operations.\n * @returns Response data for renew lease operation.\n */\n async renewLease(options = {}) {\n var _a, _b, _c, _d, _e, _f;\n const { span, updatedOptions } = createSpan(\"BlobLeaseClient-renewLease\", options);\n if (this._isContainer &&\n ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||\n (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||\n ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {\n throw new RangeError(\"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\");\n }\n try {\n return await this._containerOrBlobOperation.renewLease(this._leaseId, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * To end the lease but ensure that another client cannot acquire a new lease\n * until the current lease period has expired.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container\n * and\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob\n *\n * @param breakPeriod - Break period\n * @param options - Optional options to configure lease management operations.\n * @returns Response data for break lease operation.\n */\n async breakLease(breakPeriod, options = {}) {\n var _a, _b, _c, _d, _e, _f;\n const { span, updatedOptions } = createSpan(\"BlobLeaseClient-breakLease\", options);\n if (this._isContainer &&\n ((((_a = options.conditions) === null || _a === void 0 ? void 0 : _a.ifMatch) && ((_b = options.conditions) === null || _b === void 0 ? void 0 : _b.ifMatch) !== ETagNone) ||\n (((_c = options.conditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch) && ((_d = options.conditions) === null || _d === void 0 ? void 0 : _d.ifNoneMatch) !== ETagNone) ||\n ((_e = options.conditions) === null || _e === void 0 ? void 0 : _e.tagConditions))) {\n throw new RangeError(\"The IfMatch, IfNoneMatch and tags access conditions are ignored by the service. Values other than undefined or their default values are not acceptable.\");\n }\n try {\n const operationOptions = Object.assign({ abortSignal: options.abortSignal, breakPeriod, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_f = options.conditions) === null || _f === void 0 ? void 0 : _f.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions));\n return await this._containerOrBlobOperation.breakLease(operationOptions);\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * A Node.js ReadableStream will internally retry when internal ReadableStream unexpected ends.\n */\nclass RetriableReadableStream extends stream.Readable {\n /**\n * Creates an instance of RetriableReadableStream.\n *\n * @param source - The current ReadableStream returned from getter\n * @param getter - A method calling downloading request returning\n * a new ReadableStream from specified offset\n * @param offset - Offset position in original data source to read\n * @param count - How much data in original data source to read\n * @param options -\n */\n constructor(source, getter, offset, count, options = {}) {\n super({ highWaterMark: options.highWaterMark });\n this.retries = 0;\n this.sourceDataHandler = (data) => {\n if (this.options.doInjectErrorOnce) {\n this.options.doInjectErrorOnce = undefined;\n this.source.pause();\n this.source.removeAllListeners(\"data\");\n this.source.emit(\"end\");\n return;\n }\n // console.log(\n // `Offset: ${this.offset}, Received ${data.length} from internal stream`\n // );\n this.offset += data.length;\n if (this.onProgress) {\n this.onProgress({ loadedBytes: this.offset - this.start });\n }\n if (!this.push(data)) {\n this.source.pause();\n }\n };\n this.sourceErrorOrEndHandler = (err) => {\n if (err && err.name === \"AbortError\") {\n this.destroy(err);\n return;\n }\n // console.log(\n // `Source stream emits end or error, offset: ${\n // this.offset\n // }, dest end : ${this.end}`\n // );\n this.removeSourceEventHandlers();\n if (this.offset - 1 === this.end) {\n this.push(null);\n }\n else if (this.offset <= this.end) {\n // console.log(\n // `retries: ${this.retries}, max retries: ${this.maxRetries}`\n // );\n if (this.retries < this.maxRetryRequests) {\n this.retries += 1;\n this.getter(this.offset)\n .then((newSource) => {\n this.source = newSource;\n this.setSourceEventHandlers();\n return;\n })\n .catch((error) => {\n this.destroy(error);\n });\n }\n else {\n this.destroy(new Error(`Data corruption failure: received less data than required and reached maxRetires limitation. Received data offset: ${this.offset - 1}, data needed offset: ${this.end}, retries: ${this.retries}, max retries: ${this.maxRetryRequests}`));\n }\n }\n else {\n this.destroy(new Error(`Data corruption failure: Received more data than original request, data needed offset is ${this.end}, received offset: ${this.offset - 1}`));\n }\n };\n this.getter = getter;\n this.source = source;\n this.start = offset;\n this.offset = offset;\n this.end = offset + count - 1;\n this.maxRetryRequests =\n options.maxRetryRequests && options.maxRetryRequests >= 0 ? options.maxRetryRequests : 0;\n this.onProgress = options.onProgress;\n this.options = options;\n this.setSourceEventHandlers();\n }\n _read() {\n this.source.resume();\n }\n setSourceEventHandlers() {\n this.source.on(\"data\", this.sourceDataHandler);\n this.source.on(\"end\", this.sourceErrorOrEndHandler);\n this.source.on(\"error\", this.sourceErrorOrEndHandler);\n }\n removeSourceEventHandlers() {\n this.source.removeListener(\"data\", this.sourceDataHandler);\n this.source.removeListener(\"end\", this.sourceErrorOrEndHandler);\n this.source.removeListener(\"error\", this.sourceErrorOrEndHandler);\n }\n _destroy(error, callback) {\n // remove listener from source and release source\n this.removeSourceEventHandlers();\n this.source.destroy();\n callback(error === null ? undefined : error);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * BlobDownloadResponse implements BlobDownloadResponseParsed interface, and in Node.js runtime it will\n * automatically retry when internal read stream unexpected ends. (This kind of unexpected ends cannot\n * trigger retries defined in pipeline retry policy.)\n *\n * The {@link readableStreamBody} stream will retry underlayer, you can just use it as a normal Node.js\n * Readable stream.\n */\nclass BlobDownloadResponse {\n /**\n * Creates an instance of BlobDownloadResponse.\n *\n * @param originalResponse -\n * @param getter -\n * @param offset -\n * @param count -\n * @param options -\n */\n constructor(originalResponse, getter, offset, count, options = {}) {\n this.originalResponse = originalResponse;\n this.blobDownloadStream = new RetriableReadableStream(this.originalResponse.readableStreamBody, getter, offset, count, options);\n }\n /**\n * Indicates that the service supports\n * requests for partial file content.\n *\n * @readonly\n */\n get acceptRanges() {\n return this.originalResponse.acceptRanges;\n }\n /**\n * Returns if it was previously specified\n * for the file.\n *\n * @readonly\n */\n get cacheControl() {\n return this.originalResponse.cacheControl;\n }\n /**\n * Returns the value that was specified\n * for the 'x-ms-content-disposition' header and specifies how to process the\n * response.\n *\n * @readonly\n */\n get contentDisposition() {\n return this.originalResponse.contentDisposition;\n }\n /**\n * Returns the value that was specified\n * for the Content-Encoding request header.\n *\n * @readonly\n */\n get contentEncoding() {\n return this.originalResponse.contentEncoding;\n }\n /**\n * Returns the value that was specified\n * for the Content-Language request header.\n *\n * @readonly\n */\n get contentLanguage() {\n return this.originalResponse.contentLanguage;\n }\n /**\n * The current sequence number for a\n * page blob. This header is not returned for block blobs or append blobs.\n *\n * @readonly\n */\n get blobSequenceNumber() {\n return this.originalResponse.blobSequenceNumber;\n }\n /**\n * The blob's type. Possible values include:\n * 'BlockBlob', 'PageBlob', 'AppendBlob'.\n *\n * @readonly\n */\n get blobType() {\n return this.originalResponse.blobType;\n }\n /**\n * The number of bytes present in the\n * response body.\n *\n * @readonly\n */\n get contentLength() {\n return this.originalResponse.contentLength;\n }\n /**\n * If the file has an MD5 hash and the\n * request is to read the full file, this response header is returned so that\n * the client can check for message content integrity. If the request is to\n * read a specified range and the 'x-ms-range-get-content-md5' is set to\n * true, then the request returns an MD5 hash for the range, as long as the\n * range size is less than or equal to 4 MB. If neither of these sets of\n * conditions is true, then no value is returned for the 'Content-MD5'\n * header.\n *\n * @readonly\n */\n get contentMD5() {\n return this.originalResponse.contentMD5;\n }\n /**\n * Indicates the range of bytes returned if\n * the client requested a subset of the file by setting the Range request\n * header.\n *\n * @readonly\n */\n get contentRange() {\n return this.originalResponse.contentRange;\n }\n /**\n * The content type specified for the file.\n * The default content type is 'application/octet-stream'\n *\n * @readonly\n */\n get contentType() {\n return this.originalResponse.contentType;\n }\n /**\n * Conclusion time of the last attempted\n * Copy File operation where this file was the destination file. This value\n * can specify the time of a completed, aborted, or failed copy attempt.\n *\n * @readonly\n */\n get copyCompletedOn() {\n return this.originalResponse.copyCompletedOn;\n }\n /**\n * String identifier for the last attempted Copy\n * File operation where this file was the destination file.\n *\n * @readonly\n */\n get copyId() {\n return this.originalResponse.copyId;\n }\n /**\n * Contains the number of bytes copied and\n * the total bytes in the source in the last attempted Copy File operation\n * where this file was the destination file. Can show between 0 and\n * Content-Length bytes copied.\n *\n * @readonly\n */\n get copyProgress() {\n return this.originalResponse.copyProgress;\n }\n /**\n * URL up to 2KB in length that specifies the\n * source file used in the last attempted Copy File operation where this file\n * was the destination file.\n *\n * @readonly\n */\n get copySource() {\n return this.originalResponse.copySource;\n }\n /**\n * State of the copy operation\n * identified by 'x-ms-copy-id'. Possible values include: 'pending',\n * 'success', 'aborted', 'failed'\n *\n * @readonly\n */\n get copyStatus() {\n return this.originalResponse.copyStatus;\n }\n /**\n * Only appears when\n * x-ms-copy-status is failed or pending. Describes cause of fatal or\n * non-fatal copy operation failure.\n *\n * @readonly\n */\n get copyStatusDescription() {\n return this.originalResponse.copyStatusDescription;\n }\n /**\n * When a blob is leased,\n * specifies whether the lease is of infinite or fixed duration. Possible\n * values include: 'infinite', 'fixed'.\n *\n * @readonly\n */\n get leaseDuration() {\n return this.originalResponse.leaseDuration;\n }\n /**\n * Lease state of the blob. Possible\n * values include: 'available', 'leased', 'expired', 'breaking', 'broken'.\n *\n * @readonly\n */\n get leaseState() {\n return this.originalResponse.leaseState;\n }\n /**\n * The current lease status of the\n * blob. Possible values include: 'locked', 'unlocked'.\n *\n * @readonly\n */\n get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }\n /**\n * A UTC date/time value generated by the service that\n * indicates the time at which the response was initiated.\n *\n * @readonly\n */\n get date() {\n return this.originalResponse.date;\n }\n /**\n * The number of committed blocks\n * present in the blob. This header is returned only for append blobs.\n *\n * @readonly\n */\n get blobCommittedBlockCount() {\n return this.originalResponse.blobCommittedBlockCount;\n }\n /**\n * The ETag contains a value that you can use to\n * perform operations conditionally, in quotes.\n *\n * @readonly\n */\n get etag() {\n return this.originalResponse.etag;\n }\n /**\n * The number of tags associated with the blob\n *\n * @readonly\n */\n get tagCount() {\n return this.originalResponse.tagCount;\n }\n /**\n * The error code.\n *\n * @readonly\n */\n get errorCode() {\n return this.originalResponse.errorCode;\n }\n /**\n * The value of this header is set to\n * true if the file data and application metadata are completely encrypted\n * using the specified algorithm. Otherwise, the value is set to false (when\n * the file is unencrypted, or if only parts of the file/application metadata\n * are encrypted).\n *\n * @readonly\n */\n get isServerEncrypted() {\n return this.originalResponse.isServerEncrypted;\n }\n /**\n * If the blob has a MD5 hash, and if\n * request contains range header (Range or x-ms-range), this response header\n * is returned with the value of the whole blob's MD5 value. This value may\n * or may not be equal to the value returned in Content-MD5 header, with the\n * latter calculated from the requested range.\n *\n * @readonly\n */\n get blobContentMD5() {\n return this.originalResponse.blobContentMD5;\n }\n /**\n * Returns the date and time the file was last\n * modified. Any operation that modifies the file or its properties updates\n * the last modified time.\n *\n * @readonly\n */\n get lastModified() {\n return this.originalResponse.lastModified;\n }\n /**\n * Returns the UTC date and time generated by the service that indicates the time at which the blob was\n * last read or written to.\n *\n * @readonly\n */\n get lastAccessed() {\n return this.originalResponse.lastAccessed;\n }\n /**\n * Returns the date and time the blob was created.\n *\n * @readonly\n */\n get createdOn() {\n return this.originalResponse.createdOn;\n }\n /**\n * A name-value pair\n * to associate with a file storage object.\n *\n * @readonly\n */\n get metadata() {\n return this.originalResponse.metadata;\n }\n /**\n * This header uniquely identifies the request\n * that was made and can be used for troubleshooting the request.\n *\n * @readonly\n */\n get requestId() {\n return this.originalResponse.requestId;\n }\n /**\n * If a client request id header is sent in the request, this header will be present in the\n * response with the same value.\n *\n * @readonly\n */\n get clientRequestId() {\n return this.originalResponse.clientRequestId;\n }\n /**\n * Indicates the version of the Blob service used\n * to execute the request.\n *\n * @readonly\n */\n get version() {\n return this.originalResponse.version;\n }\n /**\n * Indicates the versionId of the downloaded blob version.\n *\n * @readonly\n */\n get versionId() {\n return this.originalResponse.versionId;\n }\n /**\n * Indicates whether version of this blob is a current version.\n *\n * @readonly\n */\n get isCurrentVersion() {\n return this.originalResponse.isCurrentVersion;\n }\n /**\n * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned\n * when the blob was encrypted with a customer-provided key.\n *\n * @readonly\n */\n get encryptionKeySha256() {\n return this.originalResponse.encryptionKeySha256;\n }\n /**\n * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to\n * true, then the request returns a crc64 for the range, as long as the range size is less than\n * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is\n * specified in the same request, it will fail with 400(Bad Request)\n */\n get contentCrc64() {\n return this.originalResponse.contentCrc64;\n }\n /**\n * Object Replication Policy Id of the destination blob.\n *\n * @readonly\n */\n get objectReplicationDestinationPolicyId() {\n return this.originalResponse.objectReplicationDestinationPolicyId;\n }\n /**\n * Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob.\n *\n * @readonly\n */\n get objectReplicationSourceProperties() {\n return this.originalResponse.objectReplicationSourceProperties;\n }\n /**\n * If this blob has been sealed.\n *\n * @readonly\n */\n get isSealed() {\n return this.originalResponse.isSealed;\n }\n /**\n * UTC date/time value generated by the service that indicates the time at which the blob immutability policy will expire.\n *\n * @readonly\n */\n get immutabilityPolicyExpiresOn() {\n return this.originalResponse.immutabilityPolicyExpiresOn;\n }\n /**\n * Indicates immutability policy mode.\n *\n * @readonly\n */\n get immutabilityPolicyMode() {\n return this.originalResponse.immutabilityPolicyMode;\n }\n /**\n * Indicates if a legal hold is present on the blob.\n *\n * @readonly\n */\n get legalHold() {\n return this.originalResponse.legalHold;\n }\n /**\n * The response body as a browser Blob.\n * Always undefined in node.js.\n *\n * @readonly\n */\n get contentAsBlob() {\n return this.originalResponse.blobBody;\n }\n /**\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n *\n * It will automatically retry when internal read stream unexpected ends.\n *\n * @readonly\n */\n get readableStreamBody() {\n return coreHttp.isNode ? this.blobDownloadStream : undefined;\n }\n /**\n * The HTTP response.\n */\n get _response() {\n return this.originalResponse._response;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nconst AVRO_SYNC_MARKER_SIZE = 16;\nconst AVRO_INIT_BYTES = new Uint8Array([79, 98, 106, 1]);\nconst AVRO_CODEC_KEY = \"avro.codec\";\nconst AVRO_SCHEMA_KEY = \"avro.schema\";\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nclass AvroParser {\n /**\n * Reads a fixed number of bytes from the stream.\n *\n * @param stream -\n * @param length -\n * @param options -\n */\n static async readFixedBytes(stream, length, options = {}) {\n const bytes = await stream.read(length, { abortSignal: options.abortSignal });\n if (bytes.length !== length) {\n throw new Error(\"Hit stream end.\");\n }\n return bytes;\n }\n /**\n * Reads a single byte from the stream.\n *\n * @param stream -\n * @param options -\n */\n static async readByte(stream, options = {}) {\n const buf = await AvroParser.readFixedBytes(stream, 1, options);\n return buf[0];\n }\n // int and long are stored in variable-length zig-zag coding.\n // variable-length: https://lucene.apache.org/core/3_5_0/fileformats.html#VInt\n // zig-zag: https://developers.google.com/protocol-buffers/docs/encoding?csw=1#types\n static async readZigZagLong(stream, options = {}) {\n let zigZagEncoded = 0;\n let significanceInBit = 0;\n let byte, haveMoreByte, significanceInFloat;\n do {\n byte = await AvroParser.readByte(stream, options);\n haveMoreByte = byte & 0x80;\n zigZagEncoded |= (byte & 0x7f) << significanceInBit;\n significanceInBit += 7;\n } while (haveMoreByte && significanceInBit < 28); // bitwise operation only works for 32-bit integers\n if (haveMoreByte) {\n // Switch to float arithmetic\n // eslint-disable-next-line no-self-assign\n zigZagEncoded = zigZagEncoded;\n significanceInFloat = 268435456; // 2 ** 28.\n do {\n byte = await AvroParser.readByte(stream, options);\n zigZagEncoded += (byte & 0x7f) * significanceInFloat;\n significanceInFloat *= 128; // 2 ** 7\n } while (byte & 0x80);\n const res = (zigZagEncoded % 2 ? -(zigZagEncoded + 1) : zigZagEncoded) / 2;\n if (res < Number.MIN_SAFE_INTEGER || res > Number.MAX_SAFE_INTEGER) {\n throw new Error(\"Integer overflow.\");\n }\n return res;\n }\n return (zigZagEncoded >> 1) ^ -(zigZagEncoded & 1);\n }\n static async readLong(stream, options = {}) {\n return AvroParser.readZigZagLong(stream, options);\n }\n static async readInt(stream, options = {}) {\n return AvroParser.readZigZagLong(stream, options);\n }\n static async readNull() {\n return null;\n }\n static async readBoolean(stream, options = {}) {\n const b = await AvroParser.readByte(stream, options);\n if (b === 1) {\n return true;\n }\n else if (b === 0) {\n return false;\n }\n else {\n throw new Error(\"Byte was not a boolean.\");\n }\n }\n static async readFloat(stream, options = {}) {\n const u8arr = await AvroParser.readFixedBytes(stream, 4, options);\n const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength);\n return view.getFloat32(0, true); // littleEndian = true\n }\n static async readDouble(stream, options = {}) {\n const u8arr = await AvroParser.readFixedBytes(stream, 8, options);\n const view = new DataView(u8arr.buffer, u8arr.byteOffset, u8arr.byteLength);\n return view.getFloat64(0, true); // littleEndian = true\n }\n static async readBytes(stream, options = {}) {\n const size = await AvroParser.readLong(stream, options);\n if (size < 0) {\n throw new Error(\"Bytes size was negative.\");\n }\n return stream.read(size, { abortSignal: options.abortSignal });\n }\n static async readString(stream, options = {}) {\n const u8arr = await AvroParser.readBytes(stream, options);\n const utf8decoder = new TextDecoder();\n return utf8decoder.decode(u8arr);\n }\n static async readMapPair(stream, readItemMethod, options = {}) {\n const key = await AvroParser.readString(stream, options);\n // FUTURE: this won't work with readFixed (currently not supported) which needs a length as the parameter.\n const value = await readItemMethod(stream, options);\n return { key, value };\n }\n static async readMap(stream, readItemMethod, options = {}) {\n const readPairMethod = (s, opts = {}) => {\n return AvroParser.readMapPair(s, readItemMethod, opts);\n };\n const pairs = await AvroParser.readArray(stream, readPairMethod, options);\n const dict = {};\n for (const pair of pairs) {\n dict[pair.key] = pair.value;\n }\n return dict;\n }\n static async readArray(stream, readItemMethod, options = {}) {\n const items = [];\n for (let count = await AvroParser.readLong(stream, options); count !== 0; count = await AvroParser.readLong(stream, options)) {\n if (count < 0) {\n // Ignore block sizes\n await AvroParser.readLong(stream, options);\n count = -count;\n }\n while (count--) {\n const item = await readItemMethod(stream, options);\n items.push(item);\n }\n }\n return items;\n }\n}\nvar AvroComplex;\n(function (AvroComplex) {\n AvroComplex[\"RECORD\"] = \"record\";\n AvroComplex[\"ENUM\"] = \"enum\";\n AvroComplex[\"ARRAY\"] = \"array\";\n AvroComplex[\"MAP\"] = \"map\";\n AvroComplex[\"UNION\"] = \"union\";\n AvroComplex[\"FIXED\"] = \"fixed\";\n})(AvroComplex || (AvroComplex = {}));\nvar AvroPrimitive;\n(function (AvroPrimitive) {\n AvroPrimitive[\"NULL\"] = \"null\";\n AvroPrimitive[\"BOOLEAN\"] = \"boolean\";\n AvroPrimitive[\"INT\"] = \"int\";\n AvroPrimitive[\"LONG\"] = \"long\";\n AvroPrimitive[\"FLOAT\"] = \"float\";\n AvroPrimitive[\"DOUBLE\"] = \"double\";\n AvroPrimitive[\"BYTES\"] = \"bytes\";\n AvroPrimitive[\"STRING\"] = \"string\";\n})(AvroPrimitive || (AvroPrimitive = {}));\nclass AvroType {\n /**\n * Determines the AvroType from the Avro Schema.\n */\n static fromSchema(schema) {\n if (typeof schema === \"string\") {\n return AvroType.fromStringSchema(schema);\n }\n else if (Array.isArray(schema)) {\n return AvroType.fromArraySchema(schema);\n }\n else {\n return AvroType.fromObjectSchema(schema);\n }\n }\n static fromStringSchema(schema) {\n switch (schema) {\n case AvroPrimitive.NULL:\n case AvroPrimitive.BOOLEAN:\n case AvroPrimitive.INT:\n case AvroPrimitive.LONG:\n case AvroPrimitive.FLOAT:\n case AvroPrimitive.DOUBLE:\n case AvroPrimitive.BYTES:\n case AvroPrimitive.STRING:\n return new AvroPrimitiveType(schema);\n default:\n throw new Error(`Unexpected Avro type ${schema}`);\n }\n }\n static fromArraySchema(schema) {\n return new AvroUnionType(schema.map(AvroType.fromSchema));\n }\n static fromObjectSchema(schema) {\n const type = schema.type;\n // Primitives can be defined as strings or objects\n try {\n return AvroType.fromStringSchema(type);\n }\n catch (err) {\n // eslint-disable-line no-empty\n }\n switch (type) {\n case AvroComplex.RECORD:\n if (schema.aliases) {\n throw new Error(`aliases currently is not supported, schema: ${schema}`);\n }\n if (!schema.name) {\n throw new Error(`Required attribute 'name' doesn't exist on schema: ${schema}`);\n }\n // eslint-disable-next-line no-case-declarations\n const fields = {};\n if (!schema.fields) {\n throw new Error(`Required attribute 'fields' doesn't exist on schema: ${schema}`);\n }\n for (const field of schema.fields) {\n fields[field.name] = AvroType.fromSchema(field.type);\n }\n return new AvroRecordType(fields, schema.name);\n case AvroComplex.ENUM:\n if (schema.aliases) {\n throw new Error(`aliases currently is not supported, schema: ${schema}`);\n }\n if (!schema.symbols) {\n throw new Error(`Required attribute 'symbols' doesn't exist on schema: ${schema}`);\n }\n return new AvroEnumType(schema.symbols);\n case AvroComplex.MAP:\n if (!schema.values) {\n throw new Error(`Required attribute 'values' doesn't exist on schema: ${schema}`);\n }\n return new AvroMapType(AvroType.fromSchema(schema.values));\n case AvroComplex.ARRAY: // Unused today\n case AvroComplex.FIXED: // Unused today\n default:\n throw new Error(`Unexpected Avro type ${type} in ${schema}`);\n }\n }\n}\nclass AvroPrimitiveType extends AvroType {\n constructor(primitive) {\n super();\n this._primitive = primitive;\n }\n read(stream, options = {}) {\n switch (this._primitive) {\n case AvroPrimitive.NULL:\n return AvroParser.readNull();\n case AvroPrimitive.BOOLEAN:\n return AvroParser.readBoolean(stream, options);\n case AvroPrimitive.INT:\n return AvroParser.readInt(stream, options);\n case AvroPrimitive.LONG:\n return AvroParser.readLong(stream, options);\n case AvroPrimitive.FLOAT:\n return AvroParser.readFloat(stream, options);\n case AvroPrimitive.DOUBLE:\n return AvroParser.readDouble(stream, options);\n case AvroPrimitive.BYTES:\n return AvroParser.readBytes(stream, options);\n case AvroPrimitive.STRING:\n return AvroParser.readString(stream, options);\n default:\n throw new Error(\"Unknown Avro Primitive\");\n }\n }\n}\nclass AvroEnumType extends AvroType {\n constructor(symbols) {\n super();\n this._symbols = symbols;\n }\n async read(stream, options = {}) {\n const value = await AvroParser.readInt(stream, options);\n return this._symbols[value];\n }\n}\nclass AvroUnionType extends AvroType {\n constructor(types) {\n super();\n this._types = types;\n }\n async read(stream, options = {}) {\n // eslint-disable-line @typescript-eslint/ban-types\n const typeIndex = await AvroParser.readInt(stream, options);\n return this._types[typeIndex].read(stream, options);\n }\n}\nclass AvroMapType extends AvroType {\n constructor(itemType) {\n super();\n this._itemType = itemType;\n }\n read(stream, options = {}) {\n const readItemMethod = (s, opts) => {\n return this._itemType.read(s, opts);\n };\n return AvroParser.readMap(stream, readItemMethod, options);\n }\n}\nclass AvroRecordType extends AvroType {\n constructor(fields, name) {\n super();\n this._fields = fields;\n this._name = name;\n }\n async read(stream, options = {}) {\n const record = {};\n record[\"$schema\"] = this._name;\n for (const key in this._fields) {\n if (Object.prototype.hasOwnProperty.call(this._fields, key)) {\n record[key] = await this._fields[key].read(stream, options);\n }\n }\n return record;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nfunction arraysEqual(a, b) {\n if (a === b)\n return true;\n // eslint-disable-next-line eqeqeq\n if (a == null || b == null)\n return false;\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; ++i) {\n if (a[i] !== b[i])\n return false;\n }\n return true;\n}\n\n// Copyright (c) Microsoft Corporation.\nclass AvroReader {\n constructor(dataStream, headerStream, currentBlockOffset, indexWithinCurrentBlock) {\n this._dataStream = dataStream;\n this._headerStream = headerStream || dataStream;\n this._initialized = false;\n this._blockOffset = currentBlockOffset || 0;\n this._objectIndex = indexWithinCurrentBlock || 0;\n this._initialBlockOffset = currentBlockOffset || 0;\n }\n get blockOffset() {\n return this._blockOffset;\n }\n get objectIndex() {\n return this._objectIndex;\n }\n async initialize(options = {}) {\n const header = await AvroParser.readFixedBytes(this._headerStream, AVRO_INIT_BYTES.length, {\n abortSignal: options.abortSignal,\n });\n if (!arraysEqual(header, AVRO_INIT_BYTES)) {\n throw new Error(\"Stream is not an Avro file.\");\n }\n // File metadata is written as if defined by the following map schema:\n // { \"type\": \"map\", \"values\": \"bytes\"}\n this._metadata = await AvroParser.readMap(this._headerStream, AvroParser.readString, {\n abortSignal: options.abortSignal,\n });\n // Validate codec\n const codec = this._metadata[AVRO_CODEC_KEY];\n if (!(codec === undefined || codec === null || codec === \"null\")) {\n throw new Error(\"Codecs are not supported\");\n }\n // The 16-byte, randomly-generated sync marker for this file.\n this._syncMarker = await AvroParser.readFixedBytes(this._headerStream, AVRO_SYNC_MARKER_SIZE, {\n abortSignal: options.abortSignal,\n });\n // Parse the schema\n const schema = JSON.parse(this._metadata[AVRO_SCHEMA_KEY]);\n this._itemType = AvroType.fromSchema(schema);\n if (this._blockOffset === 0) {\n this._blockOffset = this._initialBlockOffset + this._dataStream.position;\n }\n this._itemsRemainingInBlock = await AvroParser.readLong(this._dataStream, {\n abortSignal: options.abortSignal,\n });\n // skip block length\n await AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal });\n this._initialized = true;\n if (this._objectIndex && this._objectIndex > 0) {\n for (let i = 0; i < this._objectIndex; i++) {\n await this._itemType.read(this._dataStream, { abortSignal: options.abortSignal });\n this._itemsRemainingInBlock--;\n }\n }\n }\n hasNext() {\n return !this._initialized || this._itemsRemainingInBlock > 0;\n }\n parseObjects(options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* parseObjects_1() {\n if (!this._initialized) {\n yield tslib.__await(this.initialize(options));\n }\n while (this.hasNext()) {\n const result = yield tslib.__await(this._itemType.read(this._dataStream, {\n abortSignal: options.abortSignal,\n }));\n this._itemsRemainingInBlock--;\n this._objectIndex++;\n if (this._itemsRemainingInBlock === 0) {\n const marker = yield tslib.__await(AvroParser.readFixedBytes(this._dataStream, AVRO_SYNC_MARKER_SIZE, {\n abortSignal: options.abortSignal,\n }));\n this._blockOffset = this._initialBlockOffset + this._dataStream.position;\n this._objectIndex = 0;\n if (!arraysEqual(this._syncMarker, marker)) {\n throw new Error(\"Stream is not a valid Avro file.\");\n }\n try {\n this._itemsRemainingInBlock = yield tslib.__await(AvroParser.readLong(this._dataStream, {\n abortSignal: options.abortSignal,\n }));\n }\n catch (err) {\n // We hit the end of the stream.\n this._itemsRemainingInBlock = 0;\n }\n if (this._itemsRemainingInBlock > 0) {\n // Ignore block size\n yield tslib.__await(AvroParser.readLong(this._dataStream, { abortSignal: options.abortSignal }));\n }\n }\n yield yield tslib.__await(result);\n }\n });\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nclass AvroReadable {\n}\n\n// Copyright (c) Microsoft Corporation.\nconst ABORT_ERROR = new abortController.AbortError(\"Reading from the avro stream was aborted.\");\nclass AvroReadableFromStream extends AvroReadable {\n constructor(readable) {\n super();\n this._readable = readable;\n this._position = 0;\n }\n toUint8Array(data) {\n if (typeof data === \"string\") {\n return Buffer.from(data);\n }\n return data;\n }\n get position() {\n return this._position;\n }\n async read(size, options = {}) {\n var _a;\n if ((_a = options.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {\n throw ABORT_ERROR;\n }\n if (size < 0) {\n throw new Error(`size parameter should be positive: ${size}`);\n }\n if (size === 0) {\n return new Uint8Array();\n }\n if (!this._readable.readable) {\n throw new Error(\"Stream no longer readable.\");\n }\n // See if there is already enough data.\n const chunk = this._readable.read(size);\n if (chunk) {\n this._position += chunk.length;\n // chunk.length maybe less than desired size if the stream ends.\n return this.toUint8Array(chunk);\n }\n else {\n // register callback to wait for enough data to read\n return new Promise((resolve, reject) => {\n /* eslint-disable @typescript-eslint/no-use-before-define */\n const cleanUp = () => {\n this._readable.removeListener(\"readable\", readableCallback);\n this._readable.removeListener(\"error\", rejectCallback);\n this._readable.removeListener(\"end\", rejectCallback);\n this._readable.removeListener(\"close\", rejectCallback);\n if (options.abortSignal) {\n options.abortSignal.removeEventListener(\"abort\", abortHandler);\n }\n };\n const readableCallback = () => {\n const callbackChunk = this._readable.read(size);\n if (callbackChunk) {\n this._position += callbackChunk.length;\n cleanUp();\n // callbackChunk.length maybe less than desired size if the stream ends.\n resolve(this.toUint8Array(callbackChunk));\n }\n };\n const rejectCallback = () => {\n cleanUp();\n reject();\n };\n const abortHandler = () => {\n cleanUp();\n reject(ABORT_ERROR);\n };\n this._readable.on(\"readable\", readableCallback);\n this._readable.once(\"error\", rejectCallback);\n this._readable.once(\"end\", rejectCallback);\n this._readable.once(\"close\", rejectCallback);\n if (options.abortSignal) {\n options.abortSignal.addEventListener(\"abort\", abortHandler);\n }\n /* eslint-enable @typescript-eslint/no-use-before-define */\n });\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * A Node.js BlobQuickQueryStream will internally parse avro data stream for blob query.\n */\nclass BlobQuickQueryStream extends stream.Readable {\n /**\n * Creates an instance of BlobQuickQueryStream.\n *\n * @param source - The current ReadableStream returned from getter\n * @param options -\n */\n constructor(source, options = {}) {\n super();\n this.avroPaused = true;\n this.source = source;\n this.onProgress = options.onProgress;\n this.onError = options.onError;\n this.avroReader = new AvroReader(new AvroReadableFromStream(this.source));\n this.avroIter = this.avroReader.parseObjects({ abortSignal: options.abortSignal });\n }\n _read() {\n if (this.avroPaused) {\n this.readInternal().catch((err) => {\n this.emit(\"error\", err);\n });\n }\n }\n async readInternal() {\n this.avroPaused = false;\n let avroNext;\n do {\n avroNext = await this.avroIter.next();\n if (avroNext.done) {\n break;\n }\n const obj = avroNext.value;\n const schema = obj.$schema;\n if (typeof schema !== \"string\") {\n throw Error(\"Missing schema in avro record.\");\n }\n switch (schema) {\n case \"com.microsoft.azure.storage.queryBlobContents.resultData\":\n {\n const data = obj.data;\n if (data instanceof Uint8Array === false) {\n throw Error(\"Invalid data in avro result record.\");\n }\n if (!this.push(Buffer.from(data))) {\n this.avroPaused = true;\n }\n }\n break;\n case \"com.microsoft.azure.storage.queryBlobContents.progress\":\n {\n const bytesScanned = obj.bytesScanned;\n if (typeof bytesScanned !== \"number\") {\n throw Error(\"Invalid bytesScanned in avro progress record.\");\n }\n if (this.onProgress) {\n this.onProgress({ loadedBytes: bytesScanned });\n }\n }\n break;\n case \"com.microsoft.azure.storage.queryBlobContents.end\":\n if (this.onProgress) {\n const totalBytes = obj.totalBytes;\n if (typeof totalBytes !== \"number\") {\n throw Error(\"Invalid totalBytes in avro end record.\");\n }\n this.onProgress({ loadedBytes: totalBytes });\n }\n this.push(null);\n break;\n case \"com.microsoft.azure.storage.queryBlobContents.error\":\n if (this.onError) {\n const fatal = obj.fatal;\n if (typeof fatal !== \"boolean\") {\n throw Error(\"Invalid fatal in avro error record.\");\n }\n const name = obj.name;\n if (typeof name !== \"string\") {\n throw Error(\"Invalid name in avro error record.\");\n }\n const description = obj.description;\n if (typeof description !== \"string\") {\n throw Error(\"Invalid description in avro error record.\");\n }\n const position = obj.position;\n if (typeof position !== \"number\") {\n throw Error(\"Invalid position in avro error record.\");\n }\n this.onError({\n position,\n name,\n isFatal: fatal,\n description,\n });\n }\n break;\n default:\n throw Error(`Unknown schema ${schema} in avro progress record.`);\n }\n } while (!avroNext.done && !this.avroPaused);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * BlobQueryResponse implements BlobDownloadResponseModel interface, and in Node.js runtime it will\n * parse avor data returned by blob query.\n */\nclass BlobQueryResponse {\n /**\n * Creates an instance of BlobQueryResponse.\n *\n * @param originalResponse -\n * @param options -\n */\n constructor(originalResponse, options = {}) {\n this.originalResponse = originalResponse;\n this.blobDownloadStream = new BlobQuickQueryStream(this.originalResponse.readableStreamBody, options);\n }\n /**\n * Indicates that the service supports\n * requests for partial file content.\n *\n * @readonly\n */\n get acceptRanges() {\n return this.originalResponse.acceptRanges;\n }\n /**\n * Returns if it was previously specified\n * for the file.\n *\n * @readonly\n */\n get cacheControl() {\n return this.originalResponse.cacheControl;\n }\n /**\n * Returns the value that was specified\n * for the 'x-ms-content-disposition' header and specifies how to process the\n * response.\n *\n * @readonly\n */\n get contentDisposition() {\n return this.originalResponse.contentDisposition;\n }\n /**\n * Returns the value that was specified\n * for the Content-Encoding request header.\n *\n * @readonly\n */\n get contentEncoding() {\n return this.originalResponse.contentEncoding;\n }\n /**\n * Returns the value that was specified\n * for the Content-Language request header.\n *\n * @readonly\n */\n get contentLanguage() {\n return this.originalResponse.contentLanguage;\n }\n /**\n * The current sequence number for a\n * page blob. This header is not returned for block blobs or append blobs.\n *\n * @readonly\n */\n get blobSequenceNumber() {\n return this.originalResponse.blobSequenceNumber;\n }\n /**\n * The blob's type. Possible values include:\n * 'BlockBlob', 'PageBlob', 'AppendBlob'.\n *\n * @readonly\n */\n get blobType() {\n return this.originalResponse.blobType;\n }\n /**\n * The number of bytes present in the\n * response body.\n *\n * @readonly\n */\n get contentLength() {\n return this.originalResponse.contentLength;\n }\n /**\n * If the file has an MD5 hash and the\n * request is to read the full file, this response header is returned so that\n * the client can check for message content integrity. If the request is to\n * read a specified range and the 'x-ms-range-get-content-md5' is set to\n * true, then the request returns an MD5 hash for the range, as long as the\n * range size is less than or equal to 4 MB. If neither of these sets of\n * conditions is true, then no value is returned for the 'Content-MD5'\n * header.\n *\n * @readonly\n */\n get contentMD5() {\n return this.originalResponse.contentMD5;\n }\n /**\n * Indicates the range of bytes returned if\n * the client requested a subset of the file by setting the Range request\n * header.\n *\n * @readonly\n */\n get contentRange() {\n return this.originalResponse.contentRange;\n }\n /**\n * The content type specified for the file.\n * The default content type is 'application/octet-stream'\n *\n * @readonly\n */\n get contentType() {\n return this.originalResponse.contentType;\n }\n /**\n * Conclusion time of the last attempted\n * Copy File operation where this file was the destination file. This value\n * can specify the time of a completed, aborted, or failed copy attempt.\n *\n * @readonly\n */\n get copyCompletedOn() {\n return undefined;\n }\n /**\n * String identifier for the last attempted Copy\n * File operation where this file was the destination file.\n *\n * @readonly\n */\n get copyId() {\n return this.originalResponse.copyId;\n }\n /**\n * Contains the number of bytes copied and\n * the total bytes in the source in the last attempted Copy File operation\n * where this file was the destination file. Can show between 0 and\n * Content-Length bytes copied.\n *\n * @readonly\n */\n get copyProgress() {\n return this.originalResponse.copyProgress;\n }\n /**\n * URL up to 2KB in length that specifies the\n * source file used in the last attempted Copy File operation where this file\n * was the destination file.\n *\n * @readonly\n */\n get copySource() {\n return this.originalResponse.copySource;\n }\n /**\n * State of the copy operation\n * identified by 'x-ms-copy-id'. Possible values include: 'pending',\n * 'success', 'aborted', 'failed'\n *\n * @readonly\n */\n get copyStatus() {\n return this.originalResponse.copyStatus;\n }\n /**\n * Only appears when\n * x-ms-copy-status is failed or pending. Describes cause of fatal or\n * non-fatal copy operation failure.\n *\n * @readonly\n */\n get copyStatusDescription() {\n return this.originalResponse.copyStatusDescription;\n }\n /**\n * When a blob is leased,\n * specifies whether the lease is of infinite or fixed duration. Possible\n * values include: 'infinite', 'fixed'.\n *\n * @readonly\n */\n get leaseDuration() {\n return this.originalResponse.leaseDuration;\n }\n /**\n * Lease state of the blob. Possible\n * values include: 'available', 'leased', 'expired', 'breaking', 'broken'.\n *\n * @readonly\n */\n get leaseState() {\n return this.originalResponse.leaseState;\n }\n /**\n * The current lease status of the\n * blob. Possible values include: 'locked', 'unlocked'.\n *\n * @readonly\n */\n get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }\n /**\n * A UTC date/time value generated by the service that\n * indicates the time at which the response was initiated.\n *\n * @readonly\n */\n get date() {\n return this.originalResponse.date;\n }\n /**\n * The number of committed blocks\n * present in the blob. This header is returned only for append blobs.\n *\n * @readonly\n */\n get blobCommittedBlockCount() {\n return this.originalResponse.blobCommittedBlockCount;\n }\n /**\n * The ETag contains a value that you can use to\n * perform operations conditionally, in quotes.\n *\n * @readonly\n */\n get etag() {\n return this.originalResponse.etag;\n }\n /**\n * The error code.\n *\n * @readonly\n */\n get errorCode() {\n return this.originalResponse.errorCode;\n }\n /**\n * The value of this header is set to\n * true if the file data and application metadata are completely encrypted\n * using the specified algorithm. Otherwise, the value is set to false (when\n * the file is unencrypted, or if only parts of the file/application metadata\n * are encrypted).\n *\n * @readonly\n */\n get isServerEncrypted() {\n return this.originalResponse.isServerEncrypted;\n }\n /**\n * If the blob has a MD5 hash, and if\n * request contains range header (Range or x-ms-range), this response header\n * is returned with the value of the whole blob's MD5 value. This value may\n * or may not be equal to the value returned in Content-MD5 header, with the\n * latter calculated from the requested range.\n *\n * @readonly\n */\n get blobContentMD5() {\n return this.originalResponse.blobContentMD5;\n }\n /**\n * Returns the date and time the file was last\n * modified. Any operation that modifies the file or its properties updates\n * the last modified time.\n *\n * @readonly\n */\n get lastModified() {\n return this.originalResponse.lastModified;\n }\n /**\n * A name-value pair\n * to associate with a file storage object.\n *\n * @readonly\n */\n get metadata() {\n return this.originalResponse.metadata;\n }\n /**\n * This header uniquely identifies the request\n * that was made and can be used for troubleshooting the request.\n *\n * @readonly\n */\n get requestId() {\n return this.originalResponse.requestId;\n }\n /**\n * If a client request id header is sent in the request, this header will be present in the\n * response with the same value.\n *\n * @readonly\n */\n get clientRequestId() {\n return this.originalResponse.clientRequestId;\n }\n /**\n * Indicates the version of the File service used\n * to execute the request.\n *\n * @readonly\n */\n get version() {\n return this.originalResponse.version;\n }\n /**\n * The SHA-256 hash of the encryption key used to encrypt the blob. This value is only returned\n * when the blob was encrypted with a customer-provided key.\n *\n * @readonly\n */\n get encryptionKeySha256() {\n return this.originalResponse.encryptionKeySha256;\n }\n /**\n * If the request is to read a specified range and the x-ms-range-get-content-crc64 is set to\n * true, then the request returns a crc64 for the range, as long as the range size is less than\n * or equal to 4 MB. If both x-ms-range-get-content-crc64 & x-ms-range-get-content-md5 is\n * specified in the same request, it will fail with 400(Bad Request)\n */\n get contentCrc64() {\n return this.originalResponse.contentCrc64;\n }\n /**\n * The response body as a browser Blob.\n * Always undefined in node.js.\n *\n * @readonly\n */\n get blobBody() {\n return undefined;\n }\n /**\n * The response body as a node.js Readable stream.\n * Always undefined in the browser.\n *\n * It will parse avor data returned by blob query.\n *\n * @readonly\n */\n get readableStreamBody() {\n return coreHttp.isNode ? this.blobDownloadStream : undefined;\n }\n /**\n * The HTTP response.\n */\n get _response() {\n return this.originalResponse._response;\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Represents the access tier on a blob.\n * For detailed information about block blob level tiering see {@link https://docs.microsoft.com/azure/storage/blobs/storage-blob-storage-tiers|Hot, cool and archive storage tiers.}\n */\nexports.BlockBlobTier = void 0;\n(function (BlockBlobTier) {\n /**\n * Optimized for storing data that is accessed frequently.\n */\n BlockBlobTier[\"Hot\"] = \"Hot\";\n /**\n * Optimized for storing data that is infrequently accessed and stored for at least 30 days.\n */\n BlockBlobTier[\"Cool\"] = \"Cool\";\n /**\n * Optimized for storing data that is rarely accessed.\n */\n BlockBlobTier[\"Cold\"] = \"Cold\";\n /**\n * Optimized for storing data that is rarely accessed and stored for at least 180 days\n * with flexible latency requirements (on the order of hours).\n */\n BlockBlobTier[\"Archive\"] = \"Archive\";\n})(exports.BlockBlobTier || (exports.BlockBlobTier = {}));\n/**\n * Specifies the page blob tier to set the blob to. This is only applicable to page blobs on premium storage accounts.\n * Please see {@link https://docs.microsoft.com/azure/storage/storage-premium-storage#scalability-and-performance-targets|here}\n * for detailed information on the corresponding IOPS and throughput per PageBlobTier.\n */\nexports.PremiumPageBlobTier = void 0;\n(function (PremiumPageBlobTier) {\n /**\n * P4 Tier.\n */\n PremiumPageBlobTier[\"P4\"] = \"P4\";\n /**\n * P6 Tier.\n */\n PremiumPageBlobTier[\"P6\"] = \"P6\";\n /**\n * P10 Tier.\n */\n PremiumPageBlobTier[\"P10\"] = \"P10\";\n /**\n * P15 Tier.\n */\n PremiumPageBlobTier[\"P15\"] = \"P15\";\n /**\n * P20 Tier.\n */\n PremiumPageBlobTier[\"P20\"] = \"P20\";\n /**\n * P30 Tier.\n */\n PremiumPageBlobTier[\"P30\"] = \"P30\";\n /**\n * P40 Tier.\n */\n PremiumPageBlobTier[\"P40\"] = \"P40\";\n /**\n * P50 Tier.\n */\n PremiumPageBlobTier[\"P50\"] = \"P50\";\n /**\n * P60 Tier.\n */\n PremiumPageBlobTier[\"P60\"] = \"P60\";\n /**\n * P70 Tier.\n */\n PremiumPageBlobTier[\"P70\"] = \"P70\";\n /**\n * P80 Tier.\n */\n PremiumPageBlobTier[\"P80\"] = \"P80\";\n})(exports.PremiumPageBlobTier || (exports.PremiumPageBlobTier = {}));\nfunction toAccessTier(tier) {\n if (tier === undefined) {\n return undefined;\n }\n return tier; // No more check if string is a valid AccessTier, and left this to underlay logic to decide(service).\n}\nfunction ensureCpkIfSpecified(cpk, isHttps) {\n if (cpk && !isHttps) {\n throw new RangeError(\"Customer-provided encryption key must be used over HTTPS.\");\n }\n if (cpk && !cpk.encryptionAlgorithm) {\n cpk.encryptionAlgorithm = EncryptionAlgorithmAES25;\n }\n}\n/**\n * Defines the known cloud audiences for Storage.\n */\nexports.StorageBlobAudience = void 0;\n(function (StorageBlobAudience) {\n /**\n * The OAuth scope to use to retrieve an AAD token for Azure Storage.\n */\n StorageBlobAudience[\"StorageOAuthScopes\"] = \"https://storage.azure.com/.default\";\n /**\n * The OAuth scope to use to retrieve an AAD token for Azure Disk.\n */\n StorageBlobAudience[\"DiskComputeOAuthScopes\"] = \"https://disk.compute.azure.com/.default\";\n})(exports.StorageBlobAudience || (exports.StorageBlobAudience = {}));\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Function that converts PageRange and ClearRange to a common Range object.\n * PageRange and ClearRange have start and end while Range offset and count\n * this function normalizes to Range.\n * @param response - Model PageBlob Range response\n */\nfunction rangeResponseFromModel(response) {\n const pageRange = (response._response.parsedBody.pageRange || []).map((x) => ({\n offset: x.start,\n count: x.end - x.start,\n }));\n const clearRange = (response._response.parsedBody.clearRange || []).map((x) => ({\n offset: x.start,\n count: x.end - x.start,\n }));\n return Object.assign(Object.assign({}, response), { pageRange,\n clearRange, _response: Object.assign(Object.assign({}, response._response), { parsedBody: {\n pageRange,\n clearRange,\n } }) });\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * This is the poller returned by {@link BlobClient.beginCopyFromURL}.\n * This can not be instantiated directly outside of this package.\n *\n * @hidden\n */\nclass BlobBeginCopyFromUrlPoller extends coreLro.Poller {\n constructor(options) {\n const { blobClient, copySource, intervalInMs = 15000, onProgress, resumeFrom, startCopyFromURLOptions, } = options;\n let state;\n if (resumeFrom) {\n state = JSON.parse(resumeFrom).state;\n }\n const operation = makeBlobBeginCopyFromURLPollOperation(Object.assign(Object.assign({}, state), { blobClient,\n copySource,\n startCopyFromURLOptions }));\n super(operation);\n if (typeof onProgress === \"function\") {\n this.onProgress(onProgress);\n }\n this.intervalInMs = intervalInMs;\n }\n delay() {\n return coreHttp.delay(this.intervalInMs);\n }\n}\n/**\n * Note: Intentionally using function expression over arrow function expression\n * so that the function can be invoked with a different context.\n * This affects what `this` refers to.\n * @hidden\n */\nconst cancel = async function cancel(options = {}) {\n const state = this.state;\n const { copyId } = state;\n if (state.isCompleted) {\n return makeBlobBeginCopyFromURLPollOperation(state);\n }\n if (!copyId) {\n state.isCancelled = true;\n return makeBlobBeginCopyFromURLPollOperation(state);\n }\n // if abortCopyFromURL throws, it will bubble up to user's poller.cancelOperation call\n await state.blobClient.abortCopyFromURL(copyId, {\n abortSignal: options.abortSignal,\n });\n state.isCancelled = true;\n return makeBlobBeginCopyFromURLPollOperation(state);\n};\n/**\n * Note: Intentionally using function expression over arrow function expression\n * so that the function can be invoked with a different context.\n * This affects what `this` refers to.\n * @hidden\n */\nconst update = async function update(options = {}) {\n const state = this.state;\n const { blobClient, copySource, startCopyFromURLOptions } = state;\n if (!state.isStarted) {\n state.isStarted = true;\n const result = await blobClient.startCopyFromURL(copySource, startCopyFromURLOptions);\n // copyId is needed to abort\n state.copyId = result.copyId;\n if (result.copyStatus === \"success\") {\n state.result = result;\n state.isCompleted = true;\n }\n }\n else if (!state.isCompleted) {\n try {\n const result = await state.blobClient.getProperties({ abortSignal: options.abortSignal });\n const { copyStatus, copyProgress } = result;\n const prevCopyProgress = state.copyProgress;\n if (copyProgress) {\n state.copyProgress = copyProgress;\n }\n if (copyStatus === \"pending\" &&\n copyProgress !== prevCopyProgress &&\n typeof options.fireProgress === \"function\") {\n // trigger in setTimeout, or swallow error?\n options.fireProgress(state);\n }\n else if (copyStatus === \"success\") {\n state.result = result;\n state.isCompleted = true;\n }\n else if (copyStatus === \"failed\") {\n state.error = new Error(`Blob copy failed with reason: \"${result.copyStatusDescription || \"unknown\"}\"`);\n state.isCompleted = true;\n }\n }\n catch (err) {\n state.error = err;\n state.isCompleted = true;\n }\n }\n return makeBlobBeginCopyFromURLPollOperation(state);\n};\n/**\n * Note: Intentionally using function expression over arrow function expression\n * so that the function can be invoked with a different context.\n * This affects what `this` refers to.\n * @hidden\n */\nconst toString = function toString() {\n return JSON.stringify({ state: this.state }, (key, value) => {\n // remove blobClient from serialized state since a client can't be hydrated from this info.\n if (key === \"blobClient\") {\n return undefined;\n }\n return value;\n });\n};\n/**\n * Creates a poll operation given the provided state.\n * @hidden\n */\nfunction makeBlobBeginCopyFromURLPollOperation(state) {\n return {\n state: Object.assign({}, state),\n cancel,\n toString,\n update,\n };\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * Generate a range string. For example:\n *\n * \"bytes=255-\" or \"bytes=0-511\"\n *\n * @param iRange -\n */\nfunction rangeToString(iRange) {\n if (iRange.offset < 0) {\n throw new RangeError(`Range.offset cannot be smaller than 0.`);\n }\n if (iRange.count && iRange.count <= 0) {\n throw new RangeError(`Range.count must be larger than 0. Leave it undefined if you want a range from offset to the end.`);\n }\n return iRange.count\n ? `bytes=${iRange.offset}-${iRange.offset + iRange.count - 1}`\n : `bytes=${iRange.offset}-`;\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * States for Batch.\n */\nvar BatchStates;\n(function (BatchStates) {\n BatchStates[BatchStates[\"Good\"] = 0] = \"Good\";\n BatchStates[BatchStates[\"Error\"] = 1] = \"Error\";\n})(BatchStates || (BatchStates = {}));\n/**\n * Batch provides basic parallel execution with concurrency limits.\n * Will stop execute left operations when one of the executed operation throws an error.\n * But Batch cannot cancel ongoing operations, you need to cancel them by yourself.\n */\nclass Batch {\n /**\n * Creates an instance of Batch.\n * @param concurrency -\n */\n constructor(concurrency = 5) {\n /**\n * Number of active operations under execution.\n */\n this.actives = 0;\n /**\n * Number of completed operations under execution.\n */\n this.completed = 0;\n /**\n * Offset of next operation to be executed.\n */\n this.offset = 0;\n /**\n * Operation array to be executed.\n */\n this.operations = [];\n /**\n * States of Batch. When an error happens, state will turn into error.\n * Batch will stop execute left operations.\n */\n this.state = BatchStates.Good;\n if (concurrency < 1) {\n throw new RangeError(\"concurrency must be larger than 0\");\n }\n this.concurrency = concurrency;\n this.emitter = new events.EventEmitter();\n }\n /**\n * Add a operation into queue.\n *\n * @param operation -\n */\n addOperation(operation) {\n this.operations.push(async () => {\n try {\n this.actives++;\n await operation();\n this.actives--;\n this.completed++;\n this.parallelExecute();\n }\n catch (error) {\n this.emitter.emit(\"error\", error);\n }\n });\n }\n /**\n * Start execute operations in the queue.\n *\n */\n async do() {\n if (this.operations.length === 0) {\n return Promise.resolve();\n }\n this.parallelExecute();\n return new Promise((resolve, reject) => {\n this.emitter.on(\"finish\", resolve);\n this.emitter.on(\"error\", (error) => {\n this.state = BatchStates.Error;\n reject(error);\n });\n });\n }\n /**\n * Get next operation to be executed. Return null when reaching ends.\n *\n */\n nextOperation() {\n if (this.offset < this.operations.length) {\n return this.operations[this.offset++];\n }\n return null;\n }\n /**\n * Start execute operations. One one the most important difference between\n * this method with do() is that do() wraps as an sync method.\n *\n */\n parallelExecute() {\n if (this.state === BatchStates.Error) {\n return;\n }\n if (this.completed >= this.operations.length) {\n this.emitter.emit(\"finish\");\n return;\n }\n while (this.actives < this.concurrency) {\n const operation = this.nextOperation();\n if (operation) {\n operation();\n }\n else {\n return;\n }\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * This class generates a readable stream from the data in an array of buffers.\n */\nclass BuffersStream extends stream.Readable {\n /**\n * Creates an instance of BuffersStream that will emit the data\n * contained in the array of buffers.\n *\n * @param buffers - Array of buffers containing the data\n * @param byteLength - The total length of data contained in the buffers\n */\n constructor(buffers, byteLength, options) {\n super(options);\n this.buffers = buffers;\n this.byteLength = byteLength;\n this.byteOffsetInCurrentBuffer = 0;\n this.bufferIndex = 0;\n this.pushedBytesLength = 0;\n // check byteLength is no larger than buffers[] total length\n let buffersLength = 0;\n for (const buf of this.buffers) {\n buffersLength += buf.byteLength;\n }\n if (buffersLength < this.byteLength) {\n throw new Error(\"Data size shouldn't be larger than the total length of buffers.\");\n }\n }\n /**\n * Internal _read() that will be called when the stream wants to pull more data in.\n *\n * @param size - Optional. The size of data to be read\n */\n _read(size) {\n if (this.pushedBytesLength >= this.byteLength) {\n this.push(null);\n }\n if (!size) {\n size = this.readableHighWaterMark;\n }\n const outBuffers = [];\n let i = 0;\n while (i < size && this.pushedBytesLength < this.byteLength) {\n // The last buffer may be longer than the data it contains.\n const remainingDataInAllBuffers = this.byteLength - this.pushedBytesLength;\n const remainingCapacityInThisBuffer = this.buffers[this.bufferIndex].byteLength - this.byteOffsetInCurrentBuffer;\n const remaining = Math.min(remainingCapacityInThisBuffer, remainingDataInAllBuffers);\n if (remaining > size - i) {\n // chunkSize = size - i\n const end = this.byteOffsetInCurrentBuffer + size - i;\n outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end));\n this.pushedBytesLength += size - i;\n this.byteOffsetInCurrentBuffer = end;\n i = size;\n break;\n }\n else {\n // chunkSize = remaining\n const end = this.byteOffsetInCurrentBuffer + remaining;\n outBuffers.push(this.buffers[this.bufferIndex].slice(this.byteOffsetInCurrentBuffer, end));\n if (remaining === remainingCapacityInThisBuffer) {\n // this.buffers[this.bufferIndex] used up, shift to next one\n this.byteOffsetInCurrentBuffer = 0;\n this.bufferIndex++;\n }\n else {\n this.byteOffsetInCurrentBuffer = end;\n }\n this.pushedBytesLength += remaining;\n i += remaining;\n }\n }\n if (outBuffers.length > 1) {\n this.push(Buffer.concat(outBuffers));\n }\n else if (outBuffers.length === 1) {\n this.push(outBuffers[0]);\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * maxBufferLength is max size of each buffer in the pooled buffers.\n */\n// Can't use import as Typescript doesn't recognize \"buffer\".\nconst maxBufferLength = require(\"buffer\").constants.MAX_LENGTH;\n/**\n * This class provides a buffer container which conceptually has no hard size limit.\n * It accepts a capacity, an array of input buffers and the total length of input data.\n * It will allocate an internal \"buffer\" of the capacity and fill the data in the input buffers\n * into the internal \"buffer\" serially with respect to the total length.\n * Then by calling PooledBuffer.getReadableStream(), you can get a readable stream\n * assembled from all the data in the internal \"buffer\".\n */\nclass PooledBuffer {\n constructor(capacity, buffers, totalLength) {\n /**\n * Internal buffers used to keep the data.\n * Each buffer has a length of the maxBufferLength except last one.\n */\n this.buffers = [];\n this.capacity = capacity;\n this._size = 0;\n // allocate\n const bufferNum = Math.ceil(capacity / maxBufferLength);\n for (let i = 0; i < bufferNum; i++) {\n let len = i === bufferNum - 1 ? capacity % maxBufferLength : maxBufferLength;\n if (len === 0) {\n len = maxBufferLength;\n }\n this.buffers.push(Buffer.allocUnsafe(len));\n }\n if (buffers) {\n this.fill(buffers, totalLength);\n }\n }\n /**\n * The size of the data contained in the pooled buffers.\n */\n get size() {\n return this._size;\n }\n /**\n * Fill the internal buffers with data in the input buffers serially\n * with respect to the total length and the total capacity of the internal buffers.\n * Data copied will be shift out of the input buffers.\n *\n * @param buffers - Input buffers containing the data to be filled in the pooled buffer\n * @param totalLength - Total length of the data to be filled in.\n *\n */\n fill(buffers, totalLength) {\n this._size = Math.min(this.capacity, totalLength);\n let i = 0, j = 0, targetOffset = 0, sourceOffset = 0, totalCopiedNum = 0;\n while (totalCopiedNum < this._size) {\n const source = buffers[i];\n const target = this.buffers[j];\n const copiedNum = source.copy(target, targetOffset, sourceOffset);\n totalCopiedNum += copiedNum;\n sourceOffset += copiedNum;\n targetOffset += copiedNum;\n if (sourceOffset === source.length) {\n i++;\n sourceOffset = 0;\n }\n if (targetOffset === target.length) {\n j++;\n targetOffset = 0;\n }\n }\n // clear copied from source buffers\n buffers.splice(0, i);\n if (buffers.length > 0) {\n buffers[0] = buffers[0].slice(sourceOffset);\n }\n }\n /**\n * Get the readable stream assembled from all the data in the internal buffers.\n *\n */\n getReadableStream() {\n return new BuffersStream(this.buffers, this.size);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * This class accepts a Node.js Readable stream as input, and keeps reading data\n * from the stream into the internal buffer structure, until it reaches maxBuffers.\n * Every available buffer will try to trigger outgoingHandler.\n *\n * The internal buffer structure includes an incoming buffer array, and a outgoing\n * buffer array. The incoming buffer array includes the \"empty\" buffers can be filled\n * with new incoming data. The outgoing array includes the filled buffers to be\n * handled by outgoingHandler. Every above buffer size is defined by parameter bufferSize.\n *\n * NUM_OF_ALL_BUFFERS = BUFFERS_IN_INCOMING + BUFFERS_IN_OUTGOING + BUFFERS_UNDER_HANDLING\n *\n * NUM_OF_ALL_BUFFERS lesser than or equal to maxBuffers\n *\n * PERFORMANCE IMPROVEMENT TIPS:\n * 1. Input stream highWaterMark is better to set a same value with bufferSize\n * parameter, which will avoid Buffer.concat() operations.\n * 2. concurrency should set a smaller value than maxBuffers, which is helpful to\n * reduce the possibility when a outgoing handler waits for the stream data.\n * in this situation, outgoing handlers are blocked.\n * Outgoing queue shouldn't be empty.\n */\nclass BufferScheduler {\n /**\n * Creates an instance of BufferScheduler.\n *\n * @param readable - A Node.js Readable stream\n * @param bufferSize - Buffer size of every maintained buffer\n * @param maxBuffers - How many buffers can be allocated\n * @param outgoingHandler - An async function scheduled to be\n * triggered when a buffer fully filled\n * with stream data\n * @param concurrency - Concurrency of executing outgoingHandlers (>0)\n * @param encoding - [Optional] Encoding of Readable stream when it's a string stream\n */\n constructor(readable, bufferSize, maxBuffers, outgoingHandler, concurrency, encoding) {\n /**\n * An internal event emitter.\n */\n this.emitter = new events.EventEmitter();\n /**\n * An internal offset marker to track data offset in bytes of next outgoingHandler.\n */\n this.offset = 0;\n /**\n * An internal marker to track whether stream is end.\n */\n this.isStreamEnd = false;\n /**\n * An internal marker to track whether stream or outgoingHandler returns error.\n */\n this.isError = false;\n /**\n * How many handlers are executing.\n */\n this.executingOutgoingHandlers = 0;\n /**\n * How many buffers have been allocated.\n */\n this.numBuffers = 0;\n /**\n * Because this class doesn't know how much data every time stream pops, which\n * is defined by highWaterMarker of the stream. So BufferScheduler will cache\n * data received from the stream, when data in unresolvedDataArray exceeds the\n * blockSize defined, it will try to concat a blockSize of buffer, fill into available\n * buffers from incoming and push to outgoing array.\n */\n this.unresolvedDataArray = [];\n /**\n * How much data consisted in unresolvedDataArray.\n */\n this.unresolvedLength = 0;\n /**\n * The array includes all the available buffers can be used to fill data from stream.\n */\n this.incoming = [];\n /**\n * The array (queue) includes all the buffers filled from stream data.\n */\n this.outgoing = [];\n if (bufferSize <= 0) {\n throw new RangeError(`bufferSize must be larger than 0, current is ${bufferSize}`);\n }\n if (maxBuffers <= 0) {\n throw new RangeError(`maxBuffers must be larger than 0, current is ${maxBuffers}`);\n }\n if (concurrency <= 0) {\n throw new RangeError(`concurrency must be larger than 0, current is ${concurrency}`);\n }\n this.bufferSize = bufferSize;\n this.maxBuffers = maxBuffers;\n this.readable = readable;\n this.outgoingHandler = outgoingHandler;\n this.concurrency = concurrency;\n this.encoding = encoding;\n }\n /**\n * Start the scheduler, will return error when stream of any of the outgoingHandlers\n * returns error.\n *\n */\n async do() {\n return new Promise((resolve, reject) => {\n this.readable.on(\"data\", (data) => {\n data = typeof data === \"string\" ? Buffer.from(data, this.encoding) : data;\n this.appendUnresolvedData(data);\n if (!this.resolveData()) {\n this.readable.pause();\n }\n });\n this.readable.on(\"error\", (err) => {\n this.emitter.emit(\"error\", err);\n });\n this.readable.on(\"end\", () => {\n this.isStreamEnd = true;\n this.emitter.emit(\"checkEnd\");\n });\n this.emitter.on(\"error\", (err) => {\n this.isError = true;\n this.readable.pause();\n reject(err);\n });\n this.emitter.on(\"checkEnd\", () => {\n if (this.outgoing.length > 0) {\n this.triggerOutgoingHandlers();\n return;\n }\n if (this.isStreamEnd && this.executingOutgoingHandlers === 0) {\n if (this.unresolvedLength > 0 && this.unresolvedLength < this.bufferSize) {\n const buffer = this.shiftBufferFromUnresolvedDataArray();\n this.outgoingHandler(() => buffer.getReadableStream(), buffer.size, this.offset)\n .then(resolve)\n .catch(reject);\n }\n else if (this.unresolvedLength >= this.bufferSize) {\n return;\n }\n else {\n resolve();\n }\n }\n });\n });\n }\n /**\n * Insert a new data into unresolved array.\n *\n * @param data -\n */\n appendUnresolvedData(data) {\n this.unresolvedDataArray.push(data);\n this.unresolvedLength += data.length;\n }\n /**\n * Try to shift a buffer with size in blockSize. The buffer returned may be less\n * than blockSize when data in unresolvedDataArray is less than bufferSize.\n *\n */\n shiftBufferFromUnresolvedDataArray(buffer) {\n if (!buffer) {\n buffer = new PooledBuffer(this.bufferSize, this.unresolvedDataArray, this.unresolvedLength);\n }\n else {\n buffer.fill(this.unresolvedDataArray, this.unresolvedLength);\n }\n this.unresolvedLength -= buffer.size;\n return buffer;\n }\n /**\n * Resolve data in unresolvedDataArray. For every buffer with size in blockSize\n * shifted, it will try to get (or allocate a buffer) from incoming, and fill it,\n * then push it into outgoing to be handled by outgoing handler.\n *\n * Return false when available buffers in incoming are not enough, else true.\n *\n * @returns Return false when buffers in incoming are not enough, else true.\n */\n resolveData() {\n while (this.unresolvedLength >= this.bufferSize) {\n let buffer;\n if (this.incoming.length > 0) {\n buffer = this.incoming.shift();\n this.shiftBufferFromUnresolvedDataArray(buffer);\n }\n else {\n if (this.numBuffers < this.maxBuffers) {\n buffer = this.shiftBufferFromUnresolvedDataArray();\n this.numBuffers++;\n }\n else {\n // No available buffer, wait for buffer returned\n return false;\n }\n }\n this.outgoing.push(buffer);\n this.triggerOutgoingHandlers();\n }\n return true;\n }\n /**\n * Try to trigger a outgoing handler for every buffer in outgoing. Stop when\n * concurrency reaches.\n */\n async triggerOutgoingHandlers() {\n let buffer;\n do {\n if (this.executingOutgoingHandlers >= this.concurrency) {\n return;\n }\n buffer = this.outgoing.shift();\n if (buffer) {\n this.triggerOutgoingHandler(buffer);\n }\n } while (buffer);\n }\n /**\n * Trigger a outgoing handler for a buffer shifted from outgoing.\n *\n * @param buffer -\n */\n async triggerOutgoingHandler(buffer) {\n const bufferLength = buffer.size;\n this.executingOutgoingHandlers++;\n this.offset += bufferLength;\n try {\n await this.outgoingHandler(() => buffer.getReadableStream(), bufferLength, this.offset - bufferLength);\n }\n catch (err) {\n this.emitter.emit(\"error\", err);\n return;\n }\n this.executingOutgoingHandlers--;\n this.reuseBuffer(buffer);\n this.emitter.emit(\"checkEnd\");\n }\n /**\n * Return buffer used by outgoing handler into incoming.\n *\n * @param buffer -\n */\n reuseBuffer(buffer) {\n this.incoming.push(buffer);\n if (!this.isError && this.resolveData() && !this.isStreamEnd) {\n this.readable.resume();\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * Reads a readable stream into buffer. Fill the buffer from offset to end.\n *\n * @param stream - A Node.js Readable stream\n * @param buffer - Buffer to be filled, length must greater than or equal to offset\n * @param offset - From which position in the buffer to be filled, inclusive\n * @param end - To which position in the buffer to be filled, exclusive\n * @param encoding - Encoding of the Readable stream\n */\nasync function streamToBuffer(stream, buffer, offset, end, encoding) {\n let pos = 0; // Position in stream\n const count = end - offset; // Total amount of data needed in stream\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error(`The operation cannot be completed in timeout.`)), REQUEST_TIMEOUT);\n stream.on(\"readable\", () => {\n if (pos >= count) {\n clearTimeout(timeout);\n resolve();\n return;\n }\n let chunk = stream.read();\n if (!chunk) {\n return;\n }\n if (typeof chunk === \"string\") {\n chunk = Buffer.from(chunk, encoding);\n }\n // How much data needed in this chunk\n const chunkLength = pos + chunk.length > count ? count - pos : chunk.length;\n buffer.fill(chunk.slice(0, chunkLength), offset + pos, offset + pos + chunkLength);\n pos += chunkLength;\n });\n stream.on(\"end\", () => {\n clearTimeout(timeout);\n if (pos < count) {\n reject(new Error(`Stream drains before getting enough data needed. Data read: ${pos}, data need: ${count}`));\n }\n resolve();\n });\n stream.on(\"error\", (msg) => {\n clearTimeout(timeout);\n reject(msg);\n });\n });\n}\n/**\n * Reads a readable stream into buffer entirely.\n *\n * @param stream - A Node.js Readable stream\n * @param buffer - Buffer to be filled, length must greater than or equal to offset\n * @param encoding - Encoding of the Readable stream\n * @returns with the count of bytes read.\n * @throws `RangeError` If buffer size is not big enough.\n */\nasync function streamToBuffer2(stream, buffer, encoding) {\n let pos = 0; // Position in stream\n const bufferSize = buffer.length;\n return new Promise((resolve, reject) => {\n stream.on(\"readable\", () => {\n let chunk = stream.read();\n if (!chunk) {\n return;\n }\n if (typeof chunk === \"string\") {\n chunk = Buffer.from(chunk, encoding);\n }\n if (pos + chunk.length > bufferSize) {\n reject(new Error(`Stream exceeds buffer size. Buffer size: ${bufferSize}`));\n return;\n }\n buffer.fill(chunk, pos, pos + chunk.length);\n pos += chunk.length;\n });\n stream.on(\"end\", () => {\n resolve(pos);\n });\n stream.on(\"error\", reject);\n });\n}\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Writes the content of a readstream to a local file. Returns a Promise which is completed after the file handle is closed.\n *\n * @param rs - The read stream.\n * @param file - Destination file path.\n */\nasync function readStreamToLocalFile(rs, file) {\n return new Promise((resolve, reject) => {\n const ws = fs__namespace.createWriteStream(file);\n rs.on(\"error\", (err) => {\n reject(err);\n });\n ws.on(\"error\", (err) => {\n reject(err);\n });\n ws.on(\"close\", resolve);\n rs.pipe(ws);\n });\n}\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Promisified version of fs.stat().\n */\nconst fsStat = util__namespace.promisify(fs__namespace.stat);\nconst fsCreateReadStream = fs__namespace.createReadStream;\n\n/**\n * A BlobClient represents a URL to an Azure Storage blob; the blob may be a block blob,\n * append blob, or page blob.\n */\nclass BlobClient extends StorageClient {\n constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n options = options || {};\n let pipeline;\n let url;\n if (isPipelineLike(credentialOrPipelineOrContainerName)) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrContainerName;\n }\n else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||\n credentialOrPipelineOrContainerName instanceof AnonymousCredential ||\n coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n url = urlOrConnectionString;\n options = blobNameOrOptions;\n pipeline = newPipeline(credentialOrPipelineOrContainerName, options);\n }\n else if (!credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName !== \"string\") {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n // The second parameter is undefined. Use anonymous credential.\n url = urlOrConnectionString;\n if (blobNameOrOptions && typeof blobNameOrOptions !== \"string\") {\n options = blobNameOrOptions;\n }\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else if (credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName === \"string\" &&\n blobNameOrOptions &&\n typeof blobNameOrOptions === \"string\") {\n // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)\n const containerName = credentialOrPipelineOrContainerName;\n const blobName = blobNameOrOptions;\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (coreHttp.isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);\n url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));\n if (!options.proxyOptions) {\n options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);\n }\n pipeline = newPipeline(sharedKeyCredential, options);\n }\n else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n }\n else if (extractedCreds.kind === \"SASConnString\") {\n url =\n appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +\n \"?\" +\n extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else {\n throw new Error(\"Connection string must be either an Account connection string or a SAS connection string\");\n }\n }\n else {\n throw new Error(\"Expecting non-empty strings for containerName and blobName parameters\");\n }\n super(url, pipeline);\n ({ blobName: this._name, containerName: this._containerName } =\n this.getBlobAndContainerNamesFromUrl());\n this.blobContext = new Blob$1(this.storageClientContext);\n this._snapshot = getURLParameter(this.url, URLConstants.Parameters.SNAPSHOT);\n this._versionId = getURLParameter(this.url, URLConstants.Parameters.VERSIONID);\n }\n /**\n * The name of the blob.\n */\n get name() {\n return this._name;\n }\n /**\n * The name of the storage container the blob is associated with.\n */\n get containerName() {\n return this._containerName;\n }\n /**\n * Creates a new BlobClient object identical to the source but with the specified snapshot timestamp.\n * Provide \"\" will remove the snapshot and return a Client to the base blob.\n *\n * @param snapshot - The snapshot timestamp.\n * @returns A new BlobClient object identical to the source but with the specified snapshot timestamp\n */\n withSnapshot(snapshot) {\n return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);\n }\n /**\n * Creates a new BlobClient object pointing to a version of this blob.\n * Provide \"\" will remove the versionId and return a Client to the base blob.\n *\n * @param versionId - The versionId.\n * @returns A new BlobClient object pointing to the version of this blob.\n */\n withVersion(versionId) {\n return new BlobClient(setURLParameter(this.url, URLConstants.Parameters.VERSIONID, versionId.length === 0 ? undefined : versionId), this.pipeline);\n }\n /**\n * Creates a AppendBlobClient object.\n *\n */\n getAppendBlobClient() {\n return new AppendBlobClient(this.url, this.pipeline);\n }\n /**\n * Creates a BlockBlobClient object.\n *\n */\n getBlockBlobClient() {\n return new BlockBlobClient(this.url, this.pipeline);\n }\n /**\n * Creates a PageBlobClient object.\n *\n */\n getPageBlobClient() {\n return new PageBlobClient(this.url, this.pipeline);\n }\n /**\n * Reads or downloads a blob from the system, including its metadata and properties.\n * You can also call Get Blob to read a snapshot.\n *\n * * In Node.js, data returns in a Readable stream readableStreamBody\n * * In browsers, data returns in a promise blobBody\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob\n *\n * @param offset - From which position of the blob to download, greater than or equal to 0\n * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined\n * @param options - Optional options to Blob Download operation.\n *\n *\n * Example usage (Node.js):\n *\n * ```js\n * // Download and convert a blob to a string\n * const downloadBlockBlobResponse = await blobClient.download();\n * const downloaded = await streamToBuffer(downloadBlockBlobResponse.readableStreamBody);\n * console.log(\"Downloaded blob content:\", downloaded.toString());\n *\n * async function streamToBuffer(readableStream) {\n * return new Promise((resolve, reject) => {\n * const chunks = [];\n * readableStream.on(\"data\", (data) => {\n * chunks.push(data instanceof Buffer ? data : Buffer.from(data));\n * });\n * readableStream.on(\"end\", () => {\n * resolve(Buffer.concat(chunks));\n * });\n * readableStream.on(\"error\", reject);\n * });\n * }\n * ```\n *\n * Example usage (browser):\n *\n * ```js\n * // Download and convert a blob to a string\n * const downloadBlockBlobResponse = await blobClient.download();\n * const downloaded = await blobToString(await downloadBlockBlobResponse.blobBody);\n * console.log(\n * \"Downloaded blob content\",\n * downloaded\n * );\n *\n * async function blobToString(blob: Blob): Promise {\n * const fileReader = new FileReader();\n * return new Promise((resolve, reject) => {\n * fileReader.onloadend = (ev: any) => {\n * resolve(ev.target!.result);\n * };\n * fileReader.onerror = reject;\n * fileReader.readAsText(blob);\n * });\n * }\n * ```\n */\n async download(offset = 0, count, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n options.conditions = options.conditions || {};\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n const { span, updatedOptions } = createSpan(\"BlobClient-download\", options);\n try {\n const res = await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {\n onDownloadProgress: coreHttp.isNode ? undefined : options.onProgress, // for Node.js, progress is reported by RetriableReadableStream\n }, range: offset === 0 && !count ? undefined : rangeToString({ offset, count }), rangeGetContentMD5: options.rangeGetContentMD5, rangeGetContentCRC64: options.rangeGetContentCrc64, snapshot: options.snapshot, cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)));\n const wrappedRes = Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) });\n // Return browser response immediately\n if (!coreHttp.isNode) {\n return wrappedRes;\n }\n // We support retrying when download stream unexpected ends in Node.js runtime\n // Following code shouldn't be bundled into browser build, however some\n // bundlers may try to bundle following code and \"FileReadResponse.ts\".\n // In this case, \"FileDownloadResponse.browser.ts\" will be used as a shim of \"FileDownloadResponse.ts\"\n // The config is in package.json \"browser\" field\n if (options.maxRetryRequests === undefined || options.maxRetryRequests < 0) {\n // TODO: Default value or make it a required parameter?\n options.maxRetryRequests = DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS;\n }\n if (res.contentLength === undefined) {\n throw new RangeError(`File download response doesn't contain valid content length header`);\n }\n if (!res.etag) {\n throw new RangeError(`File download response doesn't contain valid etag header`);\n }\n return new BlobDownloadResponse(wrappedRes, async (start) => {\n var _a;\n const updatedDownloadOptions = {\n leaseAccessConditions: options.conditions,\n modifiedAccessConditions: {\n ifMatch: options.conditions.ifMatch || res.etag,\n ifModifiedSince: options.conditions.ifModifiedSince,\n ifNoneMatch: options.conditions.ifNoneMatch,\n ifUnmodifiedSince: options.conditions.ifUnmodifiedSince,\n ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions,\n },\n range: rangeToString({\n count: offset + res.contentLength - start,\n offset: start,\n }),\n rangeGetContentMD5: options.rangeGetContentMD5,\n rangeGetContentCRC64: options.rangeGetContentCrc64,\n snapshot: options.snapshot,\n cpkInfo: options.customerProvidedKey,\n };\n // Debug purpose only\n // console.log(\n // `Read from internal stream, range: ${\n // updatedOptions.range\n // }, options: ${JSON.stringify(updatedOptions)}`\n // );\n return (await this.blobContext.download(Object.assign({ abortSignal: options.abortSignal }, updatedDownloadOptions))).readableStreamBody;\n }, offset, res.contentLength, {\n maxRetryRequests: options.maxRetryRequests,\n onProgress: options.onProgress,\n });\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns true if the Azure blob resource represented by this client exists; false otherwise.\n *\n * NOTE: use this function with care since an existing blob might be deleted by other clients or\n * applications. Vice versa new blobs might be added by other clients or applications after this\n * function completes.\n *\n * @param options - options to Exists operation.\n */\n async exists(options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobClient-exists\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n await this.getProperties({\n abortSignal: options.abortSignal,\n customerProvidedKey: options.customerProvidedKey,\n conditions: options.conditions,\n tracingOptions: updatedOptions.tracingOptions,\n });\n return true;\n }\n catch (e) {\n if (e.statusCode === 404) {\n // Expected exception when checking blob existence\n return false;\n }\n else if (e.statusCode === 409 &&\n (e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg ||\n e.details.errorCode === BlobDoesNotUseCustomerSpecifiedEncryption)) {\n // Expected exception when checking blob existence\n return true;\n }\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns all user-defined metadata, standard HTTP properties, and system properties\n * for the blob. It does not return the content of the blob.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-properties\n *\n * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if\n * they originally contained uppercase characters. This differs from the metadata keys returned by\n * the methods of {@link ContainerClient} that list blobs using the `includeMetadata` option, which\n * will retain their original casing.\n *\n * @param options - Optional options to Get Properties operation.\n */\n async getProperties(options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-getProperties\", options);\n try {\n options.conditions = options.conditions || {};\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n const res = await this.blobContext.getProperties(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)));\n return Object.assign(Object.assign({}, res), { _response: res._response, objectReplicationDestinationPolicyId: res.objectReplicationPolicyId, objectReplicationSourceProperties: parseObjectReplicationRecord(res.objectReplicationRules) });\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Marks the specified blob or snapshot for deletion. The blob is later deleted\n * during garbage collection. Note that in order to delete a blob, you must delete\n * all of its snapshots. You can delete both at the same time with the Delete\n * Blob operation.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob\n *\n * @param options - Optional options to Blob Delete operation.\n */\n async delete(options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-delete\", options);\n options.conditions = options.conditions || {};\n try {\n return await this.blobContext.delete(Object.assign({ abortSignal: options.abortSignal, deleteSnapshots: options.deleteSnapshots, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Marks the specified blob or snapshot for deletion if it exists. The blob is later deleted\n * during garbage collection. Note that in order to delete a blob, you must delete\n * all of its snapshots. You can delete both at the same time with the Delete\n * Blob operation.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob\n *\n * @param options - Optional options to Blob Delete operation.\n */\n async deleteIfExists(options = {}) {\n var _a, _b;\n const { span, updatedOptions } = createSpan(\"BlobClient-deleteIfExists\", options);\n try {\n const res = await this.delete(updatedOptions);\n return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });\n }\n catch (e) {\n if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === \"BlobNotFound\") {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: \"Expected exception when deleting a blob or snapshot only if it exists.\",\n });\n return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });\n }\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Restores the contents and metadata of soft deleted blob and any associated\n * soft deleted snapshots. Undelete Blob is supported only on version 2017-07-29\n * or later.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/undelete-blob\n *\n * @param options - Optional options to Blob Undelete operation.\n */\n async undelete(options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobClient-undelete\", options);\n try {\n return await this.blobContext.undelete(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Sets system properties on the blob.\n *\n * If no value provided, or no value provided for the specified blob HTTP headers,\n * these blob HTTP headers without a value will be cleared.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties\n *\n * @param blobHTTPHeaders - If no value provided, or no value provided for\n * the specified blob HTTP headers, these blob HTTP\n * headers without a value will be cleared.\n * A common header to set is `blobContentType`\n * enabling the browser to provide functionality\n * based on file type.\n * @param options - Optional options to Blob Set HTTP Headers operation.\n */\n async setHTTPHeaders(blobHTTPHeaders, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-setHTTPHeaders\", options);\n options.conditions = options.conditions || {};\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blobContext.setHttpHeaders(Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Sets user-defined metadata for the specified blob as one or more name-value pairs.\n *\n * If no option provided, or no metadata defined in the parameter, the blob\n * metadata will be removed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata\n *\n * @param metadata - Replace existing metadata with this value.\n * If no value provided the existing metadata will be removed.\n * @param options - Optional options to Set Metadata operation.\n */\n async setMetadata(metadata, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-setMetadata\", options);\n options.conditions = options.conditions || {};\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blobContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Sets tags on the underlying blob.\n * A blob can have up to 10 tags. Tag keys must be between 1 and 128 characters. Tag values must be between 0 and 256 characters.\n * Valid tag key and value characters include lower and upper case letters, digits (0-9),\n * space (' '), plus ('+'), minus ('-'), period ('.'), foward slash ('/'), colon (':'), equals ('='), and underscore ('_').\n *\n * @param tags -\n * @param options -\n */\n async setTags(tags, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-setTags\", options);\n try {\n return await this.blobContext.setTags(Object.assign(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)), { tags: toBlobTags(tags) }));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Gets the tags associated with the underlying blob.\n *\n * @param options -\n */\n async getTags(options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-getTags\", options);\n try {\n const response = await this.blobContext.getTags(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, tags: toTags({ blobTagSet: response.blobTagSet }) || {} });\n return wrappedResponse;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Get a {@link BlobLeaseClient} that manages leases on the blob.\n *\n * @param proposeLeaseId - Initial proposed lease Id.\n * @returns A new BlobLeaseClient object for managing leases on the blob.\n */\n getBlobLeaseClient(proposeLeaseId) {\n return new BlobLeaseClient(this, proposeLeaseId);\n }\n /**\n * Creates a read-only snapshot of a blob.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/snapshot-blob\n *\n * @param options - Optional options to the Blob Create Snapshot operation.\n */\n async createSnapshot(options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-createSnapshot\", options);\n options.conditions = options.conditions || {};\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blobContext.createSnapshot(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Asynchronously copies a blob to a destination within the storage account.\n * This method returns a long running operation poller that allows you to wait\n * indefinitely until the copy is completed.\n * You can also cancel a copy before it is completed by calling `cancelOperation` on the poller.\n * Note that the onProgress callback will not be invoked if the operation completes in the first\n * request, and attempting to cancel a completed copy will result in an error being thrown.\n *\n * In version 2012-02-12 and later, the source for a Copy Blob operation can be\n * a committed blob in any Azure storage account.\n * Beginning with version 2015-02-21, the source for a Copy Blob operation can be\n * an Azure file in any Azure storage account.\n * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob\n * operation to copy from another storage account.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob\n *\n * Example using automatic polling:\n *\n * ```js\n * const copyPoller = await blobClient.beginCopyFromURL('url');\n * const result = await copyPoller.pollUntilDone();\n * ```\n *\n * Example using manual polling:\n *\n * ```js\n * const copyPoller = await blobClient.beginCopyFromURL('url');\n * while (!poller.isDone()) {\n * await poller.poll();\n * }\n * const result = copyPoller.getResult();\n * ```\n *\n * Example using progress updates:\n *\n * ```js\n * const copyPoller = await blobClient.beginCopyFromURL('url', {\n * onProgress(state) {\n * console.log(`Progress: ${state.copyProgress}`);\n * }\n * });\n * const result = await copyPoller.pollUntilDone();\n * ```\n *\n * Example using a changing polling interval (default 15 seconds):\n *\n * ```js\n * const copyPoller = await blobClient.beginCopyFromURL('url', {\n * intervalInMs: 1000 // poll blob every 1 second for copy progress\n * });\n * const result = await copyPoller.pollUntilDone();\n * ```\n *\n * Example using copy cancellation:\n *\n * ```js\n * const copyPoller = await blobClient.beginCopyFromURL('url');\n * // cancel operation after starting it.\n * try {\n * await copyPoller.cancelOperation();\n * // calls to get the result now throw PollerCancelledError\n * await copyPoller.getResult();\n * } catch (err) {\n * if (err.name === 'PollerCancelledError') {\n * console.log('The copy was cancelled.');\n * }\n * }\n * ```\n *\n * @param copySource - url to the source Azure Blob/File.\n * @param options - Optional options to the Blob Start Copy From URL operation.\n */\n async beginCopyFromURL(copySource, options = {}) {\n const client = {\n abortCopyFromURL: (...args) => this.abortCopyFromURL(...args),\n getProperties: (...args) => this.getProperties(...args),\n startCopyFromURL: (...args) => this.startCopyFromURL(...args),\n };\n const poller = new BlobBeginCopyFromUrlPoller({\n blobClient: client,\n copySource,\n intervalInMs: options.intervalInMs,\n onProgress: options.onProgress,\n resumeFrom: options.resumeFrom,\n startCopyFromURLOptions: options,\n });\n // Trigger the startCopyFromURL call by calling poll.\n // Any errors from this method should be surfaced to the user.\n await poller.poll();\n return poller;\n }\n /**\n * Aborts a pending asynchronous Copy Blob operation, and leaves a destination blob with zero\n * length and full metadata. Version 2012-02-12 and newer.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/abort-copy-blob\n *\n * @param copyId - Id of the Copy From URL operation.\n * @param options - Optional options to the Blob Abort Copy From URL operation.\n */\n async abortCopyFromURL(copyId, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobClient-abortCopyFromURL\", options);\n try {\n return await this.blobContext.abortCopyFromURL(copyId, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * The synchronous Copy From URL operation copies a blob or an internet resource to a new blob. It will not\n * return a response until the copy is complete.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob-from-url\n *\n * @param copySource - The source URL to copy from, Shared Access Signature(SAS) maybe needed for authentication\n * @param options -\n */\n async syncCopyFromURL(copySource, options = {}) {\n var _a, _b, _c;\n const { span, updatedOptions } = createSpan(\"BlobClient-syncCopyFromURL\", options);\n options.conditions = options.conditions || {};\n options.sourceConditions = options.sourceConditions || {};\n try {\n return await this.blobContext.copyFromURL(copySource, Object.assign({ abortSignal: options.abortSignal, metadata: options.metadata, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: {\n sourceIfMatch: options.sourceConditions.ifMatch,\n sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,\n sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,\n sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,\n }, 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)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Sets the tier on a blob. The operation is allowed on a page blob in a premium\n * storage account and on a block blob in a blob storage account (locally redundant\n * storage only). A premium page blob's tier determines the allowed size, IOPS,\n * and bandwidth of the blob. A block blob's tier determines Hot/Cool/Archive\n * storage type. This operation does not update the blob's ETag.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-tier\n *\n * @param tier - The tier to be set on the blob. Valid values are Hot, Cool, or Archive.\n * @param options - Optional options to the Blob Set Tier operation.\n */\n async setAccessTier(tier, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobClient-setAccessTier\", options);\n try {\n return await this.blobContext.setTier(toAccessTier(tier), Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), rehydratePriority: options.rehydratePriority }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n async downloadToBuffer(param1, param2, param3, param4 = {}) {\n let buffer;\n let offset = 0;\n let count = 0;\n let options = param4;\n if (param1 instanceof Buffer) {\n buffer = param1;\n offset = param2 || 0;\n count = typeof param3 === \"number\" ? param3 : 0;\n }\n else {\n offset = typeof param1 === \"number\" ? param1 : 0;\n count = typeof param2 === \"number\" ? param2 : 0;\n options = param3 || {};\n }\n const { span, updatedOptions } = createSpan(\"BlobClient-downloadToBuffer\", options);\n try {\n if (!options.blockSize) {\n options.blockSize = 0;\n }\n if (options.blockSize < 0) {\n throw new RangeError(\"blockSize option must be >= 0\");\n }\n if (options.blockSize === 0) {\n options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES;\n }\n if (offset < 0) {\n throw new RangeError(\"offset option must be >= 0\");\n }\n if (count && count <= 0) {\n throw new RangeError(\"count option must be greater than 0\");\n }\n if (!options.conditions) {\n options.conditions = {};\n }\n // Customer doesn't specify length, get it\n if (!count) {\n const response = await this.getProperties(Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) }));\n count = response.contentLength - offset;\n if (count < 0) {\n throw new RangeError(`offset ${offset} shouldn't be larger than blob size ${response.contentLength}`);\n }\n }\n // Allocate the buffer of size = count if the buffer is not provided\n if (!buffer) {\n try {\n buffer = Buffer.alloc(count);\n }\n catch (error) {\n throw new Error(`Unable to allocate the buffer of size: ${count}(in bytes). Please try passing your own buffer to the \"downloadToBuffer\" method or try using other methods like \"download\" or \"downloadToFile\".\\t ${error.message}`);\n }\n }\n if (buffer.length < count) {\n throw new RangeError(`The buffer's size should be equal to or larger than the request count of bytes: ${count}`);\n }\n let transferProgress = 0;\n const batch = new Batch(options.concurrency);\n for (let off = offset; off < offset + count; off = off + options.blockSize) {\n batch.addOperation(async () => {\n // Exclusive chunk end position\n let chunkEnd = offset + count;\n if (off + options.blockSize < chunkEnd) {\n chunkEnd = off + options.blockSize;\n }\n const response = await this.download(off, chunkEnd - off, {\n abortSignal: options.abortSignal,\n conditions: options.conditions,\n maxRetryRequests: options.maxRetryRequestsPerBlock,\n customerProvidedKey: options.customerProvidedKey,\n tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)),\n });\n const stream = response.readableStreamBody;\n await streamToBuffer(stream, buffer, off - offset, chunkEnd - offset);\n // Update progress after block is downloaded, in case of block trying\n // Could provide finer grained progress updating inside HTTP requests,\n // only if convenience layer download try is enabled\n transferProgress += chunkEnd - off;\n if (options.onProgress) {\n options.onProgress({ loadedBytes: transferProgress });\n }\n });\n }\n await batch.do();\n return buffer;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Downloads an Azure Blob to a local file.\n * Fails if the the given file path already exits.\n * Offset and count are optional, pass 0 and undefined respectively to download the entire blob.\n *\n * @param filePath -\n * @param offset - From which position of the block blob to download.\n * @param count - How much data to be downloaded. Will download to the end when passing undefined.\n * @param options - Options to Blob download options.\n * @returns The response data for blob download operation,\n * but with readableStreamBody set to undefined since its\n * content is already read and written into a local file\n * at the specified path.\n */\n async downloadToFile(filePath, offset = 0, count, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobClient-downloadToFile\", options);\n try {\n const response = await this.download(offset, count, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) }));\n if (response.readableStreamBody) {\n await readStreamToLocalFile(response.readableStreamBody, filePath);\n }\n // The stream is no longer accessible so setting it to undefined.\n response.blobDownloadStream = undefined;\n return response;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n getBlobAndContainerNamesFromUrl() {\n let containerName;\n let blobName;\n try {\n // URL may look like the following\n // \"https://myaccount.blob.core.windows.net/mycontainer/blob?sasString\";\n // \"https://myaccount.blob.core.windows.net/mycontainer/blob\";\n // \"https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt?sasString\";\n // \"https://myaccount.blob.core.windows.net/mycontainer/blob/a.txt\";\n // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername/blob`\n // http://localhost:10001/devstoreaccount1/containername/blob\n const parsedUrl = coreHttp.URLBuilder.parse(this.url);\n if (parsedUrl.getHost().split(\".\")[1] === \"blob\") {\n // \"https://myaccount.blob.core.windows.net/containername/blob\".\n // .getPath() -> /containername/blob\n const pathComponents = parsedUrl.getPath().match(\"/([^/]*)(/(.*))?\");\n containerName = pathComponents[1];\n blobName = pathComponents[3];\n }\n else if (isIpEndpointStyle(parsedUrl)) {\n // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername/blob\n // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername/blob\n // .getPath() -> /devstoreaccount1/containername/blob\n const pathComponents = parsedUrl.getPath().match(\"/([^/]*)/([^/]*)(/(.*))?\");\n containerName = pathComponents[2];\n blobName = pathComponents[4];\n }\n else {\n // \"https://customdomain.com/containername/blob\".\n // .getPath() -> /containername/blob\n const pathComponents = parsedUrl.getPath().match(\"/([^/]*)(/(.*))?\");\n containerName = pathComponents[1];\n blobName = pathComponents[3];\n }\n // decode the encoded blobName, containerName - to get all the special characters that might be present in them\n containerName = decodeURIComponent(containerName);\n blobName = decodeURIComponent(blobName);\n // Azure Storage Server will replace \"\\\" with \"/\" in the blob names\n // doing the same in the SDK side so that the user doesn't have to replace \"\\\" instances in the blobName\n blobName = blobName.replace(/\\\\/g, \"/\");\n if (!containerName) {\n throw new Error(\"Provided containerName is invalid.\");\n }\n return { blobName, containerName };\n }\n catch (error) {\n throw new Error(\"Unable to extract blobName and containerName with provided information.\");\n }\n }\n /**\n * Asynchronously copies a blob to a destination within the storage account.\n * In version 2012-02-12 and later, the source for a Copy Blob operation can be\n * a committed blob in any Azure storage account.\n * Beginning with version 2015-02-21, the source for a Copy Blob operation can be\n * an Azure file in any Azure storage account.\n * Only storage accounts created on or after June 7th, 2012 allow the Copy Blob\n * operation to copy from another storage account.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/copy-blob\n *\n * @param copySource - url to the source Azure Blob/File.\n * @param options - Optional options to the Blob Start Copy From URL operation.\n */\n async startCopyFromURL(copySource, options = {}) {\n var _a, _b, _c;\n const { span, updatedOptions } = createSpan(\"BlobClient-startCopyFromURL\", options);\n options.conditions = options.conditions || {};\n options.sourceConditions = options.sourceConditions || {};\n try {\n return await this.blobContext.startCopyFromURL(copySource, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: {\n sourceIfMatch: options.sourceConditions.ifMatch,\n sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,\n sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,\n sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,\n sourceIfTags: options.sourceConditions.tagConditions,\n }, 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, rehydratePriority: options.rehydratePriority, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), sealBlob: options.sealBlob }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Only available for BlobClient constructed with a shared key credential.\n *\n * Generates a Blob Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n generateSasUrl(options) {\n return new Promise((resolve) => {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw new RangeError(\"Can only generate the SAS when the client is initialized with a shared key credential\");\n }\n const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName, blobName: this._name, snapshotTime: this._snapshot, versionId: this._versionId }, options), this.credential).toString();\n resolve(appendToURLQuery(this.url, sas));\n });\n }\n /**\n * Delete the immutablility policy on the blob.\n *\n * @param options - Optional options to delete immutability policy on the blob.\n */\n async deleteImmutabilityPolicy(options) {\n const { span, updatedOptions } = createSpan(\"BlobClient-deleteImmutabilityPolicy\", options);\n try {\n return await this.blobContext.deleteImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Set immutablility policy on the blob.\n *\n * @param options - Optional options to set immutability policy on the blob.\n */\n async setImmutabilityPolicy(immutabilityPolicy, options) {\n const { span, updatedOptions } = createSpan(\"BlobClient-setImmutabilityPolicy\", options);\n try {\n return await this.blobContext.setImmutabilityPolicy(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, immutabilityPolicyExpiry: immutabilityPolicy.expiriesOn, immutabilityPolicyMode: immutabilityPolicy.policyMode, modifiedAccessConditions: options === null || options === void 0 ? void 0 : options.modifiedAccessCondition }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Set legal hold on the blob.\n *\n * @param options - Optional options to set legal hold on the blob.\n */\n async setLegalHold(legalHoldEnabled, options) {\n const { span, updatedOptions } = createSpan(\"BlobClient-setLegalHold\", options);\n try {\n return await this.blobContext.setLegalHold(legalHoldEnabled, Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n}\n/**\n * AppendBlobClient defines a set of operations applicable to append blobs.\n */\nclass AppendBlobClient extends BlobClient {\n constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.\n // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);\n let pipeline;\n let url;\n options = options || {};\n if (isPipelineLike(credentialOrPipelineOrContainerName)) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrContainerName;\n }\n else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||\n credentialOrPipelineOrContainerName instanceof AnonymousCredential ||\n coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions) url = urlOrConnectionString;\n url = urlOrConnectionString;\n options = blobNameOrOptions;\n pipeline = newPipeline(credentialOrPipelineOrContainerName, options);\n }\n else if (!credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName !== \"string\") {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n url = urlOrConnectionString;\n // The second parameter is undefined. Use anonymous credential.\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else if (credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName === \"string\" &&\n blobNameOrOptions &&\n typeof blobNameOrOptions === \"string\") {\n // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)\n const containerName = credentialOrPipelineOrContainerName;\n const blobName = blobNameOrOptions;\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (coreHttp.isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);\n url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));\n if (!options.proxyOptions) {\n options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);\n }\n pipeline = newPipeline(sharedKeyCredential, options);\n }\n else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n }\n else if (extractedCreds.kind === \"SASConnString\") {\n url =\n appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +\n \"?\" +\n extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else {\n throw new Error(\"Connection string must be either an Account connection string or a SAS connection string\");\n }\n }\n else {\n throw new Error(\"Expecting non-empty strings for containerName and blobName parameters\");\n }\n super(url, pipeline);\n this.appendBlobContext = new AppendBlob(this.storageClientContext);\n }\n /**\n * Creates a new AppendBlobClient object identical to the source but with the\n * specified snapshot timestamp.\n * Provide \"\" will remove the snapshot and return a Client to the base blob.\n *\n * @param snapshot - The snapshot timestamp.\n * @returns A new AppendBlobClient object identical to the source but with the specified snapshot timestamp.\n */\n withSnapshot(snapshot) {\n return new AppendBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);\n }\n /**\n * Creates a 0-length append blob. Call AppendBlock to append data to an append blob.\n * @see https://docs.microsoft.com/rest/api/storageservices/put-blob\n *\n * @param options - Options to the Append Block Create operation.\n *\n *\n * Example usage:\n *\n * ```js\n * const appendBlobClient = containerClient.getAppendBlobClient(\"\");\n * await appendBlobClient.create();\n * ```\n */\n async create(options = {}) {\n var _a, _b, _c;\n const { span, updatedOptions } = createSpan(\"AppendBlobClient-create\", options);\n options.conditions = options.conditions || {};\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.appendBlobContext.create(0, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, 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, blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Creates a 0-length append blob. Call AppendBlock to append data to an append blob.\n * If the blob with the same name already exists, the content of the existing blob will remain unchanged.\n * @see https://docs.microsoft.com/rest/api/storageservices/put-blob\n *\n * @param options -\n */\n async createIfNotExists(options = {}) {\n var _a, _b;\n const { span, updatedOptions } = createSpan(\"AppendBlobClient-createIfNotExists\", options);\n const conditions = { ifNoneMatch: ETagAny };\n try {\n const res = await this.create(Object.assign(Object.assign({}, updatedOptions), { conditions }));\n return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });\n }\n catch (e) {\n if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === \"BlobAlreadyExists\") {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: \"Expected exception when creating a blob only if it does not already exist.\",\n });\n return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });\n }\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Seals the append blob, making it read only.\n *\n * @param options -\n */\n async seal(options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"AppendBlobClient-seal\", options);\n options.conditions = options.conditions || {};\n try {\n return await this.appendBlobContext.seal(Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Commits a new block of data to the end of the existing append blob.\n * @see https://docs.microsoft.com/rest/api/storageservices/append-block\n *\n * @param body - Data to be appended.\n * @param contentLength - Length of the body in bytes.\n * @param options - Options to the Append Block operation.\n *\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello World!\";\n *\n * // Create a new append blob and append data to the blob.\n * const newAppendBlobClient = containerClient.getAppendBlobClient(\"\");\n * await newAppendBlobClient.create();\n * await newAppendBlobClient.appendBlock(content, content.length);\n *\n * // Append data to an existing append blob.\n * const existingAppendBlobClient = containerClient.getAppendBlobClient(\"\");\n * await existingAppendBlobClient.appendBlock(content, content.length);\n * ```\n */\n async appendBlock(body, contentLength, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"AppendBlobClient-appendBlock\", options);\n options.conditions = options.conditions || {};\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.appendBlobContext.appendBlock(contentLength, body, Object.assign({ abortSignal: options.abortSignal, appendPositionAccessConditions: options.conditions, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {\n onUploadProgress: options.onProgress,\n }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * The Append Block operation commits a new block of data to the end of an existing append blob\n * where the contents are read from a source url.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/append-block-from-url\n *\n * @param sourceURL -\n * The url to the blob that will be the source of the copy. A source blob in the same storage account can\n * be authenticated via Shared Key. However, if the source is a blob in another account, the source blob\n * must either be public or must be authenticated via a shared access signature. If the source blob is\n * public, no authentication is required to perform the operation.\n * @param sourceOffset - Offset in source to be appended\n * @param count - Number of bytes to be appended as a block\n * @param options -\n */\n async appendBlockFromURL(sourceURL, sourceOffset, count, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"AppendBlobClient-appendBlockFromURL\", options);\n options.conditions = options.conditions || {};\n options.sourceConditions = options.sourceConditions || {};\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.appendBlobContext.appendBlockFromUrl(sourceURL, 0, Object.assign({ abortSignal: options.abortSignal, sourceRange: rangeToString({ offset: sourceOffset, count }), sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, appendPositionAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: {\n sourceIfMatch: options.sourceConditions.ifMatch,\n sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,\n sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,\n sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,\n }, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n}\n/**\n * BlockBlobClient defines a set of operations applicable to block blobs.\n */\nclass BlockBlobClient extends BlobClient {\n constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.\n // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);\n let pipeline;\n let url;\n options = options || {};\n if (isPipelineLike(credentialOrPipelineOrContainerName)) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrContainerName;\n }\n else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||\n credentialOrPipelineOrContainerName instanceof AnonymousCredential ||\n coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n url = urlOrConnectionString;\n options = blobNameOrOptions;\n pipeline = newPipeline(credentialOrPipelineOrContainerName, options);\n }\n else if (!credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName !== \"string\") {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n // The second parameter is undefined. Use anonymous credential.\n url = urlOrConnectionString;\n if (blobNameOrOptions && typeof blobNameOrOptions !== \"string\") {\n options = blobNameOrOptions;\n }\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else if (credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName === \"string\" &&\n blobNameOrOptions &&\n typeof blobNameOrOptions === \"string\") {\n // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)\n const containerName = credentialOrPipelineOrContainerName;\n const blobName = blobNameOrOptions;\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (coreHttp.isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);\n url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));\n if (!options.proxyOptions) {\n options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);\n }\n pipeline = newPipeline(sharedKeyCredential, options);\n }\n else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n }\n else if (extractedCreds.kind === \"SASConnString\") {\n url =\n appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +\n \"?\" +\n extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else {\n throw new Error(\"Connection string must be either an Account connection string or a SAS connection string\");\n }\n }\n else {\n throw new Error(\"Expecting non-empty strings for containerName and blobName parameters\");\n }\n super(url, pipeline);\n this.blockBlobContext = new BlockBlob(this.storageClientContext);\n this._blobContext = new Blob$1(this.storageClientContext);\n }\n /**\n * Creates a new BlockBlobClient object identical to the source but with the\n * specified snapshot timestamp.\n * Provide \"\" will remove the snapshot and return a URL to the base blob.\n *\n * @param snapshot - The snapshot timestamp.\n * @returns A new BlockBlobClient object identical to the source but with the specified snapshot timestamp.\n */\n withSnapshot(snapshot) {\n return new BlockBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);\n }\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Quick query for a JSON or CSV formatted blob.\n *\n * Example usage (Node.js):\n *\n * ```js\n * // Query and convert a blob to a string\n * const queryBlockBlobResponse = await blockBlobClient.query(\"select * from BlobStorage\");\n * const downloaded = (await streamToBuffer(queryBlockBlobResponse.readableStreamBody)).toString();\n * console.log(\"Query blob content:\", downloaded);\n *\n * async function streamToBuffer(readableStream) {\n * return new Promise((resolve, reject) => {\n * const chunks = [];\n * readableStream.on(\"data\", (data) => {\n * chunks.push(data instanceof Buffer ? data : Buffer.from(data));\n * });\n * readableStream.on(\"end\", () => {\n * resolve(Buffer.concat(chunks));\n * });\n * readableStream.on(\"error\", reject);\n * });\n * }\n * ```\n *\n * @param query -\n * @param options -\n */\n async query(query, options = {}) {\n var _a;\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-query\", options);\n try {\n if (!coreHttp.isNode) {\n throw new Error(\"This operation currently is only supported in Node.js.\");\n }\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n const response = await this._blobContext.query(Object.assign({ abortSignal: options.abortSignal, queryRequest: {\n queryType: \"SQL\",\n expression: query,\n inputSerialization: toQuerySerialization(options.inputTextConfiguration),\n outputSerialization: toQuerySerialization(options.outputTextConfiguration),\n }, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey }, convertTracingToRequestOptionsBase(updatedOptions)));\n return new BlobQueryResponse(response, {\n abortSignal: options.abortSignal,\n onProgress: options.onProgress,\n onError: options.onError,\n });\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Creates a new block blob, or updates the content of an existing block blob.\n * Updating an existing block blob overwrites any existing metadata on the blob.\n * Partial updates are not supported; the content of the existing blob is\n * overwritten with the new content. To perform a partial update of a block blob's,\n * use {@link stageBlock} and {@link commitBlockList}.\n *\n * This is a non-parallel uploading method, please use {@link uploadFile},\n * {@link uploadStream} or {@link uploadBrowserData} for better performance\n * with concurrency uploading.\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/put-blob\n *\n * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function\n * which returns a new Readable stream whose offset is from data source beginning.\n * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a\n * string including non non-Base64/Hex-encoded characters.\n * @param options - Options to the Block Blob Upload operation.\n * @returns Response data for the Block Blob Upload operation.\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello world!\";\n * const uploadBlobResponse = await blockBlobClient.upload(content, content.length);\n * ```\n */\n async upload(body, contentLength, options = {}) {\n var _a, _b, _c;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-upload\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blockBlobContext.upload(contentLength, body, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {\n onUploadProgress: options.onProgress,\n }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, 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, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Creates a new Block Blob where the contents of the blob are read from a given URL.\n * This API is supported beginning with the 2020-04-08 version. Partial updates\n * are not supported with Put Blob from URL; the content of an existing blob is overwritten with\n * the content of the new blob. To perform partial updates to a block blob’s contents using a\n * source URL, use {@link stageBlockFromURL} and {@link commitBlockList}.\n *\n * @param sourceURL - Specifies the URL of the blob. The value\n * may be a URL of up to 2 KB in length that specifies a blob.\n * The value should be URL-encoded as it would appear\n * in a request URI. The source blob must either be public\n * or must be authenticated via a shared access signature.\n * If the source blob is public, no authentication is required\n * to perform the operation. Here are some examples of source object URLs:\n * - https://myaccount.blob.core.windows.net/mycontainer/myblob\n * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=\n * @param options - Optional parameters.\n */\n async syncUploadFromURL(sourceURL, options = {}) {\n var _a, _b, _c, _d, _e;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-syncUploadFromURL\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blockBlobContext.putBlobFromUrl(0, sourceURL, Object.assign(Object.assign(Object.assign({}, options), { blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: options.conditions.tagConditions }), sourceModifiedAccessConditions: {\n sourceIfMatch: (_a = options.sourceConditions) === null || _a === void 0 ? void 0 : _a.ifMatch,\n sourceIfModifiedSince: (_b = options.sourceConditions) === null || _b === void 0 ? void 0 : _b.ifModifiedSince,\n sourceIfNoneMatch: (_c = options.sourceConditions) === null || _c === void 0 ? void 0 : _c.ifNoneMatch,\n sourceIfUnmodifiedSince: (_d = options.sourceConditions) === null || _d === void 0 ? void 0 : _d.ifUnmodifiedSince,\n sourceIfTags: (_e = options.sourceConditions) === null || _e === void 0 ? void 0 : _e.tagConditions,\n }, cpkInfo: options.customerProvidedKey, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization), tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags), copySourceTags: options.copySourceTags }), convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Uploads the specified block to the block blob's \"staging area\" to be later\n * committed by a call to commitBlockList.\n * @see https://docs.microsoft.com/rest/api/storageservices/put-block\n *\n * @param blockId - A 64-byte value that is base64-encoded\n * @param body - Data to upload to the staging area.\n * @param contentLength - Number of bytes to upload.\n * @param options - Options to the Block Blob Stage Block operation.\n * @returns Response data for the Block Blob Stage Block operation.\n */\n async stageBlock(blockId, body, contentLength, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-stageBlock\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blockBlobContext.stageBlock(blockId, contentLength, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, requestOptions: {\n onUploadProgress: options.onProgress,\n }, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * The Stage Block From URL operation creates a new block to be committed as part\n * of a blob where the contents are read from a URL.\n * This API is available starting in version 2018-03-28.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-from-url\n *\n * @param blockId - A 64-byte value that is base64-encoded\n * @param sourceURL - Specifies the URL of the blob. The value\n * may be a URL of up to 2 KB in length that specifies a blob.\n * The value should be URL-encoded as it would appear\n * in a request URI. The source blob must either be public\n * or must be authenticated via a shared access signature.\n * If the source blob is public, no authentication is required\n * to perform the operation. Here are some examples of source object URLs:\n * - https://myaccount.blob.core.windows.net/mycontainer/myblob\n * - https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=\n * @param offset - From which position of the blob to download, greater than or equal to 0\n * @param count - How much data to be downloaded, greater than 0. Will download to the end when undefined\n * @param options - Options to the Block Blob Stage Block From URL operation.\n * @returns Response data for the Block Blob Stage Block From URL operation.\n */\n async stageBlockFromURL(blockId, sourceURL, offset = 0, count, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-stageBlockFromURL\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blockBlobContext.stageBlockFromURL(blockId, 0, sourceURL, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, sourceRange: offset === 0 && !count ? undefined : rangeToString({ offset, count }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Writes a blob by specifying the list of block IDs that make up the blob.\n * In order to be written as part of a blob, a block must have been successfully written\n * to the server in a prior {@link stageBlock} operation. You can call {@link commitBlockList} to\n * update a blob by uploading only those blocks that have changed, then committing the new and existing\n * blocks together. Any blocks not specified in the block list and permanently deleted.\n * @see https://docs.microsoft.com/rest/api/storageservices/put-block-list\n *\n * @param blocks - Array of 64-byte value that is base64-encoded\n * @param options - Options to the Block Blob Commit Block List operation.\n * @returns Response data for the Block Blob Commit Block List operation.\n */\n async commitBlockList(blocks, options = {}) {\n var _a, _b, _c;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-commitBlockList\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.blockBlobContext.commitBlockList({ latest: blocks }, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, 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, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns the list of blocks that have been uploaded as part of a block blob\n * using the specified block list filter.\n * @see https://docs.microsoft.com/rest/api/storageservices/get-block-list\n *\n * @param listType - Specifies whether to return the list of committed blocks,\n * the list of uncommitted blocks, or both lists together.\n * @param options - Options to the Block Blob Get Block List operation.\n * @returns Response data for the Block Blob Get Block List operation.\n */\n async getBlockList(listType, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-getBlockList\", options);\n try {\n const res = await this.blockBlobContext.getBlockList(listType, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n if (!res.committedBlocks) {\n res.committedBlocks = [];\n }\n if (!res.uncommittedBlocks) {\n res.uncommittedBlocks = [];\n }\n return res;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n // High level functions\n /**\n * Uploads a Buffer(Node.js)/Blob(browsers)/ArrayBuffer/ArrayBufferView object to a BlockBlob.\n *\n * When data length is no more than the specifiled {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is\n * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.\n * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}\n * to commit the block list.\n *\n * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is\n * `blobContentType`, enabling the browser to provide\n * functionality based on file type.\n *\n * @param data - Buffer(Node.js), Blob, ArrayBuffer or ArrayBufferView\n * @param options -\n */\n async uploadData(data, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-uploadData\", options);\n try {\n if (coreHttp.isNode) {\n let buffer;\n if (data instanceof Buffer) {\n buffer = data;\n }\n else if (data instanceof ArrayBuffer) {\n buffer = Buffer.from(data);\n }\n else {\n data = data;\n buffer = Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n }\n return this.uploadSeekableInternal((offset, size) => buffer.slice(offset, offset + size), buffer.byteLength, updatedOptions);\n }\n else {\n const browserBlob = new Blob([data]);\n return this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);\n }\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * ONLY AVAILABLE IN BROWSERS.\n *\n * Uploads a browser Blob/File/ArrayBuffer/ArrayBufferView object to block blob.\n *\n * When buffer length lesser than or equal to 256MB, this method will use 1 upload call to finish the upload.\n * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call\n * {@link commitBlockList} to commit the block list.\n *\n * A common {@link BlockBlobParallelUploadOptions.blobHTTPHeaders} option to set is\n * `blobContentType`, enabling the browser to provide\n * functionality based on file type.\n *\n * @deprecated Use {@link uploadData} instead.\n *\n * @param browserData - Blob, File, ArrayBuffer or ArrayBufferView\n * @param options - Options to upload browser data.\n * @returns Response data for the Blob Upload operation.\n */\n async uploadBrowserData(browserData, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-uploadBrowserData\", options);\n try {\n const browserBlob = new Blob([browserData]);\n return await this.uploadSeekableInternal((offset, size) => browserBlob.slice(offset, offset + size), browserBlob.size, updatedOptions);\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n *\n * Uploads data to block blob. Requires a bodyFactory as the data source,\n * which need to return a {@link HttpRequestBody} object with the offset and size provided.\n *\n * When data length is no more than the specified {@link BlockBlobParallelUploadOptions.maxSingleShotSize} (default is\n * {@link BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}), this method will use 1 {@link upload} call to finish the upload.\n * Otherwise, this method will call {@link stageBlock} to upload blocks, and finally call {@link commitBlockList}\n * to commit the block list.\n *\n * @param bodyFactory -\n * @param size - size of the data to upload.\n * @param options - Options to Upload to Block Blob operation.\n * @returns Response data for the Blob Upload operation.\n */\n async uploadSeekableInternal(bodyFactory, size, options = {}) {\n if (!options.blockSize) {\n options.blockSize = 0;\n }\n if (options.blockSize < 0 || options.blockSize > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES) {\n throw new RangeError(`blockSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES}`);\n }\n if (options.maxSingleShotSize !== 0 && !options.maxSingleShotSize) {\n options.maxSingleShotSize = BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES;\n }\n if (options.maxSingleShotSize < 0 ||\n options.maxSingleShotSize > BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES) {\n throw new RangeError(`maxSingleShotSize option must be >= 0 and <= ${BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES}`);\n }\n if (options.blockSize === 0) {\n if (size > BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES * BLOCK_BLOB_MAX_BLOCKS) {\n throw new RangeError(`${size} is too larger to upload to a block blob.`);\n }\n if (size > options.maxSingleShotSize) {\n options.blockSize = Math.ceil(size / BLOCK_BLOB_MAX_BLOCKS);\n if (options.blockSize < DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES) {\n options.blockSize = DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES;\n }\n }\n }\n if (!options.blobHTTPHeaders) {\n options.blobHTTPHeaders = {};\n }\n if (!options.conditions) {\n options.conditions = {};\n }\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-uploadSeekableInternal\", options);\n try {\n if (size <= options.maxSingleShotSize) {\n return await this.upload(bodyFactory(0, size), size, updatedOptions);\n }\n const numBlocks = Math.floor((size - 1) / options.blockSize) + 1;\n if (numBlocks > BLOCK_BLOB_MAX_BLOCKS) {\n throw new RangeError(`The buffer's size is too big or the BlockSize is too small;` +\n `the number of blocks must be <= ${BLOCK_BLOB_MAX_BLOCKS}`);\n }\n const blockList = [];\n const blockIDPrefix = coreHttp.generateUuid();\n let transferProgress = 0;\n const batch = new Batch(options.concurrency);\n for (let i = 0; i < numBlocks; i++) {\n batch.addOperation(async () => {\n const blockID = generateBlockID(blockIDPrefix, i);\n const start = options.blockSize * i;\n const end = i === numBlocks - 1 ? size : start + options.blockSize;\n const contentLength = end - start;\n blockList.push(blockID);\n await this.stageBlock(blockID, bodyFactory(start, contentLength), contentLength, {\n abortSignal: options.abortSignal,\n conditions: options.conditions,\n encryptionScope: options.encryptionScope,\n tracingOptions: updatedOptions.tracingOptions,\n });\n // Update progress after block is successfully uploaded to server, in case of block trying\n // TODO: Hook with convenience layer progress event in finer level\n transferProgress += contentLength;\n if (options.onProgress) {\n options.onProgress({\n loadedBytes: transferProgress,\n });\n }\n });\n }\n await batch.do();\n return this.commitBlockList(blockList, updatedOptions);\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Uploads a local file in blocks to a block blob.\n *\n * When file size lesser than or equal to 256MB, this method will use 1 upload call to finish the upload.\n * Otherwise, this method will call stageBlock to upload blocks, and finally call commitBlockList\n * to commit the block list.\n *\n * @param filePath - Full path of local file\n * @param options - Options to Upload to Block Blob operation.\n * @returns Response data for the Blob Upload operation.\n */\n async uploadFile(filePath, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-uploadFile\", options);\n try {\n const size = (await fsStat(filePath)).size;\n return await this.uploadSeekableInternal((offset, count) => {\n return () => fsCreateReadStream(filePath, {\n autoClose: true,\n end: count ? offset + count - 1 : Infinity,\n start: offset,\n });\n }, size, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) }));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Uploads a Node.js Readable stream into block blob.\n *\n * PERFORMANCE IMPROVEMENT TIPS:\n * * Input stream highWaterMark is better to set a same value with bufferSize\n * parameter, which will avoid Buffer.concat() operations.\n *\n * @param stream - Node.js Readable stream\n * @param bufferSize - Size of every buffer allocated, also the block size in the uploaded block blob. Default value is 8MB\n * @param maxConcurrency - Max concurrency indicates the max number of buffers that can be allocated,\n * positive correlation with max uploading concurrency. Default value is 5\n * @param options - Options to Upload Stream to Block Blob operation.\n * @returns Response data for the Blob Upload operation.\n */\n async uploadStream(stream, bufferSize = DEFAULT_BLOCK_BUFFER_SIZE_BYTES, maxConcurrency = 5, options = {}) {\n if (!options.blobHTTPHeaders) {\n options.blobHTTPHeaders = {};\n }\n if (!options.conditions) {\n options.conditions = {};\n }\n const { span, updatedOptions } = createSpan(\"BlockBlobClient-uploadStream\", options);\n try {\n let blockNum = 0;\n const blockIDPrefix = coreHttp.generateUuid();\n let transferProgress = 0;\n const blockList = [];\n const scheduler = new BufferScheduler(stream, bufferSize, maxConcurrency, async (body, length) => {\n const blockID = generateBlockID(blockIDPrefix, blockNum);\n blockList.push(blockID);\n blockNum++;\n await this.stageBlock(blockID, body, length, {\n conditions: options.conditions,\n encryptionScope: options.encryptionScope,\n tracingOptions: updatedOptions.tracingOptions,\n });\n // Update progress after block is successfully uploaded to server, in case of block trying\n transferProgress += length;\n if (options.onProgress) {\n options.onProgress({ loadedBytes: transferProgress });\n }\n }, \n // concurrency should set a smaller value than maxConcurrency, which is helpful to\n // reduce the possibility when a outgoing handler waits for stream data, in\n // this situation, outgoing handlers are blocked.\n // Outgoing queue shouldn't be empty.\n Math.ceil((maxConcurrency / 4) * 3));\n await scheduler.do();\n return await this.commitBlockList(blockList, Object.assign(Object.assign({}, options), { tracingOptions: Object.assign(Object.assign({}, options.tracingOptions), convertTracingToRequestOptionsBase(updatedOptions)) }));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n}\n/**\n * PageBlobClient defines a set of operations applicable to page blobs.\n */\nclass PageBlobClient extends BlobClient {\n constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, blobNameOrOptions, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n // In TypeScript we cannot simply pass all parameters to super() like below so have to duplicate the code instead.\n // super(s, credentialOrPipelineOrContainerNameOrOptions, blobNameOrOptions, options);\n let pipeline;\n let url;\n options = options || {};\n if (isPipelineLike(credentialOrPipelineOrContainerName)) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrContainerName;\n }\n else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||\n credentialOrPipelineOrContainerName instanceof AnonymousCredential ||\n coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n url = urlOrConnectionString;\n options = blobNameOrOptions;\n pipeline = newPipeline(credentialOrPipelineOrContainerName, options);\n }\n else if (!credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName !== \"string\") {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n // The second parameter is undefined. Use anonymous credential.\n url = urlOrConnectionString;\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else if (credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName === \"string\" &&\n blobNameOrOptions &&\n typeof blobNameOrOptions === \"string\") {\n // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)\n const containerName = credentialOrPipelineOrContainerName;\n const blobName = blobNameOrOptions;\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (coreHttp.isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);\n url = appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName));\n if (!options.proxyOptions) {\n options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);\n }\n pipeline = newPipeline(sharedKeyCredential, options);\n }\n else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n }\n else if (extractedCreds.kind === \"SASConnString\") {\n url =\n appendToURLPath(appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)), encodeURIComponent(blobName)) +\n \"?\" +\n extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else {\n throw new Error(\"Connection string must be either an Account connection string or a SAS connection string\");\n }\n }\n else {\n throw new Error(\"Expecting non-empty strings for containerName and blobName parameters\");\n }\n super(url, pipeline);\n this.pageBlobContext = new PageBlob(this.storageClientContext);\n }\n /**\n * Creates a new PageBlobClient object identical to the source but with the\n * specified snapshot timestamp.\n * Provide \"\" will remove the snapshot and return a Client to the base blob.\n *\n * @param snapshot - The snapshot timestamp.\n * @returns A new PageBlobClient object identical to the source but with the specified snapshot timestamp.\n */\n withSnapshot(snapshot) {\n return new PageBlobClient(setURLParameter(this.url, URLConstants.Parameters.SNAPSHOT, snapshot.length === 0 ? undefined : snapshot), this.pipeline);\n }\n /**\n * Creates a page blob of the specified length. Call uploadPages to upload data\n * data to a page blob.\n * @see https://docs.microsoft.com/rest/api/storageservices/put-blob\n *\n * @param size - size of the page blob.\n * @param options - Options to the Page Blob Create operation.\n * @returns Response data for the Page Blob Create operation.\n */\n async create(size, options = {}) {\n var _a, _b, _c;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-create\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.pageBlobContext.create(0, size, Object.assign({ abortSignal: options.abortSignal, blobHttpHeaders: options.blobHTTPHeaders, blobSequenceNumber: options.blobSequenceNumber, leaseAccessConditions: options.conditions, metadata: options.metadata, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, 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, tier: toAccessTier(options.tier), blobTagsString: toBlobTagsString(options.tags) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Creates a page blob of the specified length. Call uploadPages to upload data\n * data to a page blob. If the blob with the same name already exists, the content\n * of the existing blob will remain unchanged.\n * @see https://docs.microsoft.com/rest/api/storageservices/put-blob\n *\n * @param size - size of the page blob.\n * @param options -\n */\n async createIfNotExists(size, options = {}) {\n var _a, _b;\n const { span, updatedOptions } = createSpan(\"PageBlobClient-createIfNotExists\", options);\n try {\n const conditions = { ifNoneMatch: ETagAny };\n const res = await this.create(size, Object.assign(Object.assign({}, options), { conditions, tracingOptions: updatedOptions.tracingOptions }));\n return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });\n }\n catch (e) {\n if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === \"BlobAlreadyExists\") {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: \"Expected exception when creating a blob only if it does not already exist.\",\n });\n return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });\n }\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Writes 1 or more pages to the page blob. The start and end offsets must be a multiple of 512.\n * @see https://docs.microsoft.com/rest/api/storageservices/put-page\n *\n * @param body - Data to upload\n * @param offset - Offset of destination page blob\n * @param count - Content length of the body, also number of bytes to be uploaded\n * @param options - Options to the Page Blob Upload Pages operation.\n * @returns Response data for the Page Blob Upload Pages operation.\n */\n async uploadPages(body, offset, count, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-uploadPages\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.pageBlobContext.uploadPages(count, body, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), requestOptions: {\n onUploadProgress: options.onProgress,\n }, range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, transactionalContentMD5: options.transactionalContentMD5, transactionalContentCrc64: options.transactionalContentCrc64, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * The Upload Pages operation writes a range of pages to a page blob where the\n * contents are read from a URL.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/put-page-from-url\n *\n * @param sourceURL - Specify a URL to the copy source, Shared Access Signature(SAS) maybe needed for authentication\n * @param sourceOffset - The source offset to copy from. Pass 0 to copy from the beginning of source page blob\n * @param destOffset - Offset of destination page blob\n * @param count - Number of bytes to be uploaded from source page blob\n * @param options -\n */\n async uploadPagesFromURL(sourceURL, sourceOffset, destOffset, count, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n options.sourceConditions = options.sourceConditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-uploadPagesFromURL\", options);\n try {\n ensureCpkIfSpecified(options.customerProvidedKey, this.isHttps);\n return await this.pageBlobContext.uploadPagesFromURL(sourceURL, rangeToString({ offset: sourceOffset, count }), 0, rangeToString({ offset: destOffset, count }), Object.assign({ abortSignal: options.abortSignal, sourceContentMD5: options.sourceContentMD5, sourceContentCrc64: options.sourceContentCrc64, leaseAccessConditions: options.conditions, sequenceNumberAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), sourceModifiedAccessConditions: {\n sourceIfMatch: options.sourceConditions.ifMatch,\n sourceIfModifiedSince: options.sourceConditions.ifModifiedSince,\n sourceIfNoneMatch: options.sourceConditions.ifNoneMatch,\n sourceIfUnmodifiedSince: options.sourceConditions.ifUnmodifiedSince,\n }, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope, copySourceAuthorization: httpAuthorizationToString(options.sourceAuthorization) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Frees the specified pages from the page blob.\n * @see https://docs.microsoft.com/rest/api/storageservices/put-page\n *\n * @param offset - Starting byte position of the pages to clear.\n * @param count - Number of bytes to clear.\n * @param options - Options to the Page Blob Clear Pages operation.\n * @returns Response data for the Page Blob Clear Pages operation.\n */\n async clearPages(offset = 0, count, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-clearPages\", options);\n try {\n return await this.pageBlobContext.clearPages(0, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset, count }), sequenceNumberAccessConditions: options.conditions, cpkInfo: options.customerProvidedKey, encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns the list of valid page ranges for a page blob or snapshot of a page blob.\n * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges\n *\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param options - Options to the Page Blob Get Ranges operation.\n * @returns Response data for the Page Blob Get Ranges operation.\n */\n async getPageRanges(offset = 0, count, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-getPageRanges\", options);\n try {\n return await this.pageBlobContext\n .getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions)))\n .then(rangeResponseFromModel);\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * getPageRangesSegment returns a single segment of page ranges starting from the\n * specified Marker. Use an empty Marker to start enumeration from the beginning.\n * After getting a segment, process it, and then call getPageRangesSegment again\n * (passing the the previously-returned Marker) to get the next segment.\n * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges\n *\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.\n * @param options - Options to PageBlob Get Page Ranges Segment operation.\n */\n async listPageRangesSegment(offset = 0, count, marker, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"PageBlobClient-getPageRangesSegment\", options);\n try {\n return await this.pageBlobContext.getPageRanges(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), range: rangeToString({ offset, count }), marker: marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesResponseModel}\n *\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param marker - A string value that identifies the portion of\n * the get of page ranges to be returned with the next getting operation. The\n * operation returns the ContinuationToken value within the response body if the\n * getting operation did not return all page ranges remaining within the current page.\n * The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of get\n * items. The marker value is opaque to the client.\n * @param options - Options to List Page Ranges operation.\n */\n listPageRangeItemSegments(offset = 0, count, marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listPageRangeItemSegments_1() {\n let getPageRangeItemSegmentsResponse;\n if (!!marker || marker === undefined) {\n do {\n getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesSegment(offset, count, marker, options));\n marker = getPageRangeItemSegmentsResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse));\n } while (marker);\n }\n });\n }\n /**\n * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects\n *\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param options - Options to List Page Ranges operation.\n */\n listPageRangeItems(offset = 0, count, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listPageRangeItems_1() {\n var e_1, _a;\n let marker;\n try {\n for (var _b = tslib.__asyncValues(this.listPageRangeItemSegments(offset, count, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {\n const getPageRangesSegment = _c.value;\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment))));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n }\n /**\n * Returns an async iterable iterator to list of page ranges for a page blob.\n * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges\n *\n * .byPage() returns an async iterable iterator to list of page ranges for a page blob.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * // Get the pageBlobClient before you run these snippets,\n * // Can be obtained from `blobServiceClient.getContainerClient(\"\").getPageBlobClient(\"\");`\n * let i = 1;\n * for await (const pageRange of pageBlobClient.listPageRanges()) {\n * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = pageBlobClient.listPageRanges();\n * let pageRangeItem = await iter.next();\n * while (!pageRangeItem.done) {\n * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`);\n * pageRangeItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of pageBlobClient.listPageRanges().byPage({ maxPageSize: 20 })) {\n * for (const pageRange of response) {\n * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = pageBlobClient.listPageRanges().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 page ranges\n * for (const pageRange of response) {\n * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n *\n * iterator = pageBlobClient.listPageRanges().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 page ranges\n * for (const blob of response) {\n * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);\n * }\n * ```\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param options - Options to the Page Blob Get Ranges operation.\n * @returns An asyncIterableIterator that supports paging.\n */\n listPageRanges(offset = 0, count, options = {}) {\n options.conditions = options.conditions || {};\n // AsyncIterableIterator to iterate over blobs\n const iter = this.listPageRangeItems(offset, count, options);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings = {}) => {\n return this.listPageRangeItemSegments(offset, count, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options));\n },\n };\n }\n /**\n * Gets the collection of page ranges that differ between a specified snapshot and this page blob.\n * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges\n *\n * @param offset - Starting byte position of the page blob\n * @param count - Number of bytes to get ranges diff.\n * @param prevSnapshot - Timestamp of snapshot to retrieve the difference.\n * @param options - Options to the Page Blob Get Page Ranges Diff operation.\n * @returns Response data for the Page Blob Get Page Range Diff operation.\n */\n async getPageRangesDiff(offset, count, prevSnapshot, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-getPageRangesDiff\", options);\n try {\n return await this.pageBlobContext\n .getPageRangesDiff(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevsnapshot: prevSnapshot, range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions)))\n .then(rangeResponseFromModel);\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * getPageRangesDiffSegment returns a single segment of page ranges starting from the\n * specified Marker for difference between previous snapshot and the target page blob.\n * Use an empty Marker to start enumeration from the beginning.\n * After getting a segment, process it, and then call getPageRangesDiffSegment again\n * (passing the the previously-returned Marker) to get the next segment.\n * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges\n *\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.\n * @param marker - A string value that identifies the portion of the get to be returned with the next get operation.\n * @param options - Options to the Page Blob Get Page Ranges Diff operation.\n */\n async listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options) {\n var _a;\n const { span, updatedOptions } = createSpan(\"PageBlobClient-getPageRangesDiffSegment\", options);\n try {\n return await this.pageBlobContext.getPageRangesDiff(Object.assign({ abortSignal: options === null || options === void 0 ? void 0 : options.abortSignal, leaseAccessConditions: options === null || options === void 0 ? void 0 : options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.conditions), { ifTags: (_a = options === null || options === void 0 ? void 0 : options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevsnapshot: prevSnapshotOrUrl, range: rangeToString({\n offset: offset,\n count: count,\n }), marker: marker, maxPageSize: options === null || options === void 0 ? void 0 : options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns an AsyncIterableIterator for {@link PageBlobGetPageRangesDiffResponseModel}\n *\n *\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.\n * @param marker - A string value that identifies the portion of\n * the get of page ranges to be returned with the next getting operation. The\n * operation returns the ContinuationToken value within the response body if the\n * getting operation did not return all page ranges remaining within the current page.\n * The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of get\n * items. The marker value is opaque to the client.\n * @param options - Options to the Page Blob Get Page Ranges Diff operation.\n */\n listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options) {\n return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItemSegments_1() {\n let getPageRangeItemSegmentsResponse;\n if (!!marker || marker === undefined) {\n do {\n getPageRangeItemSegmentsResponse = yield tslib.__await(this.listPageRangesDiffSegment(offset, count, prevSnapshotOrUrl, marker, options));\n marker = getPageRangeItemSegmentsResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(getPageRangeItemSegmentsResponse));\n } while (marker);\n }\n });\n }\n /**\n * Returns an AsyncIterableIterator of {@link PageRangeInfo} objects\n *\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param prevSnapshotOrUrl - Timestamp of snapshot to retrieve the difference or URL of snapshot to retrieve the difference.\n * @param options - Options to the Page Blob Get Page Ranges Diff operation.\n */\n listPageRangeDiffItems(offset, count, prevSnapshotOrUrl, options) {\n return tslib.__asyncGenerator(this, arguments, function* listPageRangeDiffItems_1() {\n var e_2, _a;\n let marker;\n try {\n for (var _b = tslib.__asyncValues(this.listPageRangeDiffItemSegments(offset, count, prevSnapshotOrUrl, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {\n const getPageRangesSegment = _c.value;\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(ExtractPageRangeInfoItems(getPageRangesSegment))));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));\n }\n finally { if (e_2) throw e_2.error; }\n }\n });\n }\n /**\n * Returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.\n * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges\n *\n * .byPage() returns an async iterable iterator to list of page ranges that differ between a specified snapshot and this page blob.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * // Get the pageBlobClient before you run these snippets,\n * // Can be obtained from `blobServiceClient.getContainerClient(\"\").getPageBlobClient(\"\");`\n * let i = 1;\n * for await (const pageRange of pageBlobClient.listPageRangesDiff()) {\n * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = pageBlobClient.listPageRangesDiff();\n * let pageRangeItem = await iter.next();\n * while (!pageRangeItem.done) {\n * console.log(`Page range ${i++}: ${pageRangeItem.value.start} - ${pageRangeItem.value.end}, IsClear: ${pageRangeItem.value.isClear}`);\n * pageRangeItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 20 })) {\n * for (const pageRange of response) {\n * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = pageBlobClient.listPageRangesDiff().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 page ranges\n * for (const pageRange of response) {\n * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n *\n * iterator = pageBlobClient.listPageRangesDiff().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 page ranges\n * for (const blob of response) {\n * console.log(`Page range ${i++}: ${pageRange.start} - ${pageRange.end}`);\n * }\n * ```\n * @param offset - Starting byte position of the page ranges.\n * @param count - Number of bytes to get.\n * @param prevSnapshot - Timestamp of snapshot to retrieve the difference.\n * @param options - Options to the Page Blob Get Ranges operation.\n * @returns An asyncIterableIterator that supports paging.\n */\n listPageRangesDiff(offset, count, prevSnapshot, options = {}) {\n options.conditions = options.conditions || {};\n // AsyncIterableIterator to iterate over blobs\n const iter = this.listPageRangeDiffItems(offset, count, prevSnapshot, Object.assign({}, options));\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings = {}) => {\n return this.listPageRangeDiffItemSegments(offset, count, prevSnapshot, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, options));\n },\n };\n }\n /**\n * Gets the collection of page ranges that differ between a specified snapshot and this page blob for managed disks.\n * @see https://docs.microsoft.com/rest/api/storageservices/get-page-ranges\n *\n * @param offset - Starting byte position of the page blob\n * @param count - Number of bytes to get ranges diff.\n * @param prevSnapshotUrl - URL of snapshot to retrieve the difference.\n * @param options - Options to the Page Blob Get Page Ranges Diff operation.\n * @returns Response data for the Page Blob Get Page Range Diff operation.\n */\n async getPageRangesDiffForManagedDisks(offset, count, prevSnapshotUrl, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-GetPageRangesDiffForManagedDisks\", options);\n try {\n return await this.pageBlobContext\n .getPageRangesDiff(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), prevSnapshotUrl, range: rangeToString({ offset, count }) }, convertTracingToRequestOptionsBase(updatedOptions)))\n .then(rangeResponseFromModel);\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Resizes the page blob to the specified size (which must be a multiple of 512).\n * @see https://docs.microsoft.com/rest/api/storageservices/set-blob-properties\n *\n * @param size - Target size\n * @param options - Options to the Page Blob Resize operation.\n * @returns Response data for the Page Blob Resize operation.\n */\n async resize(size, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-resize\", options);\n try {\n return await this.pageBlobContext.resize(size, Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }), encryptionScope: options.encryptionScope }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Sets a page blob's sequence number.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-properties\n *\n * @param sequenceNumberAction - Indicates how the service should modify the blob's sequence number.\n * @param sequenceNumber - Required if sequenceNumberAction is max or update\n * @param options - Options to the Page Blob Update Sequence Number operation.\n * @returns Response data for the Page Blob Update Sequence Number operation.\n */\n async updateSequenceNumber(sequenceNumberAction, sequenceNumber, options = {}) {\n var _a;\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"PageBlobClient-updateSequenceNumber\", options);\n try {\n return await this.pageBlobContext.updateSequenceNumber(sequenceNumberAction, Object.assign({ abortSignal: options.abortSignal, blobSequenceNumber: sequenceNumber, leaseAccessConditions: options.conditions, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Begins an operation to start an incremental copy from one page blob's snapshot to this page blob.\n * The snapshot is copied such that only the differential changes between the previously\n * copied snapshot are transferred to the destination.\n * The copied snapshots are complete copies of the original snapshot and can be read or copied from as usual.\n * @see https://docs.microsoft.com/rest/api/storageservices/incremental-copy-blob\n * @see https://docs.microsoft.com/en-us/azure/virtual-machines/windows/incremental-snapshots\n *\n * @param copySource - Specifies the name of the source page blob snapshot. For example,\n * https://myaccount.blob.core.windows.net/mycontainer/myblob?snapshot=\n * @param options - Options to the Page Blob Copy Incremental operation.\n * @returns Response data for the Page Blob Copy Incremental operation.\n */\n async startCopyIncremental(copySource, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"PageBlobClient-startCopyIncremental\", options);\n try {\n return await this.pageBlobContext.copyIncremental(copySource, Object.assign({ abortSignal: options.abortSignal, modifiedAccessConditions: Object.assign(Object.assign({}, options.conditions), { ifTags: (_a = options.conditions) === null || _a === void 0 ? void 0 : _a.tagConditions }) }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n}\n\n// Copyright (c) Microsoft Corporation.\nasync function getBodyAsText(batchResponse) {\n let buffer = Buffer.alloc(BATCH_MAX_PAYLOAD_IN_BYTES);\n const responseLength = await streamToBuffer2(batchResponse.readableStreamBody, buffer);\n // Slice the buffer to trim the empty ending.\n buffer = buffer.slice(0, responseLength);\n return buffer.toString();\n}\nfunction utf8ByteLength(str) {\n return Buffer.byteLength(str);\n}\n\n// Copyright (c) Microsoft Corporation.\nconst HTTP_HEADER_DELIMITER = \": \";\nconst SPACE_DELIMITER = \" \";\nconst NOT_FOUND = -1;\n/**\n * Util class for parsing batch response.\n */\nclass BatchResponseParser {\n constructor(batchResponse, subRequests) {\n if (!batchResponse || !batchResponse.contentType) {\n // In special case(reported), server may return invalid content-type which could not be parsed.\n throw new RangeError(\"batchResponse is malformed or doesn't contain valid content-type.\");\n }\n if (!subRequests || subRequests.size === 0) {\n // This should be prevent during coding.\n throw new RangeError(\"Invalid state: subRequests is not provided or size is 0.\");\n }\n this.batchResponse = batchResponse;\n this.subRequests = subRequests;\n this.responseBatchBoundary = this.batchResponse.contentType.split(\"=\")[1];\n this.perResponsePrefix = `--${this.responseBatchBoundary}${HTTP_LINE_ENDING}`;\n this.batchResponseEnding = `--${this.responseBatchBoundary}--`;\n }\n // For example of response, please refer to https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#response\n async parseBatchResponse() {\n // When logic reach here, suppose batch request has already succeeded with 202, so we can further parse\n // sub request's response.\n if (this.batchResponse._response.status !== HTTPURLConnection.HTTP_ACCEPTED) {\n throw new Error(`Invalid state: batch request failed with status: '${this.batchResponse._response.status}'.`);\n }\n const responseBodyAsText = await getBodyAsText(this.batchResponse);\n const subResponses = responseBodyAsText\n .split(this.batchResponseEnding)[0] // string after ending is useless\n .split(this.perResponsePrefix)\n .slice(1); // string before first response boundary is useless\n const subResponseCount = subResponses.length;\n // Defensive coding in case of potential error parsing.\n // Note: subResponseCount == 1 is special case where sub request is invalid.\n // We try to prevent such cases through early validation, e.g. validate sub request count >= 1.\n // While in unexpected sub request invalid case, we allow sub response to be parsed and return to user.\n if (subResponseCount !== this.subRequests.size && subResponseCount !== 1) {\n throw new Error(\"Invalid state: sub responses' count is not equal to sub requests' count.\");\n }\n const deserializedSubResponses = new Array(subResponseCount);\n let subResponsesSucceededCount = 0;\n let subResponsesFailedCount = 0;\n // Parse sub subResponses.\n for (let index = 0; index < subResponseCount; index++) {\n const subResponse = subResponses[index];\n const deserializedSubResponse = {};\n deserializedSubResponse.headers = new coreHttp.HttpHeaders();\n const responseLines = subResponse.split(`${HTTP_LINE_ENDING}`);\n let subRespHeaderStartFound = false;\n let subRespHeaderEndFound = false;\n let subRespFailed = false;\n let contentId = NOT_FOUND;\n for (const responseLine of responseLines) {\n if (!subRespHeaderStartFound) {\n // Convention line to indicate content ID\n if (responseLine.startsWith(HeaderConstants.CONTENT_ID)) {\n contentId = parseInt(responseLine.split(HTTP_HEADER_DELIMITER)[1]);\n }\n // Http version line with status code indicates the start of sub request's response.\n // Example: HTTP/1.1 202 Accepted\n if (responseLine.startsWith(HTTP_VERSION_1_1)) {\n subRespHeaderStartFound = true;\n const tokens = responseLine.split(SPACE_DELIMITER);\n deserializedSubResponse.status = parseInt(tokens[1]);\n deserializedSubResponse.statusMessage = tokens.slice(2).join(SPACE_DELIMITER);\n }\n continue; // Skip convention headers not specifically for sub request i.e. Content-Type: application/http and Content-ID: *\n }\n if (responseLine.trim() === \"\") {\n // Sub response's header start line already found, and the first empty line indicates header end line found.\n if (!subRespHeaderEndFound) {\n subRespHeaderEndFound = true;\n }\n continue; // Skip empty line\n }\n // Note: when code reach here, it indicates subRespHeaderStartFound == true\n if (!subRespHeaderEndFound) {\n if (responseLine.indexOf(HTTP_HEADER_DELIMITER) === -1) {\n // Defensive coding to prevent from missing valuable lines.\n throw new Error(`Invalid state: find non-empty line '${responseLine}' without HTTP header delimiter '${HTTP_HEADER_DELIMITER}'.`);\n }\n // Parse headers of sub response.\n const tokens = responseLine.split(HTTP_HEADER_DELIMITER);\n deserializedSubResponse.headers.set(tokens[0], tokens[1]);\n if (tokens[0] === HeaderConstants.X_MS_ERROR_CODE) {\n deserializedSubResponse.errorCode = tokens[1];\n subRespFailed = true;\n }\n }\n else {\n // Assemble body of sub response.\n if (!deserializedSubResponse.bodyAsText) {\n deserializedSubResponse.bodyAsText = \"\";\n }\n deserializedSubResponse.bodyAsText += responseLine;\n }\n } // Inner for end\n // The response will contain the Content-ID header for each corresponding subrequest response to use for tracking.\n // The Content-IDs are set to a valid index in the subrequests we sent. In the status code 202 path, we could expect it\n // to be 1-1 mapping from the [0, subRequests.size) to the Content-IDs returned. If not, we simply don't return that\n // unexpected subResponse in the parsed reponse and we can always look it up in the raw response for debugging purpose.\n if (contentId !== NOT_FOUND &&\n Number.isInteger(contentId) &&\n contentId >= 0 &&\n contentId < this.subRequests.size &&\n deserializedSubResponses[contentId] === undefined) {\n deserializedSubResponse._request = this.subRequests.get(contentId);\n deserializedSubResponses[contentId] = deserializedSubResponse;\n }\n else {\n logger.error(`subResponses[${index}] is dropped as the Content-ID is not found or invalid, Content-ID: ${contentId}`);\n }\n if (subRespFailed) {\n subResponsesFailedCount++;\n }\n else {\n subResponsesSucceededCount++;\n }\n }\n return {\n subResponses: deserializedSubResponses,\n subResponsesSucceededCount: subResponsesSucceededCount,\n subResponsesFailedCount: subResponsesFailedCount,\n };\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nvar MutexLockStatus;\n(function (MutexLockStatus) {\n MutexLockStatus[MutexLockStatus[\"LOCKED\"] = 0] = \"LOCKED\";\n MutexLockStatus[MutexLockStatus[\"UNLOCKED\"] = 1] = \"UNLOCKED\";\n})(MutexLockStatus || (MutexLockStatus = {}));\n/**\n * An async mutex lock.\n */\nclass Mutex {\n /**\n * Lock for a specific key. If the lock has been acquired by another customer, then\n * will wait until getting the lock.\n *\n * @param key - lock key\n */\n static async lock(key) {\n return new Promise((resolve) => {\n if (this.keys[key] === undefined || this.keys[key] === MutexLockStatus.UNLOCKED) {\n this.keys[key] = MutexLockStatus.LOCKED;\n resolve();\n }\n else {\n this.onUnlockEvent(key, () => {\n this.keys[key] = MutexLockStatus.LOCKED;\n resolve();\n });\n }\n });\n }\n /**\n * Unlock a key.\n *\n * @param key -\n */\n static async unlock(key) {\n return new Promise((resolve) => {\n if (this.keys[key] === MutexLockStatus.LOCKED) {\n this.emitUnlockEvent(key);\n }\n delete this.keys[key];\n resolve();\n });\n }\n static onUnlockEvent(key, handler) {\n if (this.listeners[key] === undefined) {\n this.listeners[key] = [handler];\n }\n else {\n this.listeners[key].push(handler);\n }\n }\n static emitUnlockEvent(key) {\n if (this.listeners[key] !== undefined && this.listeners[key].length > 0) {\n const handler = this.listeners[key].shift();\n setImmediate(() => {\n handler.call(this);\n });\n }\n }\n}\nMutex.keys = {};\nMutex.listeners = {};\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A BlobBatch represents an aggregated set of operations on blobs.\n * Currently, only `delete` and `setAccessTier` are supported.\n */\nclass BlobBatch {\n constructor() {\n this.batch = \"batch\";\n this.batchRequest = new InnerBatchRequest();\n }\n /**\n * Get the value of Content-Type for a batch request.\n * The value must be multipart/mixed with a batch boundary.\n * Example: multipart/mixed; boundary=batch_a81786c8-e301-4e42-a729-a32ca24ae252\n */\n getMultiPartContentType() {\n return this.batchRequest.getMultipartContentType();\n }\n /**\n * Get assembled HTTP request body for sub requests.\n */\n getHttpRequestBody() {\n return this.batchRequest.getHttpRequestBody();\n }\n /**\n * Get sub requests that are added into the batch request.\n */\n getSubRequests() {\n return this.batchRequest.getSubRequests();\n }\n async addSubRequestInternal(subRequest, assembleSubRequestFunc) {\n await Mutex.lock(this.batch);\n try {\n this.batchRequest.preAddSubRequest(subRequest);\n await assembleSubRequestFunc();\n this.batchRequest.postAddSubRequest(subRequest);\n }\n finally {\n await Mutex.unlock(this.batch);\n }\n }\n setBatchType(batchType) {\n if (!this.batchType) {\n this.batchType = batchType;\n }\n if (this.batchType !== batchType) {\n throw new RangeError(`BlobBatch only supports one operation type per batch and it already is being used for ${this.batchType} operations.`);\n }\n }\n async deleteBlob(urlOrBlobClient, credentialOrOptions, options) {\n let url;\n let credential;\n if (typeof urlOrBlobClient === \"string\" &&\n ((coreHttp.isNode && credentialOrOptions instanceof StorageSharedKeyCredential) ||\n credentialOrOptions instanceof AnonymousCredential ||\n coreHttp.isTokenCredential(credentialOrOptions))) {\n // First overload\n url = urlOrBlobClient;\n credential = credentialOrOptions;\n }\n else if (urlOrBlobClient instanceof BlobClient) {\n // Second overload\n url = urlOrBlobClient.url;\n credential = urlOrBlobClient.credential;\n options = credentialOrOptions;\n }\n else {\n throw new RangeError(\"Invalid arguments. Either url and credential, or BlobClient need be provided.\");\n }\n if (!options) {\n options = {};\n }\n const { span, updatedOptions } = createSpan(\"BatchDeleteRequest-addSubRequest\", options);\n try {\n this.setBatchType(\"delete\");\n await this.addSubRequestInternal({\n url: url,\n credential: credential,\n }, async () => {\n await new BlobClient(url, this.batchRequest.createPipeline(credential)).delete(updatedOptions);\n });\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n async setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options) {\n let url;\n let credential;\n let tier;\n if (typeof urlOrBlobClient === \"string\" &&\n ((coreHttp.isNode && credentialOrTier instanceof StorageSharedKeyCredential) ||\n credentialOrTier instanceof AnonymousCredential ||\n coreHttp.isTokenCredential(credentialOrTier))) {\n // First overload\n url = urlOrBlobClient;\n credential = credentialOrTier;\n tier = tierOrOptions;\n }\n else if (urlOrBlobClient instanceof BlobClient) {\n // Second overload\n url = urlOrBlobClient.url;\n credential = urlOrBlobClient.credential;\n tier = credentialOrTier;\n options = tierOrOptions;\n }\n else {\n throw new RangeError(\"Invalid arguments. Either url and credential, or BlobClient need be provided.\");\n }\n if (!options) {\n options = {};\n }\n const { span, updatedOptions } = createSpan(\"BatchSetTierRequest-addSubRequest\", options);\n try {\n this.setBatchType(\"setAccessTier\");\n await this.addSubRequestInternal({\n url: url,\n credential: credential,\n }, async () => {\n await new BlobClient(url, this.batchRequest.createPipeline(credential)).setAccessTier(tier, updatedOptions);\n });\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n}\n/**\n * Inner batch request class which is responsible for assembling and serializing sub requests.\n * See https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch#request-body for how requests are assembled.\n */\nclass InnerBatchRequest {\n constructor() {\n this.operationCount = 0;\n this.body = \"\";\n const tempGuid = coreHttp.generateUuid();\n // batch_{batchid}\n this.boundary = `batch_${tempGuid}`;\n // --batch_{batchid}\n // Content-Type: application/http\n // Content-Transfer-Encoding: binary\n this.subRequestPrefix = `--${this.boundary}${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TYPE}: application/http${HTTP_LINE_ENDING}${HeaderConstants.CONTENT_TRANSFER_ENCODING}: binary`;\n // multipart/mixed; boundary=batch_{batchid}\n this.multipartContentType = `multipart/mixed; boundary=${this.boundary}`;\n // --batch_{batchid}--\n this.batchRequestEnding = `--${this.boundary}--`;\n this.subRequests = new Map();\n }\n /**\n * Create pipeline to assemble sub requests. The idea here is to use existing\n * credential and serialization/deserialization components, with additional policies to\n * filter unnecessary headers, assemble sub requests into request's body\n * and intercept request from going to wire.\n * @param credential - Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the `@azure/identity` package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.\n */\n createPipeline(credential) {\n const isAnonymousCreds = credential instanceof AnonymousCredential;\n const policyFactoryLength = 3 + (isAnonymousCreds ? 0 : 1); // [deserializationPolicy, BatchHeaderFilterPolicyFactory, (Optional)Credential, BatchRequestAssemblePolicyFactory]\n const factories = new Array(policyFactoryLength);\n factories[0] = coreHttp.deserializationPolicy(); // Default deserializationPolicy is provided by protocol layer\n factories[1] = new BatchHeaderFilterPolicyFactory(); // Use batch header filter policy to exclude unnecessary headers\n if (!isAnonymousCreds) {\n factories[2] = coreHttp.isTokenCredential(credential)\n ? attachCredential(coreHttp.bearerTokenAuthenticationPolicy(credential, StorageOAuthScopes), credential)\n : credential;\n }\n factories[policyFactoryLength - 1] = new BatchRequestAssemblePolicyFactory(this); // Use batch assemble policy to assemble request and intercept request from going to wire\n return new Pipeline(factories, {});\n }\n appendSubRequestToBody(request) {\n // Start to assemble sub request\n this.body += [\n this.subRequestPrefix,\n `${HeaderConstants.CONTENT_ID}: ${this.operationCount}`,\n \"\",\n `${request.method.toString()} ${getURLPathAndQuery(request.url)} ${HTTP_VERSION_1_1}${HTTP_LINE_ENDING}`, // sub request start line with method\n ].join(HTTP_LINE_ENDING);\n for (const header of request.headers.headersArray()) {\n this.body += `${header.name}: ${header.value}${HTTP_LINE_ENDING}`;\n }\n this.body += HTTP_LINE_ENDING; // sub request's headers need be ending with an empty line\n // No body to assemble for current batch request support\n // End to assemble sub request\n }\n preAddSubRequest(subRequest) {\n if (this.operationCount >= BATCH_MAX_REQUEST) {\n throw new RangeError(`Cannot exceed ${BATCH_MAX_REQUEST} sub requests in a single batch`);\n }\n // Fast fail if url for sub request is invalid\n const path = getURLPath(subRequest.url);\n if (!path || path === \"\") {\n throw new RangeError(`Invalid url for sub request: '${subRequest.url}'`);\n }\n }\n postAddSubRequest(subRequest) {\n this.subRequests.set(this.operationCount, subRequest);\n this.operationCount++;\n }\n // Return the http request body with assembling the ending line to the sub request body.\n getHttpRequestBody() {\n return `${this.body}${this.batchRequestEnding}${HTTP_LINE_ENDING}`;\n }\n getMultipartContentType() {\n return this.multipartContentType;\n }\n getSubRequests() {\n return this.subRequests;\n }\n}\nclass BatchRequestAssemblePolicy extends coreHttp.BaseRequestPolicy {\n constructor(batchRequest, nextPolicy, options) {\n super(nextPolicy, options);\n this.dummyResponse = {\n request: new coreHttp.WebResource(),\n status: 200,\n headers: new coreHttp.HttpHeaders(),\n };\n this.batchRequest = batchRequest;\n }\n async sendRequest(request) {\n await this.batchRequest.appendSubRequestToBody(request);\n return this.dummyResponse; // Intercept request from going to wire\n }\n}\nclass BatchRequestAssemblePolicyFactory {\n constructor(batchRequest) {\n this.batchRequest = batchRequest;\n }\n create(nextPolicy, options) {\n return new BatchRequestAssemblePolicy(this.batchRequest, nextPolicy, options);\n }\n}\nclass BatchHeaderFilterPolicy extends coreHttp.BaseRequestPolicy {\n // The base class has a protected constructor. Adding a public one to enable constructing of this class.\n /* eslint-disable-next-line @typescript-eslint/no-useless-constructor*/\n constructor(nextPolicy, options) {\n super(nextPolicy, options);\n }\n async sendRequest(request) {\n let xMsHeaderName = \"\";\n for (const header of request.headers.headersArray()) {\n if (iEqual(header.name, HeaderConstants.X_MS_VERSION)) {\n xMsHeaderName = header.name;\n }\n }\n if (xMsHeaderName !== \"\") {\n request.headers.remove(xMsHeaderName); // The subrequests should not have the x-ms-version header.\n }\n return this._nextPolicy.sendRequest(request);\n }\n}\nclass BatchHeaderFilterPolicyFactory {\n create(nextPolicy, options) {\n return new BatchHeaderFilterPolicy(nextPolicy, options);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * A BlobBatchClient allows you to make batched requests to the Azure Storage Blob service.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch\n */\nclass BlobBatchClient {\n constructor(url, credentialOrPipeline, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n let pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n }\n else if (!credentialOrPipeline) {\n // no credential provided\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else {\n pipeline = newPipeline(credentialOrPipeline, options);\n }\n const storageClientContext = new StorageClientContext(url, pipeline.toServiceClientOptions());\n const path = getURLPath(url);\n if (path && path !== \"/\") {\n // Container scoped.\n this.serviceOrContainerContext = new Container(storageClientContext);\n }\n else {\n this.serviceOrContainerContext = new Service(storageClientContext);\n }\n }\n /**\n * Creates a {@link BlobBatch}.\n * A BlobBatch represents an aggregated set of operations on blobs.\n */\n createBatch() {\n return new BlobBatch();\n }\n async deleteBlobs(urlsOrBlobClients, credentialOrOptions, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions, options);\n }\n else {\n await batch.deleteBlob(urlOrBlobClient, credentialOrOptions);\n }\n }\n return this.submitBatch(batch);\n }\n async setBlobsAccessTier(urlsOrBlobClients, credentialOrTier, tierOrOptions, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n const batch = new BlobBatch();\n for (const urlOrBlobClient of urlsOrBlobClients) {\n if (typeof urlOrBlobClient === \"string\") {\n await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions, options);\n }\n else {\n await batch.setBlobAccessTier(urlOrBlobClient, credentialOrTier, tierOrOptions);\n }\n }\n return this.submitBatch(batch);\n }\n /**\n * Submit batch request which consists of multiple subrequests.\n *\n * Get `blobBatchClient` and other details before running the snippets.\n * `blobServiceClient.getBlobBatchClient()` gives the `blobBatchClient`\n *\n * Example usage:\n *\n * ```js\n * let batchRequest = new BlobBatch();\n * await batchRequest.deleteBlob(urlInString0, credential0);\n * await batchRequest.deleteBlob(urlInString1, credential1, {\n * deleteSnapshots: \"include\"\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * Example using a lease:\n *\n * ```js\n * let batchRequest = new BlobBatch();\n * await batchRequest.setBlobAccessTier(blockBlobClient0, \"Cool\");\n * await batchRequest.setBlobAccessTier(blockBlobClient1, \"Cool\", {\n * conditions: { leaseId: leaseId }\n * });\n * const batchResp = await blobBatchClient.submitBatch(batchRequest);\n * console.log(batchResp.subResponsesSucceededCount);\n * ```\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch\n *\n * @param batchRequest - A set of Delete or SetTier operations.\n * @param options -\n */\n async submitBatch(batchRequest, options = {}) {\n if (!batchRequest || batchRequest.getSubRequests().size === 0) {\n throw new RangeError(\"Batch request should contain one or more sub requests.\");\n }\n const { span, updatedOptions } = createSpan(\"BlobBatchClient-submitBatch\", options);\n try {\n const batchRequestBody = batchRequest.getHttpRequestBody();\n // ServiceSubmitBatchResponseModel and ContainerSubmitBatchResponse are compatible for now.\n const rawBatchResponse = await this.serviceOrContainerContext.submitBatch(utf8ByteLength(batchRequestBody), batchRequest.getMultiPartContentType(), batchRequestBody, Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions)));\n // Parse the sub responses result, if logic reaches here(i.e. the batch request succeeded with status code 202).\n const batchResponseParser = new BatchResponseParser(rawBatchResponse, batchRequest.getSubRequests());\n const responseSummary = await batchResponseParser.parseBatchResponse();\n const res = {\n _response: rawBatchResponse._response,\n contentType: rawBatchResponse.contentType,\n errorCode: rawBatchResponse.errorCode,\n requestId: rawBatchResponse.requestId,\n clientRequestId: rawBatchResponse.clientRequestId,\n version: rawBatchResponse.version,\n subResponses: responseSummary.subResponses,\n subResponsesSucceededCount: responseSummary.subResponsesSucceededCount,\n subResponsesFailedCount: responseSummary.subResponsesFailedCount,\n };\n return res;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n}\n\n/**\n * A ContainerClient represents a URL to the Azure Storage container allowing you to manipulate its blobs.\n */\nclass ContainerClient extends StorageClient {\n constructor(urlOrConnectionString, credentialOrPipelineOrContainerName, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n let pipeline;\n let url;\n options = options || {};\n if (isPipelineLike(credentialOrPipelineOrContainerName)) {\n // (url: string, pipeline: Pipeline)\n url = urlOrConnectionString;\n pipeline = credentialOrPipelineOrContainerName;\n }\n else if ((coreHttp.isNode && credentialOrPipelineOrContainerName instanceof StorageSharedKeyCredential) ||\n credentialOrPipelineOrContainerName instanceof AnonymousCredential ||\n coreHttp.isTokenCredential(credentialOrPipelineOrContainerName)) {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n url = urlOrConnectionString;\n pipeline = newPipeline(credentialOrPipelineOrContainerName, options);\n }\n else if (!credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName !== \"string\") {\n // (url: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential, options?: StoragePipelineOptions)\n // The second parameter is undefined. Use anonymous credential.\n url = urlOrConnectionString;\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else if (credentialOrPipelineOrContainerName &&\n typeof credentialOrPipelineOrContainerName === \"string\") {\n // (connectionString: string, containerName: string, blobName: string, options?: StoragePipelineOptions)\n const containerName = credentialOrPipelineOrContainerName;\n const extractedCreds = extractConnectionStringParts(urlOrConnectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (coreHttp.isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);\n url = appendToURLPath(extractedCreds.url, encodeURIComponent(containerName));\n if (!options.proxyOptions) {\n options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);\n }\n pipeline = newPipeline(sharedKeyCredential, options);\n }\n else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n }\n else if (extractedCreds.kind === \"SASConnString\") {\n url =\n appendToURLPath(extractedCreds.url, encodeURIComponent(containerName)) +\n \"?\" +\n extractedCreds.accountSas;\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n else {\n throw new Error(\"Connection string must be either an Account connection string or a SAS connection string\");\n }\n }\n else {\n throw new Error(\"Expecting non-empty strings for containerName parameter\");\n }\n super(url, pipeline);\n this._containerName = this.getContainerNameFromUrl();\n this.containerContext = new Container(this.storageClientContext);\n }\n /**\n * The name of the container.\n */\n get containerName() {\n return this._containerName;\n }\n /**\n * Creates a new container under the specified account. If the container with\n * the same name already exists, the operation fails.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container\n * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata\n *\n * @param options - Options to Container Create operation.\n *\n *\n * Example usage:\n *\n * ```js\n * const containerClient = blobServiceClient.getContainerClient(\"\");\n * const createContainerResponse = await containerClient.create();\n * console.log(\"Container was created successfully\", createContainerResponse.requestId);\n * ```\n */\n async create(options = {}) {\n const { span, updatedOptions } = createSpan(\"ContainerClient-create\", options);\n try {\n // Spread operator in destructuring assignments,\n // this will filter out unwanted properties from the response object into result object\n return await this.containerContext.create(Object.assign(Object.assign({}, options), convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Creates a new container under the specified account. If the container with\n * the same name already exists, it is not changed.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container\n * Naming rules: @see https://learn.microsoft.com/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata\n *\n * @param options -\n */\n async createIfNotExists(options = {}) {\n var _a, _b;\n const { span, updatedOptions } = createSpan(\"ContainerClient-createIfNotExists\", options);\n try {\n const res = await this.create(updatedOptions);\n return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });\n }\n catch (e) {\n if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === \"ContainerAlreadyExists\") {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: \"Expected exception when creating a container only if it does not already exist.\",\n });\n return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });\n }\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns true if the Azure container resource represented by this client exists; false otherwise.\n *\n * NOTE: use this function with care since an existing container might be deleted by other clients or\n * applications. Vice versa new containers with the same name might be added by other clients or\n * applications after this function completes.\n *\n * @param options -\n */\n async exists(options = {}) {\n const { span, updatedOptions } = createSpan(\"ContainerClient-exists\", options);\n try {\n await this.getProperties({\n abortSignal: options.abortSignal,\n tracingOptions: updatedOptions.tracingOptions,\n });\n return true;\n }\n catch (e) {\n if (e.statusCode === 404) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: \"Expected exception when checking container existence\",\n });\n return false;\n }\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Creates a {@link BlobClient}\n *\n * @param blobName - A blob name\n * @returns A new BlobClient object for the given blob name.\n */\n getBlobClient(blobName) {\n return new BlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline);\n }\n /**\n * Creates an {@link AppendBlobClient}\n *\n * @param blobName - An append blob name\n */\n getAppendBlobClient(blobName) {\n return new AppendBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline);\n }\n /**\n * Creates a {@link BlockBlobClient}\n *\n * @param blobName - A block blob name\n *\n *\n * Example usage:\n *\n * ```js\n * const content = \"Hello world!\";\n *\n * const blockBlobClient = containerClient.getBlockBlobClient(\"\");\n * const uploadBlobResponse = await blockBlobClient.upload(content, content.length);\n * ```\n */\n getBlockBlobClient(blobName) {\n return new BlockBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline);\n }\n /**\n * Creates a {@link PageBlobClient}\n *\n * @param blobName - A page blob name\n */\n getPageBlobClient(blobName) {\n return new PageBlobClient(appendToURLPath(this.url, EscapePath(blobName)), this.pipeline);\n }\n /**\n * Returns all user-defined metadata and system properties for the specified\n * container. The data returned does not include the container's list of blobs.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-properties\n *\n * WARNING: The `metadata` object returned in the response will have its keys in lowercase, even if\n * they originally contained uppercase characters. This differs from the metadata keys returned by\n * the `listContainers` method of {@link BlobServiceClient} using the `includeMetadata` option, which\n * will retain their original casing.\n *\n * @param options - Options to Container Get Properties operation.\n */\n async getProperties(options = {}) {\n if (!options.conditions) {\n options.conditions = {};\n }\n const { span, updatedOptions } = createSpan(\"ContainerClient-getProperties\", options);\n try {\n return await this.containerContext.getProperties(Object.assign(Object.assign({ abortSignal: options.abortSignal }, options.conditions), convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Marks the specified container for deletion. The container and any blobs\n * contained within it are later deleted during garbage collection.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container\n *\n * @param options - Options to Container Delete operation.\n */\n async delete(options = {}) {\n if (!options.conditions) {\n options.conditions = {};\n }\n const { span, updatedOptions } = createSpan(\"ContainerClient-delete\", options);\n try {\n return await this.containerContext.delete(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Marks the specified container for deletion if it exists. The container and any blobs\n * contained within it are later deleted during garbage collection.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-container\n *\n * @param options - Options to Container Delete operation.\n */\n async deleteIfExists(options = {}) {\n var _a, _b;\n const { span, updatedOptions } = createSpan(\"ContainerClient-deleteIfExists\", options);\n try {\n const res = await this.delete(updatedOptions);\n return Object.assign(Object.assign({ succeeded: true }, res), { _response: res._response });\n }\n catch (e) {\n if (((_a = e.details) === null || _a === void 0 ? void 0 : _a.errorCode) === \"ContainerNotFound\") {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: \"Expected exception when deleting a container only if it exists.\",\n });\n return Object.assign(Object.assign({ succeeded: false }, (_b = e.response) === null || _b === void 0 ? void 0 : _b.parsedHeaders), { _response: e.response });\n }\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Sets one or more user-defined name-value pairs for the specified container.\n *\n * If no option provided, or no metadata defined in the parameter, the container\n * metadata will be removed.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-metadata\n *\n * @param metadata - Replace existing metadata with this value.\n * If no value provided the existing metadata will be removed.\n * @param options - Options to Container Set Metadata operation.\n */\n async setMetadata(metadata, options = {}) {\n if (!options.conditions) {\n options.conditions = {};\n }\n if (options.conditions.ifUnmodifiedSince) {\n throw new RangeError(\"the IfUnmodifiedSince must have their default values because they are ignored by the blob service\");\n }\n const { span, updatedOptions } = createSpan(\"ContainerClient-setMetadata\", options);\n try {\n return await this.containerContext.setMetadata(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions, metadata, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Gets the permissions for the specified container. The permissions indicate\n * whether container data may be accessed publicly.\n *\n * WARNING: JavaScript Date will potentially lose precision when parsing startsOn and expiresOn strings.\n * For example, new Date(\"2018-12-31T03:44:23.8827891Z\").toISOString() will get \"2018-12-31T03:44:23.882Z\".\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-container-acl\n *\n * @param options - Options to Container Get Access Policy operation.\n */\n async getAccessPolicy(options = {}) {\n if (!options.conditions) {\n options.conditions = {};\n }\n const { span, updatedOptions } = createSpan(\"ContainerClient-getAccessPolicy\", options);\n try {\n const response = await this.containerContext.getAccessPolicy(Object.assign({ abortSignal: options.abortSignal, leaseAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));\n const res = {\n _response: response._response,\n blobPublicAccess: response.blobPublicAccess,\n date: response.date,\n etag: response.etag,\n errorCode: response.errorCode,\n lastModified: response.lastModified,\n requestId: response.requestId,\n clientRequestId: response.clientRequestId,\n signedIdentifiers: [],\n version: response.version,\n };\n for (const identifier of response) {\n let accessPolicy = undefined;\n if (identifier.accessPolicy) {\n accessPolicy = {\n permissions: identifier.accessPolicy.permissions,\n };\n if (identifier.accessPolicy.expiresOn) {\n accessPolicy.expiresOn = new Date(identifier.accessPolicy.expiresOn);\n }\n if (identifier.accessPolicy.startsOn) {\n accessPolicy.startsOn = new Date(identifier.accessPolicy.startsOn);\n }\n }\n res.signedIdentifiers.push({\n accessPolicy,\n id: identifier.id,\n });\n }\n return res;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Sets the permissions for the specified container. The permissions indicate\n * whether blobs in a container may be accessed publicly.\n *\n * When you set permissions for a container, the existing permissions are replaced.\n * If no access or containerAcl provided, the existing container ACL will be\n * removed.\n *\n * When you establish a stored access policy on a container, it may take up to 30 seconds to take effect.\n * During this interval, a shared access signature that is associated with the stored access policy will\n * fail with status code 403 (Forbidden), until the access policy becomes active.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-container-acl\n *\n * @param access - The level of public access to data in the container.\n * @param containerAcl - Array of elements each having a unique Id and details of the access policy.\n * @param options - Options to Container Set Access Policy operation.\n */\n async setAccessPolicy(access, containerAcl, options = {}) {\n options.conditions = options.conditions || {};\n const { span, updatedOptions } = createSpan(\"ContainerClient-setAccessPolicy\", options);\n try {\n const acl = [];\n for (const identifier of containerAcl || []) {\n acl.push({\n accessPolicy: {\n expiresOn: identifier.accessPolicy.expiresOn\n ? truncatedISO8061Date(identifier.accessPolicy.expiresOn)\n : \"\",\n permissions: identifier.accessPolicy.permissions,\n startsOn: identifier.accessPolicy.startsOn\n ? truncatedISO8061Date(identifier.accessPolicy.startsOn)\n : \"\",\n },\n id: identifier.id,\n });\n }\n return await this.containerContext.setAccessPolicy(Object.assign({ abortSignal: options.abortSignal, access, containerAcl: acl, leaseAccessConditions: options.conditions, modifiedAccessConditions: options.conditions }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Get a {@link BlobLeaseClient} that manages leases on the container.\n *\n * @param proposeLeaseId - Initial proposed lease Id.\n * @returns A new BlobLeaseClient object for managing leases on the container.\n */\n getBlobLeaseClient(proposeLeaseId) {\n return new BlobLeaseClient(this, proposeLeaseId);\n }\n /**\n * Creates a new block blob, or updates the content of an existing block blob.\n *\n * Updating an existing block blob overwrites any existing metadata on the blob.\n * Partial updates are not supported; the content of the existing blob is\n * overwritten with the new content. To perform a partial update of a block blob's,\n * use {@link BlockBlobClient.stageBlock} and {@link BlockBlobClient.commitBlockList}.\n *\n * This is a non-parallel uploading method, please use {@link BlockBlobClient.uploadFile},\n * {@link BlockBlobClient.uploadStream} or {@link BlockBlobClient.uploadBrowserData} for better\n * performance with concurrency uploading.\n *\n * @see https://docs.microsoft.com/rest/api/storageservices/put-blob\n *\n * @param blobName - Name of the block blob to create or update.\n * @param body - Blob, string, ArrayBuffer, ArrayBufferView or a function\n * which returns a new Readable stream whose offset is from data source beginning.\n * @param contentLength - Length of body in bytes. Use Buffer.byteLength() to calculate body length for a\n * string including non non-Base64/Hex-encoded characters.\n * @param options - Options to configure the Block Blob Upload operation.\n * @returns Block Blob upload response data and the corresponding BlockBlobClient instance.\n */\n async uploadBlockBlob(blobName, body, contentLength, options = {}) {\n const { span, updatedOptions } = createSpan(\"ContainerClient-uploadBlockBlob\", options);\n try {\n const blockBlobClient = this.getBlockBlobClient(blobName);\n const response = await blockBlobClient.upload(body, contentLength, updatedOptions);\n return {\n blockBlobClient,\n response,\n };\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Marks the specified blob or snapshot for deletion. The blob is later deleted\n * during garbage collection. Note that in order to delete a blob, you must delete\n * all of its snapshots. You can delete both at the same time with the Delete\n * Blob operation.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/delete-blob\n *\n * @param blobName -\n * @param options - Options to Blob Delete operation.\n * @returns Block blob deletion response data.\n */\n async deleteBlob(blobName, options = {}) {\n const { span, updatedOptions } = createSpan(\"ContainerClient-deleteBlob\", options);\n try {\n let blobClient = this.getBlobClient(blobName);\n if (options.versionId) {\n blobClient = blobClient.withVersion(options.versionId);\n }\n return await blobClient.delete(updatedOptions);\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * listBlobFlatSegment returns a single segment of blobs starting from the\n * specified Marker. Use an empty Marker to start enumeration from the beginning.\n * After getting a segment, process it, and then call listBlobsFlatSegment again\n * (passing the the previously-returned Marker) to get the next segment.\n * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs\n *\n * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.\n * @param options - Options to Container List Blob Flat Segment operation.\n */\n async listBlobFlatSegment(marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"ContainerClient-listBlobFlatSegment\", options);\n try {\n const response = await this.containerContext.listBlobFlatSegment(Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));\n 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) => {\n const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });\n return blobItem;\n }) }) });\n return wrappedResponse;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * listBlobHierarchySegment returns a single segment of blobs starting from\n * the specified Marker. Use an empty Marker to start enumeration from the\n * beginning. After getting a segment, process it, and then call listBlobsHierarchicalSegment\n * again (passing the the previously-returned Marker) to get the next segment.\n * @see https://docs.microsoft.com/rest/api/storageservices/list-blobs\n *\n * @param delimiter - The character or string used to define the virtual hierarchy\n * @param marker - A string value that identifies the portion of the list to be returned with the next list operation.\n * @param options - Options to Container List Blob Hierarchy Segment operation.\n */\n async listBlobHierarchySegment(delimiter, marker, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"ContainerClient-listBlobHierarchySegment\", options);\n try {\n const response = await this.containerContext.listBlobHierarchySegment(delimiter, Object.assign(Object.assign({ marker }, options), convertTracingToRequestOptionsBase(updatedOptions)));\n 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) => {\n const blobItem = Object.assign(Object.assign({}, blobItemInteral), { name: BlobNameToString(blobItemInteral.name), tags: toTags(blobItemInteral.blobTags), objectReplicationSourceProperties: parseObjectReplicationRecord(blobItemInteral.objectReplicationMetadata) });\n return blobItem;\n }), blobPrefixes: (_a = response.segment.blobPrefixes) === null || _a === void 0 ? void 0 : _a.map((blobPrefixInternal) => {\n const blobPrefix = Object.assign(Object.assign({}, blobPrefixInternal), { name: BlobNameToString(blobPrefixInternal.name) });\n return blobPrefix;\n }) }) });\n return wrappedResponse;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns an AsyncIterableIterator for ContainerListBlobFlatSegmentResponse\n *\n * @param marker - A string value that identifies the portion of\n * the list of blobs to be returned with the next listing operation. The\n * operation returns the ContinuationToken value within the response body if the\n * listing operation did not return all blobs remaining to be listed\n * with the current page. The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list blobs operation.\n */\n listSegments(marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listSegments_1() {\n let listBlobsFlatSegmentResponse;\n if (!!marker || marker === undefined) {\n do {\n listBlobsFlatSegmentResponse = yield tslib.__await(this.listBlobFlatSegment(marker, options));\n marker = listBlobsFlatSegmentResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(listBlobsFlatSegmentResponse));\n } while (marker);\n }\n });\n }\n /**\n * Returns an AsyncIterableIterator of {@link BlobItem} objects\n *\n * @param options - Options to list blobs operation.\n */\n listItems(options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listItems_1() {\n var e_1, _a;\n let marker;\n try {\n for (var _b = tslib.__asyncValues(this.listSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {\n const listBlobsFlatSegmentResponse = _c.value;\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(listBlobsFlatSegmentResponse.segment.blobItems)));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n }\n /**\n * Returns an async iterable iterator to list all the blobs\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the blobs in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * // Get the containerClient before you run these snippets,\n * // Can be obtained from `blobServiceClient.getContainerClient(\"\");`\n * let i = 1;\n * for await (const blob of containerClient.listBlobsFlat()) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * let iter = containerClient.listBlobsFlat();\n * let blobItem = await iter.next();\n * while (!blobItem.done) {\n * console.log(`Blob ${i++}: ${blobItem.value.name}`);\n * blobItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of containerClient.listBlobsFlat().byPage({ maxPageSize: 20 })) {\n * for (const blob of response.segment.blobItems) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = containerClient.listBlobsFlat().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 blob names\n * for (const blob of response.segment.blobItems) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n *\n * // Passing next marker as continuationToken\n *\n * iterator = containerClient.listBlobsFlat().byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 blob names\n * for (const blob of response.segment.blobItems) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * ```\n *\n * @param options - Options to list blobs.\n * @returns An asyncIterableIterator that supports paging.\n */\n listBlobsFlat(options = {}) {\n const include = [];\n if (options.includeCopy) {\n include.push(\"copy\");\n }\n if (options.includeDeleted) {\n include.push(\"deleted\");\n }\n if (options.includeMetadata) {\n include.push(\"metadata\");\n }\n if (options.includeSnapshots) {\n include.push(\"snapshots\");\n }\n if (options.includeVersions) {\n include.push(\"versions\");\n }\n if (options.includeUncommitedBlobs) {\n include.push(\"uncommittedblobs\");\n }\n if (options.includeTags) {\n include.push(\"tags\");\n }\n if (options.includeDeletedWithVersions) {\n include.push(\"deletedwithversions\");\n }\n if (options.includeImmutabilityPolicy) {\n include.push(\"immutabilitypolicy\");\n }\n if (options.includeLegalHold) {\n include.push(\"legalhold\");\n }\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));\n // AsyncIterableIterator to iterate over blobs\n const iter = this.listItems(updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings = {}) => {\n return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));\n },\n };\n }\n /**\n * Returns an AsyncIterableIterator for ContainerListBlobHierarchySegmentResponse\n *\n * @param delimiter - The character or string used to define the virtual hierarchy\n * @param marker - A string value that identifies the portion of\n * the list of blobs to be returned with the next listing operation. The\n * operation returns the ContinuationToken value within the response body if the\n * listing operation did not return all blobs remaining to be listed\n * with the current page. The ContinuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list blobs operation.\n */\n listHierarchySegments(delimiter, marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listHierarchySegments_1() {\n let listBlobsHierarchySegmentResponse;\n if (!!marker || marker === undefined) {\n do {\n listBlobsHierarchySegmentResponse = yield tslib.__await(this.listBlobHierarchySegment(delimiter, marker, options));\n marker = listBlobsHierarchySegmentResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(listBlobsHierarchySegmentResponse));\n } while (marker);\n }\n });\n }\n /**\n * Returns an AsyncIterableIterator for {@link BlobPrefix} and {@link BlobItem} objects.\n *\n * @param delimiter - The character or string used to define the virtual hierarchy\n * @param options - Options to list blobs operation.\n */\n listItemsByHierarchy(delimiter, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listItemsByHierarchy_1() {\n var e_2, _a;\n let marker;\n try {\n for (var _b = tslib.__asyncValues(this.listHierarchySegments(delimiter, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {\n const listBlobsHierarchySegmentResponse = _c.value;\n const segment = listBlobsHierarchySegmentResponse.segment;\n if (segment.blobPrefixes) {\n for (const prefix of segment.blobPrefixes) {\n yield yield tslib.__await(Object.assign({ kind: \"prefix\" }, prefix));\n }\n }\n for (const blob of segment.blobItems) {\n yield yield tslib.__await(Object.assign({ kind: \"blob\" }, blob));\n }\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));\n }\n finally { if (e_2) throw e_2.error; }\n }\n });\n }\n /**\n * Returns an async iterable iterator to list all the blobs by hierarchy.\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the blobs by hierarchy in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * for await (const item of containerClient.listBlobsByHierarchy(\"/\")) {\n * if (item.kind === \"prefix\") {\n * console.log(`\\tBlobPrefix: ${item.name}`);\n * } else {\n * console.log(`\\tBlobItem: name - ${item.name}`);\n * }\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let iter = containerClient.listBlobsByHierarchy(\"/\", { prefix: \"prefix1/\" });\n * let entity = await iter.next();\n * while (!entity.done) {\n * let item = entity.value;\n * if (item.kind === \"prefix\") {\n * console.log(`\\tBlobPrefix: ${item.name}`);\n * } else {\n * console.log(`\\tBlobItem: name - ${item.name}`);\n * }\n * entity = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * console.log(\"Listing blobs by hierarchy by page\");\n * for await (const response of containerClient.listBlobsByHierarchy(\"/\").byPage()) {\n * const segment = response.segment;\n * if (segment.blobPrefixes) {\n * for (const prefix of segment.blobPrefixes) {\n * console.log(`\\tBlobPrefix: ${prefix.name}`);\n * }\n * }\n * for (const blob of response.segment.blobItems) {\n * console.log(`\\tBlobItem: name - ${blob.name}`);\n * }\n * }\n * ```\n *\n * Example using paging with a max page size:\n *\n * ```js\n * console.log(\"Listing blobs by hierarchy by page, specifying a prefix and a max page size\");\n *\n * let i = 1;\n * for await (const response of containerClient\n * .listBlobsByHierarchy(\"/\", { prefix: \"prefix2/sub1/\" })\n * .byPage({ maxPageSize: 2 })) {\n * console.log(`Page ${i++}`);\n * const segment = response.segment;\n *\n * if (segment.blobPrefixes) {\n * for (const prefix of segment.blobPrefixes) {\n * console.log(`\\tBlobPrefix: ${prefix.name}`);\n * }\n * }\n *\n * for (const blob of response.segment.blobItems) {\n * console.log(`\\tBlobItem: name - ${blob.name}`);\n * }\n * }\n * ```\n *\n * @param delimiter - The character or string used to define the virtual hierarchy\n * @param options - Options to list blobs operation.\n */\n listBlobsByHierarchy(delimiter, options = {}) {\n if (delimiter === \"\") {\n throw new RangeError(\"delimiter should contain one or more characters\");\n }\n const include = [];\n if (options.includeCopy) {\n include.push(\"copy\");\n }\n if (options.includeDeleted) {\n include.push(\"deleted\");\n }\n if (options.includeMetadata) {\n include.push(\"metadata\");\n }\n if (options.includeSnapshots) {\n include.push(\"snapshots\");\n }\n if (options.includeVersions) {\n include.push(\"versions\");\n }\n if (options.includeUncommitedBlobs) {\n include.push(\"uncommittedblobs\");\n }\n if (options.includeTags) {\n include.push(\"tags\");\n }\n if (options.includeDeletedWithVersions) {\n include.push(\"deletedwithversions\");\n }\n if (options.includeImmutabilityPolicy) {\n include.push(\"immutabilitypolicy\");\n }\n if (options.includeLegalHold) {\n include.push(\"legalhold\");\n }\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n const updatedOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include: include } : {}));\n // AsyncIterableIterator to iterate over blob prefixes and blobs\n const iter = this.listItemsByHierarchy(delimiter, updatedOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n async next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings = {}) => {\n return this.listHierarchySegments(delimiter, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, updatedOptions));\n },\n };\n }\n /**\n * The Filter Blobs operation enables callers to list blobs in the container whose tags\n * match a given search expression.\n *\n * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.\n * The given expression must evaluate to true for a blob to be returned in the results.\n * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;\n * however, only a subset of the OData filter syntax is supported in the Blob service.\n * @param marker - A string value that identifies the portion of\n * the list of blobs to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all blobs remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to find blobs by tags.\n */\n async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"ContainerClient-findBlobsByTagsSegment\", options);\n try {\n const response = await this.containerContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));\n const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => {\n var _a;\n let tagValue = \"\";\n if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) {\n tagValue = blob.tags.blobTagSet[0].value;\n }\n return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue });\n }) });\n return wrappedResponse;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns an AsyncIterableIterator for ContainerFindBlobsByTagsSegmentResponse.\n *\n * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.\n * The given expression must evaluate to true for a blob to be returned in the results.\n * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;\n * however, only a subset of the OData filter syntax is supported in the Blob service.\n * @param marker - A string value that identifies the portion of\n * the list of blobs to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all blobs remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to find blobs by tags.\n */\n findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() {\n let response;\n if (!!marker || marker === undefined) {\n do {\n response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options));\n response.blobs = response.blobs || [];\n marker = response.continuationToken;\n yield yield tslib.__await(response);\n } while (marker);\n }\n });\n }\n /**\n * Returns an AsyncIterableIterator for blobs.\n *\n * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.\n * The given expression must evaluate to true for a blob to be returned in the results.\n * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;\n * however, only a subset of the OData filter syntax is supported in the Blob service.\n * @param options - Options to findBlobsByTagsItems.\n */\n findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() {\n var e_3, _a;\n let marker;\n try {\n for (var _b = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {\n const segment = _c.value;\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)));\n }\n }\n catch (e_3_1) { e_3 = { error: e_3_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));\n }\n finally { if (e_3) throw e_3.error; }\n }\n });\n }\n /**\n * Returns an async iterable iterator to find all blobs with specified tag\n * under the specified container.\n *\n * .byPage() returns an async iterable iterator to list the blobs in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const blob of containerClient.findBlobsByTags(\"tagkey='tagvalue'\")) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * const iter = containerClient.findBlobsByTags(\"tagkey='tagvalue'\");\n * let blobItem = await iter.next();\n * while (!blobItem.done) {\n * console.log(`Blob ${i++}: ${blobItem.value.name}`);\n * blobItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of containerClient.findBlobsByTags(\"tagkey='tagvalue'\").byPage({ maxPageSize: 20 })) {\n * if (response.blobs) {\n * for (const blob of response.blobs) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = containerClient.findBlobsByTags(\"tagkey='tagvalue'\").byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 blob names\n * if (response.blobs) {\n * for (const blob of response.blobs) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * iterator = containerClient\n * .findBlobsByTags(\"tagkey='tagvalue'\")\n * .byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints blob names\n * if (response.blobs) {\n * for (const blob of response.blobs) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * }\n * ```\n *\n * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.\n * The given expression must evaluate to true for a blob to be returned in the results.\n * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;\n * however, only a subset of the OData filter syntax is supported in the Blob service.\n * @param options - Options to find blobs by tags.\n */\n findBlobsByTags(tagFilterSqlExpression, options = {}) {\n // AsyncIterableIterator to iterate over blobs\n const listSegmentOptions = Object.assign({}, options);\n const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings = {}) => {\n return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));\n },\n };\n }\n getContainerNameFromUrl() {\n let containerName;\n try {\n // URL may look like the following\n // \"https://myaccount.blob.core.windows.net/mycontainer?sasString\";\n // \"https://myaccount.blob.core.windows.net/mycontainer\";\n // IPv4/IPv6 address hosts, Endpoints - `http://127.0.0.1:10000/devstoreaccount1/containername`\n // http://localhost:10001/devstoreaccount1/containername\n const parsedUrl = coreHttp.URLBuilder.parse(this.url);\n if (parsedUrl.getHost().split(\".\")[1] === \"blob\") {\n // \"https://myaccount.blob.core.windows.net/containername\".\n // \"https://customdomain.com/containername\".\n // .getPath() -> /containername\n containerName = parsedUrl.getPath().split(\"/\")[1];\n }\n else if (isIpEndpointStyle(parsedUrl)) {\n // IPv4/IPv6 address hosts... Example - http://192.0.0.10:10001/devstoreaccount1/containername\n // Single word domain without a [dot] in the endpoint... Example - http://localhost:10001/devstoreaccount1/containername\n // .getPath() -> /devstoreaccount1/containername\n containerName = parsedUrl.getPath().split(\"/\")[2];\n }\n else {\n // \"https://customdomain.com/containername\".\n // .getPath() -> /containername\n containerName = parsedUrl.getPath().split(\"/\")[1];\n }\n // decode the encoded containerName - to get all the special characters that might be present in it\n containerName = decodeURIComponent(containerName);\n if (!containerName) {\n throw new Error(\"Provided containerName is invalid.\");\n }\n return containerName;\n }\n catch (error) {\n throw new Error(\"Unable to extract containerName with provided information.\");\n }\n }\n /**\n * Only available for ContainerClient constructed with a shared key credential.\n *\n * Generates a Blob Container Service Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-a-service-sas\n *\n * @param options - Optional parameters.\n * @returns The SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n generateSasUrl(options) {\n return new Promise((resolve) => {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw new RangeError(\"Can only generate the SAS when the client is initialized with a shared key credential\");\n }\n const sas = generateBlobSASQueryParameters(Object.assign({ containerName: this._containerName }, options), this.credential).toString();\n resolve(appendToURLQuery(this.url, sas));\n });\n }\n /**\n * Creates a BlobBatchClient object to conduct batch operations.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch\n *\n * @returns A new BlobBatchClient object for this container.\n */\n getBlobBatchClient() {\n return new BlobBatchClient(this.url, this.pipeline);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the permissions granted by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant permissions for that operation. Once all the\n * values are set, this should be serialized with toString and set as the permissions field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the permissions string without this class, but\n * the order of the permissions is particular and this class guarantees correctness.\n */\nclass AccountSASPermissions {\n constructor() {\n /**\n * Permission to read resources and list queues and tables granted.\n */\n this.read = false;\n /**\n * Permission to write resources granted.\n */\n this.write = false;\n /**\n * Permission to create blobs and files granted.\n */\n this.delete = false;\n /**\n * Permission to delete versions granted.\n */\n this.deleteVersion = false;\n /**\n * Permission to list blob containers, blobs, shares, directories, and files granted.\n */\n this.list = false;\n /**\n * Permission to add messages, table entities, and append to blobs granted.\n */\n this.add = false;\n /**\n * Permission to create blobs and files granted.\n */\n this.create = false;\n /**\n * Permissions to update messages and table entities granted.\n */\n this.update = false;\n /**\n * Permission to get and delete messages granted.\n */\n this.process = false;\n /**\n * Specfies Tag access granted.\n */\n this.tag = false;\n /**\n * Permission to filter blobs.\n */\n this.filter = false;\n /**\n * Permission to set immutability policy.\n */\n this.setImmutabilityPolicy = false;\n /**\n * Specifies that Permanent Delete is permitted.\n */\n this.permanentDelete = false;\n }\n /**\n * Parse initializes the AccountSASPermissions fields from a string.\n *\n * @param permissions -\n */\n static parse(permissions) {\n const accountSASPermissions = new AccountSASPermissions();\n for (const c of permissions) {\n switch (c) {\n case \"r\":\n accountSASPermissions.read = true;\n break;\n case \"w\":\n accountSASPermissions.write = true;\n break;\n case \"d\":\n accountSASPermissions.delete = true;\n break;\n case \"x\":\n accountSASPermissions.deleteVersion = true;\n break;\n case \"l\":\n accountSASPermissions.list = true;\n break;\n case \"a\":\n accountSASPermissions.add = true;\n break;\n case \"c\":\n accountSASPermissions.create = true;\n break;\n case \"u\":\n accountSASPermissions.update = true;\n break;\n case \"p\":\n accountSASPermissions.process = true;\n break;\n case \"t\":\n accountSASPermissions.tag = true;\n break;\n case \"f\":\n accountSASPermissions.filter = true;\n break;\n case \"i\":\n accountSASPermissions.setImmutabilityPolicy = true;\n break;\n case \"y\":\n accountSASPermissions.permanentDelete = true;\n break;\n default:\n throw new RangeError(`Invalid permission character: ${c}`);\n }\n }\n return accountSASPermissions;\n }\n /**\n * Creates a {@link AccountSASPermissions} from a raw object which contains same keys as it\n * and boolean values for them.\n *\n * @param permissionLike -\n */\n static from(permissionLike) {\n const accountSASPermissions = new AccountSASPermissions();\n if (permissionLike.read) {\n accountSASPermissions.read = true;\n }\n if (permissionLike.write) {\n accountSASPermissions.write = true;\n }\n if (permissionLike.delete) {\n accountSASPermissions.delete = true;\n }\n if (permissionLike.deleteVersion) {\n accountSASPermissions.deleteVersion = true;\n }\n if (permissionLike.filter) {\n accountSASPermissions.filter = true;\n }\n if (permissionLike.tag) {\n accountSASPermissions.tag = true;\n }\n if (permissionLike.list) {\n accountSASPermissions.list = true;\n }\n if (permissionLike.add) {\n accountSASPermissions.add = true;\n }\n if (permissionLike.create) {\n accountSASPermissions.create = true;\n }\n if (permissionLike.update) {\n accountSASPermissions.update = true;\n }\n if (permissionLike.process) {\n accountSASPermissions.process = true;\n }\n if (permissionLike.setImmutabilityPolicy) {\n accountSASPermissions.setImmutabilityPolicy = true;\n }\n if (permissionLike.permanentDelete) {\n accountSASPermissions.permanentDelete = true;\n }\n return accountSASPermissions;\n }\n /**\n * Produces the SAS permissions string for an Azure Storage account.\n * Call this method to set AccountSASSignatureValues Permissions field.\n *\n * Using this method will guarantee the resource types are in\n * an order accepted by the service.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\n toString() {\n // The order of the characters should be as specified here to ensure correctness:\n // https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n // Use a string array instead of string concatenating += operator for performance\n const permissions = [];\n if (this.read) {\n permissions.push(\"r\");\n }\n if (this.write) {\n permissions.push(\"w\");\n }\n if (this.delete) {\n permissions.push(\"d\");\n }\n if (this.deleteVersion) {\n permissions.push(\"x\");\n }\n if (this.filter) {\n permissions.push(\"f\");\n }\n if (this.tag) {\n permissions.push(\"t\");\n }\n if (this.list) {\n permissions.push(\"l\");\n }\n if (this.add) {\n permissions.push(\"a\");\n }\n if (this.create) {\n permissions.push(\"c\");\n }\n if (this.update) {\n permissions.push(\"u\");\n }\n if (this.process) {\n permissions.push(\"p\");\n }\n if (this.setImmutabilityPolicy) {\n permissions.push(\"i\");\n }\n if (this.permanentDelete) {\n permissions.push(\"y\");\n }\n return permissions.join(\"\");\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the resources accessible by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant access to that resource type. Once all the\n * values are set, this should be serialized with toString and set as the resources field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the resources string without this class, but\n * the order of the resources is particular and this class guarantees correctness.\n */\nclass AccountSASResourceTypes {\n constructor() {\n /**\n * Permission to access service level APIs granted.\n */\n this.service = false;\n /**\n * Permission to access container level APIs (Blob Containers, Tables, Queues, File Shares) granted.\n */\n this.container = false;\n /**\n * Permission to access object level APIs (Blobs, Table Entities, Queue Messages, Files) granted.\n */\n this.object = false;\n }\n /**\n * Creates an {@link AccountSASResourceTypes} from the specified resource types string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid resource type.\n *\n * @param resourceTypes -\n */\n static parse(resourceTypes) {\n const accountSASResourceTypes = new AccountSASResourceTypes();\n for (const c of resourceTypes) {\n switch (c) {\n case \"s\":\n accountSASResourceTypes.service = true;\n break;\n case \"c\":\n accountSASResourceTypes.container = true;\n break;\n case \"o\":\n accountSASResourceTypes.object = true;\n break;\n default:\n throw new RangeError(`Invalid resource type: ${c}`);\n }\n }\n return accountSASResourceTypes;\n }\n /**\n * Converts the given resource types to a string.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n */\n toString() {\n const resourceTypes = [];\n if (this.service) {\n resourceTypes.push(\"s\");\n }\n if (this.container) {\n resourceTypes.push(\"c\");\n }\n if (this.object) {\n resourceTypes.push(\"o\");\n }\n return resourceTypes.join(\"\");\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * This is a helper class to construct a string representing the services accessible by an AccountSAS. Setting a value\n * to true means that any SAS which uses these permissions will grant access to that service. Once all the\n * values are set, this should be serialized with toString and set as the services field on an\n * {@link AccountSASSignatureValues} object. It is possible to construct the services string without this class, but\n * the order of the services is particular and this class guarantees correctness.\n */\nclass AccountSASServices {\n constructor() {\n /**\n * Permission to access blob resources granted.\n */\n this.blob = false;\n /**\n * Permission to access file resources granted.\n */\n this.file = false;\n /**\n * Permission to access queue resources granted.\n */\n this.queue = false;\n /**\n * Permission to access table resources granted.\n */\n this.table = false;\n }\n /**\n * Creates an {@link AccountSASServices} from the specified services string. This method will throw an\n * Error if it encounters a character that does not correspond to a valid service.\n *\n * @param services -\n */\n static parse(services) {\n const accountSASServices = new AccountSASServices();\n for (const c of services) {\n switch (c) {\n case \"b\":\n accountSASServices.blob = true;\n break;\n case \"f\":\n accountSASServices.file = true;\n break;\n case \"q\":\n accountSASServices.queue = true;\n break;\n case \"t\":\n accountSASServices.table = true;\n break;\n default:\n throw new RangeError(`Invalid service character: ${c}`);\n }\n }\n return accountSASServices;\n }\n /**\n * Converts the given services to a string.\n *\n */\n toString() {\n const services = [];\n if (this.blob) {\n services.push(\"b\");\n }\n if (this.table) {\n services.push(\"t\");\n }\n if (this.queue) {\n services.push(\"q\");\n }\n if (this.file) {\n services.push(\"f\");\n }\n return services.join(\"\");\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n/**\n * ONLY AVAILABLE IN NODE.JS RUNTIME.\n *\n * Generates a {@link SASQueryParameters} object which contains all SAS query parameters needed to make an actual\n * REST request.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/constructing-an-account-sas\n *\n * @param accountSASSignatureValues -\n * @param sharedKeyCredential -\n */\nfunction generateAccountSASQueryParameters(accountSASSignatureValues, sharedKeyCredential) {\n const version = accountSASSignatureValues.version\n ? accountSASSignatureValues.version\n : SERVICE_VERSION;\n if (accountSASSignatureValues.permissions &&\n accountSASSignatureValues.permissions.setImmutabilityPolicy &&\n version < \"2020-08-04\") {\n throw RangeError(\"'version' must be >= '2020-08-04' when provided 'i' permission.\");\n }\n if (accountSASSignatureValues.permissions &&\n accountSASSignatureValues.permissions.deleteVersion &&\n version < \"2019-10-10\") {\n throw RangeError(\"'version' must be >= '2019-10-10' when provided 'x' permission.\");\n }\n if (accountSASSignatureValues.permissions &&\n accountSASSignatureValues.permissions.permanentDelete &&\n version < \"2019-10-10\") {\n throw RangeError(\"'version' must be >= '2019-10-10' when provided 'y' permission.\");\n }\n if (accountSASSignatureValues.permissions &&\n accountSASSignatureValues.permissions.tag &&\n version < \"2019-12-12\") {\n throw RangeError(\"'version' must be >= '2019-12-12' when provided 't' permission.\");\n }\n if (accountSASSignatureValues.permissions &&\n accountSASSignatureValues.permissions.filter &&\n version < \"2019-12-12\") {\n throw RangeError(\"'version' must be >= '2019-12-12' when provided 'f' permission.\");\n }\n if (accountSASSignatureValues.encryptionScope && version < \"2020-12-06\") {\n throw RangeError(\"'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS.\");\n }\n const parsedPermissions = AccountSASPermissions.parse(accountSASSignatureValues.permissions.toString());\n const parsedServices = AccountSASServices.parse(accountSASSignatureValues.services).toString();\n const parsedResourceTypes = AccountSASResourceTypes.parse(accountSASSignatureValues.resourceTypes).toString();\n let stringToSign;\n if (version >= \"2020-12-06\") {\n stringToSign = [\n sharedKeyCredential.accountName,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSASSignatureValues.startsOn\n ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)\n : \"\",\n truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),\n accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : \"\",\n accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : \"\",\n version,\n accountSASSignatureValues.encryptionScope ? accountSASSignatureValues.encryptionScope : \"\",\n \"\", // Account SAS requires an additional newline character\n ].join(\"\\n\");\n }\n else {\n stringToSign = [\n sharedKeyCredential.accountName,\n parsedPermissions,\n parsedServices,\n parsedResourceTypes,\n accountSASSignatureValues.startsOn\n ? truncatedISO8061Date(accountSASSignatureValues.startsOn, false)\n : \"\",\n truncatedISO8061Date(accountSASSignatureValues.expiresOn, false),\n accountSASSignatureValues.ipRange ? ipRangeToString(accountSASSignatureValues.ipRange) : \"\",\n accountSASSignatureValues.protocol ? accountSASSignatureValues.protocol : \"\",\n version,\n \"\", // Account SAS requires an additional newline character\n ].join(\"\\n\");\n }\n const signature = sharedKeyCredential.computeHMACSHA256(stringToSign);\n return new SASQueryParameters(version, signature, parsedPermissions.toString(), parsedServices, parsedResourceTypes, accountSASSignatureValues.protocol, accountSASSignatureValues.startsOn, accountSASSignatureValues.expiresOn, accountSASSignatureValues.ipRange, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, undefined, accountSASSignatureValues.encryptionScope);\n}\n\n/**\n * A BlobServiceClient represents a Client to the Azure Storage Blob service allowing you\n * to manipulate blob containers.\n */\nclass BlobServiceClient extends StorageClient {\n constructor(url, credentialOrPipeline, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n let pipeline;\n if (isPipelineLike(credentialOrPipeline)) {\n pipeline = credentialOrPipeline;\n }\n else if ((coreHttp.isNode && credentialOrPipeline instanceof StorageSharedKeyCredential) ||\n credentialOrPipeline instanceof AnonymousCredential ||\n coreHttp.isTokenCredential(credentialOrPipeline)) {\n pipeline = newPipeline(credentialOrPipeline, options);\n }\n else {\n // The second parameter is undefined. Use anonymous credential\n pipeline = newPipeline(new AnonymousCredential(), options);\n }\n super(url, pipeline);\n this.serviceContext = new Service(this.storageClientContext);\n }\n /**\n *\n * Creates an instance of BlobServiceClient from connection string.\n *\n * @param connectionString - Account connection string or a SAS connection string of an Azure storage account.\n * [ Note - Account connection string can only be used in NODE.JS runtime. ]\n * Account connection string example -\n * `DefaultEndpointsProtocol=https;AccountName=myaccount;AccountKey=accountKey;EndpointSuffix=core.windows.net`\n * SAS connection string example -\n * `BlobEndpoint=https://myaccount.blob.core.windows.net/;QueueEndpoint=https://myaccount.queue.core.windows.net/;FileEndpoint=https://myaccount.file.core.windows.net/;TableEndpoint=https://myaccount.table.core.windows.net/;SharedAccessSignature=sasString`\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n static fromConnectionString(connectionString, \n // Legacy, no fix for eslint error without breaking. Disable it for this interface.\n /* eslint-disable-next-line @azure/azure-sdk/ts-naming-options*/\n options) {\n options = options || {};\n const extractedCreds = extractConnectionStringParts(connectionString);\n if (extractedCreds.kind === \"AccountConnString\") {\n if (coreHttp.isNode) {\n const sharedKeyCredential = new StorageSharedKeyCredential(extractedCreds.accountName, extractedCreds.accountKey);\n if (!options.proxyOptions) {\n options.proxyOptions = coreHttp.getDefaultProxySettings(extractedCreds.proxyUri);\n }\n const pipeline = newPipeline(sharedKeyCredential, options);\n return new BlobServiceClient(extractedCreds.url, pipeline);\n }\n else {\n throw new Error(\"Account connection string is only supported in Node.js environment\");\n }\n }\n else if (extractedCreds.kind === \"SASConnString\") {\n const pipeline = newPipeline(new AnonymousCredential(), options);\n return new BlobServiceClient(extractedCreds.url + \"?\" + extractedCreds.accountSas, pipeline);\n }\n else {\n throw new Error(\"Connection string must be either an Account connection string or a SAS connection string\");\n }\n }\n /**\n * Creates a {@link ContainerClient} object\n *\n * @param containerName - A container name\n * @returns A new ContainerClient object for the given container name.\n *\n * Example usage:\n *\n * ```js\n * const containerClient = blobServiceClient.getContainerClient(\"\");\n * ```\n */\n getContainerClient(containerName) {\n return new ContainerClient(appendToURLPath(this.url, encodeURIComponent(containerName)), this.pipeline);\n }\n /**\n * Create a Blob container. @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-container\n *\n * @param containerName - Name of the container to create.\n * @param options - Options to configure Container Create operation.\n * @returns Container creation response and the corresponding container client.\n */\n async createContainer(containerName, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-createContainer\", options);\n try {\n const containerClient = this.getContainerClient(containerName);\n const containerCreateResponse = await containerClient.create(updatedOptions);\n return {\n containerClient,\n containerCreateResponse,\n };\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Deletes a Blob container.\n *\n * @param containerName - Name of the container to delete.\n * @param options - Options to configure Container Delete operation.\n * @returns Container deletion response.\n */\n async deleteContainer(containerName, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-deleteContainer\", options);\n try {\n const containerClient = this.getContainerClient(containerName);\n return await containerClient.delete(updatedOptions);\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Restore a previously deleted Blob container.\n * This API is only functional if Container Soft Delete is enabled for the storage account associated with the container.\n *\n * @param deletedContainerName - Name of the previously deleted container.\n * @param deletedContainerVersion - Version of the previously deleted container, used to uniquely identify the deleted container.\n * @param options - Options to configure Container Restore operation.\n * @returns Container deletion response.\n */\n async undeleteContainer(deletedContainerName, deletedContainerVersion, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-undeleteContainer\", options);\n try {\n const containerClient = this.getContainerClient(options.destinationContainerName || deletedContainerName);\n // Hack to access a protected member.\n const containerContext = new Container(containerClient[\"storageClientContext\"]);\n const containerUndeleteResponse = await containerContext.restore(Object.assign({ deletedContainerName,\n deletedContainerVersion }, updatedOptions));\n return { containerClient, containerUndeleteResponse };\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Rename an existing Blob Container.\n *\n * @param sourceContainerName - The name of the source container.\n * @param destinationContainerName - The new name of the container.\n * @param options - Options to configure Container Rename operation.\n */\n /* eslint-disable-next-line @typescript-eslint/ban-ts-comment */\n // @ts-ignore Need to hide this interface for now. Make it public and turn on the live tests for it when the service is ready.\n async renameContainer(sourceContainerName, destinationContainerName, options = {}) {\n var _a;\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-renameContainer\", options);\n try {\n const containerClient = this.getContainerClient(destinationContainerName);\n // Hack to access a protected member.\n const containerContext = new Container(containerClient[\"storageClientContext\"]);\n const containerRenameResponse = await containerContext.rename(sourceContainerName, Object.assign(Object.assign({}, updatedOptions), { sourceLeaseId: (_a = options.sourceCondition) === null || _a === void 0 ? void 0 : _a.leaseId }));\n return { containerClient, containerRenameResponse };\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Gets the properties of a storage account’s Blob service, including properties\n * for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties\n *\n * @param options - Options to the Service Get Properties operation.\n * @returns Response data for the Service Get Properties operation.\n */\n async getProperties(options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-getProperties\", options);\n try {\n return await this.serviceContext.getProperties(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Sets properties for a storage account’s Blob service endpoint, including properties\n * for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-service-properties\n *\n * @param properties -\n * @param options - Options to the Service Set Properties operation.\n * @returns Response data for the Service Set Properties operation.\n */\n async setProperties(properties, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-setProperties\", options);\n try {\n return await this.serviceContext.setProperties(properties, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Retrieves statistics related to replication for the Blob service. It is only\n * available on the secondary location endpoint when read-access geo-redundant\n * replication is enabled for the storage account.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-stats\n *\n * @param options - Options to the Service Get Statistics operation.\n * @returns Response data for the Service Get Statistics operation.\n */\n async getStatistics(options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-getStatistics\", options);\n try {\n return await this.serviceContext.getStatistics(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * The Get Account Information operation returns the sku name and account kind\n * for the specified account.\n * The Get Account Information operation is available on service versions beginning\n * with version 2018-03-28.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-account-information\n *\n * @param options - Options to the Service Get Account Info operation.\n * @returns Response data for the Service Get Account Info operation.\n */\n async getAccountInfo(options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-getAccountInfo\", options);\n try {\n return await this.serviceContext.getAccountInfo(Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns a list of the containers under the specified account.\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/list-containers2\n *\n * @param marker - A string value that identifies the portion of\n * the list of containers to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all containers remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to the Service List Container Segment operation.\n * @returns Response data for the Service List Container Segment operation.\n */\n async listContainersSegment(marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-listContainersSegment\", options);\n try {\n return await this.serviceContext.listContainersSegment(Object.assign(Object.assign(Object.assign({ abortSignal: options.abortSignal, marker }, options), { include: typeof options.include === \"string\" ? [options.include] : options.include }), convertTracingToRequestOptionsBase(updatedOptions)));\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * The Filter Blobs operation enables callers to list blobs across all containers whose tags\n * match a given search expression. Filter blobs searches across all containers within a\n * storage account but can be scoped within the expression to a single container.\n *\n * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.\n * The given expression must evaluate to true for a blob to be returned in the results.\n * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;\n * however, only a subset of the OData filter syntax is supported in the Blob service.\n * @param marker - A string value that identifies the portion of\n * the list of blobs to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all blobs remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to find blobs by tags.\n */\n async findBlobsByTagsSegment(tagFilterSqlExpression, marker, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-findBlobsByTagsSegment\", options);\n try {\n const response = await this.serviceContext.filterBlobs(Object.assign({ abortSignal: options.abortSignal, where: tagFilterSqlExpression, marker, maxPageSize: options.maxPageSize }, convertTracingToRequestOptionsBase(updatedOptions)));\n const wrappedResponse = Object.assign(Object.assign({}, response), { _response: response._response, blobs: response.blobs.map((blob) => {\n var _a;\n let tagValue = \"\";\n if (((_a = blob.tags) === null || _a === void 0 ? void 0 : _a.blobTagSet.length) === 1) {\n tagValue = blob.tags.blobTagSet[0].value;\n }\n return Object.assign(Object.assign({}, blob), { tags: toTags(blob.tags), tagValue });\n }) });\n return wrappedResponse;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Returns an AsyncIterableIterator for ServiceFindBlobsByTagsSegmentResponse.\n *\n * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.\n * The given expression must evaluate to true for a blob to be returned in the results.\n * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;\n * however, only a subset of the OData filter syntax is supported in the Blob service.\n * @param marker - A string value that identifies the portion of\n * the list of blobs to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all blobs remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to find blobs by tags.\n */\n findBlobsByTagsSegments(tagFilterSqlExpression, marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsSegments_1() {\n let response;\n if (!!marker || marker === undefined) {\n do {\n response = yield tslib.__await(this.findBlobsByTagsSegment(tagFilterSqlExpression, marker, options));\n response.blobs = response.blobs || [];\n marker = response.continuationToken;\n yield yield tslib.__await(response);\n } while (marker);\n }\n });\n }\n /**\n * Returns an AsyncIterableIterator for blobs.\n *\n * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.\n * The given expression must evaluate to true for a blob to be returned in the results.\n * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;\n * however, only a subset of the OData filter syntax is supported in the Blob service.\n * @param options - Options to findBlobsByTagsItems.\n */\n findBlobsByTagsItems(tagFilterSqlExpression, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* findBlobsByTagsItems_1() {\n var e_1, _a;\n let marker;\n try {\n for (var _b = tslib.__asyncValues(this.findBlobsByTagsSegments(tagFilterSqlExpression, marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {\n const segment = _c.value;\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.blobs)));\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));\n }\n finally { if (e_1) throw e_1.error; }\n }\n });\n }\n /**\n * Returns an async iterable iterator to find all blobs with specified tag\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the blobs in pages.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-blob-service-properties\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const blob of blobServiceClient.findBlobsByTags(\"tagkey='tagvalue'\")) {\n * console.log(`Blob ${i++}: ${container.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * const iter = blobServiceClient.findBlobsByTags(\"tagkey='tagvalue'\");\n * let blobItem = await iter.next();\n * while (!blobItem.done) {\n * console.log(`Blob ${i++}: ${blobItem.value.name}`);\n * blobItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of blobServiceClient.findBlobsByTags(\"tagkey='tagvalue'\").byPage({ maxPageSize: 20 })) {\n * if (response.blobs) {\n * for (const blob of response.blobs) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = blobServiceClient.findBlobsByTags(\"tagkey='tagvalue'\").byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 blob names\n * if (response.blobs) {\n * for (const blob of response.blobs) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * iterator = blobServiceClient\n * .findBlobsByTags(\"tagkey='tagvalue'\")\n * .byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints blob names\n * if (response.blobs) {\n * for (const blob of response.blobs) {\n * console.log(`Blob ${i++}: ${blob.name}`);\n * }\n * }\n * ```\n *\n * @param tagFilterSqlExpression - The where parameter enables the caller to query blobs whose tags match a given expression.\n * The given expression must evaluate to true for a blob to be returned in the results.\n * The[OData - ABNF] filter syntax rule defines the formal grammar for the value of the where query parameter;\n * however, only a subset of the OData filter syntax is supported in the Blob service.\n * @param options - Options to find blobs by tags.\n */\n findBlobsByTags(tagFilterSqlExpression, options = {}) {\n // AsyncIterableIterator to iterate over blobs\n const listSegmentOptions = Object.assign({}, options);\n const iter = this.findBlobsByTagsItems(tagFilterSqlExpression, listSegmentOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings = {}) => {\n return this.findBlobsByTagsSegments(tagFilterSqlExpression, settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));\n },\n };\n }\n /**\n * Returns an AsyncIterableIterator for ServiceListContainersSegmentResponses\n *\n * @param marker - A string value that identifies the portion of\n * the list of containers to be returned with the next listing operation. The\n * operation returns the continuationToken value within the response body if the\n * listing operation did not return all containers remaining to be listed\n * with the current page. The continuationToken value can be used as the value for\n * the marker parameter in a subsequent call to request the next page of list\n * items. The marker value is opaque to the client.\n * @param options - Options to list containers operation.\n */\n listSegments(marker, options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listSegments_1() {\n let listContainersSegmentResponse;\n if (!!marker || marker === undefined) {\n do {\n listContainersSegmentResponse = yield tslib.__await(this.listContainersSegment(marker, options));\n listContainersSegmentResponse.containerItems =\n listContainersSegmentResponse.containerItems || [];\n marker = listContainersSegmentResponse.continuationToken;\n yield yield tslib.__await(yield tslib.__await(listContainersSegmentResponse));\n } while (marker);\n }\n });\n }\n /**\n * Returns an AsyncIterableIterator for Container Items\n *\n * @param options - Options to list containers operation.\n */\n listItems(options = {}) {\n return tslib.__asyncGenerator(this, arguments, function* listItems_1() {\n var e_2, _a;\n let marker;\n try {\n for (var _b = tslib.__asyncValues(this.listSegments(marker, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {\n const segment = _c.value;\n yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(segment.containerItems)));\n }\n }\n catch (e_2_1) { e_2 = { error: e_2_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));\n }\n finally { if (e_2) throw e_2.error; }\n }\n });\n }\n /**\n * Returns an async iterable iterator to list all the containers\n * under the specified account.\n *\n * .byPage() returns an async iterable iterator to list the containers in pages.\n *\n * Example using `for await` syntax:\n *\n * ```js\n * let i = 1;\n * for await (const container of blobServiceClient.listContainers()) {\n * console.log(`Container ${i++}: ${container.name}`);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```js\n * let i = 1;\n * const iter = blobServiceClient.listContainers();\n * let containerItem = await iter.next();\n * while (!containerItem.done) {\n * console.log(`Container ${i++}: ${containerItem.value.name}`);\n * containerItem = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```js\n * // passing optional maxPageSize in the page settings\n * let i = 1;\n * for await (const response of blobServiceClient.listContainers().byPage({ maxPageSize: 20 })) {\n * if (response.containerItems) {\n * for (const container of response.containerItems) {\n * console.log(`Container ${i++}: ${container.name}`);\n * }\n * }\n * }\n * ```\n *\n * Example using paging with a marker:\n *\n * ```js\n * let i = 1;\n * let iterator = blobServiceClient.listContainers().byPage({ maxPageSize: 2 });\n * let response = (await iterator.next()).value;\n *\n * // Prints 2 container names\n * if (response.containerItems) {\n * for (const container of response.containerItems) {\n * console.log(`Container ${i++}: ${container.name}`);\n * }\n * }\n *\n * // Gets next marker\n * let marker = response.continuationToken;\n * // Passing next marker as continuationToken\n * iterator = blobServiceClient\n * .listContainers()\n * .byPage({ continuationToken: marker, maxPageSize: 10 });\n * response = (await iterator.next()).value;\n *\n * // Prints 10 container names\n * if (response.containerItems) {\n * for (const container of response.containerItems) {\n * console.log(`Container ${i++}: ${container.name}`);\n * }\n * }\n * ```\n *\n * @param options - Options to list containers.\n * @returns An asyncIterableIterator that supports paging.\n */\n listContainers(options = {}) {\n if (options.prefix === \"\") {\n options.prefix = undefined;\n }\n const include = [];\n if (options.includeDeleted) {\n include.push(\"deleted\");\n }\n if (options.includeMetadata) {\n include.push(\"metadata\");\n }\n if (options.includeSystem) {\n include.push(\"system\");\n }\n // AsyncIterableIterator to iterate over containers\n const listSegmentOptions = Object.assign(Object.assign({}, options), (include.length > 0 ? { include } : {}));\n const iter = this.listItems(listSegmentOptions);\n return {\n /**\n * The next method, part of the iteration protocol\n */\n next() {\n return iter.next();\n },\n /**\n * The connection to the async iterator, part of the iteration protocol\n */\n [Symbol.asyncIterator]() {\n return this;\n },\n /**\n * Return an AsyncIterableIterator that works a page at a time\n */\n byPage: (settings = {}) => {\n return this.listSegments(settings.continuationToken, Object.assign({ maxPageSize: settings.maxPageSize }, listSegmentOptions));\n },\n };\n }\n /**\n * ONLY AVAILABLE WHEN USING BEARER TOKEN AUTHENTICATION (TokenCredential).\n *\n * Retrieves a user delegation key for the Blob service. This is only a valid operation when using\n * bearer token authentication.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/get-user-delegation-key\n *\n * @param startsOn - The start time for the user delegation SAS. Must be within 7 days of the current time\n * @param expiresOn - The end time for the user delegation SAS. Must be within 7 days of the current time\n */\n async getUserDelegationKey(startsOn, expiresOn, options = {}) {\n const { span, updatedOptions } = createSpan(\"BlobServiceClient-getUserDelegationKey\", options);\n try {\n const response = await this.serviceContext.getUserDelegationKey({\n startsOn: truncatedISO8061Date(startsOn, false),\n expiresOn: truncatedISO8061Date(expiresOn, false),\n }, Object.assign({ abortSignal: options.abortSignal }, convertTracingToRequestOptionsBase(updatedOptions)));\n const userDelegationKey = {\n signedObjectId: response.signedObjectId,\n signedTenantId: response.signedTenantId,\n signedStartsOn: new Date(response.signedStartsOn),\n signedExpiresOn: new Date(response.signedExpiresOn),\n signedService: response.signedService,\n signedVersion: response.signedVersion,\n value: response.value,\n };\n const res = Object.assign({ _response: response._response, requestId: response.requestId, clientRequestId: response.clientRequestId, version: response.version, date: response.date, errorCode: response.errorCode }, userDelegationKey);\n return res;\n }\n catch (e) {\n span.setStatus({\n code: coreTracing.SpanStatusCode.ERROR,\n message: e.message,\n });\n throw e;\n }\n finally {\n span.end();\n }\n }\n /**\n * Creates a BlobBatchClient object to conduct batch operations.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/blob-batch\n *\n * @returns A new BlobBatchClient object for this service.\n */\n getBlobBatchClient() {\n return new BlobBatchClient(this.url, this.pipeline);\n }\n /**\n * Only available for BlobServiceClient constructed with a shared key credential.\n *\n * Generates a Blob account Shared Access Signature (SAS) URI based on the client properties\n * and parameters passed in. The SAS is signed by the shared key credential of the client.\n *\n * @see https://docs.microsoft.com/en-us/rest/api/storageservices/create-account-sas\n *\n * @param expiresOn - Optional. The time at which the shared access signature becomes invalid. Default to an hour later if not provided.\n * @param permissions - Specifies the list of permissions to be associated with the SAS.\n * @param resourceTypes - Specifies the resource types associated with the shared access signature.\n * @param options - Optional parameters.\n * @returns An account SAS URI consisting of the URI to the resource represented by this client, followed by the generated SAS token.\n */\n generateAccountSasUrl(expiresOn, permissions = AccountSASPermissions.parse(\"r\"), resourceTypes = \"sco\", options = {}) {\n if (!(this.credential instanceof StorageSharedKeyCredential)) {\n throw RangeError(\"Can only generate the account SAS when the client is initialized with a shared key credential\");\n }\n if (expiresOn === undefined) {\n const now = new Date();\n expiresOn = new Date(now.getTime() + 3600 * 1000);\n }\n const sas = generateAccountSASQueryParameters(Object.assign({ permissions,\n expiresOn,\n resourceTypes, services: AccountSASServices.parse(\"b\").toString() }, options), this.credential).toString();\n return appendToURLQuery(this.url, sas);\n }\n}\n\n// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/** Known values of {@link EncryptionAlgorithmType} that the service accepts. */\nexports.KnownEncryptionAlgorithmType = void 0;\n(function (KnownEncryptionAlgorithmType) {\n KnownEncryptionAlgorithmType[\"AES256\"] = \"AES256\";\n})(exports.KnownEncryptionAlgorithmType || (exports.KnownEncryptionAlgorithmType = {}));\n\nObject.defineProperty(exports, 'BaseRequestPolicy', {\n enumerable: true,\n get: function () { return coreHttp.BaseRequestPolicy; }\n});\nObject.defineProperty(exports, 'HttpHeaders', {\n enumerable: true,\n get: function () { return coreHttp.HttpHeaders; }\n});\nObject.defineProperty(exports, 'RequestPolicyOptions', {\n enumerable: true,\n get: function () { return coreHttp.RequestPolicyOptions; }\n});\nObject.defineProperty(exports, 'RestError', {\n enumerable: true,\n get: function () { return coreHttp.RestError; }\n});\nObject.defineProperty(exports, 'WebResource', {\n enumerable: true,\n get: function () { return coreHttp.WebResource; }\n});\nObject.defineProperty(exports, 'deserializationPolicy', {\n enumerable: true,\n get: function () { return coreHttp.deserializationPolicy; }\n});\nexports.AccountSASPermissions = AccountSASPermissions;\nexports.AccountSASResourceTypes = AccountSASResourceTypes;\nexports.AccountSASServices = AccountSASServices;\nexports.AnonymousCredential = AnonymousCredential;\nexports.AnonymousCredentialPolicy = AnonymousCredentialPolicy;\nexports.AppendBlobClient = AppendBlobClient;\nexports.BlobBatch = BlobBatch;\nexports.BlobBatchClient = BlobBatchClient;\nexports.BlobClient = BlobClient;\nexports.BlobLeaseClient = BlobLeaseClient;\nexports.BlobSASPermissions = BlobSASPermissions;\nexports.BlobServiceClient = BlobServiceClient;\nexports.BlockBlobClient = BlockBlobClient;\nexports.ContainerClient = ContainerClient;\nexports.ContainerSASPermissions = ContainerSASPermissions;\nexports.Credential = Credential;\nexports.CredentialPolicy = CredentialPolicy;\nexports.PageBlobClient = PageBlobClient;\nexports.Pipeline = Pipeline;\nexports.SASQueryParameters = SASQueryParameters;\nexports.StorageBrowserPolicy = StorageBrowserPolicy;\nexports.StorageBrowserPolicyFactory = StorageBrowserPolicyFactory;\nexports.StorageOAuthScopes = StorageOAuthScopes;\nexports.StorageRetryPolicy = StorageRetryPolicy;\nexports.StorageRetryPolicyFactory = StorageRetryPolicyFactory;\nexports.StorageSharedKeyCredential = StorageSharedKeyCredential;\nexports.StorageSharedKeyCredentialPolicy = StorageSharedKeyCredentialPolicy;\nexports.generateAccountSASQueryParameters = generateAccountSASQueryParameters;\nexports.generateBlobSASQueryParameters = generateBlobSASQueryParameters;\nexports.isPipelineLike = isPipelineLike;\nexports.logger = logger;\nexports.newPipeline = newPipeline;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.testDefinitions = void 0;\r\n/** Reference to the array that `Deno.test` calls insert their definition into. */\r\nexports.testDefinitions = [];\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.testDefinitions = exports.Deno = void 0;\r\nexports.Deno = require(\"./test.js\");\r\n__exportStar(require(\"./test.js\"), exports);\r\nvar definitions_js_1 = require(\"./definitions.js\");\r\nObject.defineProperty(exports, \"testDefinitions\", { enumerable: true, get: function () { return definitions_js_1.testDefinitions; } });\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.test = void 0;\r\nconst definitions_js_1 = require(\"./definitions.js\");\r\nconst test = function test() {\r\n var _a, _b;\r\n let testDef;\r\n const firstArg = arguments[0];\r\n const secondArg = arguments[1];\r\n const thirdArg = arguments[2];\r\n if (typeof firstArg === \"string\") {\r\n if (typeof secondArg === \"object\") {\r\n if (typeof thirdArg === \"function\") {\r\n if (secondArg.fn != null) {\r\n throw new TypeError(\"Unexpected 'fn' field in options, test function is already provided as the third argument.\");\r\n }\r\n }\r\n if (secondArg.name != null) {\r\n throw new TypeError(\"Unexpected 'name' field in options, test name is already provided as the first argument.\");\r\n }\r\n // name, options, fn\r\n testDef = { name: firstArg, fn: thirdArg, ...secondArg };\r\n }\r\n else {\r\n // name, fn\r\n testDef = { name: firstArg, fn: secondArg };\r\n }\r\n }\r\n else if (firstArg instanceof Function) {\r\n // function only\r\n if (firstArg.name.length === 0) {\r\n throw new TypeError(\"The test function must have a name\");\r\n }\r\n testDef = { fn: firstArg, name: firstArg.name };\r\n if (secondArg != null) {\r\n throw new TypeError(\"Unexpected second argument to Deno.test()\");\r\n }\r\n }\r\n else if (typeof firstArg === \"object\") {\r\n testDef = { ...firstArg };\r\n if (typeof secondArg === \"function\") {\r\n // options, fn\r\n testDef.fn = secondArg;\r\n if (firstArg.fn != null) {\r\n throw new TypeError(\"Unexpected 'fn' field in options, test function is already provided as the second argument.\");\r\n }\r\n if (testDef.name == null) {\r\n if (secondArg.name.length === 0) {\r\n throw new TypeError(\"The test function must have a name\");\r\n }\r\n // options without name, fn\r\n testDef.name = secondArg.name;\r\n }\r\n }\r\n else {\r\n if (typeof firstArg.fn !== \"function\") {\r\n throw new TypeError(\"Expected 'fn' field in the first argument to be a test function.\");\r\n }\r\n }\r\n }\r\n else {\r\n throw new TypeError(\"Unknown test overload\");\r\n }\r\n if (typeof testDef.fn !== \"function\") {\r\n throw new TypeError(\"Missing test function\");\r\n }\r\n if (((_b = (_a = testDef.name) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) === 0) {\r\n throw new TypeError(\"The test name can't be empty\");\r\n }\r\n definitions_js_1.testDefinitions.push(testDef);\r\n};\r\nexports.test = test;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n__exportStar(require(\"./deno/stable/main.js\"), exports);\r\n__exportStar(require(\"./deno/unstable/main.js\"), exports);\r\n","\"use strict\";\r\n///\r\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n};\r\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n};\r\nvar _Conn_socket;\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.TlsConn = exports.Conn = void 0;\r\nconst net_1 = require(\"net\");\r\nconst FsFile_js_1 = require(\"../stable/classes/FsFile.js\");\r\nclass Conn extends FsFile_js_1.FsFile {\r\n constructor(rid, localAddr, remoteAddr, socket) {\r\n super(rid);\r\n this.rid = rid;\r\n this.localAddr = localAddr;\r\n this.remoteAddr = remoteAddr;\r\n _Conn_socket.set(this, void 0);\r\n __classPrivateFieldSet(this, _Conn_socket, socket || new net_1.Socket({ fd: rid }), \"f\");\r\n }\r\n async closeWrite() {\r\n await new Promise((resolve) => __classPrivateFieldGet(this, _Conn_socket, \"f\").end(resolve));\r\n }\r\n setNoDelay(enable) {\r\n __classPrivateFieldGet(this, _Conn_socket, \"f\").setNoDelay(enable);\r\n }\r\n setKeepAlive(enable) {\r\n __classPrivateFieldGet(this, _Conn_socket, \"f\").setKeepAlive(enable);\r\n }\r\n ref() {\r\n __classPrivateFieldGet(this, _Conn_socket, \"f\").ref();\r\n }\r\n unref() {\r\n __classPrivateFieldGet(this, _Conn_socket, \"f\").unref();\r\n }\r\n}\r\nexports.Conn = Conn;\r\n_Conn_socket = new WeakMap();\r\nclass TlsConn extends Conn {\r\n handshake() {\r\n console.warn(\"@deno/shim-deno: Handshake is not supported.\");\r\n return Promise.resolve({\r\n alpnProtocol: null,\r\n });\r\n }\r\n}\r\nexports.TlsConn = TlsConn;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n};\r\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n};\r\nvar _Listener_listener;\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Listener = void 0;\r\nconst close_js_1 = require(\"../stable/functions/close.js\");\r\nconst errors = __importStar(require(\"../stable/variables/errors.js\"));\r\nclass Listener {\r\n constructor(rid, addr, listener) {\r\n this.rid = rid;\r\n this.addr = addr;\r\n _Listener_listener.set(this, void 0);\r\n __classPrivateFieldSet(this, _Listener_listener, listener, \"f\");\r\n }\r\n async accept() {\r\n if (!__classPrivateFieldGet(this, _Listener_listener, \"f\")) {\r\n throw new errors.BadResource(\"Listener not initialised\");\r\n }\r\n const result = await __classPrivateFieldGet(this, _Listener_listener, \"f\").next();\r\n if (result.done) {\r\n throw new errors.BadResource(\"Server not listening\");\r\n }\r\n return result.value;\r\n }\r\n async next() {\r\n let conn;\r\n try {\r\n conn = await this.accept();\r\n }\r\n catch (error) {\r\n if (error instanceof errors.BadResource) {\r\n return { value: undefined, done: true };\r\n }\r\n throw error;\r\n }\r\n return { value: conn, done: false };\r\n }\r\n return(value) {\r\n this.close();\r\n return Promise.resolve({ value, done: true });\r\n }\r\n close() {\r\n (0, close_js_1.close)(this.rid);\r\n }\r\n ref() {\r\n throw new Error(\"Not implemented\");\r\n }\r\n unref() {\r\n throw new Error(\"Not implemented\");\r\n }\r\n [(_Listener_listener = new WeakMap(), Symbol.asyncIterator)]() {\r\n return this;\r\n }\r\n}\r\nexports.Listener = Listener;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.DEFAULT_BUFFER_SIZE = void 0;\r\nexports.DEFAULT_BUFFER_SIZE = 32 * 1024;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nconst errors = __importStar(require(\"../stable/variables/errors.js\"));\r\nconst mapper = (Ctor) => (err) => Object.assign(new Ctor(err.message), {\r\n stack: err.stack,\r\n});\r\nconst map = {\r\n EEXIST: mapper(errors.AlreadyExists),\r\n ENOENT: mapper(errors.NotFound),\r\n};\r\nconst isNodeErr = (e) => {\r\n return e instanceof Error && \"code\" in e;\r\n};\r\nfunction mapError(e) {\r\n var _a;\r\n if (!isNodeErr(e))\r\n return e;\r\n return ((_a = map[e.code]) === null || _a === void 0 ? void 0 : _a.call(map, e)) || e;\r\n}\r\nexports.default = mapError;\r\n","\"use strict\";\r\n// getAccessFlag and getCreationFlag adapted from the original in Rust's std::fs\r\n// \r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.getFsFlag = exports.getCreationFlag = exports.getAccessFlag = void 0;\r\nconst errors = __importStar(require(\"../stable/variables/errors.js\"));\r\nconst fs_1 = require(\"fs\");\r\nconst os_1 = __importDefault(require(\"os\"));\r\nconst { O_APPEND, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY } = fs_1.constants;\r\nfunction getAccessFlag(opts) {\r\n if (opts.read && !opts.write && !opts.append)\r\n return O_RDONLY;\r\n if (!opts.read && opts.write && !opts.append)\r\n return O_WRONLY;\r\n if (opts.read && opts.write && !opts.append)\r\n return O_RDWR;\r\n if (!opts.read && opts.append)\r\n return O_WRONLY | O_APPEND;\r\n if (opts.read && opts.append)\r\n return O_RDWR | O_APPEND;\r\n if (!opts.read && !opts.write && !opts.append) {\r\n throw new errors.BadResource(\"EINVAL: One of 'read', 'write', 'append' is required to open file.\");\r\n }\r\n throw new errors.BadResource(\"EINVAL: Invalid fs flags.\");\r\n}\r\nexports.getAccessFlag = getAccessFlag;\r\nfunction getCreationFlag(opts) {\r\n if (!opts.write && !opts.append) {\r\n if (opts.truncate || opts.create || opts.createNew) {\r\n throw new errors.BadResource(\"EINVAL: One of 'write', 'append' is required to 'truncate', 'create' or 'createNew' file.\");\r\n }\r\n }\r\n if (opts.append) {\r\n if (opts.truncate && !opts.createNew) {\r\n throw new errors.BadResource(\"EINVAL: unexpected 'truncate': true and 'createNew': false when 'append' is true.\");\r\n }\r\n }\r\n if (!opts.create && !opts.truncate && !opts.createNew)\r\n return 0;\r\n if (opts.create && !opts.truncate && !opts.createNew)\r\n return O_CREAT;\r\n if (!opts.create && opts.truncate && !opts.createNew) {\r\n if (os_1.default.platform() === \"win32\") {\r\n // for some reason only providing O_TRUNC on windows will\r\n // throw a \"EINVAL: invalid argument\", so to work around this\r\n // we relax the restriction here to also create the file if it\r\n // doesn't exist\r\n return O_CREAT | O_TRUNC;\r\n }\r\n else {\r\n return O_TRUNC;\r\n }\r\n }\r\n if (opts.create && opts.truncate && !opts.createNew) {\r\n return O_CREAT | O_TRUNC;\r\n }\r\n if (opts.createNew)\r\n return O_CREAT | O_EXCL;\r\n throw new errors.BadResource(\"EINVAL: Invalid fs flags.\");\r\n}\r\nexports.getCreationFlag = getCreationFlag;\r\nfunction getFsFlag(flags) {\r\n return getAccessFlag(flags) | getCreationFlag(flags);\r\n}\r\nexports.getFsFlag = getFsFlag;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.merge = exports.mapAsync = exports.map = void 0;\r\nfunction* map(iter, f) {\r\n for (const i of iter) {\r\n yield f(i);\r\n }\r\n}\r\nexports.map = map;\r\nasync function* mapAsync(iter, f) {\r\n for await (const i of iter) {\r\n yield f(i);\r\n }\r\n}\r\nexports.mapAsync = mapAsync;\r\nasync function* merge(iterables) {\r\n const racers = new Map(map(map(iterables, (iter) => iter[Symbol.asyncIterator]()), (iter) => [iter, iter.next()]));\r\n while (racers.size > 0) {\r\n const winner = await Promise.race(map(racers.entries(), ([iter, prom]) => prom.then((result) => ({ result, iter }))));\r\n if (winner.result.done) {\r\n racers.delete(winner.iter);\r\n }\r\n else {\r\n yield await winner.result.value;\r\n racers.set(winner.iter, winner.iter.next());\r\n }\r\n }\r\n}\r\nexports.merge = merge;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.randomId = void 0;\r\nconst randomId = () => {\r\n const n = (Math.random() * 0xfffff * 1000000).toString(16);\r\n return \"\" + n.slice(0, 6);\r\n};\r\nexports.randomId = randomId;\r\n","\"use strict\";\r\n/// \r\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n};\r\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n};\r\nvar _BufferStreamReader_instances, _BufferStreamReader_stream, _BufferStreamReader_error, _BufferStreamReader_ended, _BufferStreamReader_pendingActions, _BufferStreamReader_runPendingActions, _StreamWriter_stream;\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.StreamWriter = exports.BufferStreamReader = void 0;\r\nclass BufferStreamReader {\r\n constructor(stream) {\r\n _BufferStreamReader_instances.add(this);\r\n _BufferStreamReader_stream.set(this, void 0);\r\n _BufferStreamReader_error.set(this, void 0);\r\n _BufferStreamReader_ended.set(this, false);\r\n _BufferStreamReader_pendingActions.set(this, []);\r\n __classPrivateFieldSet(this, _BufferStreamReader_stream, stream, \"f\");\r\n __classPrivateFieldGet(this, _BufferStreamReader_stream, \"f\").pause();\r\n __classPrivateFieldGet(this, _BufferStreamReader_stream, \"f\").on(\"error\", (error) => {\r\n __classPrivateFieldSet(this, _BufferStreamReader_error, error, \"f\");\r\n __classPrivateFieldGet(this, _BufferStreamReader_instances, \"m\", _BufferStreamReader_runPendingActions).call(this);\r\n });\r\n __classPrivateFieldGet(this, _BufferStreamReader_stream, \"f\").on(\"readable\", () => {\r\n __classPrivateFieldGet(this, _BufferStreamReader_instances, \"m\", _BufferStreamReader_runPendingActions).call(this);\r\n });\r\n __classPrivateFieldGet(this, _BufferStreamReader_stream, \"f\").on(\"end\", () => {\r\n __classPrivateFieldSet(this, _BufferStreamReader_ended, true, \"f\");\r\n __classPrivateFieldGet(this, _BufferStreamReader_instances, \"m\", _BufferStreamReader_runPendingActions).call(this);\r\n });\r\n }\r\n readAll() {\r\n return new Promise((resolve, reject) => {\r\n const chunks = [];\r\n const action = () => {\r\n if (__classPrivateFieldGet(this, _BufferStreamReader_error, \"f\")) {\r\n reject(__classPrivateFieldGet(this, _BufferStreamReader_error, \"f\"));\r\n return;\r\n }\r\n const buffer = __classPrivateFieldGet(this, _BufferStreamReader_stream, \"f\").read();\r\n if (buffer != null) {\r\n chunks.push(buffer);\r\n __classPrivateFieldGet(this, _BufferStreamReader_pendingActions, \"f\").push(action);\r\n }\r\n else if (__classPrivateFieldGet(this, _BufferStreamReader_ended, \"f\")) {\r\n const result = Buffer.concat(chunks);\r\n resolve(result);\r\n }\r\n else {\r\n __classPrivateFieldGet(this, _BufferStreamReader_pendingActions, \"f\").push(action);\r\n }\r\n };\r\n action();\r\n });\r\n }\r\n read(p) {\r\n return new Promise((resolve, reject) => {\r\n const action = () => {\r\n if (__classPrivateFieldGet(this, _BufferStreamReader_error, \"f\")) {\r\n reject(__classPrivateFieldGet(this, _BufferStreamReader_error, \"f\"));\r\n return;\r\n }\r\n const readBuffer = __classPrivateFieldGet(this, _BufferStreamReader_stream, \"f\").read(p.byteLength);\r\n if (readBuffer && readBuffer.byteLength > 0) {\r\n readBuffer.copy(p, 0, 0, readBuffer.byteLength);\r\n resolve(readBuffer.byteLength);\r\n return;\r\n }\r\n if (__classPrivateFieldGet(this, _BufferStreamReader_ended, \"f\")) {\r\n resolve(null);\r\n }\r\n else {\r\n __classPrivateFieldGet(this, _BufferStreamReader_pendingActions, \"f\").push(action);\r\n }\r\n };\r\n action();\r\n });\r\n }\r\n}\r\nexports.BufferStreamReader = BufferStreamReader;\r\n_BufferStreamReader_stream = new WeakMap(), _BufferStreamReader_error = new WeakMap(), _BufferStreamReader_ended = new WeakMap(), _BufferStreamReader_pendingActions = new WeakMap(), _BufferStreamReader_instances = new WeakSet(), _BufferStreamReader_runPendingActions = function _BufferStreamReader_runPendingActions() {\r\n const errors = [];\r\n for (const action of __classPrivateFieldGet(this, _BufferStreamReader_pendingActions, \"f\").splice(0)) {\r\n try {\r\n action();\r\n }\r\n catch (err) {\r\n errors.push(err);\r\n }\r\n }\r\n if (errors.length > 0) {\r\n throw (errors.length > 1 ? new AggregateError(errors) : errors[0]);\r\n }\r\n};\r\nclass StreamWriter {\r\n constructor(stream) {\r\n _StreamWriter_stream.set(this, void 0);\r\n __classPrivateFieldSet(this, _StreamWriter_stream, stream, \"f\");\r\n }\r\n write(p) {\r\n return new Promise((resolve, reject) => {\r\n __classPrivateFieldGet(this, _StreamWriter_stream, \"f\").write(p, (err) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n else {\r\n resolve(p.byteLength);\r\n }\r\n });\r\n });\r\n }\r\n}\r\nexports.StreamWriter = StreamWriter;\r\n_StreamWriter_stream = new WeakMap();\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.typescript = exports.deno = void 0;\r\nexports.deno = \"1.29.2\";\r\nexports.typescript = \"4.9.4\";\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.PermissionStatus = exports.Permissions = exports.FsFile = exports.File = void 0;\r\nvar FsFile_js_1 = require(\"./classes/FsFile.js\");\r\nObject.defineProperty(exports, \"File\", { enumerable: true, get: function () { return FsFile_js_1.File; } });\r\nObject.defineProperty(exports, \"FsFile\", { enumerable: true, get: function () { return FsFile_js_1.FsFile; } });\r\nvar Permissions_js_1 = require(\"./classes/Permissions.js\");\r\nObject.defineProperty(exports, \"Permissions\", { enumerable: true, get: function () { return Permissions_js_1.Permissions; } });\r\nvar PermissionStatus_js_1 = require(\"./classes/PermissionStatus.js\");\r\nObject.defineProperty(exports, \"PermissionStatus\", { enumerable: true, get: function () { return PermissionStatus_js_1.PermissionStatus; } });\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.File = exports.FsFile = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst fstat_js_1 = require(\"../functions/fstat.js\");\r\nconst fstatSync_js_1 = require(\"../functions/fstatSync.js\");\r\nconst ftruncate_js_1 = require(\"../functions/ftruncate.js\");\r\nconst ftruncateSync_js_1 = require(\"../functions/ftruncateSync.js\");\r\nconst read_js_1 = require(\"../functions/read.js\");\r\nconst readSync_js_1 = require(\"../functions/readSync.js\");\r\nconst write_js_1 = require(\"../functions/write.js\");\r\nconst writeSync_js_1 = require(\"../functions/writeSync.js\");\r\nclass FsFile {\r\n constructor(rid) {\r\n this.rid = rid;\r\n }\r\n async write(p) {\r\n return await (0, write_js_1.write)(this.rid, p);\r\n }\r\n writeSync(p) {\r\n return (0, writeSync_js_1.writeSync)(this.rid, p);\r\n }\r\n async truncate(len) {\r\n await (0, ftruncate_js_1.ftruncate)(this.rid, len);\r\n }\r\n truncateSync(len) {\r\n return (0, ftruncateSync_js_1.ftruncateSync)(this.rid, len);\r\n }\r\n read(p) {\r\n return (0, read_js_1.read)(this.rid, p);\r\n }\r\n readSync(p) {\r\n return (0, readSync_js_1.readSync)(this.rid, p);\r\n }\r\n seek(_offset, _whence) {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n seekSync(_offset, _whence) {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n async stat() {\r\n return await (0, fstat_js_1.fstat)(this.rid);\r\n }\r\n statSync() {\r\n return (0, fstatSync_js_1.fstatSync)(this.rid);\r\n }\r\n close() {\r\n fs.closeSync(this.rid);\r\n }\r\n get readable() {\r\n throw new Error(\"Not implemented.\");\r\n }\r\n get writable() {\r\n throw new Error(\"Not implemented.\");\r\n }\r\n}\r\nexports.FsFile = FsFile;\r\nconst File = FsFile;\r\nexports.File = File;\r\n","\"use strict\";\r\n///\r\nvar _a, _b;\r\nvar _c;\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.PermissionStatus = void 0;\r\n// The listeners don't actually matter because the state of these permissions\r\n// is constant and mocked as Node.js has all doors open.\r\n(_a = (_c = globalThis).EventTarget) !== null && _a !== void 0 ? _a : (_c.EventTarget = (_b = require(\"events\").EventTarget) !== null && _b !== void 0 ? _b : null);\r\nclass PermissionStatus extends EventTarget {\r\n /** @internal */\r\n constructor(state) {\r\n super();\r\n this.state = state;\r\n this.onchange = null;\r\n }\r\n}\r\nexports.PermissionStatus = PermissionStatus;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Permissions = void 0;\r\nconst PermissionStatus_js_1 = require(\"../classes/PermissionStatus.js\");\r\nclass Permissions {\r\n query(_desc) {\r\n return Promise.resolve(new PermissionStatus_js_1.PermissionStatus(\"granted\"));\r\n }\r\n revoke(_desc) {\r\n return Promise.resolve(new PermissionStatus_js_1.PermissionStatus(\"denied\"));\r\n }\r\n request(desc) {\r\n return this.query(desc);\r\n }\r\n}\r\nexports.Permissions = Permissions;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SeekMode = void 0;\r\nvar SeekMode_js_1 = require(\"./enums/SeekMode.js\");\r\nObject.defineProperty(exports, \"SeekMode\", { enumerable: true, get: function () { return SeekMode_js_1.SeekMode; } });\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.SeekMode = void 0;\r\nvar SeekMode;\r\n(function (SeekMode) {\r\n SeekMode[SeekMode[\"Start\"] = 0] = \"Start\";\r\n SeekMode[SeekMode[\"Current\"] = 1] = \"Current\";\r\n SeekMode[SeekMode[\"End\"] = 2] = \"End\";\r\n})(SeekMode = exports.SeekMode || (exports.SeekMode = {}));\r\n","\"use strict\";\r\n// Command palette -> Organize imports\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.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;\r\nexports.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;\r\nvar tty_1 = require(\"tty\");\r\nObject.defineProperty(exports, \"isatty\", { enumerable: true, get: function () { return tty_1.isatty; } });\r\nvar chdir_js_1 = require(\"./functions/chdir.js\");\r\nObject.defineProperty(exports, \"chdir\", { enumerable: true, get: function () { return chdir_js_1.chdir; } });\r\nvar chmod_js_1 = require(\"./functions/chmod.js\");\r\nObject.defineProperty(exports, \"chmod\", { enumerable: true, get: function () { return chmod_js_1.chmod; } });\r\nvar chmodSync_js_1 = require(\"./functions/chmodSync.js\");\r\nObject.defineProperty(exports, \"chmodSync\", { enumerable: true, get: function () { return chmodSync_js_1.chmodSync; } });\r\nvar chown_js_1 = require(\"./functions/chown.js\");\r\nObject.defineProperty(exports, \"chown\", { enumerable: true, get: function () { return chown_js_1.chown; } });\r\nvar chownSync_js_1 = require(\"./functions/chownSync.js\");\r\nObject.defineProperty(exports, \"chownSync\", { enumerable: true, get: function () { return chownSync_js_1.chownSync; } });\r\nvar close_js_1 = require(\"./functions/close.js\");\r\nObject.defineProperty(exports, \"close\", { enumerable: true, get: function () { return close_js_1.close; } });\r\nvar connect_js_1 = require(\"./functions/connect.js\");\r\nObject.defineProperty(exports, \"connect\", { enumerable: true, get: function () { return connect_js_1.connect; } });\r\nvar connectTls_js_1 = require(\"./functions/connectTls.js\");\r\nObject.defineProperty(exports, \"connectTls\", { enumerable: true, get: function () { return connectTls_js_1.connectTls; } });\r\nvar copy_js_1 = require(\"./functions/copy.js\");\r\nObject.defineProperty(exports, \"copy\", { enumerable: true, get: function () { return copy_js_1.copy; } });\r\nvar copyFile_js_1 = require(\"./functions/copyFile.js\");\r\nObject.defineProperty(exports, \"copyFile\", { enumerable: true, get: function () { return copyFile_js_1.copyFile; } });\r\nvar copyFileSync_js_1 = require(\"./functions/copyFileSync.js\");\r\nObject.defineProperty(exports, \"copyFileSync\", { enumerable: true, get: function () { return copyFileSync_js_1.copyFileSync; } });\r\nvar create_js_1 = require(\"./functions/create.js\");\r\nObject.defineProperty(exports, \"create\", { enumerable: true, get: function () { return create_js_1.create; } });\r\nvar createSync_js_1 = require(\"./functions/createSync.js\");\r\nObject.defineProperty(exports, \"createSync\", { enumerable: true, get: function () { return createSync_js_1.createSync; } });\r\nvar cwd_js_1 = require(\"./functions/cwd.js\");\r\nObject.defineProperty(exports, \"cwd\", { enumerable: true, get: function () { return cwd_js_1.cwd; } });\r\nvar execPath_js_1 = require(\"./functions/execPath.js\");\r\nObject.defineProperty(exports, \"execPath\", { enumerable: true, get: function () { return execPath_js_1.execPath; } });\r\nvar exit_js_1 = require(\"./functions/exit.js\");\r\nObject.defineProperty(exports, \"exit\", { enumerable: true, get: function () { return exit_js_1.exit; } });\r\nvar fdatasync_js_1 = require(\"./functions/fdatasync.js\");\r\nObject.defineProperty(exports, \"fdatasync\", { enumerable: true, get: function () { return fdatasync_js_1.fdatasync; } });\r\nvar fdatasyncSync_js_1 = require(\"./functions/fdatasyncSync.js\");\r\nObject.defineProperty(exports, \"fdatasyncSync\", { enumerable: true, get: function () { return fdatasyncSync_js_1.fdatasyncSync; } });\r\nvar fstat_js_1 = require(\"./functions/fstat.js\");\r\nObject.defineProperty(exports, \"fstat\", { enumerable: true, get: function () { return fstat_js_1.fstat; } });\r\nvar fstatSync_js_1 = require(\"./functions/fstatSync.js\");\r\nObject.defineProperty(exports, \"fstatSync\", { enumerable: true, get: function () { return fstatSync_js_1.fstatSync; } });\r\nvar fsync_js_1 = require(\"./functions/fsync.js\");\r\nObject.defineProperty(exports, \"fsync\", { enumerable: true, get: function () { return fsync_js_1.fsync; } });\r\nvar fsyncSync_js_1 = require(\"./functions/fsyncSync.js\");\r\nObject.defineProperty(exports, \"fsyncSync\", { enumerable: true, get: function () { return fsyncSync_js_1.fsyncSync; } });\r\nvar ftruncate_js_1 = require(\"./functions/ftruncate.js\");\r\nObject.defineProperty(exports, \"ftruncate\", { enumerable: true, get: function () { return ftruncate_js_1.ftruncate; } });\r\nvar ftruncateSync_js_1 = require(\"./functions/ftruncateSync.js\");\r\nObject.defineProperty(exports, \"ftruncateSync\", { enumerable: true, get: function () { return ftruncateSync_js_1.ftruncateSync; } });\r\nvar inspect_js_1 = require(\"./functions/inspect.js\");\r\nObject.defineProperty(exports, \"inspect\", { enumerable: true, get: function () { return inspect_js_1.inspect; } });\r\nvar kill_js_1 = require(\"./functions/kill.js\");\r\nObject.defineProperty(exports, \"kill\", { enumerable: true, get: function () { return kill_js_1.kill; } });\r\nvar link_js_1 = require(\"./functions/link.js\");\r\nObject.defineProperty(exports, \"link\", { enumerable: true, get: function () { return link_js_1.link; } });\r\nvar linkSync_js_1 = require(\"./functions/linkSync.js\");\r\nObject.defineProperty(exports, \"linkSync\", { enumerable: true, get: function () { return linkSync_js_1.linkSync; } });\r\nvar listen_js_1 = require(\"./functions/listen.js\");\r\nObject.defineProperty(exports, \"listen\", { enumerable: true, get: function () { return listen_js_1.listen; } });\r\nvar listenTls_js_1 = require(\"./functions/listenTls.js\");\r\nObject.defineProperty(exports, \"listenTls\", { enumerable: true, get: function () { return listenTls_js_1.listenTls; } });\r\nvar lstat_js_1 = require(\"./functions/lstat.js\");\r\nObject.defineProperty(exports, \"lstat\", { enumerable: true, get: function () { return lstat_js_1.lstat; } });\r\nvar lstatSync_js_1 = require(\"./functions/lstatSync.js\");\r\nObject.defineProperty(exports, \"lstatSync\", { enumerable: true, get: function () { return lstatSync_js_1.lstatSync; } });\r\nvar makeTempDir_js_1 = require(\"./functions/makeTempDir.js\");\r\nObject.defineProperty(exports, \"makeTempDir\", { enumerable: true, get: function () { return makeTempDir_js_1.makeTempDir; } });\r\nvar makeTempDirSync_js_1 = require(\"./functions/makeTempDirSync.js\");\r\nObject.defineProperty(exports, \"makeTempDirSync\", { enumerable: true, get: function () { return makeTempDirSync_js_1.makeTempDirSync; } });\r\nvar makeTempFile_js_1 = require(\"./functions/makeTempFile.js\");\r\nObject.defineProperty(exports, \"makeTempFile\", { enumerable: true, get: function () { return makeTempFile_js_1.makeTempFile; } });\r\nvar makeTempFileSync_js_1 = require(\"./functions/makeTempFileSync.js\");\r\nObject.defineProperty(exports, \"makeTempFileSync\", { enumerable: true, get: function () { return makeTempFileSync_js_1.makeTempFileSync; } });\r\nvar memoryUsage_js_1 = require(\"./functions/memoryUsage.js\");\r\nObject.defineProperty(exports, \"memoryUsage\", { enumerable: true, get: function () { return memoryUsage_js_1.memoryUsage; } });\r\nvar mkdir_js_1 = require(\"./functions/mkdir.js\");\r\nObject.defineProperty(exports, \"mkdir\", { enumerable: true, get: function () { return mkdir_js_1.mkdir; } });\r\nvar mkdirSync_js_1 = require(\"./functions/mkdirSync.js\");\r\nObject.defineProperty(exports, \"mkdirSync\", { enumerable: true, get: function () { return mkdirSync_js_1.mkdirSync; } });\r\nvar open_js_1 = require(\"./functions/open.js\");\r\nObject.defineProperty(exports, \"open\", { enumerable: true, get: function () { return open_js_1.open; } });\r\nvar openSync_js_1 = require(\"./functions/openSync.js\");\r\nObject.defineProperty(exports, \"openSync\", { enumerable: true, get: function () { return openSync_js_1.openSync; } });\r\nvar read_js_1 = require(\"./functions/read.js\");\r\nObject.defineProperty(exports, \"read\", { enumerable: true, get: function () { return read_js_1.read; } });\r\nvar readDir_js_1 = require(\"./functions/readDir.js\");\r\nObject.defineProperty(exports, \"readDir\", { enumerable: true, get: function () { return readDir_js_1.readDir; } });\r\nvar readDirSync_js_1 = require(\"./functions/readDirSync.js\");\r\nObject.defineProperty(exports, \"readDirSync\", { enumerable: true, get: function () { return readDirSync_js_1.readDirSync; } });\r\nvar readFile_js_1 = require(\"./functions/readFile.js\");\r\nObject.defineProperty(exports, \"readFile\", { enumerable: true, get: function () { return readFile_js_1.readFile; } });\r\nvar readFileSync_js_1 = require(\"./functions/readFileSync.js\");\r\nObject.defineProperty(exports, \"readFileSync\", { enumerable: true, get: function () { return readFileSync_js_1.readFileSync; } });\r\nvar readLink_js_1 = require(\"./functions/readLink.js\");\r\nObject.defineProperty(exports, \"readLink\", { enumerable: true, get: function () { return readLink_js_1.readLink; } });\r\nvar readLinkSync_js_1 = require(\"./functions/readLinkSync.js\");\r\nObject.defineProperty(exports, \"readLinkSync\", { enumerable: true, get: function () { return readLinkSync_js_1.readLinkSync; } });\r\nvar readSync_js_1 = require(\"./functions/readSync.js\");\r\nObject.defineProperty(exports, \"readSync\", { enumerable: true, get: function () { return readSync_js_1.readSync; } });\r\nvar readTextFile_js_1 = require(\"./functions/readTextFile.js\");\r\nObject.defineProperty(exports, \"readTextFile\", { enumerable: true, get: function () { return readTextFile_js_1.readTextFile; } });\r\nvar readTextFileSync_js_1 = require(\"./functions/readTextFileSync.js\");\r\nObject.defineProperty(exports, \"readTextFileSync\", { enumerable: true, get: function () { return readTextFileSync_js_1.readTextFileSync; } });\r\nvar realPath_js_1 = require(\"./functions/realPath.js\");\r\nObject.defineProperty(exports, \"realPath\", { enumerable: true, get: function () { return realPath_js_1.realPath; } });\r\nvar realPathSync_js_1 = require(\"./functions/realPathSync.js\");\r\nObject.defineProperty(exports, \"realPathSync\", { enumerable: true, get: function () { return realPathSync_js_1.realPathSync; } });\r\nvar remove_js_1 = require(\"./functions/remove.js\");\r\nObject.defineProperty(exports, \"remove\", { enumerable: true, get: function () { return remove_js_1.remove; } });\r\nvar removeSync_js_1 = require(\"./functions/removeSync.js\");\r\nObject.defineProperty(exports, \"removeSync\", { enumerable: true, get: function () { return removeSync_js_1.removeSync; } });\r\nvar rename_js_1 = require(\"./functions/rename.js\");\r\nObject.defineProperty(exports, \"rename\", { enumerable: true, get: function () { return rename_js_1.rename; } });\r\nvar renameSync_js_1 = require(\"./functions/renameSync.js\");\r\nObject.defineProperty(exports, \"renameSync\", { enumerable: true, get: function () { return renameSync_js_1.renameSync; } });\r\nvar resolveDns_js_1 = require(\"./functions/resolveDns.js\");\r\nObject.defineProperty(exports, \"resolveDns\", { enumerable: true, get: function () { return resolveDns_js_1.resolveDns; } });\r\nvar run_js_1 = require(\"./functions/run.js\");\r\nObject.defineProperty(exports, \"Process\", { enumerable: true, get: function () { return run_js_1.Process; } });\r\nObject.defineProperty(exports, \"run\", { enumerable: true, get: function () { return run_js_1.run; } });\r\nvar shutdown_js_1 = require(\"./functions/shutdown.js\");\r\nObject.defineProperty(exports, \"shutdown\", { enumerable: true, get: function () { return shutdown_js_1.shutdown; } });\r\nvar stat_js_1 = require(\"./functions/stat.js\");\r\nObject.defineProperty(exports, \"stat\", { enumerable: true, get: function () { return stat_js_1.stat; } });\r\nvar statSync_js_1 = require(\"./functions/statSync.js\");\r\nObject.defineProperty(exports, \"statSync\", { enumerable: true, get: function () { return statSync_js_1.statSync; } });\r\nvar symlink_js_1 = require(\"./functions/symlink.js\");\r\nObject.defineProperty(exports, \"symlink\", { enumerable: true, get: function () { return symlink_js_1.symlink; } });\r\nvar symlinkSync_js_1 = require(\"./functions/symlinkSync.js\");\r\nObject.defineProperty(exports, \"symlinkSync\", { enumerable: true, get: function () { return symlinkSync_js_1.symlinkSync; } });\r\nvar test_js_1 = require(\"./functions/test.js\");\r\nObject.defineProperty(exports, \"test\", { enumerable: true, get: function () { return test_js_1.test; } });\r\nvar truncate_js_1 = require(\"./functions/truncate.js\");\r\nObject.defineProperty(exports, \"truncate\", { enumerable: true, get: function () { return truncate_js_1.truncate; } });\r\nvar truncateSync_js_1 = require(\"./functions/truncateSync.js\");\r\nObject.defineProperty(exports, \"truncateSync\", { enumerable: true, get: function () { return truncateSync_js_1.truncateSync; } });\r\nvar watchFs_js_1 = require(\"./functions/watchFs.js\");\r\nObject.defineProperty(exports, \"watchFs\", { enumerable: true, get: function () { return watchFs_js_1.watchFs; } });\r\nvar write_js_1 = require(\"./functions/write.js\");\r\nObject.defineProperty(exports, \"write\", { enumerable: true, get: function () { return write_js_1.write; } });\r\nvar writeFile_js_1 = require(\"./functions/writeFile.js\");\r\nObject.defineProperty(exports, \"writeFile\", { enumerable: true, get: function () { return writeFile_js_1.writeFile; } });\r\nvar writeFileSync_js_1 = require(\"./functions/writeFileSync.js\");\r\nObject.defineProperty(exports, \"writeFileSync\", { enumerable: true, get: function () { return writeFileSync_js_1.writeFileSync; } });\r\nvar writeSync_js_1 = require(\"./functions/writeSync.js\");\r\nObject.defineProperty(exports, \"writeSync\", { enumerable: true, get: function () { return writeSync_js_1.writeSync; } });\r\nvar writeTextFile_js_1 = require(\"./functions/writeTextFile.js\");\r\nObject.defineProperty(exports, \"writeTextFile\", { enumerable: true, get: function () { return writeTextFile_js_1.writeTextFile; } });\r\nvar writeTextFileSync_js_1 = require(\"./functions/writeTextFileSync.js\");\r\nObject.defineProperty(exports, \"writeTextFileSync\", { enumerable: true, get: function () { return writeTextFileSync_js_1.writeTextFileSync; } });\r\nvar args_js_1 = require(\"./variables/args.js\");\r\nObject.defineProperty(exports, \"args\", { enumerable: true, get: function () { return args_js_1.args; } });\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.chdir = void 0;\r\nconst url_1 = require(\"url\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst variables_js_1 = require(\"../variables.js\");\r\nconst chdir = function (path) {\r\n try {\r\n return process.chdir(path instanceof URL ? (0, url_1.fileURLToPath)(path) : path);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"ENOENT\") {\r\n throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), chdir '${path}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.chdir = chdir;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.chmod = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nexports.chmod = fs.chmod;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.chmodSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nexports.chmodSync = fs.chmodSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.chown = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nconst chown = async (path, uid, gid) => await fs.chown(path, uid !== null && uid !== void 0 ? uid : -1, gid !== null && gid !== void 0 ? gid : -1);\r\nexports.chown = chown;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.chownSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst chownSync = (path, uid, gid) => fs.chownSync(path, uid !== null && uid !== void 0 ? uid : -1, gid !== null && gid !== void 0 ? gid : -1);\r\nexports.chownSync = chownSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.close = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nexports.close = fs.closeSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.connect = void 0;\r\nconst net_1 = require(\"net\");\r\nconst Conn_js_1 = require(\"../../internal/Conn.js\");\r\nconst connect = function connect(options) {\r\n if (options.transport === \"unix\") {\r\n throw new Error(\"Unstable UnixConnectOptions is not implemented\");\r\n }\r\n const { transport = \"tcp\", hostname = \"127.0.0.1\", port } = options;\r\n if (transport !== \"tcp\") {\r\n throw new Error(\"Deno.connect is only implemented for transport: tcp\");\r\n }\r\n const socket = (0, net_1.createConnection)({ port, host: hostname });\r\n socket.on(\"error\", (err) => console.error(err));\r\n return new Promise((resolve) => {\r\n socket.once(\"connect\", () => {\r\n // @ts-expect-error undocumented socket._handle property\r\n const rid = socket._handle.fd;\r\n const localAddr = {\r\n // cannot be undefined while socket is connected\r\n hostname: socket.localAddress,\r\n port: socket.localPort,\r\n transport: \"tcp\",\r\n };\r\n const remoteAddr = {\r\n // cannot be undefined while socket is connected\r\n hostname: socket.remoteAddress,\r\n port: socket.remotePort,\r\n transport: \"tcp\",\r\n };\r\n resolve(new Conn_js_1.Conn(rid, localAddr, remoteAddr, socket));\r\n });\r\n });\r\n};\r\nexports.connect = connect;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.connectTls = void 0;\r\nconst tls_1 = require(\"tls\");\r\nconst Conn_js_1 = require(\"../../internal/Conn.js\");\r\nconst readTextFile_js_1 = require(\"./readTextFile.js\");\r\nconst connectTls = async function connectTls({ port, hostname = \"127.0.0.1\", certFile }) {\r\n const cert = certFile && await (0, readTextFile_js_1.readTextFile)(certFile);\r\n const socket = (0, tls_1.connect)({ port, host: hostname, cert });\r\n return new Promise((resolve) => {\r\n socket.on(\"connect\", () => {\r\n // @ts-expect-error undocumented socket._handle property\r\n const rid = socket._handle.fd;\r\n const localAddr = {\r\n // cannot be undefined while socket is connected\r\n hostname: socket.localAddress,\r\n port: socket.localPort,\r\n transport: \"tcp\",\r\n };\r\n const remoteAddr = {\r\n // cannot be undefined while socket is connected\r\n hostname: socket.remoteAddress,\r\n port: socket.remotePort,\r\n transport: \"tcp\",\r\n };\r\n resolve(new Conn_js_1.TlsConn(rid, localAddr, remoteAddr, socket));\r\n });\r\n });\r\n};\r\nexports.connectTls = connectTls;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.copy = void 0;\r\nconst consts_js_1 = require(\"../../internal/consts.js\");\r\nconst copy = async function copy(src, dst, options) {\r\n var _a;\r\n let n = 0;\r\n const bufSize = (_a = options === null || options === void 0 ? void 0 : options.bufSize) !== null && _a !== void 0 ? _a : consts_js_1.DEFAULT_BUFFER_SIZE;\r\n const b = new Uint8Array(bufSize);\r\n let gotEOF = false;\r\n while (gotEOF === false) {\r\n const result = await src.read(b);\r\n if (result === null) {\r\n gotEOF = true;\r\n }\r\n else {\r\n let nwritten = 0;\r\n while (nwritten < result) {\r\n nwritten += await dst.write(b.subarray(nwritten, result));\r\n }\r\n n += nwritten;\r\n }\r\n }\r\n return n;\r\n};\r\nexports.copy = copy;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.copyFile = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst errors = __importStar(require(\"../variables/errors.js\"));\r\nconst copyFile = async (src, dest) => {\r\n try {\r\n await fs.copyFile(src, dest);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"ENOENT\") {\r\n throw new errors.NotFound(`File not found, copy '${src}' -> '${dest}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.copyFile = copyFile;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.copyFileSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst errors = __importStar(require(\"../variables/errors.js\"));\r\nconst copyFileSync = (src, dest) => {\r\n try {\r\n fs.copyFileSync(src, dest);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"ENOENT\") {\r\n throw new errors.NotFound(`File not found, copy '${src}' -> '${dest}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.copyFileSync = copyFileSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.create = void 0;\r\nconst open_js_1 = require(\"./open.js\");\r\nconst create = async function create(path) {\r\n return await (0, open_js_1.open)(path, { write: true, create: true, truncate: true });\r\n};\r\nexports.create = create;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.createSync = void 0;\r\nconst openSync_js_1 = require(\"./openSync.js\");\r\nconst createSync = function createSync(path) {\r\n return (0, openSync_js_1.openSync)(path, {\r\n create: true,\r\n truncate: true,\r\n read: true,\r\n write: true,\r\n });\r\n};\r\nexports.createSync = createSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.cwd = void 0;\r\nexports.cwd = process.cwd;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.execPath = void 0;\r\nconst which_1 = __importDefault(require(\"which\"));\r\nconst execPath = () => which_1.default.sync(\"deno\");\r\nexports.execPath = execPath;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.exit = void 0;\r\nconst exit = function exit(code) {\r\n return process.exit(code);\r\n};\r\nexports.exit = exit;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.fdatasync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst util_1 = require(\"util\");\r\nconst _fdatasync = (0, util_1.promisify)(fs_1.fdatasync);\r\nexports.fdatasync = _fdatasync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.fdatasyncSync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nexports.fdatasyncSync = fs_1.fdatasyncSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.fstat = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst util_1 = require(\"util\");\r\nconst stat_js_1 = require(\"./stat.js\");\r\nconst nodeFstat = (0, util_1.promisify)(fs.fstat);\r\nconst fstat = async function (fd) {\r\n return (0, stat_js_1.denoifyFileInfo)(await nodeFstat(fd));\r\n};\r\nexports.fstat = fstat;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.fstatSync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst stat_js_1 = require(\"./stat.js\");\r\nconst fstatSync = function fstatSync(fd) {\r\n return (0, stat_js_1.denoifyFileInfo)((0, fs_1.fstatSync)(fd));\r\n};\r\nexports.fstatSync = fstatSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.fsync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst util_1 = require(\"util\");\r\nconst fsync = function fsync(rid) {\r\n return (0, util_1.promisify)(fs_1.fsync)(rid);\r\n};\r\nexports.fsync = fsync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.fsyncSync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst fsyncSync = function fsyncSync(rid) {\r\n return (0, fs_1.fsyncSync)(rid);\r\n};\r\nexports.fsyncSync = fsyncSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ftruncate = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst util_1 = require(\"util\");\r\nconst _ftruncate = (0, util_1.promisify)(fs_1.ftruncate);\r\nexports.ftruncate = _ftruncate;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ftruncateSync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nexports.ftruncateSync = fs_1.ftruncateSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.inspect = void 0;\r\nconst util = __importStar(require(\"util\"));\r\nconst inspect = (value, options = {}) => util.inspect(value, options);\r\nexports.inspect = inspect;\r\n","\"use strict\";\r\n/// \r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.kill = void 0;\r\nconst os_1 = __importDefault(require(\"os\"));\r\nconst process_1 = __importDefault(require(\"process\"));\r\nconst kill = function (pid, signo) {\r\n if (pid < 0 && os_1.default.platform() === \"win32\") {\r\n throw new TypeError(\"Invalid pid\");\r\n }\r\n process_1.default.kill(pid, signo);\r\n};\r\nexports.kill = kill;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.link = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nexports.link = fs.link;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.linkSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nexports.linkSync = fs.linkSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.listen = void 0;\r\nconst net_1 = require(\"net\");\r\nconst Conn_js_1 = require(\"../../internal/Conn.js\");\r\nconst Listener_js_1 = require(\"../../internal/Listener.js\");\r\nasync function* _listen(server, waitFor) {\r\n await waitFor;\r\n while (server.listening) {\r\n yield new Promise((resolve) => server.once(\"connection\", (socket) => {\r\n socket.on(\"error\", (err) => console.error(err));\r\n // @ts-expect-error undocumented socket._handle property\r\n const rid = socket._handle.fd;\r\n const localAddr = {\r\n // cannot be undefined while socket is connected\r\n hostname: socket.localAddress,\r\n port: socket.localPort,\r\n transport: \"tcp\",\r\n };\r\n const remoteAddr = {\r\n // cannot be undefined while socket is connected\r\n hostname: socket.remoteAddress,\r\n port: socket.remotePort,\r\n transport: \"tcp\",\r\n };\r\n resolve(new Conn_js_1.Conn(rid, localAddr, remoteAddr));\r\n }));\r\n }\r\n}\r\nconst listen = function listen(options) {\r\n if (options.transport === \"unix\") {\r\n throw new Error(\"Unstable UnixListenOptions is not implemented\");\r\n }\r\n const { port, hostname = \"0.0.0.0\", transport = \"tcp\" } = options;\r\n if (transport !== \"tcp\") {\r\n throw new Error(\"Deno.listen is only implemented for transport: tcp\");\r\n }\r\n const server = (0, net_1.createServer)();\r\n const waitFor = new Promise((resolve) => \r\n // server._handle.fd is assigned immediately on .listen()\r\n server.listen(port, hostname, resolve));\r\n // @ts-expect-error undocumented socket._handle property\r\n const listener = new Listener_js_1.Listener(server._handle.fd, {\r\n hostname,\r\n port,\r\n transport: \"tcp\",\r\n }, _listen(server, waitFor));\r\n return listener;\r\n};\r\nexports.listen = listen;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.listenTls = void 0;\r\nconst tls_1 = require(\"tls\");\r\nconst Conn_js_1 = require(\"../../internal/Conn.js\");\r\nconst Listener_js_1 = require(\"../../internal/Listener.js\");\r\nconst readTextFileSync_js_1 = require(\"./readTextFileSync.js\");\r\nasync function* _listen(server, waitFor) {\r\n await waitFor;\r\n while (server.listening) {\r\n yield new Promise((resolve) => server.once(\"secureConnection\", (socket) => {\r\n socket.on(\"error\", (err) => console.error(err));\r\n // @ts-expect-error undocumented socket._handle property\r\n const rid = socket._handle.fd;\r\n const localAddr = {\r\n // cannot be undefined while socket is connected\r\n hostname: socket.localAddress,\r\n port: socket.localPort,\r\n transport: \"tcp\",\r\n };\r\n const remoteAddr = {\r\n // cannot be undefined while socket is connected\r\n hostname: socket.remoteAddress,\r\n port: socket.remotePort,\r\n transport: \"tcp\",\r\n };\r\n resolve(new Conn_js_1.TlsConn(rid, localAddr, remoteAddr));\r\n }));\r\n }\r\n}\r\nconst listenTls = function listen({ port, hostname = \"0.0.0.0\", transport = \"tcp\", certFile, keyFile }) {\r\n if (transport !== \"tcp\") {\r\n throw new Error(\"Deno.listen is only implemented for transport: tcp\");\r\n }\r\n const [cert, key] = [certFile, keyFile].map((f) => f == null ? undefined : (0, readTextFileSync_js_1.readTextFileSync)(f));\r\n const server = (0, tls_1.createServer)({ cert, key });\r\n const waitFor = new Promise((resolve) => \r\n // server._handle.fd is assigned immediately on .listen()\r\n server.listen(port, hostname, resolve));\r\n // @ts-expect-error undocumented socket._handle property\r\n const listener = new Listener_js_1.Listener(server._handle.fd, {\r\n hostname,\r\n port,\r\n transport: \"tcp\",\r\n }, _listen(server, waitFor));\r\n return listener;\r\n};\r\nexports.listenTls = listenTls;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.lstat = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nconst stat_js_1 = require(\"./stat.js\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst lstat = async (path) => {\r\n try {\r\n return (0, stat_js_1.denoifyFileInfo)(await fs.lstat(path));\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.lstat = lstat;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.lstatSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst stat_js_1 = require(\"./stat.js\");\r\nconst lstatSync = (path) => (0, stat_js_1.denoifyFileInfo)(fs.lstatSync(path));\r\nexports.lstatSync = lstatSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.makeTempDir = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst path_1 = require(\"path\");\r\nconst os_1 = require(\"os\");\r\nconst makeTempDir = function makeTempDir({ prefix = \"\" } = {}) {\r\n return (0, promises_1.mkdtemp)((0, path_1.join)((0, os_1.tmpdir)(), prefix || \"/\"));\r\n};\r\nexports.makeTempDir = makeTempDir;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.makeTempDirSync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst path_1 = require(\"path\");\r\nconst os_1 = require(\"os\");\r\nconst makeTempDirSync = function makeTempDirSync({ prefix = \"\" } = {}) {\r\n return (0, fs_1.mkdtempSync)((0, path_1.join)((0, os_1.tmpdir)(), prefix || \"/\"));\r\n};\r\nexports.makeTempDirSync = makeTempDirSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.makeTempFile = void 0;\r\nconst os_1 = require(\"os\");\r\nconst path_1 = require(\"path\");\r\nconst random_id_js_1 = require(\"../../internal/random_id.js\");\r\nconst writeTextFile_js_1 = require(\"./writeTextFile.js\");\r\nconst makeTempFile = async function makeTempFile({ prefix = \"\" } = {}) {\r\n const name = (0, path_1.join)((0, os_1.tmpdir)(), prefix, (0, random_id_js_1.randomId)());\r\n await (0, writeTextFile_js_1.writeTextFile)(name, \"\");\r\n return name;\r\n};\r\nexports.makeTempFile = makeTempFile;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.makeTempFileSync = void 0;\r\nconst os_1 = require(\"os\");\r\nconst path_1 = require(\"path\");\r\nconst random_id_js_1 = require(\"../../internal/random_id.js\");\r\nconst writeTextFileSync_js_1 = require(\"./writeTextFileSync.js\");\r\nconst makeTempFileSync = function makeTempFileSync({ prefix = \"\" } = {}) {\r\n const name = (0, path_1.join)((0, os_1.tmpdir)(), prefix, (0, random_id_js_1.randomId)());\r\n (0, writeTextFileSync_js_1.writeTextFileSync)(name, \"\");\r\n return name;\r\n};\r\nexports.makeTempFileSync = makeTempFileSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.memoryUsage = void 0;\r\nexports.memoryUsage = process.memoryUsage;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.mkdir = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst variables_js_1 = require(\"../variables.js\");\r\nconst mkdir = async function mkdir(path, options) {\r\n try {\r\n await (0, promises_1.mkdir)(path, options);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"EEXIST\") {\r\n throw new variables_js_1.errors.AlreadyExists(`File exists (os error 17), mkdir '${path}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.mkdir = mkdir;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.mkdirSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst variables_js_1 = require(\"../variables.js\");\r\nconst mkdirSync = (path, options) => {\r\n try {\r\n fs.mkdirSync(path, options);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"EEXIST\") {\r\n throw new variables_js_1.errors.AlreadyExists(`File exists (os error 17), mkdir '${path}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.mkdirSync = mkdirSync;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.open = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst util_1 = require(\"util\");\r\nconst FsFile_js_1 = require(\"../classes/FsFile.js\");\r\nconst fs_flags_js_1 = require(\"../../internal/fs_flags.js\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst nodeOpen = (0, util_1.promisify)(fs_1.open);\r\nconst open = async function open(path, { read, write, append, truncate, create, createNew, mode = 0o666 } = {\r\n read: true,\r\n}) {\r\n const flagMode = (0, fs_flags_js_1.getFsFlag)({\r\n read,\r\n write,\r\n append,\r\n truncate,\r\n create,\r\n createNew,\r\n });\r\n try {\r\n const fd = await nodeOpen(path, flagMode, mode);\r\n return new FsFile_js_1.File(fd);\r\n }\r\n catch (err) {\r\n throw (0, errorMap_js_1.default)(err);\r\n }\r\n};\r\nexports.open = open;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.openSync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst FsFile_js_1 = require(\"../classes/FsFile.js\");\r\nconst fs_flags_js_1 = require(\"../../internal/fs_flags.js\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst openSync = function openSync(path, { read, write, append, truncate, create, createNew, mode = 0o666 } = {\r\n read: true,\r\n}) {\r\n const flagMode = (0, fs_flags_js_1.getFsFlag)({\r\n read,\r\n write,\r\n append,\r\n truncate,\r\n create,\r\n createNew,\r\n });\r\n try {\r\n const fd = (0, fs_1.openSync)(path, flagMode, mode);\r\n return new FsFile_js_1.File(fd);\r\n }\r\n catch (err) {\r\n throw (0, errorMap_js_1.default)(err);\r\n }\r\n};\r\nexports.openSync = openSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.read = void 0;\r\nconst util_1 = require(\"util\");\r\nconst fs_1 = require(\"fs\");\r\nconst _read = (0, util_1.promisify)(fs_1.read);\r\nconst read = async function read(rid, buffer) {\r\n if (buffer == null) {\r\n throw new TypeError(\"Buffer must not be null.\");\r\n }\r\n if (buffer.length === 0) {\r\n return 0;\r\n }\r\n const { bytesRead } = await _read(rid, buffer, 0, buffer.length, null);\r\n // node returns 0 on EOF, Deno expects null\r\n return bytesRead === 0 ? null : bytesRead;\r\n};\r\nexports.read = read;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readDir = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst readDir = async function* readDir(path) {\r\n try {\r\n for await (const e of await (0, promises_1.opendir)(String(path))) {\r\n const ent = {\r\n name: e.name,\r\n isFile: e.isFile(),\r\n isDirectory: e.isDirectory(),\r\n isSymlink: e.isSymbolicLink(),\r\n };\r\n yield ent;\r\n }\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.readDir = readDir;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readDirSync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst readDirSync = function* readDir(path) {\r\n try {\r\n for (const e of (0, fs_1.readdirSync)(String(path), { withFileTypes: true })) {\r\n const ent = {\r\n name: e.name,\r\n isFile: e.isFile(),\r\n isDirectory: e.isDirectory(),\r\n isSymlink: e.isSymbolicLink(),\r\n };\r\n yield ent;\r\n }\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.readDirSync = readDirSync;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readFile = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst readFile = async function readFile(path, { signal } = {}) {\r\n try {\r\n const buf = await (0, promises_1.readFile)(path, { signal });\r\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.length);\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.readFile = readFile;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readFileSync = void 0;\r\nconst fs_1 = require(\"fs\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst readFileSync = function readFileSync(path) {\r\n try {\r\n const buf = (0, fs_1.readFileSync)(path);\r\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.length);\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.readFileSync = readFileSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readLink = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nexports.readLink = fs.readlink;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readLinkSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nexports.readLinkSync = fs.readlinkSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst readSync = (fd, buffer) => {\r\n const bytesRead = fs.readSync(fd, buffer);\r\n // node returns 0 on EOF, Deno expects null\r\n return bytesRead === 0 ? null : bytesRead;\r\n};\r\nexports.readSync = readSync;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readTextFile = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst readTextFile = async (path, { signal } = {}) => {\r\n try {\r\n return await (0, promises_1.readFile)(path, { encoding: \"utf8\", signal });\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.readTextFile = readTextFile;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.readTextFileSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst readTextFileSync = function (path) {\r\n try {\r\n return fs.readFileSync(path, \"utf8\");\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.readTextFileSync = readTextFileSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.realPath = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nexports.realPath = fs.realpath;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.realPathSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nexports.realPathSync = fs.realpathSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.remove = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst remove = async function remove(path, options = {}) {\r\n const innerOptions = options.recursive\r\n ? { recursive: true, force: true }\r\n : {};\r\n try {\r\n return await (0, promises_1.rm)(path, innerOptions);\r\n }\r\n catch (err) {\r\n if (err.code === \"ERR_FS_EISDIR\") {\r\n return await (0, promises_1.rmdir)(path, innerOptions);\r\n }\r\n else {\r\n throw err;\r\n }\r\n }\r\n};\r\nexports.remove = remove;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.removeSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst removeSync = (path, options = {}) => {\r\n const innerOptions = options.recursive\r\n ? { recursive: true, force: true }\r\n : {};\r\n try {\r\n fs.rmSync(path, innerOptions);\r\n }\r\n catch (err) {\r\n if (err.code === \"ERR_FS_EISDIR\") {\r\n fs.rmdirSync(path, innerOptions);\r\n }\r\n else {\r\n throw err;\r\n }\r\n }\r\n};\r\nexports.removeSync = removeSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.rename = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst rename = function rename(oldpath, newpath) {\r\n return (0, promises_1.rename)(oldpath, newpath);\r\n};\r\nexports.rename = rename;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.renameSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nexports.renameSync = fs.renameSync;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.resolveDns = void 0;\r\nconst dns_1 = __importDefault(require(\"dns\"));\r\nconst resolveDns = function resolveDns(query, recordType, options) {\r\n if (options) {\r\n throw Error(`resolveDns option not implemnted yet`);\r\n }\r\n switch (recordType) {\r\n case \"A\":\r\n /* falls through */\r\n case \"AAAA\":\r\n case \"CNAME\":\r\n case \"NS\":\r\n case \"PTR\":\r\n return new Promise((resolve, reject) => {\r\n dns_1.default.resolve(query, recordType, (err, addresses) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n else {\r\n resolve(addresses);\r\n }\r\n });\r\n });\r\n case \"ANAME\":\r\n case \"CAA\":\r\n case \"MX\":\r\n case \"NAPTR\":\r\n case \"SOA\":\r\n case \"SRV\":\r\n case \"TXT\":\r\n default:\r\n throw Error(`resolveDns type ${recordType} not implemnted yet`);\r\n }\r\n};\r\nexports.resolveDns = resolveDns;\r\n","\"use strict\";\r\n/// \r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n};\r\nvar __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nvar _Process_process, _Process_stderr, _Process_stdout, _Process_stdin, _Process_status, _Process_receivedStatus, _ProcessReadStream_stream, _ProcessReadStream_bufferStreamReader, _ProcessReadStream_closed, _ProcessWriteStream_stream, _ProcessWriteStream_streamWriter, _ProcessWriteStream_closed;\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Process = exports.run = void 0;\r\nconst child_process_1 = __importDefault(require(\"child_process\"));\r\nconst fs_1 = __importDefault(require(\"fs\"));\r\nconst os_1 = __importDefault(require(\"os\"));\r\nconst url_1 = __importDefault(require(\"url\"));\r\nconst events_1 = require(\"events\");\r\nconst which_1 = __importDefault(require(\"which\"));\r\nconst streams_js_1 = require(\"../../internal/streams.js\");\r\nconst errors = __importStar(require(\"../variables/errors.js\"));\r\nconst run = function run(options) {\r\n const [cmd, ...args] = options.cmd;\r\n if (options.cwd && !fs_1.default.existsSync(options.cwd)) {\r\n throw new Error(\"The directory name is invalid.\");\r\n }\r\n // childProcess.spawn will asynchronously check if the command exists, but\r\n // we need to do this synchronously\r\n const commandName = getCmd(cmd);\r\n if (!which_1.default.sync(commandName, { nothrow: true })) {\r\n throw new errors.NotFound(\"The system cannot find the file specified.\");\r\n }\r\n const process = child_process_1.default.spawn(commandName, args, {\r\n cwd: options.cwd,\r\n env: getEnv(options),\r\n uid: options.uid,\r\n gid: options.gid,\r\n shell: false,\r\n stdio: [\r\n getStdio(options.stdin, \"in\"),\r\n getStdio(options.stdout, \"out\"),\r\n getStdio(options.stderr, \"out\"),\r\n ],\r\n });\r\n return new Process(process);\r\n};\r\nexports.run = run;\r\nfunction getStdio(value, kind) {\r\n if (value === \"inherit\" || value == null) {\r\n return \"inherit\"; // default\r\n }\r\n else if (value === \"piped\") {\r\n return \"pipe\";\r\n }\r\n else if (value === \"null\") {\r\n return \"ignore\";\r\n }\r\n else if (typeof value === \"number\") {\r\n switch (kind) {\r\n case \"in\":\r\n return fs_1.default.createReadStream(null, { fd: value });\r\n case \"out\":\r\n return fs_1.default.createWriteStream(null, { fd: value });\r\n default: {\r\n const _assertNever = kind;\r\n throw new Error(\"Unreachable.\");\r\n }\r\n }\r\n }\r\n else {\r\n const _assertNever = value;\r\n throw new Error(\"Unknown value.\");\r\n }\r\n}\r\nfunction getCmd(firstArg) {\r\n if (firstArg instanceof URL) {\r\n return url_1.default.fileURLToPath(firstArg);\r\n }\r\n else {\r\n return firstArg;\r\n }\r\n}\r\nfunction getEnv(options) {\r\n var _a;\r\n const env = (_a = options.env) !== null && _a !== void 0 ? _a : {};\r\n for (const name in process.env) {\r\n if (!Object.prototype.hasOwnProperty.call(env, name)) {\r\n if (options.clearEnv) {\r\n if (os_1.default.platform() === \"win32\") {\r\n env[name] = \"\";\r\n }\r\n else {\r\n delete env[name];\r\n }\r\n }\r\n else {\r\n env[name] = process.env[name];\r\n }\r\n }\r\n }\r\n return env;\r\n}\r\nclass Process {\r\n /** @internal */\r\n constructor(process) {\r\n var _a, _b, _c;\r\n _Process_process.set(this, void 0);\r\n _Process_stderr.set(this, void 0);\r\n _Process_stdout.set(this, void 0);\r\n _Process_stdin.set(this, void 0);\r\n _Process_status.set(this, void 0);\r\n _Process_receivedStatus.set(this, false);\r\n __classPrivateFieldSet(this, _Process_process, process, \"f\");\r\n __classPrivateFieldSet(this, _Process_stdout, (_a = ProcessReadStream.fromNullable(__classPrivateFieldGet(this, _Process_process, \"f\").stdout)) !== null && _a !== void 0 ? _a : null, \"f\");\r\n __classPrivateFieldSet(this, _Process_stderr, (_b = ProcessReadStream.fromNullable(__classPrivateFieldGet(this, _Process_process, \"f\").stderr)) !== null && _b !== void 0 ? _b : null, \"f\");\r\n __classPrivateFieldSet(this, _Process_stdin, (_c = ProcessWriteStream.fromNullable(__classPrivateFieldGet(this, _Process_process, \"f\").stdin)) !== null && _c !== void 0 ? _c : null, \"f\");\r\n __classPrivateFieldSet(this, _Process_status, (0, events_1.once)(process, \"exit\"), \"f\");\r\n }\r\n get rid() {\r\n // todo: useful to return something?\r\n return NaN;\r\n }\r\n get pid() {\r\n // only undefined when the process doesn't spawn, in which case this\r\n // will never be reached\r\n return __classPrivateFieldGet(this, _Process_process, \"f\").pid;\r\n }\r\n get stdin() {\r\n return __classPrivateFieldGet(this, _Process_stdin, \"f\");\r\n }\r\n get stdout() {\r\n return __classPrivateFieldGet(this, _Process_stdout, \"f\");\r\n }\r\n get stderr() {\r\n return __classPrivateFieldGet(this, _Process_stderr, \"f\");\r\n }\r\n async status() {\r\n const [receivedCode, signalName] = await __classPrivateFieldGet(this, _Process_status, \"f\");\r\n // when there is a signal, the exit code is 128 + signal code\r\n const signal = signalName\r\n ? os_1.default.constants.signals[signalName]\r\n : receivedCode > 128\r\n ? receivedCode - 128\r\n : undefined;\r\n const code = receivedCode != null\r\n ? receivedCode\r\n : signal != null\r\n ? 128 + signal\r\n : undefined;\r\n const success = code === 0;\r\n __classPrivateFieldSet(this, _Process_receivedStatus, true, \"f\");\r\n return { code, signal, success };\r\n }\r\n async output() {\r\n if (!__classPrivateFieldGet(this, _Process_stdout, \"f\")) {\r\n throw new TypeError(\"stdout was not piped\");\r\n }\r\n const result = await __classPrivateFieldGet(this, _Process_stdout, \"f\").readAll();\r\n __classPrivateFieldGet(this, _Process_stdout, \"f\").close();\r\n return result;\r\n }\r\n async stderrOutput() {\r\n if (!__classPrivateFieldGet(this, _Process_stderr, \"f\")) {\r\n throw new TypeError(\"stderr was not piped\");\r\n }\r\n const result = await __classPrivateFieldGet(this, _Process_stderr, \"f\").readAll();\r\n __classPrivateFieldGet(this, _Process_stderr, \"f\").close();\r\n return result;\r\n }\r\n close() {\r\n // Deno doesn't close any stdio streams here\r\n __classPrivateFieldGet(this, _Process_process, \"f\").unref();\r\n __classPrivateFieldGet(this, _Process_process, \"f\").kill();\r\n }\r\n kill(signo = \"SIGTERM\") {\r\n if (__classPrivateFieldGet(this, _Process_receivedStatus, \"f\")) {\r\n throw new errors.NotFound(\"entity not found\");\r\n }\r\n __classPrivateFieldGet(this, _Process_process, \"f\").kill(signo);\r\n }\r\n}\r\nexports.Process = Process;\r\n_Process_process = new WeakMap(), _Process_stderr = new WeakMap(), _Process_stdout = new WeakMap(), _Process_stdin = new WeakMap(), _Process_status = new WeakMap(), _Process_receivedStatus = new WeakMap();\r\nclass ProcessReadStream {\r\n constructor(stream) {\r\n _ProcessReadStream_stream.set(this, void 0);\r\n _ProcessReadStream_bufferStreamReader.set(this, void 0);\r\n _ProcessReadStream_closed.set(this, false);\r\n __classPrivateFieldSet(this, _ProcessReadStream_stream, stream, \"f\");\r\n __classPrivateFieldSet(this, _ProcessReadStream_bufferStreamReader, new streams_js_1.BufferStreamReader(stream), \"f\");\r\n }\r\n static fromNullable(stream) {\r\n return stream ? new ProcessReadStream(stream) : undefined;\r\n }\r\n readAll() {\r\n if (__classPrivateFieldGet(this, _ProcessReadStream_closed, \"f\")) {\r\n return Promise.resolve(new Uint8Array(0));\r\n }\r\n else {\r\n return __classPrivateFieldGet(this, _ProcessReadStream_bufferStreamReader, \"f\").readAll();\r\n }\r\n }\r\n read(p) {\r\n if (__classPrivateFieldGet(this, _ProcessReadStream_closed, \"f\")) {\r\n return Promise.resolve(null);\r\n }\r\n else {\r\n return __classPrivateFieldGet(this, _ProcessReadStream_bufferStreamReader, \"f\").read(p);\r\n }\r\n }\r\n close() {\r\n __classPrivateFieldSet(this, _ProcessReadStream_closed, true, \"f\");\r\n __classPrivateFieldGet(this, _ProcessReadStream_stream, \"f\").destroy();\r\n }\r\n get readable() {\r\n throw new Error(\"Not implemented.\");\r\n }\r\n get writable() {\r\n throw new Error(\"Not implemented.\");\r\n }\r\n}\r\n_ProcessReadStream_stream = new WeakMap(), _ProcessReadStream_bufferStreamReader = new WeakMap(), _ProcessReadStream_closed = new WeakMap();\r\nclass ProcessWriteStream {\r\n constructor(stream) {\r\n _ProcessWriteStream_stream.set(this, void 0);\r\n _ProcessWriteStream_streamWriter.set(this, void 0);\r\n _ProcessWriteStream_closed.set(this, false);\r\n __classPrivateFieldSet(this, _ProcessWriteStream_stream, stream, \"f\");\r\n __classPrivateFieldSet(this, _ProcessWriteStream_streamWriter, new streams_js_1.StreamWriter(stream), \"f\");\r\n }\r\n static fromNullable(stream) {\r\n return stream ? new ProcessWriteStream(stream) : undefined;\r\n }\r\n write(p) {\r\n if (__classPrivateFieldGet(this, _ProcessWriteStream_closed, \"f\")) {\r\n return Promise.resolve(0);\r\n }\r\n else {\r\n return __classPrivateFieldGet(this, _ProcessWriteStream_streamWriter, \"f\").write(p);\r\n }\r\n }\r\n close() {\r\n __classPrivateFieldSet(this, _ProcessWriteStream_closed, true, \"f\");\r\n __classPrivateFieldGet(this, _ProcessWriteStream_stream, \"f\").end();\r\n }\r\n}\r\n_ProcessWriteStream_stream = new WeakMap(), _ProcessWriteStream_streamWriter = new WeakMap(), _ProcessWriteStream_closed = new WeakMap();\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.shutdown = void 0;\r\nconst net_1 = require(\"net\");\r\nconst shutdown = async function shutdown(rid) {\r\n await new Promise((resolve) => new net_1.Socket({ fd: rid }).end(resolve));\r\n};\r\nexports.shutdown = shutdown;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.stat = exports.denoifyFileInfo = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nfunction denoifyFileInfo(s) {\r\n return {\r\n atime: s.atime,\r\n birthtime: s.birthtime,\r\n blksize: s.blksize,\r\n blocks: s.blocks,\r\n dev: s.dev,\r\n gid: s.gid,\r\n ino: s.ino,\r\n isDirectory: s.isDirectory(),\r\n isFile: s.isFile(),\r\n isSymlink: s.isSymbolicLink(),\r\n mode: s.mode,\r\n mtime: s.mtime,\r\n nlink: s.nlink,\r\n rdev: s.rdev,\r\n size: s.size,\r\n uid: s.uid,\r\n };\r\n}\r\nexports.denoifyFileInfo = denoifyFileInfo;\r\nconst stat = async (path) => {\r\n try {\r\n return denoifyFileInfo(await (0, promises_1.stat)(path));\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.stat = stat;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.statSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst stat_js_1 = require(\"./stat.js\");\r\nconst statSync = (path) => (0, stat_js_1.denoifyFileInfo)(fs.statSync(path));\r\nexports.statSync = statSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.symlink = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nconst symlink = async (oldpath, newpath, options) => await fs.symlink(oldpath, newpath, options === null || options === void 0 ? void 0 : options.type);\r\nexports.symlink = symlink;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.symlinkSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst symlinkSync = (oldpath, newpath, options) => fs.symlinkSync(oldpath, newpath, options === null || options === void 0 ? void 0 : options.type);\r\nexports.symlinkSync = symlinkSync;\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.test = void 0;\r\nvar shim_deno_test_1 = require(\"@deno/shim-deno-test\");\r\nObject.defineProperty(exports, \"test\", { enumerable: true, get: function () { return shim_deno_test_1.test; } });\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.truncate = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst variables_js_1 = require(\"../variables.js\");\r\nconst truncate = async (name, len) => {\r\n try {\r\n return await fs.truncate(name, len);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"ENOENT\") {\r\n throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), truncate '${name}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.truncate = truncate;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.truncateSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst variables_js_1 = require(\"../variables.js\");\r\nconst truncateSync = (name, len) => {\r\n try {\r\n return fs.truncateSync(name, len);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"ENOENT\") {\r\n throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), truncate '${name}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.truncateSync = truncateSync;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.watchFs = void 0;\r\nconst promises_1 = require(\"fs/promises\");\r\nconst path_1 = require(\"path\");\r\nconst iterutil_js_1 = require(\"../../internal/iterutil.js\");\r\nconst watchFs = function watchFs(paths, options = { recursive: true }) {\r\n paths = Array.isArray(paths) ? paths : [paths];\r\n const ac = new AbortController();\r\n const { signal } = ac;\r\n // TODO(mkr): create valid rids for watchers\r\n const rid = -1;\r\n const masterWatcher = (0, iterutil_js_1.merge)(paths.map((path) => (0, iterutil_js_1.mapAsync)((0, promises_1.watch)(path, { recursive: options === null || options === void 0 ? void 0 : options.recursive, signal }), (info) => ({\r\n kind: \"modify\",\r\n paths: [(0, path_1.resolve)(path, info.filename)],\r\n }))));\r\n function close() {\r\n ac.abort();\r\n }\r\n return Object.assign(masterWatcher, { rid, close });\r\n};\r\nexports.watchFs = watchFs;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.write = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst util_1 = require(\"util\");\r\nconst nodeWrite = (0, util_1.promisify)(fs.write);\r\nconst write = async (fd, data) => {\r\n const { bytesWritten } = await nodeWrite(fd, data);\r\n return bytesWritten;\r\n};\r\nexports.write = write;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.writeFile = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst fs_flags_js_1 = require(\"../../internal/fs_flags.js\");\r\nconst writeFile = async function writeFile(path, data, { append = false, create = true, createNew = false, mode, signal } = {}) {\r\n const truncate = create && !append;\r\n const flag = (0, fs_flags_js_1.getFsFlag)({ append, create, createNew, truncate, write: true });\r\n try {\r\n await fs.writeFile(path, data, { flag, signal });\r\n if (mode != null)\r\n await fs.chmod(path, mode);\r\n }\r\n catch (error) {\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.writeFile = writeFile;\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.writeFileSync = void 0;\r\nconst os_1 = require(\"os\");\r\nconst openSync_js_1 = require(\"./openSync.js\");\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst statSync_js_1 = require(\"./statSync.js\");\r\nconst chmodSync_js_1 = require(\"./chmodSync.js\");\r\nconst writeFileSync = function writeFileSync(path, data, options = {}) {\r\n try {\r\n if (options.create !== undefined) {\r\n const create = !!options.create;\r\n if (!create) {\r\n // verify that file exists\r\n (0, statSync_js_1.statSync)(path);\r\n }\r\n }\r\n const openOptions = {\r\n write: true,\r\n create: true,\r\n createNew: options.createNew,\r\n append: !!options.append,\r\n truncate: !options.append,\r\n };\r\n const file = (0, openSync_js_1.openSync)(path, openOptions);\r\n if (options.mode !== undefined &&\r\n options.mode !== null &&\r\n (0, os_1.platform)() !== \"win32\") {\r\n (0, chmodSync_js_1.chmodSync)(path, options.mode);\r\n }\r\n let nwritten = 0;\r\n while (nwritten < data.length) {\r\n nwritten += file.writeSync(data.subarray(nwritten));\r\n }\r\n file.close();\r\n }\r\n catch (e) {\r\n throw (0, errorMap_js_1.default)(e);\r\n }\r\n};\r\nexports.writeFileSync = writeFileSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.writeSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nexports.writeSync = fs.writeSync;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.writeTextFile = void 0;\r\nconst fs = __importStar(require(\"fs/promises\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst fs_flags_js_1 = require(\"../../internal/fs_flags.js\");\r\nconst writeTextFile = async function writeTextFile(path, data, { append = false, create = true, mode, signal } = {}) {\r\n const truncate = create && !append;\r\n const flag = (0, fs_flags_js_1.getFsFlag)({ append, create, truncate, write: true });\r\n try {\r\n await fs.writeFile(path, data, { flag, mode, signal });\r\n if (mode !== undefined)\r\n await fs.chmod(path, mode);\r\n }\r\n catch (error) {\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.writeTextFile = writeTextFile;\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.writeTextFileSync = void 0;\r\nconst fs = __importStar(require(\"fs\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../../internal/errorMap.js\"));\r\nconst writeTextFileSync = (path, data, { append = false, create = true, mode } = {}) => {\r\n const flag = create ? (append ? \"a\" : \"w\") : \"r+\";\r\n try {\r\n fs.writeFileSync(path, data, { flag, mode });\r\n if (mode !== undefined)\r\n fs.chmodSync(path, mode);\r\n }\r\n catch (error) {\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.writeTextFileSync = writeTextFileSync;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n__exportStar(require(\"./classes.js\"), exports);\r\n__exportStar(require(\"./enums.js\"), exports);\r\n__exportStar(require(\"./functions.js\"), exports);\r\n__exportStar(require(\"./types.js\"), exports);\r\n__exportStar(require(\"./variables.js\"), exports);\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n///\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.version = exports.resources = exports.ppid = exports.pid = exports.permissions = exports.noColor = exports.metrics = exports.mainModule = exports.errors = exports.env = exports.customInspect = exports.build = void 0;\r\nvar build_js_1 = require(\"./variables/build.js\");\r\nObject.defineProperty(exports, \"build\", { enumerable: true, get: function () { return build_js_1.build; } });\r\nvar customInspect_js_1 = require(\"./variables/customInspect.js\");\r\nObject.defineProperty(exports, \"customInspect\", { enumerable: true, get: function () { return customInspect_js_1.customInspect; } });\r\nvar env_js_1 = require(\"./variables/env.js\");\r\nObject.defineProperty(exports, \"env\", { enumerable: true, get: function () { return env_js_1.env; } });\r\nexports.errors = __importStar(require(\"./variables/errors.js\"));\r\nvar mainModule_js_1 = require(\"./variables/mainModule.js\");\r\nObject.defineProperty(exports, \"mainModule\", { enumerable: true, get: function () { return mainModule_js_1.mainModule; } });\r\nvar metrics_js_1 = require(\"./variables/metrics.js\");\r\nObject.defineProperty(exports, \"metrics\", { enumerable: true, get: function () { return metrics_js_1.metrics; } });\r\nvar noColor_js_1 = require(\"./variables/noColor.js\");\r\nObject.defineProperty(exports, \"noColor\", { enumerable: true, get: function () { return noColor_js_1.noColor; } });\r\nvar permissions_js_1 = require(\"./variables/permissions.js\");\r\nObject.defineProperty(exports, \"permissions\", { enumerable: true, get: function () { return permissions_js_1.permissions; } });\r\nvar pid_js_1 = require(\"./variables/pid.js\");\r\nObject.defineProperty(exports, \"pid\", { enumerable: true, get: function () { return pid_js_1.pid; } });\r\nvar ppid_js_1 = require(\"./variables/ppid.js\");\r\nObject.defineProperty(exports, \"ppid\", { enumerable: true, get: function () { return ppid_js_1.ppid; } });\r\nvar resources_js_1 = require(\"./variables/resources.js\");\r\nObject.defineProperty(exports, \"resources\", { enumerable: true, get: function () { return resources_js_1.resources; } });\r\n__exportStar(require(\"./variables/std.js\"), exports);\r\nvar version_js_1 = require(\"./variables/version.js\");\r\nObject.defineProperty(exports, \"version\", { enumerable: true, get: function () { return version_js_1.version; } });\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.args = void 0;\r\nexports.args = process.argv.slice(2);\r\n","\"use strict\";\r\n///\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.build = void 0;\r\nconst os = __importStar(require(\"os\"));\r\nexports.build = {\r\n arch: \"x86_64\",\r\n os: ((p) => p === \"win32\" ? \"windows\" : p === \"darwin\" ? \"darwin\" : \"linux\")(os.platform()),\r\n vendor: \"pc\",\r\n target: ((p) => p === \"win32\"\r\n ? \"x86_64-pc-windows-msvc\"\r\n : p === \"darwin\"\r\n ? \"x86_64-apple-darwin\"\r\n : \"x86_64-unknown-linux-gnu\")(os.platform()),\r\n};\r\n","\"use strict\";\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.customInspect = void 0;\r\nexports.customInspect = Symbol.for(\"nodejs.util.inspect.custom\");\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.env = void 0;\r\nexports.env = {\r\n get(key) {\r\n return process.env[key];\r\n },\r\n set(key, value) {\r\n process.env[key] = value;\r\n },\r\n delete(key) {\r\n delete process.env[key];\r\n },\r\n // @ts-expect-error https://github.com/denoland/deno/issues/10267\r\n toObject() {\r\n return { ...process.env };\r\n },\r\n};\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.WriteZero = exports.UnexpectedEof = exports.TimedOut = exports.PermissionDenied = exports.NotFound = exports.NotConnected = exports.InvalidData = exports.Interrupted = exports.Http = exports.ConnectionReset = exports.ConnectionRefused = exports.ConnectionAborted = exports.Busy = exports.BrokenPipe = exports.BadResource = exports.AlreadyExists = exports.AddrNotAvailable = exports.AddrInUse = void 0;\r\n// please keep sorted\r\nclass AddrInUse extends Error {\r\n}\r\nexports.AddrInUse = AddrInUse;\r\nclass AddrNotAvailable extends Error {\r\n}\r\nexports.AddrNotAvailable = AddrNotAvailable;\r\nclass AlreadyExists extends Error {\r\n}\r\nexports.AlreadyExists = AlreadyExists;\r\nclass BadResource extends Error {\r\n}\r\nexports.BadResource = BadResource;\r\nclass BrokenPipe extends Error {\r\n}\r\nexports.BrokenPipe = BrokenPipe;\r\nclass Busy extends Error {\r\n}\r\nexports.Busy = Busy;\r\nclass ConnectionAborted extends Error {\r\n}\r\nexports.ConnectionAborted = ConnectionAborted;\r\nclass ConnectionRefused extends Error {\r\n}\r\nexports.ConnectionRefused = ConnectionRefused;\r\nclass ConnectionReset extends Error {\r\n}\r\nexports.ConnectionReset = ConnectionReset;\r\nclass Http extends Error {\r\n}\r\nexports.Http = Http;\r\nclass Interrupted extends Error {\r\n}\r\nexports.Interrupted = Interrupted;\r\nclass InvalidData extends Error {\r\n}\r\nexports.InvalidData = InvalidData;\r\nclass NotConnected extends Error {\r\n}\r\nexports.NotConnected = NotConnected;\r\nclass NotFound extends Error {\r\n}\r\nexports.NotFound = NotFound;\r\nclass PermissionDenied extends Error {\r\n}\r\nexports.PermissionDenied = PermissionDenied;\r\nclass TimedOut extends Error {\r\n}\r\nexports.TimedOut = TimedOut;\r\nclass UnexpectedEof extends Error {\r\n}\r\nexports.UnexpectedEof = UnexpectedEof;\r\nclass WriteZero extends Error {\r\n}\r\nexports.WriteZero = WriteZero;\r\n",null,"\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.metrics = void 0;\r\nconst metrics = function metrics() {\r\n return {\r\n opsDispatched: 0,\r\n opsDispatchedSync: 0,\r\n opsDispatchedAsync: 0,\r\n opsDispatchedAsyncUnref: 0,\r\n opsCompleted: 0,\r\n opsCompletedSync: 0,\r\n opsCompletedAsync: 0,\r\n opsCompletedAsyncUnref: 0,\r\n bytesSentControl: 0,\r\n bytesSentData: 0,\r\n bytesReceived: 0,\r\n ops: {},\r\n };\r\n};\r\nexports.metrics = metrics;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.noColor = void 0;\r\nexports.noColor = process.env.NO_COLOR !== undefined;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.permissions = void 0;\r\nconst Permissions_js_1 = require(\"../classes/Permissions.js\");\r\nexports.permissions = new Permissions_js_1.Permissions();\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.pid = void 0;\r\nexports.pid = process.pid;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.ppid = void 0;\r\nexports.ppid = process.ppid;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.resources = void 0;\r\nconst resources = function resources() {\r\n console.warn([\r\n \"Deno.resources() shim returns a dummy object that does not update.\",\r\n \"If you think this is a mistake, raise an issue at https://github.com/denoland/node_deno_shims/issues\",\r\n ].join(\"\\n\"));\r\n return {};\r\n};\r\nexports.resources = resources;\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.stderr = exports.stdout = exports.stdin = void 0;\r\nfunction chain(fn, cleanup) {\r\n let prev;\r\n return function _fn(...args) {\r\n const curr = (prev || Promise.resolve())\r\n .then(() => fn(...args))\r\n .finally(cleanup || (() => { }))\r\n .then((result) => {\r\n if (prev === curr)\r\n prev = undefined;\r\n return result;\r\n });\r\n return (prev = curr);\r\n };\r\n}\r\nexports.stdin = {\r\n rid: 0,\r\n read: chain((p) => {\r\n return new Promise((resolve, reject) => {\r\n process.stdin.resume();\r\n process.stdin.on(\"error\", onerror);\r\n process.stdin.once(\"readable\", () => {\r\n var _a;\r\n process.stdin.off(\"error\", onerror);\r\n const data = (_a = process.stdin.read(p.length)) !== null && _a !== void 0 ? _a : process.stdin.read();\r\n if (data) {\r\n p.set(data);\r\n resolve(data.length > 0 ? data.length : null);\r\n }\r\n else {\r\n resolve(null);\r\n }\r\n });\r\n function onerror(error) {\r\n reject(error);\r\n process.stdin.off(\"error\", onerror);\r\n }\r\n });\r\n }, () => process.stdin.pause()),\r\n get readable() {\r\n throw new Error(\"Not implemented.\");\r\n },\r\n readSync() {\r\n // Node.js doesn't support readSync for stdin\r\n throw new Error(\"Not implemented.\");\r\n },\r\n close() {\r\n process.stdin.destroy();\r\n },\r\n setRaw(mode, options) {\r\n if (options === null || options === void 0 ? void 0 : options.cbreak) {\r\n throw new Error(\"The cbreak option is not implemented.\");\r\n }\r\n process.stdin.setRawMode(mode);\r\n },\r\n};\r\nexports.stdout = {\r\n rid: 1,\r\n write: chain((p) => {\r\n return new Promise((resolve) => {\r\n const result = process.stdout.write(p);\r\n if (!result) {\r\n process.stdout.once(\"drain\", () => resolve(p.length));\r\n }\r\n else {\r\n resolve(p.length);\r\n }\r\n });\r\n }),\r\n get writable() {\r\n throw new Error(\"Not implemented.\");\r\n },\r\n writeSync() {\r\n // Node.js doesn't support writeSync for stdout\r\n throw new Error(\"Not implemented\");\r\n },\r\n close() {\r\n process.stdout.destroy();\r\n },\r\n};\r\nexports.stderr = {\r\n rid: 2,\r\n write: chain((p) => {\r\n return new Promise((resolve) => {\r\n const result = process.stderr.write(p);\r\n if (!result) {\r\n process.stderr.once(\"drain\", () => resolve(p.length));\r\n }\r\n else {\r\n resolve(p.length);\r\n }\r\n });\r\n }),\r\n get writable() {\r\n throw new Error(\"Not implemented.\");\r\n },\r\n writeSync() {\r\n // Node.js doesn't support writeSync for stderr\r\n throw new Error(\"Not implemented\");\r\n },\r\n close() {\r\n process.stderr.destroy();\r\n },\r\n};\r\n","\"use strict\";\r\n///\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.version = void 0;\r\nconst version_js_1 = require(\"../../internal/version.js\");\r\nexports.version = {\r\n deno: version_js_1.deno,\r\n typescript: version_js_1.typescript,\r\n v8: process.versions.v8,\r\n};\r\n","\"use strict\";\r\n///\r\nvar __importDefault = (this && this.__importDefault) || function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.utimeSync = exports.utime = exports.futimeSync = exports.futime = void 0;\r\nconst fs_1 = __importDefault(require(\"fs\"));\r\nconst errorMap_js_1 = __importDefault(require(\"../internal/errorMap.js\"));\r\nconst variables_js_1 = require(\"../stable/variables.js\");\r\nconst futime = async function (rid, atime, mtime) {\r\n try {\r\n await new Promise((resolve, reject) => {\r\n // doesn't exist in fs.promises\r\n fs_1.default.futimes(rid, atime, mtime, (err) => {\r\n if (err) {\r\n reject(err);\r\n }\r\n else {\r\n resolve();\r\n }\r\n });\r\n });\r\n }\r\n catch (error) {\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.futime = futime;\r\nconst futimeSync = function (rid, atime, mtime) {\r\n try {\r\n fs_1.default.futimesSync(rid, atime, mtime);\r\n }\r\n catch (error) {\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.futimeSync = futimeSync;\r\nconst utime = async function (path, atime, mtime) {\r\n try {\r\n await fs_1.default.promises.utimes(path, atime, mtime);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"ENOENT\") {\r\n throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), utime '${path}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.utime = utime;\r\nconst utimeSync = function (path, atime, mtime) {\r\n try {\r\n fs_1.default.utimesSync(path, atime, mtime);\r\n }\r\n catch (error) {\r\n if ((error === null || error === void 0 ? void 0 : error.code) === \"ENOENT\") {\r\n throw new variables_js_1.errors.NotFound(`No such file or directory (os error 2), utime '${path}'`);\r\n }\r\n throw (0, errorMap_js_1.default)(error);\r\n }\r\n};\r\nexports.utimeSync = utimeSync;\r\n","\"use strict\";\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n});\r\nvar __importStar = (this && this.__importStar) || function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\nexports.Deno = void 0;\r\nexports.Deno = __importStar(require(\"./deno.js\"));\r\n","'use strict'\n\nconst WritableStream = require('node:stream').Writable\nconst inherits = require('node:util').inherits\n\nconst StreamSearch = require('../../streamsearch/sbmh')\n\nconst PartStream = require('./PartStream')\nconst HeaderParser = require('./HeaderParser')\n\nconst DASH = 45\nconst B_ONEDASH = Buffer.from('-')\nconst B_CRLF = Buffer.from('\\r\\n')\nconst EMPTY_FN = function () {}\n\nfunction Dicer (cfg) {\n if (!(this instanceof Dicer)) { return new Dicer(cfg) }\n WritableStream.call(this, cfg)\n\n if (!cfg || (!cfg.headerFirst && typeof cfg.boundary !== 'string')) { throw new TypeError('Boundary required') }\n\n if (typeof cfg.boundary === 'string') { this.setBoundary(cfg.boundary) } else { this._bparser = undefined }\n\n this._headerFirst = cfg.headerFirst\n\n this._dashes = 0\n this._parts = 0\n this._finished = false\n this._realFinish = false\n this._isPreamble = true\n this._justMatched = false\n this._firstWrite = true\n this._inHeader = true\n this._part = undefined\n this._cb = undefined\n this._ignoreData = false\n this._partOpts = { highWaterMark: cfg.partHwm }\n this._pause = false\n\n const self = this\n this._hparser = new HeaderParser(cfg)\n this._hparser.on('header', function (header) {\n self._inHeader = false\n self._part.emit('header', header)\n })\n}\ninherits(Dicer, WritableStream)\n\nDicer.prototype.emit = function (ev) {\n if (ev === 'finish' && !this._realFinish) {\n if (!this._finished) {\n const self = this\n process.nextTick(function () {\n self.emit('error', new Error('Unexpected end of multipart data'))\n if (self._part && !self._ignoreData) {\n const type = (self._isPreamble ? 'Preamble' : 'Part')\n self._part.emit('error', new Error(type + ' terminated early due to unexpected end of multipart data'))\n self._part.push(null)\n process.nextTick(function () {\n self._realFinish = true\n self.emit('finish')\n self._realFinish = false\n })\n return\n }\n self._realFinish = true\n self.emit('finish')\n self._realFinish = false\n })\n }\n } else { WritableStream.prototype.emit.apply(this, arguments) }\n}\n\nDicer.prototype._write = function (data, encoding, cb) {\n // ignore unexpected data (e.g. extra trailer data after finished)\n if (!this._hparser && !this._bparser) { return cb() }\n\n if (this._headerFirst && this._isPreamble) {\n if (!this._part) {\n this._part = new PartStream(this._partOpts)\n if (this._events.preamble) { this.emit('preamble', this._part) } else { this._ignore() }\n }\n const r = this._hparser.push(data)\n if (!this._inHeader && r !== undefined && r < data.length) { data = data.slice(r) } else { return cb() }\n }\n\n // allows for \"easier\" testing\n if (this._firstWrite) {\n this._bparser.push(B_CRLF)\n this._firstWrite = false\n }\n\n this._bparser.push(data)\n\n if (this._pause) { this._cb = cb } else { cb() }\n}\n\nDicer.prototype.reset = function () {\n this._part = undefined\n this._bparser = undefined\n this._hparser = undefined\n}\n\nDicer.prototype.setBoundary = function (boundary) {\n const self = this\n this._bparser = new StreamSearch('\\r\\n--' + boundary)\n this._bparser.on('info', function (isMatch, data, start, end) {\n self._oninfo(isMatch, data, start, end)\n })\n}\n\nDicer.prototype._ignore = function () {\n if (this._part && !this._ignoreData) {\n this._ignoreData = true\n this._part.on('error', EMPTY_FN)\n // we must perform some kind of read on the stream even though we are\n // ignoring the data, otherwise node's Readable stream will not emit 'end'\n // after pushing null to the stream\n this._part.resume()\n }\n}\n\nDicer.prototype._oninfo = function (isMatch, data, start, end) {\n let buf; const self = this; let i = 0; let r; let shouldWriteMore = true\n\n if (!this._part && this._justMatched && data) {\n while (this._dashes < 2 && (start + i) < end) {\n if (data[start + i] === DASH) {\n ++i\n ++this._dashes\n } else {\n if (this._dashes) { buf = B_ONEDASH }\n this._dashes = 0\n break\n }\n }\n if (this._dashes === 2) {\n if ((start + i) < end && this._events.trailer) { this.emit('trailer', data.slice(start + i, end)) }\n this.reset()\n this._finished = true\n // no more parts will be added\n if (self._parts === 0) {\n self._realFinish = true\n self.emit('finish')\n self._realFinish = false\n }\n }\n if (this._dashes) { return }\n }\n if (this._justMatched) { this._justMatched = false }\n if (!this._part) {\n this._part = new PartStream(this._partOpts)\n this._part._read = function (n) {\n self._unpause()\n }\n if (this._isPreamble && this._events.preamble) { this.emit('preamble', this._part) } else if (this._isPreamble !== true && this._events.part) { this.emit('part', this._part) } else { this._ignore() }\n if (!this._isPreamble) { this._inHeader = true }\n }\n if (data && start < end && !this._ignoreData) {\n if (this._isPreamble || !this._inHeader) {\n if (buf) { shouldWriteMore = this._part.push(buf) }\n shouldWriteMore = this._part.push(data.slice(start, end))\n if (!shouldWriteMore) { this._pause = true }\n } else if (!this._isPreamble && this._inHeader) {\n if (buf) { this._hparser.push(buf) }\n r = this._hparser.push(data.slice(start, end))\n if (!this._inHeader && r !== undefined && r < end) { this._oninfo(false, data, start + r, end) }\n }\n }\n if (isMatch) {\n this._hparser.reset()\n if (this._isPreamble) { this._isPreamble = false } else {\n if (start !== end) {\n ++this._parts\n this._part.on('end', function () {\n if (--self._parts === 0) {\n if (self._finished) {\n self._realFinish = true\n self.emit('finish')\n self._realFinish = false\n } else {\n self._unpause()\n }\n }\n })\n }\n }\n this._part.push(null)\n this._part = undefined\n this._ignoreData = false\n this._justMatched = true\n this._dashes = 0\n }\n}\n\nDicer.prototype._unpause = function () {\n if (!this._pause) { return }\n\n this._pause = false\n if (this._cb) {\n const cb = this._cb\n this._cb = undefined\n cb()\n }\n}\n\nmodule.exports = Dicer\n","'use strict'\n\nconst EventEmitter = require('node:events').EventEmitter\nconst inherits = require('node:util').inherits\nconst getLimit = require('../../../lib/utils/getLimit')\n\nconst StreamSearch = require('../../streamsearch/sbmh')\n\nconst B_DCRLF = Buffer.from('\\r\\n\\r\\n')\nconst RE_CRLF = /\\r\\n/g\nconst RE_HDR = /^([^:]+):[ \\t]?([\\x00-\\xFF]+)?$/ // eslint-disable-line no-control-regex\n\nfunction HeaderParser (cfg) {\n EventEmitter.call(this)\n\n cfg = cfg || {}\n const self = this\n this.nread = 0\n this.maxed = false\n this.npairs = 0\n this.maxHeaderPairs = getLimit(cfg, 'maxHeaderPairs', 2000)\n this.maxHeaderSize = getLimit(cfg, 'maxHeaderSize', 80 * 1024)\n this.buffer = ''\n this.header = {}\n this.finished = false\n this.ss = new StreamSearch(B_DCRLF)\n this.ss.on('info', function (isMatch, data, start, end) {\n if (data && !self.maxed) {\n if (self.nread + end - start >= self.maxHeaderSize) {\n end = self.maxHeaderSize - self.nread + start\n self.nread = self.maxHeaderSize\n self.maxed = true\n } else { self.nread += (end - start) }\n\n self.buffer += data.toString('binary', start, end)\n }\n if (isMatch) { self._finish() }\n })\n}\ninherits(HeaderParser, EventEmitter)\n\nHeaderParser.prototype.push = function (data) {\n const r = this.ss.push(data)\n if (this.finished) { return r }\n}\n\nHeaderParser.prototype.reset = function () {\n this.finished = false\n this.buffer = ''\n this.header = {}\n this.ss.reset()\n}\n\nHeaderParser.prototype._finish = function () {\n if (this.buffer) { this._parseHeader() }\n this.ss.matches = this.ss.maxMatches\n const header = this.header\n this.header = {}\n this.buffer = ''\n this.finished = true\n this.nread = this.npairs = 0\n this.maxed = false\n this.emit('header', header)\n}\n\nHeaderParser.prototype._parseHeader = function () {\n if (this.npairs === this.maxHeaderPairs) { return }\n\n const lines = this.buffer.split(RE_CRLF)\n const len = lines.length\n let m, h\n\n for (var i = 0; i < len; ++i) { // eslint-disable-line no-var\n if (lines[i].length === 0) { continue }\n if (lines[i][0] === '\\t' || lines[i][0] === ' ') {\n // folded header content\n // RFC2822 says to just remove the CRLF and not the whitespace following\n // it, so we follow the RFC and include the leading whitespace ...\n if (h) {\n this.header[h][this.header[h].length - 1] += lines[i]\n continue\n }\n }\n\n const posColon = lines[i].indexOf(':')\n if (\n posColon === -1 ||\n posColon === 0\n ) {\n return\n }\n m = RE_HDR.exec(lines[i])\n h = m[1].toLowerCase()\n this.header[h] = this.header[h] || []\n this.header[h].push((m[2] || ''))\n if (++this.npairs === this.maxHeaderPairs) { break }\n }\n}\n\nmodule.exports = HeaderParser\n","'use strict'\n\nconst inherits = require('node:util').inherits\nconst ReadableStream = require('node:stream').Readable\n\nfunction PartStream (opts) {\n ReadableStream.call(this, opts)\n}\ninherits(PartStream, ReadableStream)\n\nPartStream.prototype._read = function (n) {}\n\nmodule.exports = PartStream\n","'use strict'\n\n/**\n * Copyright Brian White. All rights reserved.\n *\n * @see https://github.com/mscdex/streamsearch\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n *\n * Based heavily on the Streaming Boyer-Moore-Horspool C++ implementation\n * by Hongli Lai at: https://github.com/FooBarWidget/boyer-moore-horspool\n */\nconst EventEmitter = require('node:events').EventEmitter\nconst inherits = require('node:util').inherits\n\nfunction SBMH (needle) {\n if (typeof needle === 'string') {\n needle = Buffer.from(needle)\n }\n\n if (!Buffer.isBuffer(needle)) {\n throw new TypeError('The needle has to be a String or a Buffer.')\n }\n\n const needleLength = needle.length\n\n if (needleLength === 0) {\n throw new Error('The needle cannot be an empty String/Buffer.')\n }\n\n if (needleLength > 256) {\n throw new Error('The needle cannot have a length bigger than 256.')\n }\n\n this.maxMatches = Infinity\n this.matches = 0\n\n this._occ = new Array(256)\n .fill(needleLength) // Initialize occurrence table.\n this._lookbehind_size = 0\n this._needle = needle\n this._bufpos = 0\n\n this._lookbehind = Buffer.alloc(needleLength)\n\n // Populate occurrence table with analysis of the needle,\n // ignoring last letter.\n for (var i = 0; i < needleLength - 1; ++i) { // eslint-disable-line no-var\n this._occ[needle[i]] = needleLength - 1 - i\n }\n}\ninherits(SBMH, EventEmitter)\n\nSBMH.prototype.reset = function () {\n this._lookbehind_size = 0\n this.matches = 0\n this._bufpos = 0\n}\n\nSBMH.prototype.push = function (chunk, pos) {\n if (!Buffer.isBuffer(chunk)) {\n chunk = Buffer.from(chunk, 'binary')\n }\n const chlen = chunk.length\n this._bufpos = pos || 0\n let r\n while (r !== chlen && this.matches < this.maxMatches) { r = this._sbmh_feed(chunk) }\n return r\n}\n\nSBMH.prototype._sbmh_feed = function (data) {\n const len = data.length\n const needle = this._needle\n const needleLength = needle.length\n const lastNeedleChar = needle[needleLength - 1]\n\n // Positive: points to a position in `data`\n // pos == 3 points to data[3]\n // Negative: points to a position in the lookbehind buffer\n // pos == -2 points to lookbehind[lookbehind_size - 2]\n let pos = -this._lookbehind_size\n let ch\n\n if (pos < 0) {\n // Lookbehind buffer is not empty. Perform Boyer-Moore-Horspool\n // search with character lookup code that considers both the\n // lookbehind buffer and the current round's haystack data.\n //\n // Loop until\n // there is a match.\n // or until\n // we've moved past the position that requires the\n // lookbehind buffer. In this case we switch to the\n // optimized loop.\n // or until\n // the character to look at lies outside the haystack.\n while (pos < 0 && pos <= len - needleLength) {\n ch = this._sbmh_lookup_char(data, pos + needleLength - 1)\n\n if (\n ch === lastNeedleChar &&\n this._sbmh_memcmp(data, pos, needleLength - 1)\n ) {\n this._lookbehind_size = 0\n ++this.matches\n this.emit('info', true)\n\n return (this._bufpos = pos + needleLength)\n }\n pos += this._occ[ch]\n }\n\n // No match.\n\n if (pos < 0) {\n // There's too few data for Boyer-Moore-Horspool to run,\n // so let's use a different algorithm to skip as much as\n // we can.\n // Forward pos until\n // the trailing part of lookbehind + data\n // looks like the beginning of the needle\n // or until\n // pos == 0\n while (pos < 0 && !this._sbmh_memcmp(data, pos, len - pos)) { ++pos }\n }\n\n if (pos >= 0) {\n // Discard lookbehind buffer.\n this.emit('info', false, this._lookbehind, 0, this._lookbehind_size)\n this._lookbehind_size = 0\n } else {\n // Cut off part of the lookbehind buffer that has\n // been processed and append the entire haystack\n // into it.\n const bytesToCutOff = this._lookbehind_size + pos\n if (bytesToCutOff > 0) {\n // The cut off data is guaranteed not to contain the needle.\n this.emit('info', false, this._lookbehind, 0, bytesToCutOff)\n }\n\n this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,\n this._lookbehind_size - bytesToCutOff)\n this._lookbehind_size -= bytesToCutOff\n\n data.copy(this._lookbehind, this._lookbehind_size)\n this._lookbehind_size += len\n\n this._bufpos = len\n return len\n }\n }\n\n pos += (pos >= 0) * this._bufpos\n\n // Lookbehind buffer is now empty. We only need to check if the\n // needle is in the haystack.\n if (data.indexOf(needle, pos) !== -1) {\n pos = data.indexOf(needle, pos)\n ++this.matches\n if (pos > 0) { this.emit('info', true, data, this._bufpos, pos) } else { this.emit('info', true) }\n\n return (this._bufpos = pos + needleLength)\n } else {\n pos = len - needleLength\n }\n\n // There was no match. If there's trailing haystack data that we cannot\n // match yet using the Boyer-Moore-Horspool algorithm (because the trailing\n // data is less than the needle size) then match using a modified\n // algorithm that starts matching from the beginning instead of the end.\n // Whatever trailing data is left after running this algorithm is added to\n // the lookbehind buffer.\n while (\n pos < len &&\n (\n data[pos] !== needle[0] ||\n (\n (Buffer.compare(\n data.subarray(pos, pos + len - pos),\n needle.subarray(0, len - pos)\n ) !== 0)\n )\n )\n ) {\n ++pos\n }\n if (pos < len) {\n data.copy(this._lookbehind, 0, pos, pos + (len - pos))\n this._lookbehind_size = len - pos\n }\n\n // Everything until pos is guaranteed not to contain needle data.\n if (pos > 0) { this.emit('info', false, data, this._bufpos, pos < len ? pos : len) }\n\n this._bufpos = len\n return len\n}\n\nSBMH.prototype._sbmh_lookup_char = function (data, pos) {\n return (pos < 0)\n ? this._lookbehind[this._lookbehind_size + pos]\n : data[pos]\n}\n\nSBMH.prototype._sbmh_memcmp = function (data, pos, len) {\n for (var i = 0; i < len; ++i) { // eslint-disable-line no-var\n if (this._sbmh_lookup_char(data, pos + i) !== this._needle[i]) { return false }\n }\n return true\n}\n\nmodule.exports = SBMH\n","'use strict'\n\nconst WritableStream = require('node:stream').Writable\nconst { inherits } = require('node:util')\nconst Dicer = require('../deps/dicer/lib/Dicer')\n\nconst MultipartParser = require('./types/multipart')\nconst UrlencodedParser = require('./types/urlencoded')\nconst parseParams = require('./utils/parseParams')\n\nfunction Busboy (opts) {\n if (!(this instanceof Busboy)) { return new Busboy(opts) }\n\n if (typeof opts !== 'object') {\n throw new TypeError('Busboy expected an options-Object.')\n }\n if (typeof opts.headers !== 'object') {\n throw new TypeError('Busboy expected an options-Object with headers-attribute.')\n }\n if (typeof opts.headers['content-type'] !== 'string') {\n throw new TypeError('Missing Content-Type-header.')\n }\n\n const {\n headers,\n ...streamOptions\n } = opts\n\n this.opts = {\n autoDestroy: false,\n ...streamOptions\n }\n WritableStream.call(this, this.opts)\n\n this._done = false\n this._parser = this.getParserByHeaders(headers)\n this._finished = false\n}\ninherits(Busboy, WritableStream)\n\nBusboy.prototype.emit = function (ev) {\n if (ev === 'finish') {\n if (!this._done) {\n this._parser?.end()\n return\n } else if (this._finished) {\n return\n }\n this._finished = true\n }\n WritableStream.prototype.emit.apply(this, arguments)\n}\n\nBusboy.prototype.getParserByHeaders = function (headers) {\n const parsed = parseParams(headers['content-type'])\n\n const cfg = {\n defCharset: this.opts.defCharset,\n fileHwm: this.opts.fileHwm,\n headers,\n highWaterMark: this.opts.highWaterMark,\n isPartAFile: this.opts.isPartAFile,\n limits: this.opts.limits,\n parsedConType: parsed,\n preservePath: this.opts.preservePath\n }\n\n if (MultipartParser.detect.test(parsed[0])) {\n return new MultipartParser(this, cfg)\n }\n if (UrlencodedParser.detect.test(parsed[0])) {\n return new UrlencodedParser(this, cfg)\n }\n throw new Error('Unsupported Content-Type.')\n}\n\nBusboy.prototype._write = function (chunk, encoding, cb) {\n this._parser.write(chunk, cb)\n}\n\nmodule.exports = Busboy\nmodule.exports.default = Busboy\nmodule.exports.Busboy = Busboy\n\nmodule.exports.Dicer = Dicer\n","'use strict'\n\n// TODO:\n// * support 1 nested multipart level\n// (see second multipart example here:\n// http://www.w3.org/TR/html401/interact/forms.html#didx-multipartform-data)\n// * support limits.fieldNameSize\n// -- this will require modifications to utils.parseParams\n\nconst { Readable } = require('node:stream')\nconst { inherits } = require('node:util')\n\nconst Dicer = require('../../deps/dicer/lib/Dicer')\n\nconst parseParams = require('../utils/parseParams')\nconst decodeText = require('../utils/decodeText')\nconst basename = require('../utils/basename')\nconst getLimit = require('../utils/getLimit')\n\nconst RE_BOUNDARY = /^boundary$/i\nconst RE_FIELD = /^form-data$/i\nconst RE_CHARSET = /^charset$/i\nconst RE_FILENAME = /^filename$/i\nconst RE_NAME = /^name$/i\n\nMultipart.detect = /^multipart\\/form-data/i\nfunction Multipart (boy, cfg) {\n let i\n let len\n const self = this\n let boundary\n const limits = cfg.limits\n const isPartAFile = cfg.isPartAFile || ((fieldName, contentType, fileName) => (contentType === 'application/octet-stream' || fileName !== undefined))\n const parsedConType = cfg.parsedConType || []\n const defCharset = cfg.defCharset || 'utf8'\n const preservePath = cfg.preservePath\n const fileOpts = { highWaterMark: cfg.fileHwm }\n\n for (i = 0, len = parsedConType.length; i < len; ++i) {\n if (Array.isArray(parsedConType[i]) &&\n RE_BOUNDARY.test(parsedConType[i][0])) {\n boundary = parsedConType[i][1]\n break\n }\n }\n\n function checkFinished () {\n if (nends === 0 && finished && !boy._done) {\n finished = false\n self.end()\n }\n }\n\n if (typeof boundary !== 'string') { throw new Error('Multipart: Boundary not found') }\n\n const fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)\n const fileSizeLimit = getLimit(limits, 'fileSize', Infinity)\n const filesLimit = getLimit(limits, 'files', Infinity)\n const fieldsLimit = getLimit(limits, 'fields', Infinity)\n const partsLimit = getLimit(limits, 'parts', Infinity)\n const headerPairsLimit = getLimit(limits, 'headerPairs', 2000)\n const headerSizeLimit = getLimit(limits, 'headerSize', 80 * 1024)\n\n let nfiles = 0\n let nfields = 0\n let nends = 0\n let curFile\n let curField\n let finished = false\n\n this._needDrain = false\n this._pause = false\n this._cb = undefined\n this._nparts = 0\n this._boy = boy\n\n const parserCfg = {\n boundary,\n maxHeaderPairs: headerPairsLimit,\n maxHeaderSize: headerSizeLimit,\n partHwm: fileOpts.highWaterMark,\n highWaterMark: cfg.highWaterMark\n }\n\n this.parser = new Dicer(parserCfg)\n this.parser.on('drain', function () {\n self._needDrain = false\n if (self._cb && !self._pause) {\n const cb = self._cb\n self._cb = undefined\n cb()\n }\n }).on('part', function onPart (part) {\n if (++self._nparts > partsLimit) {\n self.parser.removeListener('part', onPart)\n self.parser.on('part', skipPart)\n boy.hitPartsLimit = true\n boy.emit('partsLimit')\n return skipPart(part)\n }\n\n // hack because streams2 _always_ doesn't emit 'end' until nextTick, so let\n // us emit 'end' early since we know the part has ended if we are already\n // seeing the next part\n if (curField) {\n const field = curField\n field.emit('end')\n field.removeAllListeners('end')\n }\n\n part.on('header', function (header) {\n let contype\n let fieldname\n let parsed\n let charset\n let encoding\n let filename\n let nsize = 0\n\n if (header['content-type']) {\n parsed = parseParams(header['content-type'][0])\n if (parsed[0]) {\n contype = parsed[0].toLowerCase()\n for (i = 0, len = parsed.length; i < len; ++i) {\n if (RE_CHARSET.test(parsed[i][0])) {\n charset = parsed[i][1].toLowerCase()\n break\n }\n }\n }\n }\n\n if (contype === undefined) { contype = 'text/plain' }\n if (charset === undefined) { charset = defCharset }\n\n if (header['content-disposition']) {\n parsed = parseParams(header['content-disposition'][0])\n if (!RE_FIELD.test(parsed[0])) { return skipPart(part) }\n for (i = 0, len = parsed.length; i < len; ++i) {\n if (RE_NAME.test(parsed[i][0])) {\n fieldname = parsed[i][1]\n } else if (RE_FILENAME.test(parsed[i][0])) {\n filename = parsed[i][1]\n if (!preservePath) { filename = basename(filename) }\n }\n }\n } else { return skipPart(part) }\n\n if (header['content-transfer-encoding']) { encoding = header['content-transfer-encoding'][0].toLowerCase() } else { encoding = '7bit' }\n\n let onData,\n onEnd\n\n if (isPartAFile(fieldname, contype, filename)) {\n // file/binary field\n if (nfiles === filesLimit) {\n if (!boy.hitFilesLimit) {\n boy.hitFilesLimit = true\n boy.emit('filesLimit')\n }\n return skipPart(part)\n }\n\n ++nfiles\n\n if (!boy._events.file) {\n self.parser._ignore()\n return\n }\n\n ++nends\n const file = new FileStream(fileOpts)\n curFile = file\n file.on('end', function () {\n --nends\n self._pause = false\n checkFinished()\n if (self._cb && !self._needDrain) {\n const cb = self._cb\n self._cb = undefined\n cb()\n }\n })\n file._read = function (n) {\n if (!self._pause) { return }\n self._pause = false\n if (self._cb && !self._needDrain) {\n const cb = self._cb\n self._cb = undefined\n cb()\n }\n }\n boy.emit('file', fieldname, file, filename, encoding, contype)\n\n onData = function (data) {\n if ((nsize += data.length) > fileSizeLimit) {\n const extralen = fileSizeLimit - nsize + data.length\n if (extralen > 0) { file.push(data.slice(0, extralen)) }\n file.truncated = true\n file.bytesRead = fileSizeLimit\n part.removeAllListeners('data')\n file.emit('limit')\n return\n } else if (!file.push(data)) { self._pause = true }\n\n file.bytesRead = nsize\n }\n\n onEnd = function () {\n curFile = undefined\n file.push(null)\n }\n } else {\n // non-file field\n if (nfields === fieldsLimit) {\n if (!boy.hitFieldsLimit) {\n boy.hitFieldsLimit = true\n boy.emit('fieldsLimit')\n }\n return skipPart(part)\n }\n\n ++nfields\n ++nends\n let buffer = ''\n let truncated = false\n curField = part\n\n onData = function (data) {\n if ((nsize += data.length) > fieldSizeLimit) {\n const extralen = (fieldSizeLimit - (nsize - data.length))\n buffer += data.toString('binary', 0, extralen)\n truncated = true\n part.removeAllListeners('data')\n } else { buffer += data.toString('binary') }\n }\n\n onEnd = function () {\n curField = undefined\n if (buffer.length) { buffer = decodeText(buffer, 'binary', charset) }\n boy.emit('field', fieldname, buffer, false, truncated, encoding, contype)\n --nends\n checkFinished()\n }\n }\n\n /* As of node@2efe4ab761666 (v0.10.29+/v0.11.14+), busboy had become\n broken. Streams2/streams3 is a huge black box of confusion, but\n somehow overriding the sync state seems to fix things again (and still\n seems to work for previous node versions).\n */\n part._readableState.sync = false\n\n part.on('data', onData)\n part.on('end', onEnd)\n }).on('error', function (err) {\n if (curFile) { curFile.emit('error', err) }\n })\n }).on('error', function (err) {\n boy.emit('error', err)\n }).on('finish', function () {\n finished = true\n checkFinished()\n })\n}\n\nMultipart.prototype.write = function (chunk, cb) {\n const r = this.parser.write(chunk)\n if (r && !this._pause) {\n cb()\n } else {\n this._needDrain = !r\n this._cb = cb\n }\n}\n\nMultipart.prototype.end = function () {\n const self = this\n\n if (self.parser.writable) {\n self.parser.end()\n } else if (!self._boy._done) {\n process.nextTick(function () {\n self._boy._done = true\n self._boy.emit('finish')\n })\n }\n}\n\nfunction skipPart (part) {\n part.resume()\n}\n\nfunction FileStream (opts) {\n Readable.call(this, opts)\n\n this.bytesRead = 0\n\n this.truncated = false\n}\n\ninherits(FileStream, Readable)\n\nFileStream.prototype._read = function (n) {}\n\nmodule.exports = Multipart\n","'use strict'\n\nconst Decoder = require('../utils/Decoder')\nconst decodeText = require('../utils/decodeText')\nconst getLimit = require('../utils/getLimit')\n\nconst RE_CHARSET = /^charset$/i\n\nUrlEncoded.detect = /^application\\/x-www-form-urlencoded/i\nfunction UrlEncoded (boy, cfg) {\n const limits = cfg.limits\n const parsedConType = cfg.parsedConType\n this.boy = boy\n\n this.fieldSizeLimit = getLimit(limits, 'fieldSize', 1 * 1024 * 1024)\n this.fieldNameSizeLimit = getLimit(limits, 'fieldNameSize', 100)\n this.fieldsLimit = getLimit(limits, 'fields', Infinity)\n\n let charset\n for (var i = 0, len = parsedConType.length; i < len; ++i) { // eslint-disable-line no-var\n if (Array.isArray(parsedConType[i]) &&\n RE_CHARSET.test(parsedConType[i][0])) {\n charset = parsedConType[i][1].toLowerCase()\n break\n }\n }\n\n if (charset === undefined) { charset = cfg.defCharset || 'utf8' }\n\n this.decoder = new Decoder()\n this.charset = charset\n this._fields = 0\n this._state = 'key'\n this._checkingBytes = true\n this._bytesKey = 0\n this._bytesVal = 0\n this._key = ''\n this._val = ''\n this._keyTrunc = false\n this._valTrunc = false\n this._hitLimit = false\n}\n\nUrlEncoded.prototype.write = function (data, cb) {\n if (this._fields === this.fieldsLimit) {\n if (!this.boy.hitFieldsLimit) {\n this.boy.hitFieldsLimit = true\n this.boy.emit('fieldsLimit')\n }\n return cb()\n }\n\n let idxeq; let idxamp; let i; let p = 0; const len = data.length\n\n while (p < len) {\n if (this._state === 'key') {\n idxeq = idxamp = undefined\n for (i = p; i < len; ++i) {\n if (!this._checkingBytes) { ++p }\n if (data[i] === 0x3D/* = */) {\n idxeq = i\n break\n } else if (data[i] === 0x26/* & */) {\n idxamp = i\n break\n }\n if (this._checkingBytes && this._bytesKey === this.fieldNameSizeLimit) {\n this._hitLimit = true\n break\n } else if (this._checkingBytes) { ++this._bytesKey }\n }\n\n if (idxeq !== undefined) {\n // key with assignment\n if (idxeq > p) { this._key += this.decoder.write(data.toString('binary', p, idxeq)) }\n this._state = 'val'\n\n this._hitLimit = false\n this._checkingBytes = true\n this._val = ''\n this._bytesVal = 0\n this._valTrunc = false\n this.decoder.reset()\n\n p = idxeq + 1\n } else if (idxamp !== undefined) {\n // key with no assignment\n ++this._fields\n let key; const keyTrunc = this._keyTrunc\n if (idxamp > p) { key = (this._key += this.decoder.write(data.toString('binary', p, idxamp))) } else { key = this._key }\n\n this._hitLimit = false\n this._checkingBytes = true\n this._key = ''\n this._bytesKey = 0\n this._keyTrunc = false\n this.decoder.reset()\n\n if (key.length) {\n this.boy.emit('field', decodeText(key, 'binary', this.charset),\n '',\n keyTrunc,\n false)\n }\n\n p = idxamp + 1\n if (this._fields === this.fieldsLimit) { return cb() }\n } else if (this._hitLimit) {\n // we may not have hit the actual limit if there are encoded bytes...\n if (i > p) { this._key += this.decoder.write(data.toString('binary', p, i)) }\n p = i\n if ((this._bytesKey = this._key.length) === this.fieldNameSizeLimit) {\n // yep, we actually did hit the limit\n this._checkingBytes = false\n this._keyTrunc = true\n }\n } else {\n if (p < len) { this._key += this.decoder.write(data.toString('binary', p)) }\n p = len\n }\n } else {\n idxamp = undefined\n for (i = p; i < len; ++i) {\n if (!this._checkingBytes) { ++p }\n if (data[i] === 0x26/* & */) {\n idxamp = i\n break\n }\n if (this._checkingBytes && this._bytesVal === this.fieldSizeLimit) {\n this._hitLimit = true\n break\n } else if (this._checkingBytes) { ++this._bytesVal }\n }\n\n if (idxamp !== undefined) {\n ++this._fields\n if (idxamp > p) { this._val += this.decoder.write(data.toString('binary', p, idxamp)) }\n this.boy.emit('field', decodeText(this._key, 'binary', this.charset),\n decodeText(this._val, 'binary', this.charset),\n this._keyTrunc,\n this._valTrunc)\n this._state = 'key'\n\n this._hitLimit = false\n this._checkingBytes = true\n this._key = ''\n this._bytesKey = 0\n this._keyTrunc = false\n this.decoder.reset()\n\n p = idxamp + 1\n if (this._fields === this.fieldsLimit) { return cb() }\n } else if (this._hitLimit) {\n // we may not have hit the actual limit if there are encoded bytes...\n if (i > p) { this._val += this.decoder.write(data.toString('binary', p, i)) }\n p = i\n if ((this._val === '' && this.fieldSizeLimit === 0) ||\n (this._bytesVal = this._val.length) === this.fieldSizeLimit) {\n // yep, we actually did hit the limit\n this._checkingBytes = false\n this._valTrunc = true\n }\n } else {\n if (p < len) { this._val += this.decoder.write(data.toString('binary', p)) }\n p = len\n }\n }\n }\n cb()\n}\n\nUrlEncoded.prototype.end = function () {\n if (this.boy._done) { return }\n\n if (this._state === 'key' && this._key.length > 0) {\n this.boy.emit('field', decodeText(this._key, 'binary', this.charset),\n '',\n this._keyTrunc,\n false)\n } else if (this._state === 'val') {\n this.boy.emit('field', decodeText(this._key, 'binary', this.charset),\n decodeText(this._val, 'binary', this.charset),\n this._keyTrunc,\n this._valTrunc)\n }\n this.boy._done = true\n this.boy.emit('finish')\n}\n\nmodule.exports = UrlEncoded\n","'use strict'\n\nconst RE_PLUS = /\\+/g\n\nconst HEX = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,\n 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0\n]\n\nfunction Decoder () {\n this.buffer = undefined\n}\nDecoder.prototype.write = function (str) {\n // Replace '+' with ' ' before decoding\n str = str.replace(RE_PLUS, ' ')\n let res = ''\n let i = 0; let p = 0; const len = str.length\n for (; i < len; ++i) {\n if (this.buffer !== undefined) {\n if (!HEX[str.charCodeAt(i)]) {\n res += '%' + this.buffer\n this.buffer = undefined\n --i // retry character\n } else {\n this.buffer += str[i]\n ++p\n if (this.buffer.length === 2) {\n res += String.fromCharCode(parseInt(this.buffer, 16))\n this.buffer = undefined\n }\n }\n } else if (str[i] === '%') {\n if (i > p) {\n res += str.substring(p, i)\n p = i\n }\n this.buffer = ''\n ++p\n }\n }\n if (p < len && this.buffer === undefined) { res += str.substring(p) }\n return res\n}\nDecoder.prototype.reset = function () {\n this.buffer = undefined\n}\n\nmodule.exports = Decoder\n","'use strict'\n\nmodule.exports = function basename (path) {\n if (typeof path !== 'string') { return '' }\n for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var\n switch (path.charCodeAt(i)) {\n case 0x2F: // '/'\n case 0x5C: // '\\'\n path = path.slice(i + 1)\n return (path === '..' || path === '.' ? '' : path)\n }\n }\n return (path === '..' || path === '.' ? '' : path)\n}\n","'use strict'\n\n// Node has always utf-8\nconst utf8Decoder = new TextDecoder('utf-8')\nconst textDecoders = new Map([\n ['utf-8', utf8Decoder],\n ['utf8', utf8Decoder]\n])\n\nfunction decodeText (text, textEncoding, destEncoding) {\n if (text) {\n if (textDecoders.has(destEncoding)) {\n try {\n return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding))\n } catch (e) { }\n } else {\n try {\n textDecoders.set(destEncoding, new TextDecoder(destEncoding))\n return textDecoders.get(destEncoding).decode(Buffer.from(text, textEncoding))\n } catch (e) { }\n }\n }\n return text\n}\n\nmodule.exports = decodeText\n","'use strict'\n\nmodule.exports = function getLimit (limits, name, defaultLimit) {\n if (\n !limits ||\n limits[name] === undefined ||\n limits[name] === null\n ) { return defaultLimit }\n\n if (\n typeof limits[name] !== 'number' ||\n isNaN(limits[name])\n ) { throw new TypeError('Limit ' + name + ' is not a valid number') }\n\n return limits[name]\n}\n","'use strict'\n\nconst decodeText = require('./decodeText')\n\nconst RE_ENCODED = /%([a-fA-F0-9]{2})/g\n\nfunction encodedReplacer (match, byte) {\n return String.fromCharCode(parseInt(byte, 16))\n}\n\nfunction parseParams (str) {\n const res = []\n let state = 'key'\n let charset = ''\n let inquote = false\n let escaping = false\n let p = 0\n let tmp = ''\n\n for (var i = 0, len = str.length; i < len; ++i) { // eslint-disable-line no-var\n const char = str[i]\n if (char === '\\\\' && inquote) {\n if (escaping) { escaping = false } else {\n escaping = true\n continue\n }\n } else if (char === '\"') {\n if (!escaping) {\n if (inquote) {\n inquote = false\n state = 'key'\n } else { inquote = true }\n continue\n } else { escaping = false }\n } else {\n if (escaping && inquote) { tmp += '\\\\' }\n escaping = false\n if ((state === 'charset' || state === 'lang') && char === \"'\") {\n if (state === 'charset') {\n state = 'lang'\n charset = tmp.substring(1)\n } else { state = 'value' }\n tmp = ''\n continue\n } else if (state === 'key' &&\n (char === '*' || char === '=') &&\n res.length) {\n if (char === '*') { state = 'charset' } else { state = 'value' }\n res[p] = [tmp, undefined]\n tmp = ''\n continue\n } else if (!inquote && char === ';') {\n state = 'key'\n if (charset) {\n if (tmp.length) {\n tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),\n 'binary',\n charset)\n }\n charset = ''\n } else if (tmp.length) {\n tmp = decodeText(tmp, 'binary', 'utf8')\n }\n if (res[p] === undefined) { res[p] = tmp } else { res[p][1] = tmp }\n tmp = ''\n ++p\n continue\n } else if (!inquote && (char === ' ' || char === '\\t')) { continue }\n }\n tmp += char\n }\n if (charset && tmp.length) {\n tmp = decodeText(tmp.replace(RE_ENCODED, encodedReplacer),\n 'binary',\n charset)\n } else if (tmp) {\n tmp = decodeText(tmp, 'binary', 'utf8')\n }\n\n if (res[p] === undefined) {\n if (tmp) { res[p] = tmp }\n } else { res[p][1] = tmp }\n\n return res\n}\n\nmodule.exports = parseParams\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./gen/api\"), exports);\n//# sourceMappingURL=api.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Attach = void 0;\nconst querystring = require(\"querystring\");\nconst terminal_size_queue_1 = require(\"./terminal-size-queue\");\nconst web_socket_handler_1 = require(\"./web-socket-handler\");\nclass Attach {\n constructor(config, websocketInterface) {\n this.handler = websocketInterface || new web_socket_handler_1.WebSocketHandler(config);\n }\n async attach(namespace, podName, containerName, stdout, stderr, stdin, tty) {\n const query = {\n container: containerName,\n stderr: stderr != null,\n stdin: stdin != null,\n stdout: stdout != null,\n tty,\n };\n const queryStr = querystring.stringify(query);\n const path = `/api/v1/namespaces/${namespace}/pods/${podName}/attach?${queryStr}`;\n const conn = await this.handler.connect(path, null, (streamNum, buff) => {\n web_socket_handler_1.WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr);\n return true;\n });\n if (stdin != null) {\n web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, stdin, web_socket_handler_1.WebSocketHandler.StdinStream);\n }\n if (terminal_size_queue_1.isResizable(stdout)) {\n this.terminalSizeQueue = new terminal_size_queue_1.TerminalSizeQueue();\n web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, web_socket_handler_1.WebSocketHandler.ResizeStream);\n this.terminalSizeQueue.handleResizes(stdout);\n }\n return conn;\n }\n}\nexports.Attach = Attach;\n//# sourceMappingURL=attach.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AzureAuth = void 0;\nconst tslib_1 = require(\"tslib\");\nconst proc = tslib_1.__importStar(require(\"child_process\"));\nconst jsonpath = tslib_1.__importStar(require(\"jsonpath-plus\"));\nclass AzureAuth {\n isAuthProvider(user) {\n if (!user || !user.authProvider) {\n return false;\n }\n return user.authProvider.name === 'azure';\n }\n async applyAuthentication(user, opts) {\n const token = this.getToken(user);\n if (token) {\n opts.headers.Authorization = `Bearer ${token}`;\n }\n }\n getToken(user) {\n const config = user.authProvider.config;\n if (this.isExpired(config)) {\n this.updateAccessToken(config);\n }\n return config['access-token'];\n }\n isExpired(config) {\n const token = config['access-token'];\n const expiry = config.expiry;\n const expiresOn = config['expires-on'];\n if (!token) {\n return true;\n }\n if (!expiry && !expiresOn) {\n return false;\n }\n const expiresOnDate = expiresOn ? new Date(parseInt(expiresOn, 10) * 1000) : undefined;\n const expiration = expiry ? Date.parse(expiry) : expiresOnDate;\n if (expiration < Date.now()) {\n return true;\n }\n return false;\n }\n updateAccessToken(config) {\n let cmd = config['cmd-path'];\n if (!cmd) {\n throw new Error('Token is expired!');\n }\n // Wrap cmd in quotes to make it cope with spaces in path\n cmd = `\"${cmd}\"`;\n const args = config['cmd-args'];\n if (args) {\n cmd = cmd + ' ' + args;\n }\n // TODO: Cache to file?\n // TODO: do this asynchronously\n let output;\n try {\n output = proc.execSync(cmd);\n }\n catch (err) {\n throw new Error('Failed to refresh token: ' + err.message);\n }\n const resultObj = JSON.parse(output);\n const tokenPathKeyInConfig = config['token-key'];\n const expiryPathKeyInConfig = config['expiry-key'];\n // Format in file is {}, so slice it out and add '$'\n const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1);\n const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1);\n config['access-token'] = jsonpath.JSONPath(tokenPathKey, resultObj);\n config.expiry = jsonpath.JSONPath(expiryPathKey, resultObj);\n }\n}\nexports.AzureAuth = AzureAuth;\n//# sourceMappingURL=azure_auth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deleteObject = exports.addOrUpdateObject = exports.deleteItems = exports.ListWatch = void 0;\nconst api_1 = require(\"./api\");\nconst informer_1 = require(\"./informer\");\nclass ListWatch {\n constructor(path, watch, listFn, autoStart = true, labelSelector) {\n this.path = path;\n this.watch = watch;\n this.listFn = listFn;\n this.labelSelector = labelSelector;\n this.objects = [];\n this.indexCache = {};\n this.callbackCache = {};\n this.stopped = false;\n this.callbackCache[informer_1.ADD] = [];\n this.callbackCache[informer_1.UPDATE] = [];\n this.callbackCache[informer_1.DELETE] = [];\n this.callbackCache[informer_1.ERROR] = [];\n this.callbackCache[informer_1.CONNECT] = [];\n this.resourceVersion = '';\n if (autoStart) {\n this.doneHandler(null);\n }\n }\n async start() {\n this.stopped = false;\n await this.doneHandler(null);\n }\n async stop() {\n this.stopped = true;\n this._stop();\n }\n on(verb, cb) {\n if (verb === informer_1.CHANGE) {\n this.on('add', cb);\n this.on('update', cb);\n this.on('delete', cb);\n return;\n }\n if (this.callbackCache[verb] === undefined) {\n throw new Error(`Unknown verb: ${verb}`);\n }\n this.callbackCache[verb].push(cb);\n }\n off(verb, cb) {\n if (verb === informer_1.CHANGE) {\n this.off('add', cb);\n this.off('update', cb);\n this.off('delete', cb);\n return;\n }\n if (this.callbackCache[verb] === undefined) {\n throw new Error(`Unknown verb: ${verb}`);\n }\n const indexToRemove = this.callbackCache[verb].findIndex((cachedCb) => cachedCb === cb);\n if (indexToRemove === -1) {\n return;\n }\n this.callbackCache[verb].splice(indexToRemove, 1);\n }\n get(name, namespace) {\n return this.objects.find((obj) => {\n return obj.metadata.name === name && (!namespace || obj.metadata.namespace === namespace);\n });\n }\n list(namespace) {\n if (!namespace) {\n return this.objects;\n }\n return this.indexCache[namespace];\n }\n latestResourceVersion() {\n return this.resourceVersion;\n }\n _stop() {\n if (this.request) {\n this.request.abort();\n this.request = undefined;\n }\n }\n async doneHandler(err) {\n this._stop();\n if (err && err.statusCode === 410) {\n this.resourceVersion = '';\n }\n else if (err) {\n this.callbackCache[informer_1.ERROR].forEach((elt) => elt(err));\n return;\n }\n if (this.stopped) {\n // do not auto-restart\n return;\n }\n this.callbackCache[informer_1.CONNECT].forEach((elt) => elt(undefined));\n if (!this.resourceVersion) {\n const promise = this.listFn();\n const result = await promise;\n const list = result.body;\n this.objects = deleteItems(this.objects, list.items, this.callbackCache[informer_1.DELETE].slice());\n Object.keys(this.indexCache).forEach((key) => {\n const updateObjects = deleteItems(this.indexCache[key], list.items);\n if (updateObjects.length !== 0) {\n this.indexCache[key] = updateObjects;\n }\n else {\n delete this.indexCache[key];\n }\n });\n this.addOrUpdateItems(list.items);\n this.resourceVersion = list.metadata.resourceVersion;\n }\n const queryParams = {\n resourceVersion: this.resourceVersion,\n };\n if (this.labelSelector !== undefined) {\n queryParams.labelSelector = api_1.ObjectSerializer.serialize(this.labelSelector, 'string');\n }\n this.request = await this.watch.watch(this.path, queryParams, this.watchHandler.bind(this), this.doneHandler.bind(this));\n }\n addOrUpdateItems(items) {\n items.forEach((obj) => {\n addOrUpdateObject(this.objects, obj, this.callbackCache[informer_1.ADD].slice(), this.callbackCache[informer_1.UPDATE].slice());\n if (obj.metadata.namespace) {\n this.indexObj(obj);\n }\n });\n }\n indexObj(obj) {\n let namespaceList = this.indexCache[obj.metadata.namespace];\n if (!namespaceList) {\n namespaceList = [];\n this.indexCache[obj.metadata.namespace] = namespaceList;\n }\n addOrUpdateObject(namespaceList, obj);\n }\n watchHandler(phase, obj, watchObj) {\n switch (phase) {\n case 'ADDED':\n case 'MODIFIED':\n addOrUpdateObject(this.objects, obj, this.callbackCache[informer_1.ADD].slice(), this.callbackCache[informer_1.UPDATE].slice());\n if (obj.metadata.namespace) {\n this.indexObj(obj);\n }\n break;\n case 'DELETED':\n deleteObject(this.objects, obj, this.callbackCache[informer_1.DELETE].slice());\n if (obj.metadata.namespace) {\n const namespaceList = this.indexCache[obj.metadata.namespace];\n if (namespaceList) {\n deleteObject(namespaceList, obj);\n }\n }\n break;\n case 'BOOKMARK':\n // nothing to do, here for documentation, mostly.\n break;\n }\n if (watchObj && watchObj.metadata) {\n this.resourceVersion = watchObj.metadata.resourceVersion;\n }\n }\n}\nexports.ListWatch = ListWatch;\n// external for testing\nfunction deleteItems(oldObjects, newObjects, deleteCallback) {\n return oldObjects.filter((obj) => {\n if (findKubernetesObject(newObjects, obj) === -1) {\n if (deleteCallback) {\n deleteCallback.forEach((fn) => fn(obj));\n }\n return false;\n }\n return true;\n });\n}\nexports.deleteItems = deleteItems;\n// Only public for testing.\nfunction addOrUpdateObject(objects, obj, addCallback, updateCallback) {\n const ix = findKubernetesObject(objects, obj);\n if (ix === -1) {\n objects.push(obj);\n if (addCallback) {\n addCallback.forEach((elt) => elt(obj));\n }\n }\n else {\n if (!isSameVersion(objects[ix], obj)) {\n objects[ix] = obj;\n if (updateCallback) {\n updateCallback.forEach((elt) => elt(obj));\n }\n }\n }\n}\nexports.addOrUpdateObject = addOrUpdateObject;\nfunction isSameObject(o1, o2) {\n return o1.metadata.name === o2.metadata.name && o1.metadata.namespace === o2.metadata.namespace;\n}\nfunction isSameVersion(o1, o2) {\n return (o1.metadata.resourceVersion !== undefined &&\n o1.metadata.resourceVersion !== null &&\n o1.metadata.resourceVersion === o2.metadata.resourceVersion);\n}\nfunction findKubernetesObject(objects, obj) {\n return objects.findIndex((elt) => {\n return isSameObject(elt, obj);\n });\n}\n// Public for testing.\nfunction deleteObject(objects, obj, deleteCallback) {\n const ix = findKubernetesObject(objects, obj);\n if (ix !== -1) {\n objects.splice(ix, 1);\n if (deleteCallback) {\n deleteCallback.forEach((elt) => elt(obj));\n }\n }\n}\nexports.deleteObject = deleteObject;\n//# sourceMappingURL=cache.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.findObject = exports.findHomeDir = exports.bufferFromFileOrString = exports.makeAbsolutePath = exports.Config = exports.KubeConfig = void 0;\nconst tslib_1 = require(\"tslib\");\nconst execa = require(\"execa\");\nconst fs = require(\"fs\");\nconst yaml = require(\"js-yaml\");\nconst net = require(\"net\");\nconst path = require(\"path\");\nconst shelljs = require(\"shelljs\");\nconst api = tslib_1.__importStar(require(\"./api\"));\nconst azure_auth_1 = require(\"./azure_auth\");\nconst config_types_1 = require(\"./config_types\");\nconst exec_auth_1 = require(\"./exec_auth\");\nconst file_auth_1 = require(\"./file_auth\");\nconst gcp_auth_1 = require(\"./gcp_auth\");\nconst oidc_auth_1 = require(\"./oidc_auth\");\n// fs.existsSync was removed in node 10\nfunction fileExists(filepath) {\n try {\n fs.accessSync(filepath);\n return true;\n }\n catch (ignore) {\n return false;\n }\n}\nclass KubeConfig {\n constructor() {\n this.contexts = [];\n this.clusters = [];\n this.users = [];\n }\n getContexts() {\n return this.contexts;\n }\n getClusters() {\n return this.clusters;\n }\n getUsers() {\n return this.users;\n }\n getCurrentContext() {\n return this.currentContext;\n }\n setCurrentContext(context) {\n this.currentContext = context;\n }\n getContextObject(name) {\n if (!this.contexts) {\n return null;\n }\n return findObject(this.contexts, name, 'context');\n }\n getCurrentCluster() {\n const context = this.getCurrentContextObject();\n if (!context) {\n return null;\n }\n return this.getCluster(context.cluster);\n }\n getCluster(name) {\n return findObject(this.clusters, name, 'cluster');\n }\n getCurrentUser() {\n const ctx = this.getCurrentContextObject();\n if (!ctx) {\n return null;\n }\n return this.getUser(ctx.user);\n }\n getUser(name) {\n return findObject(this.users, name, 'user');\n }\n loadFromFile(file, opts) {\n const rootDirectory = path.dirname(file);\n this.loadFromString(fs.readFileSync(file, 'utf8'), opts);\n this.makePathsAbsolute(rootDirectory);\n }\n async applytoHTTPSOptions(opts) {\n const user = this.getCurrentUser();\n await this.applyOptions(opts);\n if (user && user.username) {\n opts.auth = `${user.username}:${user.password}`;\n }\n }\n async applyToRequest(opts) {\n const cluster = this.getCurrentCluster();\n const user = this.getCurrentUser();\n await this.applyOptions(opts);\n if (cluster && cluster.skipTLSVerify) {\n opts.strictSSL = false;\n }\n if (user && user.username) {\n opts.auth = {\n password: user.password,\n username: user.username,\n };\n }\n }\n loadFromString(config, opts) {\n const obj = yaml.load(config);\n this.clusters = config_types_1.newClusters(obj.clusters, opts);\n this.contexts = config_types_1.newContexts(obj.contexts, opts);\n this.users = config_types_1.newUsers(obj.users, opts);\n this.currentContext = obj['current-context'];\n }\n loadFromOptions(options) {\n this.clusters = options.clusters;\n this.contexts = options.contexts;\n this.users = options.users;\n this.currentContext = options.currentContext;\n }\n loadFromClusterAndUser(cluster, user) {\n this.clusters = [cluster];\n this.users = [user];\n this.currentContext = 'loaded-context';\n this.contexts = [\n {\n cluster: cluster.name,\n user: user.name,\n name: this.currentContext,\n },\n ];\n }\n loadFromCluster(pathPrefix = '') {\n const host = process.env.KUBERNETES_SERVICE_HOST;\n const port = process.env.KUBERNETES_SERVICE_PORT;\n const clusterName = 'inCluster';\n const userName = 'inClusterUser';\n const contextName = 'inClusterContext';\n let scheme = 'https';\n if (port === '80' || port === '8080' || port === '8001') {\n scheme = 'http';\n }\n // Wrap raw IPv6 addresses in brackets.\n let serverHost = host;\n if (host && net.isIPv6(host)) {\n serverHost = `[${host}]`;\n }\n this.clusters = [\n {\n name: clusterName,\n caFile: `${pathPrefix}${Config.SERVICEACCOUNT_CA_PATH}`,\n server: `${scheme}://${serverHost}:${port}`,\n skipTLSVerify: false,\n },\n ];\n this.users = [\n {\n name: userName,\n authProvider: {\n name: 'tokenFile',\n config: {\n tokenFile: `${pathPrefix}${Config.SERVICEACCOUNT_TOKEN_PATH}`,\n },\n },\n },\n ];\n const namespaceFile = `${pathPrefix}${Config.SERVICEACCOUNT_NAMESPACE_PATH}`;\n let namespace;\n if (fileExists(namespaceFile)) {\n namespace = fs.readFileSync(namespaceFile, 'utf8');\n }\n this.contexts = [\n {\n cluster: clusterName,\n name: contextName,\n user: userName,\n namespace,\n },\n ];\n this.currentContext = contextName;\n }\n mergeConfig(config, preserveContext = false) {\n if (!preserveContext) {\n this.currentContext = config.currentContext;\n }\n config.clusters.forEach((cluster) => {\n this.addCluster(cluster);\n });\n config.users.forEach((user) => {\n this.addUser(user);\n });\n config.contexts.forEach((ctx) => {\n this.addContext(ctx);\n });\n }\n addCluster(cluster) {\n if (!this.clusters) {\n this.clusters = [];\n }\n this.clusters.forEach((c, ix) => {\n if (c.name === cluster.name) {\n throw new Error(`Duplicate cluster: ${c.name}`);\n }\n });\n this.clusters.push(cluster);\n }\n addUser(user) {\n if (!this.users) {\n this.users = [];\n }\n this.users.forEach((c, ix) => {\n if (c.name === user.name) {\n throw new Error(`Duplicate user: ${c.name}`);\n }\n });\n this.users.push(user);\n }\n addContext(ctx) {\n if (!this.contexts) {\n this.contexts = [];\n }\n this.contexts.forEach((c, ix) => {\n if (c.name === ctx.name) {\n throw new Error(`Duplicate context: ${c.name}`);\n }\n });\n this.contexts.push(ctx);\n }\n loadFromDefault(opts, contextFromStartingConfig = false) {\n if (process.env.KUBECONFIG && process.env.KUBECONFIG.length > 0) {\n const files = process.env.KUBECONFIG.split(path.delimiter).filter((filename) => filename);\n this.loadFromFile(files[0], opts);\n for (let i = 1; i < files.length; i++) {\n const kc = new KubeConfig();\n kc.loadFromFile(files[i], opts);\n this.mergeConfig(kc, contextFromStartingConfig);\n }\n return;\n }\n const home = findHomeDir();\n if (home) {\n const config = path.join(home, '.kube', 'config');\n if (fileExists(config)) {\n this.loadFromFile(config, opts);\n return;\n }\n }\n if (process.platform === 'win32' && shelljs.which('wsl.exe')) {\n try {\n const envKubeconfigPathResult = execa.sync('wsl.exe', ['bash', '-ic', 'printenv KUBECONFIG']);\n if (envKubeconfigPathResult.exitCode === 0 && envKubeconfigPathResult.stdout.length > 0) {\n const result = execa.sync('wsl.exe', ['cat', envKubeconfigPathResult.stdout]);\n if (result.exitCode === 0) {\n this.loadFromString(result.stdout, opts);\n return;\n }\n if (result.exitCode === 0) {\n this.loadFromString(result.stdout, opts);\n return;\n }\n }\n }\n catch (err) {\n // Falling back to default kubeconfig\n }\n try {\n const result = execa.sync('wsl.exe', ['cat', '~/.kube/config']);\n if (result.exitCode === 0) {\n this.loadFromString(result.stdout, opts);\n return;\n }\n }\n catch (err) {\n // Falling back to alternative auth\n }\n }\n if (fileExists(Config.SERVICEACCOUNT_TOKEN_PATH)) {\n this.loadFromCluster();\n return;\n }\n this.loadFromClusterAndUser({ name: 'cluster', server: 'http://localhost:8080' }, { name: 'user' });\n }\n makeApiClient(apiClientType) {\n const cluster = this.getCurrentCluster();\n if (!cluster) {\n throw new Error('No active cluster!');\n }\n const apiClient = new apiClientType(cluster.server);\n apiClient.setDefaultAuthentication(this);\n return apiClient;\n }\n makePathsAbsolute(rootDirectory) {\n this.clusters.forEach((cluster) => {\n if (cluster.caFile) {\n cluster.caFile = makeAbsolutePath(rootDirectory, cluster.caFile);\n }\n });\n this.users.forEach((user) => {\n if (user.certFile) {\n user.certFile = makeAbsolutePath(rootDirectory, user.certFile);\n }\n if (user.keyFile) {\n user.keyFile = makeAbsolutePath(rootDirectory, user.keyFile);\n }\n });\n }\n exportConfig() {\n const configObj = {\n apiVersion: 'v1',\n kind: 'Config',\n clusters: this.clusters.map(config_types_1.exportCluster),\n users: this.users.map(config_types_1.exportUser),\n contexts: this.contexts.map(config_types_1.exportContext),\n preferences: {},\n 'current-context': this.getCurrentContext(),\n };\n return JSON.stringify(configObj);\n }\n getCurrentContextObject() {\n return this.getContextObject(this.currentContext);\n }\n applyHTTPSOptions(opts) {\n const cluster = this.getCurrentCluster();\n const user = this.getCurrentUser();\n if (!user) {\n return;\n }\n if (cluster != null && cluster.skipTLSVerify) {\n opts.rejectUnauthorized = false;\n }\n const ca = cluster != null ? bufferFromFileOrString(cluster.caFile, cluster.caData) : null;\n if (ca) {\n opts.ca = ca;\n }\n const cert = bufferFromFileOrString(user.certFile, user.certData);\n if (cert) {\n opts.cert = cert;\n }\n const key = bufferFromFileOrString(user.keyFile, user.keyData);\n if (key) {\n opts.key = key;\n }\n }\n async applyAuthorizationHeader(opts) {\n const user = this.getCurrentUser();\n if (!user) {\n return;\n }\n const authenticator = KubeConfig.authenticators.find((elt) => {\n return elt.isAuthProvider(user);\n });\n if (!opts.headers) {\n opts.headers = {};\n }\n if (authenticator) {\n await authenticator.applyAuthentication(user, opts);\n }\n if (user.token) {\n opts.headers.Authorization = `Bearer ${user.token}`;\n }\n }\n async applyOptions(opts) {\n this.applyHTTPSOptions(opts);\n await this.applyAuthorizationHeader(opts);\n }\n}\nexports.KubeConfig = KubeConfig;\nKubeConfig.authenticators = [\n new azure_auth_1.AzureAuth(),\n new gcp_auth_1.GoogleCloudPlatformAuth(),\n new exec_auth_1.ExecAuth(),\n new file_auth_1.FileAuth(),\n new oidc_auth_1.OpenIDConnectAuth(),\n];\n// This class is deprecated and will eventually be removed.\nclass Config {\n static fromFile(filename) {\n return Config.apiFromFile(filename, api.CoreV1Api);\n }\n static fromCluster() {\n return Config.apiFromCluster(api.CoreV1Api);\n }\n static defaultClient() {\n return Config.apiFromDefaultClient(api.CoreV1Api);\n }\n static apiFromFile(filename, apiClientType) {\n const kc = new KubeConfig();\n kc.loadFromFile(filename);\n return kc.makeApiClient(apiClientType);\n }\n static apiFromCluster(apiClientType) {\n const kc = new KubeConfig();\n kc.loadFromCluster();\n const cluster = kc.getCurrentCluster();\n if (!cluster) {\n throw new Error('No active cluster!');\n }\n const k8sApi = new apiClientType(cluster.server);\n k8sApi.setDefaultAuthentication(kc);\n return k8sApi;\n }\n static apiFromDefaultClient(apiClientType) {\n const kc = new KubeConfig();\n kc.loadFromDefault();\n return kc.makeApiClient(apiClientType);\n }\n}\nexports.Config = Config;\nConfig.SERVICEACCOUNT_ROOT = '/var/run/secrets/kubernetes.io/serviceaccount';\nConfig.SERVICEACCOUNT_CA_PATH = Config.SERVICEACCOUNT_ROOT + '/ca.crt';\nConfig.SERVICEACCOUNT_TOKEN_PATH = Config.SERVICEACCOUNT_ROOT + '/token';\nConfig.SERVICEACCOUNT_NAMESPACE_PATH = Config.SERVICEACCOUNT_ROOT + '/namespace';\nfunction makeAbsolutePath(root, file) {\n if (!root || path.isAbsolute(file)) {\n return file;\n }\n return path.join(root, file);\n}\nexports.makeAbsolutePath = makeAbsolutePath;\n// This is public really only for testing.\nfunction bufferFromFileOrString(file, data) {\n if (file) {\n return fs.readFileSync(file);\n }\n if (data) {\n return Buffer.from(data, 'base64');\n }\n return null;\n}\nexports.bufferFromFileOrString = bufferFromFileOrString;\nfunction dropDuplicatesAndNils(a) {\n return a.reduce((acceptedValues, currentValue) => {\n // Good-enough algorithm for reducing a small (3 items at this point) array into an ordered list\n // of unique non-empty strings.\n if (currentValue && !acceptedValues.includes(currentValue)) {\n return acceptedValues.concat(currentValue);\n }\n else {\n return acceptedValues;\n }\n }, []);\n}\n// Only public for testing.\nfunction findHomeDir() {\n if (process.platform !== 'win32') {\n if (process.env.HOME) {\n try {\n fs.accessSync(process.env.HOME);\n return process.env.HOME;\n // tslint:disable-next-line:no-empty\n }\n catch (ignore) { }\n }\n return null;\n }\n // $HOME is always favoured, but the k8s go-client prefers the other two env vars\n // differently depending on whether .kube/config exists or not.\n const homeDrivePath = process.env.HOMEDRIVE && process.env.HOMEPATH\n ? path.join(process.env.HOMEDRIVE, process.env.HOMEPATH)\n : '';\n const homePath = process.env.HOME || '';\n const userProfile = process.env.USERPROFILE || '';\n const favourHomeDrivePathList = dropDuplicatesAndNils([homePath, homeDrivePath, userProfile]);\n const favourUserProfileList = dropDuplicatesAndNils([homePath, userProfile, homeDrivePath]);\n // 1. the first of %HOME%, %HOMEDRIVE%%HOMEPATH%, %USERPROFILE% containing a `.kube\\config` file is returned.\n for (const dir of favourHomeDrivePathList) {\n try {\n fs.accessSync(path.join(dir, '.kube', 'config'));\n return dir;\n // tslint:disable-next-line:no-empty\n }\n catch (ignore) { }\n }\n // 2. ...the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that exists and is writeable is returned\n for (const dir of favourUserProfileList) {\n try {\n fs.accessSync(dir, fs.constants.W_OK);\n return dir;\n // tslint:disable-next-line:no-empty\n }\n catch (ignore) { }\n }\n // 3. ...the first of %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that exists is returned.\n for (const dir of favourUserProfileList) {\n try {\n fs.accessSync(dir);\n return dir;\n // tslint:disable-next-line:no-empty\n }\n catch (ignore) { }\n }\n // 4. if none of those locations exists, the first of\n // %HOME%, %USERPROFILE%, %HOMEDRIVE%%HOMEPATH% that is set is returned.\n return favourUserProfileList[0] || null;\n}\nexports.findHomeDir = findHomeDir;\n// Only really public for testing...\nfunction findObject(list, name, key) {\n if (!list) {\n return null;\n }\n for (const obj of list) {\n if (obj.name === name) {\n if (obj[key]) {\n obj[key].name = name;\n return obj[key];\n }\n return obj;\n }\n }\n return null;\n}\nexports.findObject = findObject;\n//# sourceMappingURL=config.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.exportContext = exports.newContexts = exports.exportUser = exports.newUsers = exports.exportCluster = exports.newClusters = exports.ActionOnInvalid = void 0;\nconst tslib_1 = require(\"tslib\");\nconst fs = tslib_1.__importStar(require(\"fs\"));\nconst _ = tslib_1.__importStar(require(\"underscore\"));\nvar ActionOnInvalid;\n(function (ActionOnInvalid) {\n ActionOnInvalid[\"THROW\"] = \"throw\";\n ActionOnInvalid[\"FILTER\"] = \"filter\";\n})(ActionOnInvalid = exports.ActionOnInvalid || (exports.ActionOnInvalid = {}));\nfunction defaultNewConfigOptions() {\n return {\n onInvalidEntry: ActionOnInvalid.THROW,\n };\n}\nfunction newClusters(a, opts) {\n const options = Object.assign(defaultNewConfigOptions(), opts || {});\n return _.compact(_.map(a, clusterIterator(options.onInvalidEntry)));\n}\nexports.newClusters = newClusters;\nfunction exportCluster(cluster) {\n return {\n name: cluster.name,\n cluster: {\n server: cluster.server,\n 'certificate-authority-data': cluster.caData,\n 'certificate-authority': cluster.caFile,\n 'insecure-skip-tls-verify': cluster.skipTLSVerify,\n },\n };\n}\nexports.exportCluster = exportCluster;\nfunction clusterIterator(onInvalidEntry) {\n return (elt, i, list) => {\n try {\n if (!elt.name) {\n throw new Error(`clusters[${i}].name is missing`);\n }\n if (!elt.cluster) {\n throw new Error(`clusters[${i}].cluster is missing`);\n }\n if (!elt.cluster.server) {\n throw new Error(`clusters[${i}].cluster.server is missing`);\n }\n return {\n caData: elt.cluster['certificate-authority-data'],\n caFile: elt.cluster['certificate-authority'],\n name: elt.name,\n server: elt.cluster.server.replace(/\\/$/, ''),\n skipTLSVerify: elt.cluster['insecure-skip-tls-verify'] === true,\n };\n }\n catch (err) {\n switch (onInvalidEntry) {\n case ActionOnInvalid.FILTER:\n return null;\n default:\n case ActionOnInvalid.THROW:\n throw err;\n }\n }\n };\n}\nfunction newUsers(a, opts) {\n const options = Object.assign(defaultNewConfigOptions(), opts || {});\n return _.compact(_.map(a, userIterator(options.onInvalidEntry)));\n}\nexports.newUsers = newUsers;\nfunction exportUser(user) {\n return {\n name: user.name,\n user: {\n 'auth-provider': user.authProvider,\n 'client-certificate-data': user.certData,\n 'client-certificate': user.certFile,\n exec: user.exec,\n 'client-key-data': user.keyData,\n 'client-key': user.keyFile,\n token: user.token,\n password: user.password,\n username: user.username,\n },\n };\n}\nexports.exportUser = exportUser;\nfunction userIterator(onInvalidEntry) {\n return (elt, i, list) => {\n try {\n if (!elt.name) {\n throw new Error(`users[${i}].name is missing`);\n }\n return {\n authProvider: elt.user ? elt.user['auth-provider'] : null,\n certData: elt.user ? elt.user['client-certificate-data'] : null,\n certFile: elt.user ? elt.user['client-certificate'] : null,\n exec: elt.user ? elt.user.exec : null,\n keyData: elt.user ? elt.user['client-key-data'] : null,\n keyFile: elt.user ? elt.user['client-key'] : null,\n name: elt.name,\n token: findToken(elt.user),\n password: elt.user ? elt.user.password : null,\n username: elt.user ? elt.user.username : null,\n };\n }\n catch (err) {\n switch (onInvalidEntry) {\n case ActionOnInvalid.FILTER:\n return null;\n default:\n case ActionOnInvalid.THROW:\n throw err;\n }\n }\n };\n}\nfunction findToken(user) {\n if (user) {\n if (user.token) {\n return user.token;\n }\n if (user['token-file']) {\n return fs.readFileSync(user['token-file']).toString();\n }\n }\n}\nfunction newContexts(a, opts) {\n const options = Object.assign(defaultNewConfigOptions(), opts || {});\n return _.compact(_.map(a, contextIterator(options.onInvalidEntry)));\n}\nexports.newContexts = newContexts;\nfunction exportContext(ctx) {\n return {\n name: ctx.name,\n context: ctx,\n };\n}\nexports.exportContext = exportContext;\nfunction contextIterator(onInvalidEntry) {\n return (elt, i, list) => {\n try {\n if (!elt.name) {\n throw new Error(`contexts[${i}].name is missing`);\n }\n if (!elt.context) {\n throw new Error(`contexts[${i}].context is missing`);\n }\n if (!elt.context.cluster) {\n throw new Error(`contexts[${i}].context.cluster is missing`);\n }\n return {\n cluster: elt.context.cluster,\n name: elt.name,\n user: elt.context.user || undefined,\n namespace: elt.context.namespace || undefined,\n };\n }\n catch (err) {\n switch (onInvalidEntry) {\n case ActionOnInvalid.FILTER:\n return null;\n default:\n case ActionOnInvalid.THROW:\n throw err;\n }\n }\n };\n}\n//# sourceMappingURL=config_types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Cp = void 0;\nconst tslib_1 = require(\"tslib\");\nconst fs = tslib_1.__importStar(require(\"fs\"));\nconst stream_buffers_1 = require(\"stream-buffers\");\nconst tar = tslib_1.__importStar(require(\"tar\"));\nconst tmp = tslib_1.__importStar(require(\"tmp-promise\"));\nconst exec_1 = require(\"./exec\");\nclass Cp {\n constructor(config, execInstance) {\n this.execInstance = execInstance || new exec_1.Exec(config);\n }\n /**\n * @param {string} namespace - The namespace of the pod to exec the command inside.\n * @param {string} podName - The name of the pod to exec the command inside.\n * @param {string} containerName - The name of the container in the pod to exec the command inside.\n * @param {string} srcPath - The source path in the pod\n * @param {string} tgtPath - The target path in local\n */\n async cpFromPod(namespace, podName, containerName, srcPath, tgtPath) {\n const tmpFile = tmp.fileSync();\n const tmpFileName = tmpFile.name;\n const command = ['tar', 'zcf', '-', srcPath];\n const writerStream = fs.createWriteStream(tmpFileName);\n const errStream = new stream_buffers_1.WritableStreamBuffer();\n this.execInstance.exec(namespace, podName, containerName, command, writerStream, errStream, null, false, async () => {\n if (errStream.size()) {\n throw new Error(`Error from cpFromPod - details: \\n ${errStream.getContentsAsString()}`);\n }\n await tar.x({\n file: tmpFileName,\n cwd: tgtPath,\n });\n });\n }\n /**\n * @param {string} namespace - The namespace of the pod to exec the command inside.\n * @param {string} podName - The name of the pod to exec the command inside.\n * @param {string} containerName - The name of the container in the pod to exec the command inside.\n * @param {string} srcPath - The source path in local\n * @param {string} tgtPath - The target path in the pod\n */\n async cpToPod(namespace, podName, containerName, srcPath, tgtPath) {\n const tmpFile = tmp.fileSync();\n const tmpFileName = tmpFile.name;\n const command = ['tar', 'xf', '-', '-C', tgtPath];\n await tar.c({\n file: tmpFile.name,\n }, [srcPath]);\n const readStream = fs.createReadStream(tmpFileName);\n const errStream = new stream_buffers_1.WritableStreamBuffer();\n this.execInstance.exec(namespace, podName, containerName, command, null, errStream, readStream, false, async () => {\n if (errStream.size()) {\n throw new Error(`Error from cpToPod - details: \\n ${errStream.getContentsAsString()}`);\n }\n });\n }\n}\nexports.Cp = Cp;\n//# sourceMappingURL=cp.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Exec = void 0;\nconst querystring = require(\"querystring\");\nconst terminal_size_queue_1 = require(\"./terminal-size-queue\");\nconst web_socket_handler_1 = require(\"./web-socket-handler\");\nclass Exec {\n constructor(config, wsInterface) {\n this.handler = wsInterface || new web_socket_handler_1.WebSocketHandler(config);\n }\n /**\n * @param {string} namespace - The namespace of the pod to exec the command inside.\n * @param {string} podName - The name of the pod to exec the command inside.\n * @param {string} containerName - The name of the container in the pod to exec the command inside.\n * @param {(string|string[])} command - The command or command and arguments to execute.\n * @param {stream.Writable} stdout - The stream to write stdout data from the command.\n * @param {stream.Writable} stderr - The stream to write stderr data from the command.\n * @param {stream.Readable} stdin - The stream to write stdin data into the command.\n * @param {boolean} tty - Should the command execute in a TTY enabled session.\n * @param {(V1Status) => void} statusCallback -\n * A callback to received the status (e.g. exit code) from the command, optional.\n * @return {string} This is the result\n */\n async exec(namespace, podName, containerName, command, stdout, stderr, stdin, tty, statusCallback) {\n const query = {\n stdout: stdout != null,\n stderr: stderr != null,\n stdin: stdin != null,\n tty,\n command,\n container: containerName,\n };\n const queryStr = querystring.stringify(query);\n const path = `/api/v1/namespaces/${namespace}/pods/${podName}/exec?${queryStr}`;\n const conn = await this.handler.connect(path, null, (streamNum, buff) => {\n const status = web_socket_handler_1.WebSocketHandler.handleStandardStreams(streamNum, buff, stdout, stderr);\n if (status != null) {\n if (statusCallback) {\n statusCallback(status);\n }\n return false;\n }\n return true;\n });\n if (stdin != null) {\n web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, stdin, web_socket_handler_1.WebSocketHandler.StdinStream);\n }\n if (terminal_size_queue_1.isResizable(stdout)) {\n this.terminalSizeQueue = new terminal_size_queue_1.TerminalSizeQueue();\n web_socket_handler_1.WebSocketHandler.handleStandardInput(conn, this.terminalSizeQueue, web_socket_handler_1.WebSocketHandler.ResizeStream);\n this.terminalSizeQueue.handleResizes(stdout);\n }\n return conn;\n }\n}\nexports.Exec = Exec;\n//# sourceMappingURL=exec.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExecAuth = void 0;\nconst execa = require(\"execa\");\nclass ExecAuth {\n constructor() {\n this.tokenCache = {};\n this.execFn = execa.sync;\n }\n isAuthProvider(user) {\n if (!user) {\n return false;\n }\n if (user.exec) {\n return true;\n }\n if (!user.authProvider) {\n return false;\n }\n return (user.authProvider.name === 'exec' || !!(user.authProvider.config && user.authProvider.config.exec));\n }\n async applyAuthentication(user, opts) {\n const credential = this.getCredential(user);\n if (!credential) {\n return;\n }\n if (credential.status.clientCertificateData) {\n opts.cert = credential.status.clientCertificateData;\n }\n if (credential.status.clientKeyData) {\n opts.key = credential.status.clientKeyData;\n }\n const token = this.getToken(credential);\n if (token) {\n if (!opts.headers) {\n opts.headers = [];\n }\n opts.headers.Authorization = `Bearer ${token}`;\n }\n }\n getToken(credential) {\n if (!credential) {\n return null;\n }\n if (credential.status.token) {\n return credential.status.token;\n }\n return null;\n }\n getCredential(user) {\n // TODO: Add a unit test for token caching.\n const cachedToken = this.tokenCache[user.name];\n if (cachedToken) {\n const date = Date.parse(cachedToken.status.expirationTimestamp);\n if (date > Date.now()) {\n return cachedToken;\n }\n this.tokenCache[user.name] = null;\n }\n let exec = null;\n if (user.authProvider && user.authProvider.config) {\n exec = user.authProvider.config.exec;\n }\n if (user.exec) {\n exec = user.exec;\n }\n if (!exec) {\n return null;\n }\n if (!exec.command) {\n throw new Error('No command was specified for exec authProvider!');\n }\n let opts = {};\n if (exec.env) {\n const env = process.env;\n exec.env.forEach((elt) => (env[elt.name] = elt.value));\n opts = { ...opts, env };\n }\n const result = this.execFn(exec.command, exec.args, opts);\n if (result.exitCode === 0) {\n const obj = JSON.parse(result.stdout);\n this.tokenCache[user.name] = obj;\n return obj;\n }\n throw new Error(result.stderr);\n }\n}\nexports.ExecAuth = ExecAuth;\n//# sourceMappingURL=exec_auth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FileAuth = void 0;\nconst fs = require(\"fs\");\nclass FileAuth {\n constructor() {\n this.token = null;\n this.lastRead = null;\n }\n isAuthProvider(user) {\n return user.authProvider && user.authProvider.config && user.authProvider.config.tokenFile;\n }\n async applyAuthentication(user, opts) {\n if (this.token == null) {\n this.refreshToken(user.authProvider.config.tokenFile);\n }\n if (this.isTokenExpired()) {\n this.refreshToken(user.authProvider.config.tokenFile);\n }\n if (this.token) {\n opts.headers.Authorization = `Bearer ${this.token}`;\n }\n }\n refreshToken(filePath) {\n // TODO make this async?\n this.token = fs.readFileSync(filePath).toString('UTF-8');\n this.lastRead = new Date();\n }\n isTokenExpired() {\n if (this.lastRead === null) {\n return true;\n }\n const now = new Date();\n const delta = (now.getTime() - this.lastRead.getTime()) / 1000;\n // For now just refresh every 60 seconds. This is imperfect since the token\n // could be out of date for this time, but it is unlikely and it's also what\n // the client-go library does.\n // TODO: Use file notifications instead?\n return delta > 60;\n }\n}\nexports.FileAuth = FileAuth;\n//# sourceMappingURL=file_auth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GoogleCloudPlatformAuth = void 0;\nconst tslib_1 = require(\"tslib\");\nconst proc = tslib_1.__importStar(require(\"child_process\"));\nconst jsonpath = tslib_1.__importStar(require(\"jsonpath-plus\"));\nclass GoogleCloudPlatformAuth {\n isAuthProvider(user) {\n if (!user || !user.authProvider) {\n return false;\n }\n return user.authProvider.name === 'gcp';\n }\n async applyAuthentication(user, opts) {\n const token = this.getToken(user);\n if (token) {\n opts.headers.Authorization = `Bearer ${token}`;\n }\n }\n getToken(user) {\n const config = user.authProvider.config;\n if (this.isExpired(config)) {\n this.updateAccessToken(config);\n }\n return config['access-token'];\n }\n isExpired(config) {\n const token = config['access-token'];\n const expiry = config.expiry;\n if (!token) {\n return true;\n }\n if (!expiry) {\n return false;\n }\n const expiration = Date.parse(expiry);\n if (expiration < Date.now()) {\n return true;\n }\n return false;\n }\n updateAccessToken(config) {\n let cmd = config['cmd-path'];\n if (!cmd) {\n throw new Error('Token is expired!');\n }\n // Wrap cmd in quotes to make it cope with spaces in path\n cmd = `\"${cmd}\"`;\n const args = config['cmd-args'];\n if (args) {\n cmd = cmd + ' ' + args;\n }\n // TODO: Cache to file?\n // TODO: do this asynchronously\n let output;\n try {\n output = proc.execSync(cmd);\n }\n catch (err) {\n throw new Error('Failed to refresh token: ' + err.message);\n }\n const resultObj = JSON.parse(output);\n const tokenPathKeyInConfig = config['token-key'];\n const expiryPathKeyInConfig = config['expiry-key'];\n // Format in file is {}, so slice it out and add '$'\n const tokenPathKey = '$' + tokenPathKeyInConfig.slice(1, -1);\n const expiryPathKey = '$' + expiryPathKeyInConfig.slice(1, -1);\n config['access-token'] = jsonpath.JSONPath(tokenPathKey, resultObj);\n config.expiry = jsonpath.JSONPath(expiryPathKey, resultObj);\n }\n}\nexports.GoogleCloudPlatformAuth = GoogleCloudPlatformAuth;\n//# sourceMappingURL=gcp_auth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\n// This is the entrypoint for the package\ntslib_1.__exportStar(require(\"./api/apis\"), exports);\ntslib_1.__exportStar(require(\"./model/models\"), exports);\n//# sourceMappingURL=api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdmissionregistrationApi = exports.AdmissionregistrationApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AdmissionregistrationApiApiKeys;\n(function (AdmissionregistrationApiApiKeys) {\n AdmissionregistrationApiApiKeys[AdmissionregistrationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AdmissionregistrationApiApiKeys = exports.AdmissionregistrationApiApiKeys || (exports.AdmissionregistrationApiApiKeys = {}));\nclass AdmissionregistrationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AdmissionregistrationApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AdmissionregistrationApi = AdmissionregistrationApi;\n//# sourceMappingURL=admissionregistrationApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdmissionregistrationV1Api = exports.AdmissionregistrationV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AdmissionregistrationV1ApiApiKeys;\n(function (AdmissionregistrationV1ApiApiKeys) {\n AdmissionregistrationV1ApiApiKeys[AdmissionregistrationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AdmissionregistrationV1ApiApiKeys = exports.AdmissionregistrationV1ApiApiKeys || (exports.AdmissionregistrationV1ApiApiKeys = {}));\nclass AdmissionregistrationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AdmissionregistrationV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a MutatingWebhookConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createMutatingWebhookConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1MutatingWebhookConfiguration\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1MutatingWebhookConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a ValidatingWebhookConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createValidatingWebhookConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ValidatingWebhookConfiguration\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ValidatingWebhookConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of MutatingWebhookConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionMutatingWebhookConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ValidatingWebhookConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionValidatingWebhookConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a MutatingWebhookConfiguration\n * @param name name of the MutatingWebhookConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteMutatingWebhookConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ValidatingWebhookConfiguration\n * @param name name of the ValidatingWebhookConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteValidatingWebhookConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind MutatingWebhookConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listMutatingWebhookConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1MutatingWebhookConfigurationList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ValidatingWebhookConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listValidatingWebhookConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ValidatingWebhookConfigurationList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified MutatingWebhookConfiguration\n * @param name name of the MutatingWebhookConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchMutatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchMutatingWebhookConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1MutatingWebhookConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ValidatingWebhookConfiguration\n * @param name name of the ValidatingWebhookConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchValidatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchValidatingWebhookConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ValidatingWebhookConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified MutatingWebhookConfiguration\n * @param name name of the MutatingWebhookConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readMutatingWebhookConfiguration(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1MutatingWebhookConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ValidatingWebhookConfiguration\n * @param name name of the ValidatingWebhookConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readValidatingWebhookConfiguration(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ValidatingWebhookConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified MutatingWebhookConfiguration\n * @param name name of the MutatingWebhookConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceMutatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/mutatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceMutatingWebhookConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceMutatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1MutatingWebhookConfiguration\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1MutatingWebhookConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ValidatingWebhookConfiguration\n * @param name name of the ValidatingWebhookConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceValidatingWebhookConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceValidatingWebhookConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceValidatingWebhookConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ValidatingWebhookConfiguration\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ValidatingWebhookConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AdmissionregistrationV1Api = AdmissionregistrationV1Api;\n//# sourceMappingURL=admissionregistrationV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ApiextensionsApi = exports.ApiextensionsApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar ApiextensionsApiApiKeys;\n(function (ApiextensionsApiApiKeys) {\n ApiextensionsApiApiKeys[ApiextensionsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiextensionsApiApiKeys = exports.ApiextensionsApiApiKeys || (exports.ApiextensionsApiApiKeys = {}));\nclass ApiextensionsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiextensionsApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.ApiextensionsApi = ApiextensionsApi;\n//# sourceMappingURL=apiextensionsApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ApiextensionsV1Api = exports.ApiextensionsV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar ApiextensionsV1ApiApiKeys;\n(function (ApiextensionsV1ApiApiKeys) {\n ApiextensionsV1ApiApiKeys[ApiextensionsV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiextensionsV1ApiApiKeys = exports.ApiextensionsV1ApiApiKeys || (exports.ApiextensionsV1ApiApiKeys = {}));\nclass ApiextensionsV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiextensionsV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a CustomResourceDefinition\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createCustomResourceDefinition(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CustomResourceDefinition\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinition\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of CustomResourceDefinition\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionCustomResourceDefinition(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteCustomResourceDefinition(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CustomResourceDefinition\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listCustomResourceDefinition(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinitionList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchCustomResourceDefinition(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinition.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinition\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchCustomResourceDefinitionStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCustomResourceDefinitionStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCustomResourceDefinitionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinition\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readCustomResourceDefinition(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinition\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readCustomResourceDefinitionStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCustomResourceDefinitionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinition\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceCustomResourceDefinition(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinition.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinition.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CustomResourceDefinition\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinition\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified CustomResourceDefinition\n * @param name name of the CustomResourceDefinition\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceCustomResourceDefinitionStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCustomResourceDefinitionStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCustomResourceDefinitionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CustomResourceDefinition\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CustomResourceDefinition\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.ApiextensionsV1Api = ApiextensionsV1Api;\n//# sourceMappingURL=apiextensionsV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ApiregistrationApi = exports.ApiregistrationApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar ApiregistrationApiApiKeys;\n(function (ApiregistrationApiApiKeys) {\n ApiregistrationApiApiKeys[ApiregistrationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiregistrationApiApiKeys = exports.ApiregistrationApiApiKeys || (exports.ApiregistrationApiApiKeys = {}));\nclass ApiregistrationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiregistrationApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.ApiregistrationApi = ApiregistrationApi;\n//# sourceMappingURL=apiregistrationApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ApiregistrationV1Api = exports.ApiregistrationV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar ApiregistrationV1ApiApiKeys;\n(function (ApiregistrationV1ApiApiKeys) {\n ApiregistrationV1ApiApiKeys[ApiregistrationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApiregistrationV1ApiApiKeys = exports.ApiregistrationV1ApiApiKeys || (exports.ApiregistrationV1ApiApiKeys = {}));\nclass ApiregistrationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApiregistrationV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create an APIService\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createAPIService(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1APIService\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIService\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete an APIService\n * @param name name of the APIService\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteAPIService(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of APIService\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionAPIService(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind APIService\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listAPIService(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIServiceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchAPIService(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchAPIService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIService\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchAPIServiceStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchAPIServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIService\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified APIService\n * @param name name of the APIService\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readAPIService(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIService\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified APIService\n * @param name name of the APIService\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readAPIServiceStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIService\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceAPIService(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceAPIService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceAPIService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1APIService\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIService\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified APIService\n * @param name name of the APIService\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceAPIServiceStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apiregistration.k8s.io/v1/apiservices/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceAPIServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceAPIServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1APIService\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIService\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.ApiregistrationV1Api = ApiregistrationV1Api;\n//# sourceMappingURL=apiregistrationV1Api.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.APIS = exports.HttpError = void 0;\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./admissionregistrationApi\"), exports);\nconst admissionregistrationApi_1 = require(\"./admissionregistrationApi\");\ntslib_1.__exportStar(require(\"./admissionregistrationV1Api\"), exports);\nconst admissionregistrationV1Api_1 = require(\"./admissionregistrationV1Api\");\ntslib_1.__exportStar(require(\"./apiextensionsApi\"), exports);\nconst apiextensionsApi_1 = require(\"./apiextensionsApi\");\ntslib_1.__exportStar(require(\"./apiextensionsV1Api\"), exports);\nconst apiextensionsV1Api_1 = require(\"./apiextensionsV1Api\");\ntslib_1.__exportStar(require(\"./apiregistrationApi\"), exports);\nconst apiregistrationApi_1 = require(\"./apiregistrationApi\");\ntslib_1.__exportStar(require(\"./apiregistrationV1Api\"), exports);\nconst apiregistrationV1Api_1 = require(\"./apiregistrationV1Api\");\ntslib_1.__exportStar(require(\"./apisApi\"), exports);\nconst apisApi_1 = require(\"./apisApi\");\ntslib_1.__exportStar(require(\"./appsApi\"), exports);\nconst appsApi_1 = require(\"./appsApi\");\ntslib_1.__exportStar(require(\"./appsV1Api\"), exports);\nconst appsV1Api_1 = require(\"./appsV1Api\");\ntslib_1.__exportStar(require(\"./authenticationApi\"), exports);\nconst authenticationApi_1 = require(\"./authenticationApi\");\ntslib_1.__exportStar(require(\"./authenticationV1Api\"), exports);\nconst authenticationV1Api_1 = require(\"./authenticationV1Api\");\ntslib_1.__exportStar(require(\"./authorizationApi\"), exports);\nconst authorizationApi_1 = require(\"./authorizationApi\");\ntslib_1.__exportStar(require(\"./authorizationV1Api\"), exports);\nconst authorizationV1Api_1 = require(\"./authorizationV1Api\");\ntslib_1.__exportStar(require(\"./autoscalingApi\"), exports);\nconst autoscalingApi_1 = require(\"./autoscalingApi\");\ntslib_1.__exportStar(require(\"./autoscalingV1Api\"), exports);\nconst autoscalingV1Api_1 = require(\"./autoscalingV1Api\");\ntslib_1.__exportStar(require(\"./autoscalingV2beta1Api\"), exports);\nconst autoscalingV2beta1Api_1 = require(\"./autoscalingV2beta1Api\");\ntslib_1.__exportStar(require(\"./autoscalingV2beta2Api\"), exports);\nconst autoscalingV2beta2Api_1 = require(\"./autoscalingV2beta2Api\");\ntslib_1.__exportStar(require(\"./batchApi\"), exports);\nconst batchApi_1 = require(\"./batchApi\");\ntslib_1.__exportStar(require(\"./batchV1Api\"), exports);\nconst batchV1Api_1 = require(\"./batchV1Api\");\ntslib_1.__exportStar(require(\"./batchV1beta1Api\"), exports);\nconst batchV1beta1Api_1 = require(\"./batchV1beta1Api\");\ntslib_1.__exportStar(require(\"./certificatesApi\"), exports);\nconst certificatesApi_1 = require(\"./certificatesApi\");\ntslib_1.__exportStar(require(\"./certificatesV1Api\"), exports);\nconst certificatesV1Api_1 = require(\"./certificatesV1Api\");\ntslib_1.__exportStar(require(\"./coordinationApi\"), exports);\nconst coordinationApi_1 = require(\"./coordinationApi\");\ntslib_1.__exportStar(require(\"./coordinationV1Api\"), exports);\nconst coordinationV1Api_1 = require(\"./coordinationV1Api\");\ntslib_1.__exportStar(require(\"./coreApi\"), exports);\nconst coreApi_1 = require(\"./coreApi\");\ntslib_1.__exportStar(require(\"./coreV1Api\"), exports);\nconst coreV1Api_1 = require(\"./coreV1Api\");\ntslib_1.__exportStar(require(\"./customObjectsApi\"), exports);\nconst customObjectsApi_1 = require(\"./customObjectsApi\");\ntslib_1.__exportStar(require(\"./discoveryApi\"), exports);\nconst discoveryApi_1 = require(\"./discoveryApi\");\ntslib_1.__exportStar(require(\"./discoveryV1Api\"), exports);\nconst discoveryV1Api_1 = require(\"./discoveryV1Api\");\ntslib_1.__exportStar(require(\"./discoveryV1beta1Api\"), exports);\nconst discoveryV1beta1Api_1 = require(\"./discoveryV1beta1Api\");\ntslib_1.__exportStar(require(\"./eventsApi\"), exports);\nconst eventsApi_1 = require(\"./eventsApi\");\ntslib_1.__exportStar(require(\"./eventsV1Api\"), exports);\nconst eventsV1Api_1 = require(\"./eventsV1Api\");\ntslib_1.__exportStar(require(\"./eventsV1beta1Api\"), exports);\nconst eventsV1beta1Api_1 = require(\"./eventsV1beta1Api\");\ntslib_1.__exportStar(require(\"./flowcontrolApiserverApi\"), exports);\nconst flowcontrolApiserverApi_1 = require(\"./flowcontrolApiserverApi\");\ntslib_1.__exportStar(require(\"./flowcontrolApiserverV1beta1Api\"), exports);\nconst flowcontrolApiserverV1beta1Api_1 = require(\"./flowcontrolApiserverV1beta1Api\");\ntslib_1.__exportStar(require(\"./internalApiserverApi\"), exports);\nconst internalApiserverApi_1 = require(\"./internalApiserverApi\");\ntslib_1.__exportStar(require(\"./internalApiserverV1alpha1Api\"), exports);\nconst internalApiserverV1alpha1Api_1 = require(\"./internalApiserverV1alpha1Api\");\ntslib_1.__exportStar(require(\"./logsApi\"), exports);\nconst logsApi_1 = require(\"./logsApi\");\ntslib_1.__exportStar(require(\"./networkingApi\"), exports);\nconst networkingApi_1 = require(\"./networkingApi\");\ntslib_1.__exportStar(require(\"./networkingV1Api\"), exports);\nconst networkingV1Api_1 = require(\"./networkingV1Api\");\ntslib_1.__exportStar(require(\"./nodeApi\"), exports);\nconst nodeApi_1 = require(\"./nodeApi\");\ntslib_1.__exportStar(require(\"./nodeV1Api\"), exports);\nconst nodeV1Api_1 = require(\"./nodeV1Api\");\ntslib_1.__exportStar(require(\"./nodeV1alpha1Api\"), exports);\nconst nodeV1alpha1Api_1 = require(\"./nodeV1alpha1Api\");\ntslib_1.__exportStar(require(\"./nodeV1beta1Api\"), exports);\nconst nodeV1beta1Api_1 = require(\"./nodeV1beta1Api\");\ntslib_1.__exportStar(require(\"./openidApi\"), exports);\nconst openidApi_1 = require(\"./openidApi\");\ntslib_1.__exportStar(require(\"./policyApi\"), exports);\nconst policyApi_1 = require(\"./policyApi\");\ntslib_1.__exportStar(require(\"./policyV1Api\"), exports);\nconst policyV1Api_1 = require(\"./policyV1Api\");\ntslib_1.__exportStar(require(\"./policyV1beta1Api\"), exports);\nconst policyV1beta1Api_1 = require(\"./policyV1beta1Api\");\ntslib_1.__exportStar(require(\"./rbacAuthorizationApi\"), exports);\nconst rbacAuthorizationApi_1 = require(\"./rbacAuthorizationApi\");\ntslib_1.__exportStar(require(\"./rbacAuthorizationV1Api\"), exports);\nconst rbacAuthorizationV1Api_1 = require(\"./rbacAuthorizationV1Api\");\ntslib_1.__exportStar(require(\"./rbacAuthorizationV1alpha1Api\"), exports);\nconst rbacAuthorizationV1alpha1Api_1 = require(\"./rbacAuthorizationV1alpha1Api\");\ntslib_1.__exportStar(require(\"./schedulingApi\"), exports);\nconst schedulingApi_1 = require(\"./schedulingApi\");\ntslib_1.__exportStar(require(\"./schedulingV1Api\"), exports);\nconst schedulingV1Api_1 = require(\"./schedulingV1Api\");\ntslib_1.__exportStar(require(\"./schedulingV1alpha1Api\"), exports);\nconst schedulingV1alpha1Api_1 = require(\"./schedulingV1alpha1Api\");\ntslib_1.__exportStar(require(\"./storageApi\"), exports);\nconst storageApi_1 = require(\"./storageApi\");\ntslib_1.__exportStar(require(\"./storageV1Api\"), exports);\nconst storageV1Api_1 = require(\"./storageV1Api\");\ntslib_1.__exportStar(require(\"./storageV1alpha1Api\"), exports);\nconst storageV1alpha1Api_1 = require(\"./storageV1alpha1Api\");\ntslib_1.__exportStar(require(\"./storageV1beta1Api\"), exports);\nconst storageV1beta1Api_1 = require(\"./storageV1beta1Api\");\ntslib_1.__exportStar(require(\"./versionApi\"), exports);\nconst versionApi_1 = require(\"./versionApi\");\ntslib_1.__exportStar(require(\"./wellKnownApi\"), exports);\nconst wellKnownApi_1 = require(\"./wellKnownApi\");\nclass HttpError extends Error {\n constructor(response, body, statusCode) {\n super('HTTP request failed');\n this.response = response;\n this.body = body;\n this.statusCode = statusCode;\n this.name = 'HttpError';\n }\n}\nexports.HttpError = HttpError;\nexports.APIS = [admissionregistrationApi_1.AdmissionregistrationApi, admissionregistrationV1Api_1.AdmissionregistrationV1Api, apiextensionsApi_1.ApiextensionsApi, apiextensionsV1Api_1.ApiextensionsV1Api, apiregistrationApi_1.ApiregistrationApi, apiregistrationV1Api_1.ApiregistrationV1Api, apisApi_1.ApisApi, appsApi_1.AppsApi, appsV1Api_1.AppsV1Api, authenticationApi_1.AuthenticationApi, authenticationV1Api_1.AuthenticationV1Api, authorizationApi_1.AuthorizationApi, authorizationV1Api_1.AuthorizationV1Api, autoscalingApi_1.AutoscalingApi, autoscalingV1Api_1.AutoscalingV1Api, autoscalingV2beta1Api_1.AutoscalingV2beta1Api, autoscalingV2beta2Api_1.AutoscalingV2beta2Api, batchApi_1.BatchApi, batchV1Api_1.BatchV1Api, batchV1beta1Api_1.BatchV1beta1Api, certificatesApi_1.CertificatesApi, certificatesV1Api_1.CertificatesV1Api, coordinationApi_1.CoordinationApi, coordinationV1Api_1.CoordinationV1Api, coreApi_1.CoreApi, coreV1Api_1.CoreV1Api, customObjectsApi_1.CustomObjectsApi, discoveryApi_1.DiscoveryApi, discoveryV1Api_1.DiscoveryV1Api, discoveryV1beta1Api_1.DiscoveryV1beta1Api, eventsApi_1.EventsApi, eventsV1Api_1.EventsV1Api, eventsV1beta1Api_1.EventsV1beta1Api, flowcontrolApiserverApi_1.FlowcontrolApiserverApi, flowcontrolApiserverV1beta1Api_1.FlowcontrolApiserverV1beta1Api, internalApiserverApi_1.InternalApiserverApi, internalApiserverV1alpha1Api_1.InternalApiserverV1alpha1Api, logsApi_1.LogsApi, networkingApi_1.NetworkingApi, networkingV1Api_1.NetworkingV1Api, nodeApi_1.NodeApi, nodeV1Api_1.NodeV1Api, nodeV1alpha1Api_1.NodeV1alpha1Api, nodeV1beta1Api_1.NodeV1beta1Api, openidApi_1.OpenidApi, policyApi_1.PolicyApi, policyV1Api_1.PolicyV1Api, policyV1beta1Api_1.PolicyV1beta1Api, rbacAuthorizationApi_1.RbacAuthorizationApi, rbacAuthorizationV1Api_1.RbacAuthorizationV1Api, rbacAuthorizationV1alpha1Api_1.RbacAuthorizationV1alpha1Api, schedulingApi_1.SchedulingApi, schedulingV1Api_1.SchedulingV1Api, schedulingV1alpha1Api_1.SchedulingV1alpha1Api, storageApi_1.StorageApi, storageV1Api_1.StorageV1Api, storageV1alpha1Api_1.StorageV1alpha1Api, storageV1beta1Api_1.StorageV1beta1Api, versionApi_1.VersionApi, wellKnownApi_1.WellKnownApi];\n//# sourceMappingURL=apis.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ApisApi = exports.ApisApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar ApisApiApiKeys;\n(function (ApisApiApiKeys) {\n ApisApiApiKeys[ApisApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(ApisApiApiKeys = exports.ApisApiApiKeys || (exports.ApisApiApiKeys = {}));\nclass ApisApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[ApisApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get available API versions\n */\n async getAPIVersions(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroupList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.ApisApi = ApisApi;\n//# sourceMappingURL=apisApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AppsApi = exports.AppsApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AppsApiApiKeys;\n(function (AppsApiApiKeys) {\n AppsApiApiKeys[AppsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AppsApiApiKeys = exports.AppsApiApiKeys || (exports.AppsApiApiKeys = {}));\nclass AppsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AppsApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AppsApi = AppsApi;\n//# sourceMappingURL=appsApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AppsV1Api = exports.AppsV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AppsV1ApiApiKeys;\n(function (AppsV1ApiApiKeys) {\n AppsV1ApiApiKeys[AppsV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AppsV1ApiApiKeys = exports.AppsV1ApiApiKeys || (exports.AppsV1ApiApiKeys = {}));\nclass AppsV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AppsV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedControllerRevision(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ControllerRevision\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ControllerRevision\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedDaemonSet(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DaemonSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedDeployment(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Deployment\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Deployment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedReplicaSet(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ReplicaSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedStatefulSet(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1StatefulSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedControllerRevision(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedDaemonSet(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedDeployment(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedReplicaSet(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedStatefulSet(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedControllerRevision(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedDaemonSet(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedDeployment(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedReplicaSet(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedStatefulSet(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ControllerRevision\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listControllerRevisionForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/controllerrevisions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ControllerRevisionList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind DaemonSet\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listDaemonSetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/daemonsets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listDeploymentForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/deployments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DeploymentList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedControllerRevision(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ControllerRevisionList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedDaemonSet(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedDeployment(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DeploymentList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedReplicaSet(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedStatefulSet(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ReplicaSet\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listReplicaSetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/replicasets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind StatefulSet\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listStatefulSetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/statefulsets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedControllerRevision(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ControllerRevision\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedDaemonSet(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedDeployment(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Deployment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Deployment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedReplicaSet(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedStatefulSet(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedControllerRevision(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ControllerRevision\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedDaemonSet(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedDaemonSetStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedDeployment(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Deployment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedDeploymentScale(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedDeploymentStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Deployment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedReplicaSet(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedReplicaSetScale(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedReplicaSetStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedStatefulSet(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedStatefulSetScale(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedStatefulSetStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ControllerRevision\n * @param name name of the ControllerRevision\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedControllerRevision(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedControllerRevision.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ControllerRevision\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ControllerRevision\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedDaemonSet(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DaemonSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified DaemonSet\n * @param name name of the DaemonSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedDaemonSetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/daemonsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDaemonSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DaemonSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1DaemonSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedDeployment(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeployment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeployment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Deployment\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Deployment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace scale of the specified Deployment\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedDeploymentScale(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Scale\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified Deployment\n * @param name name of the Deployment\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedDeploymentStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/deployments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedDeploymentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Deployment\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Deployment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedReplicaSet(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ReplicaSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace scale of the specified ReplicaSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedReplicaSetScale(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Scale\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified ReplicaSet\n * @param name name of the ReplicaSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedReplicaSetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/replicasets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicaSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ReplicaSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicaSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedStatefulSet(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSet.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1StatefulSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace scale of the specified StatefulSet\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedStatefulSetScale(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Scale\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified StatefulSet\n * @param name name of the StatefulSet\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedStatefulSetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/apps/v1/namespaces/{namespace}/statefulsets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedStatefulSetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1StatefulSet\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StatefulSet\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AppsV1Api = AppsV1Api;\n//# sourceMappingURL=appsV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthenticationApi = exports.AuthenticationApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AuthenticationApiApiKeys;\n(function (AuthenticationApiApiKeys) {\n AuthenticationApiApiKeys[AuthenticationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthenticationApiApiKeys = exports.AuthenticationApiApiKeys || (exports.AuthenticationApiApiKeys = {}));\nclass AuthenticationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthenticationApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authentication.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AuthenticationApi = AuthenticationApi;\n//# sourceMappingURL=authenticationApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthenticationV1Api = exports.AuthenticationV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AuthenticationV1ApiApiKeys;\n(function (AuthenticationV1ApiApiKeys) {\n AuthenticationV1ApiApiKeys[AuthenticationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthenticationV1ApiApiKeys = exports.AuthenticationV1ApiApiKeys || (exports.AuthenticationV1ApiApiKeys = {}));\nclass AuthenticationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthenticationV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a TokenReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createTokenReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1/tokenreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createTokenReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1TokenReview\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1TokenReview\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authentication.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AuthenticationV1Api = AuthenticationV1Api;\n//# sourceMappingURL=authenticationV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthorizationApi = exports.AuthorizationApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AuthorizationApiApiKeys;\n(function (AuthorizationApiApiKeys) {\n AuthorizationApiApiKeys[AuthorizationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthorizationApiApiKeys = exports.AuthorizationApiApiKeys || (exports.AuthorizationApiApiKeys = {}));\nclass AuthorizationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthorizationApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AuthorizationApi = AuthorizationApi;\n//# sourceMappingURL=authorizationApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthorizationV1Api = exports.AuthorizationV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AuthorizationV1ApiApiKeys;\n(function (AuthorizationV1ApiApiKeys) {\n AuthorizationV1ApiApiKeys[AuthorizationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AuthorizationV1ApiApiKeys = exports.AuthorizationV1ApiApiKeys || (exports.AuthorizationV1ApiApiKeys = {}));\nclass AuthorizationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AuthorizationV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a LocalSubjectAccessReview\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createNamespacedLocalSubjectAccessReview(namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLocalSubjectAccessReview.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedLocalSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1LocalSubjectAccessReview\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LocalSubjectAccessReview\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a SelfSubjectAccessReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createSelfSubjectAccessReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/selfsubjectaccessreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSelfSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1SelfSubjectAccessReview\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1SelfSubjectAccessReview\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a SelfSubjectRulesReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createSelfSubjectRulesReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/selfsubjectrulesreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSelfSubjectRulesReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1SelfSubjectRulesReview\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1SelfSubjectRulesReview\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a SubjectAccessReview\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createSubjectAccessReview(body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/subjectaccessreviews';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createSubjectAccessReview.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1SubjectAccessReview\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1SubjectAccessReview\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/authorization.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AuthorizationV1Api = AuthorizationV1Api;\n//# sourceMappingURL=authorizationV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AutoscalingApi = exports.AutoscalingApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AutoscalingApiApiKeys;\n(function (AutoscalingApiApiKeys) {\n AutoscalingApiApiKeys[AutoscalingApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AutoscalingApiApiKeys = exports.AutoscalingApiApiKeys || (exports.AutoscalingApiApiKeys = {}));\nclass AutoscalingApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AutoscalingApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AutoscalingApi = AutoscalingApi;\n//# sourceMappingURL=autoscalingApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AutoscalingV1Api = exports.AutoscalingV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AutoscalingV1ApiApiKeys;\n(function (AutoscalingV1ApiApiKeys) {\n AutoscalingV1ApiApiKeys[AutoscalingV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AutoscalingV1ApiApiKeys = exports.AutoscalingV1ApiApiKeys || (exports.AutoscalingV1ApiApiKeys = {}));\nclass AutoscalingV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AutoscalingV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedHorizontalPodAutoscaler(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listHorizontalPodAutoscalerForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/horizontalpodautoscalers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscalerList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedHorizontalPodAutoscaler(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscalerList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AutoscalingV1Api = AutoscalingV1Api;\n//# sourceMappingURL=autoscalingV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AutoscalingV2beta1Api = exports.AutoscalingV2beta1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AutoscalingV2beta1ApiApiKeys;\n(function (AutoscalingV2beta1ApiApiKeys) {\n AutoscalingV2beta1ApiApiKeys[AutoscalingV2beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AutoscalingV2beta1ApiApiKeys = exports.AutoscalingV2beta1ApiApiKeys || (exports.AutoscalingV2beta1ApiApiKeys = {}));\nclass AutoscalingV2beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AutoscalingV2beta1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedHorizontalPodAutoscaler(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V2beta1HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listHorizontalPodAutoscalerForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/horizontalpodautoscalers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscalerList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedHorizontalPodAutoscaler(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscalerList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V2beta1HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V2beta1HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta1HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AutoscalingV2beta1Api = AutoscalingV2beta1Api;\n//# sourceMappingURL=autoscalingV2beta1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AutoscalingV2beta2Api = exports.AutoscalingV2beta2ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar AutoscalingV2beta2ApiApiKeys;\n(function (AutoscalingV2beta2ApiApiKeys) {\n AutoscalingV2beta2ApiApiKeys[AutoscalingV2beta2ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(AutoscalingV2beta2ApiApiKeys = exports.AutoscalingV2beta2ApiApiKeys || (exports.AutoscalingV2beta2ApiApiKeys = {}));\nclass AutoscalingV2beta2Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[AutoscalingV2beta2ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedHorizontalPodAutoscaler(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V2beta2HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedHorizontalPodAutoscaler(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedHorizontalPodAutoscaler(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listHorizontalPodAutoscalerForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/horizontalpodautoscalers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscalerList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedHorizontalPodAutoscaler(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscalerList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedHorizontalPodAutoscaler(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedHorizontalPodAutoscalerStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedHorizontalPodAutoscaler(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscaler.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V2beta2HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified HorizontalPodAutoscaler\n * @param name name of the HorizontalPodAutoscaler\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedHorizontalPodAutoscalerStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/autoscaling/v2beta2/namespaces/{namespace}/horizontalpodautoscalers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedHorizontalPodAutoscalerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V2beta2HorizontalPodAutoscaler\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V2beta2HorizontalPodAutoscaler\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.AutoscalingV2beta2Api = AutoscalingV2beta2Api;\n//# sourceMappingURL=autoscalingV2beta2Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BatchApi = exports.BatchApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar BatchApiApiKeys;\n(function (BatchApiApiKeys) {\n BatchApiApiKeys[BatchApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(BatchApiApiKeys = exports.BatchApiApiKeys || (exports.BatchApiApiKeys = {}));\nclass BatchApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[BatchApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.BatchApi = BatchApi;\n//# sourceMappingURL=batchApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BatchV1Api = exports.BatchV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar BatchV1ApiApiKeys;\n(function (BatchV1ApiApiKeys) {\n BatchV1ApiApiKeys[BatchV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(BatchV1ApiApiKeys = exports.BatchV1ApiApiKeys || (exports.BatchV1ApiApiKeys = {}));\nclass BatchV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[BatchV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedCronJob(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CronJob\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedJob(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Job\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Job\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedCronJob(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedJob(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedCronJob(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedJob(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CronJob\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listCronJobForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/cronjobs';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJobList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Job\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listJobForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/jobs';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1JobList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedCronJob(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJobList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedJob(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1JobList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedJob(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Job\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedJobStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Job\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedCronJob(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedCronJobStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedJob(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Job\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedJobStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Job\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CronJob\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CronJob\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedJob(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Job\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Job\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified Job\n * @param name name of the Job\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedJobStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1/namespaces/{namespace}/jobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Job\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Job\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.BatchV1Api = BatchV1Api;\n//# sourceMappingURL=batchV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BatchV1beta1Api = exports.BatchV1beta1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar BatchV1beta1ApiApiKeys;\n(function (BatchV1beta1ApiApiKeys) {\n BatchV1beta1ApiApiKeys[BatchV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(BatchV1beta1ApiApiKeys = exports.BatchV1beta1ApiApiKeys || (exports.BatchV1beta1ApiApiKeys = {}));\nclass BatchV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[BatchV1beta1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedCronJob(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1CronJob\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedCronJob(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedCronJob(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CronJob\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listCronJobForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/cronjobs';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJobList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedCronJob(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJobList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedCronJob(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedCronJobStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCronJob(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJob.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJob.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJob.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1CronJob\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified CronJob\n * @param name name of the CronJob\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCronJobStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/batch/v1beta1/namespaces/{namespace}/cronjobs/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCronJobStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1CronJob\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CronJob\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.BatchV1beta1Api = BatchV1beta1Api;\n//# sourceMappingURL=batchV1beta1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CertificatesApi = exports.CertificatesApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar CertificatesApiApiKeys;\n(function (CertificatesApiApiKeys) {\n CertificatesApiApiKeys[CertificatesApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CertificatesApiApiKeys = exports.CertificatesApiApiKeys || (exports.CertificatesApiApiKeys = {}));\nclass CertificatesApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CertificatesApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.CertificatesApi = CertificatesApi;\n//# sourceMappingURL=certificatesApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CertificatesV1Api = exports.CertificatesV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar CertificatesV1ApiApiKeys;\n(function (CertificatesV1ApiApiKeys) {\n CertificatesV1ApiApiKeys[CertificatesV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CertificatesV1ApiApiKeys = exports.CertificatesV1ApiApiKeys || (exports.CertificatesV1ApiApiKeys = {}));\nclass CertificatesV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CertificatesV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a CertificateSigningRequest\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createCertificateSigningRequest(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CertificateSigningRequest\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteCertificateSigningRequest(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of CertificateSigningRequest\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionCertificateSigningRequest(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CertificateSigningRequest\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listCertificateSigningRequest(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequestList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchCertificateSigningRequest(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequest.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update approval of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchCertificateSigningRequestApproval(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequestApproval.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequestApproval.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchCertificateSigningRequestStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCertificateSigningRequestStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCertificateSigningRequestStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readCertificateSigningRequest(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read approval of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readCertificateSigningRequestApproval(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequestApproval.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readCertificateSigningRequestStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCertificateSigningRequestStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceCertificateSigningRequest(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequest.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequest.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CertificateSigningRequest\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace approval of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceCertificateSigningRequestApproval(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestApproval.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestApproval.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CertificateSigningRequest\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified CertificateSigningRequest\n * @param name name of the CertificateSigningRequest\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceCertificateSigningRequestStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCertificateSigningRequestStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCertificateSigningRequestStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CertificateSigningRequest\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CertificateSigningRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.CertificatesV1Api = CertificatesV1Api;\n//# sourceMappingURL=certificatesV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CoordinationApi = exports.CoordinationApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar CoordinationApiApiKeys;\n(function (CoordinationApiApiKeys) {\n CoordinationApiApiKeys[CoordinationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CoordinationApiApiKeys = exports.CoordinationApiApiKeys || (exports.CoordinationApiApiKeys = {}));\nclass CoordinationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CoordinationApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.CoordinationApi = CoordinationApi;\n//# sourceMappingURL=coordinationApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CoordinationV1Api = exports.CoordinationV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar CoordinationV1ApiApiKeys;\n(function (CoordinationV1ApiApiKeys) {\n CoordinationV1ApiApiKeys[CoordinationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CoordinationV1ApiApiKeys = exports.CoordinationV1ApiApiKeys || (exports.CoordinationV1ApiApiKeys = {}));\nclass CoordinationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CoordinationV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedLease(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLease.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Lease\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Lease\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedLease(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Lease\n * @param name name of the Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedLease(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLease.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Lease\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listLeaseForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/leases';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LeaseList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedLease(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LeaseList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Lease\n * @param name name of the Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedLease(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedLease.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLease.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Lease\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Lease\n * @param name name of the Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedLease(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedLease.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Lease\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Lease\n * @param name name of the Lease\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedLease(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLease.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLease.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLease.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Lease\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Lease\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.CoordinationV1Api = CoordinationV1Api;\n//# sourceMappingURL=coordinationV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CoreApi = exports.CoreApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar CoreApiApiKeys;\n(function (CoreApiApiKeys) {\n CoreApiApiKeys[CoreApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CoreApiApiKeys = exports.CoreApiApiKeys || (exports.CoreApiApiKeys = {}));\nclass CoreApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CoreApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get available API versions\n */\n async getAPIVersions(options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIVersions\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.CoreApi = CoreApi;\n//# sourceMappingURL=coreApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CoreV1Api = exports.CoreV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar CoreV1ApiApiKeys;\n(function (CoreV1ApiApiKeys) {\n CoreV1ApiApiKeys[CoreV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CoreV1ApiApiKeys = exports.CoreV1ApiApiKeys || (exports.CoreV1ApiApiKeys = {}));\nclass CoreV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CoreV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * connect DELETE requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n */\n async connectDeleteNamespacedPodProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n */\n async connectDeleteNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectDeleteNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectDeleteNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectDeleteNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectDeleteNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n */\n async connectDeleteNodeProxy(name, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect DELETE requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n */\n async connectDeleteNodeProxyWithPath(name, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectDeleteNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectDeleteNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to attach of Pod\n * @param name name of the PodAttachOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param container The container in which to execute the command. Defaults to only container if there is only one container in the pod.\n * @param stderr Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true.\n * @param stdin Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false.\n * @param stdout Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true.\n * @param tty TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false.\n */\n async connectGetNamespacedPodAttach(name, namespace, container, stderr, stdin, stdout, tty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/attach'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodAttach.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodAttach.');\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, \"string\");\n }\n if (stderr !== undefined) {\n localVarQueryParameters['stderr'] = models_1.ObjectSerializer.serialize(stderr, \"boolean\");\n }\n if (stdin !== undefined) {\n localVarQueryParameters['stdin'] = models_1.ObjectSerializer.serialize(stdin, \"boolean\");\n }\n if (stdout !== undefined) {\n localVarQueryParameters['stdout'] = models_1.ObjectSerializer.serialize(stdout, \"boolean\");\n }\n if (tty !== undefined) {\n localVarQueryParameters['tty'] = models_1.ObjectSerializer.serialize(tty, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to exec of Pod\n * @param name name of the PodExecOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param command Command is the remote command to execute. argv array. Not executed within a shell.\n * @param container Container in which to execute the command. Defaults to only container if there is only one container in the pod.\n * @param stderr Redirect the standard error stream of the pod for this call. Defaults to true.\n * @param stdin Redirect the standard input stream of the pod for this call. Defaults to false.\n * @param stdout Redirect the standard output stream of the pod for this call. Defaults to true.\n * @param tty TTY if true indicates that a tty will be allocated for the exec call. Defaults to false.\n */\n async connectGetNamespacedPodExec(name, namespace, command, container, stderr, stdin, stdout, tty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/exec'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodExec.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodExec.');\n }\n if (command !== undefined) {\n localVarQueryParameters['command'] = models_1.ObjectSerializer.serialize(command, \"string\");\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, \"string\");\n }\n if (stderr !== undefined) {\n localVarQueryParameters['stderr'] = models_1.ObjectSerializer.serialize(stderr, \"boolean\");\n }\n if (stdin !== undefined) {\n localVarQueryParameters['stdin'] = models_1.ObjectSerializer.serialize(stdin, \"boolean\");\n }\n if (stdout !== undefined) {\n localVarQueryParameters['stdout'] = models_1.ObjectSerializer.serialize(stdout, \"boolean\");\n }\n if (tty !== undefined) {\n localVarQueryParameters['tty'] = models_1.ObjectSerializer.serialize(tty, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to portforward of Pod\n * @param name name of the PodPortForwardOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param ports List of ports to forward Required when using WebSockets\n */\n async connectGetNamespacedPodPortforward(name, namespace, ports, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/portforward'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodPortforward.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodPortforward.');\n }\n if (ports !== undefined) {\n localVarQueryParameters['ports'] = models_1.ObjectSerializer.serialize(ports, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n */\n async connectGetNamespacedPodProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n */\n async connectGetNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectGetNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectGetNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectGetNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectGetNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectGetNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n */\n async connectGetNodeProxy(name, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect GET requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n */\n async connectGetNodeProxyWithPath(name, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectGetNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectGetNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n */\n async connectHeadNamespacedPodProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n */\n async connectHeadNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectHeadNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectHeadNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectHeadNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectHeadNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n */\n async connectHeadNodeProxy(name, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect HEAD requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n */\n async connectHeadNodeProxyWithPath(name, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectHeadNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectHeadNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'HEAD',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n */\n async connectOptionsNamespacedPodProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n */\n async connectOptionsNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectOptionsNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectOptionsNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectOptionsNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectOptionsNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n */\n async connectOptionsNodeProxy(name, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect OPTIONS requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n */\n async connectOptionsNodeProxyWithPath(name, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectOptionsNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectOptionsNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'OPTIONS',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n */\n async connectPatchNamespacedPodProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n */\n async connectPatchNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPatchNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectPatchNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectPatchNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPatchNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n */\n async connectPatchNodeProxy(name, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PATCH requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n */\n async connectPatchNodeProxyWithPath(name, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPatchNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPatchNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to attach of Pod\n * @param name name of the PodAttachOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param container The container in which to execute the command. Defaults to only container if there is only one container in the pod.\n * @param stderr Stderr if true indicates that stderr is to be redirected for the attach call. Defaults to true.\n * @param stdin Stdin if true, redirects the standard input stream of the pod for this call. Defaults to false.\n * @param stdout Stdout if true indicates that stdout is to be redirected for the attach call. Defaults to true.\n * @param tty TTY if true indicates that a tty will be allocated for the attach call. This is passed through the container runtime so the tty is allocated on the worker node by the container runtime. Defaults to false.\n */\n async connectPostNamespacedPodAttach(name, namespace, container, stderr, stdin, stdout, tty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/attach'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodAttach.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodAttach.');\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, \"string\");\n }\n if (stderr !== undefined) {\n localVarQueryParameters['stderr'] = models_1.ObjectSerializer.serialize(stderr, \"boolean\");\n }\n if (stdin !== undefined) {\n localVarQueryParameters['stdin'] = models_1.ObjectSerializer.serialize(stdin, \"boolean\");\n }\n if (stdout !== undefined) {\n localVarQueryParameters['stdout'] = models_1.ObjectSerializer.serialize(stdout, \"boolean\");\n }\n if (tty !== undefined) {\n localVarQueryParameters['tty'] = models_1.ObjectSerializer.serialize(tty, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to exec of Pod\n * @param name name of the PodExecOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param command Command is the remote command to execute. argv array. Not executed within a shell.\n * @param container Container in which to execute the command. Defaults to only container if there is only one container in the pod.\n * @param stderr Redirect the standard error stream of the pod for this call. Defaults to true.\n * @param stdin Redirect the standard input stream of the pod for this call. Defaults to false.\n * @param stdout Redirect the standard output stream of the pod for this call. Defaults to true.\n * @param tty TTY if true indicates that a tty will be allocated for the exec call. Defaults to false.\n */\n async connectPostNamespacedPodExec(name, namespace, command, container, stderr, stdin, stdout, tty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/exec'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodExec.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodExec.');\n }\n if (command !== undefined) {\n localVarQueryParameters['command'] = models_1.ObjectSerializer.serialize(command, \"string\");\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, \"string\");\n }\n if (stderr !== undefined) {\n localVarQueryParameters['stderr'] = models_1.ObjectSerializer.serialize(stderr, \"boolean\");\n }\n if (stdin !== undefined) {\n localVarQueryParameters['stdin'] = models_1.ObjectSerializer.serialize(stdin, \"boolean\");\n }\n if (stdout !== undefined) {\n localVarQueryParameters['stdout'] = models_1.ObjectSerializer.serialize(stdout, \"boolean\");\n }\n if (tty !== undefined) {\n localVarQueryParameters['tty'] = models_1.ObjectSerializer.serialize(tty, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to portforward of Pod\n * @param name name of the PodPortForwardOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param ports List of ports to forward Required when using WebSockets\n */\n async connectPostNamespacedPodPortforward(name, namespace, ports, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/portforward'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodPortforward.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodPortforward.');\n }\n if (ports !== undefined) {\n localVarQueryParameters['ports'] = models_1.ObjectSerializer.serialize(ports, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n */\n async connectPostNamespacedPodProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n */\n async connectPostNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPostNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectPostNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectPostNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPostNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPostNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n */\n async connectPostNodeProxy(name, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect POST requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n */\n async connectPostNodeProxyWithPath(name, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPostNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPostNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PUT requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the URL path to use for the current proxy request to pod.\n */\n async connectPutNamespacedPodProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedPodProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedPodProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PUT requests to proxy of Pod\n * @param name name of the PodProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to pod.\n */\n async connectPutNamespacedPodProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedPodProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPutNamespacedPodProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PUT requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectPutNamespacedServiceProxy(name, namespace, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedServiceProxy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedServiceProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PUT requests to proxy of Service\n * @param name name of the ServiceProxyOptions\n * @param namespace object name and auth scope, such as for teams and projects\n * @param path path to the resource\n * @param path2 Path is the part of URLs that include service endpoints, suffixes, and parameters to use for the current proxy request to service. For example, the whole request URL is http://localhost/api/v1/namespaces/kube-system/services/elasticsearch-logging/_search?q=user:kimchy. Path is _search?q=user:kimchy.\n */\n async connectPutNamespacedServiceProxyWithPath(name, namespace, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling connectPutNamespacedServiceProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPutNamespacedServiceProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PUT requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path Path is the URL path to use for the current proxy request to node.\n */\n async connectPutNodeProxy(name, path, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNodeProxy.');\n }\n if (path !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * connect PUT requests to proxy of Node\n * @param name name of the NodeProxyOptions\n * @param path path to the resource\n * @param path2 Path is the URL path to use for the current proxy request to node.\n */\n async connectPutNodeProxyWithPath(name, path, path2, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/proxy/{path}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'path' + '}', encodeURIComponent(String(path)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['*/*'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling connectPutNodeProxyWithPath.');\n }\n // verify required parameter 'path' is not null or undefined\n if (path === null || path === undefined) {\n throw new Error('Required parameter path was null or undefined when calling connectPutNodeProxyWithPath.');\n }\n if (path2 !== undefined) {\n localVarQueryParameters['path'] = models_1.ObjectSerializer.serialize(path2, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Namespace\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespace(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Namespace\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Namespace\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Binding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createNamespacedBinding(namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/bindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedBinding.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Binding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Binding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedConfigMap(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedConfigMap.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ConfigMap\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ConfigMap\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedEndpoints(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEndpoints.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Endpoints\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Endpoints\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create an Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedEvent(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"CoreV1Event\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"CoreV1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedLimitRange(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedLimitRange.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1LimitRange\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LimitRange\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedPersistentVolumeClaim(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PersistentVolumeClaim\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedPod(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPod.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Pod\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create binding of a Pod\n * @param name name of the Binding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createNamespacedPodBinding(name, namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/binding'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling createNamespacedPodBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodBinding.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Binding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Binding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create eviction of a Pod\n * @param name name of the Eviction\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createNamespacedPodEviction(name, namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/eviction'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling createNamespacedPodEviction.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodEviction.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodEviction.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Eviction\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Eviction\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedPodTemplate(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodTemplate.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PodTemplate\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedReplicationController(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedReplicationController.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ReplicationController\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedResourceQuota(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedResourceQuota.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ResourceQuota\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedSecret(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedSecret.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Secret\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Secret\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedService(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Service\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Service\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedServiceAccount(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedServiceAccount.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ServiceAccount\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create token of a ServiceAccount\n * @param name name of the TokenRequest\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async createNamespacedServiceAccountToken(name, namespace, body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}/token'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling createNamespacedServiceAccountToken.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedServiceAccountToken.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedServiceAccountToken.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"AuthenticationV1TokenRequest\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"AuthenticationV1TokenRequest\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Node\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNode(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Node\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Node\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a PersistentVolume\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createPersistentVolume(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PersistentVolume\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedConfigMap(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedEndpoints(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedEvent(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedLimitRange(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedPersistentVolumeClaim(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedPod(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedPodTemplate(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedReplicationController(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedResourceQuota(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedSecret(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedServiceAccount(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Node\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNode(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PersistentVolume\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionPersistentVolume(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Namespace\n * @param name name of the Namespace\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespace(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ConfigMap\n * @param name name of the ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedConfigMap(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedConfigMap.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete Endpoints\n * @param name name of the Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedEndpoints(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEndpoints.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete an Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedEvent(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a LimitRange\n * @param name name of the LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedLimitRange(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedLimitRange.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedPersistentVolumeClaim(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedPod(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPod.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PodTemplate\n * @param name name of the PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedPodTemplate(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodTemplate.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedReplicationController(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedResourceQuota(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedResourceQuota.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Secret\n * @param name name of the Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedSecret(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedSecret.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedService(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedService.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ServiceAccount\n * @param name name of the ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedServiceAccount(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedServiceAccount.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Node\n * @param name name of the Node\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNode(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PersistentVolume\n * @param name name of the PersistentVolume\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deletePersistentVolume(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list objects of kind ComponentStatus\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listComponentStatus(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/componentstatuses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ComponentStatusList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ConfigMap\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listConfigMapForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/configmaps';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ConfigMapList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Endpoints\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listEndpointsForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/endpoints';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1EndpointsList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listEventForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/events';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"CoreV1EventList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind LimitRange\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listLimitRangeForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/limitranges';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LimitRangeList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Namespace\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespace(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1NamespaceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedConfigMap(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ConfigMapList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedEndpoints(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1EndpointsList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedEvent(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"CoreV1EventList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedLimitRange(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LimitRangeList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedPersistentVolumeClaim(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaimList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedPod(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedPodTemplate(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodTemplateList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedReplicationController(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationControllerList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedResourceQuota(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuotaList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedSecret(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1SecretList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedService(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedServiceAccount(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceAccountList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Node\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNode(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1NodeList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PersistentVolume\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPersistentVolume(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PersistentVolumeClaim\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPersistentVolumeClaimForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumeclaims';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaimList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Pod\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPodForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/pods';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PodTemplate\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPodTemplateForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/podtemplates';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodTemplateList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ReplicationController\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listReplicationControllerForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/replicationcontrollers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationControllerList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ResourceQuota\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listResourceQuotaForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/resourcequotas';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuotaList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Secret\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listSecretForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/secrets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1SecretList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ServiceAccount\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listServiceAccountForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/serviceaccounts';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceAccountList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Service\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listServiceForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/services';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespace(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespace.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Namespace\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespaceStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespaceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespaceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Namespace\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ConfigMap\n * @param name name of the ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedConfigMap(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedConfigMap.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedConfigMap.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ConfigMap\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Endpoints\n * @param name name of the Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedEndpoints(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEndpoints.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEndpoints.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Endpoints\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"CoreV1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified LimitRange\n * @param name name of the LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedLimitRange(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedLimitRange.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedLimitRange.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LimitRange\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPersistentVolumeClaim(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPersistentVolumeClaimStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPersistentVolumeClaimStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPod(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPod.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPod.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update ephemeralcontainers of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPodEphemeralcontainers(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodEphemeralcontainers.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodEphemeralcontainers.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodEphemeralcontainers.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPodStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PodTemplate\n * @param name name of the PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPodTemplate(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodTemplate.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodTemplate.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedReplicationController(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationController.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update scale of the specified ReplicationController\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedReplicationControllerScale(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedReplicationControllerStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedReplicationControllerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedResourceQuota(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedResourceQuota.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedResourceQuota.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedResourceQuotaStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedResourceQuotaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Secret\n * @param name name of the Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedSecret(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedSecret.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedSecret.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Secret\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedService(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedService.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Service\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ServiceAccount\n * @param name name of the ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedServiceAccount(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedServiceAccount.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedServiceAccount.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedServiceStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedServiceStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Service\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Node\n * @param name name of the Node\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNode(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNode.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Node\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified Node\n * @param name name of the Node\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNodeStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNodeStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNodeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Node\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchPersistentVolume(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPersistentVolume.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchPersistentVolumeStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPersistentVolumeStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPersistentVolumeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ComponentStatus\n * @param name name of the ComponentStatus\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readComponentStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/componentstatuses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readComponentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ComponentStatus\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Namespace\n * @param name name of the Namespace\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespace(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Namespace\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified Namespace\n * @param name name of the Namespace\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespaceStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespaceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Namespace\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ConfigMap\n * @param name name of the ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedConfigMap(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedConfigMap.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ConfigMap\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Endpoints\n * @param name name of the Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedEndpoints(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEndpoints.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Endpoints\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedEvent(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"CoreV1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified LimitRange\n * @param name name of the LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedLimitRange(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedLimitRange.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LimitRange\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPersistentVolumeClaim(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPersistentVolumeClaimStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPersistentVolumeClaimStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPod(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPod.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read ephemeralcontainers of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPodEphemeralcontainers(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodEphemeralcontainers.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodEphemeralcontainers.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read log of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param container The container for which to stream logs. Defaults to only container if there is one container in the pod.\n * @param follow Follow the log stream of the pod. Defaults to false.\n * @param insecureSkipTLSVerifyBackend insecureSkipTLSVerifyBackend indicates that the apiserver should not confirm the validity of the serving certificate of the backend it is connecting to. This will make the HTTPS connection between the apiserver and the backend insecure. This means the apiserver cannot verify the log data it is receiving came from the real kubelet. If the kubelet is configured to verify the apiserver\\'s TLS credentials, it does not mean the connection to the real kubelet is vulnerable to a man in the middle attack (e.g. an attacker could not intercept the actual log data coming from the real kubelet).\n * @param limitBytes If set, the number of bytes to read from the server before terminating the log output. This may not display a complete final line of logging, and may return slightly more or slightly less than the specified limit.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param previous Return previous terminated container logs. Defaults to false.\n * @param sinceSeconds A relative time in seconds before the current time from which to show logs. If this value precedes the time a pod was started, only logs since the pod start will be returned. If this value is in the future, no logs will be returned. Only one of sinceSeconds or sinceTime may be specified.\n * @param tailLines If set, the number of lines from the end of the logs to show. If not specified, logs are shown from the creation of the container or sinceSeconds or sinceTime\n * @param timestamps If true, add an RFC3339 or RFC3339Nano timestamp at the beginning of every line of log output. Defaults to false.\n */\n async readNamespacedPodLog(name, namespace, container, follow, insecureSkipTLSVerifyBackend, limitBytes, pretty, previous, sinceSeconds, tailLines, timestamps, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/log'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['text/plain', 'application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodLog.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodLog.');\n }\n if (container !== undefined) {\n localVarQueryParameters['container'] = models_1.ObjectSerializer.serialize(container, \"string\");\n }\n if (follow !== undefined) {\n localVarQueryParameters['follow'] = models_1.ObjectSerializer.serialize(follow, \"boolean\");\n }\n if (insecureSkipTLSVerifyBackend !== undefined) {\n localVarQueryParameters['insecureSkipTLSVerifyBackend'] = models_1.ObjectSerializer.serialize(insecureSkipTLSVerifyBackend, \"boolean\");\n }\n if (limitBytes !== undefined) {\n localVarQueryParameters['limitBytes'] = models_1.ObjectSerializer.serialize(limitBytes, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (previous !== undefined) {\n localVarQueryParameters['previous'] = models_1.ObjectSerializer.serialize(previous, \"boolean\");\n }\n if (sinceSeconds !== undefined) {\n localVarQueryParameters['sinceSeconds'] = models_1.ObjectSerializer.serialize(sinceSeconds, \"number\");\n }\n if (tailLines !== undefined) {\n localVarQueryParameters['tailLines'] = models_1.ObjectSerializer.serialize(tailLines, \"number\");\n }\n if (timestamps !== undefined) {\n localVarQueryParameters['timestamps'] = models_1.ObjectSerializer.serialize(timestamps, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPodStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PodTemplate\n * @param name name of the PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPodTemplate(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodTemplate.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedReplicationController(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read scale of the specified ReplicationController\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedReplicationControllerScale(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedReplicationControllerStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedReplicationControllerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedResourceQuota(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedResourceQuota.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedResourceQuotaStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedResourceQuotaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Secret\n * @param name name of the Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedSecret(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedSecret.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Secret\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedService(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedService.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Service\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ServiceAccount\n * @param name name of the ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedServiceAccount(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedServiceAccount.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedServiceStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedServiceStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Service\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Node\n * @param name name of the Node\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNode(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Node\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified Node\n * @param name name of the Node\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNodeStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNodeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Node\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readPersistentVolume(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readPersistentVolumeStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPersistentVolumeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespace(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespace.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespace.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Namespace\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Namespace\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace finalize of the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async replaceNamespaceFinalize(name, body, dryRun, fieldManager, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}/finalize'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespaceFinalize.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespaceFinalize.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Namespace\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Namespace\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified Namespace\n * @param name name of the Namespace\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespaceStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespaceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespaceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Namespace\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Namespace\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ConfigMap\n * @param name name of the ConfigMap\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedConfigMap(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/configmaps/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedConfigMap.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedConfigMap.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedConfigMap.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ConfigMap\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ConfigMap\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Endpoints\n * @param name name of the Endpoints\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedEndpoints(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/endpoints/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEndpoints.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEndpoints.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEndpoints.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Endpoints\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Endpoints\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"CoreV1Event\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"CoreV1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified LimitRange\n * @param name name of the LimitRange\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedLimitRange(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/limitranges/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedLimitRange.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedLimitRange.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedLimitRange.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1LimitRange\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1LimitRange\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPersistentVolumeClaim(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPersistentVolumeClaim.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPersistentVolumeClaim.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PersistentVolumeClaim\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified PersistentVolumeClaim\n * @param name name of the PersistentVolumeClaim\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPersistentVolumeClaimStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPersistentVolumeClaimStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PersistentVolumeClaim\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolumeClaim\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPod(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPod.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPod.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPod.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Pod\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace ephemeralcontainers of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPodEphemeralcontainers(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/ephemeralcontainers'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodEphemeralcontainers.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodEphemeralcontainers.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodEphemeralcontainers.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Pod\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified Pod\n * @param name name of the Pod\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPodStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/pods/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Pod\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Pod\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PodTemplate\n * @param name name of the PodTemplate\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPodTemplate(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/podtemplates/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodTemplate.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodTemplate.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodTemplate.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PodTemplate\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodTemplate\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedReplicationController(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationController.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationController.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationController.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ReplicationController\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace scale of the specified ReplicationController\n * @param name name of the Scale\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedReplicationControllerScale(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/scale'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerScale.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Scale\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Scale\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified ReplicationController\n * @param name name of the ReplicationController\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedReplicationControllerStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/replicationcontrollers/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedReplicationControllerStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedReplicationControllerStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ReplicationController\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ReplicationController\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedResourceQuota(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedResourceQuota.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedResourceQuota.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedResourceQuota.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ResourceQuota\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified ResourceQuota\n * @param name name of the ResourceQuota\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedResourceQuotaStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/resourcequotas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedResourceQuotaStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedResourceQuotaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ResourceQuota\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ResourceQuota\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Secret\n * @param name name of the Secret\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedSecret(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/secrets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedSecret.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedSecret.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedSecret.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Secret\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Secret\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedService(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedService.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedService.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedService.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Service\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Service\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ServiceAccount\n * @param name name of the ServiceAccount\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedServiceAccount(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/serviceaccounts/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedServiceAccount.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedServiceAccount.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedServiceAccount.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ServiceAccount\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ServiceAccount\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified Service\n * @param name name of the Service\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedServiceStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/namespaces/{namespace}/services/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedServiceStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedServiceStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedServiceStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Service\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Service\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Node\n * @param name name of the Node\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNode(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNode.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Node\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Node\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified Node\n * @param name name of the Node\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNodeStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/nodes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNodeStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNodeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Node\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Node\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replacePersistentVolume(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePersistentVolume.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePersistentVolume.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PersistentVolume\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified PersistentVolume\n * @param name name of the PersistentVolume\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replacePersistentVolumeStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/api/v1/persistentvolumes/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePersistentVolumeStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePersistentVolumeStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PersistentVolume\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PersistentVolume\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.CoreV1Api = CoreV1Api;\n//# sourceMappingURL=coreV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CustomObjectsApi = exports.CustomObjectsApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar CustomObjectsApiApiKeys;\n(function (CustomObjectsApiApiKeys) {\n CustomObjectsApiApiKeys[CustomObjectsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(CustomObjectsApiApiKeys = exports.CustomObjectsApiApiKeys || (exports.CustomObjectsApiApiKeys = {}));\nclass CustomObjectsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[CustomObjectsApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * Creates a cluster scoped Custom object\n * @param group The custom resource\\'s group name\n * @param version The custom resource\\'s version\n * @param plural The custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param body The JSON schema of the Resource to create.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n */\n async createClusterCustomObject(group, version, plural, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling createClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling createClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling createClusterCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * Creates a namespace scoped Custom object\n * @param group The custom resource\\'s group name\n * @param version The custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural The custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param body The JSON schema of the Resource to create.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedCustomObject(group, version, namespace, plural, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling createNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling createNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling createNamespacedCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * Deletes the specified cluster scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom object\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param body\n */\n async deleteClusterCustomObject(group, version, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling deleteClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling deleteClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling deleteClusterCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterCustomObject.');\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * Delete collection of cluster scoped custom objects\n * @param group The custom resource\\'s group name\n * @param version The custom resource\\'s version\n * @param plural The custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param body\n */\n async deleteCollectionClusterCustomObject(group, version, plural, pretty, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling deleteCollectionClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling deleteCollectionClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling deleteCollectionClusterCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * Delete collection of namespace scoped custom objects\n * @param group The custom resource\\'s group name\n * @param version The custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural The custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param body\n */\n async deleteCollectionNamespacedCustomObject(group, version, namespace, plural, pretty, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling deleteCollectionNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling deleteCollectionNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling deleteCollectionNamespacedCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * Deletes the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param body\n */\n async deleteNamespacedCustomObject(group, version, namespace, plural, name, gracePeriodSeconds, orphanDependents, propagationPolicy, dryRun, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling deleteNamespacedCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCustomObject.');\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * Returns a cluster scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom object\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n */\n async getClusterCustomObject(group, version, plural, name, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getClusterCustomObject.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read scale of the specified custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n */\n async getClusterCustomObjectScale(group, version, plural, name, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getClusterCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getClusterCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getClusterCustomObjectScale.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified cluster scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n */\n async getClusterCustomObjectStatus(group, version, plural, name, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getClusterCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getClusterCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getClusterCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getClusterCustomObjectStatus.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * Returns a namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n */\n async getNamespacedCustomObject(group, version, namespace, plural, name, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObject.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read scale of the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n */\n async getNamespacedCustomObjectScale(group, version, namespace, plural, name, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObjectScale.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n */\n async getNamespacedCustomObjectStatus(group, version, namespace, plural, name, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling getNamespacedCustomObjectStatus.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch cluster scoped custom objects\n * @param group The custom resource\\'s group name\n * @param version The custom resource\\'s version\n * @param plural The custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it\\'s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.\n */\n async listClusterCustomObject(group, version, plural, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/json;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling listClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling listClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling listClusterCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch namespace scoped custom objects\n * @param group The custom resource\\'s group name\n * @param version The custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural The custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it\\'s 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv.\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications.\n */\n async listNamespacedCustomObject(group, version, namespace, plural, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/json;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling listNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling listNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling listNamespacedCustomObject.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * patch the specified cluster scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom object\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body The JSON schema of the Resource to patch.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchClusterCustomObject(group, version, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObject.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update scale of the specified cluster scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchClusterCustomObjectScale(group, version, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObjectScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObjectScale.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified cluster scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchClusterCustomObjectStatus(group, version, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterCustomObjectStatus.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * patch the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body The JSON schema of the Resource to patch.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCustomObject(group, version, namespace, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObject.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update scale of the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCustomObjectScale(group, version, namespace, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObjectScale.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCustomObjectStatus.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified cluster scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom object\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body The JSON schema of the Resource to replace.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceClusterCustomObject(group, version, plural, name, body, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObject.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace scale of the specified cluster scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceClusterCustomObjectScale(group, version, plural, name, body, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObjectScale.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the cluster scoped specified custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceClusterCustomObjectStatus(group, version, plural, name, body, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterCustomObjectStatus.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body The JSON schema of the Resource to replace.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCustomObject(group, version, namespace, plural, name, body, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObject.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObject.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace scale of the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCustomObjectScale(group, version, namespace, plural, name, body, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/scale'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObjectScale.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified namespace scoped custom object\n * @param group the custom resource\\'s group\n * @param version the custom resource\\'s version\n * @param namespace The custom resource\\'s namespace\n * @param plural the custom resource\\'s plural name. For TPRs this would be lowercase plural kind.\n * @param name the custom object\\'s name\n * @param body\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCustomObjectStatus(group, version, namespace, plural, name, body, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/{group}/{version}/namespaces/{namespace}/{plural}/{name}/status'\n .replace('{' + 'group' + '}', encodeURIComponent(String(group)))\n .replace('{' + 'version' + '}', encodeURIComponent(String(version)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)))\n .replace('{' + 'plural' + '}', encodeURIComponent(String(plural)))\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'group' is not null or undefined\n if (group === null || group === undefined) {\n throw new Error('Required parameter group was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'version' is not null or undefined\n if (version === null || version === undefined) {\n throw new Error('Required parameter version was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'plural' is not null or undefined\n if (plural === null || plural === undefined) {\n throw new Error('Required parameter plural was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCustomObjectStatus.');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"object\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.CustomObjectsApi = CustomObjectsApi;\n//# sourceMappingURL=customObjectsApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiscoveryApi = exports.DiscoveryApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar DiscoveryApiApiKeys;\n(function (DiscoveryApiApiKeys) {\n DiscoveryApiApiKeys[DiscoveryApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(DiscoveryApiApiKeys = exports.DiscoveryApiApiKeys || (exports.DiscoveryApiApiKeys = {}));\nclass DiscoveryApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[DiscoveryApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.DiscoveryApi = DiscoveryApi;\n//# sourceMappingURL=discoveryApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiscoveryV1Api = exports.DiscoveryV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar DiscoveryV1ApiApiKeys;\n(function (DiscoveryV1ApiApiKeys) {\n DiscoveryV1ApiApiKeys[DiscoveryV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(DiscoveryV1ApiApiKeys = exports.DiscoveryV1ApiApiKeys || (exports.DiscoveryV1ApiApiKeys = {}));\nclass DiscoveryV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[DiscoveryV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create an EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedEndpointSlice(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEndpointSlice.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1EndpointSlice\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1EndpointSlice\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedEndpointSlice(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete an EndpointSlice\n * @param name name of the EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedEndpointSlice(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEndpointSlice.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind EndpointSlice\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listEndpointSliceForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/endpointslices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1EndpointSliceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedEndpointSlice(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1EndpointSliceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified EndpointSlice\n * @param name name of the EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedEndpointSlice(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEndpointSlice.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEndpointSlice.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1EndpointSlice\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified EndpointSlice\n * @param name name of the EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedEndpointSlice(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEndpointSlice.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1EndpointSlice\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified EndpointSlice\n * @param name name of the EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedEndpointSlice(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEndpointSlice.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEndpointSlice.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1EndpointSlice\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1EndpointSlice\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.DiscoveryV1Api = DiscoveryV1Api;\n//# sourceMappingURL=discoveryV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiscoveryV1beta1Api = exports.DiscoveryV1beta1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar DiscoveryV1beta1ApiApiKeys;\n(function (DiscoveryV1beta1ApiApiKeys) {\n DiscoveryV1beta1ApiApiKeys[DiscoveryV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(DiscoveryV1beta1ApiApiKeys = exports.DiscoveryV1beta1ApiApiKeys || (exports.DiscoveryV1beta1ApiApiKeys = {}));\nclass DiscoveryV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[DiscoveryV1beta1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create an EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedEndpointSlice(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEndpointSlice.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1EndpointSlice\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1EndpointSlice\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedEndpointSlice(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete an EndpointSlice\n * @param name name of the EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedEndpointSlice(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEndpointSlice.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind EndpointSlice\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listEndpointSliceForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/endpointslices';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1EndpointSliceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedEndpointSlice(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1EndpointSliceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified EndpointSlice\n * @param name name of the EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedEndpointSlice(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEndpointSlice.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEndpointSlice.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1EndpointSlice\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified EndpointSlice\n * @param name name of the EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedEndpointSlice(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEndpointSlice.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1EndpointSlice\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified EndpointSlice\n * @param name name of the EndpointSlice\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedEndpointSlice(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/discovery.k8s.io/v1beta1/namespaces/{namespace}/endpointslices/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEndpointSlice.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEndpointSlice.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEndpointSlice.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1EndpointSlice\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1EndpointSlice\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.DiscoveryV1beta1Api = DiscoveryV1beta1Api;\n//# sourceMappingURL=discoveryV1beta1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventsApi = exports.EventsApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar EventsApiApiKeys;\n(function (EventsApiApiKeys) {\n EventsApiApiKeys[EventsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(EventsApiApiKeys = exports.EventsApiApiKeys || (exports.EventsApiApiKeys = {}));\nclass EventsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[EventsApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.EventsApi = EventsApi;\n//# sourceMappingURL=eventsApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventsV1Api = exports.EventsV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar EventsV1ApiApiKeys;\n(function (EventsV1ApiApiKeys) {\n EventsV1ApiApiKeys[EventsV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(EventsV1ApiApiKeys = exports.EventsV1ApiApiKeys || (exports.EventsV1ApiApiKeys = {}));\nclass EventsV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[EventsV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create an Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedEvent(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"EventsV1Event\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"EventsV1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedEvent(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete an Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedEvent(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listEventForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/events';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"EventsV1EventList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedEvent(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"EventsV1EventList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"EventsV1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedEvent(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"EventsV1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"EventsV1Event\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"EventsV1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.EventsV1Api = EventsV1Api;\n//# sourceMappingURL=eventsV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventsV1beta1Api = exports.EventsV1beta1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar EventsV1beta1ApiApiKeys;\n(function (EventsV1beta1ApiApiKeys) {\n EventsV1beta1ApiApiKeys[EventsV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(EventsV1beta1ApiApiKeys = exports.EventsV1beta1ApiApiKeys || (exports.EventsV1beta1ApiApiKeys = {}));\nclass EventsV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[EventsV1beta1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create an Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedEvent(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1Event\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedEvent(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete an Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedEvent(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listEventForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/events';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1EventList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedEvent(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1EventList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedEvent(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Event\n * @param name name of the Event\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedEvent(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/events.k8s.io/v1beta1/namespaces/{namespace}/events/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedEvent.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedEvent.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1Event\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1Event\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.EventsV1beta1Api = EventsV1beta1Api;\n//# sourceMappingURL=eventsV1beta1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FlowcontrolApiserverApi = exports.FlowcontrolApiserverApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar FlowcontrolApiserverApiApiKeys;\n(function (FlowcontrolApiserverApiApiKeys) {\n FlowcontrolApiserverApiApiKeys[FlowcontrolApiserverApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(FlowcontrolApiserverApiApiKeys = exports.FlowcontrolApiserverApiApiKeys || (exports.FlowcontrolApiserverApiApiKeys = {}));\nclass FlowcontrolApiserverApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[FlowcontrolApiserverApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.FlowcontrolApiserverApi = FlowcontrolApiserverApi;\n//# sourceMappingURL=flowcontrolApiserverApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FlowcontrolApiserverV1beta1Api = exports.FlowcontrolApiserverV1beta1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar FlowcontrolApiserverV1beta1ApiApiKeys;\n(function (FlowcontrolApiserverV1beta1ApiApiKeys) {\n FlowcontrolApiserverV1beta1ApiApiKeys[FlowcontrolApiserverV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(FlowcontrolApiserverV1beta1ApiApiKeys = exports.FlowcontrolApiserverV1beta1ApiApiKeys || (exports.FlowcontrolApiserverV1beta1ApiApiKeys = {}));\nclass FlowcontrolApiserverV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[FlowcontrolApiserverV1beta1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a FlowSchema\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createFlowSchema(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createFlowSchema.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1FlowSchema\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1FlowSchema\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a PriorityLevelConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createPriorityLevelConfiguration(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPriorityLevelConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1PriorityLevelConfiguration\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PriorityLevelConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of FlowSchema\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionFlowSchema(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PriorityLevelConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionPriorityLevelConfiguration(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a FlowSchema\n * @param name name of the FlowSchema\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteFlowSchema(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteFlowSchema.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PriorityLevelConfiguration\n * @param name name of the PriorityLevelConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deletePriorityLevelConfiguration(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePriorityLevelConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind FlowSchema\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listFlowSchema(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1FlowSchemaList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PriorityLevelConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPriorityLevelConfiguration(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PriorityLevelConfigurationList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified FlowSchema\n * @param name name of the FlowSchema\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchFlowSchema(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchFlowSchema.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchFlowSchema.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1FlowSchema\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified FlowSchema\n * @param name name of the FlowSchema\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchFlowSchemaStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchFlowSchemaStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchFlowSchemaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1FlowSchema\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PriorityLevelConfiguration\n * @param name name of the PriorityLevelConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchPriorityLevelConfiguration(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPriorityLevelConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPriorityLevelConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PriorityLevelConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified PriorityLevelConfiguration\n * @param name name of the PriorityLevelConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchPriorityLevelConfigurationStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPriorityLevelConfigurationStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPriorityLevelConfigurationStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PriorityLevelConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified FlowSchema\n * @param name name of the FlowSchema\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readFlowSchema(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readFlowSchema.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1FlowSchema\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified FlowSchema\n * @param name name of the FlowSchema\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readFlowSchemaStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readFlowSchemaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1FlowSchema\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PriorityLevelConfiguration\n * @param name name of the PriorityLevelConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readPriorityLevelConfiguration(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPriorityLevelConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PriorityLevelConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified PriorityLevelConfiguration\n * @param name name of the PriorityLevelConfiguration\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readPriorityLevelConfigurationStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPriorityLevelConfigurationStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PriorityLevelConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified FlowSchema\n * @param name name of the FlowSchema\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceFlowSchema(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceFlowSchema.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceFlowSchema.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1FlowSchema\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1FlowSchema\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified FlowSchema\n * @param name name of the FlowSchema\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceFlowSchemaStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/flowschemas/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceFlowSchemaStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceFlowSchemaStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1FlowSchema\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1FlowSchema\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PriorityLevelConfiguration\n * @param name name of the PriorityLevelConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replacePriorityLevelConfiguration(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePriorityLevelConfiguration.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePriorityLevelConfiguration.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1PriorityLevelConfiguration\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PriorityLevelConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified PriorityLevelConfiguration\n * @param name name of the PriorityLevelConfiguration\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replacePriorityLevelConfigurationStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/flowcontrol.apiserver.k8s.io/v1beta1/prioritylevelconfigurations/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePriorityLevelConfigurationStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePriorityLevelConfigurationStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1PriorityLevelConfiguration\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PriorityLevelConfiguration\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.FlowcontrolApiserverV1beta1Api = FlowcontrolApiserverV1beta1Api;\n//# sourceMappingURL=flowcontrolApiserverV1beta1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InternalApiserverApi = exports.InternalApiserverApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar InternalApiserverApiApiKeys;\n(function (InternalApiserverApiApiKeys) {\n InternalApiserverApiApiKeys[InternalApiserverApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(InternalApiserverApiApiKeys = exports.InternalApiserverApiApiKeys || (exports.InternalApiserverApiApiKeys = {}));\nclass InternalApiserverApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[InternalApiserverApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.InternalApiserverApi = InternalApiserverApi;\n//# sourceMappingURL=internalApiserverApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.InternalApiserverV1alpha1Api = exports.InternalApiserverV1alpha1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar InternalApiserverV1alpha1ApiApiKeys;\n(function (InternalApiserverV1alpha1ApiApiKeys) {\n InternalApiserverV1alpha1ApiApiKeys[InternalApiserverV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(InternalApiserverV1alpha1ApiApiKeys = exports.InternalApiserverV1alpha1ApiApiKeys || (exports.InternalApiserverV1alpha1ApiApiKeys = {}));\nclass InternalApiserverV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[InternalApiserverV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a StorageVersion\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createStorageVersion(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createStorageVersion.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1StorageVersion\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1StorageVersion\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of StorageVersion\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionStorageVersion(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a StorageVersion\n * @param name name of the StorageVersion\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteStorageVersion(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteStorageVersion.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind StorageVersion\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listStorageVersion(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1StorageVersionList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified StorageVersion\n * @param name name of the StorageVersion\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchStorageVersion(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchStorageVersion.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchStorageVersion.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1StorageVersion\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified StorageVersion\n * @param name name of the StorageVersion\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchStorageVersionStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchStorageVersionStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchStorageVersionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1StorageVersion\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified StorageVersion\n * @param name name of the StorageVersion\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readStorageVersion(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readStorageVersion.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1StorageVersion\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified StorageVersion\n * @param name name of the StorageVersion\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readStorageVersionStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readStorageVersionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1StorageVersion\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified StorageVersion\n * @param name name of the StorageVersion\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceStorageVersion(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceStorageVersion.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceStorageVersion.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1StorageVersion\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1StorageVersion\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified StorageVersion\n * @param name name of the StorageVersion\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceStorageVersionStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/internal.apiserver.k8s.io/v1alpha1/storageversions/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceStorageVersionStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceStorageVersionStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1StorageVersion\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1StorageVersion\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.InternalApiserverV1alpha1Api = InternalApiserverV1alpha1Api;\n//# sourceMappingURL=internalApiserverV1alpha1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LogsApi = exports.LogsApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\n/* tslint:disable:no-unused-locals */\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar LogsApiApiKeys;\n(function (LogsApiApiKeys) {\n LogsApiApiKeys[LogsApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(LogsApiApiKeys = exports.LogsApiApiKeys || (exports.LogsApiApiKeys = {}));\nclass LogsApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[LogsApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n *\n * @param logpath path to the log\n */\n async logFileHandler(logpath, options = { headers: {} }) {\n const localVarPath = this.basePath + '/logs/{logpath}'\n .replace('{' + 'logpath' + '}', encodeURIComponent(String(logpath)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n let localVarFormParams = {};\n // verify required parameter 'logpath' is not null or undefined\n if (logpath === null || logpath === undefined) {\n throw new Error('Required parameter logpath was null or undefined when calling logFileHandler.');\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n *\n */\n async logFileListHandler(options = { headers: {} }) {\n const localVarPath = this.basePath + '/logs/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.LogsApi = LogsApi;\n//# sourceMappingURL=logsApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NetworkingApi = exports.NetworkingApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar NetworkingApiApiKeys;\n(function (NetworkingApiApiKeys) {\n NetworkingApiApiKeys[NetworkingApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(NetworkingApiApiKeys = exports.NetworkingApiApiKeys || (exports.NetworkingApiApiKeys = {}));\nclass NetworkingApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[NetworkingApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.NetworkingApi = NetworkingApi;\n//# sourceMappingURL=networkingApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NetworkingV1Api = exports.NetworkingV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar NetworkingV1ApiApiKeys;\n(function (NetworkingV1ApiApiKeys) {\n NetworkingV1ApiApiKeys[NetworkingV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(NetworkingV1ApiApiKeys = exports.NetworkingV1ApiApiKeys || (exports.NetworkingV1ApiApiKeys = {}));\nclass NetworkingV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[NetworkingV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create an IngressClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createIngressClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createIngressClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1IngressClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1IngressClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create an Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedIngress(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedIngress.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Ingress\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Ingress\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedNetworkPolicy(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1NetworkPolicy\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1NetworkPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of IngressClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionIngressClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedIngress(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedNetworkPolicy(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete an IngressClass\n * @param name name of the IngressClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteIngressClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteIngressClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete an Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedIngress(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedIngress.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedNetworkPolicy(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind IngressClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listIngressClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1IngressClassList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Ingress\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listIngressForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingresses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1IngressList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedIngress(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1IngressList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedNetworkPolicy(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1NetworkPolicyList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind NetworkPolicy\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNetworkPolicyForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/networkpolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1NetworkPolicyList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified IngressClass\n * @param name name of the IngressClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchIngressClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchIngressClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchIngressClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1IngressClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedIngress(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngress.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngress.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Ingress\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedIngressStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedIngressStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedIngressStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedIngressStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Ingress\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1NetworkPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified IngressClass\n * @param name name of the IngressClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readIngressClass(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readIngressClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1IngressClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedIngress(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedIngress.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Ingress\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedIngressStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedIngressStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedIngressStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Ingress\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedNetworkPolicy(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1NetworkPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified IngressClass\n * @param name name of the IngressClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceIngressClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/ingressclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceIngressClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceIngressClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1IngressClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1IngressClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedIngress(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngress.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngress.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngress.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Ingress\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Ingress\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified Ingress\n * @param name name of the Ingress\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedIngressStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedIngressStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedIngressStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedIngressStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Ingress\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Ingress\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified NetworkPolicy\n * @param name name of the NetworkPolicy\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedNetworkPolicy(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/networking.k8s.io/v1/namespaces/{namespace}/networkpolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedNetworkPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1NetworkPolicy\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1NetworkPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.NetworkingV1Api = NetworkingV1Api;\n//# sourceMappingURL=networkingV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeApi = exports.NodeApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar NodeApiApiKeys;\n(function (NodeApiApiKeys) {\n NodeApiApiKeys[NodeApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(NodeApiApiKeys = exports.NodeApiApiKeys || (exports.NodeApiApiKeys = {}));\nclass NodeApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[NodeApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.NodeApi = NodeApi;\n//# sourceMappingURL=nodeApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeV1Api = exports.NodeV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar NodeV1ApiApiKeys;\n(function (NodeV1ApiApiKeys) {\n NodeV1ApiApiKeys[NodeV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(NodeV1ApiApiKeys = exports.NodeV1ApiApiKeys || (exports.NodeV1ApiApiKeys = {}));\nclass NodeV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[NodeV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createRuntimeClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1RuntimeClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionRuntimeClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a RuntimeClass\n * @param name name of the RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteRuntimeClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listRuntimeClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RuntimeClassList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchRuntimeClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchRuntimeClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readRuntimeClass(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceRuntimeClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceRuntimeClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1RuntimeClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.NodeV1Api = NodeV1Api;\n//# sourceMappingURL=nodeV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeV1alpha1Api = exports.NodeV1alpha1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar NodeV1alpha1ApiApiKeys;\n(function (NodeV1alpha1ApiApiKeys) {\n NodeV1alpha1ApiApiKeys[NodeV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(NodeV1alpha1ApiApiKeys = exports.NodeV1alpha1ApiApiKeys || (exports.NodeV1alpha1ApiApiKeys = {}));\nclass NodeV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[NodeV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createRuntimeClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1RuntimeClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionRuntimeClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a RuntimeClass\n * @param name name of the RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteRuntimeClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listRuntimeClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RuntimeClassList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchRuntimeClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchRuntimeClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readRuntimeClass(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceRuntimeClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1alpha1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceRuntimeClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1RuntimeClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.NodeV1alpha1Api = NodeV1alpha1Api;\n//# sourceMappingURL=nodeV1alpha1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NodeV1beta1Api = exports.NodeV1beta1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar NodeV1beta1ApiApiKeys;\n(function (NodeV1beta1ApiApiKeys) {\n NodeV1beta1ApiApiKeys[NodeV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(NodeV1beta1ApiApiKeys = exports.NodeV1beta1ApiApiKeys || (exports.NodeV1beta1ApiApiKeys = {}));\nclass NodeV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[NodeV1beta1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createRuntimeClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1RuntimeClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionRuntimeClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a RuntimeClass\n * @param name name of the RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteRuntimeClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listRuntimeClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1RuntimeClassList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchRuntimeClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchRuntimeClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readRuntimeClass(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified RuntimeClass\n * @param name name of the RuntimeClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceRuntimeClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/node.k8s.io/v1beta1/runtimeclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceRuntimeClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceRuntimeClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1RuntimeClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1RuntimeClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.NodeV1beta1Api = NodeV1beta1Api;\n//# sourceMappingURL=nodeV1beta1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OpenidApi = exports.OpenidApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\n/* tslint:disable:no-unused-locals */\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar OpenidApiApiKeys;\n(function (OpenidApiApiKeys) {\n OpenidApiApiKeys[OpenidApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(OpenidApiApiKeys = exports.OpenidApiApiKeys || (exports.OpenidApiApiKeys = {}));\nclass OpenidApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[OpenidApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get service account issuer OpenID JSON Web Key Set (contains public token verification keys)\n */\n async getServiceAccountIssuerOpenIDKeyset(options = { headers: {} }) {\n const localVarPath = this.basePath + '/openid/v1/jwks/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/jwk-set+json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.OpenidApi = OpenidApi;\n//# sourceMappingURL=openidApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PolicyApi = exports.PolicyApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar PolicyApiApiKeys;\n(function (PolicyApiApiKeys) {\n PolicyApiApiKeys[PolicyApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(PolicyApiApiKeys = exports.PolicyApiApiKeys || (exports.PolicyApiApiKeys = {}));\nclass PolicyApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[PolicyApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.PolicyApi = PolicyApi;\n//# sourceMappingURL=policyApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PolicyV1Api = exports.PolicyV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar PolicyV1ApiApiKeys;\n(function (PolicyV1ApiApiKeys) {\n PolicyV1ApiApiKeys[PolicyV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(PolicyV1ApiApiKeys = exports.PolicyV1ApiApiKeys || (exports.PolicyV1ApiApiKeys = {}));\nclass PolicyV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[PolicyV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedPodDisruptionBudget(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PodDisruptionBudget\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedPodDisruptionBudget(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedPodDisruptionBudget(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedPodDisruptionBudget(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudgetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PodDisruptionBudget\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPodDisruptionBudgetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/poddisruptionbudgets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudgetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPodDisruptionBudget(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPodDisruptionBudgetStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PodDisruptionBudget\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PodDisruptionBudget\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.PolicyV1Api = PolicyV1Api;\n//# sourceMappingURL=policyV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PolicyV1beta1Api = exports.PolicyV1beta1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar PolicyV1beta1ApiApiKeys;\n(function (PolicyV1beta1ApiApiKeys) {\n PolicyV1beta1ApiApiKeys[PolicyV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(PolicyV1beta1ApiApiKeys = exports.PolicyV1beta1ApiApiKeys || (exports.PolicyV1beta1ApiApiKeys = {}));\nclass PolicyV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[PolicyV1beta1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedPodDisruptionBudget(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1PodDisruptionBudget\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a PodSecurityPolicy\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createPodSecurityPolicy(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1PodSecurityPolicy\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodSecurityPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedPodDisruptionBudget(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PodSecurityPolicy\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionPodSecurityPolicy(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedPodDisruptionBudget(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deletePodSecurityPolicy(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodSecurityPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedPodDisruptionBudget(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudgetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PodDisruptionBudget\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPodDisruptionBudgetForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/poddisruptionbudgets';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudgetList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PodSecurityPolicy\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPodSecurityPolicy(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodSecurityPolicyList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchPodSecurityPolicy(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPodSecurityPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodSecurityPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPodDisruptionBudget(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedPodDisruptionBudgetStatus(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readPodSecurityPolicy(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodSecurityPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPodDisruptionBudget(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudget.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1PodDisruptionBudget\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified PodDisruptionBudget\n * @param name name of the PodDisruptionBudget\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedPodDisruptionBudgetStatus(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/namespaces/{namespace}/poddisruptionbudgets/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedPodDisruptionBudgetStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1PodDisruptionBudget\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodDisruptionBudget\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PodSecurityPolicy\n * @param name name of the PodSecurityPolicy\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replacePodSecurityPolicy(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/policy/v1beta1/podsecuritypolicies/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePodSecurityPolicy.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePodSecurityPolicy.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1PodSecurityPolicy\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1PodSecurityPolicy\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.PolicyV1beta1Api = PolicyV1beta1Api;\n//# sourceMappingURL=policyV1beta1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RbacAuthorizationApi = exports.RbacAuthorizationApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar RbacAuthorizationApiApiKeys;\n(function (RbacAuthorizationApiApiKeys) {\n RbacAuthorizationApiApiKeys[RbacAuthorizationApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(RbacAuthorizationApiApiKeys = exports.RbacAuthorizationApiApiKeys || (exports.RbacAuthorizationApiApiKeys = {}));\nclass RbacAuthorizationApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[RbacAuthorizationApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.RbacAuthorizationApi = RbacAuthorizationApi;\n//# sourceMappingURL=rbacAuthorizationApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RbacAuthorizationV1Api = exports.RbacAuthorizationV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar RbacAuthorizationV1ApiApiKeys;\n(function (RbacAuthorizationV1ApiApiKeys) {\n RbacAuthorizationV1ApiApiKeys[RbacAuthorizationV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(RbacAuthorizationV1ApiApiKeys = exports.RbacAuthorizationV1ApiApiKeys || (exports.RbacAuthorizationV1ApiApiKeys = {}));\nclass RbacAuthorizationV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[RbacAuthorizationV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a ClusterRole\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createClusterRole(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ClusterRole\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRole\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a ClusterRoleBinding\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createClusterRoleBinding(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ClusterRoleBinding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedRole(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Role\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Role\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedRoleBinding(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1RoleBinding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteClusterRole(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteClusterRoleBinding(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ClusterRole\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionClusterRole(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ClusterRoleBinding\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionClusterRoleBinding(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedRole(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedRoleBinding(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedRole(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedRoleBinding(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRole\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listClusterRole(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRoleList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRoleBinding\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listClusterRoleBinding(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRoleBindingList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedRole(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RoleList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedRoleBinding(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RoleBindingList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listRoleBindingForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/rolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RoleBindingList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listRoleForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/roles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RoleList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchClusterRole(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRole\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchClusterRoleBinding(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Role\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readClusterRole(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRole\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readClusterRoleBinding(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedRole(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Role\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedRoleBinding(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceClusterRole(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ClusterRole\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRole\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceClusterRoleBinding(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1ClusterRoleBinding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1ClusterRoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1Role\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Role\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1RoleBinding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1RoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.RbacAuthorizationV1Api = RbacAuthorizationV1Api;\n//# sourceMappingURL=rbacAuthorizationV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RbacAuthorizationV1alpha1Api = exports.RbacAuthorizationV1alpha1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar RbacAuthorizationV1alpha1ApiApiKeys;\n(function (RbacAuthorizationV1alpha1ApiApiKeys) {\n RbacAuthorizationV1alpha1ApiApiKeys[RbacAuthorizationV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(RbacAuthorizationV1alpha1ApiApiKeys = exports.RbacAuthorizationV1alpha1ApiApiKeys || (exports.RbacAuthorizationV1alpha1ApiApiKeys = {}));\nclass RbacAuthorizationV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[RbacAuthorizationV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a ClusterRole\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createClusterRole(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1ClusterRole\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRole\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a ClusterRoleBinding\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createClusterRoleBinding(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1ClusterRoleBinding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedRole(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1Role\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1Role\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedRoleBinding(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1RoleBinding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteClusterRole(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteClusterRoleBinding(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ClusterRole\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionClusterRole(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of ClusterRoleBinding\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionClusterRoleBinding(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedRole(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedRoleBinding(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedRole(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedRoleBinding(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRole\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listClusterRole(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind ClusterRoleBinding\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listClusterRoleBinding(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBindingList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedRole(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RoleList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedRoleBinding(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RoleBindingList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind RoleBinding\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listRoleBindingForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/rolebindings';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RoleBindingList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind Role\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listRoleForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/roles';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RoleList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchClusterRole(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRole\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchClusterRoleBinding(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1Role\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ClusterRole\n * @param name name of the ClusterRole\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readClusterRole(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRole\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readClusterRoleBinding(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedRole(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1Role\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedRoleBinding(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ClusterRole\n * @param name name of the ClusterRole\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceClusterRole(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterroles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1ClusterRole\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRole\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified ClusterRoleBinding\n * @param name name of the ClusterRoleBinding\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceClusterRoleBinding(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/clusterrolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceClusterRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceClusterRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1ClusterRoleBinding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1ClusterRoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified Role\n * @param name name of the Role\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedRole(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/roles/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRole.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRole.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1Role\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1Role\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified RoleBinding\n * @param name name of the RoleBinding\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedRoleBinding(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/rbac.authorization.k8s.io/v1alpha1/namespaces/{namespace}/rolebindings/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedRoleBinding.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1RoleBinding\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1RoleBinding\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.RbacAuthorizationV1alpha1Api = RbacAuthorizationV1alpha1Api;\n//# sourceMappingURL=rbacAuthorizationV1alpha1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SchedulingApi = exports.SchedulingApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar SchedulingApiApiKeys;\n(function (SchedulingApiApiKeys) {\n SchedulingApiApiKeys[SchedulingApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(SchedulingApiApiKeys = exports.SchedulingApiApiKeys || (exports.SchedulingApiApiKeys = {}));\nclass SchedulingApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[SchedulingApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.SchedulingApi = SchedulingApi;\n//# sourceMappingURL=schedulingApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SchedulingV1Api = exports.SchedulingV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar SchedulingV1ApiApiKeys;\n(function (SchedulingV1ApiApiKeys) {\n SchedulingV1ApiApiKeys[SchedulingV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(SchedulingV1ApiApiKeys = exports.SchedulingV1ApiApiKeys || (exports.SchedulingV1ApiApiKeys = {}));\nclass SchedulingV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[SchedulingV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a PriorityClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createPriorityClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PriorityClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PriorityClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PriorityClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionPriorityClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PriorityClass\n * @param name name of the PriorityClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deletePriorityClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PriorityClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPriorityClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PriorityClassList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PriorityClass\n * @param name name of the PriorityClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchPriorityClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PriorityClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PriorityClass\n * @param name name of the PriorityClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readPriorityClass(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PriorityClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PriorityClass\n * @param name name of the PriorityClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replacePriorityClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1PriorityClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1PriorityClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.SchedulingV1Api = SchedulingV1Api;\n//# sourceMappingURL=schedulingV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SchedulingV1alpha1Api = exports.SchedulingV1alpha1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar SchedulingV1alpha1ApiApiKeys;\n(function (SchedulingV1alpha1ApiApiKeys) {\n SchedulingV1alpha1ApiApiKeys[SchedulingV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(SchedulingV1alpha1ApiApiKeys = exports.SchedulingV1alpha1ApiApiKeys || (exports.SchedulingV1alpha1ApiApiKeys = {}));\nclass SchedulingV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[SchedulingV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a PriorityClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createPriorityClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1PriorityClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1PriorityClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of PriorityClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionPriorityClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a PriorityClass\n * @param name name of the PriorityClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deletePriorityClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deletePriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind PriorityClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listPriorityClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1PriorityClassList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified PriorityClass\n * @param name name of the PriorityClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchPriorityClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchPriorityClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1PriorityClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified PriorityClass\n * @param name name of the PriorityClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readPriorityClass(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readPriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1PriorityClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified PriorityClass\n * @param name name of the PriorityClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replacePriorityClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/scheduling.k8s.io/v1alpha1/priorityclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replacePriorityClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replacePriorityClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1PriorityClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1PriorityClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.SchedulingV1alpha1Api = SchedulingV1alpha1Api;\n//# sourceMappingURL=schedulingV1alpha1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StorageApi = exports.StorageApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar StorageApiApiKeys;\n(function (StorageApiApiKeys) {\n StorageApiApiKeys[StorageApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(StorageApiApiKeys = exports.StorageApiApiKeys || (exports.StorageApiApiKeys = {}));\nclass StorageApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[StorageApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get information of a group\n */\n async getAPIGroup(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIGroup\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.StorageApi = StorageApi;\n//# sourceMappingURL=storageApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StorageV1Api = exports.StorageV1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar StorageV1ApiApiKeys;\n(function (StorageV1ApiApiKeys) {\n StorageV1ApiApiKeys[StorageV1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(StorageV1ApiApiKeys = exports.StorageV1ApiApiKeys || (exports.StorageV1ApiApiKeys = {}));\nclass StorageV1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[StorageV1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a CSIDriver\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createCSIDriver(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createCSIDriver.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CSIDriver\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSIDriver\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a CSINode\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createCSINode(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createCSINode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CSINode\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSINode\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a StorageClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createStorageClass(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1StorageClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StorageClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a VolumeAttachment\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createVolumeAttachment(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1VolumeAttachment\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a CSIDriver\n * @param name name of the CSIDriver\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteCSIDriver(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteCSIDriver.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSIDriver\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a CSINode\n * @param name name of the CSINode\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteCSINode(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteCSINode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSINode\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of CSIDriver\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionCSIDriver(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of CSINode\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionCSINode(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of StorageClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionStorageClass(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionVolumeAttachment(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a StorageClass\n * @param name name of the StorageClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteStorageClass(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StorageClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteVolumeAttachment(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CSIDriver\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listCSIDriver(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSIDriverList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CSINode\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listCSINode(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSINodeList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind StorageClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listStorageClass(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StorageClassList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listVolumeAttachment(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachmentList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified CSIDriver\n * @param name name of the CSIDriver\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchCSIDriver(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCSIDriver.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCSIDriver.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSIDriver\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified CSINode\n * @param name name of the CSINode\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchCSINode(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchCSINode.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchCSINode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSINode\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified StorageClass\n * @param name name of the StorageClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchStorageClass(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchStorageClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StorageClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchVolumeAttachment(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update status of the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchVolumeAttachmentStatus(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachmentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachmentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified CSIDriver\n * @param name name of the CSIDriver\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readCSIDriver(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCSIDriver.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSIDriver\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified CSINode\n * @param name name of the CSINode\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readCSINode(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readCSINode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSINode\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified StorageClass\n * @param name name of the StorageClass\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readStorageClass(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StorageClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readVolumeAttachment(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read status of the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readVolumeAttachmentStatus(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readVolumeAttachmentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified CSIDriver\n * @param name name of the CSIDriver\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceCSIDriver(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csidrivers/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCSIDriver.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCSIDriver.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CSIDriver\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSIDriver\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified CSINode\n * @param name name of the CSINode\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceCSINode(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/csinodes/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceCSINode.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceCSINode.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1CSINode\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1CSINode\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified StorageClass\n * @param name name of the StorageClass\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceStorageClass(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/storageclasses/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceStorageClass.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceStorageClass.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1StorageClass\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1StorageClass\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceVolumeAttachment(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1VolumeAttachment\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace status of the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceVolumeAttachmentStatus(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1/volumeattachments/{name}/status'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachmentStatus.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachmentStatus.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1VolumeAttachment\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.StorageV1Api = StorageV1Api;\n//# sourceMappingURL=storageV1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StorageV1alpha1Api = exports.StorageV1alpha1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar StorageV1alpha1ApiApiKeys;\n(function (StorageV1alpha1ApiApiKeys) {\n StorageV1alpha1ApiApiKeys[StorageV1alpha1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(StorageV1alpha1ApiApiKeys = exports.StorageV1alpha1ApiApiKeys || (exports.StorageV1alpha1ApiApiKeys = {}));\nclass StorageV1alpha1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[StorageV1alpha1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedCSIStorageCapacity(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/namespaces/{namespace}/csistoragecapacities'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1CSIStorageCapacity\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1CSIStorageCapacity\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * create a VolumeAttachment\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createVolumeAttachment(body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1VolumeAttachment\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedCSIStorageCapacity(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/namespaces/{namespace}/csistoragecapacities'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionVolumeAttachment(pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a CSIStorageCapacity\n * @param name name of the CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedCSIStorageCapacity(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/namespaces/{namespace}/csistoragecapacities/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteVolumeAttachment(name, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CSIStorageCapacity\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listCSIStorageCapacityForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/csistoragecapacities';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1CSIStorageCapacityList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedCSIStorageCapacity(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/namespaces/{namespace}/csistoragecapacities'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1CSIStorageCapacityList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listVolumeAttachment(pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachmentList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified CSIStorageCapacity\n * @param name name of the CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCSIStorageCapacity(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/namespaces/{namespace}/csistoragecapacities/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1CSIStorageCapacity\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchVolumeAttachment(name, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified CSIStorageCapacity\n * @param name name of the CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedCSIStorageCapacity(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/namespaces/{namespace}/csistoragecapacities/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1CSIStorageCapacity\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readVolumeAttachment(name, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified CSIStorageCapacity\n * @param name name of the CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCSIStorageCapacity(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/namespaces/{namespace}/csistoragecapacities/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1CSIStorageCapacity\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1CSIStorageCapacity\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified VolumeAttachment\n * @param name name of the VolumeAttachment\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceVolumeAttachment(name, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1alpha1/volumeattachments/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceVolumeAttachment.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceVolumeAttachment.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1alpha1VolumeAttachment\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1alpha1VolumeAttachment\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.StorageV1alpha1Api = StorageV1alpha1Api;\n//# sourceMappingURL=storageV1alpha1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StorageV1beta1Api = exports.StorageV1beta1ApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar StorageV1beta1ApiApiKeys;\n(function (StorageV1beta1ApiApiKeys) {\n StorageV1beta1ApiApiKeys[StorageV1beta1ApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(StorageV1beta1ApiApiKeys = exports.StorageV1beta1ApiApiKeys || (exports.StorageV1beta1ApiApiKeys = {}));\nclass StorageV1beta1Api {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[StorageV1beta1ApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * create a CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async createNamespacedCSIStorageCapacity(namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling createNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling createNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1CSIStorageCapacity\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CSIStorageCapacity\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete collection of CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param body\n */\n async deleteCollectionNamespacedCSIStorageCapacity(namespace, pretty, _continue, dryRun, fieldSelector, gracePeriodSeconds, labelSelector, limit, orphanDependents, propagationPolicy, resourceVersion, resourceVersionMatch, timeoutSeconds, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteCollectionNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * delete a CSIStorageCapacity\n * @param name name of the CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents in the foreground.\n * @param body\n */\n async deleteNamespacedCSIStorageCapacity(name, namespace, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling deleteNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling deleteNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters['gracePeriodSeconds'] = models_1.ObjectSerializer.serialize(gracePeriodSeconds, \"number\");\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters['orphanDependents'] = models_1.ObjectSerializer.serialize(orphanDependents, \"boolean\");\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters['propagationPolicy'] = models_1.ObjectSerializer.serialize(propagationPolicy, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1DeleteOptions\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1Status\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * get available resources\n */\n async getAPIResources(options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1APIResourceList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CSIStorageCapacity\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listCSIStorageCapacityForAllNamespaces(allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, pretty, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/csistoragecapacities';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CSIStorageCapacityList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * list or watch objects of kind CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param allowWatchBookmarks allowWatchBookmarks requests watch events with type \\"BOOKMARK\\". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server\\'s discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.\n * @param _continue The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the \\"next key\\". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.\n * @param resourceVersion resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param resourceVersionMatch resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details. Defaults to unset\n * @param timeoutSeconds Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.\n * @param watch Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.\n */\n async listNamespacedCSIStorageCapacity(namespace, pretty, allowWatchBookmarks, _continue, fieldSelector, labelSelector, limit, resourceVersion, resourceVersionMatch, timeoutSeconds, watch, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities'\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf', 'application/json;stream=watch', 'application/vnd.kubernetes.protobuf;stream=watch'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling listNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (allowWatchBookmarks !== undefined) {\n localVarQueryParameters['allowWatchBookmarks'] = models_1.ObjectSerializer.serialize(allowWatchBookmarks, \"boolean\");\n }\n if (_continue !== undefined) {\n localVarQueryParameters['continue'] = models_1.ObjectSerializer.serialize(_continue, \"string\");\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters['fieldSelector'] = models_1.ObjectSerializer.serialize(fieldSelector, \"string\");\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters['labelSelector'] = models_1.ObjectSerializer.serialize(labelSelector, \"string\");\n }\n if (limit !== undefined) {\n localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(limit, \"number\");\n }\n if (resourceVersion !== undefined) {\n localVarQueryParameters['resourceVersion'] = models_1.ObjectSerializer.serialize(resourceVersion, \"string\");\n }\n if (resourceVersionMatch !== undefined) {\n localVarQueryParameters['resourceVersionMatch'] = models_1.ObjectSerializer.serialize(resourceVersionMatch, \"string\");\n }\n if (timeoutSeconds !== undefined) {\n localVarQueryParameters['timeoutSeconds'] = models_1.ObjectSerializer.serialize(timeoutSeconds, \"number\");\n }\n if (watch !== undefined) {\n localVarQueryParameters['watch'] = models_1.ObjectSerializer.serialize(watch, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CSIStorageCapacityList\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * partially update the specified CSIStorageCapacity\n * @param name name of the CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch, StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.\n */\n async patchNamespacedCSIStorageCapacity(name, namespace, body, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling patchNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling patchNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling patchNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n if (force !== undefined) {\n localVarQueryParameters['force'] = models_1.ObjectSerializer.serialize(force, \"boolean\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"object\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CSIStorageCapacity\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * read the specified CSIStorageCapacity\n * @param name name of the CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param pretty If \\'true\\', then the output is pretty printed.\n */\n async readNamespacedCSIStorageCapacity(name, namespace, pretty, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling readNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling readNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CSIStorageCapacity\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n /**\n * replace the specified CSIStorageCapacity\n * @param name name of the CSIStorageCapacity\n * @param namespace object name and auth scope, such as for teams and projects\n * @param body\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.\n */\n async replaceNamespacedCSIStorageCapacity(name, namespace, body, pretty, dryRun, fieldManager, options = { headers: {} }) {\n const localVarPath = this.basePath + '/apis/storage.k8s.io/v1beta1/namespaces/{namespace}/csistoragecapacities/{name}'\n .replace('{' + 'name' + '}', encodeURIComponent(String(name)))\n .replace('{' + 'namespace' + '}', encodeURIComponent(String(namespace)));\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json', 'application/yaml', 'application/vnd.kubernetes.protobuf'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n // verify required parameter 'name' is not null or undefined\n if (name === null || name === undefined) {\n throw new Error('Required parameter name was null or undefined when calling replaceNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'namespace' is not null or undefined\n if (namespace === null || namespace === undefined) {\n throw new Error('Required parameter namespace was null or undefined when calling replaceNamespacedCSIStorageCapacity.');\n }\n // verify required parameter 'body' is not null or undefined\n if (body === null || body === undefined) {\n throw new Error('Required parameter body was null or undefined when calling replaceNamespacedCSIStorageCapacity.');\n }\n if (pretty !== undefined) {\n localVarQueryParameters['pretty'] = models_1.ObjectSerializer.serialize(pretty, \"string\");\n }\n if (dryRun !== undefined) {\n localVarQueryParameters['dryRun'] = models_1.ObjectSerializer.serialize(dryRun, \"string\");\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters['fieldManager'] = models_1.ObjectSerializer.serialize(fieldManager, \"string\");\n }\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: models_1.ObjectSerializer.serialize(body, \"V1beta1CSIStorageCapacity\")\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"V1beta1CSIStorageCapacity\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.StorageV1beta1Api = StorageV1beta1Api;\n//# sourceMappingURL=storageV1beta1Api.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VersionApi = exports.VersionApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar VersionApiApiKeys;\n(function (VersionApiApiKeys) {\n VersionApiApiKeys[VersionApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(VersionApiApiKeys = exports.VersionApiApiKeys || (exports.VersionApiApiKeys = {}));\nclass VersionApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[VersionApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get the code version\n */\n async getCode(options = { headers: {} }) {\n const localVarPath = this.basePath + '/version/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"VersionInfo\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.VersionApi = VersionApi;\n//# sourceMappingURL=versionApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WellKnownApi = exports.WellKnownApiApiKeys = void 0;\nconst tslib_1 = require(\"tslib\");\nconst request_1 = tslib_1.__importDefault(require(\"request\"));\n/* tslint:disable:no-unused-locals */\nconst models_1 = require(\"../model/models\");\nconst models_2 = require(\"../model/models\");\nconst apis_1 = require(\"./apis\");\nlet defaultBasePath = 'http://localhost';\n// ===============================================\n// This file is autogenerated - Please do not edit\n// ===============================================\nvar WellKnownApiApiKeys;\n(function (WellKnownApiApiKeys) {\n WellKnownApiApiKeys[WellKnownApiApiKeys[\"BearerToken\"] = 0] = \"BearerToken\";\n})(WellKnownApiApiKeys = exports.WellKnownApiApiKeys || (exports.WellKnownApiApiKeys = {}));\nclass WellKnownApi {\n constructor(basePathOrUsername, password, basePath) {\n this._basePath = defaultBasePath;\n this._defaultHeaders = {};\n this._useQuerystring = false;\n this.authentications = {\n 'default': new models_1.VoidAuth(),\n 'BearerToken': new models_2.ApiKeyAuth('header', 'authorization'),\n };\n this.interceptors = [];\n if (password) {\n if (basePath) {\n this.basePath = basePath;\n }\n }\n else {\n if (basePathOrUsername) {\n this.basePath = basePathOrUsername;\n }\n }\n }\n set useQuerystring(value) {\n this._useQuerystring = value;\n }\n set basePath(basePath) {\n this._basePath = basePath;\n }\n set defaultHeaders(defaultHeaders) {\n this._defaultHeaders = defaultHeaders;\n }\n get defaultHeaders() {\n return this._defaultHeaders;\n }\n get basePath() {\n return this._basePath;\n }\n setDefaultAuthentication(auth) {\n this.authentications.default = auth;\n }\n setApiKey(key, value) {\n this.authentications[WellKnownApiApiKeys[key]].apiKey = value;\n }\n addInterceptor(interceptor) {\n this.interceptors.push(interceptor);\n }\n /**\n * get service account issuer OpenID configuration, also known as the \\'OIDC discovery doc\\'\n */\n async getServiceAccountIssuerOpenIDConfiguration(options = { headers: {} }) {\n const localVarPath = this.basePath + '/.well-known/openid-configuration/';\n let localVarQueryParameters = {};\n let localVarHeaderParams = Object.assign({}, this._defaultHeaders);\n const produces = ['application/json'];\n // give precedence to 'application/json'\n if (produces.indexOf('application/json') >= 0) {\n localVarHeaderParams.Accept = 'application/json';\n }\n else {\n localVarHeaderParams.Accept = produces.join(',');\n }\n let localVarFormParams = {};\n Object.assign(localVarHeaderParams, options.headers);\n let localVarUseFormData = false;\n let localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(localVarRequestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions));\n }\n return interceptorPromise.then(() => {\n if (Object.keys(localVarFormParams).length) {\n if (localVarUseFormData) {\n localVarRequestOptions.formData = localVarFormParams;\n }\n else {\n localVarRequestOptions.form = localVarFormParams;\n }\n }\n return new Promise((resolve, reject) => {\n request_1.default(localVarRequestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n body = models_1.ObjectSerializer.deserialize(body, \"string\");\n resolve({ response: response, body: body });\n }\n else {\n reject(new apis_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n });\n }\n}\nexports.WellKnownApi = WellKnownApi;\n//# sourceMappingURL=wellKnownApi.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdmissionregistrationV1ServiceReference = void 0;\n/**\n* ServiceReference holds a reference to Service.legacy.k8s.io\n*/\nclass AdmissionregistrationV1ServiceReference {\n static getAttributeTypeMap() {\n return AdmissionregistrationV1ServiceReference.attributeTypeMap;\n }\n}\nexports.AdmissionregistrationV1ServiceReference = AdmissionregistrationV1ServiceReference;\nAdmissionregistrationV1ServiceReference.discriminator = undefined;\nAdmissionregistrationV1ServiceReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=admissionregistrationV1ServiceReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AdmissionregistrationV1WebhookClientConfig = void 0;\n/**\n* WebhookClientConfig contains the information to make a TLS connection with the webhook\n*/\nclass AdmissionregistrationV1WebhookClientConfig {\n static getAttributeTypeMap() {\n return AdmissionregistrationV1WebhookClientConfig.attributeTypeMap;\n }\n}\nexports.AdmissionregistrationV1WebhookClientConfig = AdmissionregistrationV1WebhookClientConfig;\nAdmissionregistrationV1WebhookClientConfig.discriminator = undefined;\nAdmissionregistrationV1WebhookClientConfig.attributeTypeMap = [\n {\n \"name\": \"caBundle\",\n \"baseName\": \"caBundle\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"AdmissionregistrationV1ServiceReference\"\n },\n {\n \"name\": \"url\",\n \"baseName\": \"url\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=admissionregistrationV1WebhookClientConfig.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ApiextensionsV1ServiceReference = void 0;\n/**\n* ServiceReference holds a reference to Service.legacy.k8s.io\n*/\nclass ApiextensionsV1ServiceReference {\n static getAttributeTypeMap() {\n return ApiextensionsV1ServiceReference.attributeTypeMap;\n }\n}\nexports.ApiextensionsV1ServiceReference = ApiextensionsV1ServiceReference;\nApiextensionsV1ServiceReference.discriminator = undefined;\nApiextensionsV1ServiceReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=apiextensionsV1ServiceReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ApiextensionsV1WebhookClientConfig = void 0;\n/**\n* WebhookClientConfig contains the information to make a TLS connection with the webhook.\n*/\nclass ApiextensionsV1WebhookClientConfig {\n static getAttributeTypeMap() {\n return ApiextensionsV1WebhookClientConfig.attributeTypeMap;\n }\n}\nexports.ApiextensionsV1WebhookClientConfig = ApiextensionsV1WebhookClientConfig;\nApiextensionsV1WebhookClientConfig.discriminator = undefined;\nApiextensionsV1WebhookClientConfig.attributeTypeMap = [\n {\n \"name\": \"caBundle\",\n \"baseName\": \"caBundle\",\n \"type\": \"string\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"ApiextensionsV1ServiceReference\"\n },\n {\n \"name\": \"url\",\n \"baseName\": \"url\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=apiextensionsV1WebhookClientConfig.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ApiregistrationV1ServiceReference = void 0;\n/**\n* ServiceReference holds a reference to Service.legacy.k8s.io\n*/\nclass ApiregistrationV1ServiceReference {\n static getAttributeTypeMap() {\n return ApiregistrationV1ServiceReference.attributeTypeMap;\n }\n}\nexports.ApiregistrationV1ServiceReference = ApiregistrationV1ServiceReference;\nApiregistrationV1ServiceReference.discriminator = undefined;\nApiregistrationV1ServiceReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=apiregistrationV1ServiceReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthenticationV1TokenRequest = void 0;\n/**\n* TokenRequest requests a token for a given service account.\n*/\nclass AuthenticationV1TokenRequest {\n static getAttributeTypeMap() {\n return AuthenticationV1TokenRequest.attributeTypeMap;\n }\n}\nexports.AuthenticationV1TokenRequest = AuthenticationV1TokenRequest;\nAuthenticationV1TokenRequest.discriminator = undefined;\nAuthenticationV1TokenRequest.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1TokenRequestSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1TokenRequestStatus\"\n }\n];\n//# sourceMappingURL=authenticationV1TokenRequest.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CoreV1EndpointPort = void 0;\n/**\n* EndpointPort is a tuple that describes a single port.\n*/\nclass CoreV1EndpointPort {\n static getAttributeTypeMap() {\n return CoreV1EndpointPort.attributeTypeMap;\n }\n}\nexports.CoreV1EndpointPort = CoreV1EndpointPort;\nCoreV1EndpointPort.discriminator = undefined;\nCoreV1EndpointPort.attributeTypeMap = [\n {\n \"name\": \"appProtocol\",\n \"baseName\": \"appProtocol\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=coreV1EndpointPort.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CoreV1Event = void 0;\n/**\n* Event is a report of an event somewhere in the cluster. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data.\n*/\nclass CoreV1Event {\n static getAttributeTypeMap() {\n return CoreV1Event.attributeTypeMap;\n }\n}\nexports.CoreV1Event = CoreV1Event;\nCoreV1Event.discriminator = undefined;\nCoreV1Event.attributeTypeMap = [\n {\n \"name\": \"action\",\n \"baseName\": \"action\",\n \"type\": \"string\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"count\",\n \"baseName\": \"count\",\n \"type\": \"number\"\n },\n {\n \"name\": \"eventTime\",\n \"baseName\": \"eventTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"firstTimestamp\",\n \"baseName\": \"firstTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"involvedObject\",\n \"baseName\": \"involvedObject\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lastTimestamp\",\n \"baseName\": \"lastTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"related\",\n \"baseName\": \"related\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"reportingComponent\",\n \"baseName\": \"reportingComponent\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reportingInstance\",\n \"baseName\": \"reportingInstance\",\n \"type\": \"string\"\n },\n {\n \"name\": \"series\",\n \"baseName\": \"series\",\n \"type\": \"CoreV1EventSeries\"\n },\n {\n \"name\": \"source\",\n \"baseName\": \"source\",\n \"type\": \"V1EventSource\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=coreV1Event.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CoreV1EventList = void 0;\n/**\n* EventList is a list of events.\n*/\nclass CoreV1EventList {\n static getAttributeTypeMap() {\n return CoreV1EventList.attributeTypeMap;\n }\n}\nexports.CoreV1EventList = CoreV1EventList;\nCoreV1EventList.discriminator = undefined;\nCoreV1EventList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=coreV1EventList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CoreV1EventSeries = void 0;\n/**\n* EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.\n*/\nclass CoreV1EventSeries {\n static getAttributeTypeMap() {\n return CoreV1EventSeries.attributeTypeMap;\n }\n}\nexports.CoreV1EventSeries = CoreV1EventSeries;\nCoreV1EventSeries.discriminator = undefined;\nCoreV1EventSeries.attributeTypeMap = [\n {\n \"name\": \"count\",\n \"baseName\": \"count\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastObservedTime\",\n \"baseName\": \"lastObservedTime\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=coreV1EventSeries.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiscoveryV1EndpointPort = void 0;\n/**\n* EndpointPort represents a Port used by an EndpointSlice\n*/\nclass DiscoveryV1EndpointPort {\n static getAttributeTypeMap() {\n return DiscoveryV1EndpointPort.attributeTypeMap;\n }\n}\nexports.DiscoveryV1EndpointPort = DiscoveryV1EndpointPort;\nDiscoveryV1EndpointPort.discriminator = undefined;\nDiscoveryV1EndpointPort.attributeTypeMap = [\n {\n \"name\": \"appProtocol\",\n \"baseName\": \"appProtocol\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=discoveryV1EndpointPort.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventsV1Event = void 0;\n/**\n* Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data.\n*/\nclass EventsV1Event {\n static getAttributeTypeMap() {\n return EventsV1Event.attributeTypeMap;\n }\n}\nexports.EventsV1Event = EventsV1Event;\nEventsV1Event.discriminator = undefined;\nEventsV1Event.attributeTypeMap = [\n {\n \"name\": \"action\",\n \"baseName\": \"action\",\n \"type\": \"string\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"deprecatedCount\",\n \"baseName\": \"deprecatedCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"deprecatedFirstTimestamp\",\n \"baseName\": \"deprecatedFirstTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"deprecatedLastTimestamp\",\n \"baseName\": \"deprecatedLastTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"deprecatedSource\",\n \"baseName\": \"deprecatedSource\",\n \"type\": \"V1EventSource\"\n },\n {\n \"name\": \"eventTime\",\n \"baseName\": \"eventTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"note\",\n \"baseName\": \"note\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"regarding\",\n \"baseName\": \"regarding\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"related\",\n \"baseName\": \"related\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"reportingController\",\n \"baseName\": \"reportingController\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reportingInstance\",\n \"baseName\": \"reportingInstance\",\n \"type\": \"string\"\n },\n {\n \"name\": \"series\",\n \"baseName\": \"series\",\n \"type\": \"EventsV1EventSeries\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=eventsV1Event.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventsV1EventList = void 0;\n/**\n* EventList is a list of Event objects.\n*/\nclass EventsV1EventList {\n static getAttributeTypeMap() {\n return EventsV1EventList.attributeTypeMap;\n }\n}\nexports.EventsV1EventList = EventsV1EventList;\nEventsV1EventList.discriminator = undefined;\nEventsV1EventList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=eventsV1EventList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EventsV1EventSeries = void 0;\n/**\n* EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time. How often to update the EventSeries is up to the event reporters. The default event reporter in \\\"k8s.io/client-go/tools/events/event_broadcaster.go\\\" shows how this struct is updated on heartbeats and can guide customized reporter implementations.\n*/\nclass EventsV1EventSeries {\n static getAttributeTypeMap() {\n return EventsV1EventSeries.attributeTypeMap;\n }\n}\nexports.EventsV1EventSeries = EventsV1EventSeries;\nEventsV1EventSeries.discriminator = undefined;\nEventsV1EventSeries.attributeTypeMap = [\n {\n \"name\": \"count\",\n \"baseName\": \"count\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastObservedTime\",\n \"baseName\": \"lastObservedTime\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=eventsV1EventSeries.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VoidAuth = exports.OAuth = exports.ApiKeyAuth = exports.HttpBearerAuth = exports.HttpBasicAuth = exports.ObjectSerializer = void 0;\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./admissionregistrationV1ServiceReference\"), exports);\ntslib_1.__exportStar(require(\"./admissionregistrationV1WebhookClientConfig\"), exports);\ntslib_1.__exportStar(require(\"./apiextensionsV1ServiceReference\"), exports);\ntslib_1.__exportStar(require(\"./apiextensionsV1WebhookClientConfig\"), exports);\ntslib_1.__exportStar(require(\"./apiregistrationV1ServiceReference\"), exports);\ntslib_1.__exportStar(require(\"./authenticationV1TokenRequest\"), exports);\ntslib_1.__exportStar(require(\"./coreV1EndpointPort\"), exports);\ntslib_1.__exportStar(require(\"./coreV1Event\"), exports);\ntslib_1.__exportStar(require(\"./coreV1EventList\"), exports);\ntslib_1.__exportStar(require(\"./coreV1EventSeries\"), exports);\ntslib_1.__exportStar(require(\"./discoveryV1EndpointPort\"), exports);\ntslib_1.__exportStar(require(\"./eventsV1Event\"), exports);\ntslib_1.__exportStar(require(\"./eventsV1EventList\"), exports);\ntslib_1.__exportStar(require(\"./eventsV1EventSeries\"), exports);\ntslib_1.__exportStar(require(\"./storageV1TokenRequest\"), exports);\ntslib_1.__exportStar(require(\"./v1APIGroup\"), exports);\ntslib_1.__exportStar(require(\"./v1APIGroupList\"), exports);\ntslib_1.__exportStar(require(\"./v1APIResource\"), exports);\ntslib_1.__exportStar(require(\"./v1APIResourceList\"), exports);\ntslib_1.__exportStar(require(\"./v1APIService\"), exports);\ntslib_1.__exportStar(require(\"./v1APIServiceCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1APIServiceList\"), exports);\ntslib_1.__exportStar(require(\"./v1APIServiceSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1APIServiceStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1APIVersions\"), exports);\ntslib_1.__exportStar(require(\"./v1AWSElasticBlockStoreVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Affinity\"), exports);\ntslib_1.__exportStar(require(\"./v1AggregationRule\"), exports);\ntslib_1.__exportStar(require(\"./v1AttachedVolume\"), exports);\ntslib_1.__exportStar(require(\"./v1AzureDiskVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1AzureFilePersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1AzureFileVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Binding\"), exports);\ntslib_1.__exportStar(require(\"./v1BoundObjectReference\"), exports);\ntslib_1.__exportStar(require(\"./v1CSIDriver\"), exports);\ntslib_1.__exportStar(require(\"./v1CSIDriverList\"), exports);\ntslib_1.__exportStar(require(\"./v1CSIDriverSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1CSINode\"), exports);\ntslib_1.__exportStar(require(\"./v1CSINodeDriver\"), exports);\ntslib_1.__exportStar(require(\"./v1CSINodeList\"), exports);\ntslib_1.__exportStar(require(\"./v1CSINodeSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1CSIPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1CSIVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Capabilities\"), exports);\ntslib_1.__exportStar(require(\"./v1CephFSPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1CephFSVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1CertificateSigningRequest\"), exports);\ntslib_1.__exportStar(require(\"./v1CertificateSigningRequestCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1CertificateSigningRequestList\"), exports);\ntslib_1.__exportStar(require(\"./v1CertificateSigningRequestSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1CertificateSigningRequestStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1CinderPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1CinderVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ClientIPConfig\"), exports);\ntslib_1.__exportStar(require(\"./v1ClusterRole\"), exports);\ntslib_1.__exportStar(require(\"./v1ClusterRoleBinding\"), exports);\ntslib_1.__exportStar(require(\"./v1ClusterRoleBindingList\"), exports);\ntslib_1.__exportStar(require(\"./v1ClusterRoleList\"), exports);\ntslib_1.__exportStar(require(\"./v1ComponentCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1ComponentStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1ComponentStatusList\"), exports);\ntslib_1.__exportStar(require(\"./v1Condition\"), exports);\ntslib_1.__exportStar(require(\"./v1ConfigMap\"), exports);\ntslib_1.__exportStar(require(\"./v1ConfigMapEnvSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ConfigMapKeySelector\"), exports);\ntslib_1.__exportStar(require(\"./v1ConfigMapList\"), exports);\ntslib_1.__exportStar(require(\"./v1ConfigMapNodeConfigSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ConfigMapProjection\"), exports);\ntslib_1.__exportStar(require(\"./v1ConfigMapVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Container\"), exports);\ntslib_1.__exportStar(require(\"./v1ContainerImage\"), exports);\ntslib_1.__exportStar(require(\"./v1ContainerPort\"), exports);\ntslib_1.__exportStar(require(\"./v1ContainerState\"), exports);\ntslib_1.__exportStar(require(\"./v1ContainerStateRunning\"), exports);\ntslib_1.__exportStar(require(\"./v1ContainerStateTerminated\"), exports);\ntslib_1.__exportStar(require(\"./v1ContainerStateWaiting\"), exports);\ntslib_1.__exportStar(require(\"./v1ContainerStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1ControllerRevision\"), exports);\ntslib_1.__exportStar(require(\"./v1ControllerRevisionList\"), exports);\ntslib_1.__exportStar(require(\"./v1CronJob\"), exports);\ntslib_1.__exportStar(require(\"./v1CronJobList\"), exports);\ntslib_1.__exportStar(require(\"./v1CronJobSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1CronJobStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1CrossVersionObjectReference\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceColumnDefinition\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceConversion\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceDefinition\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceDefinitionCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceDefinitionList\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceDefinitionNames\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceDefinitionSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceDefinitionStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceDefinitionVersion\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceSubresourceScale\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceSubresources\"), exports);\ntslib_1.__exportStar(require(\"./v1CustomResourceValidation\"), exports);\ntslib_1.__exportStar(require(\"./v1DaemonEndpoint\"), exports);\ntslib_1.__exportStar(require(\"./v1DaemonSet\"), exports);\ntslib_1.__exportStar(require(\"./v1DaemonSetCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1DaemonSetList\"), exports);\ntslib_1.__exportStar(require(\"./v1DaemonSetSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1DaemonSetStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1DaemonSetUpdateStrategy\"), exports);\ntslib_1.__exportStar(require(\"./v1DeleteOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1Deployment\"), exports);\ntslib_1.__exportStar(require(\"./v1DeploymentCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1DeploymentList\"), exports);\ntslib_1.__exportStar(require(\"./v1DeploymentSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1DeploymentStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1DeploymentStrategy\"), exports);\ntslib_1.__exportStar(require(\"./v1DownwardAPIProjection\"), exports);\ntslib_1.__exportStar(require(\"./v1DownwardAPIVolumeFile\"), exports);\ntslib_1.__exportStar(require(\"./v1DownwardAPIVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1EmptyDirVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Endpoint\"), exports);\ntslib_1.__exportStar(require(\"./v1EndpointAddress\"), exports);\ntslib_1.__exportStar(require(\"./v1EndpointConditions\"), exports);\ntslib_1.__exportStar(require(\"./v1EndpointHints\"), exports);\ntslib_1.__exportStar(require(\"./v1EndpointSlice\"), exports);\ntslib_1.__exportStar(require(\"./v1EndpointSliceList\"), exports);\ntslib_1.__exportStar(require(\"./v1EndpointSubset\"), exports);\ntslib_1.__exportStar(require(\"./v1Endpoints\"), exports);\ntslib_1.__exportStar(require(\"./v1EndpointsList\"), exports);\ntslib_1.__exportStar(require(\"./v1EnvFromSource\"), exports);\ntslib_1.__exportStar(require(\"./v1EnvVar\"), exports);\ntslib_1.__exportStar(require(\"./v1EnvVarSource\"), exports);\ntslib_1.__exportStar(require(\"./v1EphemeralContainer\"), exports);\ntslib_1.__exportStar(require(\"./v1EphemeralVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1EventSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Eviction\"), exports);\ntslib_1.__exportStar(require(\"./v1ExecAction\"), exports);\ntslib_1.__exportStar(require(\"./v1ExternalDocumentation\"), exports);\ntslib_1.__exportStar(require(\"./v1FCVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1FlexPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1FlexVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1FlockerVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ForZone\"), exports);\ntslib_1.__exportStar(require(\"./v1GCEPersistentDiskVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1GitRepoVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1GlusterfsPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1GlusterfsVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1GroupVersionForDiscovery\"), exports);\ntslib_1.__exportStar(require(\"./v1HTTPGetAction\"), exports);\ntslib_1.__exportStar(require(\"./v1HTTPHeader\"), exports);\ntslib_1.__exportStar(require(\"./v1HTTPIngressPath\"), exports);\ntslib_1.__exportStar(require(\"./v1HTTPIngressRuleValue\"), exports);\ntslib_1.__exportStar(require(\"./v1Handler\"), exports);\ntslib_1.__exportStar(require(\"./v1HorizontalPodAutoscaler\"), exports);\ntslib_1.__exportStar(require(\"./v1HorizontalPodAutoscalerList\"), exports);\ntslib_1.__exportStar(require(\"./v1HorizontalPodAutoscalerSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1HorizontalPodAutoscalerStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1HostAlias\"), exports);\ntslib_1.__exportStar(require(\"./v1HostPathVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1IPBlock\"), exports);\ntslib_1.__exportStar(require(\"./v1ISCSIPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ISCSIVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Ingress\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressBackend\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressClass\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressClassList\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressClassParametersReference\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressClassSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressList\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressRule\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressServiceBackend\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1IngressTLS\"), exports);\ntslib_1.__exportStar(require(\"./v1JSONSchemaProps\"), exports);\ntslib_1.__exportStar(require(\"./v1Job\"), exports);\ntslib_1.__exportStar(require(\"./v1JobCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1JobList\"), exports);\ntslib_1.__exportStar(require(\"./v1JobSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1JobStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1JobTemplateSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1KeyToPath\"), exports);\ntslib_1.__exportStar(require(\"./v1LabelSelector\"), exports);\ntslib_1.__exportStar(require(\"./v1LabelSelectorRequirement\"), exports);\ntslib_1.__exportStar(require(\"./v1Lease\"), exports);\ntslib_1.__exportStar(require(\"./v1LeaseList\"), exports);\ntslib_1.__exportStar(require(\"./v1LeaseSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1Lifecycle\"), exports);\ntslib_1.__exportStar(require(\"./v1LimitRange\"), exports);\ntslib_1.__exportStar(require(\"./v1LimitRangeItem\"), exports);\ntslib_1.__exportStar(require(\"./v1LimitRangeList\"), exports);\ntslib_1.__exportStar(require(\"./v1LimitRangeSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1ListMeta\"), exports);\ntslib_1.__exportStar(require(\"./v1LoadBalancerIngress\"), exports);\ntslib_1.__exportStar(require(\"./v1LoadBalancerStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1LocalObjectReference\"), exports);\ntslib_1.__exportStar(require(\"./v1LocalSubjectAccessReview\"), exports);\ntslib_1.__exportStar(require(\"./v1LocalVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ManagedFieldsEntry\"), exports);\ntslib_1.__exportStar(require(\"./v1MutatingWebhook\"), exports);\ntslib_1.__exportStar(require(\"./v1MutatingWebhookConfiguration\"), exports);\ntslib_1.__exportStar(require(\"./v1MutatingWebhookConfigurationList\"), exports);\ntslib_1.__exportStar(require(\"./v1NFSVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Namespace\"), exports);\ntslib_1.__exportStar(require(\"./v1NamespaceCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1NamespaceList\"), exports);\ntslib_1.__exportStar(require(\"./v1NamespaceSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1NamespaceStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1NetworkPolicy\"), exports);\ntslib_1.__exportStar(require(\"./v1NetworkPolicyEgressRule\"), exports);\ntslib_1.__exportStar(require(\"./v1NetworkPolicyIngressRule\"), exports);\ntslib_1.__exportStar(require(\"./v1NetworkPolicyList\"), exports);\ntslib_1.__exportStar(require(\"./v1NetworkPolicyPeer\"), exports);\ntslib_1.__exportStar(require(\"./v1NetworkPolicyPort\"), exports);\ntslib_1.__exportStar(require(\"./v1NetworkPolicySpec\"), exports);\ntslib_1.__exportStar(require(\"./v1Node\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeAddress\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeAffinity\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeConfigSource\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeConfigStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeDaemonEndpoints\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeList\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeSelector\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeSelectorRequirement\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeSelectorTerm\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1NodeSystemInfo\"), exports);\ntslib_1.__exportStar(require(\"./v1NonResourceAttributes\"), exports);\ntslib_1.__exportStar(require(\"./v1NonResourceRule\"), exports);\ntslib_1.__exportStar(require(\"./v1ObjectFieldSelector\"), exports);\ntslib_1.__exportStar(require(\"./v1ObjectMeta\"), exports);\ntslib_1.__exportStar(require(\"./v1ObjectReference\"), exports);\ntslib_1.__exportStar(require(\"./v1Overhead\"), exports);\ntslib_1.__exportStar(require(\"./v1OwnerReference\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolume\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeClaim\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeClaimCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeClaimList\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeClaimSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeClaimStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeClaimTemplate\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeClaimVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeList\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1PersistentVolumeStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1PhotonPersistentDiskVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Pod\"), exports);\ntslib_1.__exportStar(require(\"./v1PodAffinity\"), exports);\ntslib_1.__exportStar(require(\"./v1PodAffinityTerm\"), exports);\ntslib_1.__exportStar(require(\"./v1PodAntiAffinity\"), exports);\ntslib_1.__exportStar(require(\"./v1PodCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1PodDNSConfig\"), exports);\ntslib_1.__exportStar(require(\"./v1PodDNSConfigOption\"), exports);\ntslib_1.__exportStar(require(\"./v1PodDisruptionBudget\"), exports);\ntslib_1.__exportStar(require(\"./v1PodDisruptionBudgetList\"), exports);\ntslib_1.__exportStar(require(\"./v1PodDisruptionBudgetSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1PodDisruptionBudgetStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1PodIP\"), exports);\ntslib_1.__exportStar(require(\"./v1PodList\"), exports);\ntslib_1.__exportStar(require(\"./v1PodReadinessGate\"), exports);\ntslib_1.__exportStar(require(\"./v1PodSecurityContext\"), exports);\ntslib_1.__exportStar(require(\"./v1PodSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1PodStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1PodTemplate\"), exports);\ntslib_1.__exportStar(require(\"./v1PodTemplateList\"), exports);\ntslib_1.__exportStar(require(\"./v1PodTemplateSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1PolicyRule\"), exports);\ntslib_1.__exportStar(require(\"./v1PortStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1PortworxVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Preconditions\"), exports);\ntslib_1.__exportStar(require(\"./v1PreferredSchedulingTerm\"), exports);\ntslib_1.__exportStar(require(\"./v1PriorityClass\"), exports);\ntslib_1.__exportStar(require(\"./v1PriorityClassList\"), exports);\ntslib_1.__exportStar(require(\"./v1Probe\"), exports);\ntslib_1.__exportStar(require(\"./v1ProjectedVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1QuobyteVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1RBDPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1RBDVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicaSet\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicaSetCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicaSetList\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicaSetSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicaSetStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicationController\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicationControllerCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicationControllerList\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicationControllerSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1ReplicationControllerStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1ResourceAttributes\"), exports);\ntslib_1.__exportStar(require(\"./v1ResourceFieldSelector\"), exports);\ntslib_1.__exportStar(require(\"./v1ResourceQuota\"), exports);\ntslib_1.__exportStar(require(\"./v1ResourceQuotaList\"), exports);\ntslib_1.__exportStar(require(\"./v1ResourceQuotaSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1ResourceQuotaStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1ResourceRequirements\"), exports);\ntslib_1.__exportStar(require(\"./v1ResourceRule\"), exports);\ntslib_1.__exportStar(require(\"./v1Role\"), exports);\ntslib_1.__exportStar(require(\"./v1RoleBinding\"), exports);\ntslib_1.__exportStar(require(\"./v1RoleBindingList\"), exports);\ntslib_1.__exportStar(require(\"./v1RoleList\"), exports);\ntslib_1.__exportStar(require(\"./v1RoleRef\"), exports);\ntslib_1.__exportStar(require(\"./v1RollingUpdateDaemonSet\"), exports);\ntslib_1.__exportStar(require(\"./v1RollingUpdateDeployment\"), exports);\ntslib_1.__exportStar(require(\"./v1RollingUpdateStatefulSetStrategy\"), exports);\ntslib_1.__exportStar(require(\"./v1RuleWithOperations\"), exports);\ntslib_1.__exportStar(require(\"./v1RuntimeClass\"), exports);\ntslib_1.__exportStar(require(\"./v1RuntimeClassList\"), exports);\ntslib_1.__exportStar(require(\"./v1SELinuxOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1Scale\"), exports);\ntslib_1.__exportStar(require(\"./v1ScaleIOPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ScaleIOVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1ScaleSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1ScaleStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1Scheduling\"), exports);\ntslib_1.__exportStar(require(\"./v1ScopeSelector\"), exports);\ntslib_1.__exportStar(require(\"./v1ScopedResourceSelectorRequirement\"), exports);\ntslib_1.__exportStar(require(\"./v1SeccompProfile\"), exports);\ntslib_1.__exportStar(require(\"./v1Secret\"), exports);\ntslib_1.__exportStar(require(\"./v1SecretEnvSource\"), exports);\ntslib_1.__exportStar(require(\"./v1SecretKeySelector\"), exports);\ntslib_1.__exportStar(require(\"./v1SecretList\"), exports);\ntslib_1.__exportStar(require(\"./v1SecretProjection\"), exports);\ntslib_1.__exportStar(require(\"./v1SecretReference\"), exports);\ntslib_1.__exportStar(require(\"./v1SecretVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1SecurityContext\"), exports);\ntslib_1.__exportStar(require(\"./v1SelfSubjectAccessReview\"), exports);\ntslib_1.__exportStar(require(\"./v1SelfSubjectAccessReviewSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1SelfSubjectRulesReview\"), exports);\ntslib_1.__exportStar(require(\"./v1SelfSubjectRulesReviewSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1ServerAddressByClientCIDR\"), exports);\ntslib_1.__exportStar(require(\"./v1Service\"), exports);\ntslib_1.__exportStar(require(\"./v1ServiceAccount\"), exports);\ntslib_1.__exportStar(require(\"./v1ServiceAccountList\"), exports);\ntslib_1.__exportStar(require(\"./v1ServiceAccountTokenProjection\"), exports);\ntslib_1.__exportStar(require(\"./v1ServiceBackendPort\"), exports);\ntslib_1.__exportStar(require(\"./v1ServiceList\"), exports);\ntslib_1.__exportStar(require(\"./v1ServicePort\"), exports);\ntslib_1.__exportStar(require(\"./v1ServiceSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1ServiceStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1SessionAffinityConfig\"), exports);\ntslib_1.__exportStar(require(\"./v1StatefulSet\"), exports);\ntslib_1.__exportStar(require(\"./v1StatefulSetCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1StatefulSetList\"), exports);\ntslib_1.__exportStar(require(\"./v1StatefulSetSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1StatefulSetStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1StatefulSetUpdateStrategy\"), exports);\ntslib_1.__exportStar(require(\"./v1Status\"), exports);\ntslib_1.__exportStar(require(\"./v1StatusCause\"), exports);\ntslib_1.__exportStar(require(\"./v1StatusDetails\"), exports);\ntslib_1.__exportStar(require(\"./v1StorageClass\"), exports);\ntslib_1.__exportStar(require(\"./v1StorageClassList\"), exports);\ntslib_1.__exportStar(require(\"./v1StorageOSPersistentVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1StorageOSVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1Subject\"), exports);\ntslib_1.__exportStar(require(\"./v1SubjectAccessReview\"), exports);\ntslib_1.__exportStar(require(\"./v1SubjectAccessReviewSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1SubjectAccessReviewStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1SubjectRulesReviewStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1Sysctl\"), exports);\ntslib_1.__exportStar(require(\"./v1TCPSocketAction\"), exports);\ntslib_1.__exportStar(require(\"./v1Taint\"), exports);\ntslib_1.__exportStar(require(\"./v1TokenRequestSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1TokenRequestStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1TokenReview\"), exports);\ntslib_1.__exportStar(require(\"./v1TokenReviewSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1TokenReviewStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1Toleration\"), exports);\ntslib_1.__exportStar(require(\"./v1TopologySelectorLabelRequirement\"), exports);\ntslib_1.__exportStar(require(\"./v1TopologySelectorTerm\"), exports);\ntslib_1.__exportStar(require(\"./v1TopologySpreadConstraint\"), exports);\ntslib_1.__exportStar(require(\"./v1TypedLocalObjectReference\"), exports);\ntslib_1.__exportStar(require(\"./v1UncountedTerminatedPods\"), exports);\ntslib_1.__exportStar(require(\"./v1UserInfo\"), exports);\ntslib_1.__exportStar(require(\"./v1ValidatingWebhook\"), exports);\ntslib_1.__exportStar(require(\"./v1ValidatingWebhookConfiguration\"), exports);\ntslib_1.__exportStar(require(\"./v1ValidatingWebhookConfigurationList\"), exports);\ntslib_1.__exportStar(require(\"./v1Volume\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeAttachment\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeAttachmentList\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeAttachmentSource\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeAttachmentSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeAttachmentStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeDevice\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeError\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeMount\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeNodeAffinity\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeNodeResources\"), exports);\ntslib_1.__exportStar(require(\"./v1VolumeProjection\"), exports);\ntslib_1.__exportStar(require(\"./v1VsphereVirtualDiskVolumeSource\"), exports);\ntslib_1.__exportStar(require(\"./v1WatchEvent\"), exports);\ntslib_1.__exportStar(require(\"./v1WebhookConversion\"), exports);\ntslib_1.__exportStar(require(\"./v1WeightedPodAffinityTerm\"), exports);\ntslib_1.__exportStar(require(\"./v1WindowsSecurityContextOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1AggregationRule\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1CSIStorageCapacity\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1CSIStorageCapacityList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1ClusterRole\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1ClusterRoleBinding\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1ClusterRoleBindingList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1ClusterRoleList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1Overhead\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1PolicyRule\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1PriorityClass\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1PriorityClassList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1Role\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1RoleBinding\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1RoleBindingList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1RoleList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1RoleRef\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1RuntimeClass\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1RuntimeClassList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1RuntimeClassSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1Scheduling\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1ServerStorageVersion\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1StorageVersion\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1StorageVersionCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1StorageVersionList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1StorageVersionStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1Subject\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1VolumeAttachment\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1VolumeAttachmentList\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1VolumeAttachmentSource\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1VolumeAttachmentSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1VolumeAttachmentStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1alpha1VolumeError\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1AllowedCSIDriver\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1AllowedFlexVolume\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1AllowedHostPath\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1CSIStorageCapacity\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1CSIStorageCapacityList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1CronJob\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1CronJobList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1CronJobSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1CronJobStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1Endpoint\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1EndpointConditions\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1EndpointHints\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1EndpointPort\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1EndpointSlice\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1EndpointSliceList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1Event\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1EventList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1EventSeries\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1FSGroupStrategyOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1FlowDistinguisherMethod\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1FlowSchema\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1FlowSchemaCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1FlowSchemaList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1FlowSchemaSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1FlowSchemaStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1ForZone\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1GroupSubject\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1HostPortRange\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1IDRange\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1JobTemplateSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1LimitResponse\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1LimitedPriorityLevelConfiguration\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1NonResourcePolicyRule\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1Overhead\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PodDisruptionBudget\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PodDisruptionBudgetList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PodDisruptionBudgetSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PodDisruptionBudgetStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PodSecurityPolicy\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PodSecurityPolicyList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PodSecurityPolicySpec\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PolicyRulesWithSubjects\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PriorityLevelConfiguration\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PriorityLevelConfigurationCondition\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PriorityLevelConfigurationList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PriorityLevelConfigurationReference\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PriorityLevelConfigurationSpec\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1PriorityLevelConfigurationStatus\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1QueuingConfiguration\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1ResourcePolicyRule\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1RunAsGroupStrategyOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1RunAsUserStrategyOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1RuntimeClass\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1RuntimeClassList\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1RuntimeClassStrategyOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1SELinuxStrategyOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1Scheduling\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1ServiceAccountSubject\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1Subject\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1SupplementalGroupsStrategyOptions\"), exports);\ntslib_1.__exportStar(require(\"./v1beta1UserSubject\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1ContainerResourceMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1ContainerResourceMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1CrossVersionObjectReference\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1ExternalMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1ExternalMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1HorizontalPodAutoscaler\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1HorizontalPodAutoscalerCondition\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1HorizontalPodAutoscalerList\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1HorizontalPodAutoscalerSpec\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1HorizontalPodAutoscalerStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1MetricSpec\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1MetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1ObjectMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1ObjectMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1PodsMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1PodsMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1ResourceMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta1ResourceMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2ContainerResourceMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2ContainerResourceMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2CrossVersionObjectReference\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2ExternalMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2ExternalMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2HPAScalingPolicy\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2HPAScalingRules\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2HorizontalPodAutoscaler\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2HorizontalPodAutoscalerBehavior\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2HorizontalPodAutoscalerCondition\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2HorizontalPodAutoscalerList\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2HorizontalPodAutoscalerSpec\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2HorizontalPodAutoscalerStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2MetricIdentifier\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2MetricSpec\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2MetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2MetricTarget\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2MetricValueStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2ObjectMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2ObjectMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2PodsMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2PodsMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2ResourceMetricSource\"), exports);\ntslib_1.__exportStar(require(\"./v2beta2ResourceMetricStatus\"), exports);\ntslib_1.__exportStar(require(\"./versionInfo\"), exports);\nconst admissionregistrationV1ServiceReference_1 = require(\"./admissionregistrationV1ServiceReference\");\nconst admissionregistrationV1WebhookClientConfig_1 = require(\"./admissionregistrationV1WebhookClientConfig\");\nconst apiextensionsV1ServiceReference_1 = require(\"./apiextensionsV1ServiceReference\");\nconst apiextensionsV1WebhookClientConfig_1 = require(\"./apiextensionsV1WebhookClientConfig\");\nconst apiregistrationV1ServiceReference_1 = require(\"./apiregistrationV1ServiceReference\");\nconst authenticationV1TokenRequest_1 = require(\"./authenticationV1TokenRequest\");\nconst coreV1EndpointPort_1 = require(\"./coreV1EndpointPort\");\nconst coreV1Event_1 = require(\"./coreV1Event\");\nconst coreV1EventList_1 = require(\"./coreV1EventList\");\nconst coreV1EventSeries_1 = require(\"./coreV1EventSeries\");\nconst discoveryV1EndpointPort_1 = require(\"./discoveryV1EndpointPort\");\nconst eventsV1Event_1 = require(\"./eventsV1Event\");\nconst eventsV1EventList_1 = require(\"./eventsV1EventList\");\nconst eventsV1EventSeries_1 = require(\"./eventsV1EventSeries\");\nconst storageV1TokenRequest_1 = require(\"./storageV1TokenRequest\");\nconst v1APIGroup_1 = require(\"./v1APIGroup\");\nconst v1APIGroupList_1 = require(\"./v1APIGroupList\");\nconst v1APIResource_1 = require(\"./v1APIResource\");\nconst v1APIResourceList_1 = require(\"./v1APIResourceList\");\nconst v1APIService_1 = require(\"./v1APIService\");\nconst v1APIServiceCondition_1 = require(\"./v1APIServiceCondition\");\nconst v1APIServiceList_1 = require(\"./v1APIServiceList\");\nconst v1APIServiceSpec_1 = require(\"./v1APIServiceSpec\");\nconst v1APIServiceStatus_1 = require(\"./v1APIServiceStatus\");\nconst v1APIVersions_1 = require(\"./v1APIVersions\");\nconst v1AWSElasticBlockStoreVolumeSource_1 = require(\"./v1AWSElasticBlockStoreVolumeSource\");\nconst v1Affinity_1 = require(\"./v1Affinity\");\nconst v1AggregationRule_1 = require(\"./v1AggregationRule\");\nconst v1AttachedVolume_1 = require(\"./v1AttachedVolume\");\nconst v1AzureDiskVolumeSource_1 = require(\"./v1AzureDiskVolumeSource\");\nconst v1AzureFilePersistentVolumeSource_1 = require(\"./v1AzureFilePersistentVolumeSource\");\nconst v1AzureFileVolumeSource_1 = require(\"./v1AzureFileVolumeSource\");\nconst v1Binding_1 = require(\"./v1Binding\");\nconst v1BoundObjectReference_1 = require(\"./v1BoundObjectReference\");\nconst v1CSIDriver_1 = require(\"./v1CSIDriver\");\nconst v1CSIDriverList_1 = require(\"./v1CSIDriverList\");\nconst v1CSIDriverSpec_1 = require(\"./v1CSIDriverSpec\");\nconst v1CSINode_1 = require(\"./v1CSINode\");\nconst v1CSINodeDriver_1 = require(\"./v1CSINodeDriver\");\nconst v1CSINodeList_1 = require(\"./v1CSINodeList\");\nconst v1CSINodeSpec_1 = require(\"./v1CSINodeSpec\");\nconst v1CSIPersistentVolumeSource_1 = require(\"./v1CSIPersistentVolumeSource\");\nconst v1CSIVolumeSource_1 = require(\"./v1CSIVolumeSource\");\nconst v1Capabilities_1 = require(\"./v1Capabilities\");\nconst v1CephFSPersistentVolumeSource_1 = require(\"./v1CephFSPersistentVolumeSource\");\nconst v1CephFSVolumeSource_1 = require(\"./v1CephFSVolumeSource\");\nconst v1CertificateSigningRequest_1 = require(\"./v1CertificateSigningRequest\");\nconst v1CertificateSigningRequestCondition_1 = require(\"./v1CertificateSigningRequestCondition\");\nconst v1CertificateSigningRequestList_1 = require(\"./v1CertificateSigningRequestList\");\nconst v1CertificateSigningRequestSpec_1 = require(\"./v1CertificateSigningRequestSpec\");\nconst v1CertificateSigningRequestStatus_1 = require(\"./v1CertificateSigningRequestStatus\");\nconst v1CinderPersistentVolumeSource_1 = require(\"./v1CinderPersistentVolumeSource\");\nconst v1CinderVolumeSource_1 = require(\"./v1CinderVolumeSource\");\nconst v1ClientIPConfig_1 = require(\"./v1ClientIPConfig\");\nconst v1ClusterRole_1 = require(\"./v1ClusterRole\");\nconst v1ClusterRoleBinding_1 = require(\"./v1ClusterRoleBinding\");\nconst v1ClusterRoleBindingList_1 = require(\"./v1ClusterRoleBindingList\");\nconst v1ClusterRoleList_1 = require(\"./v1ClusterRoleList\");\nconst v1ComponentCondition_1 = require(\"./v1ComponentCondition\");\nconst v1ComponentStatus_1 = require(\"./v1ComponentStatus\");\nconst v1ComponentStatusList_1 = require(\"./v1ComponentStatusList\");\nconst v1Condition_1 = require(\"./v1Condition\");\nconst v1ConfigMap_1 = require(\"./v1ConfigMap\");\nconst v1ConfigMapEnvSource_1 = require(\"./v1ConfigMapEnvSource\");\nconst v1ConfigMapKeySelector_1 = require(\"./v1ConfigMapKeySelector\");\nconst v1ConfigMapList_1 = require(\"./v1ConfigMapList\");\nconst v1ConfigMapNodeConfigSource_1 = require(\"./v1ConfigMapNodeConfigSource\");\nconst v1ConfigMapProjection_1 = require(\"./v1ConfigMapProjection\");\nconst v1ConfigMapVolumeSource_1 = require(\"./v1ConfigMapVolumeSource\");\nconst v1Container_1 = require(\"./v1Container\");\nconst v1ContainerImage_1 = require(\"./v1ContainerImage\");\nconst v1ContainerPort_1 = require(\"./v1ContainerPort\");\nconst v1ContainerState_1 = require(\"./v1ContainerState\");\nconst v1ContainerStateRunning_1 = require(\"./v1ContainerStateRunning\");\nconst v1ContainerStateTerminated_1 = require(\"./v1ContainerStateTerminated\");\nconst v1ContainerStateWaiting_1 = require(\"./v1ContainerStateWaiting\");\nconst v1ContainerStatus_1 = require(\"./v1ContainerStatus\");\nconst v1ControllerRevision_1 = require(\"./v1ControllerRevision\");\nconst v1ControllerRevisionList_1 = require(\"./v1ControllerRevisionList\");\nconst v1CronJob_1 = require(\"./v1CronJob\");\nconst v1CronJobList_1 = require(\"./v1CronJobList\");\nconst v1CronJobSpec_1 = require(\"./v1CronJobSpec\");\nconst v1CronJobStatus_1 = require(\"./v1CronJobStatus\");\nconst v1CrossVersionObjectReference_1 = require(\"./v1CrossVersionObjectReference\");\nconst v1CustomResourceColumnDefinition_1 = require(\"./v1CustomResourceColumnDefinition\");\nconst v1CustomResourceConversion_1 = require(\"./v1CustomResourceConversion\");\nconst v1CustomResourceDefinition_1 = require(\"./v1CustomResourceDefinition\");\nconst v1CustomResourceDefinitionCondition_1 = require(\"./v1CustomResourceDefinitionCondition\");\nconst v1CustomResourceDefinitionList_1 = require(\"./v1CustomResourceDefinitionList\");\nconst v1CustomResourceDefinitionNames_1 = require(\"./v1CustomResourceDefinitionNames\");\nconst v1CustomResourceDefinitionSpec_1 = require(\"./v1CustomResourceDefinitionSpec\");\nconst v1CustomResourceDefinitionStatus_1 = require(\"./v1CustomResourceDefinitionStatus\");\nconst v1CustomResourceDefinitionVersion_1 = require(\"./v1CustomResourceDefinitionVersion\");\nconst v1CustomResourceSubresourceScale_1 = require(\"./v1CustomResourceSubresourceScale\");\nconst v1CustomResourceSubresources_1 = require(\"./v1CustomResourceSubresources\");\nconst v1CustomResourceValidation_1 = require(\"./v1CustomResourceValidation\");\nconst v1DaemonEndpoint_1 = require(\"./v1DaemonEndpoint\");\nconst v1DaemonSet_1 = require(\"./v1DaemonSet\");\nconst v1DaemonSetCondition_1 = require(\"./v1DaemonSetCondition\");\nconst v1DaemonSetList_1 = require(\"./v1DaemonSetList\");\nconst v1DaemonSetSpec_1 = require(\"./v1DaemonSetSpec\");\nconst v1DaemonSetStatus_1 = require(\"./v1DaemonSetStatus\");\nconst v1DaemonSetUpdateStrategy_1 = require(\"./v1DaemonSetUpdateStrategy\");\nconst v1DeleteOptions_1 = require(\"./v1DeleteOptions\");\nconst v1Deployment_1 = require(\"./v1Deployment\");\nconst v1DeploymentCondition_1 = require(\"./v1DeploymentCondition\");\nconst v1DeploymentList_1 = require(\"./v1DeploymentList\");\nconst v1DeploymentSpec_1 = require(\"./v1DeploymentSpec\");\nconst v1DeploymentStatus_1 = require(\"./v1DeploymentStatus\");\nconst v1DeploymentStrategy_1 = require(\"./v1DeploymentStrategy\");\nconst v1DownwardAPIProjection_1 = require(\"./v1DownwardAPIProjection\");\nconst v1DownwardAPIVolumeFile_1 = require(\"./v1DownwardAPIVolumeFile\");\nconst v1DownwardAPIVolumeSource_1 = require(\"./v1DownwardAPIVolumeSource\");\nconst v1EmptyDirVolumeSource_1 = require(\"./v1EmptyDirVolumeSource\");\nconst v1Endpoint_1 = require(\"./v1Endpoint\");\nconst v1EndpointAddress_1 = require(\"./v1EndpointAddress\");\nconst v1EndpointConditions_1 = require(\"./v1EndpointConditions\");\nconst v1EndpointHints_1 = require(\"./v1EndpointHints\");\nconst v1EndpointSlice_1 = require(\"./v1EndpointSlice\");\nconst v1EndpointSliceList_1 = require(\"./v1EndpointSliceList\");\nconst v1EndpointSubset_1 = require(\"./v1EndpointSubset\");\nconst v1Endpoints_1 = require(\"./v1Endpoints\");\nconst v1EndpointsList_1 = require(\"./v1EndpointsList\");\nconst v1EnvFromSource_1 = require(\"./v1EnvFromSource\");\nconst v1EnvVar_1 = require(\"./v1EnvVar\");\nconst v1EnvVarSource_1 = require(\"./v1EnvVarSource\");\nconst v1EphemeralContainer_1 = require(\"./v1EphemeralContainer\");\nconst v1EphemeralVolumeSource_1 = require(\"./v1EphemeralVolumeSource\");\nconst v1EventSource_1 = require(\"./v1EventSource\");\nconst v1Eviction_1 = require(\"./v1Eviction\");\nconst v1ExecAction_1 = require(\"./v1ExecAction\");\nconst v1ExternalDocumentation_1 = require(\"./v1ExternalDocumentation\");\nconst v1FCVolumeSource_1 = require(\"./v1FCVolumeSource\");\nconst v1FlexPersistentVolumeSource_1 = require(\"./v1FlexPersistentVolumeSource\");\nconst v1FlexVolumeSource_1 = require(\"./v1FlexVolumeSource\");\nconst v1FlockerVolumeSource_1 = require(\"./v1FlockerVolumeSource\");\nconst v1ForZone_1 = require(\"./v1ForZone\");\nconst v1GCEPersistentDiskVolumeSource_1 = require(\"./v1GCEPersistentDiskVolumeSource\");\nconst v1GitRepoVolumeSource_1 = require(\"./v1GitRepoVolumeSource\");\nconst v1GlusterfsPersistentVolumeSource_1 = require(\"./v1GlusterfsPersistentVolumeSource\");\nconst v1GlusterfsVolumeSource_1 = require(\"./v1GlusterfsVolumeSource\");\nconst v1GroupVersionForDiscovery_1 = require(\"./v1GroupVersionForDiscovery\");\nconst v1HTTPGetAction_1 = require(\"./v1HTTPGetAction\");\nconst v1HTTPHeader_1 = require(\"./v1HTTPHeader\");\nconst v1HTTPIngressPath_1 = require(\"./v1HTTPIngressPath\");\nconst v1HTTPIngressRuleValue_1 = require(\"./v1HTTPIngressRuleValue\");\nconst v1Handler_1 = require(\"./v1Handler\");\nconst v1HorizontalPodAutoscaler_1 = require(\"./v1HorizontalPodAutoscaler\");\nconst v1HorizontalPodAutoscalerList_1 = require(\"./v1HorizontalPodAutoscalerList\");\nconst v1HorizontalPodAutoscalerSpec_1 = require(\"./v1HorizontalPodAutoscalerSpec\");\nconst v1HorizontalPodAutoscalerStatus_1 = require(\"./v1HorizontalPodAutoscalerStatus\");\nconst v1HostAlias_1 = require(\"./v1HostAlias\");\nconst v1HostPathVolumeSource_1 = require(\"./v1HostPathVolumeSource\");\nconst v1IPBlock_1 = require(\"./v1IPBlock\");\nconst v1ISCSIPersistentVolumeSource_1 = require(\"./v1ISCSIPersistentVolumeSource\");\nconst v1ISCSIVolumeSource_1 = require(\"./v1ISCSIVolumeSource\");\nconst v1Ingress_1 = require(\"./v1Ingress\");\nconst v1IngressBackend_1 = require(\"./v1IngressBackend\");\nconst v1IngressClass_1 = require(\"./v1IngressClass\");\nconst v1IngressClassList_1 = require(\"./v1IngressClassList\");\nconst v1IngressClassParametersReference_1 = require(\"./v1IngressClassParametersReference\");\nconst v1IngressClassSpec_1 = require(\"./v1IngressClassSpec\");\nconst v1IngressList_1 = require(\"./v1IngressList\");\nconst v1IngressRule_1 = require(\"./v1IngressRule\");\nconst v1IngressServiceBackend_1 = require(\"./v1IngressServiceBackend\");\nconst v1IngressSpec_1 = require(\"./v1IngressSpec\");\nconst v1IngressStatus_1 = require(\"./v1IngressStatus\");\nconst v1IngressTLS_1 = require(\"./v1IngressTLS\");\nconst v1JSONSchemaProps_1 = require(\"./v1JSONSchemaProps\");\nconst v1Job_1 = require(\"./v1Job\");\nconst v1JobCondition_1 = require(\"./v1JobCondition\");\nconst v1JobList_1 = require(\"./v1JobList\");\nconst v1JobSpec_1 = require(\"./v1JobSpec\");\nconst v1JobStatus_1 = require(\"./v1JobStatus\");\nconst v1JobTemplateSpec_1 = require(\"./v1JobTemplateSpec\");\nconst v1KeyToPath_1 = require(\"./v1KeyToPath\");\nconst v1LabelSelector_1 = require(\"./v1LabelSelector\");\nconst v1LabelSelectorRequirement_1 = require(\"./v1LabelSelectorRequirement\");\nconst v1Lease_1 = require(\"./v1Lease\");\nconst v1LeaseList_1 = require(\"./v1LeaseList\");\nconst v1LeaseSpec_1 = require(\"./v1LeaseSpec\");\nconst v1Lifecycle_1 = require(\"./v1Lifecycle\");\nconst v1LimitRange_1 = require(\"./v1LimitRange\");\nconst v1LimitRangeItem_1 = require(\"./v1LimitRangeItem\");\nconst v1LimitRangeList_1 = require(\"./v1LimitRangeList\");\nconst v1LimitRangeSpec_1 = require(\"./v1LimitRangeSpec\");\nconst v1ListMeta_1 = require(\"./v1ListMeta\");\nconst v1LoadBalancerIngress_1 = require(\"./v1LoadBalancerIngress\");\nconst v1LoadBalancerStatus_1 = require(\"./v1LoadBalancerStatus\");\nconst v1LocalObjectReference_1 = require(\"./v1LocalObjectReference\");\nconst v1LocalSubjectAccessReview_1 = require(\"./v1LocalSubjectAccessReview\");\nconst v1LocalVolumeSource_1 = require(\"./v1LocalVolumeSource\");\nconst v1ManagedFieldsEntry_1 = require(\"./v1ManagedFieldsEntry\");\nconst v1MutatingWebhook_1 = require(\"./v1MutatingWebhook\");\nconst v1MutatingWebhookConfiguration_1 = require(\"./v1MutatingWebhookConfiguration\");\nconst v1MutatingWebhookConfigurationList_1 = require(\"./v1MutatingWebhookConfigurationList\");\nconst v1NFSVolumeSource_1 = require(\"./v1NFSVolumeSource\");\nconst v1Namespace_1 = require(\"./v1Namespace\");\nconst v1NamespaceCondition_1 = require(\"./v1NamespaceCondition\");\nconst v1NamespaceList_1 = require(\"./v1NamespaceList\");\nconst v1NamespaceSpec_1 = require(\"./v1NamespaceSpec\");\nconst v1NamespaceStatus_1 = require(\"./v1NamespaceStatus\");\nconst v1NetworkPolicy_1 = require(\"./v1NetworkPolicy\");\nconst v1NetworkPolicyEgressRule_1 = require(\"./v1NetworkPolicyEgressRule\");\nconst v1NetworkPolicyIngressRule_1 = require(\"./v1NetworkPolicyIngressRule\");\nconst v1NetworkPolicyList_1 = require(\"./v1NetworkPolicyList\");\nconst v1NetworkPolicyPeer_1 = require(\"./v1NetworkPolicyPeer\");\nconst v1NetworkPolicyPort_1 = require(\"./v1NetworkPolicyPort\");\nconst v1NetworkPolicySpec_1 = require(\"./v1NetworkPolicySpec\");\nconst v1Node_1 = require(\"./v1Node\");\nconst v1NodeAddress_1 = require(\"./v1NodeAddress\");\nconst v1NodeAffinity_1 = require(\"./v1NodeAffinity\");\nconst v1NodeCondition_1 = require(\"./v1NodeCondition\");\nconst v1NodeConfigSource_1 = require(\"./v1NodeConfigSource\");\nconst v1NodeConfigStatus_1 = require(\"./v1NodeConfigStatus\");\nconst v1NodeDaemonEndpoints_1 = require(\"./v1NodeDaemonEndpoints\");\nconst v1NodeList_1 = require(\"./v1NodeList\");\nconst v1NodeSelector_1 = require(\"./v1NodeSelector\");\nconst v1NodeSelectorRequirement_1 = require(\"./v1NodeSelectorRequirement\");\nconst v1NodeSelectorTerm_1 = require(\"./v1NodeSelectorTerm\");\nconst v1NodeSpec_1 = require(\"./v1NodeSpec\");\nconst v1NodeStatus_1 = require(\"./v1NodeStatus\");\nconst v1NodeSystemInfo_1 = require(\"./v1NodeSystemInfo\");\nconst v1NonResourceAttributes_1 = require(\"./v1NonResourceAttributes\");\nconst v1NonResourceRule_1 = require(\"./v1NonResourceRule\");\nconst v1ObjectFieldSelector_1 = require(\"./v1ObjectFieldSelector\");\nconst v1ObjectMeta_1 = require(\"./v1ObjectMeta\");\nconst v1ObjectReference_1 = require(\"./v1ObjectReference\");\nconst v1Overhead_1 = require(\"./v1Overhead\");\nconst v1OwnerReference_1 = require(\"./v1OwnerReference\");\nconst v1PersistentVolume_1 = require(\"./v1PersistentVolume\");\nconst v1PersistentVolumeClaim_1 = require(\"./v1PersistentVolumeClaim\");\nconst v1PersistentVolumeClaimCondition_1 = require(\"./v1PersistentVolumeClaimCondition\");\nconst v1PersistentVolumeClaimList_1 = require(\"./v1PersistentVolumeClaimList\");\nconst v1PersistentVolumeClaimSpec_1 = require(\"./v1PersistentVolumeClaimSpec\");\nconst v1PersistentVolumeClaimStatus_1 = require(\"./v1PersistentVolumeClaimStatus\");\nconst v1PersistentVolumeClaimTemplate_1 = require(\"./v1PersistentVolumeClaimTemplate\");\nconst v1PersistentVolumeClaimVolumeSource_1 = require(\"./v1PersistentVolumeClaimVolumeSource\");\nconst v1PersistentVolumeList_1 = require(\"./v1PersistentVolumeList\");\nconst v1PersistentVolumeSpec_1 = require(\"./v1PersistentVolumeSpec\");\nconst v1PersistentVolumeStatus_1 = require(\"./v1PersistentVolumeStatus\");\nconst v1PhotonPersistentDiskVolumeSource_1 = require(\"./v1PhotonPersistentDiskVolumeSource\");\nconst v1Pod_1 = require(\"./v1Pod\");\nconst v1PodAffinity_1 = require(\"./v1PodAffinity\");\nconst v1PodAffinityTerm_1 = require(\"./v1PodAffinityTerm\");\nconst v1PodAntiAffinity_1 = require(\"./v1PodAntiAffinity\");\nconst v1PodCondition_1 = require(\"./v1PodCondition\");\nconst v1PodDNSConfig_1 = require(\"./v1PodDNSConfig\");\nconst v1PodDNSConfigOption_1 = require(\"./v1PodDNSConfigOption\");\nconst v1PodDisruptionBudget_1 = require(\"./v1PodDisruptionBudget\");\nconst v1PodDisruptionBudgetList_1 = require(\"./v1PodDisruptionBudgetList\");\nconst v1PodDisruptionBudgetSpec_1 = require(\"./v1PodDisruptionBudgetSpec\");\nconst v1PodDisruptionBudgetStatus_1 = require(\"./v1PodDisruptionBudgetStatus\");\nconst v1PodIP_1 = require(\"./v1PodIP\");\nconst v1PodList_1 = require(\"./v1PodList\");\nconst v1PodReadinessGate_1 = require(\"./v1PodReadinessGate\");\nconst v1PodSecurityContext_1 = require(\"./v1PodSecurityContext\");\nconst v1PodSpec_1 = require(\"./v1PodSpec\");\nconst v1PodStatus_1 = require(\"./v1PodStatus\");\nconst v1PodTemplate_1 = require(\"./v1PodTemplate\");\nconst v1PodTemplateList_1 = require(\"./v1PodTemplateList\");\nconst v1PodTemplateSpec_1 = require(\"./v1PodTemplateSpec\");\nconst v1PolicyRule_1 = require(\"./v1PolicyRule\");\nconst v1PortStatus_1 = require(\"./v1PortStatus\");\nconst v1PortworxVolumeSource_1 = require(\"./v1PortworxVolumeSource\");\nconst v1Preconditions_1 = require(\"./v1Preconditions\");\nconst v1PreferredSchedulingTerm_1 = require(\"./v1PreferredSchedulingTerm\");\nconst v1PriorityClass_1 = require(\"./v1PriorityClass\");\nconst v1PriorityClassList_1 = require(\"./v1PriorityClassList\");\nconst v1Probe_1 = require(\"./v1Probe\");\nconst v1ProjectedVolumeSource_1 = require(\"./v1ProjectedVolumeSource\");\nconst v1QuobyteVolumeSource_1 = require(\"./v1QuobyteVolumeSource\");\nconst v1RBDPersistentVolumeSource_1 = require(\"./v1RBDPersistentVolumeSource\");\nconst v1RBDVolumeSource_1 = require(\"./v1RBDVolumeSource\");\nconst v1ReplicaSet_1 = require(\"./v1ReplicaSet\");\nconst v1ReplicaSetCondition_1 = require(\"./v1ReplicaSetCondition\");\nconst v1ReplicaSetList_1 = require(\"./v1ReplicaSetList\");\nconst v1ReplicaSetSpec_1 = require(\"./v1ReplicaSetSpec\");\nconst v1ReplicaSetStatus_1 = require(\"./v1ReplicaSetStatus\");\nconst v1ReplicationController_1 = require(\"./v1ReplicationController\");\nconst v1ReplicationControllerCondition_1 = require(\"./v1ReplicationControllerCondition\");\nconst v1ReplicationControllerList_1 = require(\"./v1ReplicationControllerList\");\nconst v1ReplicationControllerSpec_1 = require(\"./v1ReplicationControllerSpec\");\nconst v1ReplicationControllerStatus_1 = require(\"./v1ReplicationControllerStatus\");\nconst v1ResourceAttributes_1 = require(\"./v1ResourceAttributes\");\nconst v1ResourceFieldSelector_1 = require(\"./v1ResourceFieldSelector\");\nconst v1ResourceQuota_1 = require(\"./v1ResourceQuota\");\nconst v1ResourceQuotaList_1 = require(\"./v1ResourceQuotaList\");\nconst v1ResourceQuotaSpec_1 = require(\"./v1ResourceQuotaSpec\");\nconst v1ResourceQuotaStatus_1 = require(\"./v1ResourceQuotaStatus\");\nconst v1ResourceRequirements_1 = require(\"./v1ResourceRequirements\");\nconst v1ResourceRule_1 = require(\"./v1ResourceRule\");\nconst v1Role_1 = require(\"./v1Role\");\nconst v1RoleBinding_1 = require(\"./v1RoleBinding\");\nconst v1RoleBindingList_1 = require(\"./v1RoleBindingList\");\nconst v1RoleList_1 = require(\"./v1RoleList\");\nconst v1RoleRef_1 = require(\"./v1RoleRef\");\nconst v1RollingUpdateDaemonSet_1 = require(\"./v1RollingUpdateDaemonSet\");\nconst v1RollingUpdateDeployment_1 = require(\"./v1RollingUpdateDeployment\");\nconst v1RollingUpdateStatefulSetStrategy_1 = require(\"./v1RollingUpdateStatefulSetStrategy\");\nconst v1RuleWithOperations_1 = require(\"./v1RuleWithOperations\");\nconst v1RuntimeClass_1 = require(\"./v1RuntimeClass\");\nconst v1RuntimeClassList_1 = require(\"./v1RuntimeClassList\");\nconst v1SELinuxOptions_1 = require(\"./v1SELinuxOptions\");\nconst v1Scale_1 = require(\"./v1Scale\");\nconst v1ScaleIOPersistentVolumeSource_1 = require(\"./v1ScaleIOPersistentVolumeSource\");\nconst v1ScaleIOVolumeSource_1 = require(\"./v1ScaleIOVolumeSource\");\nconst v1ScaleSpec_1 = require(\"./v1ScaleSpec\");\nconst v1ScaleStatus_1 = require(\"./v1ScaleStatus\");\nconst v1Scheduling_1 = require(\"./v1Scheduling\");\nconst v1ScopeSelector_1 = require(\"./v1ScopeSelector\");\nconst v1ScopedResourceSelectorRequirement_1 = require(\"./v1ScopedResourceSelectorRequirement\");\nconst v1SeccompProfile_1 = require(\"./v1SeccompProfile\");\nconst v1Secret_1 = require(\"./v1Secret\");\nconst v1SecretEnvSource_1 = require(\"./v1SecretEnvSource\");\nconst v1SecretKeySelector_1 = require(\"./v1SecretKeySelector\");\nconst v1SecretList_1 = require(\"./v1SecretList\");\nconst v1SecretProjection_1 = require(\"./v1SecretProjection\");\nconst v1SecretReference_1 = require(\"./v1SecretReference\");\nconst v1SecretVolumeSource_1 = require(\"./v1SecretVolumeSource\");\nconst v1SecurityContext_1 = require(\"./v1SecurityContext\");\nconst v1SelfSubjectAccessReview_1 = require(\"./v1SelfSubjectAccessReview\");\nconst v1SelfSubjectAccessReviewSpec_1 = require(\"./v1SelfSubjectAccessReviewSpec\");\nconst v1SelfSubjectRulesReview_1 = require(\"./v1SelfSubjectRulesReview\");\nconst v1SelfSubjectRulesReviewSpec_1 = require(\"./v1SelfSubjectRulesReviewSpec\");\nconst v1ServerAddressByClientCIDR_1 = require(\"./v1ServerAddressByClientCIDR\");\nconst v1Service_1 = require(\"./v1Service\");\nconst v1ServiceAccount_1 = require(\"./v1ServiceAccount\");\nconst v1ServiceAccountList_1 = require(\"./v1ServiceAccountList\");\nconst v1ServiceAccountTokenProjection_1 = require(\"./v1ServiceAccountTokenProjection\");\nconst v1ServiceBackendPort_1 = require(\"./v1ServiceBackendPort\");\nconst v1ServiceList_1 = require(\"./v1ServiceList\");\nconst v1ServicePort_1 = require(\"./v1ServicePort\");\nconst v1ServiceSpec_1 = require(\"./v1ServiceSpec\");\nconst v1ServiceStatus_1 = require(\"./v1ServiceStatus\");\nconst v1SessionAffinityConfig_1 = require(\"./v1SessionAffinityConfig\");\nconst v1StatefulSet_1 = require(\"./v1StatefulSet\");\nconst v1StatefulSetCondition_1 = require(\"./v1StatefulSetCondition\");\nconst v1StatefulSetList_1 = require(\"./v1StatefulSetList\");\nconst v1StatefulSetSpec_1 = require(\"./v1StatefulSetSpec\");\nconst v1StatefulSetStatus_1 = require(\"./v1StatefulSetStatus\");\nconst v1StatefulSetUpdateStrategy_1 = require(\"./v1StatefulSetUpdateStrategy\");\nconst v1Status_1 = require(\"./v1Status\");\nconst v1StatusCause_1 = require(\"./v1StatusCause\");\nconst v1StatusDetails_1 = require(\"./v1StatusDetails\");\nconst v1StorageClass_1 = require(\"./v1StorageClass\");\nconst v1StorageClassList_1 = require(\"./v1StorageClassList\");\nconst v1StorageOSPersistentVolumeSource_1 = require(\"./v1StorageOSPersistentVolumeSource\");\nconst v1StorageOSVolumeSource_1 = require(\"./v1StorageOSVolumeSource\");\nconst v1Subject_1 = require(\"./v1Subject\");\nconst v1SubjectAccessReview_1 = require(\"./v1SubjectAccessReview\");\nconst v1SubjectAccessReviewSpec_1 = require(\"./v1SubjectAccessReviewSpec\");\nconst v1SubjectAccessReviewStatus_1 = require(\"./v1SubjectAccessReviewStatus\");\nconst v1SubjectRulesReviewStatus_1 = require(\"./v1SubjectRulesReviewStatus\");\nconst v1Sysctl_1 = require(\"./v1Sysctl\");\nconst v1TCPSocketAction_1 = require(\"./v1TCPSocketAction\");\nconst v1Taint_1 = require(\"./v1Taint\");\nconst v1TokenRequestSpec_1 = require(\"./v1TokenRequestSpec\");\nconst v1TokenRequestStatus_1 = require(\"./v1TokenRequestStatus\");\nconst v1TokenReview_1 = require(\"./v1TokenReview\");\nconst v1TokenReviewSpec_1 = require(\"./v1TokenReviewSpec\");\nconst v1TokenReviewStatus_1 = require(\"./v1TokenReviewStatus\");\nconst v1Toleration_1 = require(\"./v1Toleration\");\nconst v1TopologySelectorLabelRequirement_1 = require(\"./v1TopologySelectorLabelRequirement\");\nconst v1TopologySelectorTerm_1 = require(\"./v1TopologySelectorTerm\");\nconst v1TopologySpreadConstraint_1 = require(\"./v1TopologySpreadConstraint\");\nconst v1TypedLocalObjectReference_1 = require(\"./v1TypedLocalObjectReference\");\nconst v1UncountedTerminatedPods_1 = require(\"./v1UncountedTerminatedPods\");\nconst v1UserInfo_1 = require(\"./v1UserInfo\");\nconst v1ValidatingWebhook_1 = require(\"./v1ValidatingWebhook\");\nconst v1ValidatingWebhookConfiguration_1 = require(\"./v1ValidatingWebhookConfiguration\");\nconst v1ValidatingWebhookConfigurationList_1 = require(\"./v1ValidatingWebhookConfigurationList\");\nconst v1Volume_1 = require(\"./v1Volume\");\nconst v1VolumeAttachment_1 = require(\"./v1VolumeAttachment\");\nconst v1VolumeAttachmentList_1 = require(\"./v1VolumeAttachmentList\");\nconst v1VolumeAttachmentSource_1 = require(\"./v1VolumeAttachmentSource\");\nconst v1VolumeAttachmentSpec_1 = require(\"./v1VolumeAttachmentSpec\");\nconst v1VolumeAttachmentStatus_1 = require(\"./v1VolumeAttachmentStatus\");\nconst v1VolumeDevice_1 = require(\"./v1VolumeDevice\");\nconst v1VolumeError_1 = require(\"./v1VolumeError\");\nconst v1VolumeMount_1 = require(\"./v1VolumeMount\");\nconst v1VolumeNodeAffinity_1 = require(\"./v1VolumeNodeAffinity\");\nconst v1VolumeNodeResources_1 = require(\"./v1VolumeNodeResources\");\nconst v1VolumeProjection_1 = require(\"./v1VolumeProjection\");\nconst v1VsphereVirtualDiskVolumeSource_1 = require(\"./v1VsphereVirtualDiskVolumeSource\");\nconst v1WatchEvent_1 = require(\"./v1WatchEvent\");\nconst v1WebhookConversion_1 = require(\"./v1WebhookConversion\");\nconst v1WeightedPodAffinityTerm_1 = require(\"./v1WeightedPodAffinityTerm\");\nconst v1WindowsSecurityContextOptions_1 = require(\"./v1WindowsSecurityContextOptions\");\nconst v1alpha1AggregationRule_1 = require(\"./v1alpha1AggregationRule\");\nconst v1alpha1CSIStorageCapacity_1 = require(\"./v1alpha1CSIStorageCapacity\");\nconst v1alpha1CSIStorageCapacityList_1 = require(\"./v1alpha1CSIStorageCapacityList\");\nconst v1alpha1ClusterRole_1 = require(\"./v1alpha1ClusterRole\");\nconst v1alpha1ClusterRoleBinding_1 = require(\"./v1alpha1ClusterRoleBinding\");\nconst v1alpha1ClusterRoleBindingList_1 = require(\"./v1alpha1ClusterRoleBindingList\");\nconst v1alpha1ClusterRoleList_1 = require(\"./v1alpha1ClusterRoleList\");\nconst v1alpha1Overhead_1 = require(\"./v1alpha1Overhead\");\nconst v1alpha1PolicyRule_1 = require(\"./v1alpha1PolicyRule\");\nconst v1alpha1PriorityClass_1 = require(\"./v1alpha1PriorityClass\");\nconst v1alpha1PriorityClassList_1 = require(\"./v1alpha1PriorityClassList\");\nconst v1alpha1Role_1 = require(\"./v1alpha1Role\");\nconst v1alpha1RoleBinding_1 = require(\"./v1alpha1RoleBinding\");\nconst v1alpha1RoleBindingList_1 = require(\"./v1alpha1RoleBindingList\");\nconst v1alpha1RoleList_1 = require(\"./v1alpha1RoleList\");\nconst v1alpha1RoleRef_1 = require(\"./v1alpha1RoleRef\");\nconst v1alpha1RuntimeClass_1 = require(\"./v1alpha1RuntimeClass\");\nconst v1alpha1RuntimeClassList_1 = require(\"./v1alpha1RuntimeClassList\");\nconst v1alpha1RuntimeClassSpec_1 = require(\"./v1alpha1RuntimeClassSpec\");\nconst v1alpha1Scheduling_1 = require(\"./v1alpha1Scheduling\");\nconst v1alpha1ServerStorageVersion_1 = require(\"./v1alpha1ServerStorageVersion\");\nconst v1alpha1StorageVersion_1 = require(\"./v1alpha1StorageVersion\");\nconst v1alpha1StorageVersionCondition_1 = require(\"./v1alpha1StorageVersionCondition\");\nconst v1alpha1StorageVersionList_1 = require(\"./v1alpha1StorageVersionList\");\nconst v1alpha1StorageVersionStatus_1 = require(\"./v1alpha1StorageVersionStatus\");\nconst v1alpha1Subject_1 = require(\"./v1alpha1Subject\");\nconst v1alpha1VolumeAttachment_1 = require(\"./v1alpha1VolumeAttachment\");\nconst v1alpha1VolumeAttachmentList_1 = require(\"./v1alpha1VolumeAttachmentList\");\nconst v1alpha1VolumeAttachmentSource_1 = require(\"./v1alpha1VolumeAttachmentSource\");\nconst v1alpha1VolumeAttachmentSpec_1 = require(\"./v1alpha1VolumeAttachmentSpec\");\nconst v1alpha1VolumeAttachmentStatus_1 = require(\"./v1alpha1VolumeAttachmentStatus\");\nconst v1alpha1VolumeError_1 = require(\"./v1alpha1VolumeError\");\nconst v1beta1AllowedCSIDriver_1 = require(\"./v1beta1AllowedCSIDriver\");\nconst v1beta1AllowedFlexVolume_1 = require(\"./v1beta1AllowedFlexVolume\");\nconst v1beta1AllowedHostPath_1 = require(\"./v1beta1AllowedHostPath\");\nconst v1beta1CSIStorageCapacity_1 = require(\"./v1beta1CSIStorageCapacity\");\nconst v1beta1CSIStorageCapacityList_1 = require(\"./v1beta1CSIStorageCapacityList\");\nconst v1beta1CronJob_1 = require(\"./v1beta1CronJob\");\nconst v1beta1CronJobList_1 = require(\"./v1beta1CronJobList\");\nconst v1beta1CronJobSpec_1 = require(\"./v1beta1CronJobSpec\");\nconst v1beta1CronJobStatus_1 = require(\"./v1beta1CronJobStatus\");\nconst v1beta1Endpoint_1 = require(\"./v1beta1Endpoint\");\nconst v1beta1EndpointConditions_1 = require(\"./v1beta1EndpointConditions\");\nconst v1beta1EndpointHints_1 = require(\"./v1beta1EndpointHints\");\nconst v1beta1EndpointPort_1 = require(\"./v1beta1EndpointPort\");\nconst v1beta1EndpointSlice_1 = require(\"./v1beta1EndpointSlice\");\nconst v1beta1EndpointSliceList_1 = require(\"./v1beta1EndpointSliceList\");\nconst v1beta1Event_1 = require(\"./v1beta1Event\");\nconst v1beta1EventList_1 = require(\"./v1beta1EventList\");\nconst v1beta1EventSeries_1 = require(\"./v1beta1EventSeries\");\nconst v1beta1FSGroupStrategyOptions_1 = require(\"./v1beta1FSGroupStrategyOptions\");\nconst v1beta1FlowDistinguisherMethod_1 = require(\"./v1beta1FlowDistinguisherMethod\");\nconst v1beta1FlowSchema_1 = require(\"./v1beta1FlowSchema\");\nconst v1beta1FlowSchemaCondition_1 = require(\"./v1beta1FlowSchemaCondition\");\nconst v1beta1FlowSchemaList_1 = require(\"./v1beta1FlowSchemaList\");\nconst v1beta1FlowSchemaSpec_1 = require(\"./v1beta1FlowSchemaSpec\");\nconst v1beta1FlowSchemaStatus_1 = require(\"./v1beta1FlowSchemaStatus\");\nconst v1beta1ForZone_1 = require(\"./v1beta1ForZone\");\nconst v1beta1GroupSubject_1 = require(\"./v1beta1GroupSubject\");\nconst v1beta1HostPortRange_1 = require(\"./v1beta1HostPortRange\");\nconst v1beta1IDRange_1 = require(\"./v1beta1IDRange\");\nconst v1beta1JobTemplateSpec_1 = require(\"./v1beta1JobTemplateSpec\");\nconst v1beta1LimitResponse_1 = require(\"./v1beta1LimitResponse\");\nconst v1beta1LimitedPriorityLevelConfiguration_1 = require(\"./v1beta1LimitedPriorityLevelConfiguration\");\nconst v1beta1NonResourcePolicyRule_1 = require(\"./v1beta1NonResourcePolicyRule\");\nconst v1beta1Overhead_1 = require(\"./v1beta1Overhead\");\nconst v1beta1PodDisruptionBudget_1 = require(\"./v1beta1PodDisruptionBudget\");\nconst v1beta1PodDisruptionBudgetList_1 = require(\"./v1beta1PodDisruptionBudgetList\");\nconst v1beta1PodDisruptionBudgetSpec_1 = require(\"./v1beta1PodDisruptionBudgetSpec\");\nconst v1beta1PodDisruptionBudgetStatus_1 = require(\"./v1beta1PodDisruptionBudgetStatus\");\nconst v1beta1PodSecurityPolicy_1 = require(\"./v1beta1PodSecurityPolicy\");\nconst v1beta1PodSecurityPolicyList_1 = require(\"./v1beta1PodSecurityPolicyList\");\nconst v1beta1PodSecurityPolicySpec_1 = require(\"./v1beta1PodSecurityPolicySpec\");\nconst v1beta1PolicyRulesWithSubjects_1 = require(\"./v1beta1PolicyRulesWithSubjects\");\nconst v1beta1PriorityLevelConfiguration_1 = require(\"./v1beta1PriorityLevelConfiguration\");\nconst v1beta1PriorityLevelConfigurationCondition_1 = require(\"./v1beta1PriorityLevelConfigurationCondition\");\nconst v1beta1PriorityLevelConfigurationList_1 = require(\"./v1beta1PriorityLevelConfigurationList\");\nconst v1beta1PriorityLevelConfigurationReference_1 = require(\"./v1beta1PriorityLevelConfigurationReference\");\nconst v1beta1PriorityLevelConfigurationSpec_1 = require(\"./v1beta1PriorityLevelConfigurationSpec\");\nconst v1beta1PriorityLevelConfigurationStatus_1 = require(\"./v1beta1PriorityLevelConfigurationStatus\");\nconst v1beta1QueuingConfiguration_1 = require(\"./v1beta1QueuingConfiguration\");\nconst v1beta1ResourcePolicyRule_1 = require(\"./v1beta1ResourcePolicyRule\");\nconst v1beta1RunAsGroupStrategyOptions_1 = require(\"./v1beta1RunAsGroupStrategyOptions\");\nconst v1beta1RunAsUserStrategyOptions_1 = require(\"./v1beta1RunAsUserStrategyOptions\");\nconst v1beta1RuntimeClass_1 = require(\"./v1beta1RuntimeClass\");\nconst v1beta1RuntimeClassList_1 = require(\"./v1beta1RuntimeClassList\");\nconst v1beta1RuntimeClassStrategyOptions_1 = require(\"./v1beta1RuntimeClassStrategyOptions\");\nconst v1beta1SELinuxStrategyOptions_1 = require(\"./v1beta1SELinuxStrategyOptions\");\nconst v1beta1Scheduling_1 = require(\"./v1beta1Scheduling\");\nconst v1beta1ServiceAccountSubject_1 = require(\"./v1beta1ServiceAccountSubject\");\nconst v1beta1Subject_1 = require(\"./v1beta1Subject\");\nconst v1beta1SupplementalGroupsStrategyOptions_1 = require(\"./v1beta1SupplementalGroupsStrategyOptions\");\nconst v1beta1UserSubject_1 = require(\"./v1beta1UserSubject\");\nconst v2beta1ContainerResourceMetricSource_1 = require(\"./v2beta1ContainerResourceMetricSource\");\nconst v2beta1ContainerResourceMetricStatus_1 = require(\"./v2beta1ContainerResourceMetricStatus\");\nconst v2beta1CrossVersionObjectReference_1 = require(\"./v2beta1CrossVersionObjectReference\");\nconst v2beta1ExternalMetricSource_1 = require(\"./v2beta1ExternalMetricSource\");\nconst v2beta1ExternalMetricStatus_1 = require(\"./v2beta1ExternalMetricStatus\");\nconst v2beta1HorizontalPodAutoscaler_1 = require(\"./v2beta1HorizontalPodAutoscaler\");\nconst v2beta1HorizontalPodAutoscalerCondition_1 = require(\"./v2beta1HorizontalPodAutoscalerCondition\");\nconst v2beta1HorizontalPodAutoscalerList_1 = require(\"./v2beta1HorizontalPodAutoscalerList\");\nconst v2beta1HorizontalPodAutoscalerSpec_1 = require(\"./v2beta1HorizontalPodAutoscalerSpec\");\nconst v2beta1HorizontalPodAutoscalerStatus_1 = require(\"./v2beta1HorizontalPodAutoscalerStatus\");\nconst v2beta1MetricSpec_1 = require(\"./v2beta1MetricSpec\");\nconst v2beta1MetricStatus_1 = require(\"./v2beta1MetricStatus\");\nconst v2beta1ObjectMetricSource_1 = require(\"./v2beta1ObjectMetricSource\");\nconst v2beta1ObjectMetricStatus_1 = require(\"./v2beta1ObjectMetricStatus\");\nconst v2beta1PodsMetricSource_1 = require(\"./v2beta1PodsMetricSource\");\nconst v2beta1PodsMetricStatus_1 = require(\"./v2beta1PodsMetricStatus\");\nconst v2beta1ResourceMetricSource_1 = require(\"./v2beta1ResourceMetricSource\");\nconst v2beta1ResourceMetricStatus_1 = require(\"./v2beta1ResourceMetricStatus\");\nconst v2beta2ContainerResourceMetricSource_1 = require(\"./v2beta2ContainerResourceMetricSource\");\nconst v2beta2ContainerResourceMetricStatus_1 = require(\"./v2beta2ContainerResourceMetricStatus\");\nconst v2beta2CrossVersionObjectReference_1 = require(\"./v2beta2CrossVersionObjectReference\");\nconst v2beta2ExternalMetricSource_1 = require(\"./v2beta2ExternalMetricSource\");\nconst v2beta2ExternalMetricStatus_1 = require(\"./v2beta2ExternalMetricStatus\");\nconst v2beta2HPAScalingPolicy_1 = require(\"./v2beta2HPAScalingPolicy\");\nconst v2beta2HPAScalingRules_1 = require(\"./v2beta2HPAScalingRules\");\nconst v2beta2HorizontalPodAutoscaler_1 = require(\"./v2beta2HorizontalPodAutoscaler\");\nconst v2beta2HorizontalPodAutoscalerBehavior_1 = require(\"./v2beta2HorizontalPodAutoscalerBehavior\");\nconst v2beta2HorizontalPodAutoscalerCondition_1 = require(\"./v2beta2HorizontalPodAutoscalerCondition\");\nconst v2beta2HorizontalPodAutoscalerList_1 = require(\"./v2beta2HorizontalPodAutoscalerList\");\nconst v2beta2HorizontalPodAutoscalerSpec_1 = require(\"./v2beta2HorizontalPodAutoscalerSpec\");\nconst v2beta2HorizontalPodAutoscalerStatus_1 = require(\"./v2beta2HorizontalPodAutoscalerStatus\");\nconst v2beta2MetricIdentifier_1 = require(\"./v2beta2MetricIdentifier\");\nconst v2beta2MetricSpec_1 = require(\"./v2beta2MetricSpec\");\nconst v2beta2MetricStatus_1 = require(\"./v2beta2MetricStatus\");\nconst v2beta2MetricTarget_1 = require(\"./v2beta2MetricTarget\");\nconst v2beta2MetricValueStatus_1 = require(\"./v2beta2MetricValueStatus\");\nconst v2beta2ObjectMetricSource_1 = require(\"./v2beta2ObjectMetricSource\");\nconst v2beta2ObjectMetricStatus_1 = require(\"./v2beta2ObjectMetricStatus\");\nconst v2beta2PodsMetricSource_1 = require(\"./v2beta2PodsMetricSource\");\nconst v2beta2PodsMetricStatus_1 = require(\"./v2beta2PodsMetricStatus\");\nconst v2beta2ResourceMetricSource_1 = require(\"./v2beta2ResourceMetricSource\");\nconst v2beta2ResourceMetricStatus_1 = require(\"./v2beta2ResourceMetricStatus\");\nconst versionInfo_1 = require(\"./versionInfo\");\n/* tslint:disable:no-unused-variable */\nlet primitives = [\n \"string\",\n \"boolean\",\n \"double\",\n \"integer\",\n \"long\",\n \"float\",\n \"number\",\n \"any\"\n];\nlet enumsMap = {};\nlet typeMap = {\n \"AdmissionregistrationV1ServiceReference\": admissionregistrationV1ServiceReference_1.AdmissionregistrationV1ServiceReference,\n \"AdmissionregistrationV1WebhookClientConfig\": admissionregistrationV1WebhookClientConfig_1.AdmissionregistrationV1WebhookClientConfig,\n \"ApiextensionsV1ServiceReference\": apiextensionsV1ServiceReference_1.ApiextensionsV1ServiceReference,\n \"ApiextensionsV1WebhookClientConfig\": apiextensionsV1WebhookClientConfig_1.ApiextensionsV1WebhookClientConfig,\n \"ApiregistrationV1ServiceReference\": apiregistrationV1ServiceReference_1.ApiregistrationV1ServiceReference,\n \"AuthenticationV1TokenRequest\": authenticationV1TokenRequest_1.AuthenticationV1TokenRequest,\n \"CoreV1EndpointPort\": coreV1EndpointPort_1.CoreV1EndpointPort,\n \"CoreV1Event\": coreV1Event_1.CoreV1Event,\n \"CoreV1EventList\": coreV1EventList_1.CoreV1EventList,\n \"CoreV1EventSeries\": coreV1EventSeries_1.CoreV1EventSeries,\n \"DiscoveryV1EndpointPort\": discoveryV1EndpointPort_1.DiscoveryV1EndpointPort,\n \"EventsV1Event\": eventsV1Event_1.EventsV1Event,\n \"EventsV1EventList\": eventsV1EventList_1.EventsV1EventList,\n \"EventsV1EventSeries\": eventsV1EventSeries_1.EventsV1EventSeries,\n \"StorageV1TokenRequest\": storageV1TokenRequest_1.StorageV1TokenRequest,\n \"V1APIGroup\": v1APIGroup_1.V1APIGroup,\n \"V1APIGroupList\": v1APIGroupList_1.V1APIGroupList,\n \"V1APIResource\": v1APIResource_1.V1APIResource,\n \"V1APIResourceList\": v1APIResourceList_1.V1APIResourceList,\n \"V1APIService\": v1APIService_1.V1APIService,\n \"V1APIServiceCondition\": v1APIServiceCondition_1.V1APIServiceCondition,\n \"V1APIServiceList\": v1APIServiceList_1.V1APIServiceList,\n \"V1APIServiceSpec\": v1APIServiceSpec_1.V1APIServiceSpec,\n \"V1APIServiceStatus\": v1APIServiceStatus_1.V1APIServiceStatus,\n \"V1APIVersions\": v1APIVersions_1.V1APIVersions,\n \"V1AWSElasticBlockStoreVolumeSource\": v1AWSElasticBlockStoreVolumeSource_1.V1AWSElasticBlockStoreVolumeSource,\n \"V1Affinity\": v1Affinity_1.V1Affinity,\n \"V1AggregationRule\": v1AggregationRule_1.V1AggregationRule,\n \"V1AttachedVolume\": v1AttachedVolume_1.V1AttachedVolume,\n \"V1AzureDiskVolumeSource\": v1AzureDiskVolumeSource_1.V1AzureDiskVolumeSource,\n \"V1AzureFilePersistentVolumeSource\": v1AzureFilePersistentVolumeSource_1.V1AzureFilePersistentVolumeSource,\n \"V1AzureFileVolumeSource\": v1AzureFileVolumeSource_1.V1AzureFileVolumeSource,\n \"V1Binding\": v1Binding_1.V1Binding,\n \"V1BoundObjectReference\": v1BoundObjectReference_1.V1BoundObjectReference,\n \"V1CSIDriver\": v1CSIDriver_1.V1CSIDriver,\n \"V1CSIDriverList\": v1CSIDriverList_1.V1CSIDriverList,\n \"V1CSIDriverSpec\": v1CSIDriverSpec_1.V1CSIDriverSpec,\n \"V1CSINode\": v1CSINode_1.V1CSINode,\n \"V1CSINodeDriver\": v1CSINodeDriver_1.V1CSINodeDriver,\n \"V1CSINodeList\": v1CSINodeList_1.V1CSINodeList,\n \"V1CSINodeSpec\": v1CSINodeSpec_1.V1CSINodeSpec,\n \"V1CSIPersistentVolumeSource\": v1CSIPersistentVolumeSource_1.V1CSIPersistentVolumeSource,\n \"V1CSIVolumeSource\": v1CSIVolumeSource_1.V1CSIVolumeSource,\n \"V1Capabilities\": v1Capabilities_1.V1Capabilities,\n \"V1CephFSPersistentVolumeSource\": v1CephFSPersistentVolumeSource_1.V1CephFSPersistentVolumeSource,\n \"V1CephFSVolumeSource\": v1CephFSVolumeSource_1.V1CephFSVolumeSource,\n \"V1CertificateSigningRequest\": v1CertificateSigningRequest_1.V1CertificateSigningRequest,\n \"V1CertificateSigningRequestCondition\": v1CertificateSigningRequestCondition_1.V1CertificateSigningRequestCondition,\n \"V1CertificateSigningRequestList\": v1CertificateSigningRequestList_1.V1CertificateSigningRequestList,\n \"V1CertificateSigningRequestSpec\": v1CertificateSigningRequestSpec_1.V1CertificateSigningRequestSpec,\n \"V1CertificateSigningRequestStatus\": v1CertificateSigningRequestStatus_1.V1CertificateSigningRequestStatus,\n \"V1CinderPersistentVolumeSource\": v1CinderPersistentVolumeSource_1.V1CinderPersistentVolumeSource,\n \"V1CinderVolumeSource\": v1CinderVolumeSource_1.V1CinderVolumeSource,\n \"V1ClientIPConfig\": v1ClientIPConfig_1.V1ClientIPConfig,\n \"V1ClusterRole\": v1ClusterRole_1.V1ClusterRole,\n \"V1ClusterRoleBinding\": v1ClusterRoleBinding_1.V1ClusterRoleBinding,\n \"V1ClusterRoleBindingList\": v1ClusterRoleBindingList_1.V1ClusterRoleBindingList,\n \"V1ClusterRoleList\": v1ClusterRoleList_1.V1ClusterRoleList,\n \"V1ComponentCondition\": v1ComponentCondition_1.V1ComponentCondition,\n \"V1ComponentStatus\": v1ComponentStatus_1.V1ComponentStatus,\n \"V1ComponentStatusList\": v1ComponentStatusList_1.V1ComponentStatusList,\n \"V1Condition\": v1Condition_1.V1Condition,\n \"V1ConfigMap\": v1ConfigMap_1.V1ConfigMap,\n \"V1ConfigMapEnvSource\": v1ConfigMapEnvSource_1.V1ConfigMapEnvSource,\n \"V1ConfigMapKeySelector\": v1ConfigMapKeySelector_1.V1ConfigMapKeySelector,\n \"V1ConfigMapList\": v1ConfigMapList_1.V1ConfigMapList,\n \"V1ConfigMapNodeConfigSource\": v1ConfigMapNodeConfigSource_1.V1ConfigMapNodeConfigSource,\n \"V1ConfigMapProjection\": v1ConfigMapProjection_1.V1ConfigMapProjection,\n \"V1ConfigMapVolumeSource\": v1ConfigMapVolumeSource_1.V1ConfigMapVolumeSource,\n \"V1Container\": v1Container_1.V1Container,\n \"V1ContainerImage\": v1ContainerImage_1.V1ContainerImage,\n \"V1ContainerPort\": v1ContainerPort_1.V1ContainerPort,\n \"V1ContainerState\": v1ContainerState_1.V1ContainerState,\n \"V1ContainerStateRunning\": v1ContainerStateRunning_1.V1ContainerStateRunning,\n \"V1ContainerStateTerminated\": v1ContainerStateTerminated_1.V1ContainerStateTerminated,\n \"V1ContainerStateWaiting\": v1ContainerStateWaiting_1.V1ContainerStateWaiting,\n \"V1ContainerStatus\": v1ContainerStatus_1.V1ContainerStatus,\n \"V1ControllerRevision\": v1ControllerRevision_1.V1ControllerRevision,\n \"V1ControllerRevisionList\": v1ControllerRevisionList_1.V1ControllerRevisionList,\n \"V1CronJob\": v1CronJob_1.V1CronJob,\n \"V1CronJobList\": v1CronJobList_1.V1CronJobList,\n \"V1CronJobSpec\": v1CronJobSpec_1.V1CronJobSpec,\n \"V1CronJobStatus\": v1CronJobStatus_1.V1CronJobStatus,\n \"V1CrossVersionObjectReference\": v1CrossVersionObjectReference_1.V1CrossVersionObjectReference,\n \"V1CustomResourceColumnDefinition\": v1CustomResourceColumnDefinition_1.V1CustomResourceColumnDefinition,\n \"V1CustomResourceConversion\": v1CustomResourceConversion_1.V1CustomResourceConversion,\n \"V1CustomResourceDefinition\": v1CustomResourceDefinition_1.V1CustomResourceDefinition,\n \"V1CustomResourceDefinitionCondition\": v1CustomResourceDefinitionCondition_1.V1CustomResourceDefinitionCondition,\n \"V1CustomResourceDefinitionList\": v1CustomResourceDefinitionList_1.V1CustomResourceDefinitionList,\n \"V1CustomResourceDefinitionNames\": v1CustomResourceDefinitionNames_1.V1CustomResourceDefinitionNames,\n \"V1CustomResourceDefinitionSpec\": v1CustomResourceDefinitionSpec_1.V1CustomResourceDefinitionSpec,\n \"V1CustomResourceDefinitionStatus\": v1CustomResourceDefinitionStatus_1.V1CustomResourceDefinitionStatus,\n \"V1CustomResourceDefinitionVersion\": v1CustomResourceDefinitionVersion_1.V1CustomResourceDefinitionVersion,\n \"V1CustomResourceSubresourceScale\": v1CustomResourceSubresourceScale_1.V1CustomResourceSubresourceScale,\n \"V1CustomResourceSubresources\": v1CustomResourceSubresources_1.V1CustomResourceSubresources,\n \"V1CustomResourceValidation\": v1CustomResourceValidation_1.V1CustomResourceValidation,\n \"V1DaemonEndpoint\": v1DaemonEndpoint_1.V1DaemonEndpoint,\n \"V1DaemonSet\": v1DaemonSet_1.V1DaemonSet,\n \"V1DaemonSetCondition\": v1DaemonSetCondition_1.V1DaemonSetCondition,\n \"V1DaemonSetList\": v1DaemonSetList_1.V1DaemonSetList,\n \"V1DaemonSetSpec\": v1DaemonSetSpec_1.V1DaemonSetSpec,\n \"V1DaemonSetStatus\": v1DaemonSetStatus_1.V1DaemonSetStatus,\n \"V1DaemonSetUpdateStrategy\": v1DaemonSetUpdateStrategy_1.V1DaemonSetUpdateStrategy,\n \"V1DeleteOptions\": v1DeleteOptions_1.V1DeleteOptions,\n \"V1Deployment\": v1Deployment_1.V1Deployment,\n \"V1DeploymentCondition\": v1DeploymentCondition_1.V1DeploymentCondition,\n \"V1DeploymentList\": v1DeploymentList_1.V1DeploymentList,\n \"V1DeploymentSpec\": v1DeploymentSpec_1.V1DeploymentSpec,\n \"V1DeploymentStatus\": v1DeploymentStatus_1.V1DeploymentStatus,\n \"V1DeploymentStrategy\": v1DeploymentStrategy_1.V1DeploymentStrategy,\n \"V1DownwardAPIProjection\": v1DownwardAPIProjection_1.V1DownwardAPIProjection,\n \"V1DownwardAPIVolumeFile\": v1DownwardAPIVolumeFile_1.V1DownwardAPIVolumeFile,\n \"V1DownwardAPIVolumeSource\": v1DownwardAPIVolumeSource_1.V1DownwardAPIVolumeSource,\n \"V1EmptyDirVolumeSource\": v1EmptyDirVolumeSource_1.V1EmptyDirVolumeSource,\n \"V1Endpoint\": v1Endpoint_1.V1Endpoint,\n \"V1EndpointAddress\": v1EndpointAddress_1.V1EndpointAddress,\n \"V1EndpointConditions\": v1EndpointConditions_1.V1EndpointConditions,\n \"V1EndpointHints\": v1EndpointHints_1.V1EndpointHints,\n \"V1EndpointSlice\": v1EndpointSlice_1.V1EndpointSlice,\n \"V1EndpointSliceList\": v1EndpointSliceList_1.V1EndpointSliceList,\n \"V1EndpointSubset\": v1EndpointSubset_1.V1EndpointSubset,\n \"V1Endpoints\": v1Endpoints_1.V1Endpoints,\n \"V1EndpointsList\": v1EndpointsList_1.V1EndpointsList,\n \"V1EnvFromSource\": v1EnvFromSource_1.V1EnvFromSource,\n \"V1EnvVar\": v1EnvVar_1.V1EnvVar,\n \"V1EnvVarSource\": v1EnvVarSource_1.V1EnvVarSource,\n \"V1EphemeralContainer\": v1EphemeralContainer_1.V1EphemeralContainer,\n \"V1EphemeralVolumeSource\": v1EphemeralVolumeSource_1.V1EphemeralVolumeSource,\n \"V1EventSource\": v1EventSource_1.V1EventSource,\n \"V1Eviction\": v1Eviction_1.V1Eviction,\n \"V1ExecAction\": v1ExecAction_1.V1ExecAction,\n \"V1ExternalDocumentation\": v1ExternalDocumentation_1.V1ExternalDocumentation,\n \"V1FCVolumeSource\": v1FCVolumeSource_1.V1FCVolumeSource,\n \"V1FlexPersistentVolumeSource\": v1FlexPersistentVolumeSource_1.V1FlexPersistentVolumeSource,\n \"V1FlexVolumeSource\": v1FlexVolumeSource_1.V1FlexVolumeSource,\n \"V1FlockerVolumeSource\": v1FlockerVolumeSource_1.V1FlockerVolumeSource,\n \"V1ForZone\": v1ForZone_1.V1ForZone,\n \"V1GCEPersistentDiskVolumeSource\": v1GCEPersistentDiskVolumeSource_1.V1GCEPersistentDiskVolumeSource,\n \"V1GitRepoVolumeSource\": v1GitRepoVolumeSource_1.V1GitRepoVolumeSource,\n \"V1GlusterfsPersistentVolumeSource\": v1GlusterfsPersistentVolumeSource_1.V1GlusterfsPersistentVolumeSource,\n \"V1GlusterfsVolumeSource\": v1GlusterfsVolumeSource_1.V1GlusterfsVolumeSource,\n \"V1GroupVersionForDiscovery\": v1GroupVersionForDiscovery_1.V1GroupVersionForDiscovery,\n \"V1HTTPGetAction\": v1HTTPGetAction_1.V1HTTPGetAction,\n \"V1HTTPHeader\": v1HTTPHeader_1.V1HTTPHeader,\n \"V1HTTPIngressPath\": v1HTTPIngressPath_1.V1HTTPIngressPath,\n \"V1HTTPIngressRuleValue\": v1HTTPIngressRuleValue_1.V1HTTPIngressRuleValue,\n \"V1Handler\": v1Handler_1.V1Handler,\n \"V1HorizontalPodAutoscaler\": v1HorizontalPodAutoscaler_1.V1HorizontalPodAutoscaler,\n \"V1HorizontalPodAutoscalerList\": v1HorizontalPodAutoscalerList_1.V1HorizontalPodAutoscalerList,\n \"V1HorizontalPodAutoscalerSpec\": v1HorizontalPodAutoscalerSpec_1.V1HorizontalPodAutoscalerSpec,\n \"V1HorizontalPodAutoscalerStatus\": v1HorizontalPodAutoscalerStatus_1.V1HorizontalPodAutoscalerStatus,\n \"V1HostAlias\": v1HostAlias_1.V1HostAlias,\n \"V1HostPathVolumeSource\": v1HostPathVolumeSource_1.V1HostPathVolumeSource,\n \"V1IPBlock\": v1IPBlock_1.V1IPBlock,\n \"V1ISCSIPersistentVolumeSource\": v1ISCSIPersistentVolumeSource_1.V1ISCSIPersistentVolumeSource,\n \"V1ISCSIVolumeSource\": v1ISCSIVolumeSource_1.V1ISCSIVolumeSource,\n \"V1Ingress\": v1Ingress_1.V1Ingress,\n \"V1IngressBackend\": v1IngressBackend_1.V1IngressBackend,\n \"V1IngressClass\": v1IngressClass_1.V1IngressClass,\n \"V1IngressClassList\": v1IngressClassList_1.V1IngressClassList,\n \"V1IngressClassParametersReference\": v1IngressClassParametersReference_1.V1IngressClassParametersReference,\n \"V1IngressClassSpec\": v1IngressClassSpec_1.V1IngressClassSpec,\n \"V1IngressList\": v1IngressList_1.V1IngressList,\n \"V1IngressRule\": v1IngressRule_1.V1IngressRule,\n \"V1IngressServiceBackend\": v1IngressServiceBackend_1.V1IngressServiceBackend,\n \"V1IngressSpec\": v1IngressSpec_1.V1IngressSpec,\n \"V1IngressStatus\": v1IngressStatus_1.V1IngressStatus,\n \"V1IngressTLS\": v1IngressTLS_1.V1IngressTLS,\n \"V1JSONSchemaProps\": v1JSONSchemaProps_1.V1JSONSchemaProps,\n \"V1Job\": v1Job_1.V1Job,\n \"V1JobCondition\": v1JobCondition_1.V1JobCondition,\n \"V1JobList\": v1JobList_1.V1JobList,\n \"V1JobSpec\": v1JobSpec_1.V1JobSpec,\n \"V1JobStatus\": v1JobStatus_1.V1JobStatus,\n \"V1JobTemplateSpec\": v1JobTemplateSpec_1.V1JobTemplateSpec,\n \"V1KeyToPath\": v1KeyToPath_1.V1KeyToPath,\n \"V1LabelSelector\": v1LabelSelector_1.V1LabelSelector,\n \"V1LabelSelectorRequirement\": v1LabelSelectorRequirement_1.V1LabelSelectorRequirement,\n \"V1Lease\": v1Lease_1.V1Lease,\n \"V1LeaseList\": v1LeaseList_1.V1LeaseList,\n \"V1LeaseSpec\": v1LeaseSpec_1.V1LeaseSpec,\n \"V1Lifecycle\": v1Lifecycle_1.V1Lifecycle,\n \"V1LimitRange\": v1LimitRange_1.V1LimitRange,\n \"V1LimitRangeItem\": v1LimitRangeItem_1.V1LimitRangeItem,\n \"V1LimitRangeList\": v1LimitRangeList_1.V1LimitRangeList,\n \"V1LimitRangeSpec\": v1LimitRangeSpec_1.V1LimitRangeSpec,\n \"V1ListMeta\": v1ListMeta_1.V1ListMeta,\n \"V1LoadBalancerIngress\": v1LoadBalancerIngress_1.V1LoadBalancerIngress,\n \"V1LoadBalancerStatus\": v1LoadBalancerStatus_1.V1LoadBalancerStatus,\n \"V1LocalObjectReference\": v1LocalObjectReference_1.V1LocalObjectReference,\n \"V1LocalSubjectAccessReview\": v1LocalSubjectAccessReview_1.V1LocalSubjectAccessReview,\n \"V1LocalVolumeSource\": v1LocalVolumeSource_1.V1LocalVolumeSource,\n \"V1ManagedFieldsEntry\": v1ManagedFieldsEntry_1.V1ManagedFieldsEntry,\n \"V1MutatingWebhook\": v1MutatingWebhook_1.V1MutatingWebhook,\n \"V1MutatingWebhookConfiguration\": v1MutatingWebhookConfiguration_1.V1MutatingWebhookConfiguration,\n \"V1MutatingWebhookConfigurationList\": v1MutatingWebhookConfigurationList_1.V1MutatingWebhookConfigurationList,\n \"V1NFSVolumeSource\": v1NFSVolumeSource_1.V1NFSVolumeSource,\n \"V1Namespace\": v1Namespace_1.V1Namespace,\n \"V1NamespaceCondition\": v1NamespaceCondition_1.V1NamespaceCondition,\n \"V1NamespaceList\": v1NamespaceList_1.V1NamespaceList,\n \"V1NamespaceSpec\": v1NamespaceSpec_1.V1NamespaceSpec,\n \"V1NamespaceStatus\": v1NamespaceStatus_1.V1NamespaceStatus,\n \"V1NetworkPolicy\": v1NetworkPolicy_1.V1NetworkPolicy,\n \"V1NetworkPolicyEgressRule\": v1NetworkPolicyEgressRule_1.V1NetworkPolicyEgressRule,\n \"V1NetworkPolicyIngressRule\": v1NetworkPolicyIngressRule_1.V1NetworkPolicyIngressRule,\n \"V1NetworkPolicyList\": v1NetworkPolicyList_1.V1NetworkPolicyList,\n \"V1NetworkPolicyPeer\": v1NetworkPolicyPeer_1.V1NetworkPolicyPeer,\n \"V1NetworkPolicyPort\": v1NetworkPolicyPort_1.V1NetworkPolicyPort,\n \"V1NetworkPolicySpec\": v1NetworkPolicySpec_1.V1NetworkPolicySpec,\n \"V1Node\": v1Node_1.V1Node,\n \"V1NodeAddress\": v1NodeAddress_1.V1NodeAddress,\n \"V1NodeAffinity\": v1NodeAffinity_1.V1NodeAffinity,\n \"V1NodeCondition\": v1NodeCondition_1.V1NodeCondition,\n \"V1NodeConfigSource\": v1NodeConfigSource_1.V1NodeConfigSource,\n \"V1NodeConfigStatus\": v1NodeConfigStatus_1.V1NodeConfigStatus,\n \"V1NodeDaemonEndpoints\": v1NodeDaemonEndpoints_1.V1NodeDaemonEndpoints,\n \"V1NodeList\": v1NodeList_1.V1NodeList,\n \"V1NodeSelector\": v1NodeSelector_1.V1NodeSelector,\n \"V1NodeSelectorRequirement\": v1NodeSelectorRequirement_1.V1NodeSelectorRequirement,\n \"V1NodeSelectorTerm\": v1NodeSelectorTerm_1.V1NodeSelectorTerm,\n \"V1NodeSpec\": v1NodeSpec_1.V1NodeSpec,\n \"V1NodeStatus\": v1NodeStatus_1.V1NodeStatus,\n \"V1NodeSystemInfo\": v1NodeSystemInfo_1.V1NodeSystemInfo,\n \"V1NonResourceAttributes\": v1NonResourceAttributes_1.V1NonResourceAttributes,\n \"V1NonResourceRule\": v1NonResourceRule_1.V1NonResourceRule,\n \"V1ObjectFieldSelector\": v1ObjectFieldSelector_1.V1ObjectFieldSelector,\n \"V1ObjectMeta\": v1ObjectMeta_1.V1ObjectMeta,\n \"V1ObjectReference\": v1ObjectReference_1.V1ObjectReference,\n \"V1Overhead\": v1Overhead_1.V1Overhead,\n \"V1OwnerReference\": v1OwnerReference_1.V1OwnerReference,\n \"V1PersistentVolume\": v1PersistentVolume_1.V1PersistentVolume,\n \"V1PersistentVolumeClaim\": v1PersistentVolumeClaim_1.V1PersistentVolumeClaim,\n \"V1PersistentVolumeClaimCondition\": v1PersistentVolumeClaimCondition_1.V1PersistentVolumeClaimCondition,\n \"V1PersistentVolumeClaimList\": v1PersistentVolumeClaimList_1.V1PersistentVolumeClaimList,\n \"V1PersistentVolumeClaimSpec\": v1PersistentVolumeClaimSpec_1.V1PersistentVolumeClaimSpec,\n \"V1PersistentVolumeClaimStatus\": v1PersistentVolumeClaimStatus_1.V1PersistentVolumeClaimStatus,\n \"V1PersistentVolumeClaimTemplate\": v1PersistentVolumeClaimTemplate_1.V1PersistentVolumeClaimTemplate,\n \"V1PersistentVolumeClaimVolumeSource\": v1PersistentVolumeClaimVolumeSource_1.V1PersistentVolumeClaimVolumeSource,\n \"V1PersistentVolumeList\": v1PersistentVolumeList_1.V1PersistentVolumeList,\n \"V1PersistentVolumeSpec\": v1PersistentVolumeSpec_1.V1PersistentVolumeSpec,\n \"V1PersistentVolumeStatus\": v1PersistentVolumeStatus_1.V1PersistentVolumeStatus,\n \"V1PhotonPersistentDiskVolumeSource\": v1PhotonPersistentDiskVolumeSource_1.V1PhotonPersistentDiskVolumeSource,\n \"V1Pod\": v1Pod_1.V1Pod,\n \"V1PodAffinity\": v1PodAffinity_1.V1PodAffinity,\n \"V1PodAffinityTerm\": v1PodAffinityTerm_1.V1PodAffinityTerm,\n \"V1PodAntiAffinity\": v1PodAntiAffinity_1.V1PodAntiAffinity,\n \"V1PodCondition\": v1PodCondition_1.V1PodCondition,\n \"V1PodDNSConfig\": v1PodDNSConfig_1.V1PodDNSConfig,\n \"V1PodDNSConfigOption\": v1PodDNSConfigOption_1.V1PodDNSConfigOption,\n \"V1PodDisruptionBudget\": v1PodDisruptionBudget_1.V1PodDisruptionBudget,\n \"V1PodDisruptionBudgetList\": v1PodDisruptionBudgetList_1.V1PodDisruptionBudgetList,\n \"V1PodDisruptionBudgetSpec\": v1PodDisruptionBudgetSpec_1.V1PodDisruptionBudgetSpec,\n \"V1PodDisruptionBudgetStatus\": v1PodDisruptionBudgetStatus_1.V1PodDisruptionBudgetStatus,\n \"V1PodIP\": v1PodIP_1.V1PodIP,\n \"V1PodList\": v1PodList_1.V1PodList,\n \"V1PodReadinessGate\": v1PodReadinessGate_1.V1PodReadinessGate,\n \"V1PodSecurityContext\": v1PodSecurityContext_1.V1PodSecurityContext,\n \"V1PodSpec\": v1PodSpec_1.V1PodSpec,\n \"V1PodStatus\": v1PodStatus_1.V1PodStatus,\n \"V1PodTemplate\": v1PodTemplate_1.V1PodTemplate,\n \"V1PodTemplateList\": v1PodTemplateList_1.V1PodTemplateList,\n \"V1PodTemplateSpec\": v1PodTemplateSpec_1.V1PodTemplateSpec,\n \"V1PolicyRule\": v1PolicyRule_1.V1PolicyRule,\n \"V1PortStatus\": v1PortStatus_1.V1PortStatus,\n \"V1PortworxVolumeSource\": v1PortworxVolumeSource_1.V1PortworxVolumeSource,\n \"V1Preconditions\": v1Preconditions_1.V1Preconditions,\n \"V1PreferredSchedulingTerm\": v1PreferredSchedulingTerm_1.V1PreferredSchedulingTerm,\n \"V1PriorityClass\": v1PriorityClass_1.V1PriorityClass,\n \"V1PriorityClassList\": v1PriorityClassList_1.V1PriorityClassList,\n \"V1Probe\": v1Probe_1.V1Probe,\n \"V1ProjectedVolumeSource\": v1ProjectedVolumeSource_1.V1ProjectedVolumeSource,\n \"V1QuobyteVolumeSource\": v1QuobyteVolumeSource_1.V1QuobyteVolumeSource,\n \"V1RBDPersistentVolumeSource\": v1RBDPersistentVolumeSource_1.V1RBDPersistentVolumeSource,\n \"V1RBDVolumeSource\": v1RBDVolumeSource_1.V1RBDVolumeSource,\n \"V1ReplicaSet\": v1ReplicaSet_1.V1ReplicaSet,\n \"V1ReplicaSetCondition\": v1ReplicaSetCondition_1.V1ReplicaSetCondition,\n \"V1ReplicaSetList\": v1ReplicaSetList_1.V1ReplicaSetList,\n \"V1ReplicaSetSpec\": v1ReplicaSetSpec_1.V1ReplicaSetSpec,\n \"V1ReplicaSetStatus\": v1ReplicaSetStatus_1.V1ReplicaSetStatus,\n \"V1ReplicationController\": v1ReplicationController_1.V1ReplicationController,\n \"V1ReplicationControllerCondition\": v1ReplicationControllerCondition_1.V1ReplicationControllerCondition,\n \"V1ReplicationControllerList\": v1ReplicationControllerList_1.V1ReplicationControllerList,\n \"V1ReplicationControllerSpec\": v1ReplicationControllerSpec_1.V1ReplicationControllerSpec,\n \"V1ReplicationControllerStatus\": v1ReplicationControllerStatus_1.V1ReplicationControllerStatus,\n \"V1ResourceAttributes\": v1ResourceAttributes_1.V1ResourceAttributes,\n \"V1ResourceFieldSelector\": v1ResourceFieldSelector_1.V1ResourceFieldSelector,\n \"V1ResourceQuota\": v1ResourceQuota_1.V1ResourceQuota,\n \"V1ResourceQuotaList\": v1ResourceQuotaList_1.V1ResourceQuotaList,\n \"V1ResourceQuotaSpec\": v1ResourceQuotaSpec_1.V1ResourceQuotaSpec,\n \"V1ResourceQuotaStatus\": v1ResourceQuotaStatus_1.V1ResourceQuotaStatus,\n \"V1ResourceRequirements\": v1ResourceRequirements_1.V1ResourceRequirements,\n \"V1ResourceRule\": v1ResourceRule_1.V1ResourceRule,\n \"V1Role\": v1Role_1.V1Role,\n \"V1RoleBinding\": v1RoleBinding_1.V1RoleBinding,\n \"V1RoleBindingList\": v1RoleBindingList_1.V1RoleBindingList,\n \"V1RoleList\": v1RoleList_1.V1RoleList,\n \"V1RoleRef\": v1RoleRef_1.V1RoleRef,\n \"V1RollingUpdateDaemonSet\": v1RollingUpdateDaemonSet_1.V1RollingUpdateDaemonSet,\n \"V1RollingUpdateDeployment\": v1RollingUpdateDeployment_1.V1RollingUpdateDeployment,\n \"V1RollingUpdateStatefulSetStrategy\": v1RollingUpdateStatefulSetStrategy_1.V1RollingUpdateStatefulSetStrategy,\n \"V1RuleWithOperations\": v1RuleWithOperations_1.V1RuleWithOperations,\n \"V1RuntimeClass\": v1RuntimeClass_1.V1RuntimeClass,\n \"V1RuntimeClassList\": v1RuntimeClassList_1.V1RuntimeClassList,\n \"V1SELinuxOptions\": v1SELinuxOptions_1.V1SELinuxOptions,\n \"V1Scale\": v1Scale_1.V1Scale,\n \"V1ScaleIOPersistentVolumeSource\": v1ScaleIOPersistentVolumeSource_1.V1ScaleIOPersistentVolumeSource,\n \"V1ScaleIOVolumeSource\": v1ScaleIOVolumeSource_1.V1ScaleIOVolumeSource,\n \"V1ScaleSpec\": v1ScaleSpec_1.V1ScaleSpec,\n \"V1ScaleStatus\": v1ScaleStatus_1.V1ScaleStatus,\n \"V1Scheduling\": v1Scheduling_1.V1Scheduling,\n \"V1ScopeSelector\": v1ScopeSelector_1.V1ScopeSelector,\n \"V1ScopedResourceSelectorRequirement\": v1ScopedResourceSelectorRequirement_1.V1ScopedResourceSelectorRequirement,\n \"V1SeccompProfile\": v1SeccompProfile_1.V1SeccompProfile,\n \"V1Secret\": v1Secret_1.V1Secret,\n \"V1SecretEnvSource\": v1SecretEnvSource_1.V1SecretEnvSource,\n \"V1SecretKeySelector\": v1SecretKeySelector_1.V1SecretKeySelector,\n \"V1SecretList\": v1SecretList_1.V1SecretList,\n \"V1SecretProjection\": v1SecretProjection_1.V1SecretProjection,\n \"V1SecretReference\": v1SecretReference_1.V1SecretReference,\n \"V1SecretVolumeSource\": v1SecretVolumeSource_1.V1SecretVolumeSource,\n \"V1SecurityContext\": v1SecurityContext_1.V1SecurityContext,\n \"V1SelfSubjectAccessReview\": v1SelfSubjectAccessReview_1.V1SelfSubjectAccessReview,\n \"V1SelfSubjectAccessReviewSpec\": v1SelfSubjectAccessReviewSpec_1.V1SelfSubjectAccessReviewSpec,\n \"V1SelfSubjectRulesReview\": v1SelfSubjectRulesReview_1.V1SelfSubjectRulesReview,\n \"V1SelfSubjectRulesReviewSpec\": v1SelfSubjectRulesReviewSpec_1.V1SelfSubjectRulesReviewSpec,\n \"V1ServerAddressByClientCIDR\": v1ServerAddressByClientCIDR_1.V1ServerAddressByClientCIDR,\n \"V1Service\": v1Service_1.V1Service,\n \"V1ServiceAccount\": v1ServiceAccount_1.V1ServiceAccount,\n \"V1ServiceAccountList\": v1ServiceAccountList_1.V1ServiceAccountList,\n \"V1ServiceAccountTokenProjection\": v1ServiceAccountTokenProjection_1.V1ServiceAccountTokenProjection,\n \"V1ServiceBackendPort\": v1ServiceBackendPort_1.V1ServiceBackendPort,\n \"V1ServiceList\": v1ServiceList_1.V1ServiceList,\n \"V1ServicePort\": v1ServicePort_1.V1ServicePort,\n \"V1ServiceSpec\": v1ServiceSpec_1.V1ServiceSpec,\n \"V1ServiceStatus\": v1ServiceStatus_1.V1ServiceStatus,\n \"V1SessionAffinityConfig\": v1SessionAffinityConfig_1.V1SessionAffinityConfig,\n \"V1StatefulSet\": v1StatefulSet_1.V1StatefulSet,\n \"V1StatefulSetCondition\": v1StatefulSetCondition_1.V1StatefulSetCondition,\n \"V1StatefulSetList\": v1StatefulSetList_1.V1StatefulSetList,\n \"V1StatefulSetSpec\": v1StatefulSetSpec_1.V1StatefulSetSpec,\n \"V1StatefulSetStatus\": v1StatefulSetStatus_1.V1StatefulSetStatus,\n \"V1StatefulSetUpdateStrategy\": v1StatefulSetUpdateStrategy_1.V1StatefulSetUpdateStrategy,\n \"V1Status\": v1Status_1.V1Status,\n \"V1StatusCause\": v1StatusCause_1.V1StatusCause,\n \"V1StatusDetails\": v1StatusDetails_1.V1StatusDetails,\n \"V1StorageClass\": v1StorageClass_1.V1StorageClass,\n \"V1StorageClassList\": v1StorageClassList_1.V1StorageClassList,\n \"V1StorageOSPersistentVolumeSource\": v1StorageOSPersistentVolumeSource_1.V1StorageOSPersistentVolumeSource,\n \"V1StorageOSVolumeSource\": v1StorageOSVolumeSource_1.V1StorageOSVolumeSource,\n \"V1Subject\": v1Subject_1.V1Subject,\n \"V1SubjectAccessReview\": v1SubjectAccessReview_1.V1SubjectAccessReview,\n \"V1SubjectAccessReviewSpec\": v1SubjectAccessReviewSpec_1.V1SubjectAccessReviewSpec,\n \"V1SubjectAccessReviewStatus\": v1SubjectAccessReviewStatus_1.V1SubjectAccessReviewStatus,\n \"V1SubjectRulesReviewStatus\": v1SubjectRulesReviewStatus_1.V1SubjectRulesReviewStatus,\n \"V1Sysctl\": v1Sysctl_1.V1Sysctl,\n \"V1TCPSocketAction\": v1TCPSocketAction_1.V1TCPSocketAction,\n \"V1Taint\": v1Taint_1.V1Taint,\n \"V1TokenRequestSpec\": v1TokenRequestSpec_1.V1TokenRequestSpec,\n \"V1TokenRequestStatus\": v1TokenRequestStatus_1.V1TokenRequestStatus,\n \"V1TokenReview\": v1TokenReview_1.V1TokenReview,\n \"V1TokenReviewSpec\": v1TokenReviewSpec_1.V1TokenReviewSpec,\n \"V1TokenReviewStatus\": v1TokenReviewStatus_1.V1TokenReviewStatus,\n \"V1Toleration\": v1Toleration_1.V1Toleration,\n \"V1TopologySelectorLabelRequirement\": v1TopologySelectorLabelRequirement_1.V1TopologySelectorLabelRequirement,\n \"V1TopologySelectorTerm\": v1TopologySelectorTerm_1.V1TopologySelectorTerm,\n \"V1TopologySpreadConstraint\": v1TopologySpreadConstraint_1.V1TopologySpreadConstraint,\n \"V1TypedLocalObjectReference\": v1TypedLocalObjectReference_1.V1TypedLocalObjectReference,\n \"V1UncountedTerminatedPods\": v1UncountedTerminatedPods_1.V1UncountedTerminatedPods,\n \"V1UserInfo\": v1UserInfo_1.V1UserInfo,\n \"V1ValidatingWebhook\": v1ValidatingWebhook_1.V1ValidatingWebhook,\n \"V1ValidatingWebhookConfiguration\": v1ValidatingWebhookConfiguration_1.V1ValidatingWebhookConfiguration,\n \"V1ValidatingWebhookConfigurationList\": v1ValidatingWebhookConfigurationList_1.V1ValidatingWebhookConfigurationList,\n \"V1Volume\": v1Volume_1.V1Volume,\n \"V1VolumeAttachment\": v1VolumeAttachment_1.V1VolumeAttachment,\n \"V1VolumeAttachmentList\": v1VolumeAttachmentList_1.V1VolumeAttachmentList,\n \"V1VolumeAttachmentSource\": v1VolumeAttachmentSource_1.V1VolumeAttachmentSource,\n \"V1VolumeAttachmentSpec\": v1VolumeAttachmentSpec_1.V1VolumeAttachmentSpec,\n \"V1VolumeAttachmentStatus\": v1VolumeAttachmentStatus_1.V1VolumeAttachmentStatus,\n \"V1VolumeDevice\": v1VolumeDevice_1.V1VolumeDevice,\n \"V1VolumeError\": v1VolumeError_1.V1VolumeError,\n \"V1VolumeMount\": v1VolumeMount_1.V1VolumeMount,\n \"V1VolumeNodeAffinity\": v1VolumeNodeAffinity_1.V1VolumeNodeAffinity,\n \"V1VolumeNodeResources\": v1VolumeNodeResources_1.V1VolumeNodeResources,\n \"V1VolumeProjection\": v1VolumeProjection_1.V1VolumeProjection,\n \"V1VsphereVirtualDiskVolumeSource\": v1VsphereVirtualDiskVolumeSource_1.V1VsphereVirtualDiskVolumeSource,\n \"V1WatchEvent\": v1WatchEvent_1.V1WatchEvent,\n \"V1WebhookConversion\": v1WebhookConversion_1.V1WebhookConversion,\n \"V1WeightedPodAffinityTerm\": v1WeightedPodAffinityTerm_1.V1WeightedPodAffinityTerm,\n \"V1WindowsSecurityContextOptions\": v1WindowsSecurityContextOptions_1.V1WindowsSecurityContextOptions,\n \"V1alpha1AggregationRule\": v1alpha1AggregationRule_1.V1alpha1AggregationRule,\n \"V1alpha1CSIStorageCapacity\": v1alpha1CSIStorageCapacity_1.V1alpha1CSIStorageCapacity,\n \"V1alpha1CSIStorageCapacityList\": v1alpha1CSIStorageCapacityList_1.V1alpha1CSIStorageCapacityList,\n \"V1alpha1ClusterRole\": v1alpha1ClusterRole_1.V1alpha1ClusterRole,\n \"V1alpha1ClusterRoleBinding\": v1alpha1ClusterRoleBinding_1.V1alpha1ClusterRoleBinding,\n \"V1alpha1ClusterRoleBindingList\": v1alpha1ClusterRoleBindingList_1.V1alpha1ClusterRoleBindingList,\n \"V1alpha1ClusterRoleList\": v1alpha1ClusterRoleList_1.V1alpha1ClusterRoleList,\n \"V1alpha1Overhead\": v1alpha1Overhead_1.V1alpha1Overhead,\n \"V1alpha1PolicyRule\": v1alpha1PolicyRule_1.V1alpha1PolicyRule,\n \"V1alpha1PriorityClass\": v1alpha1PriorityClass_1.V1alpha1PriorityClass,\n \"V1alpha1PriorityClassList\": v1alpha1PriorityClassList_1.V1alpha1PriorityClassList,\n \"V1alpha1Role\": v1alpha1Role_1.V1alpha1Role,\n \"V1alpha1RoleBinding\": v1alpha1RoleBinding_1.V1alpha1RoleBinding,\n \"V1alpha1RoleBindingList\": v1alpha1RoleBindingList_1.V1alpha1RoleBindingList,\n \"V1alpha1RoleList\": v1alpha1RoleList_1.V1alpha1RoleList,\n \"V1alpha1RoleRef\": v1alpha1RoleRef_1.V1alpha1RoleRef,\n \"V1alpha1RuntimeClass\": v1alpha1RuntimeClass_1.V1alpha1RuntimeClass,\n \"V1alpha1RuntimeClassList\": v1alpha1RuntimeClassList_1.V1alpha1RuntimeClassList,\n \"V1alpha1RuntimeClassSpec\": v1alpha1RuntimeClassSpec_1.V1alpha1RuntimeClassSpec,\n \"V1alpha1Scheduling\": v1alpha1Scheduling_1.V1alpha1Scheduling,\n \"V1alpha1ServerStorageVersion\": v1alpha1ServerStorageVersion_1.V1alpha1ServerStorageVersion,\n \"V1alpha1StorageVersion\": v1alpha1StorageVersion_1.V1alpha1StorageVersion,\n \"V1alpha1StorageVersionCondition\": v1alpha1StorageVersionCondition_1.V1alpha1StorageVersionCondition,\n \"V1alpha1StorageVersionList\": v1alpha1StorageVersionList_1.V1alpha1StorageVersionList,\n \"V1alpha1StorageVersionStatus\": v1alpha1StorageVersionStatus_1.V1alpha1StorageVersionStatus,\n \"V1alpha1Subject\": v1alpha1Subject_1.V1alpha1Subject,\n \"V1alpha1VolumeAttachment\": v1alpha1VolumeAttachment_1.V1alpha1VolumeAttachment,\n \"V1alpha1VolumeAttachmentList\": v1alpha1VolumeAttachmentList_1.V1alpha1VolumeAttachmentList,\n \"V1alpha1VolumeAttachmentSource\": v1alpha1VolumeAttachmentSource_1.V1alpha1VolumeAttachmentSource,\n \"V1alpha1VolumeAttachmentSpec\": v1alpha1VolumeAttachmentSpec_1.V1alpha1VolumeAttachmentSpec,\n \"V1alpha1VolumeAttachmentStatus\": v1alpha1VolumeAttachmentStatus_1.V1alpha1VolumeAttachmentStatus,\n \"V1alpha1VolumeError\": v1alpha1VolumeError_1.V1alpha1VolumeError,\n \"V1beta1AllowedCSIDriver\": v1beta1AllowedCSIDriver_1.V1beta1AllowedCSIDriver,\n \"V1beta1AllowedFlexVolume\": v1beta1AllowedFlexVolume_1.V1beta1AllowedFlexVolume,\n \"V1beta1AllowedHostPath\": v1beta1AllowedHostPath_1.V1beta1AllowedHostPath,\n \"V1beta1CSIStorageCapacity\": v1beta1CSIStorageCapacity_1.V1beta1CSIStorageCapacity,\n \"V1beta1CSIStorageCapacityList\": v1beta1CSIStorageCapacityList_1.V1beta1CSIStorageCapacityList,\n \"V1beta1CronJob\": v1beta1CronJob_1.V1beta1CronJob,\n \"V1beta1CronJobList\": v1beta1CronJobList_1.V1beta1CronJobList,\n \"V1beta1CronJobSpec\": v1beta1CronJobSpec_1.V1beta1CronJobSpec,\n \"V1beta1CronJobStatus\": v1beta1CronJobStatus_1.V1beta1CronJobStatus,\n \"V1beta1Endpoint\": v1beta1Endpoint_1.V1beta1Endpoint,\n \"V1beta1EndpointConditions\": v1beta1EndpointConditions_1.V1beta1EndpointConditions,\n \"V1beta1EndpointHints\": v1beta1EndpointHints_1.V1beta1EndpointHints,\n \"V1beta1EndpointPort\": v1beta1EndpointPort_1.V1beta1EndpointPort,\n \"V1beta1EndpointSlice\": v1beta1EndpointSlice_1.V1beta1EndpointSlice,\n \"V1beta1EndpointSliceList\": v1beta1EndpointSliceList_1.V1beta1EndpointSliceList,\n \"V1beta1Event\": v1beta1Event_1.V1beta1Event,\n \"V1beta1EventList\": v1beta1EventList_1.V1beta1EventList,\n \"V1beta1EventSeries\": v1beta1EventSeries_1.V1beta1EventSeries,\n \"V1beta1FSGroupStrategyOptions\": v1beta1FSGroupStrategyOptions_1.V1beta1FSGroupStrategyOptions,\n \"V1beta1FlowDistinguisherMethod\": v1beta1FlowDistinguisherMethod_1.V1beta1FlowDistinguisherMethod,\n \"V1beta1FlowSchema\": v1beta1FlowSchema_1.V1beta1FlowSchema,\n \"V1beta1FlowSchemaCondition\": v1beta1FlowSchemaCondition_1.V1beta1FlowSchemaCondition,\n \"V1beta1FlowSchemaList\": v1beta1FlowSchemaList_1.V1beta1FlowSchemaList,\n \"V1beta1FlowSchemaSpec\": v1beta1FlowSchemaSpec_1.V1beta1FlowSchemaSpec,\n \"V1beta1FlowSchemaStatus\": v1beta1FlowSchemaStatus_1.V1beta1FlowSchemaStatus,\n \"V1beta1ForZone\": v1beta1ForZone_1.V1beta1ForZone,\n \"V1beta1GroupSubject\": v1beta1GroupSubject_1.V1beta1GroupSubject,\n \"V1beta1HostPortRange\": v1beta1HostPortRange_1.V1beta1HostPortRange,\n \"V1beta1IDRange\": v1beta1IDRange_1.V1beta1IDRange,\n \"V1beta1JobTemplateSpec\": v1beta1JobTemplateSpec_1.V1beta1JobTemplateSpec,\n \"V1beta1LimitResponse\": v1beta1LimitResponse_1.V1beta1LimitResponse,\n \"V1beta1LimitedPriorityLevelConfiguration\": v1beta1LimitedPriorityLevelConfiguration_1.V1beta1LimitedPriorityLevelConfiguration,\n \"V1beta1NonResourcePolicyRule\": v1beta1NonResourcePolicyRule_1.V1beta1NonResourcePolicyRule,\n \"V1beta1Overhead\": v1beta1Overhead_1.V1beta1Overhead,\n \"V1beta1PodDisruptionBudget\": v1beta1PodDisruptionBudget_1.V1beta1PodDisruptionBudget,\n \"V1beta1PodDisruptionBudgetList\": v1beta1PodDisruptionBudgetList_1.V1beta1PodDisruptionBudgetList,\n \"V1beta1PodDisruptionBudgetSpec\": v1beta1PodDisruptionBudgetSpec_1.V1beta1PodDisruptionBudgetSpec,\n \"V1beta1PodDisruptionBudgetStatus\": v1beta1PodDisruptionBudgetStatus_1.V1beta1PodDisruptionBudgetStatus,\n \"V1beta1PodSecurityPolicy\": v1beta1PodSecurityPolicy_1.V1beta1PodSecurityPolicy,\n \"V1beta1PodSecurityPolicyList\": v1beta1PodSecurityPolicyList_1.V1beta1PodSecurityPolicyList,\n \"V1beta1PodSecurityPolicySpec\": v1beta1PodSecurityPolicySpec_1.V1beta1PodSecurityPolicySpec,\n \"V1beta1PolicyRulesWithSubjects\": v1beta1PolicyRulesWithSubjects_1.V1beta1PolicyRulesWithSubjects,\n \"V1beta1PriorityLevelConfiguration\": v1beta1PriorityLevelConfiguration_1.V1beta1PriorityLevelConfiguration,\n \"V1beta1PriorityLevelConfigurationCondition\": v1beta1PriorityLevelConfigurationCondition_1.V1beta1PriorityLevelConfigurationCondition,\n \"V1beta1PriorityLevelConfigurationList\": v1beta1PriorityLevelConfigurationList_1.V1beta1PriorityLevelConfigurationList,\n \"V1beta1PriorityLevelConfigurationReference\": v1beta1PriorityLevelConfigurationReference_1.V1beta1PriorityLevelConfigurationReference,\n \"V1beta1PriorityLevelConfigurationSpec\": v1beta1PriorityLevelConfigurationSpec_1.V1beta1PriorityLevelConfigurationSpec,\n \"V1beta1PriorityLevelConfigurationStatus\": v1beta1PriorityLevelConfigurationStatus_1.V1beta1PriorityLevelConfigurationStatus,\n \"V1beta1QueuingConfiguration\": v1beta1QueuingConfiguration_1.V1beta1QueuingConfiguration,\n \"V1beta1ResourcePolicyRule\": v1beta1ResourcePolicyRule_1.V1beta1ResourcePolicyRule,\n \"V1beta1RunAsGroupStrategyOptions\": v1beta1RunAsGroupStrategyOptions_1.V1beta1RunAsGroupStrategyOptions,\n \"V1beta1RunAsUserStrategyOptions\": v1beta1RunAsUserStrategyOptions_1.V1beta1RunAsUserStrategyOptions,\n \"V1beta1RuntimeClass\": v1beta1RuntimeClass_1.V1beta1RuntimeClass,\n \"V1beta1RuntimeClassList\": v1beta1RuntimeClassList_1.V1beta1RuntimeClassList,\n \"V1beta1RuntimeClassStrategyOptions\": v1beta1RuntimeClassStrategyOptions_1.V1beta1RuntimeClassStrategyOptions,\n \"V1beta1SELinuxStrategyOptions\": v1beta1SELinuxStrategyOptions_1.V1beta1SELinuxStrategyOptions,\n \"V1beta1Scheduling\": v1beta1Scheduling_1.V1beta1Scheduling,\n \"V1beta1ServiceAccountSubject\": v1beta1ServiceAccountSubject_1.V1beta1ServiceAccountSubject,\n \"V1beta1Subject\": v1beta1Subject_1.V1beta1Subject,\n \"V1beta1SupplementalGroupsStrategyOptions\": v1beta1SupplementalGroupsStrategyOptions_1.V1beta1SupplementalGroupsStrategyOptions,\n \"V1beta1UserSubject\": v1beta1UserSubject_1.V1beta1UserSubject,\n \"V2beta1ContainerResourceMetricSource\": v2beta1ContainerResourceMetricSource_1.V2beta1ContainerResourceMetricSource,\n \"V2beta1ContainerResourceMetricStatus\": v2beta1ContainerResourceMetricStatus_1.V2beta1ContainerResourceMetricStatus,\n \"V2beta1CrossVersionObjectReference\": v2beta1CrossVersionObjectReference_1.V2beta1CrossVersionObjectReference,\n \"V2beta1ExternalMetricSource\": v2beta1ExternalMetricSource_1.V2beta1ExternalMetricSource,\n \"V2beta1ExternalMetricStatus\": v2beta1ExternalMetricStatus_1.V2beta1ExternalMetricStatus,\n \"V2beta1HorizontalPodAutoscaler\": v2beta1HorizontalPodAutoscaler_1.V2beta1HorizontalPodAutoscaler,\n \"V2beta1HorizontalPodAutoscalerCondition\": v2beta1HorizontalPodAutoscalerCondition_1.V2beta1HorizontalPodAutoscalerCondition,\n \"V2beta1HorizontalPodAutoscalerList\": v2beta1HorizontalPodAutoscalerList_1.V2beta1HorizontalPodAutoscalerList,\n \"V2beta1HorizontalPodAutoscalerSpec\": v2beta1HorizontalPodAutoscalerSpec_1.V2beta1HorizontalPodAutoscalerSpec,\n \"V2beta1HorizontalPodAutoscalerStatus\": v2beta1HorizontalPodAutoscalerStatus_1.V2beta1HorizontalPodAutoscalerStatus,\n \"V2beta1MetricSpec\": v2beta1MetricSpec_1.V2beta1MetricSpec,\n \"V2beta1MetricStatus\": v2beta1MetricStatus_1.V2beta1MetricStatus,\n \"V2beta1ObjectMetricSource\": v2beta1ObjectMetricSource_1.V2beta1ObjectMetricSource,\n \"V2beta1ObjectMetricStatus\": v2beta1ObjectMetricStatus_1.V2beta1ObjectMetricStatus,\n \"V2beta1PodsMetricSource\": v2beta1PodsMetricSource_1.V2beta1PodsMetricSource,\n \"V2beta1PodsMetricStatus\": v2beta1PodsMetricStatus_1.V2beta1PodsMetricStatus,\n \"V2beta1ResourceMetricSource\": v2beta1ResourceMetricSource_1.V2beta1ResourceMetricSource,\n \"V2beta1ResourceMetricStatus\": v2beta1ResourceMetricStatus_1.V2beta1ResourceMetricStatus,\n \"V2beta2ContainerResourceMetricSource\": v2beta2ContainerResourceMetricSource_1.V2beta2ContainerResourceMetricSource,\n \"V2beta2ContainerResourceMetricStatus\": v2beta2ContainerResourceMetricStatus_1.V2beta2ContainerResourceMetricStatus,\n \"V2beta2CrossVersionObjectReference\": v2beta2CrossVersionObjectReference_1.V2beta2CrossVersionObjectReference,\n \"V2beta2ExternalMetricSource\": v2beta2ExternalMetricSource_1.V2beta2ExternalMetricSource,\n \"V2beta2ExternalMetricStatus\": v2beta2ExternalMetricStatus_1.V2beta2ExternalMetricStatus,\n \"V2beta2HPAScalingPolicy\": v2beta2HPAScalingPolicy_1.V2beta2HPAScalingPolicy,\n \"V2beta2HPAScalingRules\": v2beta2HPAScalingRules_1.V2beta2HPAScalingRules,\n \"V2beta2HorizontalPodAutoscaler\": v2beta2HorizontalPodAutoscaler_1.V2beta2HorizontalPodAutoscaler,\n \"V2beta2HorizontalPodAutoscalerBehavior\": v2beta2HorizontalPodAutoscalerBehavior_1.V2beta2HorizontalPodAutoscalerBehavior,\n \"V2beta2HorizontalPodAutoscalerCondition\": v2beta2HorizontalPodAutoscalerCondition_1.V2beta2HorizontalPodAutoscalerCondition,\n \"V2beta2HorizontalPodAutoscalerList\": v2beta2HorizontalPodAutoscalerList_1.V2beta2HorizontalPodAutoscalerList,\n \"V2beta2HorizontalPodAutoscalerSpec\": v2beta2HorizontalPodAutoscalerSpec_1.V2beta2HorizontalPodAutoscalerSpec,\n \"V2beta2HorizontalPodAutoscalerStatus\": v2beta2HorizontalPodAutoscalerStatus_1.V2beta2HorizontalPodAutoscalerStatus,\n \"V2beta2MetricIdentifier\": v2beta2MetricIdentifier_1.V2beta2MetricIdentifier,\n \"V2beta2MetricSpec\": v2beta2MetricSpec_1.V2beta2MetricSpec,\n \"V2beta2MetricStatus\": v2beta2MetricStatus_1.V2beta2MetricStatus,\n \"V2beta2MetricTarget\": v2beta2MetricTarget_1.V2beta2MetricTarget,\n \"V2beta2MetricValueStatus\": v2beta2MetricValueStatus_1.V2beta2MetricValueStatus,\n \"V2beta2ObjectMetricSource\": v2beta2ObjectMetricSource_1.V2beta2ObjectMetricSource,\n \"V2beta2ObjectMetricStatus\": v2beta2ObjectMetricStatus_1.V2beta2ObjectMetricStatus,\n \"V2beta2PodsMetricSource\": v2beta2PodsMetricSource_1.V2beta2PodsMetricSource,\n \"V2beta2PodsMetricStatus\": v2beta2PodsMetricStatus_1.V2beta2PodsMetricStatus,\n \"V2beta2ResourceMetricSource\": v2beta2ResourceMetricSource_1.V2beta2ResourceMetricSource,\n \"V2beta2ResourceMetricStatus\": v2beta2ResourceMetricStatus_1.V2beta2ResourceMetricStatus,\n \"VersionInfo\": versionInfo_1.VersionInfo,\n};\nclass ObjectSerializer {\n static findCorrectType(data, expectedType) {\n if (data == undefined) {\n return expectedType;\n }\n else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {\n return expectedType;\n }\n else if (expectedType === \"Date\") {\n return expectedType;\n }\n else {\n if (enumsMap[expectedType]) {\n return expectedType;\n }\n if (!typeMap[expectedType]) {\n return expectedType; // w/e we don't know the type\n }\n // Check the discriminator\n let discriminatorProperty = typeMap[expectedType].discriminator;\n if (discriminatorProperty == null) {\n return expectedType; // the type does not have a discriminator. use it.\n }\n else {\n if (data[discriminatorProperty]) {\n var discriminatorType = data[discriminatorProperty];\n if (typeMap[discriminatorType]) {\n return discriminatorType; // use the type given in the discriminator\n }\n else {\n return expectedType; // discriminator did not map to a type\n }\n }\n else {\n return expectedType; // discriminator was not present (or an empty string)\n }\n }\n }\n }\n static serialize(data, type) {\n if (data == undefined) {\n return data;\n }\n else if (primitives.indexOf(type.toLowerCase()) !== -1) {\n return data;\n }\n else if (type.lastIndexOf(\"Array<\", 0) === 0) { // string.startsWith pre es6\n let subType = type.replace(\"Array<\", \"\"); // Array => Type>\n subType = subType.substring(0, subType.length - 1); // Type> => Type\n let transformedData = [];\n for (let index = 0; index < data.length; index++) {\n let datum = data[index];\n transformedData.push(ObjectSerializer.serialize(datum, subType));\n }\n return transformedData;\n }\n else if (type === \"Date\") {\n return data.toISOString();\n }\n else {\n if (enumsMap[type]) {\n return data;\n }\n if (!typeMap[type]) { // in case we dont know the type\n return data;\n }\n // Get the actual type of this object\n type = this.findCorrectType(data, type);\n // get the map for the correct type.\n let attributeTypes = typeMap[type].getAttributeTypeMap();\n let instance = {};\n for (let index = 0; index < attributeTypes.length; index++) {\n let attributeType = attributeTypes[index];\n instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);\n }\n return instance;\n }\n }\n static deserialize(data, type) {\n // polymorphism may change the actual type.\n type = ObjectSerializer.findCorrectType(data, type);\n if (data == undefined) {\n return data;\n }\n else if (primitives.indexOf(type.toLowerCase()) !== -1) {\n return data;\n }\n else if (type.lastIndexOf(\"Array<\", 0) === 0) { // string.startsWith pre es6\n let subType = type.replace(\"Array<\", \"\"); // Array => Type>\n subType = subType.substring(0, subType.length - 1); // Type> => Type\n let transformedData = [];\n for (let index = 0; index < data.length; index++) {\n let datum = data[index];\n transformedData.push(ObjectSerializer.deserialize(datum, subType));\n }\n return transformedData;\n }\n else if (type === \"Date\") {\n return new Date(data);\n }\n else {\n if (enumsMap[type]) { // is Enum\n return data;\n }\n if (!typeMap[type]) { // dont know the type\n return data;\n }\n let instance = new typeMap[type]();\n let attributeTypes = typeMap[type].getAttributeTypeMap();\n for (let index = 0; index < attributeTypes.length; index++) {\n let attributeType = attributeTypes[index];\n instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);\n }\n return instance;\n }\n }\n}\nexports.ObjectSerializer = ObjectSerializer;\nclass HttpBasicAuth {\n constructor() {\n this.username = '';\n this.password = '';\n }\n applyToRequest(requestOptions) {\n requestOptions.auth = {\n username: this.username, password: this.password\n };\n }\n}\nexports.HttpBasicAuth = HttpBasicAuth;\nclass HttpBearerAuth {\n constructor() {\n this.accessToken = '';\n }\n applyToRequest(requestOptions) {\n if (requestOptions && requestOptions.headers) {\n const accessToken = typeof this.accessToken === 'function'\n ? this.accessToken()\n : this.accessToken;\n requestOptions.headers[\"Authorization\"] = \"Bearer \" + accessToken;\n }\n }\n}\nexports.HttpBearerAuth = HttpBearerAuth;\nclass ApiKeyAuth {\n constructor(location, paramName) {\n this.location = location;\n this.paramName = paramName;\n this.apiKey = '';\n }\n applyToRequest(requestOptions) {\n if (this.location == \"query\") {\n requestOptions.qs[this.paramName] = this.apiKey;\n }\n else if (this.location == \"header\" && requestOptions && requestOptions.headers) {\n requestOptions.headers[this.paramName] = this.apiKey;\n }\n else if (this.location == 'cookie' && requestOptions && requestOptions.headers) {\n if (requestOptions.headers['Cookie']) {\n requestOptions.headers['Cookie'] += '; ' + this.paramName + '=' + encodeURIComponent(this.apiKey);\n }\n else {\n requestOptions.headers['Cookie'] = this.paramName + '=' + encodeURIComponent(this.apiKey);\n }\n }\n }\n}\nexports.ApiKeyAuth = ApiKeyAuth;\nclass OAuth {\n constructor() {\n this.accessToken = '';\n }\n applyToRequest(requestOptions) {\n if (requestOptions && requestOptions.headers) {\n requestOptions.headers[\"Authorization\"] = \"Bearer \" + this.accessToken;\n }\n }\n}\nexports.OAuth = OAuth;\nclass VoidAuth {\n constructor() {\n this.username = '';\n this.password = '';\n }\n applyToRequest(_) {\n // Do nothing\n }\n}\nexports.VoidAuth = VoidAuth;\n//# sourceMappingURL=models.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StorageV1TokenRequest = void 0;\n/**\n* TokenRequest contains parameters of a service account token.\n*/\nclass StorageV1TokenRequest {\n static getAttributeTypeMap() {\n return StorageV1TokenRequest.attributeTypeMap;\n }\n}\nexports.StorageV1TokenRequest = StorageV1TokenRequest;\nStorageV1TokenRequest.discriminator = undefined;\nStorageV1TokenRequest.attributeTypeMap = [\n {\n \"name\": \"audience\",\n \"baseName\": \"audience\",\n \"type\": \"string\"\n },\n {\n \"name\": \"expirationSeconds\",\n \"baseName\": \"expirationSeconds\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=storageV1TokenRequest.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIGroup = void 0;\n/**\n* APIGroup contains the name, the supported versions, and the preferred version of a group.\n*/\nclass V1APIGroup {\n static getAttributeTypeMap() {\n return V1APIGroup.attributeTypeMap;\n }\n}\nexports.V1APIGroup = V1APIGroup;\nV1APIGroup.discriminator = undefined;\nV1APIGroup.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"preferredVersion\",\n \"baseName\": \"preferredVersion\",\n \"type\": \"V1GroupVersionForDiscovery\"\n },\n {\n \"name\": \"serverAddressByClientCIDRs\",\n \"baseName\": \"serverAddressByClientCIDRs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"versions\",\n \"baseName\": \"versions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1APIGroup.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIGroupList = void 0;\n/**\n* APIGroupList is a list of APIGroup, to allow clients to discover the API at /apis.\n*/\nclass V1APIGroupList {\n static getAttributeTypeMap() {\n return V1APIGroupList.attributeTypeMap;\n }\n}\nexports.V1APIGroupList = V1APIGroupList;\nV1APIGroupList.discriminator = undefined;\nV1APIGroupList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1APIGroupList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIResource = void 0;\n/**\n* APIResource specifies the name of a resource and whether it is namespaced.\n*/\nclass V1APIResource {\n static getAttributeTypeMap() {\n return V1APIResource.attributeTypeMap;\n }\n}\nexports.V1APIResource = V1APIResource;\nV1APIResource.discriminator = undefined;\nV1APIResource.attributeTypeMap = [\n {\n \"name\": \"categories\",\n \"baseName\": \"categories\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespaced\",\n \"baseName\": \"namespaced\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"shortNames\",\n \"baseName\": \"shortNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"singularName\",\n \"baseName\": \"singularName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storageVersionHash\",\n \"baseName\": \"storageVersionHash\",\n \"type\": \"string\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1APIResource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIResourceList = void 0;\n/**\n* APIResourceList is a list of APIResource, it is used to expose the name of the resources supported in a specific group and version, and if the resource is namespaced.\n*/\nclass V1APIResourceList {\n static getAttributeTypeMap() {\n return V1APIResourceList.attributeTypeMap;\n }\n}\nexports.V1APIResourceList = V1APIResourceList;\nV1APIResourceList.discriminator = undefined;\nV1APIResourceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"groupVersion\",\n \"baseName\": \"groupVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1APIResourceList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIService = void 0;\n/**\n* APIService represents a server for a particular GroupVersion. Name must be \\\"version.group\\\".\n*/\nclass V1APIService {\n static getAttributeTypeMap() {\n return V1APIService.attributeTypeMap;\n }\n}\nexports.V1APIService = V1APIService;\nV1APIService.discriminator = undefined;\nV1APIService.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1APIServiceSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1APIServiceStatus\"\n }\n];\n//# sourceMappingURL=v1APIService.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIServiceCondition = void 0;\n/**\n* APIServiceCondition describes the state of an APIService at a particular point\n*/\nclass V1APIServiceCondition {\n static getAttributeTypeMap() {\n return V1APIServiceCondition.attributeTypeMap;\n }\n}\nexports.V1APIServiceCondition = V1APIServiceCondition;\nV1APIServiceCondition.discriminator = undefined;\nV1APIServiceCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1APIServiceCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIServiceList = void 0;\n/**\n* APIServiceList is a list of APIService objects.\n*/\nclass V1APIServiceList {\n static getAttributeTypeMap() {\n return V1APIServiceList.attributeTypeMap;\n }\n}\nexports.V1APIServiceList = V1APIServiceList;\nV1APIServiceList.discriminator = undefined;\nV1APIServiceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1APIServiceList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIServiceSpec = void 0;\n/**\n* APIServiceSpec contains information for locating and communicating with a server. Only https is supported, though you are able to disable certificate verification.\n*/\nclass V1APIServiceSpec {\n static getAttributeTypeMap() {\n return V1APIServiceSpec.attributeTypeMap;\n }\n}\nexports.V1APIServiceSpec = V1APIServiceSpec;\nV1APIServiceSpec.discriminator = undefined;\nV1APIServiceSpec.attributeTypeMap = [\n {\n \"name\": \"caBundle\",\n \"baseName\": \"caBundle\",\n \"type\": \"string\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"groupPriorityMinimum\",\n \"baseName\": \"groupPriorityMinimum\",\n \"type\": \"number\"\n },\n {\n \"name\": \"insecureSkipTLSVerify\",\n \"baseName\": \"insecureSkipTLSVerify\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"ApiregistrationV1ServiceReference\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n },\n {\n \"name\": \"versionPriority\",\n \"baseName\": \"versionPriority\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1APIServiceSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIServiceStatus = void 0;\n/**\n* APIServiceStatus contains derived information about an API server\n*/\nclass V1APIServiceStatus {\n static getAttributeTypeMap() {\n return V1APIServiceStatus.attributeTypeMap;\n }\n}\nexports.V1APIServiceStatus = V1APIServiceStatus;\nV1APIServiceStatus.discriminator = undefined;\nV1APIServiceStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1APIServiceStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1APIVersions = void 0;\n/**\n* APIVersions lists the versions that are available, to allow clients to discover the API at /api, which is the root path of the legacy v1 API.\n*/\nclass V1APIVersions {\n static getAttributeTypeMap() {\n return V1APIVersions.attributeTypeMap;\n }\n}\nexports.V1APIVersions = V1APIVersions;\nV1APIVersions.discriminator = undefined;\nV1APIVersions.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"serverAddressByClientCIDRs\",\n \"baseName\": \"serverAddressByClientCIDRs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"versions\",\n \"baseName\": \"versions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1APIVersions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1AWSElasticBlockStoreVolumeSource = void 0;\n/**\n* Represents a Persistent Disk resource in AWS. An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.\n*/\nclass V1AWSElasticBlockStoreVolumeSource {\n static getAttributeTypeMap() {\n return V1AWSElasticBlockStoreVolumeSource.attributeTypeMap;\n }\n}\nexports.V1AWSElasticBlockStoreVolumeSource = V1AWSElasticBlockStoreVolumeSource;\nV1AWSElasticBlockStoreVolumeSource.discriminator = undefined;\nV1AWSElasticBlockStoreVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"partition\",\n \"baseName\": \"partition\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeID\",\n \"baseName\": \"volumeID\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1AWSElasticBlockStoreVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Affinity = void 0;\n/**\n* Affinity is a group of affinity scheduling rules.\n*/\nclass V1Affinity {\n static getAttributeTypeMap() {\n return V1Affinity.attributeTypeMap;\n }\n}\nexports.V1Affinity = V1Affinity;\nV1Affinity.discriminator = undefined;\nV1Affinity.attributeTypeMap = [\n {\n \"name\": \"nodeAffinity\",\n \"baseName\": \"nodeAffinity\",\n \"type\": \"V1NodeAffinity\"\n },\n {\n \"name\": \"podAffinity\",\n \"baseName\": \"podAffinity\",\n \"type\": \"V1PodAffinity\"\n },\n {\n \"name\": \"podAntiAffinity\",\n \"baseName\": \"podAntiAffinity\",\n \"type\": \"V1PodAntiAffinity\"\n }\n];\n//# sourceMappingURL=v1Affinity.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1AggregationRule = void 0;\n/**\n* AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole\n*/\nclass V1AggregationRule {\n static getAttributeTypeMap() {\n return V1AggregationRule.attributeTypeMap;\n }\n}\nexports.V1AggregationRule = V1AggregationRule;\nV1AggregationRule.discriminator = undefined;\nV1AggregationRule.attributeTypeMap = [\n {\n \"name\": \"clusterRoleSelectors\",\n \"baseName\": \"clusterRoleSelectors\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1AggregationRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1AttachedVolume = void 0;\n/**\n* AttachedVolume describes a volume attached to a node\n*/\nclass V1AttachedVolume {\n static getAttributeTypeMap() {\n return V1AttachedVolume.attributeTypeMap;\n }\n}\nexports.V1AttachedVolume = V1AttachedVolume;\nV1AttachedVolume.discriminator = undefined;\nV1AttachedVolume.attributeTypeMap = [\n {\n \"name\": \"devicePath\",\n \"baseName\": \"devicePath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1AttachedVolume.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1AzureDiskVolumeSource = void 0;\n/**\n* AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.\n*/\nclass V1AzureDiskVolumeSource {\n static getAttributeTypeMap() {\n return V1AzureDiskVolumeSource.attributeTypeMap;\n }\n}\nexports.V1AzureDiskVolumeSource = V1AzureDiskVolumeSource;\nV1AzureDiskVolumeSource.discriminator = undefined;\nV1AzureDiskVolumeSource.attributeTypeMap = [\n {\n \"name\": \"cachingMode\",\n \"baseName\": \"cachingMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"diskName\",\n \"baseName\": \"diskName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"diskURI\",\n \"baseName\": \"diskURI\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1AzureDiskVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1AzureFilePersistentVolumeSource = void 0;\n/**\n* AzureFile represents an Azure File Service mount on the host and bind mount to the pod.\n*/\nclass V1AzureFilePersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1AzureFilePersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1AzureFilePersistentVolumeSource = V1AzureFilePersistentVolumeSource;\nV1AzureFilePersistentVolumeSource.discriminator = undefined;\nV1AzureFilePersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretName\",\n \"baseName\": \"secretName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"secretNamespace\",\n \"baseName\": \"secretNamespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shareName\",\n \"baseName\": \"shareName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1AzureFilePersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1AzureFileVolumeSource = void 0;\n/**\n* AzureFile represents an Azure File Service mount on the host and bind mount to the pod.\n*/\nclass V1AzureFileVolumeSource {\n static getAttributeTypeMap() {\n return V1AzureFileVolumeSource.attributeTypeMap;\n }\n}\nexports.V1AzureFileVolumeSource = V1AzureFileVolumeSource;\nV1AzureFileVolumeSource.discriminator = undefined;\nV1AzureFileVolumeSource.attributeTypeMap = [\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretName\",\n \"baseName\": \"secretName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shareName\",\n \"baseName\": \"shareName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1AzureFileVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Binding = void 0;\n/**\n* Binding ties one object to another; for example, a pod is bound to a node by a scheduler. Deprecated in 1.7, please use the bindings subresource of pods instead.\n*/\nclass V1Binding {\n static getAttributeTypeMap() {\n return V1Binding.attributeTypeMap;\n }\n}\nexports.V1Binding = V1Binding;\nV1Binding.discriminator = undefined;\nV1Binding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V1ObjectReference\"\n }\n];\n//# sourceMappingURL=v1Binding.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1BoundObjectReference = void 0;\n/**\n* BoundObjectReference is a reference to an object that a token is bound to.\n*/\nclass V1BoundObjectReference {\n static getAttributeTypeMap() {\n return V1BoundObjectReference.attributeTypeMap;\n }\n}\nexports.V1BoundObjectReference = V1BoundObjectReference;\nV1BoundObjectReference.discriminator = undefined;\nV1BoundObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1BoundObjectReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSIDriver = void 0;\n/**\n* CSIDriver captures information about a Container Storage Interface (CSI) volume driver deployed on the cluster. Kubernetes attach detach controller uses this object to determine whether attach is required. Kubelet uses this object to determine whether pod information needs to be passed on mount. CSIDriver objects are non-namespaced.\n*/\nclass V1CSIDriver {\n static getAttributeTypeMap() {\n return V1CSIDriver.attributeTypeMap;\n }\n}\nexports.V1CSIDriver = V1CSIDriver;\nV1CSIDriver.discriminator = undefined;\nV1CSIDriver.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1CSIDriverSpec\"\n }\n];\n//# sourceMappingURL=v1CSIDriver.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSIDriverList = void 0;\n/**\n* CSIDriverList is a collection of CSIDriver objects.\n*/\nclass V1CSIDriverList {\n static getAttributeTypeMap() {\n return V1CSIDriverList.attributeTypeMap;\n }\n}\nexports.V1CSIDriverList = V1CSIDriverList;\nV1CSIDriverList.discriminator = undefined;\nV1CSIDriverList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1CSIDriverList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSIDriverSpec = void 0;\n/**\n* CSIDriverSpec is the specification of a CSIDriver.\n*/\nclass V1CSIDriverSpec {\n static getAttributeTypeMap() {\n return V1CSIDriverSpec.attributeTypeMap;\n }\n}\nexports.V1CSIDriverSpec = V1CSIDriverSpec;\nV1CSIDriverSpec.discriminator = undefined;\nV1CSIDriverSpec.attributeTypeMap = [\n {\n \"name\": \"attachRequired\",\n \"baseName\": \"attachRequired\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"fsGroupPolicy\",\n \"baseName\": \"fsGroupPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"podInfoOnMount\",\n \"baseName\": \"podInfoOnMount\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"requiresRepublish\",\n \"baseName\": \"requiresRepublish\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"storageCapacity\",\n \"baseName\": \"storageCapacity\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"tokenRequests\",\n \"baseName\": \"tokenRequests\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumeLifecycleModes\",\n \"baseName\": \"volumeLifecycleModes\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1CSIDriverSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSINode = void 0;\n/**\n* CSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn\\'t create this object. CSINode has an OwnerReference that points to the corresponding node object.\n*/\nclass V1CSINode {\n static getAttributeTypeMap() {\n return V1CSINode.attributeTypeMap;\n }\n}\nexports.V1CSINode = V1CSINode;\nV1CSINode.discriminator = undefined;\nV1CSINode.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1CSINodeSpec\"\n }\n];\n//# sourceMappingURL=v1CSINode.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSINodeDriver = void 0;\n/**\n* CSINodeDriver holds information about the specification of one CSI driver installed on a node\n*/\nclass V1CSINodeDriver {\n static getAttributeTypeMap() {\n return V1CSINodeDriver.attributeTypeMap;\n }\n}\nexports.V1CSINodeDriver = V1CSINodeDriver;\nV1CSINodeDriver.discriminator = undefined;\nV1CSINodeDriver.attributeTypeMap = [\n {\n \"name\": \"allocatable\",\n \"baseName\": \"allocatable\",\n \"type\": \"V1VolumeNodeResources\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeID\",\n \"baseName\": \"nodeID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"topologyKeys\",\n \"baseName\": \"topologyKeys\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1CSINodeDriver.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSINodeList = void 0;\n/**\n* CSINodeList is a collection of CSINode objects.\n*/\nclass V1CSINodeList {\n static getAttributeTypeMap() {\n return V1CSINodeList.attributeTypeMap;\n }\n}\nexports.V1CSINodeList = V1CSINodeList;\nV1CSINodeList.discriminator = undefined;\nV1CSINodeList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1CSINodeList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSINodeSpec = void 0;\n/**\n* CSINodeSpec holds information about the specification of all CSI drivers installed on a node\n*/\nclass V1CSINodeSpec {\n static getAttributeTypeMap() {\n return V1CSINodeSpec.attributeTypeMap;\n }\n}\nexports.V1CSINodeSpec = V1CSINodeSpec;\nV1CSINodeSpec.discriminator = undefined;\nV1CSINodeSpec.attributeTypeMap = [\n {\n \"name\": \"drivers\",\n \"baseName\": \"drivers\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1CSINodeSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSIPersistentVolumeSource = void 0;\n/**\n* Represents storage that is managed by an external CSI volume driver (Beta feature)\n*/\nclass V1CSIPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1CSIPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1CSIPersistentVolumeSource = V1CSIPersistentVolumeSource;\nV1CSIPersistentVolumeSource.discriminator = undefined;\nV1CSIPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"controllerExpandSecretRef\",\n \"baseName\": \"controllerExpandSecretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"controllerPublishSecretRef\",\n \"baseName\": \"controllerPublishSecretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodePublishSecretRef\",\n \"baseName\": \"nodePublishSecretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"nodeStageSecretRef\",\n \"baseName\": \"nodeStageSecretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeAttributes\",\n \"baseName\": \"volumeAttributes\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"volumeHandle\",\n \"baseName\": \"volumeHandle\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CSIPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CSIVolumeSource = void 0;\n/**\n* Represents a source location of a volume to mount, managed by an external CSI driver\n*/\nclass V1CSIVolumeSource {\n static getAttributeTypeMap() {\n return V1CSIVolumeSource.attributeTypeMap;\n }\n}\nexports.V1CSIVolumeSource = V1CSIVolumeSource;\nV1CSIVolumeSource.discriminator = undefined;\nV1CSIVolumeSource.attributeTypeMap = [\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodePublishSecretRef\",\n \"baseName\": \"nodePublishSecretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeAttributes\",\n \"baseName\": \"volumeAttributes\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\n//# sourceMappingURL=v1CSIVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Capabilities = void 0;\n/**\n* Adds and removes POSIX capabilities from running containers.\n*/\nclass V1Capabilities {\n static getAttributeTypeMap() {\n return V1Capabilities.attributeTypeMap;\n }\n}\nexports.V1Capabilities = V1Capabilities;\nV1Capabilities.discriminator = undefined;\nV1Capabilities.attributeTypeMap = [\n {\n \"name\": \"add\",\n \"baseName\": \"add\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"drop\",\n \"baseName\": \"drop\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1Capabilities.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CephFSPersistentVolumeSource = void 0;\n/**\n* Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1CephFSPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1CephFSPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1CephFSPersistentVolumeSource = V1CephFSPersistentVolumeSource;\nV1CephFSPersistentVolumeSource.discriminator = undefined;\nV1CephFSPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"monitors\",\n \"baseName\": \"monitors\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretFile\",\n \"baseName\": \"secretFile\",\n \"type\": \"string\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CephFSPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CephFSVolumeSource = void 0;\n/**\n* Represents a Ceph Filesystem mount that lasts the lifetime of a pod Cephfs volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1CephFSVolumeSource {\n static getAttributeTypeMap() {\n return V1CephFSVolumeSource.attributeTypeMap;\n }\n}\nexports.V1CephFSVolumeSource = V1CephFSVolumeSource;\nV1CephFSVolumeSource.discriminator = undefined;\nV1CephFSVolumeSource.attributeTypeMap = [\n {\n \"name\": \"monitors\",\n \"baseName\": \"monitors\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretFile\",\n \"baseName\": \"secretFile\",\n \"type\": \"string\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CephFSVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CertificateSigningRequest = void 0;\n/**\n* CertificateSigningRequest objects provide a mechanism to obtain x509 certificates by submitting a certificate signing request, and having it asynchronously approved and issued. Kubelets use this API to obtain: 1. client certificates to authenticate to kube-apiserver (with the \\\"kubernetes.io/kube-apiserver-client-kubelet\\\" signerName). 2. serving certificates for TLS endpoints kube-apiserver can connect to securely (with the \\\"kubernetes.io/kubelet-serving\\\" signerName). This API can be used to request client certificates to authenticate to kube-apiserver (with the \\\"kubernetes.io/kube-apiserver-client\\\" signerName), or to obtain certificates from custom non-Kubernetes signers.\n*/\nclass V1CertificateSigningRequest {\n static getAttributeTypeMap() {\n return V1CertificateSigningRequest.attributeTypeMap;\n }\n}\nexports.V1CertificateSigningRequest = V1CertificateSigningRequest;\nV1CertificateSigningRequest.discriminator = undefined;\nV1CertificateSigningRequest.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1CertificateSigningRequestSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1CertificateSigningRequestStatus\"\n }\n];\n//# sourceMappingURL=v1CertificateSigningRequest.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CertificateSigningRequestCondition = void 0;\n/**\n* CertificateSigningRequestCondition describes a condition of a CertificateSigningRequest object\n*/\nclass V1CertificateSigningRequestCondition {\n static getAttributeTypeMap() {\n return V1CertificateSigningRequestCondition.attributeTypeMap;\n }\n}\nexports.V1CertificateSigningRequestCondition = V1CertificateSigningRequestCondition;\nV1CertificateSigningRequestCondition.discriminator = undefined;\nV1CertificateSigningRequestCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastUpdateTime\",\n \"baseName\": \"lastUpdateTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CertificateSigningRequestCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CertificateSigningRequestList = void 0;\n/**\n* CertificateSigningRequestList is a collection of CertificateSigningRequest objects\n*/\nclass V1CertificateSigningRequestList {\n static getAttributeTypeMap() {\n return V1CertificateSigningRequestList.attributeTypeMap;\n }\n}\nexports.V1CertificateSigningRequestList = V1CertificateSigningRequestList;\nV1CertificateSigningRequestList.discriminator = undefined;\nV1CertificateSigningRequestList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1CertificateSigningRequestList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CertificateSigningRequestSpec = void 0;\n/**\n* CertificateSigningRequestSpec contains the certificate request.\n*/\nclass V1CertificateSigningRequestSpec {\n static getAttributeTypeMap() {\n return V1CertificateSigningRequestSpec.attributeTypeMap;\n }\n}\nexports.V1CertificateSigningRequestSpec = V1CertificateSigningRequestSpec;\nV1CertificateSigningRequestSpec.discriminator = undefined;\nV1CertificateSigningRequestSpec.attributeTypeMap = [\n {\n \"name\": \"expirationSeconds\",\n \"baseName\": \"expirationSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"extra\",\n \"baseName\": \"extra\",\n \"type\": \"{ [key: string]: Array; }\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"request\",\n \"baseName\": \"request\",\n \"type\": \"string\"\n },\n {\n \"name\": \"signerName\",\n \"baseName\": \"signerName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n },\n {\n \"name\": \"usages\",\n \"baseName\": \"usages\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"username\",\n \"baseName\": \"username\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CertificateSigningRequestSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CertificateSigningRequestStatus = void 0;\n/**\n* CertificateSigningRequestStatus contains conditions used to indicate approved/denied/failed status of the request, and the issued certificate.\n*/\nclass V1CertificateSigningRequestStatus {\n static getAttributeTypeMap() {\n return V1CertificateSigningRequestStatus.attributeTypeMap;\n }\n}\nexports.V1CertificateSigningRequestStatus = V1CertificateSigningRequestStatus;\nV1CertificateSigningRequestStatus.discriminator = undefined;\nV1CertificateSigningRequestStatus.attributeTypeMap = [\n {\n \"name\": \"certificate\",\n \"baseName\": \"certificate\",\n \"type\": \"string\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1CertificateSigningRequestStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CinderPersistentVolumeSource = void 0;\n/**\n* Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.\n*/\nclass V1CinderPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1CinderPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1CinderPersistentVolumeSource = V1CinderPersistentVolumeSource;\nV1CinderPersistentVolumeSource.discriminator = undefined;\nV1CinderPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"volumeID\",\n \"baseName\": \"volumeID\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CinderPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CinderVolumeSource = void 0;\n/**\n* Represents a cinder volume resource in Openstack. A Cinder volume must exist before mounting to a container. The volume must also be in the same region as the kubelet. Cinder volumes support ownership management and SELinux relabeling.\n*/\nclass V1CinderVolumeSource {\n static getAttributeTypeMap() {\n return V1CinderVolumeSource.attributeTypeMap;\n }\n}\nexports.V1CinderVolumeSource = V1CinderVolumeSource;\nV1CinderVolumeSource.discriminator = undefined;\nV1CinderVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"volumeID\",\n \"baseName\": \"volumeID\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CinderVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ClientIPConfig = void 0;\n/**\n* ClientIPConfig represents the configurations of Client IP based session affinity.\n*/\nclass V1ClientIPConfig {\n static getAttributeTypeMap() {\n return V1ClientIPConfig.attributeTypeMap;\n }\n}\nexports.V1ClientIPConfig = V1ClientIPConfig;\nV1ClientIPConfig.discriminator = undefined;\nV1ClientIPConfig.attributeTypeMap = [\n {\n \"name\": \"timeoutSeconds\",\n \"baseName\": \"timeoutSeconds\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1ClientIPConfig.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ClusterRole = void 0;\n/**\n* ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding.\n*/\nclass V1ClusterRole {\n static getAttributeTypeMap() {\n return V1ClusterRole.attributeTypeMap;\n }\n}\nexports.V1ClusterRole = V1ClusterRole;\nV1ClusterRole.discriminator = undefined;\nV1ClusterRole.attributeTypeMap = [\n {\n \"name\": \"aggregationRule\",\n \"baseName\": \"aggregationRule\",\n \"type\": \"V1AggregationRule\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ClusterRole.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ClusterRoleBinding = void 0;\n/**\n* ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject.\n*/\nclass V1ClusterRoleBinding {\n static getAttributeTypeMap() {\n return V1ClusterRoleBinding.attributeTypeMap;\n }\n}\nexports.V1ClusterRoleBinding = V1ClusterRoleBinding;\nV1ClusterRoleBinding.discriminator = undefined;\nV1ClusterRoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ClusterRoleBinding.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ClusterRoleBindingList = void 0;\n/**\n* ClusterRoleBindingList is a collection of ClusterRoleBindings\n*/\nclass V1ClusterRoleBindingList {\n static getAttributeTypeMap() {\n return V1ClusterRoleBindingList.attributeTypeMap;\n }\n}\nexports.V1ClusterRoleBindingList = V1ClusterRoleBindingList;\nV1ClusterRoleBindingList.discriminator = undefined;\nV1ClusterRoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ClusterRoleBindingList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ClusterRoleList = void 0;\n/**\n* ClusterRoleList is a collection of ClusterRoles\n*/\nclass V1ClusterRoleList {\n static getAttributeTypeMap() {\n return V1ClusterRoleList.attributeTypeMap;\n }\n}\nexports.V1ClusterRoleList = V1ClusterRoleList;\nV1ClusterRoleList.discriminator = undefined;\nV1ClusterRoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ClusterRoleList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ComponentCondition = void 0;\n/**\n* Information about the condition of a component.\n*/\nclass V1ComponentCondition {\n static getAttributeTypeMap() {\n return V1ComponentCondition.attributeTypeMap;\n }\n}\nexports.V1ComponentCondition = V1ComponentCondition;\nV1ComponentCondition.discriminator = undefined;\nV1ComponentCondition.attributeTypeMap = [\n {\n \"name\": \"error\",\n \"baseName\": \"error\",\n \"type\": \"string\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ComponentCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ComponentStatus = void 0;\n/**\n* ComponentStatus (and ComponentStatusList) holds the cluster validation info. Deprecated: This API is deprecated in v1.19+\n*/\nclass V1ComponentStatus {\n static getAttributeTypeMap() {\n return V1ComponentStatus.attributeTypeMap;\n }\n}\nexports.V1ComponentStatus = V1ComponentStatus;\nV1ComponentStatus.discriminator = undefined;\nV1ComponentStatus.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n }\n];\n//# sourceMappingURL=v1ComponentStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ComponentStatusList = void 0;\n/**\n* Status of all the conditions for the component as a list of ComponentStatus objects. Deprecated: This API is deprecated in v1.19+\n*/\nclass V1ComponentStatusList {\n static getAttributeTypeMap() {\n return V1ComponentStatusList.attributeTypeMap;\n }\n}\nexports.V1ComponentStatusList = V1ComponentStatusList;\nV1ComponentStatusList.discriminator = undefined;\nV1ComponentStatusList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ComponentStatusList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Condition = void 0;\n/**\n* Condition contains details for one aspect of the current state of this API Resource.\n*/\nclass V1Condition {\n static getAttributeTypeMap() {\n return V1Condition.attributeTypeMap;\n }\n}\nexports.V1Condition = V1Condition;\nV1Condition.discriminator = undefined;\nV1Condition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Condition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ConfigMap = void 0;\n/**\n* ConfigMap holds configuration data for pods to consume.\n*/\nclass V1ConfigMap {\n static getAttributeTypeMap() {\n return V1ConfigMap.attributeTypeMap;\n }\n}\nexports.V1ConfigMap = V1ConfigMap;\nV1ConfigMap.discriminator = undefined;\nV1ConfigMap.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"binaryData\",\n \"baseName\": \"binaryData\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"data\",\n \"baseName\": \"data\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"immutable\",\n \"baseName\": \"immutable\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n }\n];\n//# sourceMappingURL=v1ConfigMap.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ConfigMapEnvSource = void 0;\n/**\n* ConfigMapEnvSource selects a ConfigMap to populate the environment variables with. The contents of the target ConfigMap\\'s Data field will represent the key-value pairs as environment variables.\n*/\nclass V1ConfigMapEnvSource {\n static getAttributeTypeMap() {\n return V1ConfigMapEnvSource.attributeTypeMap;\n }\n}\nexports.V1ConfigMapEnvSource = V1ConfigMapEnvSource;\nV1ConfigMapEnvSource.discriminator = undefined;\nV1ConfigMapEnvSource.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1ConfigMapEnvSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ConfigMapKeySelector = void 0;\n/**\n* Selects a key from a ConfigMap.\n*/\nclass V1ConfigMapKeySelector {\n static getAttributeTypeMap() {\n return V1ConfigMapKeySelector.attributeTypeMap;\n }\n}\nexports.V1ConfigMapKeySelector = V1ConfigMapKeySelector;\nV1ConfigMapKeySelector.discriminator = undefined;\nV1ConfigMapKeySelector.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1ConfigMapKeySelector.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ConfigMapList = void 0;\n/**\n* ConfigMapList is a resource containing a list of ConfigMap objects.\n*/\nclass V1ConfigMapList {\n static getAttributeTypeMap() {\n return V1ConfigMapList.attributeTypeMap;\n }\n}\nexports.V1ConfigMapList = V1ConfigMapList;\nV1ConfigMapList.discriminator = undefined;\nV1ConfigMapList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ConfigMapList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ConfigMapNodeConfigSource = void 0;\n/**\n* ConfigMapNodeConfigSource contains the information to reference a ConfigMap as a config source for the Node. This API is deprecated since 1.22: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration\n*/\nclass V1ConfigMapNodeConfigSource {\n static getAttributeTypeMap() {\n return V1ConfigMapNodeConfigSource.attributeTypeMap;\n }\n}\nexports.V1ConfigMapNodeConfigSource = V1ConfigMapNodeConfigSource;\nV1ConfigMapNodeConfigSource.discriminator = undefined;\nV1ConfigMapNodeConfigSource.attributeTypeMap = [\n {\n \"name\": \"kubeletConfigKey\",\n \"baseName\": \"kubeletConfigKey\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ConfigMapNodeConfigSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ConfigMapProjection = void 0;\n/**\n* Adapts a ConfigMap into a projected volume. The contents of the target ConfigMap\\'s Data field will be presented in a projected volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. Note that this is identical to a configmap volume source without the default mode.\n*/\nclass V1ConfigMapProjection {\n static getAttributeTypeMap() {\n return V1ConfigMapProjection.attributeTypeMap;\n }\n}\nexports.V1ConfigMapProjection = V1ConfigMapProjection;\nV1ConfigMapProjection.discriminator = undefined;\nV1ConfigMapProjection.attributeTypeMap = [\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1ConfigMapProjection.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ConfigMapVolumeSource = void 0;\n/**\n* Adapts a ConfigMap into a volume. The contents of the target ConfigMap\\'s Data field will be presented in a volume as files using the keys in the Data field as the file names, unless the items element is populated with specific mappings of keys to paths. ConfigMap volumes support ownership management and SELinux relabeling.\n*/\nclass V1ConfigMapVolumeSource {\n static getAttributeTypeMap() {\n return V1ConfigMapVolumeSource.attributeTypeMap;\n }\n}\nexports.V1ConfigMapVolumeSource = V1ConfigMapVolumeSource;\nV1ConfigMapVolumeSource.discriminator = undefined;\nV1ConfigMapVolumeSource.attributeTypeMap = [\n {\n \"name\": \"defaultMode\",\n \"baseName\": \"defaultMode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1ConfigMapVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Container = void 0;\n/**\n* A single application container that you want to run within a pod.\n*/\nclass V1Container {\n static getAttributeTypeMap() {\n return V1Container.attributeTypeMap;\n }\n}\nexports.V1Container = V1Container;\nV1Container.discriminator = undefined;\nV1Container.attributeTypeMap = [\n {\n \"name\": \"args\",\n \"baseName\": \"args\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"command\",\n \"baseName\": \"command\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"env\",\n \"baseName\": \"env\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"envFrom\",\n \"baseName\": \"envFrom\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"imagePullPolicy\",\n \"baseName\": \"imagePullPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lifecycle\",\n \"baseName\": \"lifecycle\",\n \"type\": \"V1Lifecycle\"\n },\n {\n \"name\": \"livenessProbe\",\n \"baseName\": \"livenessProbe\",\n \"type\": \"V1Probe\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"readinessProbe\",\n \"baseName\": \"readinessProbe\",\n \"type\": \"V1Probe\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"V1ResourceRequirements\"\n },\n {\n \"name\": \"securityContext\",\n \"baseName\": \"securityContext\",\n \"type\": \"V1SecurityContext\"\n },\n {\n \"name\": \"startupProbe\",\n \"baseName\": \"startupProbe\",\n \"type\": \"V1Probe\"\n },\n {\n \"name\": \"stdin\",\n \"baseName\": \"stdin\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"stdinOnce\",\n \"baseName\": \"stdinOnce\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"terminationMessagePath\",\n \"baseName\": \"terminationMessagePath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"terminationMessagePolicy\",\n \"baseName\": \"terminationMessagePolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"tty\",\n \"baseName\": \"tty\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeDevices\",\n \"baseName\": \"volumeDevices\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumeMounts\",\n \"baseName\": \"volumeMounts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"workingDir\",\n \"baseName\": \"workingDir\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Container.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ContainerImage = void 0;\n/**\n* Describe a container image\n*/\nclass V1ContainerImage {\n static getAttributeTypeMap() {\n return V1ContainerImage.attributeTypeMap;\n }\n}\nexports.V1ContainerImage = V1ContainerImage;\nV1ContainerImage.discriminator = undefined;\nV1ContainerImage.attributeTypeMap = [\n {\n \"name\": \"names\",\n \"baseName\": \"names\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"sizeBytes\",\n \"baseName\": \"sizeBytes\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1ContainerImage.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ContainerPort = void 0;\n/**\n* ContainerPort represents a network port in a single container.\n*/\nclass V1ContainerPort {\n static getAttributeTypeMap() {\n return V1ContainerPort.attributeTypeMap;\n }\n}\nexports.V1ContainerPort = V1ContainerPort;\nV1ContainerPort.discriminator = undefined;\nV1ContainerPort.attributeTypeMap = [\n {\n \"name\": \"containerPort\",\n \"baseName\": \"containerPort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"hostIP\",\n \"baseName\": \"hostIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"hostPort\",\n \"baseName\": \"hostPort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ContainerPort.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ContainerState = void 0;\n/**\n* ContainerState holds a possible state of container. Only one of its members may be specified. If none of them is specified, the default one is ContainerStateWaiting.\n*/\nclass V1ContainerState {\n static getAttributeTypeMap() {\n return V1ContainerState.attributeTypeMap;\n }\n}\nexports.V1ContainerState = V1ContainerState;\nV1ContainerState.discriminator = undefined;\nV1ContainerState.attributeTypeMap = [\n {\n \"name\": \"running\",\n \"baseName\": \"running\",\n \"type\": \"V1ContainerStateRunning\"\n },\n {\n \"name\": \"terminated\",\n \"baseName\": \"terminated\",\n \"type\": \"V1ContainerStateTerminated\"\n },\n {\n \"name\": \"waiting\",\n \"baseName\": \"waiting\",\n \"type\": \"V1ContainerStateWaiting\"\n }\n];\n//# sourceMappingURL=v1ContainerState.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ContainerStateRunning = void 0;\n/**\n* ContainerStateRunning is a running state of a container.\n*/\nclass V1ContainerStateRunning {\n static getAttributeTypeMap() {\n return V1ContainerStateRunning.attributeTypeMap;\n }\n}\nexports.V1ContainerStateRunning = V1ContainerStateRunning;\nV1ContainerStateRunning.discriminator = undefined;\nV1ContainerStateRunning.attributeTypeMap = [\n {\n \"name\": \"startedAt\",\n \"baseName\": \"startedAt\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1ContainerStateRunning.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ContainerStateTerminated = void 0;\n/**\n* ContainerStateTerminated is a terminated state of a container.\n*/\nclass V1ContainerStateTerminated {\n static getAttributeTypeMap() {\n return V1ContainerStateTerminated.attributeTypeMap;\n }\n}\nexports.V1ContainerStateTerminated = V1ContainerStateTerminated;\nV1ContainerStateTerminated.discriminator = undefined;\nV1ContainerStateTerminated.attributeTypeMap = [\n {\n \"name\": \"containerID\",\n \"baseName\": \"containerID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"exitCode\",\n \"baseName\": \"exitCode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"finishedAt\",\n \"baseName\": \"finishedAt\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"signal\",\n \"baseName\": \"signal\",\n \"type\": \"number\"\n },\n {\n \"name\": \"startedAt\",\n \"baseName\": \"startedAt\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1ContainerStateTerminated.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ContainerStateWaiting = void 0;\n/**\n* ContainerStateWaiting is a waiting state of a container.\n*/\nclass V1ContainerStateWaiting {\n static getAttributeTypeMap() {\n return V1ContainerStateWaiting.attributeTypeMap;\n }\n}\nexports.V1ContainerStateWaiting = V1ContainerStateWaiting;\nV1ContainerStateWaiting.discriminator = undefined;\nV1ContainerStateWaiting.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ContainerStateWaiting.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ContainerStatus = void 0;\n/**\n* ContainerStatus contains details for the current status of this container.\n*/\nclass V1ContainerStatus {\n static getAttributeTypeMap() {\n return V1ContainerStatus.attributeTypeMap;\n }\n}\nexports.V1ContainerStatus = V1ContainerStatus;\nV1ContainerStatus.discriminator = undefined;\nV1ContainerStatus.attributeTypeMap = [\n {\n \"name\": \"containerID\",\n \"baseName\": \"containerID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"imageID\",\n \"baseName\": \"imageID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lastState\",\n \"baseName\": \"lastState\",\n \"type\": \"V1ContainerState\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ready\",\n \"baseName\": \"ready\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"restartCount\",\n \"baseName\": \"restartCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"started\",\n \"baseName\": \"started\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"state\",\n \"baseName\": \"state\",\n \"type\": \"V1ContainerState\"\n }\n];\n//# sourceMappingURL=v1ContainerStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ControllerRevision = void 0;\n/**\n* ControllerRevision implements an immutable snapshot of state data. Clients are responsible for serializing and deserializing the objects that contain their internal state. Once a ControllerRevision has been successfully created, it can not be updated. The API Server will fail validation of all requests that attempt to mutate the Data field. ControllerRevisions may, however, be deleted. Note that, due to its use by both the DaemonSet and StatefulSet controllers for update and rollback, this object is beta. However, it may be subject to name and representation changes in future releases, and clients should not depend on its stability. It is primarily for internal use by controllers.\n*/\nclass V1ControllerRevision {\n static getAttributeTypeMap() {\n return V1ControllerRevision.attributeTypeMap;\n }\n}\nexports.V1ControllerRevision = V1ControllerRevision;\nV1ControllerRevision.discriminator = undefined;\nV1ControllerRevision.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"data\",\n \"baseName\": \"data\",\n \"type\": \"object\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"revision\",\n \"baseName\": \"revision\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1ControllerRevision.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ControllerRevisionList = void 0;\n/**\n* ControllerRevisionList is a resource containing a list of ControllerRevision objects.\n*/\nclass V1ControllerRevisionList {\n static getAttributeTypeMap() {\n return V1ControllerRevisionList.attributeTypeMap;\n }\n}\nexports.V1ControllerRevisionList = V1ControllerRevisionList;\nV1ControllerRevisionList.discriminator = undefined;\nV1ControllerRevisionList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ControllerRevisionList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CronJob = void 0;\n/**\n* CronJob represents the configuration of a single cron job.\n*/\nclass V1CronJob {\n static getAttributeTypeMap() {\n return V1CronJob.attributeTypeMap;\n }\n}\nexports.V1CronJob = V1CronJob;\nV1CronJob.discriminator = undefined;\nV1CronJob.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1CronJobSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1CronJobStatus\"\n }\n];\n//# sourceMappingURL=v1CronJob.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CronJobList = void 0;\n/**\n* CronJobList is a collection of cron jobs.\n*/\nclass V1CronJobList {\n static getAttributeTypeMap() {\n return V1CronJobList.attributeTypeMap;\n }\n}\nexports.V1CronJobList = V1CronJobList;\nV1CronJobList.discriminator = undefined;\nV1CronJobList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1CronJobList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CronJobSpec = void 0;\n/**\n* CronJobSpec describes how the job execution will look like and when it will actually run.\n*/\nclass V1CronJobSpec {\n static getAttributeTypeMap() {\n return V1CronJobSpec.attributeTypeMap;\n }\n}\nexports.V1CronJobSpec = V1CronJobSpec;\nV1CronJobSpec.discriminator = undefined;\nV1CronJobSpec.attributeTypeMap = [\n {\n \"name\": \"concurrencyPolicy\",\n \"baseName\": \"concurrencyPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"failedJobsHistoryLimit\",\n \"baseName\": \"failedJobsHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"jobTemplate\",\n \"baseName\": \"jobTemplate\",\n \"type\": \"V1JobTemplateSpec\"\n },\n {\n \"name\": \"schedule\",\n \"baseName\": \"schedule\",\n \"type\": \"string\"\n },\n {\n \"name\": \"startingDeadlineSeconds\",\n \"baseName\": \"startingDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"successfulJobsHistoryLimit\",\n \"baseName\": \"successfulJobsHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"suspend\",\n \"baseName\": \"suspend\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1CronJobSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CronJobStatus = void 0;\n/**\n* CronJobStatus represents the current state of a cron job.\n*/\nclass V1CronJobStatus {\n static getAttributeTypeMap() {\n return V1CronJobStatus.attributeTypeMap;\n }\n}\nexports.V1CronJobStatus = V1CronJobStatus;\nV1CronJobStatus.discriminator = undefined;\nV1CronJobStatus.attributeTypeMap = [\n {\n \"name\": \"active\",\n \"baseName\": \"active\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"lastScheduleTime\",\n \"baseName\": \"lastScheduleTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastSuccessfulTime\",\n \"baseName\": \"lastSuccessfulTime\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1CronJobStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CrossVersionObjectReference = void 0;\n/**\n* CrossVersionObjectReference contains enough information to let you identify the referred resource.\n*/\nclass V1CrossVersionObjectReference {\n static getAttributeTypeMap() {\n return V1CrossVersionObjectReference.attributeTypeMap;\n }\n}\nexports.V1CrossVersionObjectReference = V1CrossVersionObjectReference;\nV1CrossVersionObjectReference.discriminator = undefined;\nV1CrossVersionObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CrossVersionObjectReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceColumnDefinition = void 0;\n/**\n* CustomResourceColumnDefinition specifies a column for server side printing.\n*/\nclass V1CustomResourceColumnDefinition {\n static getAttributeTypeMap() {\n return V1CustomResourceColumnDefinition.attributeTypeMap;\n }\n}\nexports.V1CustomResourceColumnDefinition = V1CustomResourceColumnDefinition;\nV1CustomResourceColumnDefinition.discriminator = undefined;\nV1CustomResourceColumnDefinition.attributeTypeMap = [\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"format\",\n \"baseName\": \"format\",\n \"type\": \"string\"\n },\n {\n \"name\": \"jsonPath\",\n \"baseName\": \"jsonPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"priority\",\n \"baseName\": \"priority\",\n \"type\": \"number\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CustomResourceColumnDefinition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceConversion = void 0;\n/**\n* CustomResourceConversion describes how to convert different versions of a CR.\n*/\nclass V1CustomResourceConversion {\n static getAttributeTypeMap() {\n return V1CustomResourceConversion.attributeTypeMap;\n }\n}\nexports.V1CustomResourceConversion = V1CustomResourceConversion;\nV1CustomResourceConversion.discriminator = undefined;\nV1CustomResourceConversion.attributeTypeMap = [\n {\n \"name\": \"strategy\",\n \"baseName\": \"strategy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"webhook\",\n \"baseName\": \"webhook\",\n \"type\": \"V1WebhookConversion\"\n }\n];\n//# sourceMappingURL=v1CustomResourceConversion.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceDefinition = void 0;\n/**\n* CustomResourceDefinition represents a resource that should be exposed on the API server. Its name MUST be in the format <.spec.name>.<.spec.group>.\n*/\nclass V1CustomResourceDefinition {\n static getAttributeTypeMap() {\n return V1CustomResourceDefinition.attributeTypeMap;\n }\n}\nexports.V1CustomResourceDefinition = V1CustomResourceDefinition;\nV1CustomResourceDefinition.discriminator = undefined;\nV1CustomResourceDefinition.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1CustomResourceDefinitionSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1CustomResourceDefinitionStatus\"\n }\n];\n//# sourceMappingURL=v1CustomResourceDefinition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceDefinitionCondition = void 0;\n/**\n* CustomResourceDefinitionCondition contains details for the current condition of this pod.\n*/\nclass V1CustomResourceDefinitionCondition {\n static getAttributeTypeMap() {\n return V1CustomResourceDefinitionCondition.attributeTypeMap;\n }\n}\nexports.V1CustomResourceDefinitionCondition = V1CustomResourceDefinitionCondition;\nV1CustomResourceDefinitionCondition.discriminator = undefined;\nV1CustomResourceDefinitionCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CustomResourceDefinitionCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceDefinitionList = void 0;\n/**\n* CustomResourceDefinitionList is a list of CustomResourceDefinition objects.\n*/\nclass V1CustomResourceDefinitionList {\n static getAttributeTypeMap() {\n return V1CustomResourceDefinitionList.attributeTypeMap;\n }\n}\nexports.V1CustomResourceDefinitionList = V1CustomResourceDefinitionList;\nV1CustomResourceDefinitionList.discriminator = undefined;\nV1CustomResourceDefinitionList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1CustomResourceDefinitionList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceDefinitionNames = void 0;\n/**\n* CustomResourceDefinitionNames indicates the names to serve this CustomResourceDefinition\n*/\nclass V1CustomResourceDefinitionNames {\n static getAttributeTypeMap() {\n return V1CustomResourceDefinitionNames.attributeTypeMap;\n }\n}\nexports.V1CustomResourceDefinitionNames = V1CustomResourceDefinitionNames;\nV1CustomResourceDefinitionNames.discriminator = undefined;\nV1CustomResourceDefinitionNames.attributeTypeMap = [\n {\n \"name\": \"categories\",\n \"baseName\": \"categories\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"listKind\",\n \"baseName\": \"listKind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"plural\",\n \"baseName\": \"plural\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shortNames\",\n \"baseName\": \"shortNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"singular\",\n \"baseName\": \"singular\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CustomResourceDefinitionNames.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceDefinitionSpec = void 0;\n/**\n* CustomResourceDefinitionSpec describes how a user wants their resource to appear\n*/\nclass V1CustomResourceDefinitionSpec {\n static getAttributeTypeMap() {\n return V1CustomResourceDefinitionSpec.attributeTypeMap;\n }\n}\nexports.V1CustomResourceDefinitionSpec = V1CustomResourceDefinitionSpec;\nV1CustomResourceDefinitionSpec.discriminator = undefined;\nV1CustomResourceDefinitionSpec.attributeTypeMap = [\n {\n \"name\": \"conversion\",\n \"baseName\": \"conversion\",\n \"type\": \"V1CustomResourceConversion\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"names\",\n \"baseName\": \"names\",\n \"type\": \"V1CustomResourceDefinitionNames\"\n },\n {\n \"name\": \"preserveUnknownFields\",\n \"baseName\": \"preserveUnknownFields\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"scope\",\n \"baseName\": \"scope\",\n \"type\": \"string\"\n },\n {\n \"name\": \"versions\",\n \"baseName\": \"versions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1CustomResourceDefinitionSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceDefinitionStatus = void 0;\n/**\n* CustomResourceDefinitionStatus indicates the state of the CustomResourceDefinition\n*/\nclass V1CustomResourceDefinitionStatus {\n static getAttributeTypeMap() {\n return V1CustomResourceDefinitionStatus.attributeTypeMap;\n }\n}\nexports.V1CustomResourceDefinitionStatus = V1CustomResourceDefinitionStatus;\nV1CustomResourceDefinitionStatus.discriminator = undefined;\nV1CustomResourceDefinitionStatus.attributeTypeMap = [\n {\n \"name\": \"acceptedNames\",\n \"baseName\": \"acceptedNames\",\n \"type\": \"V1CustomResourceDefinitionNames\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"storedVersions\",\n \"baseName\": \"storedVersions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1CustomResourceDefinitionStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceDefinitionVersion = void 0;\n/**\n* CustomResourceDefinitionVersion describes a version for CRD.\n*/\nclass V1CustomResourceDefinitionVersion {\n static getAttributeTypeMap() {\n return V1CustomResourceDefinitionVersion.attributeTypeMap;\n }\n}\nexports.V1CustomResourceDefinitionVersion = V1CustomResourceDefinitionVersion;\nV1CustomResourceDefinitionVersion.discriminator = undefined;\nV1CustomResourceDefinitionVersion.attributeTypeMap = [\n {\n \"name\": \"additionalPrinterColumns\",\n \"baseName\": \"additionalPrinterColumns\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"deprecated\",\n \"baseName\": \"deprecated\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"deprecationWarning\",\n \"baseName\": \"deprecationWarning\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"schema\",\n \"baseName\": \"schema\",\n \"type\": \"V1CustomResourceValidation\"\n },\n {\n \"name\": \"served\",\n \"baseName\": \"served\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"storage\",\n \"baseName\": \"storage\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"subresources\",\n \"baseName\": \"subresources\",\n \"type\": \"V1CustomResourceSubresources\"\n }\n];\n//# sourceMappingURL=v1CustomResourceDefinitionVersion.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceSubresourceScale = void 0;\n/**\n* CustomResourceSubresourceScale defines how to serve the scale subresource for CustomResources.\n*/\nclass V1CustomResourceSubresourceScale {\n static getAttributeTypeMap() {\n return V1CustomResourceSubresourceScale.attributeTypeMap;\n }\n}\nexports.V1CustomResourceSubresourceScale = V1CustomResourceSubresourceScale;\nV1CustomResourceSubresourceScale.discriminator = undefined;\nV1CustomResourceSubresourceScale.attributeTypeMap = [\n {\n \"name\": \"labelSelectorPath\",\n \"baseName\": \"labelSelectorPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"specReplicasPath\",\n \"baseName\": \"specReplicasPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"statusReplicasPath\",\n \"baseName\": \"statusReplicasPath\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1CustomResourceSubresourceScale.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceSubresources = void 0;\n/**\n* CustomResourceSubresources defines the status and scale subresources for CustomResources.\n*/\nclass V1CustomResourceSubresources {\n static getAttributeTypeMap() {\n return V1CustomResourceSubresources.attributeTypeMap;\n }\n}\nexports.V1CustomResourceSubresources = V1CustomResourceSubresources;\nV1CustomResourceSubresources.discriminator = undefined;\nV1CustomResourceSubresources.attributeTypeMap = [\n {\n \"name\": \"scale\",\n \"baseName\": \"scale\",\n \"type\": \"V1CustomResourceSubresourceScale\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"object\"\n }\n];\n//# sourceMappingURL=v1CustomResourceSubresources.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1CustomResourceValidation = void 0;\n/**\n* CustomResourceValidation is a list of validation methods for CustomResources.\n*/\nclass V1CustomResourceValidation {\n static getAttributeTypeMap() {\n return V1CustomResourceValidation.attributeTypeMap;\n }\n}\nexports.V1CustomResourceValidation = V1CustomResourceValidation;\nV1CustomResourceValidation.discriminator = undefined;\nV1CustomResourceValidation.attributeTypeMap = [\n {\n \"name\": \"openAPIV3Schema\",\n \"baseName\": \"openAPIV3Schema\",\n \"type\": \"V1JSONSchemaProps\"\n }\n];\n//# sourceMappingURL=v1CustomResourceValidation.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DaemonEndpoint = void 0;\n/**\n* DaemonEndpoint contains information about a single Daemon endpoint.\n*/\nclass V1DaemonEndpoint {\n static getAttributeTypeMap() {\n return V1DaemonEndpoint.attributeTypeMap;\n }\n}\nexports.V1DaemonEndpoint = V1DaemonEndpoint;\nV1DaemonEndpoint.discriminator = undefined;\nV1DaemonEndpoint.attributeTypeMap = [\n {\n \"name\": \"Port\",\n \"baseName\": \"Port\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1DaemonEndpoint.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DaemonSet = void 0;\n/**\n* DaemonSet represents the configuration of a daemon set.\n*/\nclass V1DaemonSet {\n static getAttributeTypeMap() {\n return V1DaemonSet.attributeTypeMap;\n }\n}\nexports.V1DaemonSet = V1DaemonSet;\nV1DaemonSet.discriminator = undefined;\nV1DaemonSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1DaemonSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1DaemonSetStatus\"\n }\n];\n//# sourceMappingURL=v1DaemonSet.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DaemonSetCondition = void 0;\n/**\n* DaemonSetCondition describes the state of a DaemonSet at a certain point.\n*/\nclass V1DaemonSetCondition {\n static getAttributeTypeMap() {\n return V1DaemonSetCondition.attributeTypeMap;\n }\n}\nexports.V1DaemonSetCondition = V1DaemonSetCondition;\nV1DaemonSetCondition.discriminator = undefined;\nV1DaemonSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1DaemonSetCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DaemonSetList = void 0;\n/**\n* DaemonSetList is a collection of daemon sets.\n*/\nclass V1DaemonSetList {\n static getAttributeTypeMap() {\n return V1DaemonSetList.attributeTypeMap;\n }\n}\nexports.V1DaemonSetList = V1DaemonSetList;\nV1DaemonSetList.discriminator = undefined;\nV1DaemonSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1DaemonSetList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DaemonSetSpec = void 0;\n/**\n* DaemonSetSpec is the specification of a daemon set.\n*/\nclass V1DaemonSetSpec {\n static getAttributeTypeMap() {\n return V1DaemonSetSpec.attributeTypeMap;\n }\n}\nexports.V1DaemonSetSpec = V1DaemonSetSpec;\nV1DaemonSetSpec.discriminator = undefined;\nV1DaemonSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"updateStrategy\",\n \"baseName\": \"updateStrategy\",\n \"type\": \"V1DaemonSetUpdateStrategy\"\n }\n];\n//# sourceMappingURL=v1DaemonSetSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DaemonSetStatus = void 0;\n/**\n* DaemonSetStatus represents the current status of a daemon set.\n*/\nclass V1DaemonSetStatus {\n static getAttributeTypeMap() {\n return V1DaemonSetStatus.attributeTypeMap;\n }\n}\nexports.V1DaemonSetStatus = V1DaemonSetStatus;\nV1DaemonSetStatus.discriminator = undefined;\nV1DaemonSetStatus.attributeTypeMap = [\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentNumberScheduled\",\n \"baseName\": \"currentNumberScheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredNumberScheduled\",\n \"baseName\": \"desiredNumberScheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberAvailable\",\n \"baseName\": \"numberAvailable\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberMisscheduled\",\n \"baseName\": \"numberMisscheduled\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberReady\",\n \"baseName\": \"numberReady\",\n \"type\": \"number\"\n },\n {\n \"name\": \"numberUnavailable\",\n \"baseName\": \"numberUnavailable\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedNumberScheduled\",\n \"baseName\": \"updatedNumberScheduled\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1DaemonSetStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DaemonSetUpdateStrategy = void 0;\n/**\n* DaemonSetUpdateStrategy is a struct used to control the update strategy for a DaemonSet.\n*/\nclass V1DaemonSetUpdateStrategy {\n static getAttributeTypeMap() {\n return V1DaemonSetUpdateStrategy.attributeTypeMap;\n }\n}\nexports.V1DaemonSetUpdateStrategy = V1DaemonSetUpdateStrategy;\nV1DaemonSetUpdateStrategy.discriminator = undefined;\nV1DaemonSetUpdateStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1RollingUpdateDaemonSet\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1DaemonSetUpdateStrategy.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DeleteOptions = void 0;\n/**\n* DeleteOptions may be provided when deleting an API object.\n*/\nclass V1DeleteOptions {\n static getAttributeTypeMap() {\n return V1DeleteOptions.attributeTypeMap;\n }\n}\nexports.V1DeleteOptions = V1DeleteOptions;\nV1DeleteOptions.discriminator = undefined;\nV1DeleteOptions.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"dryRun\",\n \"baseName\": \"dryRun\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"gracePeriodSeconds\",\n \"baseName\": \"gracePeriodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"orphanDependents\",\n \"baseName\": \"orphanDependents\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"preconditions\",\n \"baseName\": \"preconditions\",\n \"type\": \"V1Preconditions\"\n },\n {\n \"name\": \"propagationPolicy\",\n \"baseName\": \"propagationPolicy\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1DeleteOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Deployment = void 0;\n/**\n* Deployment enables declarative updates for Pods and ReplicaSets.\n*/\nclass V1Deployment {\n static getAttributeTypeMap() {\n return V1Deployment.attributeTypeMap;\n }\n}\nexports.V1Deployment = V1Deployment;\nV1Deployment.discriminator = undefined;\nV1Deployment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1DeploymentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1DeploymentStatus\"\n }\n];\n//# sourceMappingURL=v1Deployment.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DeploymentCondition = void 0;\n/**\n* DeploymentCondition describes the state of a deployment at a certain point.\n*/\nclass V1DeploymentCondition {\n static getAttributeTypeMap() {\n return V1DeploymentCondition.attributeTypeMap;\n }\n}\nexports.V1DeploymentCondition = V1DeploymentCondition;\nV1DeploymentCondition.discriminator = undefined;\nV1DeploymentCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastUpdateTime\",\n \"baseName\": \"lastUpdateTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1DeploymentCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DeploymentList = void 0;\n/**\n* DeploymentList is a list of Deployments.\n*/\nclass V1DeploymentList {\n static getAttributeTypeMap() {\n return V1DeploymentList.attributeTypeMap;\n }\n}\nexports.V1DeploymentList = V1DeploymentList;\nV1DeploymentList.discriminator = undefined;\nV1DeploymentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1DeploymentList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DeploymentSpec = void 0;\n/**\n* DeploymentSpec is the specification of the desired behavior of the Deployment.\n*/\nclass V1DeploymentSpec {\n static getAttributeTypeMap() {\n return V1DeploymentSpec.attributeTypeMap;\n }\n}\nexports.V1DeploymentSpec = V1DeploymentSpec;\nV1DeploymentSpec.discriminator = undefined;\nV1DeploymentSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"paused\",\n \"baseName\": \"paused\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"progressDeadlineSeconds\",\n \"baseName\": \"progressDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"strategy\",\n \"baseName\": \"strategy\",\n \"type\": \"V1DeploymentStrategy\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\n//# sourceMappingURL=v1DeploymentSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DeploymentStatus = void 0;\n/**\n* DeploymentStatus is the most recently observed status of the Deployment.\n*/\nclass V1DeploymentStatus {\n static getAttributeTypeMap() {\n return V1DeploymentStatus.attributeTypeMap;\n }\n}\nexports.V1DeploymentStatus = V1DeploymentStatus;\nV1DeploymentStatus.discriminator = undefined;\nV1DeploymentStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"unavailableReplicas\",\n \"baseName\": \"unavailableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1DeploymentStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DeploymentStrategy = void 0;\n/**\n* DeploymentStrategy describes how to replace existing pods with new ones.\n*/\nclass V1DeploymentStrategy {\n static getAttributeTypeMap() {\n return V1DeploymentStrategy.attributeTypeMap;\n }\n}\nexports.V1DeploymentStrategy = V1DeploymentStrategy;\nV1DeploymentStrategy.discriminator = undefined;\nV1DeploymentStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1RollingUpdateDeployment\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1DeploymentStrategy.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DownwardAPIProjection = void 0;\n/**\n* Represents downward API info for projecting into a projected volume. Note that this is identical to a downwardAPI volume source without the default mode.\n*/\nclass V1DownwardAPIProjection {\n static getAttributeTypeMap() {\n return V1DownwardAPIProjection.attributeTypeMap;\n }\n}\nexports.V1DownwardAPIProjection = V1DownwardAPIProjection;\nV1DownwardAPIProjection.discriminator = undefined;\nV1DownwardAPIProjection.attributeTypeMap = [\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1DownwardAPIProjection.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DownwardAPIVolumeFile = void 0;\n/**\n* DownwardAPIVolumeFile represents information to create the file containing the pod field\n*/\nclass V1DownwardAPIVolumeFile {\n static getAttributeTypeMap() {\n return V1DownwardAPIVolumeFile.attributeTypeMap;\n }\n}\nexports.V1DownwardAPIVolumeFile = V1DownwardAPIVolumeFile;\nV1DownwardAPIVolumeFile.discriminator = undefined;\nV1DownwardAPIVolumeFile.attributeTypeMap = [\n {\n \"name\": \"fieldRef\",\n \"baseName\": \"fieldRef\",\n \"type\": \"V1ObjectFieldSelector\"\n },\n {\n \"name\": \"mode\",\n \"baseName\": \"mode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resourceFieldRef\",\n \"baseName\": \"resourceFieldRef\",\n \"type\": \"V1ResourceFieldSelector\"\n }\n];\n//# sourceMappingURL=v1DownwardAPIVolumeFile.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1DownwardAPIVolumeSource = void 0;\n/**\n* DownwardAPIVolumeSource represents a volume containing downward API info. Downward API volumes support ownership management and SELinux relabeling.\n*/\nclass V1DownwardAPIVolumeSource {\n static getAttributeTypeMap() {\n return V1DownwardAPIVolumeSource.attributeTypeMap;\n }\n}\nexports.V1DownwardAPIVolumeSource = V1DownwardAPIVolumeSource;\nV1DownwardAPIVolumeSource.discriminator = undefined;\nV1DownwardAPIVolumeSource.attributeTypeMap = [\n {\n \"name\": \"defaultMode\",\n \"baseName\": \"defaultMode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1DownwardAPIVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EmptyDirVolumeSource = void 0;\n/**\n* Represents an empty directory for a pod. Empty directory volumes support ownership management and SELinux relabeling.\n*/\nclass V1EmptyDirVolumeSource {\n static getAttributeTypeMap() {\n return V1EmptyDirVolumeSource.attributeTypeMap;\n }\n}\nexports.V1EmptyDirVolumeSource = V1EmptyDirVolumeSource;\nV1EmptyDirVolumeSource.discriminator = undefined;\nV1EmptyDirVolumeSource.attributeTypeMap = [\n {\n \"name\": \"medium\",\n \"baseName\": \"medium\",\n \"type\": \"string\"\n },\n {\n \"name\": \"sizeLimit\",\n \"baseName\": \"sizeLimit\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1EmptyDirVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Endpoint = void 0;\n/**\n* Endpoint represents a single logical \\\"backend\\\" implementing a service.\n*/\nclass V1Endpoint {\n static getAttributeTypeMap() {\n return V1Endpoint.attributeTypeMap;\n }\n}\nexports.V1Endpoint = V1Endpoint;\nV1Endpoint.discriminator = undefined;\nV1Endpoint.attributeTypeMap = [\n {\n \"name\": \"addresses\",\n \"baseName\": \"addresses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"V1EndpointConditions\"\n },\n {\n \"name\": \"deprecatedTopology\",\n \"baseName\": \"deprecatedTopology\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"hints\",\n \"baseName\": \"hints\",\n \"type\": \"V1EndpointHints\"\n },\n {\n \"name\": \"hostname\",\n \"baseName\": \"hostname\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetRef\",\n \"baseName\": \"targetRef\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"zone\",\n \"baseName\": \"zone\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Endpoint.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EndpointAddress = void 0;\n/**\n* EndpointAddress is a tuple that describes single IP address.\n*/\nclass V1EndpointAddress {\n static getAttributeTypeMap() {\n return V1EndpointAddress.attributeTypeMap;\n }\n}\nexports.V1EndpointAddress = V1EndpointAddress;\nV1EndpointAddress.discriminator = undefined;\nV1EndpointAddress.attributeTypeMap = [\n {\n \"name\": \"hostname\",\n \"baseName\": \"hostname\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ip\",\n \"baseName\": \"ip\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetRef\",\n \"baseName\": \"targetRef\",\n \"type\": \"V1ObjectReference\"\n }\n];\n//# sourceMappingURL=v1EndpointAddress.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EndpointConditions = void 0;\n/**\n* EndpointConditions represents the current condition of an endpoint.\n*/\nclass V1EndpointConditions {\n static getAttributeTypeMap() {\n return V1EndpointConditions.attributeTypeMap;\n }\n}\nexports.V1EndpointConditions = V1EndpointConditions;\nV1EndpointConditions.discriminator = undefined;\nV1EndpointConditions.attributeTypeMap = [\n {\n \"name\": \"ready\",\n \"baseName\": \"ready\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"serving\",\n \"baseName\": \"serving\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"terminating\",\n \"baseName\": \"terminating\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1EndpointConditions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EndpointHints = void 0;\n/**\n* EndpointHints provides hints describing how an endpoint should be consumed.\n*/\nclass V1EndpointHints {\n static getAttributeTypeMap() {\n return V1EndpointHints.attributeTypeMap;\n }\n}\nexports.V1EndpointHints = V1EndpointHints;\nV1EndpointHints.discriminator = undefined;\nV1EndpointHints.attributeTypeMap = [\n {\n \"name\": \"forZones\",\n \"baseName\": \"forZones\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1EndpointHints.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EndpointSlice = void 0;\n/**\n* EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.\n*/\nclass V1EndpointSlice {\n static getAttributeTypeMap() {\n return V1EndpointSlice.attributeTypeMap;\n }\n}\nexports.V1EndpointSlice = V1EndpointSlice;\nV1EndpointSlice.discriminator = undefined;\nV1EndpointSlice.attributeTypeMap = [\n {\n \"name\": \"addressType\",\n \"baseName\": \"addressType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"endpoints\",\n \"baseName\": \"endpoints\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1EndpointSlice.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EndpointSliceList = void 0;\n/**\n* EndpointSliceList represents a list of endpoint slices\n*/\nclass V1EndpointSliceList {\n static getAttributeTypeMap() {\n return V1EndpointSliceList.attributeTypeMap;\n }\n}\nexports.V1EndpointSliceList = V1EndpointSliceList;\nV1EndpointSliceList.discriminator = undefined;\nV1EndpointSliceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1EndpointSliceList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EndpointSubset = void 0;\n/**\n* EndpointSubset is a group of addresses with a common set of ports. The expanded set of endpoints is the Cartesian product of Addresses x Ports. For example, given: { Addresses: [{\\\"ip\\\": \\\"10.10.1.1\\\"}, {\\\"ip\\\": \\\"10.10.2.2\\\"}], Ports: [{\\\"name\\\": \\\"a\\\", \\\"port\\\": 8675}, {\\\"name\\\": \\\"b\\\", \\\"port\\\": 309}] } The resulting set of endpoints can be viewed as: a: [ 10.10.1.1:8675, 10.10.2.2:8675 ], b: [ 10.10.1.1:309, 10.10.2.2:309 ]\n*/\nclass V1EndpointSubset {\n static getAttributeTypeMap() {\n return V1EndpointSubset.attributeTypeMap;\n }\n}\nexports.V1EndpointSubset = V1EndpointSubset;\nV1EndpointSubset.discriminator = undefined;\nV1EndpointSubset.attributeTypeMap = [\n {\n \"name\": \"addresses\",\n \"baseName\": \"addresses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"notReadyAddresses\",\n \"baseName\": \"notReadyAddresses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1EndpointSubset.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Endpoints = void 0;\n/**\n* Endpoints is a collection of endpoints that implement the actual service. Example: Name: \\\"mysvc\\\", Subsets: [ { Addresses: [{\\\"ip\\\": \\\"10.10.1.1\\\"}, {\\\"ip\\\": \\\"10.10.2.2\\\"}], Ports: [{\\\"name\\\": \\\"a\\\", \\\"port\\\": 8675}, {\\\"name\\\": \\\"b\\\", \\\"port\\\": 309}] }, { Addresses: [{\\\"ip\\\": \\\"10.10.3.3\\\"}], Ports: [{\\\"name\\\": \\\"a\\\", \\\"port\\\": 93}, {\\\"name\\\": \\\"b\\\", \\\"port\\\": 76}] }, ]\n*/\nclass V1Endpoints {\n static getAttributeTypeMap() {\n return V1Endpoints.attributeTypeMap;\n }\n}\nexports.V1Endpoints = V1Endpoints;\nV1Endpoints.discriminator = undefined;\nV1Endpoints.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"subsets\",\n \"baseName\": \"subsets\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1Endpoints.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EndpointsList = void 0;\n/**\n* EndpointsList is a list of endpoints.\n*/\nclass V1EndpointsList {\n static getAttributeTypeMap() {\n return V1EndpointsList.attributeTypeMap;\n }\n}\nexports.V1EndpointsList = V1EndpointsList;\nV1EndpointsList.discriminator = undefined;\nV1EndpointsList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1EndpointsList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EnvFromSource = void 0;\n/**\n* EnvFromSource represents the source of a set of ConfigMaps\n*/\nclass V1EnvFromSource {\n static getAttributeTypeMap() {\n return V1EnvFromSource.attributeTypeMap;\n }\n}\nexports.V1EnvFromSource = V1EnvFromSource;\nV1EnvFromSource.discriminator = undefined;\nV1EnvFromSource.attributeTypeMap = [\n {\n \"name\": \"configMapRef\",\n \"baseName\": \"configMapRef\",\n \"type\": \"V1ConfigMapEnvSource\"\n },\n {\n \"name\": \"prefix\",\n \"baseName\": \"prefix\",\n \"type\": \"string\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretEnvSource\"\n }\n];\n//# sourceMappingURL=v1EnvFromSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EnvVar = void 0;\n/**\n* EnvVar represents an environment variable present in a Container.\n*/\nclass V1EnvVar {\n static getAttributeTypeMap() {\n return V1EnvVar.attributeTypeMap;\n }\n}\nexports.V1EnvVar = V1EnvVar;\nV1EnvVar.discriminator = undefined;\nV1EnvVar.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n },\n {\n \"name\": \"valueFrom\",\n \"baseName\": \"valueFrom\",\n \"type\": \"V1EnvVarSource\"\n }\n];\n//# sourceMappingURL=v1EnvVar.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EnvVarSource = void 0;\n/**\n* EnvVarSource represents a source for the value of an EnvVar.\n*/\nclass V1EnvVarSource {\n static getAttributeTypeMap() {\n return V1EnvVarSource.attributeTypeMap;\n }\n}\nexports.V1EnvVarSource = V1EnvVarSource;\nV1EnvVarSource.discriminator = undefined;\nV1EnvVarSource.attributeTypeMap = [\n {\n \"name\": \"configMapKeyRef\",\n \"baseName\": \"configMapKeyRef\",\n \"type\": \"V1ConfigMapKeySelector\"\n },\n {\n \"name\": \"fieldRef\",\n \"baseName\": \"fieldRef\",\n \"type\": \"V1ObjectFieldSelector\"\n },\n {\n \"name\": \"resourceFieldRef\",\n \"baseName\": \"resourceFieldRef\",\n \"type\": \"V1ResourceFieldSelector\"\n },\n {\n \"name\": \"secretKeyRef\",\n \"baseName\": \"secretKeyRef\",\n \"type\": \"V1SecretKeySelector\"\n }\n];\n//# sourceMappingURL=v1EnvVarSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EphemeralContainer = void 0;\n/**\n* An EphemeralContainer is a container that may be added temporarily to an existing pod for user-initiated activities such as debugging. Ephemeral containers have no resource or scheduling guarantees, and they will not be restarted when they exit or when a pod is removed or restarted. If an ephemeral container causes a pod to exceed its resource allocation, the pod may be evicted. Ephemeral containers may not be added by directly updating the pod spec. They must be added via the pod\\'s ephemeralcontainers subresource, and they will appear in the pod spec once added. This is an alpha feature enabled by the EphemeralContainers feature flag.\n*/\nclass V1EphemeralContainer {\n static getAttributeTypeMap() {\n return V1EphemeralContainer.attributeTypeMap;\n }\n}\nexports.V1EphemeralContainer = V1EphemeralContainer;\nV1EphemeralContainer.discriminator = undefined;\nV1EphemeralContainer.attributeTypeMap = [\n {\n \"name\": \"args\",\n \"baseName\": \"args\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"command\",\n \"baseName\": \"command\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"env\",\n \"baseName\": \"env\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"envFrom\",\n \"baseName\": \"envFrom\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"imagePullPolicy\",\n \"baseName\": \"imagePullPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lifecycle\",\n \"baseName\": \"lifecycle\",\n \"type\": \"V1Lifecycle\"\n },\n {\n \"name\": \"livenessProbe\",\n \"baseName\": \"livenessProbe\",\n \"type\": \"V1Probe\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"readinessProbe\",\n \"baseName\": \"readinessProbe\",\n \"type\": \"V1Probe\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"V1ResourceRequirements\"\n },\n {\n \"name\": \"securityContext\",\n \"baseName\": \"securityContext\",\n \"type\": \"V1SecurityContext\"\n },\n {\n \"name\": \"startupProbe\",\n \"baseName\": \"startupProbe\",\n \"type\": \"V1Probe\"\n },\n {\n \"name\": \"stdin\",\n \"baseName\": \"stdin\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"stdinOnce\",\n \"baseName\": \"stdinOnce\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"targetContainerName\",\n \"baseName\": \"targetContainerName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"terminationMessagePath\",\n \"baseName\": \"terminationMessagePath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"terminationMessagePolicy\",\n \"baseName\": \"terminationMessagePolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"tty\",\n \"baseName\": \"tty\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeDevices\",\n \"baseName\": \"volumeDevices\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumeMounts\",\n \"baseName\": \"volumeMounts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"workingDir\",\n \"baseName\": \"workingDir\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1EphemeralContainer.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EphemeralVolumeSource = void 0;\n/**\n* Represents an ephemeral volume that is handled by a normal storage driver.\n*/\nclass V1EphemeralVolumeSource {\n static getAttributeTypeMap() {\n return V1EphemeralVolumeSource.attributeTypeMap;\n }\n}\nexports.V1EphemeralVolumeSource = V1EphemeralVolumeSource;\nV1EphemeralVolumeSource.discriminator = undefined;\nV1EphemeralVolumeSource.attributeTypeMap = [\n {\n \"name\": \"volumeClaimTemplate\",\n \"baseName\": \"volumeClaimTemplate\",\n \"type\": \"V1PersistentVolumeClaimTemplate\"\n }\n];\n//# sourceMappingURL=v1EphemeralVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1EventSource = void 0;\n/**\n* EventSource contains information for an event.\n*/\nclass V1EventSource {\n static getAttributeTypeMap() {\n return V1EventSource.attributeTypeMap;\n }\n}\nexports.V1EventSource = V1EventSource;\nV1EventSource.discriminator = undefined;\nV1EventSource.attributeTypeMap = [\n {\n \"name\": \"component\",\n \"baseName\": \"component\",\n \"type\": \"string\"\n },\n {\n \"name\": \"host\",\n \"baseName\": \"host\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1EventSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Eviction = void 0;\n/**\n* Eviction evicts a pod from its node subject to certain policies and safety constraints. This is a subresource of Pod. A request to cause such an eviction is created by POSTing to .../pods//evictions.\n*/\nclass V1Eviction {\n static getAttributeTypeMap() {\n return V1Eviction.attributeTypeMap;\n }\n}\nexports.V1Eviction = V1Eviction;\nV1Eviction.discriminator = undefined;\nV1Eviction.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"deleteOptions\",\n \"baseName\": \"deleteOptions\",\n \"type\": \"V1DeleteOptions\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n }\n];\n//# sourceMappingURL=v1Eviction.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ExecAction = void 0;\n/**\n* ExecAction describes a \\\"run in container\\\" action.\n*/\nclass V1ExecAction {\n static getAttributeTypeMap() {\n return V1ExecAction.attributeTypeMap;\n }\n}\nexports.V1ExecAction = V1ExecAction;\nV1ExecAction.discriminator = undefined;\nV1ExecAction.attributeTypeMap = [\n {\n \"name\": \"command\",\n \"baseName\": \"command\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ExecAction.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ExternalDocumentation = void 0;\n/**\n* ExternalDocumentation allows referencing an external resource for extended documentation.\n*/\nclass V1ExternalDocumentation {\n static getAttributeTypeMap() {\n return V1ExternalDocumentation.attributeTypeMap;\n }\n}\nexports.V1ExternalDocumentation = V1ExternalDocumentation;\nV1ExternalDocumentation.discriminator = undefined;\nV1ExternalDocumentation.attributeTypeMap = [\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"url\",\n \"baseName\": \"url\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ExternalDocumentation.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1FCVolumeSource = void 0;\n/**\n* Represents a Fibre Channel volume. Fibre Channel volumes can only be mounted as read/write once. Fibre Channel volumes support ownership management and SELinux relabeling.\n*/\nclass V1FCVolumeSource {\n static getAttributeTypeMap() {\n return V1FCVolumeSource.attributeTypeMap;\n }\n}\nexports.V1FCVolumeSource = V1FCVolumeSource;\nV1FCVolumeSource.discriminator = undefined;\nV1FCVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lun\",\n \"baseName\": \"lun\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"targetWWNs\",\n \"baseName\": \"targetWWNs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"wwids\",\n \"baseName\": \"wwids\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1FCVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1FlexPersistentVolumeSource = void 0;\n/**\n* FlexPersistentVolumeSource represents a generic persistent volume resource that is provisioned/attached using an exec based plugin.\n*/\nclass V1FlexPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1FlexPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1FlexPersistentVolumeSource = V1FlexPersistentVolumeSource;\nV1FlexPersistentVolumeSource.discriminator = undefined;\nV1FlexPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"options\",\n \"baseName\": \"options\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n }\n];\n//# sourceMappingURL=v1FlexPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1FlexVolumeSource = void 0;\n/**\n* FlexVolume represents a generic volume resource that is provisioned/attached using an exec based plugin.\n*/\nclass V1FlexVolumeSource {\n static getAttributeTypeMap() {\n return V1FlexVolumeSource.attributeTypeMap;\n }\n}\nexports.V1FlexVolumeSource = V1FlexVolumeSource;\nV1FlexVolumeSource.discriminator = undefined;\nV1FlexVolumeSource.attributeTypeMap = [\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"options\",\n \"baseName\": \"options\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n }\n];\n//# sourceMappingURL=v1FlexVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1FlockerVolumeSource = void 0;\n/**\n* Represents a Flocker volume mounted by the Flocker agent. One and only one of datasetName and datasetUUID should be set. Flocker volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1FlockerVolumeSource {\n static getAttributeTypeMap() {\n return V1FlockerVolumeSource.attributeTypeMap;\n }\n}\nexports.V1FlockerVolumeSource = V1FlockerVolumeSource;\nV1FlockerVolumeSource.discriminator = undefined;\nV1FlockerVolumeSource.attributeTypeMap = [\n {\n \"name\": \"datasetName\",\n \"baseName\": \"datasetName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"datasetUUID\",\n \"baseName\": \"datasetUUID\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1FlockerVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ForZone = void 0;\n/**\n* ForZone provides information about which zones should consume this endpoint.\n*/\nclass V1ForZone {\n static getAttributeTypeMap() {\n return V1ForZone.attributeTypeMap;\n }\n}\nexports.V1ForZone = V1ForZone;\nV1ForZone.discriminator = undefined;\nV1ForZone.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ForZone.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1GCEPersistentDiskVolumeSource = void 0;\n/**\n* Represents a Persistent Disk resource in Google Compute Engine. A GCE PD must exist before mounting to a container. The disk must also be in the same GCE project and zone as the kubelet. A GCE PD can only be mounted as read/write once or read-only many times. GCE PDs support ownership management and SELinux relabeling.\n*/\nclass V1GCEPersistentDiskVolumeSource {\n static getAttributeTypeMap() {\n return V1GCEPersistentDiskVolumeSource.attributeTypeMap;\n }\n}\nexports.V1GCEPersistentDiskVolumeSource = V1GCEPersistentDiskVolumeSource;\nV1GCEPersistentDiskVolumeSource.discriminator = undefined;\nV1GCEPersistentDiskVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"partition\",\n \"baseName\": \"partition\",\n \"type\": \"number\"\n },\n {\n \"name\": \"pdName\",\n \"baseName\": \"pdName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1GCEPersistentDiskVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1GitRepoVolumeSource = void 0;\n/**\n* Represents a volume that is populated with the contents of a git repository. Git repo volumes do not support ownership management. Git repo volumes support SELinux relabeling. DEPRECATED: GitRepo is deprecated. To provision a container with a git repo, mount an EmptyDir into an InitContainer that clones the repo using git, then mount the EmptyDir into the Pod\\'s container.\n*/\nclass V1GitRepoVolumeSource {\n static getAttributeTypeMap() {\n return V1GitRepoVolumeSource.attributeTypeMap;\n }\n}\nexports.V1GitRepoVolumeSource = V1GitRepoVolumeSource;\nV1GitRepoVolumeSource.discriminator = undefined;\nV1GitRepoVolumeSource.attributeTypeMap = [\n {\n \"name\": \"directory\",\n \"baseName\": \"directory\",\n \"type\": \"string\"\n },\n {\n \"name\": \"repository\",\n \"baseName\": \"repository\",\n \"type\": \"string\"\n },\n {\n \"name\": \"revision\",\n \"baseName\": \"revision\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1GitRepoVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1GlusterfsPersistentVolumeSource = void 0;\n/**\n* Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1GlusterfsPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1GlusterfsPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1GlusterfsPersistentVolumeSource = V1GlusterfsPersistentVolumeSource;\nV1GlusterfsPersistentVolumeSource.discriminator = undefined;\nV1GlusterfsPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"endpoints\",\n \"baseName\": \"endpoints\",\n \"type\": \"string\"\n },\n {\n \"name\": \"endpointsNamespace\",\n \"baseName\": \"endpointsNamespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1GlusterfsPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1GlusterfsVolumeSource = void 0;\n/**\n* Represents a Glusterfs mount that lasts the lifetime of a pod. Glusterfs volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1GlusterfsVolumeSource {\n static getAttributeTypeMap() {\n return V1GlusterfsVolumeSource.attributeTypeMap;\n }\n}\nexports.V1GlusterfsVolumeSource = V1GlusterfsVolumeSource;\nV1GlusterfsVolumeSource.discriminator = undefined;\nV1GlusterfsVolumeSource.attributeTypeMap = [\n {\n \"name\": \"endpoints\",\n \"baseName\": \"endpoints\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1GlusterfsVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1GroupVersionForDiscovery = void 0;\n/**\n* GroupVersion contains the \\\"group/version\\\" and \\\"version\\\" string of a version. It is made a struct to keep extensibility.\n*/\nclass V1GroupVersionForDiscovery {\n static getAttributeTypeMap() {\n return V1GroupVersionForDiscovery.attributeTypeMap;\n }\n}\nexports.V1GroupVersionForDiscovery = V1GroupVersionForDiscovery;\nV1GroupVersionForDiscovery.discriminator = undefined;\nV1GroupVersionForDiscovery.attributeTypeMap = [\n {\n \"name\": \"groupVersion\",\n \"baseName\": \"groupVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1GroupVersionForDiscovery.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HTTPGetAction = void 0;\n/**\n* HTTPGetAction describes an action based on HTTP Get requests.\n*/\nclass V1HTTPGetAction {\n static getAttributeTypeMap() {\n return V1HTTPGetAction.attributeTypeMap;\n }\n}\nexports.V1HTTPGetAction = V1HTTPGetAction;\nV1HTTPGetAction.discriminator = undefined;\nV1HTTPGetAction.attributeTypeMap = [\n {\n \"name\": \"host\",\n \"baseName\": \"host\",\n \"type\": \"string\"\n },\n {\n \"name\": \"httpHeaders\",\n \"baseName\": \"httpHeaders\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"IntOrString\"\n },\n {\n \"name\": \"scheme\",\n \"baseName\": \"scheme\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1HTTPGetAction.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HTTPHeader = void 0;\n/**\n* HTTPHeader describes a custom header to be used in HTTP probes\n*/\nclass V1HTTPHeader {\n static getAttributeTypeMap() {\n return V1HTTPHeader.attributeTypeMap;\n }\n}\nexports.V1HTTPHeader = V1HTTPHeader;\nV1HTTPHeader.discriminator = undefined;\nV1HTTPHeader.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1HTTPHeader.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HTTPIngressPath = void 0;\n/**\n* HTTPIngressPath associates a path with a backend. Incoming urls matching the path are forwarded to the backend.\n*/\nclass V1HTTPIngressPath {\n static getAttributeTypeMap() {\n return V1HTTPIngressPath.attributeTypeMap;\n }\n}\nexports.V1HTTPIngressPath = V1HTTPIngressPath;\nV1HTTPIngressPath.discriminator = undefined;\nV1HTTPIngressPath.attributeTypeMap = [\n {\n \"name\": \"backend\",\n \"baseName\": \"backend\",\n \"type\": \"V1IngressBackend\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"pathType\",\n \"baseName\": \"pathType\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1HTTPIngressPath.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HTTPIngressRuleValue = void 0;\n/**\n* HTTPIngressRuleValue is a list of http selectors pointing to backends. In the example: http:///? -> backend where where parts of the url correspond to RFC 3986, this resource will be used to match against everything after the last \\'/\\' and before the first \\'?\\' or \\'#\\'.\n*/\nclass V1HTTPIngressRuleValue {\n static getAttributeTypeMap() {\n return V1HTTPIngressRuleValue.attributeTypeMap;\n }\n}\nexports.V1HTTPIngressRuleValue = V1HTTPIngressRuleValue;\nV1HTTPIngressRuleValue.discriminator = undefined;\nV1HTTPIngressRuleValue.attributeTypeMap = [\n {\n \"name\": \"paths\",\n \"baseName\": \"paths\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1HTTPIngressRuleValue.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Handler = void 0;\n/**\n* Handler defines a specific action that should be taken\n*/\nclass V1Handler {\n static getAttributeTypeMap() {\n return V1Handler.attributeTypeMap;\n }\n}\nexports.V1Handler = V1Handler;\nV1Handler.discriminator = undefined;\nV1Handler.attributeTypeMap = [\n {\n \"name\": \"exec\",\n \"baseName\": \"exec\",\n \"type\": \"V1ExecAction\"\n },\n {\n \"name\": \"httpGet\",\n \"baseName\": \"httpGet\",\n \"type\": \"V1HTTPGetAction\"\n },\n {\n \"name\": \"tcpSocket\",\n \"baseName\": \"tcpSocket\",\n \"type\": \"V1TCPSocketAction\"\n }\n];\n//# sourceMappingURL=v1Handler.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HorizontalPodAutoscaler = void 0;\n/**\n* configuration of a horizontal pod autoscaler.\n*/\nclass V1HorizontalPodAutoscaler {\n static getAttributeTypeMap() {\n return V1HorizontalPodAutoscaler.attributeTypeMap;\n }\n}\nexports.V1HorizontalPodAutoscaler = V1HorizontalPodAutoscaler;\nV1HorizontalPodAutoscaler.discriminator = undefined;\nV1HorizontalPodAutoscaler.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1HorizontalPodAutoscalerSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1HorizontalPodAutoscalerStatus\"\n }\n];\n//# sourceMappingURL=v1HorizontalPodAutoscaler.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HorizontalPodAutoscalerList = void 0;\n/**\n* list of horizontal pod autoscaler objects.\n*/\nclass V1HorizontalPodAutoscalerList {\n static getAttributeTypeMap() {\n return V1HorizontalPodAutoscalerList.attributeTypeMap;\n }\n}\nexports.V1HorizontalPodAutoscalerList = V1HorizontalPodAutoscalerList;\nV1HorizontalPodAutoscalerList.discriminator = undefined;\nV1HorizontalPodAutoscalerList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1HorizontalPodAutoscalerList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HorizontalPodAutoscalerSpec = void 0;\n/**\n* specification of a horizontal pod autoscaler.\n*/\nclass V1HorizontalPodAutoscalerSpec {\n static getAttributeTypeMap() {\n return V1HorizontalPodAutoscalerSpec.attributeTypeMap;\n }\n}\nexports.V1HorizontalPodAutoscalerSpec = V1HorizontalPodAutoscalerSpec;\nV1HorizontalPodAutoscalerSpec.discriminator = undefined;\nV1HorizontalPodAutoscalerSpec.attributeTypeMap = [\n {\n \"name\": \"maxReplicas\",\n \"baseName\": \"maxReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minReplicas\",\n \"baseName\": \"minReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"scaleTargetRef\",\n \"baseName\": \"scaleTargetRef\",\n \"type\": \"V1CrossVersionObjectReference\"\n },\n {\n \"name\": \"targetCPUUtilizationPercentage\",\n \"baseName\": \"targetCPUUtilizationPercentage\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1HorizontalPodAutoscalerSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HorizontalPodAutoscalerStatus = void 0;\n/**\n* current status of a horizontal pod autoscaler\n*/\nclass V1HorizontalPodAutoscalerStatus {\n static getAttributeTypeMap() {\n return V1HorizontalPodAutoscalerStatus.attributeTypeMap;\n }\n}\nexports.V1HorizontalPodAutoscalerStatus = V1HorizontalPodAutoscalerStatus;\nV1HorizontalPodAutoscalerStatus.discriminator = undefined;\nV1HorizontalPodAutoscalerStatus.attributeTypeMap = [\n {\n \"name\": \"currentCPUUtilizationPercentage\",\n \"baseName\": \"currentCPUUtilizationPercentage\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredReplicas\",\n \"baseName\": \"desiredReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastScaleTime\",\n \"baseName\": \"lastScaleTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1HorizontalPodAutoscalerStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HostAlias = void 0;\n/**\n* HostAlias holds the mapping between IP and hostnames that will be injected as an entry in the pod\\'s hosts file.\n*/\nclass V1HostAlias {\n static getAttributeTypeMap() {\n return V1HostAlias.attributeTypeMap;\n }\n}\nexports.V1HostAlias = V1HostAlias;\nV1HostAlias.discriminator = undefined;\nV1HostAlias.attributeTypeMap = [\n {\n \"name\": \"hostnames\",\n \"baseName\": \"hostnames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ip\",\n \"baseName\": \"ip\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1HostAlias.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1HostPathVolumeSource = void 0;\n/**\n* Represents a host path mapped into a pod. Host path volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1HostPathVolumeSource {\n static getAttributeTypeMap() {\n return V1HostPathVolumeSource.attributeTypeMap;\n }\n}\nexports.V1HostPathVolumeSource = V1HostPathVolumeSource;\nV1HostPathVolumeSource.discriminator = undefined;\nV1HostPathVolumeSource.attributeTypeMap = [\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1HostPathVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IPBlock = void 0;\n/**\n* IPBlock describes a particular CIDR (Ex. \\\"192.168.1.1/24\\\",\\\"2001:db9::/64\\\") that is allowed to the pods matched by a NetworkPolicySpec\\'s podSelector. The except entry describes CIDRs that should not be included within this rule.\n*/\nclass V1IPBlock {\n static getAttributeTypeMap() {\n return V1IPBlock.attributeTypeMap;\n }\n}\nexports.V1IPBlock = V1IPBlock;\nV1IPBlock.discriminator = undefined;\nV1IPBlock.attributeTypeMap = [\n {\n \"name\": \"cidr\",\n \"baseName\": \"cidr\",\n \"type\": \"string\"\n },\n {\n \"name\": \"except\",\n \"baseName\": \"except\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1IPBlock.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ISCSIPersistentVolumeSource = void 0;\n/**\n* ISCSIPersistentVolumeSource represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.\n*/\nclass V1ISCSIPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1ISCSIPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1ISCSIPersistentVolumeSource = V1ISCSIPersistentVolumeSource;\nV1ISCSIPersistentVolumeSource.discriminator = undefined;\nV1ISCSIPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"chapAuthDiscovery\",\n \"baseName\": \"chapAuthDiscovery\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"chapAuthSession\",\n \"baseName\": \"chapAuthSession\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"initiatorName\",\n \"baseName\": \"initiatorName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"iqn\",\n \"baseName\": \"iqn\",\n \"type\": \"string\"\n },\n {\n \"name\": \"iscsiInterface\",\n \"baseName\": \"iscsiInterface\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lun\",\n \"baseName\": \"lun\",\n \"type\": \"number\"\n },\n {\n \"name\": \"portals\",\n \"baseName\": \"portals\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"targetPortal\",\n \"baseName\": \"targetPortal\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ISCSIPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ISCSIVolumeSource = void 0;\n/**\n* Represents an ISCSI disk. ISCSI volumes can only be mounted as read/write once. ISCSI volumes support ownership management and SELinux relabeling.\n*/\nclass V1ISCSIVolumeSource {\n static getAttributeTypeMap() {\n return V1ISCSIVolumeSource.attributeTypeMap;\n }\n}\nexports.V1ISCSIVolumeSource = V1ISCSIVolumeSource;\nV1ISCSIVolumeSource.discriminator = undefined;\nV1ISCSIVolumeSource.attributeTypeMap = [\n {\n \"name\": \"chapAuthDiscovery\",\n \"baseName\": \"chapAuthDiscovery\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"chapAuthSession\",\n \"baseName\": \"chapAuthSession\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"initiatorName\",\n \"baseName\": \"initiatorName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"iqn\",\n \"baseName\": \"iqn\",\n \"type\": \"string\"\n },\n {\n \"name\": \"iscsiInterface\",\n \"baseName\": \"iscsiInterface\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lun\",\n \"baseName\": \"lun\",\n \"type\": \"number\"\n },\n {\n \"name\": \"portals\",\n \"baseName\": \"portals\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"targetPortal\",\n \"baseName\": \"targetPortal\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ISCSIVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Ingress = void 0;\n/**\n* Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.\n*/\nclass V1Ingress {\n static getAttributeTypeMap() {\n return V1Ingress.attributeTypeMap;\n }\n}\nexports.V1Ingress = V1Ingress;\nV1Ingress.discriminator = undefined;\nV1Ingress.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1IngressSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1IngressStatus\"\n }\n];\n//# sourceMappingURL=v1Ingress.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressBackend = void 0;\n/**\n* IngressBackend describes all endpoints for a given service and port.\n*/\nclass V1IngressBackend {\n static getAttributeTypeMap() {\n return V1IngressBackend.attributeTypeMap;\n }\n}\nexports.V1IngressBackend = V1IngressBackend;\nV1IngressBackend.discriminator = undefined;\nV1IngressBackend.attributeTypeMap = [\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V1TypedLocalObjectReference\"\n },\n {\n \"name\": \"service\",\n \"baseName\": \"service\",\n \"type\": \"V1IngressServiceBackend\"\n }\n];\n//# sourceMappingURL=v1IngressBackend.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressClass = void 0;\n/**\n* IngressClass represents the class of the Ingress, referenced by the Ingress Spec. The `ingressclass.kubernetes.io/is-default-class` annotation can be used to indicate that an IngressClass should be considered default. When a single IngressClass resource has this annotation set to true, new Ingress resources without a class specified will be assigned this default class.\n*/\nclass V1IngressClass {\n static getAttributeTypeMap() {\n return V1IngressClass.attributeTypeMap;\n }\n}\nexports.V1IngressClass = V1IngressClass;\nV1IngressClass.discriminator = undefined;\nV1IngressClass.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1IngressClassSpec\"\n }\n];\n//# sourceMappingURL=v1IngressClass.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressClassList = void 0;\n/**\n* IngressClassList is a collection of IngressClasses.\n*/\nclass V1IngressClassList {\n static getAttributeTypeMap() {\n return V1IngressClassList.attributeTypeMap;\n }\n}\nexports.V1IngressClassList = V1IngressClassList;\nV1IngressClassList.discriminator = undefined;\nV1IngressClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1IngressClassList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressClassParametersReference = void 0;\n/**\n* IngressClassParametersReference identifies an API object. This can be used to specify a cluster or namespace-scoped resource.\n*/\nclass V1IngressClassParametersReference {\n static getAttributeTypeMap() {\n return V1IngressClassParametersReference.attributeTypeMap;\n }\n}\nexports.V1IngressClassParametersReference = V1IngressClassParametersReference;\nV1IngressClassParametersReference.discriminator = undefined;\nV1IngressClassParametersReference.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"scope\",\n \"baseName\": \"scope\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1IngressClassParametersReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressClassSpec = void 0;\n/**\n* IngressClassSpec provides information about the class of an Ingress.\n*/\nclass V1IngressClassSpec {\n static getAttributeTypeMap() {\n return V1IngressClassSpec.attributeTypeMap;\n }\n}\nexports.V1IngressClassSpec = V1IngressClassSpec;\nV1IngressClassSpec.discriminator = undefined;\nV1IngressClassSpec.attributeTypeMap = [\n {\n \"name\": \"controller\",\n \"baseName\": \"controller\",\n \"type\": \"string\"\n },\n {\n \"name\": \"parameters\",\n \"baseName\": \"parameters\",\n \"type\": \"V1IngressClassParametersReference\"\n }\n];\n//# sourceMappingURL=v1IngressClassSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressList = void 0;\n/**\n* IngressList is a collection of Ingress.\n*/\nclass V1IngressList {\n static getAttributeTypeMap() {\n return V1IngressList.attributeTypeMap;\n }\n}\nexports.V1IngressList = V1IngressList;\nV1IngressList.discriminator = undefined;\nV1IngressList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1IngressList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressRule = void 0;\n/**\n* IngressRule represents the rules mapping the paths under a specified host to the related backend services. Incoming requests are first evaluated for a host match, then routed to the backend associated with the matching IngressRuleValue.\n*/\nclass V1IngressRule {\n static getAttributeTypeMap() {\n return V1IngressRule.attributeTypeMap;\n }\n}\nexports.V1IngressRule = V1IngressRule;\nV1IngressRule.discriminator = undefined;\nV1IngressRule.attributeTypeMap = [\n {\n \"name\": \"host\",\n \"baseName\": \"host\",\n \"type\": \"string\"\n },\n {\n \"name\": \"http\",\n \"baseName\": \"http\",\n \"type\": \"V1HTTPIngressRuleValue\"\n }\n];\n//# sourceMappingURL=v1IngressRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressServiceBackend = void 0;\n/**\n* IngressServiceBackend references a Kubernetes Service as a Backend.\n*/\nclass V1IngressServiceBackend {\n static getAttributeTypeMap() {\n return V1IngressServiceBackend.attributeTypeMap;\n }\n}\nexports.V1IngressServiceBackend = V1IngressServiceBackend;\nV1IngressServiceBackend.discriminator = undefined;\nV1IngressServiceBackend.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"V1ServiceBackendPort\"\n }\n];\n//# sourceMappingURL=v1IngressServiceBackend.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressSpec = void 0;\n/**\n* IngressSpec describes the Ingress the user wishes to exist.\n*/\nclass V1IngressSpec {\n static getAttributeTypeMap() {\n return V1IngressSpec.attributeTypeMap;\n }\n}\nexports.V1IngressSpec = V1IngressSpec;\nV1IngressSpec.discriminator = undefined;\nV1IngressSpec.attributeTypeMap = [\n {\n \"name\": \"defaultBackend\",\n \"baseName\": \"defaultBackend\",\n \"type\": \"V1IngressBackend\"\n },\n {\n \"name\": \"ingressClassName\",\n \"baseName\": \"ingressClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"tls\",\n \"baseName\": \"tls\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1IngressSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressStatus = void 0;\n/**\n* IngressStatus describe the current state of the Ingress.\n*/\nclass V1IngressStatus {\n static getAttributeTypeMap() {\n return V1IngressStatus.attributeTypeMap;\n }\n}\nexports.V1IngressStatus = V1IngressStatus;\nV1IngressStatus.discriminator = undefined;\nV1IngressStatus.attributeTypeMap = [\n {\n \"name\": \"loadBalancer\",\n \"baseName\": \"loadBalancer\",\n \"type\": \"V1LoadBalancerStatus\"\n }\n];\n//# sourceMappingURL=v1IngressStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1IngressTLS = void 0;\n/**\n* IngressTLS describes the transport layer security associated with an Ingress.\n*/\nclass V1IngressTLS {\n static getAttributeTypeMap() {\n return V1IngressTLS.attributeTypeMap;\n }\n}\nexports.V1IngressTLS = V1IngressTLS;\nV1IngressTLS.discriminator = undefined;\nV1IngressTLS.attributeTypeMap = [\n {\n \"name\": \"hosts\",\n \"baseName\": \"hosts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"secretName\",\n \"baseName\": \"secretName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1IngressTLS.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1JSONSchemaProps = void 0;\n/**\n* JSONSchemaProps is a JSON-Schema following Specification Draft 4 (http://json-schema.org/).\n*/\nclass V1JSONSchemaProps {\n static getAttributeTypeMap() {\n return V1JSONSchemaProps.attributeTypeMap;\n }\n}\nexports.V1JSONSchemaProps = V1JSONSchemaProps;\nV1JSONSchemaProps.discriminator = undefined;\nV1JSONSchemaProps.attributeTypeMap = [\n {\n \"name\": \"$ref\",\n \"baseName\": \"$ref\",\n \"type\": \"string\"\n },\n {\n \"name\": \"$schema\",\n \"baseName\": \"$schema\",\n \"type\": \"string\"\n },\n {\n \"name\": \"additionalItems\",\n \"baseName\": \"additionalItems\",\n \"type\": \"object\"\n },\n {\n \"name\": \"additionalProperties\",\n \"baseName\": \"additionalProperties\",\n \"type\": \"object\"\n },\n {\n \"name\": \"allOf\",\n \"baseName\": \"allOf\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"anyOf\",\n \"baseName\": \"anyOf\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"_default\",\n \"baseName\": \"default\",\n \"type\": \"object\"\n },\n {\n \"name\": \"definitions\",\n \"baseName\": \"definitions\",\n \"type\": \"{ [key: string]: V1JSONSchemaProps; }\"\n },\n {\n \"name\": \"dependencies\",\n \"baseName\": \"dependencies\",\n \"type\": \"{ [key: string]: object; }\"\n },\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"_enum\",\n \"baseName\": \"enum\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"example\",\n \"baseName\": \"example\",\n \"type\": \"object\"\n },\n {\n \"name\": \"exclusiveMaximum\",\n \"baseName\": \"exclusiveMaximum\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"exclusiveMinimum\",\n \"baseName\": \"exclusiveMinimum\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"externalDocs\",\n \"baseName\": \"externalDocs\",\n \"type\": \"V1ExternalDocumentation\"\n },\n {\n \"name\": \"format\",\n \"baseName\": \"format\",\n \"type\": \"string\"\n },\n {\n \"name\": \"id\",\n \"baseName\": \"id\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"object\"\n },\n {\n \"name\": \"maxItems\",\n \"baseName\": \"maxItems\",\n \"type\": \"number\"\n },\n {\n \"name\": \"maxLength\",\n \"baseName\": \"maxLength\",\n \"type\": \"number\"\n },\n {\n \"name\": \"maxProperties\",\n \"baseName\": \"maxProperties\",\n \"type\": \"number\"\n },\n {\n \"name\": \"maximum\",\n \"baseName\": \"maximum\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minItems\",\n \"baseName\": \"minItems\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minLength\",\n \"baseName\": \"minLength\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minProperties\",\n \"baseName\": \"minProperties\",\n \"type\": \"number\"\n },\n {\n \"name\": \"minimum\",\n \"baseName\": \"minimum\",\n \"type\": \"number\"\n },\n {\n \"name\": \"multipleOf\",\n \"baseName\": \"multipleOf\",\n \"type\": \"number\"\n },\n {\n \"name\": \"not\",\n \"baseName\": \"not\",\n \"type\": \"V1JSONSchemaProps\"\n },\n {\n \"name\": \"nullable\",\n \"baseName\": \"nullable\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"oneOf\",\n \"baseName\": \"oneOf\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"pattern\",\n \"baseName\": \"pattern\",\n \"type\": \"string\"\n },\n {\n \"name\": \"patternProperties\",\n \"baseName\": \"patternProperties\",\n \"type\": \"{ [key: string]: V1JSONSchemaProps; }\"\n },\n {\n \"name\": \"properties\",\n \"baseName\": \"properties\",\n \"type\": \"{ [key: string]: V1JSONSchemaProps; }\"\n },\n {\n \"name\": \"required\",\n \"baseName\": \"required\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"title\",\n \"baseName\": \"title\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uniqueItems\",\n \"baseName\": \"uniqueItems\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"x_kubernetes_embedded_resource\",\n \"baseName\": \"x-kubernetes-embedded-resource\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"x_kubernetes_int_or_string\",\n \"baseName\": \"x-kubernetes-int-or-string\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"x_kubernetes_list_map_keys\",\n \"baseName\": \"x-kubernetes-list-map-keys\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"x_kubernetes_list_type\",\n \"baseName\": \"x-kubernetes-list-type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"x_kubernetes_map_type\",\n \"baseName\": \"x-kubernetes-map-type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"x_kubernetes_preserve_unknown_fields\",\n \"baseName\": \"x-kubernetes-preserve-unknown-fields\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1JSONSchemaProps.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Job = void 0;\n/**\n* Job represents the configuration of a single job.\n*/\nclass V1Job {\n static getAttributeTypeMap() {\n return V1Job.attributeTypeMap;\n }\n}\nexports.V1Job = V1Job;\nV1Job.discriminator = undefined;\nV1Job.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1JobSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1JobStatus\"\n }\n];\n//# sourceMappingURL=v1Job.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1JobCondition = void 0;\n/**\n* JobCondition describes current state of a job.\n*/\nclass V1JobCondition {\n static getAttributeTypeMap() {\n return V1JobCondition.attributeTypeMap;\n }\n}\nexports.V1JobCondition = V1JobCondition;\nV1JobCondition.discriminator = undefined;\nV1JobCondition.attributeTypeMap = [\n {\n \"name\": \"lastProbeTime\",\n \"baseName\": \"lastProbeTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1JobCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1JobList = void 0;\n/**\n* JobList is a collection of jobs.\n*/\nclass V1JobList {\n static getAttributeTypeMap() {\n return V1JobList.attributeTypeMap;\n }\n}\nexports.V1JobList = V1JobList;\nV1JobList.discriminator = undefined;\nV1JobList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1JobList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1JobSpec = void 0;\n/**\n* JobSpec describes how the job execution will look like.\n*/\nclass V1JobSpec {\n static getAttributeTypeMap() {\n return V1JobSpec.attributeTypeMap;\n }\n}\nexports.V1JobSpec = V1JobSpec;\nV1JobSpec.discriminator = undefined;\nV1JobSpec.attributeTypeMap = [\n {\n \"name\": \"activeDeadlineSeconds\",\n \"baseName\": \"activeDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"backoffLimit\",\n \"baseName\": \"backoffLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"completionMode\",\n \"baseName\": \"completionMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"completions\",\n \"baseName\": \"completions\",\n \"type\": \"number\"\n },\n {\n \"name\": \"manualSelector\",\n \"baseName\": \"manualSelector\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"parallelism\",\n \"baseName\": \"parallelism\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"suspend\",\n \"baseName\": \"suspend\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"ttlSecondsAfterFinished\",\n \"baseName\": \"ttlSecondsAfterFinished\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1JobSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1JobStatus = void 0;\n/**\n* JobStatus represents the current state of a Job.\n*/\nclass V1JobStatus {\n static getAttributeTypeMap() {\n return V1JobStatus.attributeTypeMap;\n }\n}\nexports.V1JobStatus = V1JobStatus;\nV1JobStatus.discriminator = undefined;\nV1JobStatus.attributeTypeMap = [\n {\n \"name\": \"active\",\n \"baseName\": \"active\",\n \"type\": \"number\"\n },\n {\n \"name\": \"completedIndexes\",\n \"baseName\": \"completedIndexes\",\n \"type\": \"string\"\n },\n {\n \"name\": \"completionTime\",\n \"baseName\": \"completionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"failed\",\n \"baseName\": \"failed\",\n \"type\": \"number\"\n },\n {\n \"name\": \"startTime\",\n \"baseName\": \"startTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"succeeded\",\n \"baseName\": \"succeeded\",\n \"type\": \"number\"\n },\n {\n \"name\": \"uncountedTerminatedPods\",\n \"baseName\": \"uncountedTerminatedPods\",\n \"type\": \"V1UncountedTerminatedPods\"\n }\n];\n//# sourceMappingURL=v1JobStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1JobTemplateSpec = void 0;\n/**\n* JobTemplateSpec describes the data a Job should have when created from a template\n*/\nclass V1JobTemplateSpec {\n static getAttributeTypeMap() {\n return V1JobTemplateSpec.attributeTypeMap;\n }\n}\nexports.V1JobTemplateSpec = V1JobTemplateSpec;\nV1JobTemplateSpec.discriminator = undefined;\nV1JobTemplateSpec.attributeTypeMap = [\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1JobSpec\"\n }\n];\n//# sourceMappingURL=v1JobTemplateSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1KeyToPath = void 0;\n/**\n* Maps a string key to a path within a volume.\n*/\nclass V1KeyToPath {\n static getAttributeTypeMap() {\n return V1KeyToPath.attributeTypeMap;\n }\n}\nexports.V1KeyToPath = V1KeyToPath;\nV1KeyToPath.discriminator = undefined;\nV1KeyToPath.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"mode\",\n \"baseName\": \"mode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1KeyToPath.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LabelSelector = void 0;\n/**\n* A label selector is a label query over a set of resources. The result of matchLabels and matchExpressions are ANDed. An empty label selector matches all objects. A null label selector matches no objects.\n*/\nclass V1LabelSelector {\n static getAttributeTypeMap() {\n return V1LabelSelector.attributeTypeMap;\n }\n}\nexports.V1LabelSelector = V1LabelSelector;\nV1LabelSelector.discriminator = undefined;\nV1LabelSelector.attributeTypeMap = [\n {\n \"name\": \"matchExpressions\",\n \"baseName\": \"matchExpressions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"matchLabels\",\n \"baseName\": \"matchLabels\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\n//# sourceMappingURL=v1LabelSelector.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LabelSelectorRequirement = void 0;\n/**\n* A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.\n*/\nclass V1LabelSelectorRequirement {\n static getAttributeTypeMap() {\n return V1LabelSelectorRequirement.attributeTypeMap;\n }\n}\nexports.V1LabelSelectorRequirement = V1LabelSelectorRequirement;\nV1LabelSelectorRequirement.discriminator = undefined;\nV1LabelSelectorRequirement.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operator\",\n \"baseName\": \"operator\",\n \"type\": \"string\"\n },\n {\n \"name\": \"values\",\n \"baseName\": \"values\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1LabelSelectorRequirement.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Lease = void 0;\n/**\n* Lease defines a lease concept.\n*/\nclass V1Lease {\n static getAttributeTypeMap() {\n return V1Lease.attributeTypeMap;\n }\n}\nexports.V1Lease = V1Lease;\nV1Lease.discriminator = undefined;\nV1Lease.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1LeaseSpec\"\n }\n];\n//# sourceMappingURL=v1Lease.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LeaseList = void 0;\n/**\n* LeaseList is a list of Lease objects.\n*/\nclass V1LeaseList {\n static getAttributeTypeMap() {\n return V1LeaseList.attributeTypeMap;\n }\n}\nexports.V1LeaseList = V1LeaseList;\nV1LeaseList.discriminator = undefined;\nV1LeaseList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1LeaseList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LeaseSpec = void 0;\n/**\n* LeaseSpec is a specification of a Lease.\n*/\nclass V1LeaseSpec {\n static getAttributeTypeMap() {\n return V1LeaseSpec.attributeTypeMap;\n }\n}\nexports.V1LeaseSpec = V1LeaseSpec;\nV1LeaseSpec.discriminator = undefined;\nV1LeaseSpec.attributeTypeMap = [\n {\n \"name\": \"acquireTime\",\n \"baseName\": \"acquireTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"holderIdentity\",\n \"baseName\": \"holderIdentity\",\n \"type\": \"string\"\n },\n {\n \"name\": \"leaseDurationSeconds\",\n \"baseName\": \"leaseDurationSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"leaseTransitions\",\n \"baseName\": \"leaseTransitions\",\n \"type\": \"number\"\n },\n {\n \"name\": \"renewTime\",\n \"baseName\": \"renewTime\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1LeaseSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Lifecycle = void 0;\n/**\n* Lifecycle describes actions that the management system should take in response to container lifecycle events. For the PostStart and PreStop lifecycle handlers, management of the container blocks until the action is complete, unless the container process fails, in which case the handler is aborted.\n*/\nclass V1Lifecycle {\n static getAttributeTypeMap() {\n return V1Lifecycle.attributeTypeMap;\n }\n}\nexports.V1Lifecycle = V1Lifecycle;\nV1Lifecycle.discriminator = undefined;\nV1Lifecycle.attributeTypeMap = [\n {\n \"name\": \"postStart\",\n \"baseName\": \"postStart\",\n \"type\": \"V1Handler\"\n },\n {\n \"name\": \"preStop\",\n \"baseName\": \"preStop\",\n \"type\": \"V1Handler\"\n }\n];\n//# sourceMappingURL=v1Lifecycle.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LimitRange = void 0;\n/**\n* LimitRange sets resource usage limits for each kind of resource in a Namespace.\n*/\nclass V1LimitRange {\n static getAttributeTypeMap() {\n return V1LimitRange.attributeTypeMap;\n }\n}\nexports.V1LimitRange = V1LimitRange;\nV1LimitRange.discriminator = undefined;\nV1LimitRange.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1LimitRangeSpec\"\n }\n];\n//# sourceMappingURL=v1LimitRange.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LimitRangeItem = void 0;\n/**\n* LimitRangeItem defines a min/max usage limit for any resource that matches on kind.\n*/\nclass V1LimitRangeItem {\n static getAttributeTypeMap() {\n return V1LimitRangeItem.attributeTypeMap;\n }\n}\nexports.V1LimitRangeItem = V1LimitRangeItem;\nV1LimitRangeItem.discriminator = undefined;\nV1LimitRangeItem.attributeTypeMap = [\n {\n \"name\": \"_default\",\n \"baseName\": \"default\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"defaultRequest\",\n \"baseName\": \"defaultRequest\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"max\",\n \"baseName\": \"max\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"maxLimitRequestRatio\",\n \"baseName\": \"maxLimitRequestRatio\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"min\",\n \"baseName\": \"min\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1LimitRangeItem.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LimitRangeList = void 0;\n/**\n* LimitRangeList is a list of LimitRange items.\n*/\nclass V1LimitRangeList {\n static getAttributeTypeMap() {\n return V1LimitRangeList.attributeTypeMap;\n }\n}\nexports.V1LimitRangeList = V1LimitRangeList;\nV1LimitRangeList.discriminator = undefined;\nV1LimitRangeList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1LimitRangeList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LimitRangeSpec = void 0;\n/**\n* LimitRangeSpec defines a min/max usage limit for resources that match on kind.\n*/\nclass V1LimitRangeSpec {\n static getAttributeTypeMap() {\n return V1LimitRangeSpec.attributeTypeMap;\n }\n}\nexports.V1LimitRangeSpec = V1LimitRangeSpec;\nV1LimitRangeSpec.discriminator = undefined;\nV1LimitRangeSpec.attributeTypeMap = [\n {\n \"name\": \"limits\",\n \"baseName\": \"limits\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1LimitRangeSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ListMeta = void 0;\n/**\n* ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.\n*/\nclass V1ListMeta {\n static getAttributeTypeMap() {\n return V1ListMeta.attributeTypeMap;\n }\n}\nexports.V1ListMeta = V1ListMeta;\nV1ListMeta.discriminator = undefined;\nV1ListMeta.attributeTypeMap = [\n {\n \"name\": \"_continue\",\n \"baseName\": \"continue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"remainingItemCount\",\n \"baseName\": \"remainingItemCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selfLink\",\n \"baseName\": \"selfLink\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ListMeta.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LoadBalancerIngress = void 0;\n/**\n* LoadBalancerIngress represents the status of a load-balancer ingress point: traffic intended for the service should be sent to an ingress point.\n*/\nclass V1LoadBalancerIngress {\n static getAttributeTypeMap() {\n return V1LoadBalancerIngress.attributeTypeMap;\n }\n}\nexports.V1LoadBalancerIngress = V1LoadBalancerIngress;\nV1LoadBalancerIngress.discriminator = undefined;\nV1LoadBalancerIngress.attributeTypeMap = [\n {\n \"name\": \"hostname\",\n \"baseName\": \"hostname\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ip\",\n \"baseName\": \"ip\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1LoadBalancerIngress.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LoadBalancerStatus = void 0;\n/**\n* LoadBalancerStatus represents the status of a load-balancer.\n*/\nclass V1LoadBalancerStatus {\n static getAttributeTypeMap() {\n return V1LoadBalancerStatus.attributeTypeMap;\n }\n}\nexports.V1LoadBalancerStatus = V1LoadBalancerStatus;\nV1LoadBalancerStatus.discriminator = undefined;\nV1LoadBalancerStatus.attributeTypeMap = [\n {\n \"name\": \"ingress\",\n \"baseName\": \"ingress\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1LoadBalancerStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LocalObjectReference = void 0;\n/**\n* LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.\n*/\nclass V1LocalObjectReference {\n static getAttributeTypeMap() {\n return V1LocalObjectReference.attributeTypeMap;\n }\n}\nexports.V1LocalObjectReference = V1LocalObjectReference;\nV1LocalObjectReference.discriminator = undefined;\nV1LocalObjectReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1LocalObjectReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LocalSubjectAccessReview = void 0;\n/**\n* LocalSubjectAccessReview checks whether or not a user or group can perform an action in a given namespace. Having a namespace scoped resource makes it much easier to grant namespace scoped policy that includes permissions checking.\n*/\nclass V1LocalSubjectAccessReview {\n static getAttributeTypeMap() {\n return V1LocalSubjectAccessReview.attributeTypeMap;\n }\n}\nexports.V1LocalSubjectAccessReview = V1LocalSubjectAccessReview;\nV1LocalSubjectAccessReview.discriminator = undefined;\nV1LocalSubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1SubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1SubjectAccessReviewStatus\"\n }\n];\n//# sourceMappingURL=v1LocalSubjectAccessReview.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1LocalVolumeSource = void 0;\n/**\n* Local represents directly-attached storage with node affinity (Beta feature)\n*/\nclass V1LocalVolumeSource {\n static getAttributeTypeMap() {\n return V1LocalVolumeSource.attributeTypeMap;\n }\n}\nexports.V1LocalVolumeSource = V1LocalVolumeSource;\nV1LocalVolumeSource.discriminator = undefined;\nV1LocalVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1LocalVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ManagedFieldsEntry = void 0;\n/**\n* ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.\n*/\nclass V1ManagedFieldsEntry {\n static getAttributeTypeMap() {\n return V1ManagedFieldsEntry.attributeTypeMap;\n }\n}\nexports.V1ManagedFieldsEntry = V1ManagedFieldsEntry;\nV1ManagedFieldsEntry.discriminator = undefined;\nV1ManagedFieldsEntry.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fieldsType\",\n \"baseName\": \"fieldsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fieldsV1\",\n \"baseName\": \"fieldsV1\",\n \"type\": \"object\"\n },\n {\n \"name\": \"manager\",\n \"baseName\": \"manager\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operation\",\n \"baseName\": \"operation\",\n \"type\": \"string\"\n },\n {\n \"name\": \"subresource\",\n \"baseName\": \"subresource\",\n \"type\": \"string\"\n },\n {\n \"name\": \"time\",\n \"baseName\": \"time\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1ManagedFieldsEntry.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1MutatingWebhook = void 0;\n/**\n* MutatingWebhook describes an admission webhook and the resources and operations it applies to.\n*/\nclass V1MutatingWebhook {\n static getAttributeTypeMap() {\n return V1MutatingWebhook.attributeTypeMap;\n }\n}\nexports.V1MutatingWebhook = V1MutatingWebhook;\nV1MutatingWebhook.discriminator = undefined;\nV1MutatingWebhook.attributeTypeMap = [\n {\n \"name\": \"admissionReviewVersions\",\n \"baseName\": \"admissionReviewVersions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"clientConfig\",\n \"baseName\": \"clientConfig\",\n \"type\": \"AdmissionregistrationV1WebhookClientConfig\"\n },\n {\n \"name\": \"failurePolicy\",\n \"baseName\": \"failurePolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"matchPolicy\",\n \"baseName\": \"matchPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespaceSelector\",\n \"baseName\": \"namespaceSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"objectSelector\",\n \"baseName\": \"objectSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"reinvocationPolicy\",\n \"baseName\": \"reinvocationPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"sideEffects\",\n \"baseName\": \"sideEffects\",\n \"type\": \"string\"\n },\n {\n \"name\": \"timeoutSeconds\",\n \"baseName\": \"timeoutSeconds\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1MutatingWebhook.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1MutatingWebhookConfiguration = void 0;\n/**\n* MutatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and may change the object.\n*/\nclass V1MutatingWebhookConfiguration {\n static getAttributeTypeMap() {\n return V1MutatingWebhookConfiguration.attributeTypeMap;\n }\n}\nexports.V1MutatingWebhookConfiguration = V1MutatingWebhookConfiguration;\nV1MutatingWebhookConfiguration.discriminator = undefined;\nV1MutatingWebhookConfiguration.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"webhooks\",\n \"baseName\": \"webhooks\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1MutatingWebhookConfiguration.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1MutatingWebhookConfigurationList = void 0;\n/**\n* MutatingWebhookConfigurationList is a list of MutatingWebhookConfiguration.\n*/\nclass V1MutatingWebhookConfigurationList {\n static getAttributeTypeMap() {\n return V1MutatingWebhookConfigurationList.attributeTypeMap;\n }\n}\nexports.V1MutatingWebhookConfigurationList = V1MutatingWebhookConfigurationList;\nV1MutatingWebhookConfigurationList.discriminator = undefined;\nV1MutatingWebhookConfigurationList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1MutatingWebhookConfigurationList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NFSVolumeSource = void 0;\n/**\n* Represents an NFS mount that lasts the lifetime of a pod. NFS volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1NFSVolumeSource {\n static getAttributeTypeMap() {\n return V1NFSVolumeSource.attributeTypeMap;\n }\n}\nexports.V1NFSVolumeSource = V1NFSVolumeSource;\nV1NFSVolumeSource.discriminator = undefined;\nV1NFSVolumeSource.attributeTypeMap = [\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"server\",\n \"baseName\": \"server\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1NFSVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Namespace = void 0;\n/**\n* Namespace provides a scope for Names. Use of multiple namespaces is optional.\n*/\nclass V1Namespace {\n static getAttributeTypeMap() {\n return V1Namespace.attributeTypeMap;\n }\n}\nexports.V1Namespace = V1Namespace;\nV1Namespace.discriminator = undefined;\nV1Namespace.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1NamespaceSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1NamespaceStatus\"\n }\n];\n//# sourceMappingURL=v1Namespace.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NamespaceCondition = void 0;\n/**\n* NamespaceCondition contains details about state of namespace.\n*/\nclass V1NamespaceCondition {\n static getAttributeTypeMap() {\n return V1NamespaceCondition.attributeTypeMap;\n }\n}\nexports.V1NamespaceCondition = V1NamespaceCondition;\nV1NamespaceCondition.discriminator = undefined;\nV1NamespaceCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1NamespaceCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NamespaceList = void 0;\n/**\n* NamespaceList is a list of Namespaces.\n*/\nclass V1NamespaceList {\n static getAttributeTypeMap() {\n return V1NamespaceList.attributeTypeMap;\n }\n}\nexports.V1NamespaceList = V1NamespaceList;\nV1NamespaceList.discriminator = undefined;\nV1NamespaceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1NamespaceList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NamespaceSpec = void 0;\n/**\n* NamespaceSpec describes the attributes on a Namespace.\n*/\nclass V1NamespaceSpec {\n static getAttributeTypeMap() {\n return V1NamespaceSpec.attributeTypeMap;\n }\n}\nexports.V1NamespaceSpec = V1NamespaceSpec;\nV1NamespaceSpec.discriminator = undefined;\nV1NamespaceSpec.attributeTypeMap = [\n {\n \"name\": \"finalizers\",\n \"baseName\": \"finalizers\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NamespaceSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NamespaceStatus = void 0;\n/**\n* NamespaceStatus is information about the current status of a Namespace.\n*/\nclass V1NamespaceStatus {\n static getAttributeTypeMap() {\n return V1NamespaceStatus.attributeTypeMap;\n }\n}\nexports.V1NamespaceStatus = V1NamespaceStatus;\nV1NamespaceStatus.discriminator = undefined;\nV1NamespaceStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1NamespaceStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NetworkPolicy = void 0;\n/**\n* NetworkPolicy describes what network traffic is allowed for a set of Pods\n*/\nclass V1NetworkPolicy {\n static getAttributeTypeMap() {\n return V1NetworkPolicy.attributeTypeMap;\n }\n}\nexports.V1NetworkPolicy = V1NetworkPolicy;\nV1NetworkPolicy.discriminator = undefined;\nV1NetworkPolicy.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1NetworkPolicySpec\"\n }\n];\n//# sourceMappingURL=v1NetworkPolicy.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NetworkPolicyEgressRule = void 0;\n/**\n* NetworkPolicyEgressRule describes a particular set of traffic that is allowed out of pods matched by a NetworkPolicySpec\\'s podSelector. The traffic must match both ports and to. This type is beta-level in 1.8\n*/\nclass V1NetworkPolicyEgressRule {\n static getAttributeTypeMap() {\n return V1NetworkPolicyEgressRule.attributeTypeMap;\n }\n}\nexports.V1NetworkPolicyEgressRule = V1NetworkPolicyEgressRule;\nV1NetworkPolicyEgressRule.discriminator = undefined;\nV1NetworkPolicyEgressRule.attributeTypeMap = [\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"to\",\n \"baseName\": \"to\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NetworkPolicyEgressRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NetworkPolicyIngressRule = void 0;\n/**\n* NetworkPolicyIngressRule describes a particular set of traffic that is allowed to the pods matched by a NetworkPolicySpec\\'s podSelector. The traffic must match both ports and from.\n*/\nclass V1NetworkPolicyIngressRule {\n static getAttributeTypeMap() {\n return V1NetworkPolicyIngressRule.attributeTypeMap;\n }\n}\nexports.V1NetworkPolicyIngressRule = V1NetworkPolicyIngressRule;\nV1NetworkPolicyIngressRule.discriminator = undefined;\nV1NetworkPolicyIngressRule.attributeTypeMap = [\n {\n \"name\": \"from\",\n \"baseName\": \"from\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NetworkPolicyIngressRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NetworkPolicyList = void 0;\n/**\n* NetworkPolicyList is a list of NetworkPolicy objects.\n*/\nclass V1NetworkPolicyList {\n static getAttributeTypeMap() {\n return V1NetworkPolicyList.attributeTypeMap;\n }\n}\nexports.V1NetworkPolicyList = V1NetworkPolicyList;\nV1NetworkPolicyList.discriminator = undefined;\nV1NetworkPolicyList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1NetworkPolicyList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NetworkPolicyPeer = void 0;\n/**\n* NetworkPolicyPeer describes a peer to allow traffic to/from. Only certain combinations of fields are allowed\n*/\nclass V1NetworkPolicyPeer {\n static getAttributeTypeMap() {\n return V1NetworkPolicyPeer.attributeTypeMap;\n }\n}\nexports.V1NetworkPolicyPeer = V1NetworkPolicyPeer;\nV1NetworkPolicyPeer.discriminator = undefined;\nV1NetworkPolicyPeer.attributeTypeMap = [\n {\n \"name\": \"ipBlock\",\n \"baseName\": \"ipBlock\",\n \"type\": \"V1IPBlock\"\n },\n {\n \"name\": \"namespaceSelector\",\n \"baseName\": \"namespaceSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"podSelector\",\n \"baseName\": \"podSelector\",\n \"type\": \"V1LabelSelector\"\n }\n];\n//# sourceMappingURL=v1NetworkPolicyPeer.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NetworkPolicyPort = void 0;\n/**\n* NetworkPolicyPort describes a port to allow traffic on\n*/\nclass V1NetworkPolicyPort {\n static getAttributeTypeMap() {\n return V1NetworkPolicyPort.attributeTypeMap;\n }\n}\nexports.V1NetworkPolicyPort = V1NetworkPolicyPort;\nV1NetworkPolicyPort.discriminator = undefined;\nV1NetworkPolicyPort.attributeTypeMap = [\n {\n \"name\": \"endPort\",\n \"baseName\": \"endPort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"IntOrString\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1NetworkPolicyPort.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NetworkPolicySpec = void 0;\n/**\n* NetworkPolicySpec provides the specification of a NetworkPolicy\n*/\nclass V1NetworkPolicySpec {\n static getAttributeTypeMap() {\n return V1NetworkPolicySpec.attributeTypeMap;\n }\n}\nexports.V1NetworkPolicySpec = V1NetworkPolicySpec;\nV1NetworkPolicySpec.discriminator = undefined;\nV1NetworkPolicySpec.attributeTypeMap = [\n {\n \"name\": \"egress\",\n \"baseName\": \"egress\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ingress\",\n \"baseName\": \"ingress\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"podSelector\",\n \"baseName\": \"podSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"policyTypes\",\n \"baseName\": \"policyTypes\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NetworkPolicySpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Node = void 0;\n/**\n* Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).\n*/\nclass V1Node {\n static getAttributeTypeMap() {\n return V1Node.attributeTypeMap;\n }\n}\nexports.V1Node = V1Node;\nV1Node.discriminator = undefined;\nV1Node.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1NodeSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1NodeStatus\"\n }\n];\n//# sourceMappingURL=v1Node.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeAddress = void 0;\n/**\n* NodeAddress contains information for the node\\'s address.\n*/\nclass V1NodeAddress {\n static getAttributeTypeMap() {\n return V1NodeAddress.attributeTypeMap;\n }\n}\nexports.V1NodeAddress = V1NodeAddress;\nV1NodeAddress.discriminator = undefined;\nV1NodeAddress.attributeTypeMap = [\n {\n \"name\": \"address\",\n \"baseName\": \"address\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1NodeAddress.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeAffinity = void 0;\n/**\n* Node affinity is a group of node affinity scheduling rules.\n*/\nclass V1NodeAffinity {\n static getAttributeTypeMap() {\n return V1NodeAffinity.attributeTypeMap;\n }\n}\nexports.V1NodeAffinity = V1NodeAffinity;\nV1NodeAffinity.discriminator = undefined;\nV1NodeAffinity.attributeTypeMap = [\n {\n \"name\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"V1NodeSelector\"\n }\n];\n//# sourceMappingURL=v1NodeAffinity.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeCondition = void 0;\n/**\n* NodeCondition contains condition information for a node.\n*/\nclass V1NodeCondition {\n static getAttributeTypeMap() {\n return V1NodeCondition.attributeTypeMap;\n }\n}\nexports.V1NodeCondition = V1NodeCondition;\nV1NodeCondition.discriminator = undefined;\nV1NodeCondition.attributeTypeMap = [\n {\n \"name\": \"lastHeartbeatTime\",\n \"baseName\": \"lastHeartbeatTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1NodeCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeConfigSource = void 0;\n/**\n* NodeConfigSource specifies a source of node configuration. Exactly one subfield (excluding metadata) must be non-nil. This API is deprecated since 1.22\n*/\nclass V1NodeConfigSource {\n static getAttributeTypeMap() {\n return V1NodeConfigSource.attributeTypeMap;\n }\n}\nexports.V1NodeConfigSource = V1NodeConfigSource;\nV1NodeConfigSource.discriminator = undefined;\nV1NodeConfigSource.attributeTypeMap = [\n {\n \"name\": \"configMap\",\n \"baseName\": \"configMap\",\n \"type\": \"V1ConfigMapNodeConfigSource\"\n }\n];\n//# sourceMappingURL=v1NodeConfigSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeConfigStatus = void 0;\n/**\n* NodeConfigStatus describes the status of the config assigned by Node.Spec.ConfigSource.\n*/\nclass V1NodeConfigStatus {\n static getAttributeTypeMap() {\n return V1NodeConfigStatus.attributeTypeMap;\n }\n}\nexports.V1NodeConfigStatus = V1NodeConfigStatus;\nV1NodeConfigStatus.discriminator = undefined;\nV1NodeConfigStatus.attributeTypeMap = [\n {\n \"name\": \"active\",\n \"baseName\": \"active\",\n \"type\": \"V1NodeConfigSource\"\n },\n {\n \"name\": \"assigned\",\n \"baseName\": \"assigned\",\n \"type\": \"V1NodeConfigSource\"\n },\n {\n \"name\": \"error\",\n \"baseName\": \"error\",\n \"type\": \"string\"\n },\n {\n \"name\": \"lastKnownGood\",\n \"baseName\": \"lastKnownGood\",\n \"type\": \"V1NodeConfigSource\"\n }\n];\n//# sourceMappingURL=v1NodeConfigStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeDaemonEndpoints = void 0;\n/**\n* NodeDaemonEndpoints lists ports opened by daemons running on the Node.\n*/\nclass V1NodeDaemonEndpoints {\n static getAttributeTypeMap() {\n return V1NodeDaemonEndpoints.attributeTypeMap;\n }\n}\nexports.V1NodeDaemonEndpoints = V1NodeDaemonEndpoints;\nV1NodeDaemonEndpoints.discriminator = undefined;\nV1NodeDaemonEndpoints.attributeTypeMap = [\n {\n \"name\": \"kubeletEndpoint\",\n \"baseName\": \"kubeletEndpoint\",\n \"type\": \"V1DaemonEndpoint\"\n }\n];\n//# sourceMappingURL=v1NodeDaemonEndpoints.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeList = void 0;\n/**\n* NodeList is the whole list of all Nodes which have been registered with master.\n*/\nclass V1NodeList {\n static getAttributeTypeMap() {\n return V1NodeList.attributeTypeMap;\n }\n}\nexports.V1NodeList = V1NodeList;\nV1NodeList.discriminator = undefined;\nV1NodeList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1NodeList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeSelector = void 0;\n/**\n* A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.\n*/\nclass V1NodeSelector {\n static getAttributeTypeMap() {\n return V1NodeSelector.attributeTypeMap;\n }\n}\nexports.V1NodeSelector = V1NodeSelector;\nV1NodeSelector.discriminator = undefined;\nV1NodeSelector.attributeTypeMap = [\n {\n \"name\": \"nodeSelectorTerms\",\n \"baseName\": \"nodeSelectorTerms\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NodeSelector.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeSelectorRequirement = void 0;\n/**\n* A node selector requirement is a selector that contains values, a key, and an operator that relates the key and values.\n*/\nclass V1NodeSelectorRequirement {\n static getAttributeTypeMap() {\n return V1NodeSelectorRequirement.attributeTypeMap;\n }\n}\nexports.V1NodeSelectorRequirement = V1NodeSelectorRequirement;\nV1NodeSelectorRequirement.discriminator = undefined;\nV1NodeSelectorRequirement.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operator\",\n \"baseName\": \"operator\",\n \"type\": \"string\"\n },\n {\n \"name\": \"values\",\n \"baseName\": \"values\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NodeSelectorRequirement.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeSelectorTerm = void 0;\n/**\n* A null or empty node selector term matches no objects. The requirements of them are ANDed. The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.\n*/\nclass V1NodeSelectorTerm {\n static getAttributeTypeMap() {\n return V1NodeSelectorTerm.attributeTypeMap;\n }\n}\nexports.V1NodeSelectorTerm = V1NodeSelectorTerm;\nV1NodeSelectorTerm.discriminator = undefined;\nV1NodeSelectorTerm.attributeTypeMap = [\n {\n \"name\": \"matchExpressions\",\n \"baseName\": \"matchExpressions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"matchFields\",\n \"baseName\": \"matchFields\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NodeSelectorTerm.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeSpec = void 0;\n/**\n* NodeSpec describes the attributes that a node is created with.\n*/\nclass V1NodeSpec {\n static getAttributeTypeMap() {\n return V1NodeSpec.attributeTypeMap;\n }\n}\nexports.V1NodeSpec = V1NodeSpec;\nV1NodeSpec.discriminator = undefined;\nV1NodeSpec.attributeTypeMap = [\n {\n \"name\": \"configSource\",\n \"baseName\": \"configSource\",\n \"type\": \"V1NodeConfigSource\"\n },\n {\n \"name\": \"externalID\",\n \"baseName\": \"externalID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"podCIDR\",\n \"baseName\": \"podCIDR\",\n \"type\": \"string\"\n },\n {\n \"name\": \"podCIDRs\",\n \"baseName\": \"podCIDRs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"providerID\",\n \"baseName\": \"providerID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"taints\",\n \"baseName\": \"taints\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"unschedulable\",\n \"baseName\": \"unschedulable\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1NodeSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeStatus = void 0;\n/**\n* NodeStatus is information about the current status of a node.\n*/\nclass V1NodeStatus {\n static getAttributeTypeMap() {\n return V1NodeStatus.attributeTypeMap;\n }\n}\nexports.V1NodeStatus = V1NodeStatus;\nV1NodeStatus.discriminator = undefined;\nV1NodeStatus.attributeTypeMap = [\n {\n \"name\": \"addresses\",\n \"baseName\": \"addresses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allocatable\",\n \"baseName\": \"allocatable\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"capacity\",\n \"baseName\": \"capacity\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"config\",\n \"baseName\": \"config\",\n \"type\": \"V1NodeConfigStatus\"\n },\n {\n \"name\": \"daemonEndpoints\",\n \"baseName\": \"daemonEndpoints\",\n \"type\": \"V1NodeDaemonEndpoints\"\n },\n {\n \"name\": \"images\",\n \"baseName\": \"images\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nodeInfo\",\n \"baseName\": \"nodeInfo\",\n \"type\": \"V1NodeSystemInfo\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumesAttached\",\n \"baseName\": \"volumesAttached\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumesInUse\",\n \"baseName\": \"volumesInUse\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NodeStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NodeSystemInfo = void 0;\n/**\n* NodeSystemInfo is a set of ids/uuids to uniquely identify the node.\n*/\nclass V1NodeSystemInfo {\n static getAttributeTypeMap() {\n return V1NodeSystemInfo.attributeTypeMap;\n }\n}\nexports.V1NodeSystemInfo = V1NodeSystemInfo;\nV1NodeSystemInfo.discriminator = undefined;\nV1NodeSystemInfo.attributeTypeMap = [\n {\n \"name\": \"architecture\",\n \"baseName\": \"architecture\",\n \"type\": \"string\"\n },\n {\n \"name\": \"bootID\",\n \"baseName\": \"bootID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"containerRuntimeVersion\",\n \"baseName\": \"containerRuntimeVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kernelVersion\",\n \"baseName\": \"kernelVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kubeProxyVersion\",\n \"baseName\": \"kubeProxyVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kubeletVersion\",\n \"baseName\": \"kubeletVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"machineID\",\n \"baseName\": \"machineID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operatingSystem\",\n \"baseName\": \"operatingSystem\",\n \"type\": \"string\"\n },\n {\n \"name\": \"osImage\",\n \"baseName\": \"osImage\",\n \"type\": \"string\"\n },\n {\n \"name\": \"systemUUID\",\n \"baseName\": \"systemUUID\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1NodeSystemInfo.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NonResourceAttributes = void 0;\n/**\n* NonResourceAttributes includes the authorization attributes available for non-resource requests to the Authorizer interface\n*/\nclass V1NonResourceAttributes {\n static getAttributeTypeMap() {\n return V1NonResourceAttributes.attributeTypeMap;\n }\n}\nexports.V1NonResourceAttributes = V1NonResourceAttributes;\nV1NonResourceAttributes.discriminator = undefined;\nV1NonResourceAttributes.attributeTypeMap = [\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n },\n {\n \"name\": \"verb\",\n \"baseName\": \"verb\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1NonResourceAttributes.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1NonResourceRule = void 0;\n/**\n* NonResourceRule holds information that describes a rule for the non-resource\n*/\nclass V1NonResourceRule {\n static getAttributeTypeMap() {\n return V1NonResourceRule.attributeTypeMap;\n }\n}\nexports.V1NonResourceRule = V1NonResourceRule;\nV1NonResourceRule.discriminator = undefined;\nV1NonResourceRule.attributeTypeMap = [\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1NonResourceRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ObjectFieldSelector = void 0;\n/**\n* ObjectFieldSelector selects an APIVersioned field of an object.\n*/\nclass V1ObjectFieldSelector {\n static getAttributeTypeMap() {\n return V1ObjectFieldSelector.attributeTypeMap;\n }\n}\nexports.V1ObjectFieldSelector = V1ObjectFieldSelector;\nV1ObjectFieldSelector.discriminator = undefined;\nV1ObjectFieldSelector.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fieldPath\",\n \"baseName\": \"fieldPath\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ObjectFieldSelector.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ObjectMeta = void 0;\n/**\n* ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.\n*/\nclass V1ObjectMeta {\n static getAttributeTypeMap() {\n return V1ObjectMeta.attributeTypeMap;\n }\n}\nexports.V1ObjectMeta = V1ObjectMeta;\nV1ObjectMeta.discriminator = undefined;\nV1ObjectMeta.attributeTypeMap = [\n {\n \"name\": \"annotations\",\n \"baseName\": \"annotations\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"clusterName\",\n \"baseName\": \"clusterName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"creationTimestamp\",\n \"baseName\": \"creationTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"deletionGracePeriodSeconds\",\n \"baseName\": \"deletionGracePeriodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"deletionTimestamp\",\n \"baseName\": \"deletionTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"finalizers\",\n \"baseName\": \"finalizers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"generateName\",\n \"baseName\": \"generateName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"generation\",\n \"baseName\": \"generation\",\n \"type\": \"number\"\n },\n {\n \"name\": \"labels\",\n \"baseName\": \"labels\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"managedFields\",\n \"baseName\": \"managedFields\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ownerReferences\",\n \"baseName\": \"ownerReferences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selfLink\",\n \"baseName\": \"selfLink\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ObjectMeta.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ObjectReference = void 0;\n/**\n* ObjectReference contains enough information to let you inspect or modify the referred object.\n*/\nclass V1ObjectReference {\n static getAttributeTypeMap() {\n return V1ObjectReference.attributeTypeMap;\n }\n}\nexports.V1ObjectReference = V1ObjectReference;\nV1ObjectReference.discriminator = undefined;\nV1ObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"fieldPath\",\n \"baseName\": \"fieldPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ObjectReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Overhead = void 0;\n/**\n* Overhead structure represents the resource overhead associated with running a pod.\n*/\nclass V1Overhead {\n static getAttributeTypeMap() {\n return V1Overhead.attributeTypeMap;\n }\n}\nexports.V1Overhead = V1Overhead;\nV1Overhead.discriminator = undefined;\nV1Overhead.attributeTypeMap = [\n {\n \"name\": \"podFixed\",\n \"baseName\": \"podFixed\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\n//# sourceMappingURL=v1Overhead.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1OwnerReference = void 0;\n/**\n* OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.\n*/\nclass V1OwnerReference {\n static getAttributeTypeMap() {\n return V1OwnerReference.attributeTypeMap;\n }\n}\nexports.V1OwnerReference = V1OwnerReference;\nV1OwnerReference.discriminator = undefined;\nV1OwnerReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"blockOwnerDeletion\",\n \"baseName\": \"blockOwnerDeletion\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"controller\",\n \"baseName\": \"controller\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1OwnerReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolume = void 0;\n/**\n* PersistentVolume (PV) is a storage resource provisioned by an administrator. It is analogous to a node. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes\n*/\nclass V1PersistentVolume {\n static getAttributeTypeMap() {\n return V1PersistentVolume.attributeTypeMap;\n }\n}\nexports.V1PersistentVolume = V1PersistentVolume;\nV1PersistentVolume.discriminator = undefined;\nV1PersistentVolume.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PersistentVolumeSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1PersistentVolumeStatus\"\n }\n];\n//# sourceMappingURL=v1PersistentVolume.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeClaim = void 0;\n/**\n* PersistentVolumeClaim is a user\\'s request for and claim to a persistent volume\n*/\nclass V1PersistentVolumeClaim {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaim.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeClaim = V1PersistentVolumeClaim;\nV1PersistentVolumeClaim.discriminator = undefined;\nV1PersistentVolumeClaim.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PersistentVolumeClaimSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1PersistentVolumeClaimStatus\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeClaim.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeClaimCondition = void 0;\n/**\n* PersistentVolumeClaimCondition contails details about state of pvc\n*/\nclass V1PersistentVolumeClaimCondition {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimCondition.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeClaimCondition = V1PersistentVolumeClaimCondition;\nV1PersistentVolumeClaimCondition.discriminator = undefined;\nV1PersistentVolumeClaimCondition.attributeTypeMap = [\n {\n \"name\": \"lastProbeTime\",\n \"baseName\": \"lastProbeTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeClaimCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeClaimList = void 0;\n/**\n* PersistentVolumeClaimList is a list of PersistentVolumeClaim items.\n*/\nclass V1PersistentVolumeClaimList {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimList.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeClaimList = V1PersistentVolumeClaimList;\nV1PersistentVolumeClaimList.discriminator = undefined;\nV1PersistentVolumeClaimList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeClaimList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeClaimSpec = void 0;\n/**\n* PersistentVolumeClaimSpec describes the common attributes of storage devices and allows a Source for provider-specific attributes\n*/\nclass V1PersistentVolumeClaimSpec {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimSpec.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeClaimSpec = V1PersistentVolumeClaimSpec;\nV1PersistentVolumeClaimSpec.discriminator = undefined;\nV1PersistentVolumeClaimSpec.attributeTypeMap = [\n {\n \"name\": \"accessModes\",\n \"baseName\": \"accessModes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"dataSource\",\n \"baseName\": \"dataSource\",\n \"type\": \"V1TypedLocalObjectReference\"\n },\n {\n \"name\": \"dataSourceRef\",\n \"baseName\": \"dataSourceRef\",\n \"type\": \"V1TypedLocalObjectReference\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"V1ResourceRequirements\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"storageClassName\",\n \"baseName\": \"storageClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeMode\",\n \"baseName\": \"volumeMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeClaimSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeClaimStatus = void 0;\n/**\n* PersistentVolumeClaimStatus is the current status of a persistent volume claim.\n*/\nclass V1PersistentVolumeClaimStatus {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimStatus.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeClaimStatus = V1PersistentVolumeClaimStatus;\nV1PersistentVolumeClaimStatus.discriminator = undefined;\nV1PersistentVolumeClaimStatus.attributeTypeMap = [\n {\n \"name\": \"accessModes\",\n \"baseName\": \"accessModes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"capacity\",\n \"baseName\": \"capacity\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeClaimStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeClaimTemplate = void 0;\n/**\n* PersistentVolumeClaimTemplate is used to produce PersistentVolumeClaim objects as part of an EphemeralVolumeSource.\n*/\nclass V1PersistentVolumeClaimTemplate {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimTemplate.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeClaimTemplate = V1PersistentVolumeClaimTemplate;\nV1PersistentVolumeClaimTemplate.discriminator = undefined;\nV1PersistentVolumeClaimTemplate.attributeTypeMap = [\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PersistentVolumeClaimSpec\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeClaimTemplate.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeClaimVolumeSource = void 0;\n/**\n* PersistentVolumeClaimVolumeSource references the user\\'s PVC in the same namespace. This volume finds the bound PV and mounts that volume for the pod. A PersistentVolumeClaimVolumeSource is, essentially, a wrapper around another type of volume that is owned by someone else (the system).\n*/\nclass V1PersistentVolumeClaimVolumeSource {\n static getAttributeTypeMap() {\n return V1PersistentVolumeClaimVolumeSource.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeClaimVolumeSource = V1PersistentVolumeClaimVolumeSource;\nV1PersistentVolumeClaimVolumeSource.discriminator = undefined;\nV1PersistentVolumeClaimVolumeSource.attributeTypeMap = [\n {\n \"name\": \"claimName\",\n \"baseName\": \"claimName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeClaimVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeList = void 0;\n/**\n* PersistentVolumeList is a list of PersistentVolume items.\n*/\nclass V1PersistentVolumeList {\n static getAttributeTypeMap() {\n return V1PersistentVolumeList.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeList = V1PersistentVolumeList;\nV1PersistentVolumeList.discriminator = undefined;\nV1PersistentVolumeList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeSpec = void 0;\n/**\n* PersistentVolumeSpec is the specification of a persistent volume.\n*/\nclass V1PersistentVolumeSpec {\n static getAttributeTypeMap() {\n return V1PersistentVolumeSpec.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeSpec = V1PersistentVolumeSpec;\nV1PersistentVolumeSpec.discriminator = undefined;\nV1PersistentVolumeSpec.attributeTypeMap = [\n {\n \"name\": \"accessModes\",\n \"baseName\": \"accessModes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"awsElasticBlockStore\",\n \"baseName\": \"awsElasticBlockStore\",\n \"type\": \"V1AWSElasticBlockStoreVolumeSource\"\n },\n {\n \"name\": \"azureDisk\",\n \"baseName\": \"azureDisk\",\n \"type\": \"V1AzureDiskVolumeSource\"\n },\n {\n \"name\": \"azureFile\",\n \"baseName\": \"azureFile\",\n \"type\": \"V1AzureFilePersistentVolumeSource\"\n },\n {\n \"name\": \"capacity\",\n \"baseName\": \"capacity\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"cephfs\",\n \"baseName\": \"cephfs\",\n \"type\": \"V1CephFSPersistentVolumeSource\"\n },\n {\n \"name\": \"cinder\",\n \"baseName\": \"cinder\",\n \"type\": \"V1CinderPersistentVolumeSource\"\n },\n {\n \"name\": \"claimRef\",\n \"baseName\": \"claimRef\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"csi\",\n \"baseName\": \"csi\",\n \"type\": \"V1CSIPersistentVolumeSource\"\n },\n {\n \"name\": \"fc\",\n \"baseName\": \"fc\",\n \"type\": \"V1FCVolumeSource\"\n },\n {\n \"name\": \"flexVolume\",\n \"baseName\": \"flexVolume\",\n \"type\": \"V1FlexPersistentVolumeSource\"\n },\n {\n \"name\": \"flocker\",\n \"baseName\": \"flocker\",\n \"type\": \"V1FlockerVolumeSource\"\n },\n {\n \"name\": \"gcePersistentDisk\",\n \"baseName\": \"gcePersistentDisk\",\n \"type\": \"V1GCEPersistentDiskVolumeSource\"\n },\n {\n \"name\": \"glusterfs\",\n \"baseName\": \"glusterfs\",\n \"type\": \"V1GlusterfsPersistentVolumeSource\"\n },\n {\n \"name\": \"hostPath\",\n \"baseName\": \"hostPath\",\n \"type\": \"V1HostPathVolumeSource\"\n },\n {\n \"name\": \"iscsi\",\n \"baseName\": \"iscsi\",\n \"type\": \"V1ISCSIPersistentVolumeSource\"\n },\n {\n \"name\": \"local\",\n \"baseName\": \"local\",\n \"type\": \"V1LocalVolumeSource\"\n },\n {\n \"name\": \"mountOptions\",\n \"baseName\": \"mountOptions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nfs\",\n \"baseName\": \"nfs\",\n \"type\": \"V1NFSVolumeSource\"\n },\n {\n \"name\": \"nodeAffinity\",\n \"baseName\": \"nodeAffinity\",\n \"type\": \"V1VolumeNodeAffinity\"\n },\n {\n \"name\": \"persistentVolumeReclaimPolicy\",\n \"baseName\": \"persistentVolumeReclaimPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"photonPersistentDisk\",\n \"baseName\": \"photonPersistentDisk\",\n \"type\": \"V1PhotonPersistentDiskVolumeSource\"\n },\n {\n \"name\": \"portworxVolume\",\n \"baseName\": \"portworxVolume\",\n \"type\": \"V1PortworxVolumeSource\"\n },\n {\n \"name\": \"quobyte\",\n \"baseName\": \"quobyte\",\n \"type\": \"V1QuobyteVolumeSource\"\n },\n {\n \"name\": \"rbd\",\n \"baseName\": \"rbd\",\n \"type\": \"V1RBDPersistentVolumeSource\"\n },\n {\n \"name\": \"scaleIO\",\n \"baseName\": \"scaleIO\",\n \"type\": \"V1ScaleIOPersistentVolumeSource\"\n },\n {\n \"name\": \"storageClassName\",\n \"baseName\": \"storageClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storageos\",\n \"baseName\": \"storageos\",\n \"type\": \"V1StorageOSPersistentVolumeSource\"\n },\n {\n \"name\": \"volumeMode\",\n \"baseName\": \"volumeMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"vsphereVolume\",\n \"baseName\": \"vsphereVolume\",\n \"type\": \"V1VsphereVirtualDiskVolumeSource\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PersistentVolumeStatus = void 0;\n/**\n* PersistentVolumeStatus is the current status of a persistent volume.\n*/\nclass V1PersistentVolumeStatus {\n static getAttributeTypeMap() {\n return V1PersistentVolumeStatus.attributeTypeMap;\n }\n}\nexports.V1PersistentVolumeStatus = V1PersistentVolumeStatus;\nV1PersistentVolumeStatus.discriminator = undefined;\nV1PersistentVolumeStatus.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PersistentVolumeStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PhotonPersistentDiskVolumeSource = void 0;\n/**\n* Represents a Photon Controller persistent disk resource.\n*/\nclass V1PhotonPersistentDiskVolumeSource {\n static getAttributeTypeMap() {\n return V1PhotonPersistentDiskVolumeSource.attributeTypeMap;\n }\n}\nexports.V1PhotonPersistentDiskVolumeSource = V1PhotonPersistentDiskVolumeSource;\nV1PhotonPersistentDiskVolumeSource.discriminator = undefined;\nV1PhotonPersistentDiskVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"pdID\",\n \"baseName\": \"pdID\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PhotonPersistentDiskVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Pod = void 0;\n/**\n* Pod is a collection of containers that can run on a host. This resource is created by clients and scheduled onto hosts.\n*/\nclass V1Pod {\n static getAttributeTypeMap() {\n return V1Pod.attributeTypeMap;\n }\n}\nexports.V1Pod = V1Pod;\nV1Pod.discriminator = undefined;\nV1Pod.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PodSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1PodStatus\"\n }\n];\n//# sourceMappingURL=v1Pod.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodAffinity = void 0;\n/**\n* Pod affinity is a group of inter pod affinity scheduling rules.\n*/\nclass V1PodAffinity {\n static getAttributeTypeMap() {\n return V1PodAffinity.attributeTypeMap;\n }\n}\nexports.V1PodAffinity = V1PodAffinity;\nV1PodAffinity.discriminator = undefined;\nV1PodAffinity.attributeTypeMap = [\n {\n \"name\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1PodAffinity.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodAffinityTerm = void 0;\n/**\n* Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, where co-located is defined as running on a node whose value of the label with key matches that of any node on which a pod of the set of pods is running\n*/\nclass V1PodAffinityTerm {\n static getAttributeTypeMap() {\n return V1PodAffinityTerm.attributeTypeMap;\n }\n}\nexports.V1PodAffinityTerm = V1PodAffinityTerm;\nV1PodAffinityTerm.discriminator = undefined;\nV1PodAffinityTerm.attributeTypeMap = [\n {\n \"name\": \"labelSelector\",\n \"baseName\": \"labelSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"namespaceSelector\",\n \"baseName\": \"namespaceSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"namespaces\",\n \"baseName\": \"namespaces\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"topologyKey\",\n \"baseName\": \"topologyKey\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PodAffinityTerm.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodAntiAffinity = void 0;\n/**\n* Pod anti affinity is a group of inter pod anti affinity scheduling rules.\n*/\nclass V1PodAntiAffinity {\n static getAttributeTypeMap() {\n return V1PodAntiAffinity.attributeTypeMap;\n }\n}\nexports.V1PodAntiAffinity = V1PodAntiAffinity;\nV1PodAntiAffinity.discriminator = undefined;\nV1PodAntiAffinity.attributeTypeMap = [\n {\n \"name\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"preferredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"baseName\": \"requiredDuringSchedulingIgnoredDuringExecution\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1PodAntiAffinity.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodCondition = void 0;\n/**\n* PodCondition contains details for the current condition of this pod.\n*/\nclass V1PodCondition {\n static getAttributeTypeMap() {\n return V1PodCondition.attributeTypeMap;\n }\n}\nexports.V1PodCondition = V1PodCondition;\nV1PodCondition.discriminator = undefined;\nV1PodCondition.attributeTypeMap = [\n {\n \"name\": \"lastProbeTime\",\n \"baseName\": \"lastProbeTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PodCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodDNSConfig = void 0;\n/**\n* PodDNSConfig defines the DNS parameters of a pod in addition to those generated from DNSPolicy.\n*/\nclass V1PodDNSConfig {\n static getAttributeTypeMap() {\n return V1PodDNSConfig.attributeTypeMap;\n }\n}\nexports.V1PodDNSConfig = V1PodDNSConfig;\nV1PodDNSConfig.discriminator = undefined;\nV1PodDNSConfig.attributeTypeMap = [\n {\n \"name\": \"nameservers\",\n \"baseName\": \"nameservers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"options\",\n \"baseName\": \"options\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"searches\",\n \"baseName\": \"searches\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1PodDNSConfig.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodDNSConfigOption = void 0;\n/**\n* PodDNSConfigOption defines DNS resolver options of a pod.\n*/\nclass V1PodDNSConfigOption {\n static getAttributeTypeMap() {\n return V1PodDNSConfigOption.attributeTypeMap;\n }\n}\nexports.V1PodDNSConfigOption = V1PodDNSConfigOption;\nV1PodDNSConfigOption.discriminator = undefined;\nV1PodDNSConfigOption.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PodDNSConfigOption.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodDisruptionBudget = void 0;\n/**\n* PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods\n*/\nclass V1PodDisruptionBudget {\n static getAttributeTypeMap() {\n return V1PodDisruptionBudget.attributeTypeMap;\n }\n}\nexports.V1PodDisruptionBudget = V1PodDisruptionBudget;\nV1PodDisruptionBudget.discriminator = undefined;\nV1PodDisruptionBudget.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PodDisruptionBudgetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1PodDisruptionBudgetStatus\"\n }\n];\n//# sourceMappingURL=v1PodDisruptionBudget.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodDisruptionBudgetList = void 0;\n/**\n* PodDisruptionBudgetList is a collection of PodDisruptionBudgets.\n*/\nclass V1PodDisruptionBudgetList {\n static getAttributeTypeMap() {\n return V1PodDisruptionBudgetList.attributeTypeMap;\n }\n}\nexports.V1PodDisruptionBudgetList = V1PodDisruptionBudgetList;\nV1PodDisruptionBudgetList.discriminator = undefined;\nV1PodDisruptionBudgetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1PodDisruptionBudgetList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodDisruptionBudgetSpec = void 0;\n/**\n* PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.\n*/\nclass V1PodDisruptionBudgetSpec {\n static getAttributeTypeMap() {\n return V1PodDisruptionBudgetSpec.attributeTypeMap;\n }\n}\nexports.V1PodDisruptionBudgetSpec = V1PodDisruptionBudgetSpec;\nV1PodDisruptionBudgetSpec.discriminator = undefined;\nV1PodDisruptionBudgetSpec.attributeTypeMap = [\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"IntOrString\"\n },\n {\n \"name\": \"minAvailable\",\n \"baseName\": \"minAvailable\",\n \"type\": \"IntOrString\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n }\n];\n//# sourceMappingURL=v1PodDisruptionBudgetSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodDisruptionBudgetStatus = void 0;\n/**\n* PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.\n*/\nclass V1PodDisruptionBudgetStatus {\n static getAttributeTypeMap() {\n return V1PodDisruptionBudgetStatus.attributeTypeMap;\n }\n}\nexports.V1PodDisruptionBudgetStatus = V1PodDisruptionBudgetStatus;\nV1PodDisruptionBudgetStatus.discriminator = undefined;\nV1PodDisruptionBudgetStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentHealthy\",\n \"baseName\": \"currentHealthy\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredHealthy\",\n \"baseName\": \"desiredHealthy\",\n \"type\": \"number\"\n },\n {\n \"name\": \"disruptedPods\",\n \"baseName\": \"disruptedPods\",\n \"type\": \"{ [key: string]: Date; }\"\n },\n {\n \"name\": \"disruptionsAllowed\",\n \"baseName\": \"disruptionsAllowed\",\n \"type\": \"number\"\n },\n {\n \"name\": \"expectedPods\",\n \"baseName\": \"expectedPods\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1PodDisruptionBudgetStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodIP = void 0;\n/**\n* IP address information for entries in the (plural) PodIPs field. Each entry includes: IP: An IP address allocated to the pod. Routable at least within the cluster.\n*/\nclass V1PodIP {\n static getAttributeTypeMap() {\n return V1PodIP.attributeTypeMap;\n }\n}\nexports.V1PodIP = V1PodIP;\nV1PodIP.discriminator = undefined;\nV1PodIP.attributeTypeMap = [\n {\n \"name\": \"ip\",\n \"baseName\": \"ip\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PodIP.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodList = void 0;\n/**\n* PodList is a list of Pods.\n*/\nclass V1PodList {\n static getAttributeTypeMap() {\n return V1PodList.attributeTypeMap;\n }\n}\nexports.V1PodList = V1PodList;\nV1PodList.discriminator = undefined;\nV1PodList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1PodList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodReadinessGate = void 0;\n/**\n* PodReadinessGate contains the reference to a pod condition\n*/\nclass V1PodReadinessGate {\n static getAttributeTypeMap() {\n return V1PodReadinessGate.attributeTypeMap;\n }\n}\nexports.V1PodReadinessGate = V1PodReadinessGate;\nV1PodReadinessGate.discriminator = undefined;\nV1PodReadinessGate.attributeTypeMap = [\n {\n \"name\": \"conditionType\",\n \"baseName\": \"conditionType\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PodReadinessGate.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodSecurityContext = void 0;\n/**\n* PodSecurityContext holds pod-level security attributes and common container settings. Some fields are also present in container.securityContext. Field values of container.securityContext take precedence over field values of PodSecurityContext.\n*/\nclass V1PodSecurityContext {\n static getAttributeTypeMap() {\n return V1PodSecurityContext.attributeTypeMap;\n }\n}\nexports.V1PodSecurityContext = V1PodSecurityContext;\nV1PodSecurityContext.discriminator = undefined;\nV1PodSecurityContext.attributeTypeMap = [\n {\n \"name\": \"fsGroup\",\n \"baseName\": \"fsGroup\",\n \"type\": \"number\"\n },\n {\n \"name\": \"fsGroupChangePolicy\",\n \"baseName\": \"fsGroupChangePolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"runAsGroup\",\n \"baseName\": \"runAsGroup\",\n \"type\": \"number\"\n },\n {\n \"name\": \"runAsNonRoot\",\n \"baseName\": \"runAsNonRoot\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"runAsUser\",\n \"baseName\": \"runAsUser\",\n \"type\": \"number\"\n },\n {\n \"name\": \"seLinuxOptions\",\n \"baseName\": \"seLinuxOptions\",\n \"type\": \"V1SELinuxOptions\"\n },\n {\n \"name\": \"seccompProfile\",\n \"baseName\": \"seccompProfile\",\n \"type\": \"V1SeccompProfile\"\n },\n {\n \"name\": \"supplementalGroups\",\n \"baseName\": \"supplementalGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"sysctls\",\n \"baseName\": \"sysctls\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"windowsOptions\",\n \"baseName\": \"windowsOptions\",\n \"type\": \"V1WindowsSecurityContextOptions\"\n }\n];\n//# sourceMappingURL=v1PodSecurityContext.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodSpec = void 0;\n/**\n* PodSpec is a description of a pod.\n*/\nclass V1PodSpec {\n static getAttributeTypeMap() {\n return V1PodSpec.attributeTypeMap;\n }\n}\nexports.V1PodSpec = V1PodSpec;\nV1PodSpec.discriminator = undefined;\nV1PodSpec.attributeTypeMap = [\n {\n \"name\": \"activeDeadlineSeconds\",\n \"baseName\": \"activeDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"affinity\",\n \"baseName\": \"affinity\",\n \"type\": \"V1Affinity\"\n },\n {\n \"name\": \"automountServiceAccountToken\",\n \"baseName\": \"automountServiceAccountToken\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"containers\",\n \"baseName\": \"containers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"dnsConfig\",\n \"baseName\": \"dnsConfig\",\n \"type\": \"V1PodDNSConfig\"\n },\n {\n \"name\": \"dnsPolicy\",\n \"baseName\": \"dnsPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"enableServiceLinks\",\n \"baseName\": \"enableServiceLinks\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"ephemeralContainers\",\n \"baseName\": \"ephemeralContainers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"hostAliases\",\n \"baseName\": \"hostAliases\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"hostIPC\",\n \"baseName\": \"hostIPC\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostNetwork\",\n \"baseName\": \"hostNetwork\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostPID\",\n \"baseName\": \"hostPID\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostname\",\n \"baseName\": \"hostname\",\n \"type\": \"string\"\n },\n {\n \"name\": \"imagePullSecrets\",\n \"baseName\": \"imagePullSecrets\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"initContainers\",\n \"baseName\": \"initContainers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeSelector\",\n \"baseName\": \"nodeSelector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"overhead\",\n \"baseName\": \"overhead\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"preemptionPolicy\",\n \"baseName\": \"preemptionPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"priority\",\n \"baseName\": \"priority\",\n \"type\": \"number\"\n },\n {\n \"name\": \"priorityClassName\",\n \"baseName\": \"priorityClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readinessGates\",\n \"baseName\": \"readinessGates\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"restartPolicy\",\n \"baseName\": \"restartPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"runtimeClassName\",\n \"baseName\": \"runtimeClassName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"schedulerName\",\n \"baseName\": \"schedulerName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"securityContext\",\n \"baseName\": \"securityContext\",\n \"type\": \"V1PodSecurityContext\"\n },\n {\n \"name\": \"serviceAccount\",\n \"baseName\": \"serviceAccount\",\n \"type\": \"string\"\n },\n {\n \"name\": \"serviceAccountName\",\n \"baseName\": \"serviceAccountName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"setHostnameAsFQDN\",\n \"baseName\": \"setHostnameAsFQDN\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"shareProcessNamespace\",\n \"baseName\": \"shareProcessNamespace\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"subdomain\",\n \"baseName\": \"subdomain\",\n \"type\": \"string\"\n },\n {\n \"name\": \"terminationGracePeriodSeconds\",\n \"baseName\": \"terminationGracePeriodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"tolerations\",\n \"baseName\": \"tolerations\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"topologySpreadConstraints\",\n \"baseName\": \"topologySpreadConstraints\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"volumes\",\n \"baseName\": \"volumes\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1PodSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodStatus = void 0;\n/**\n* PodStatus represents information about the status of a pod. Status may trail the actual state of a system, especially if the node that hosts the pod cannot contact the control plane.\n*/\nclass V1PodStatus {\n static getAttributeTypeMap() {\n return V1PodStatus.attributeTypeMap;\n }\n}\nexports.V1PodStatus = V1PodStatus;\nV1PodStatus.discriminator = undefined;\nV1PodStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"containerStatuses\",\n \"baseName\": \"containerStatuses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ephemeralContainerStatuses\",\n \"baseName\": \"ephemeralContainerStatuses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"hostIP\",\n \"baseName\": \"hostIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"initContainerStatuses\",\n \"baseName\": \"initContainerStatuses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nominatedNodeName\",\n \"baseName\": \"nominatedNodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"phase\",\n \"baseName\": \"phase\",\n \"type\": \"string\"\n },\n {\n \"name\": \"podIP\",\n \"baseName\": \"podIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"podIPs\",\n \"baseName\": \"podIPs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"qosClass\",\n \"baseName\": \"qosClass\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"startTime\",\n \"baseName\": \"startTime\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1PodStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodTemplate = void 0;\n/**\n* PodTemplate describes a template for creating copies of a predefined pod.\n*/\nclass V1PodTemplate {\n static getAttributeTypeMap() {\n return V1PodTemplate.attributeTypeMap;\n }\n}\nexports.V1PodTemplate = V1PodTemplate;\nV1PodTemplate.discriminator = undefined;\nV1PodTemplate.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\n//# sourceMappingURL=v1PodTemplate.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodTemplateList = void 0;\n/**\n* PodTemplateList is a list of PodTemplates.\n*/\nclass V1PodTemplateList {\n static getAttributeTypeMap() {\n return V1PodTemplateList.attributeTypeMap;\n }\n}\nexports.V1PodTemplateList = V1PodTemplateList;\nV1PodTemplateList.discriminator = undefined;\nV1PodTemplateList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1PodTemplateList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PodTemplateSpec = void 0;\n/**\n* PodTemplateSpec describes the data a pod should have when created from a template\n*/\nclass V1PodTemplateSpec {\n static getAttributeTypeMap() {\n return V1PodTemplateSpec.attributeTypeMap;\n }\n}\nexports.V1PodTemplateSpec = V1PodTemplateSpec;\nV1PodTemplateSpec.discriminator = undefined;\nV1PodTemplateSpec.attributeTypeMap = [\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1PodSpec\"\n }\n];\n//# sourceMappingURL=v1PodTemplateSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PolicyRule = void 0;\n/**\n* PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.\n*/\nclass V1PolicyRule {\n static getAttributeTypeMap() {\n return V1PolicyRule.attributeTypeMap;\n }\n}\nexports.V1PolicyRule = V1PolicyRule;\nV1PolicyRule.discriminator = undefined;\nV1PolicyRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceNames\",\n \"baseName\": \"resourceNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1PolicyRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PortStatus = void 0;\nclass V1PortStatus {\n static getAttributeTypeMap() {\n return V1PortStatus.attributeTypeMap;\n }\n}\nexports.V1PortStatus = V1PortStatus;\nV1PortStatus.discriminator = undefined;\nV1PortStatus.attributeTypeMap = [\n {\n \"name\": \"error\",\n \"baseName\": \"error\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PortStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PortworxVolumeSource = void 0;\n/**\n* PortworxVolumeSource represents a Portworx volume resource.\n*/\nclass V1PortworxVolumeSource {\n static getAttributeTypeMap() {\n return V1PortworxVolumeSource.attributeTypeMap;\n }\n}\nexports.V1PortworxVolumeSource = V1PortworxVolumeSource;\nV1PortworxVolumeSource.discriminator = undefined;\nV1PortworxVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"volumeID\",\n \"baseName\": \"volumeID\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1PortworxVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Preconditions = void 0;\n/**\n* Preconditions must be fulfilled before an operation (update, delete, etc.) is carried out.\n*/\nclass V1Preconditions {\n static getAttributeTypeMap() {\n return V1Preconditions.attributeTypeMap;\n }\n}\nexports.V1Preconditions = V1Preconditions;\nV1Preconditions.discriminator = undefined;\nV1Preconditions.attributeTypeMap = [\n {\n \"name\": \"resourceVersion\",\n \"baseName\": \"resourceVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Preconditions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PreferredSchedulingTerm = void 0;\n/**\n* An empty preferred scheduling term matches all objects with implicit weight 0 (i.e. it\\'s a no-op). A null preferred scheduling term matches no objects (i.e. is also a no-op).\n*/\nclass V1PreferredSchedulingTerm {\n static getAttributeTypeMap() {\n return V1PreferredSchedulingTerm.attributeTypeMap;\n }\n}\nexports.V1PreferredSchedulingTerm = V1PreferredSchedulingTerm;\nV1PreferredSchedulingTerm.discriminator = undefined;\nV1PreferredSchedulingTerm.attributeTypeMap = [\n {\n \"name\": \"preference\",\n \"baseName\": \"preference\",\n \"type\": \"V1NodeSelectorTerm\"\n },\n {\n \"name\": \"weight\",\n \"baseName\": \"weight\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1PreferredSchedulingTerm.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PriorityClass = void 0;\n/**\n* PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.\n*/\nclass V1PriorityClass {\n static getAttributeTypeMap() {\n return V1PriorityClass.attributeTypeMap;\n }\n}\nexports.V1PriorityClass = V1PriorityClass;\nV1PriorityClass.discriminator = undefined;\nV1PriorityClass.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"globalDefault\",\n \"baseName\": \"globalDefault\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"preemptionPolicy\",\n \"baseName\": \"preemptionPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1PriorityClass.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1PriorityClassList = void 0;\n/**\n* PriorityClassList is a collection of priority classes.\n*/\nclass V1PriorityClassList {\n static getAttributeTypeMap() {\n return V1PriorityClassList.attributeTypeMap;\n }\n}\nexports.V1PriorityClassList = V1PriorityClassList;\nV1PriorityClassList.discriminator = undefined;\nV1PriorityClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1PriorityClassList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Probe = void 0;\n/**\n* Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.\n*/\nclass V1Probe {\n static getAttributeTypeMap() {\n return V1Probe.attributeTypeMap;\n }\n}\nexports.V1Probe = V1Probe;\nV1Probe.discriminator = undefined;\nV1Probe.attributeTypeMap = [\n {\n \"name\": \"exec\",\n \"baseName\": \"exec\",\n \"type\": \"V1ExecAction\"\n },\n {\n \"name\": \"failureThreshold\",\n \"baseName\": \"failureThreshold\",\n \"type\": \"number\"\n },\n {\n \"name\": \"httpGet\",\n \"baseName\": \"httpGet\",\n \"type\": \"V1HTTPGetAction\"\n },\n {\n \"name\": \"initialDelaySeconds\",\n \"baseName\": \"initialDelaySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"periodSeconds\",\n \"baseName\": \"periodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"successThreshold\",\n \"baseName\": \"successThreshold\",\n \"type\": \"number\"\n },\n {\n \"name\": \"tcpSocket\",\n \"baseName\": \"tcpSocket\",\n \"type\": \"V1TCPSocketAction\"\n },\n {\n \"name\": \"terminationGracePeriodSeconds\",\n \"baseName\": \"terminationGracePeriodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"timeoutSeconds\",\n \"baseName\": \"timeoutSeconds\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1Probe.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ProjectedVolumeSource = void 0;\n/**\n* Represents a projected volume source\n*/\nclass V1ProjectedVolumeSource {\n static getAttributeTypeMap() {\n return V1ProjectedVolumeSource.attributeTypeMap;\n }\n}\nexports.V1ProjectedVolumeSource = V1ProjectedVolumeSource;\nV1ProjectedVolumeSource.discriminator = undefined;\nV1ProjectedVolumeSource.attributeTypeMap = [\n {\n \"name\": \"defaultMode\",\n \"baseName\": \"defaultMode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"sources\",\n \"baseName\": \"sources\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ProjectedVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1QuobyteVolumeSource = void 0;\n/**\n* Represents a Quobyte mount that lasts the lifetime of a pod. Quobyte volumes do not support ownership management or SELinux relabeling.\n*/\nclass V1QuobyteVolumeSource {\n static getAttributeTypeMap() {\n return V1QuobyteVolumeSource.attributeTypeMap;\n }\n}\nexports.V1QuobyteVolumeSource = V1QuobyteVolumeSource;\nV1QuobyteVolumeSource.discriminator = undefined;\nV1QuobyteVolumeSource.attributeTypeMap = [\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"registry\",\n \"baseName\": \"registry\",\n \"type\": \"string\"\n },\n {\n \"name\": \"tenant\",\n \"baseName\": \"tenant\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volume\",\n \"baseName\": \"volume\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1QuobyteVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RBDPersistentVolumeSource = void 0;\n/**\n* Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.\n*/\nclass V1RBDPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1RBDPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1RBDPersistentVolumeSource = V1RBDPersistentVolumeSource;\nV1RBDPersistentVolumeSource.discriminator = undefined;\nV1RBDPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"keyring\",\n \"baseName\": \"keyring\",\n \"type\": \"string\"\n },\n {\n \"name\": \"monitors\",\n \"baseName\": \"monitors\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"pool\",\n \"baseName\": \"pool\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1RBDPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RBDVolumeSource = void 0;\n/**\n* Represents a Rados Block Device mount that lasts the lifetime of a pod. RBD volumes support ownership management and SELinux relabeling.\n*/\nclass V1RBDVolumeSource {\n static getAttributeTypeMap() {\n return V1RBDVolumeSource.attributeTypeMap;\n }\n}\nexports.V1RBDVolumeSource = V1RBDVolumeSource;\nV1RBDVolumeSource.discriminator = undefined;\nV1RBDVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"image\",\n \"baseName\": \"image\",\n \"type\": \"string\"\n },\n {\n \"name\": \"keyring\",\n \"baseName\": \"keyring\",\n \"type\": \"string\"\n },\n {\n \"name\": \"monitors\",\n \"baseName\": \"monitors\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"pool\",\n \"baseName\": \"pool\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1RBDVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicaSet = void 0;\n/**\n* ReplicaSet ensures that a specified number of pod replicas are running at any given time.\n*/\nclass V1ReplicaSet {\n static getAttributeTypeMap() {\n return V1ReplicaSet.attributeTypeMap;\n }\n}\nexports.V1ReplicaSet = V1ReplicaSet;\nV1ReplicaSet.discriminator = undefined;\nV1ReplicaSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ReplicaSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ReplicaSetStatus\"\n }\n];\n//# sourceMappingURL=v1ReplicaSet.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicaSetCondition = void 0;\n/**\n* ReplicaSetCondition describes the state of a replica set at a certain point.\n*/\nclass V1ReplicaSetCondition {\n static getAttributeTypeMap() {\n return V1ReplicaSetCondition.attributeTypeMap;\n }\n}\nexports.V1ReplicaSetCondition = V1ReplicaSetCondition;\nV1ReplicaSetCondition.discriminator = undefined;\nV1ReplicaSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ReplicaSetCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicaSetList = void 0;\n/**\n* ReplicaSetList is a collection of ReplicaSets.\n*/\nclass V1ReplicaSetList {\n static getAttributeTypeMap() {\n return V1ReplicaSetList.attributeTypeMap;\n }\n}\nexports.V1ReplicaSetList = V1ReplicaSetList;\nV1ReplicaSetList.discriminator = undefined;\nV1ReplicaSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ReplicaSetList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicaSetSpec = void 0;\n/**\n* ReplicaSetSpec is the specification of a ReplicaSet.\n*/\nclass V1ReplicaSetSpec {\n static getAttributeTypeMap() {\n return V1ReplicaSetSpec.attributeTypeMap;\n }\n}\nexports.V1ReplicaSetSpec = V1ReplicaSetSpec;\nV1ReplicaSetSpec.discriminator = undefined;\nV1ReplicaSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\n//# sourceMappingURL=v1ReplicaSetSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicaSetStatus = void 0;\n/**\n* ReplicaSetStatus represents the current status of a ReplicaSet.\n*/\nclass V1ReplicaSetStatus {\n static getAttributeTypeMap() {\n return V1ReplicaSetStatus.attributeTypeMap;\n }\n}\nexports.V1ReplicaSetStatus = V1ReplicaSetStatus;\nV1ReplicaSetStatus.discriminator = undefined;\nV1ReplicaSetStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fullyLabeledReplicas\",\n \"baseName\": \"fullyLabeledReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1ReplicaSetStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicationController = void 0;\n/**\n* ReplicationController represents the configuration of a replication controller.\n*/\nclass V1ReplicationController {\n static getAttributeTypeMap() {\n return V1ReplicationController.attributeTypeMap;\n }\n}\nexports.V1ReplicationController = V1ReplicationController;\nV1ReplicationController.discriminator = undefined;\nV1ReplicationController.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ReplicationControllerSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ReplicationControllerStatus\"\n }\n];\n//# sourceMappingURL=v1ReplicationController.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicationControllerCondition = void 0;\n/**\n* ReplicationControllerCondition describes the state of a replication controller at a certain point.\n*/\nclass V1ReplicationControllerCondition {\n static getAttributeTypeMap() {\n return V1ReplicationControllerCondition.attributeTypeMap;\n }\n}\nexports.V1ReplicationControllerCondition = V1ReplicationControllerCondition;\nV1ReplicationControllerCondition.discriminator = undefined;\nV1ReplicationControllerCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ReplicationControllerCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicationControllerList = void 0;\n/**\n* ReplicationControllerList is a collection of replication controllers.\n*/\nclass V1ReplicationControllerList {\n static getAttributeTypeMap() {\n return V1ReplicationControllerList.attributeTypeMap;\n }\n}\nexports.V1ReplicationControllerList = V1ReplicationControllerList;\nV1ReplicationControllerList.discriminator = undefined;\nV1ReplicationControllerList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ReplicationControllerList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicationControllerSpec = void 0;\n/**\n* ReplicationControllerSpec is the specification of a replication controller.\n*/\nclass V1ReplicationControllerSpec {\n static getAttributeTypeMap() {\n return V1ReplicationControllerSpec.attributeTypeMap;\n }\n}\nexports.V1ReplicationControllerSpec = V1ReplicationControllerSpec;\nV1ReplicationControllerSpec.discriminator = undefined;\nV1ReplicationControllerSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n }\n];\n//# sourceMappingURL=v1ReplicationControllerSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ReplicationControllerStatus = void 0;\n/**\n* ReplicationControllerStatus represents the current status of a replication controller.\n*/\nclass V1ReplicationControllerStatus {\n static getAttributeTypeMap() {\n return V1ReplicationControllerStatus.attributeTypeMap;\n }\n}\nexports.V1ReplicationControllerStatus = V1ReplicationControllerStatus;\nV1ReplicationControllerStatus.discriminator = undefined;\nV1ReplicationControllerStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fullyLabeledReplicas\",\n \"baseName\": \"fullyLabeledReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1ReplicationControllerStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ResourceAttributes = void 0;\n/**\n* ResourceAttributes includes the authorization attributes available for resource requests to the Authorizer interface\n*/\nclass V1ResourceAttributes {\n static getAttributeTypeMap() {\n return V1ResourceAttributes.attributeTypeMap;\n }\n}\nexports.V1ResourceAttributes = V1ResourceAttributes;\nV1ResourceAttributes.discriminator = undefined;\nV1ResourceAttributes.attributeTypeMap = [\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"string\"\n },\n {\n \"name\": \"subresource\",\n \"baseName\": \"subresource\",\n \"type\": \"string\"\n },\n {\n \"name\": \"verb\",\n \"baseName\": \"verb\",\n \"type\": \"string\"\n },\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ResourceAttributes.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ResourceFieldSelector = void 0;\n/**\n* ResourceFieldSelector represents container resources (cpu, memory) and their output format\n*/\nclass V1ResourceFieldSelector {\n static getAttributeTypeMap() {\n return V1ResourceFieldSelector.attributeTypeMap;\n }\n}\nexports.V1ResourceFieldSelector = V1ResourceFieldSelector;\nV1ResourceFieldSelector.discriminator = undefined;\nV1ResourceFieldSelector.attributeTypeMap = [\n {\n \"name\": \"containerName\",\n \"baseName\": \"containerName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"divisor\",\n \"baseName\": \"divisor\",\n \"type\": \"string\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ResourceFieldSelector.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ResourceQuota = void 0;\n/**\n* ResourceQuota sets aggregate quota restrictions enforced per namespace\n*/\nclass V1ResourceQuota {\n static getAttributeTypeMap() {\n return V1ResourceQuota.attributeTypeMap;\n }\n}\nexports.V1ResourceQuota = V1ResourceQuota;\nV1ResourceQuota.discriminator = undefined;\nV1ResourceQuota.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ResourceQuotaSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ResourceQuotaStatus\"\n }\n];\n//# sourceMappingURL=v1ResourceQuota.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ResourceQuotaList = void 0;\n/**\n* ResourceQuotaList is a list of ResourceQuota items.\n*/\nclass V1ResourceQuotaList {\n static getAttributeTypeMap() {\n return V1ResourceQuotaList.attributeTypeMap;\n }\n}\nexports.V1ResourceQuotaList = V1ResourceQuotaList;\nV1ResourceQuotaList.discriminator = undefined;\nV1ResourceQuotaList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ResourceQuotaList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ResourceQuotaSpec = void 0;\n/**\n* ResourceQuotaSpec defines the desired hard limits to enforce for Quota.\n*/\nclass V1ResourceQuotaSpec {\n static getAttributeTypeMap() {\n return V1ResourceQuotaSpec.attributeTypeMap;\n }\n}\nexports.V1ResourceQuotaSpec = V1ResourceQuotaSpec;\nV1ResourceQuotaSpec.discriminator = undefined;\nV1ResourceQuotaSpec.attributeTypeMap = [\n {\n \"name\": \"hard\",\n \"baseName\": \"hard\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"scopeSelector\",\n \"baseName\": \"scopeSelector\",\n \"type\": \"V1ScopeSelector\"\n },\n {\n \"name\": \"scopes\",\n \"baseName\": \"scopes\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ResourceQuotaSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ResourceQuotaStatus = void 0;\n/**\n* ResourceQuotaStatus defines the enforced hard limits and observed use.\n*/\nclass V1ResourceQuotaStatus {\n static getAttributeTypeMap() {\n return V1ResourceQuotaStatus.attributeTypeMap;\n }\n}\nexports.V1ResourceQuotaStatus = V1ResourceQuotaStatus;\nV1ResourceQuotaStatus.discriminator = undefined;\nV1ResourceQuotaStatus.attributeTypeMap = [\n {\n \"name\": \"hard\",\n \"baseName\": \"hard\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"used\",\n \"baseName\": \"used\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\n//# sourceMappingURL=v1ResourceQuotaStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ResourceRequirements = void 0;\n/**\n* ResourceRequirements describes the compute resource requirements.\n*/\nclass V1ResourceRequirements {\n static getAttributeTypeMap() {\n return V1ResourceRequirements.attributeTypeMap;\n }\n}\nexports.V1ResourceRequirements = V1ResourceRequirements;\nV1ResourceRequirements.discriminator = undefined;\nV1ResourceRequirements.attributeTypeMap = [\n {\n \"name\": \"limits\",\n \"baseName\": \"limits\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"requests\",\n \"baseName\": \"requests\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\n//# sourceMappingURL=v1ResourceRequirements.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ResourceRule = void 0;\n/**\n* ResourceRule is the list of actions the subject is allowed to perform on resources. The list ordering isn\\'t significant, may contain duplicates, and possibly be incomplete.\n*/\nclass V1ResourceRule {\n static getAttributeTypeMap() {\n return V1ResourceRule.attributeTypeMap;\n }\n}\nexports.V1ResourceRule = V1ResourceRule;\nV1ResourceRule.discriminator = undefined;\nV1ResourceRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceNames\",\n \"baseName\": \"resourceNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ResourceRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Role = void 0;\n/**\n* Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding.\n*/\nclass V1Role {\n static getAttributeTypeMap() {\n return V1Role.attributeTypeMap;\n }\n}\nexports.V1Role = V1Role;\nV1Role.discriminator = undefined;\nV1Role.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1Role.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RoleBinding = void 0;\n/**\n* RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace.\n*/\nclass V1RoleBinding {\n static getAttributeTypeMap() {\n return V1RoleBinding.attributeTypeMap;\n }\n}\nexports.V1RoleBinding = V1RoleBinding;\nV1RoleBinding.discriminator = undefined;\nV1RoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1RoleBinding.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RoleBindingList = void 0;\n/**\n* RoleBindingList is a collection of RoleBindings\n*/\nclass V1RoleBindingList {\n static getAttributeTypeMap() {\n return V1RoleBindingList.attributeTypeMap;\n }\n}\nexports.V1RoleBindingList = V1RoleBindingList;\nV1RoleBindingList.discriminator = undefined;\nV1RoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1RoleBindingList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RoleList = void 0;\n/**\n* RoleList is a collection of Roles\n*/\nclass V1RoleList {\n static getAttributeTypeMap() {\n return V1RoleList.attributeTypeMap;\n }\n}\nexports.V1RoleList = V1RoleList;\nV1RoleList.discriminator = undefined;\nV1RoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1RoleList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RoleRef = void 0;\n/**\n* RoleRef contains information that points to the role being used\n*/\nclass V1RoleRef {\n static getAttributeTypeMap() {\n return V1RoleRef.attributeTypeMap;\n }\n}\nexports.V1RoleRef = V1RoleRef;\nV1RoleRef.discriminator = undefined;\nV1RoleRef.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1RoleRef.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RollingUpdateDaemonSet = void 0;\n/**\n* Spec to control the desired behavior of daemon set rolling update.\n*/\nclass V1RollingUpdateDaemonSet {\n static getAttributeTypeMap() {\n return V1RollingUpdateDaemonSet.attributeTypeMap;\n }\n}\nexports.V1RollingUpdateDaemonSet = V1RollingUpdateDaemonSet;\nV1RollingUpdateDaemonSet.discriminator = undefined;\nV1RollingUpdateDaemonSet.attributeTypeMap = [\n {\n \"name\": \"maxSurge\",\n \"baseName\": \"maxSurge\",\n \"type\": \"IntOrString\"\n },\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"IntOrString\"\n }\n];\n//# sourceMappingURL=v1RollingUpdateDaemonSet.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RollingUpdateDeployment = void 0;\n/**\n* Spec to control the desired behavior of rolling update.\n*/\nclass V1RollingUpdateDeployment {\n static getAttributeTypeMap() {\n return V1RollingUpdateDeployment.attributeTypeMap;\n }\n}\nexports.V1RollingUpdateDeployment = V1RollingUpdateDeployment;\nV1RollingUpdateDeployment.discriminator = undefined;\nV1RollingUpdateDeployment.attributeTypeMap = [\n {\n \"name\": \"maxSurge\",\n \"baseName\": \"maxSurge\",\n \"type\": \"IntOrString\"\n },\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"IntOrString\"\n }\n];\n//# sourceMappingURL=v1RollingUpdateDeployment.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RollingUpdateStatefulSetStrategy = void 0;\n/**\n* RollingUpdateStatefulSetStrategy is used to communicate parameter for RollingUpdateStatefulSetStrategyType.\n*/\nclass V1RollingUpdateStatefulSetStrategy {\n static getAttributeTypeMap() {\n return V1RollingUpdateStatefulSetStrategy.attributeTypeMap;\n }\n}\nexports.V1RollingUpdateStatefulSetStrategy = V1RollingUpdateStatefulSetStrategy;\nV1RollingUpdateStatefulSetStrategy.discriminator = undefined;\nV1RollingUpdateStatefulSetStrategy.attributeTypeMap = [\n {\n \"name\": \"partition\",\n \"baseName\": \"partition\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1RollingUpdateStatefulSetStrategy.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RuleWithOperations = void 0;\n/**\n* RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid.\n*/\nclass V1RuleWithOperations {\n static getAttributeTypeMap() {\n return V1RuleWithOperations.attributeTypeMap;\n }\n}\nexports.V1RuleWithOperations = V1RuleWithOperations;\nV1RuleWithOperations.discriminator = undefined;\nV1RuleWithOperations.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"apiVersions\",\n \"baseName\": \"apiVersions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"operations\",\n \"baseName\": \"operations\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"scope\",\n \"baseName\": \"scope\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1RuleWithOperations.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RuntimeClass = void 0;\n/**\n* RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://kubernetes.io/docs/concepts/containers/runtime-class/\n*/\nclass V1RuntimeClass {\n static getAttributeTypeMap() {\n return V1RuntimeClass.attributeTypeMap;\n }\n}\nexports.V1RuntimeClass = V1RuntimeClass;\nV1RuntimeClass.discriminator = undefined;\nV1RuntimeClass.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"handler\",\n \"baseName\": \"handler\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"overhead\",\n \"baseName\": \"overhead\",\n \"type\": \"V1Overhead\"\n },\n {\n \"name\": \"scheduling\",\n \"baseName\": \"scheduling\",\n \"type\": \"V1Scheduling\"\n }\n];\n//# sourceMappingURL=v1RuntimeClass.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1RuntimeClassList = void 0;\n/**\n* RuntimeClassList is a list of RuntimeClass objects.\n*/\nclass V1RuntimeClassList {\n static getAttributeTypeMap() {\n return V1RuntimeClassList.attributeTypeMap;\n }\n}\nexports.V1RuntimeClassList = V1RuntimeClassList;\nV1RuntimeClassList.discriminator = undefined;\nV1RuntimeClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1RuntimeClassList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SELinuxOptions = void 0;\n/**\n* SELinuxOptions are the labels to be applied to the container\n*/\nclass V1SELinuxOptions {\n static getAttributeTypeMap() {\n return V1SELinuxOptions.attributeTypeMap;\n }\n}\nexports.V1SELinuxOptions = V1SELinuxOptions;\nV1SELinuxOptions.discriminator = undefined;\nV1SELinuxOptions.attributeTypeMap = [\n {\n \"name\": \"level\",\n \"baseName\": \"level\",\n \"type\": \"string\"\n },\n {\n \"name\": \"role\",\n \"baseName\": \"role\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1SELinuxOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Scale = void 0;\n/**\n* Scale represents a scaling request for a resource.\n*/\nclass V1Scale {\n static getAttributeTypeMap() {\n return V1Scale.attributeTypeMap;\n }\n}\nexports.V1Scale = V1Scale;\nV1Scale.discriminator = undefined;\nV1Scale.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ScaleSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ScaleStatus\"\n }\n];\n//# sourceMappingURL=v1Scale.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ScaleIOPersistentVolumeSource = void 0;\n/**\n* ScaleIOPersistentVolumeSource represents a persistent ScaleIO volume\n*/\nclass V1ScaleIOPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1ScaleIOPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1ScaleIOPersistentVolumeSource = V1ScaleIOPersistentVolumeSource;\nV1ScaleIOPersistentVolumeSource.discriminator = undefined;\nV1ScaleIOPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gateway\",\n \"baseName\": \"gateway\",\n \"type\": \"string\"\n },\n {\n \"name\": \"protectionDomain\",\n \"baseName\": \"protectionDomain\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1SecretReference\"\n },\n {\n \"name\": \"sslEnabled\",\n \"baseName\": \"sslEnabled\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"storageMode\",\n \"baseName\": \"storageMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storagePool\",\n \"baseName\": \"storagePool\",\n \"type\": \"string\"\n },\n {\n \"name\": \"system\",\n \"baseName\": \"system\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ScaleIOPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ScaleIOVolumeSource = void 0;\n/**\n* ScaleIOVolumeSource represents a persistent ScaleIO volume\n*/\nclass V1ScaleIOVolumeSource {\n static getAttributeTypeMap() {\n return V1ScaleIOVolumeSource.attributeTypeMap;\n }\n}\nexports.V1ScaleIOVolumeSource = V1ScaleIOVolumeSource;\nV1ScaleIOVolumeSource.discriminator = undefined;\nV1ScaleIOVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gateway\",\n \"baseName\": \"gateway\",\n \"type\": \"string\"\n },\n {\n \"name\": \"protectionDomain\",\n \"baseName\": \"protectionDomain\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"sslEnabled\",\n \"baseName\": \"sslEnabled\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"storageMode\",\n \"baseName\": \"storageMode\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storagePool\",\n \"baseName\": \"storagePool\",\n \"type\": \"string\"\n },\n {\n \"name\": \"system\",\n \"baseName\": \"system\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ScaleIOVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ScaleSpec = void 0;\n/**\n* ScaleSpec describes the attributes of a scale subresource.\n*/\nclass V1ScaleSpec {\n static getAttributeTypeMap() {\n return V1ScaleSpec.attributeTypeMap;\n }\n}\nexports.V1ScaleSpec = V1ScaleSpec;\nV1ScaleSpec.discriminator = undefined;\nV1ScaleSpec.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1ScaleSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ScaleStatus = void 0;\n/**\n* ScaleStatus represents the current status of a scale subresource.\n*/\nclass V1ScaleStatus {\n static getAttributeTypeMap() {\n return V1ScaleStatus.attributeTypeMap;\n }\n}\nexports.V1ScaleStatus = V1ScaleStatus;\nV1ScaleStatus.discriminator = undefined;\nV1ScaleStatus.attributeTypeMap = [\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ScaleStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Scheduling = void 0;\n/**\n* Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.\n*/\nclass V1Scheduling {\n static getAttributeTypeMap() {\n return V1Scheduling.attributeTypeMap;\n }\n}\nexports.V1Scheduling = V1Scheduling;\nV1Scheduling.discriminator = undefined;\nV1Scheduling.attributeTypeMap = [\n {\n \"name\": \"nodeSelector\",\n \"baseName\": \"nodeSelector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"tolerations\",\n \"baseName\": \"tolerations\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1Scheduling.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ScopeSelector = void 0;\n/**\n* A scope selector represents the AND of the selectors represented by the scoped-resource selector requirements.\n*/\nclass V1ScopeSelector {\n static getAttributeTypeMap() {\n return V1ScopeSelector.attributeTypeMap;\n }\n}\nexports.V1ScopeSelector = V1ScopeSelector;\nV1ScopeSelector.discriminator = undefined;\nV1ScopeSelector.attributeTypeMap = [\n {\n \"name\": \"matchExpressions\",\n \"baseName\": \"matchExpressions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ScopeSelector.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ScopedResourceSelectorRequirement = void 0;\n/**\n* A scoped-resource selector requirement is a selector that contains values, a scope name, and an operator that relates the scope name and values.\n*/\nclass V1ScopedResourceSelectorRequirement {\n static getAttributeTypeMap() {\n return V1ScopedResourceSelectorRequirement.attributeTypeMap;\n }\n}\nexports.V1ScopedResourceSelectorRequirement = V1ScopedResourceSelectorRequirement;\nV1ScopedResourceSelectorRequirement.discriminator = undefined;\nV1ScopedResourceSelectorRequirement.attributeTypeMap = [\n {\n \"name\": \"operator\",\n \"baseName\": \"operator\",\n \"type\": \"string\"\n },\n {\n \"name\": \"scopeName\",\n \"baseName\": \"scopeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"values\",\n \"baseName\": \"values\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ScopedResourceSelectorRequirement.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SeccompProfile = void 0;\n/**\n* SeccompProfile defines a pod/container\\'s seccomp profile settings. Only one profile source may be set.\n*/\nclass V1SeccompProfile {\n static getAttributeTypeMap() {\n return V1SeccompProfile.attributeTypeMap;\n }\n}\nexports.V1SeccompProfile = V1SeccompProfile;\nV1SeccompProfile.discriminator = undefined;\nV1SeccompProfile.attributeTypeMap = [\n {\n \"name\": \"localhostProfile\",\n \"baseName\": \"localhostProfile\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1SeccompProfile.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Secret = void 0;\n/**\n* Secret holds secret data of a certain type. The total bytes of the values in the Data field must be less than MaxSecretSize bytes.\n*/\nclass V1Secret {\n static getAttributeTypeMap() {\n return V1Secret.attributeTypeMap;\n }\n}\nexports.V1Secret = V1Secret;\nV1Secret.discriminator = undefined;\nV1Secret.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"data\",\n \"baseName\": \"data\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"immutable\",\n \"baseName\": \"immutable\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"stringData\",\n \"baseName\": \"stringData\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Secret.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SecretEnvSource = void 0;\n/**\n* SecretEnvSource selects a Secret to populate the environment variables with. The contents of the target Secret\\'s Data field will represent the key-value pairs as environment variables.\n*/\nclass V1SecretEnvSource {\n static getAttributeTypeMap() {\n return V1SecretEnvSource.attributeTypeMap;\n }\n}\nexports.V1SecretEnvSource = V1SecretEnvSource;\nV1SecretEnvSource.discriminator = undefined;\nV1SecretEnvSource.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1SecretEnvSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SecretKeySelector = void 0;\n/**\n* SecretKeySelector selects a key of a Secret.\n*/\nclass V1SecretKeySelector {\n static getAttributeTypeMap() {\n return V1SecretKeySelector.attributeTypeMap;\n }\n}\nexports.V1SecretKeySelector = V1SecretKeySelector;\nV1SecretKeySelector.discriminator = undefined;\nV1SecretKeySelector.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1SecretKeySelector.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SecretList = void 0;\n/**\n* SecretList is a list of Secret.\n*/\nclass V1SecretList {\n static getAttributeTypeMap() {\n return V1SecretList.attributeTypeMap;\n }\n}\nexports.V1SecretList = V1SecretList;\nV1SecretList.discriminator = undefined;\nV1SecretList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1SecretList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SecretProjection = void 0;\n/**\n* Adapts a secret into a projected volume. The contents of the target Secret\\'s Data field will be presented in a projected volume as files using the keys in the Data field as the file names. Note that this is identical to a secret volume source without the default mode.\n*/\nclass V1SecretProjection {\n static getAttributeTypeMap() {\n return V1SecretProjection.attributeTypeMap;\n }\n}\nexports.V1SecretProjection = V1SecretProjection;\nV1SecretProjection.discriminator = undefined;\nV1SecretProjection.attributeTypeMap = [\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1SecretProjection.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SecretReference = void 0;\n/**\n* SecretReference represents a Secret Reference. It has enough information to retrieve secret in any namespace\n*/\nclass V1SecretReference {\n static getAttributeTypeMap() {\n return V1SecretReference.attributeTypeMap;\n }\n}\nexports.V1SecretReference = V1SecretReference;\nV1SecretReference.discriminator = undefined;\nV1SecretReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1SecretReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SecretVolumeSource = void 0;\n/**\n* Adapts a Secret into a volume. The contents of the target Secret\\'s Data field will be presented in a volume as files using the keys in the Data field as the file names. Secret volumes support ownership management and SELinux relabeling.\n*/\nclass V1SecretVolumeSource {\n static getAttributeTypeMap() {\n return V1SecretVolumeSource.attributeTypeMap;\n }\n}\nexports.V1SecretVolumeSource = V1SecretVolumeSource;\nV1SecretVolumeSource.discriminator = undefined;\nV1SecretVolumeSource.attributeTypeMap = [\n {\n \"name\": \"defaultMode\",\n \"baseName\": \"defaultMode\",\n \"type\": \"number\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"optional\",\n \"baseName\": \"optional\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretName\",\n \"baseName\": \"secretName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1SecretVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SecurityContext = void 0;\n/**\n* SecurityContext holds security configuration that will be applied to a container. Some fields are present in both SecurityContext and PodSecurityContext. When both are set, the values in SecurityContext take precedence.\n*/\nclass V1SecurityContext {\n static getAttributeTypeMap() {\n return V1SecurityContext.attributeTypeMap;\n }\n}\nexports.V1SecurityContext = V1SecurityContext;\nV1SecurityContext.discriminator = undefined;\nV1SecurityContext.attributeTypeMap = [\n {\n \"name\": \"allowPrivilegeEscalation\",\n \"baseName\": \"allowPrivilegeEscalation\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"capabilities\",\n \"baseName\": \"capabilities\",\n \"type\": \"V1Capabilities\"\n },\n {\n \"name\": \"privileged\",\n \"baseName\": \"privileged\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"procMount\",\n \"baseName\": \"procMount\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnlyRootFilesystem\",\n \"baseName\": \"readOnlyRootFilesystem\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"runAsGroup\",\n \"baseName\": \"runAsGroup\",\n \"type\": \"number\"\n },\n {\n \"name\": \"runAsNonRoot\",\n \"baseName\": \"runAsNonRoot\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"runAsUser\",\n \"baseName\": \"runAsUser\",\n \"type\": \"number\"\n },\n {\n \"name\": \"seLinuxOptions\",\n \"baseName\": \"seLinuxOptions\",\n \"type\": \"V1SELinuxOptions\"\n },\n {\n \"name\": \"seccompProfile\",\n \"baseName\": \"seccompProfile\",\n \"type\": \"V1SeccompProfile\"\n },\n {\n \"name\": \"windowsOptions\",\n \"baseName\": \"windowsOptions\",\n \"type\": \"V1WindowsSecurityContextOptions\"\n }\n];\n//# sourceMappingURL=v1SecurityContext.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SelfSubjectAccessReview = void 0;\n/**\n* SelfSubjectAccessReview checks whether or the current user can perform an action. Not filling in a spec.namespace means \\\"in all namespaces\\\". Self is a special case, because users should always be able to check whether they can perform an action\n*/\nclass V1SelfSubjectAccessReview {\n static getAttributeTypeMap() {\n return V1SelfSubjectAccessReview.attributeTypeMap;\n }\n}\nexports.V1SelfSubjectAccessReview = V1SelfSubjectAccessReview;\nV1SelfSubjectAccessReview.discriminator = undefined;\nV1SelfSubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1SelfSubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1SubjectAccessReviewStatus\"\n }\n];\n//# sourceMappingURL=v1SelfSubjectAccessReview.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SelfSubjectAccessReviewSpec = void 0;\n/**\n* SelfSubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set\n*/\nclass V1SelfSubjectAccessReviewSpec {\n static getAttributeTypeMap() {\n return V1SelfSubjectAccessReviewSpec.attributeTypeMap;\n }\n}\nexports.V1SelfSubjectAccessReviewSpec = V1SelfSubjectAccessReviewSpec;\nV1SelfSubjectAccessReviewSpec.discriminator = undefined;\nV1SelfSubjectAccessReviewSpec.attributeTypeMap = [\n {\n \"name\": \"nonResourceAttributes\",\n \"baseName\": \"nonResourceAttributes\",\n \"type\": \"V1NonResourceAttributes\"\n },\n {\n \"name\": \"resourceAttributes\",\n \"baseName\": \"resourceAttributes\",\n \"type\": \"V1ResourceAttributes\"\n }\n];\n//# sourceMappingURL=v1SelfSubjectAccessReviewSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SelfSubjectRulesReview = void 0;\n/**\n* SelfSubjectRulesReview enumerates the set of actions the current user can perform within a namespace. The returned list of actions may be incomplete depending on the server\\'s authorization mode, and any errors experienced during the evaluation. SelfSubjectRulesReview should be used by UIs to show/hide actions, or to quickly let an end user reason about their permissions. It should NOT Be used by external systems to drive authorization decisions as this raises confused deputy, cache lifetime/revocation, and correctness concerns. SubjectAccessReview, and LocalAccessReview are the correct way to defer authorization decisions to the API server.\n*/\nclass V1SelfSubjectRulesReview {\n static getAttributeTypeMap() {\n return V1SelfSubjectRulesReview.attributeTypeMap;\n }\n}\nexports.V1SelfSubjectRulesReview = V1SelfSubjectRulesReview;\nV1SelfSubjectRulesReview.discriminator = undefined;\nV1SelfSubjectRulesReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1SelfSubjectRulesReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1SubjectRulesReviewStatus\"\n }\n];\n//# sourceMappingURL=v1SelfSubjectRulesReview.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SelfSubjectRulesReviewSpec = void 0;\n/**\n* SelfSubjectRulesReviewSpec defines the specification for SelfSubjectRulesReview.\n*/\nclass V1SelfSubjectRulesReviewSpec {\n static getAttributeTypeMap() {\n return V1SelfSubjectRulesReviewSpec.attributeTypeMap;\n }\n}\nexports.V1SelfSubjectRulesReviewSpec = V1SelfSubjectRulesReviewSpec;\nV1SelfSubjectRulesReviewSpec.discriminator = undefined;\nV1SelfSubjectRulesReviewSpec.attributeTypeMap = [\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1SelfSubjectRulesReviewSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServerAddressByClientCIDR = void 0;\n/**\n* ServerAddressByClientCIDR helps the client to determine the server address that they should use, depending on the clientCIDR that they match.\n*/\nclass V1ServerAddressByClientCIDR {\n static getAttributeTypeMap() {\n return V1ServerAddressByClientCIDR.attributeTypeMap;\n }\n}\nexports.V1ServerAddressByClientCIDR = V1ServerAddressByClientCIDR;\nV1ServerAddressByClientCIDR.discriminator = undefined;\nV1ServerAddressByClientCIDR.attributeTypeMap = [\n {\n \"name\": \"clientCIDR\",\n \"baseName\": \"clientCIDR\",\n \"type\": \"string\"\n },\n {\n \"name\": \"serverAddress\",\n \"baseName\": \"serverAddress\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ServerAddressByClientCIDR.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Service = void 0;\n/**\n* Service is a named abstraction of software service (for example, mysql) consisting of local port (for example 3306) that the proxy listens on, and the selector that determines which pods will answer requests sent through the proxy.\n*/\nclass V1Service {\n static getAttributeTypeMap() {\n return V1Service.attributeTypeMap;\n }\n}\nexports.V1Service = V1Service;\nV1Service.discriminator = undefined;\nV1Service.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1ServiceSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1ServiceStatus\"\n }\n];\n//# sourceMappingURL=v1Service.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServiceAccount = void 0;\n/**\n* ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets\n*/\nclass V1ServiceAccount {\n static getAttributeTypeMap() {\n return V1ServiceAccount.attributeTypeMap;\n }\n}\nexports.V1ServiceAccount = V1ServiceAccount;\nV1ServiceAccount.discriminator = undefined;\nV1ServiceAccount.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"automountServiceAccountToken\",\n \"baseName\": \"automountServiceAccountToken\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"imagePullSecrets\",\n \"baseName\": \"imagePullSecrets\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"secrets\",\n \"baseName\": \"secrets\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ServiceAccount.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServiceAccountList = void 0;\n/**\n* ServiceAccountList is a list of ServiceAccount objects\n*/\nclass V1ServiceAccountList {\n static getAttributeTypeMap() {\n return V1ServiceAccountList.attributeTypeMap;\n }\n}\nexports.V1ServiceAccountList = V1ServiceAccountList;\nV1ServiceAccountList.discriminator = undefined;\nV1ServiceAccountList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ServiceAccountList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServiceAccountTokenProjection = void 0;\n/**\n* ServiceAccountTokenProjection represents a projected service account token volume. This projection can be used to insert a service account token into the pods runtime filesystem for use against APIs (Kubernetes API Server or otherwise).\n*/\nclass V1ServiceAccountTokenProjection {\n static getAttributeTypeMap() {\n return V1ServiceAccountTokenProjection.attributeTypeMap;\n }\n}\nexports.V1ServiceAccountTokenProjection = V1ServiceAccountTokenProjection;\nV1ServiceAccountTokenProjection.discriminator = undefined;\nV1ServiceAccountTokenProjection.attributeTypeMap = [\n {\n \"name\": \"audience\",\n \"baseName\": \"audience\",\n \"type\": \"string\"\n },\n {\n \"name\": \"expirationSeconds\",\n \"baseName\": \"expirationSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"path\",\n \"baseName\": \"path\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ServiceAccountTokenProjection.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServiceBackendPort = void 0;\n/**\n* ServiceBackendPort is the service port being referenced.\n*/\nclass V1ServiceBackendPort {\n static getAttributeTypeMap() {\n return V1ServiceBackendPort.attributeTypeMap;\n }\n}\nexports.V1ServiceBackendPort = V1ServiceBackendPort;\nV1ServiceBackendPort.discriminator = undefined;\nV1ServiceBackendPort.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"number\",\n \"baseName\": \"number\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1ServiceBackendPort.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServiceList = void 0;\n/**\n* ServiceList holds a list of services.\n*/\nclass V1ServiceList {\n static getAttributeTypeMap() {\n return V1ServiceList.attributeTypeMap;\n }\n}\nexports.V1ServiceList = V1ServiceList;\nV1ServiceList.discriminator = undefined;\nV1ServiceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ServiceList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServicePort = void 0;\n/**\n* ServicePort contains information on service\\'s port.\n*/\nclass V1ServicePort {\n static getAttributeTypeMap() {\n return V1ServicePort.attributeTypeMap;\n }\n}\nexports.V1ServicePort = V1ServicePort;\nV1ServicePort.discriminator = undefined;\nV1ServicePort.attributeTypeMap = [\n {\n \"name\": \"appProtocol\",\n \"baseName\": \"appProtocol\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodePort\",\n \"baseName\": \"nodePort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetPort\",\n \"baseName\": \"targetPort\",\n \"type\": \"IntOrString\"\n }\n];\n//# sourceMappingURL=v1ServicePort.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServiceSpec = void 0;\n/**\n* ServiceSpec describes the attributes that a user creates on a service.\n*/\nclass V1ServiceSpec {\n static getAttributeTypeMap() {\n return V1ServiceSpec.attributeTypeMap;\n }\n}\nexports.V1ServiceSpec = V1ServiceSpec;\nV1ServiceSpec.discriminator = undefined;\nV1ServiceSpec.attributeTypeMap = [\n {\n \"name\": \"allocateLoadBalancerNodePorts\",\n \"baseName\": \"allocateLoadBalancerNodePorts\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"clusterIP\",\n \"baseName\": \"clusterIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"clusterIPs\",\n \"baseName\": \"clusterIPs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"externalIPs\",\n \"baseName\": \"externalIPs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"externalName\",\n \"baseName\": \"externalName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"externalTrafficPolicy\",\n \"baseName\": \"externalTrafficPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"healthCheckNodePort\",\n \"baseName\": \"healthCheckNodePort\",\n \"type\": \"number\"\n },\n {\n \"name\": \"internalTrafficPolicy\",\n \"baseName\": \"internalTrafficPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"ipFamilies\",\n \"baseName\": \"ipFamilies\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ipFamilyPolicy\",\n \"baseName\": \"ipFamilyPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"loadBalancerClass\",\n \"baseName\": \"loadBalancerClass\",\n \"type\": \"string\"\n },\n {\n \"name\": \"loadBalancerIP\",\n \"baseName\": \"loadBalancerIP\",\n \"type\": \"string\"\n },\n {\n \"name\": \"loadBalancerSourceRanges\",\n \"baseName\": \"loadBalancerSourceRanges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"publishNotReadyAddresses\",\n \"baseName\": \"publishNotReadyAddresses\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"sessionAffinity\",\n \"baseName\": \"sessionAffinity\",\n \"type\": \"string\"\n },\n {\n \"name\": \"sessionAffinityConfig\",\n \"baseName\": \"sessionAffinityConfig\",\n \"type\": \"V1SessionAffinityConfig\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1ServiceSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ServiceStatus = void 0;\n/**\n* ServiceStatus represents the current status of a service.\n*/\nclass V1ServiceStatus {\n static getAttributeTypeMap() {\n return V1ServiceStatus.attributeTypeMap;\n }\n}\nexports.V1ServiceStatus = V1ServiceStatus;\nV1ServiceStatus.discriminator = undefined;\nV1ServiceStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"loadBalancer\",\n \"baseName\": \"loadBalancer\",\n \"type\": \"V1LoadBalancerStatus\"\n }\n];\n//# sourceMappingURL=v1ServiceStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SessionAffinityConfig = void 0;\n/**\n* SessionAffinityConfig represents the configurations of session affinity.\n*/\nclass V1SessionAffinityConfig {\n static getAttributeTypeMap() {\n return V1SessionAffinityConfig.attributeTypeMap;\n }\n}\nexports.V1SessionAffinityConfig = V1SessionAffinityConfig;\nV1SessionAffinityConfig.discriminator = undefined;\nV1SessionAffinityConfig.attributeTypeMap = [\n {\n \"name\": \"clientIP\",\n \"baseName\": \"clientIP\",\n \"type\": \"V1ClientIPConfig\"\n }\n];\n//# sourceMappingURL=v1SessionAffinityConfig.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StatefulSet = void 0;\n/**\n* StatefulSet represents a set of pods with consistent identities. Identities are defined as: - Network: A single stable DNS and hostname. - Storage: As many VolumeClaims as requested. The StatefulSet guarantees that a given network identity will always map to the same storage identity.\n*/\nclass V1StatefulSet {\n static getAttributeTypeMap() {\n return V1StatefulSet.attributeTypeMap;\n }\n}\nexports.V1StatefulSet = V1StatefulSet;\nV1StatefulSet.discriminator = undefined;\nV1StatefulSet.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1StatefulSetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1StatefulSetStatus\"\n }\n];\n//# sourceMappingURL=v1StatefulSet.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StatefulSetCondition = void 0;\n/**\n* StatefulSetCondition describes the state of a statefulset at a certain point.\n*/\nclass V1StatefulSetCondition {\n static getAttributeTypeMap() {\n return V1StatefulSetCondition.attributeTypeMap;\n }\n}\nexports.V1StatefulSetCondition = V1StatefulSetCondition;\nV1StatefulSetCondition.discriminator = undefined;\nV1StatefulSetCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1StatefulSetCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StatefulSetList = void 0;\n/**\n* StatefulSetList is a collection of StatefulSets.\n*/\nclass V1StatefulSetList {\n static getAttributeTypeMap() {\n return V1StatefulSetList.attributeTypeMap;\n }\n}\nexports.V1StatefulSetList = V1StatefulSetList;\nV1StatefulSetList.discriminator = undefined;\nV1StatefulSetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1StatefulSetList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StatefulSetSpec = void 0;\n/**\n* A StatefulSetSpec is the specification of a StatefulSet.\n*/\nclass V1StatefulSetSpec {\n static getAttributeTypeMap() {\n return V1StatefulSetSpec.attributeTypeMap;\n }\n}\nexports.V1StatefulSetSpec = V1StatefulSetSpec;\nV1StatefulSetSpec.discriminator = undefined;\nV1StatefulSetSpec.attributeTypeMap = [\n {\n \"name\": \"minReadySeconds\",\n \"baseName\": \"minReadySeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"podManagementPolicy\",\n \"baseName\": \"podManagementPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"revisionHistoryLimit\",\n \"baseName\": \"revisionHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"serviceName\",\n \"baseName\": \"serviceName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"template\",\n \"baseName\": \"template\",\n \"type\": \"V1PodTemplateSpec\"\n },\n {\n \"name\": \"updateStrategy\",\n \"baseName\": \"updateStrategy\",\n \"type\": \"V1StatefulSetUpdateStrategy\"\n },\n {\n \"name\": \"volumeClaimTemplates\",\n \"baseName\": \"volumeClaimTemplates\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1StatefulSetSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StatefulSetStatus = void 0;\n/**\n* StatefulSetStatus represents the current state of a StatefulSet.\n*/\nclass V1StatefulSetStatus {\n static getAttributeTypeMap() {\n return V1StatefulSetStatus.attributeTypeMap;\n }\n}\nexports.V1StatefulSetStatus = V1StatefulSetStatus;\nV1StatefulSetStatus.discriminator = undefined;\nV1StatefulSetStatus.attributeTypeMap = [\n {\n \"name\": \"availableReplicas\",\n \"baseName\": \"availableReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"collisionCount\",\n \"baseName\": \"collisionCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentRevision\",\n \"baseName\": \"currentRevision\",\n \"type\": \"string\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"readyReplicas\",\n \"baseName\": \"readyReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"replicas\",\n \"baseName\": \"replicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"updateRevision\",\n \"baseName\": \"updateRevision\",\n \"type\": \"string\"\n },\n {\n \"name\": \"updatedReplicas\",\n \"baseName\": \"updatedReplicas\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1StatefulSetStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StatefulSetUpdateStrategy = void 0;\n/**\n* StatefulSetUpdateStrategy indicates the strategy that the StatefulSet controller will use to perform updates. It includes any additional parameters necessary to perform the update for the indicated strategy.\n*/\nclass V1StatefulSetUpdateStrategy {\n static getAttributeTypeMap() {\n return V1StatefulSetUpdateStrategy.attributeTypeMap;\n }\n}\nexports.V1StatefulSetUpdateStrategy = V1StatefulSetUpdateStrategy;\nV1StatefulSetUpdateStrategy.discriminator = undefined;\nV1StatefulSetUpdateStrategy.attributeTypeMap = [\n {\n \"name\": \"rollingUpdate\",\n \"baseName\": \"rollingUpdate\",\n \"type\": \"V1RollingUpdateStatefulSetStrategy\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1StatefulSetUpdateStrategy.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Status = void 0;\n/**\n* Status is a return value for calls that don\\'t return other objects.\n*/\nclass V1Status {\n static getAttributeTypeMap() {\n return V1Status.attributeTypeMap;\n }\n}\nexports.V1Status = V1Status;\nV1Status.discriminator = undefined;\nV1Status.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"code\",\n \"baseName\": \"code\",\n \"type\": \"number\"\n },\n {\n \"name\": \"details\",\n \"baseName\": \"details\",\n \"type\": \"V1StatusDetails\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Status.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StatusCause = void 0;\n/**\n* StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.\n*/\nclass V1StatusCause {\n static getAttributeTypeMap() {\n return V1StatusCause.attributeTypeMap;\n }\n}\nexports.V1StatusCause = V1StatusCause;\nV1StatusCause.discriminator = undefined;\nV1StatusCause.attributeTypeMap = [\n {\n \"name\": \"field\",\n \"baseName\": \"field\",\n \"type\": \"string\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1StatusCause.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StatusDetails = void 0;\n/**\n* StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response. The Reason field of a Status object defines what attributes will be set. Clients must ignore fields that do not match the defined type of each attribute, and should assume that any attribute may be empty, invalid, or under defined.\n*/\nclass V1StatusDetails {\n static getAttributeTypeMap() {\n return V1StatusDetails.attributeTypeMap;\n }\n}\nexports.V1StatusDetails = V1StatusDetails;\nV1StatusDetails.discriminator = undefined;\nV1StatusDetails.attributeTypeMap = [\n {\n \"name\": \"causes\",\n \"baseName\": \"causes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"retryAfterSeconds\",\n \"baseName\": \"retryAfterSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1StatusDetails.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StorageClass = void 0;\n/**\n* StorageClass describes the parameters for a class of storage for which PersistentVolumes can be dynamically provisioned. StorageClasses are non-namespaced; the name of the storage class according to etcd is in ObjectMeta.Name.\n*/\nclass V1StorageClass {\n static getAttributeTypeMap() {\n return V1StorageClass.attributeTypeMap;\n }\n}\nexports.V1StorageClass = V1StorageClass;\nV1StorageClass.discriminator = undefined;\nV1StorageClass.attributeTypeMap = [\n {\n \"name\": \"allowVolumeExpansion\",\n \"baseName\": \"allowVolumeExpansion\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"allowedTopologies\",\n \"baseName\": \"allowedTopologies\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"mountOptions\",\n \"baseName\": \"mountOptions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"parameters\",\n \"baseName\": \"parameters\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"provisioner\",\n \"baseName\": \"provisioner\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reclaimPolicy\",\n \"baseName\": \"reclaimPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeBindingMode\",\n \"baseName\": \"volumeBindingMode\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1StorageClass.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StorageClassList = void 0;\n/**\n* StorageClassList is a collection of storage classes.\n*/\nclass V1StorageClassList {\n static getAttributeTypeMap() {\n return V1StorageClassList.attributeTypeMap;\n }\n}\nexports.V1StorageClassList = V1StorageClassList;\nV1StorageClassList.discriminator = undefined;\nV1StorageClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1StorageClassList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StorageOSPersistentVolumeSource = void 0;\n/**\n* Represents a StorageOS persistent volume resource.\n*/\nclass V1StorageOSPersistentVolumeSource {\n static getAttributeTypeMap() {\n return V1StorageOSPersistentVolumeSource.attributeTypeMap;\n }\n}\nexports.V1StorageOSPersistentVolumeSource = V1StorageOSPersistentVolumeSource;\nV1StorageOSPersistentVolumeSource.discriminator = undefined;\nV1StorageOSPersistentVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeNamespace\",\n \"baseName\": \"volumeNamespace\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1StorageOSPersistentVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1StorageOSVolumeSource = void 0;\n/**\n* Represents a StorageOS persistent volume resource.\n*/\nclass V1StorageOSVolumeSource {\n static getAttributeTypeMap() {\n return V1StorageOSVolumeSource.attributeTypeMap;\n }\n}\nexports.V1StorageOSVolumeSource = V1StorageOSVolumeSource;\nV1StorageOSVolumeSource.discriminator = undefined;\nV1StorageOSVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"secretRef\",\n \"baseName\": \"secretRef\",\n \"type\": \"V1LocalObjectReference\"\n },\n {\n \"name\": \"volumeName\",\n \"baseName\": \"volumeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumeNamespace\",\n \"baseName\": \"volumeNamespace\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1StorageOSVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Subject = void 0;\n/**\n* Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.\n*/\nclass V1Subject {\n static getAttributeTypeMap() {\n return V1Subject.attributeTypeMap;\n }\n}\nexports.V1Subject = V1Subject;\nV1Subject.discriminator = undefined;\nV1Subject.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Subject.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SubjectAccessReview = void 0;\n/**\n* SubjectAccessReview checks whether or not a user or group can perform an action.\n*/\nclass V1SubjectAccessReview {\n static getAttributeTypeMap() {\n return V1SubjectAccessReview.attributeTypeMap;\n }\n}\nexports.V1SubjectAccessReview = V1SubjectAccessReview;\nV1SubjectAccessReview.discriminator = undefined;\nV1SubjectAccessReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1SubjectAccessReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1SubjectAccessReviewStatus\"\n }\n];\n//# sourceMappingURL=v1SubjectAccessReview.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SubjectAccessReviewSpec = void 0;\n/**\n* SubjectAccessReviewSpec is a description of the access request. Exactly one of ResourceAuthorizationAttributes and NonResourceAuthorizationAttributes must be set\n*/\nclass V1SubjectAccessReviewSpec {\n static getAttributeTypeMap() {\n return V1SubjectAccessReviewSpec.attributeTypeMap;\n }\n}\nexports.V1SubjectAccessReviewSpec = V1SubjectAccessReviewSpec;\nV1SubjectAccessReviewSpec.discriminator = undefined;\nV1SubjectAccessReviewSpec.attributeTypeMap = [\n {\n \"name\": \"extra\",\n \"baseName\": \"extra\",\n \"type\": \"{ [key: string]: Array; }\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nonResourceAttributes\",\n \"baseName\": \"nonResourceAttributes\",\n \"type\": \"V1NonResourceAttributes\"\n },\n {\n \"name\": \"resourceAttributes\",\n \"baseName\": \"resourceAttributes\",\n \"type\": \"V1ResourceAttributes\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1SubjectAccessReviewSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SubjectAccessReviewStatus = void 0;\n/**\n* SubjectAccessReviewStatus\n*/\nclass V1SubjectAccessReviewStatus {\n static getAttributeTypeMap() {\n return V1SubjectAccessReviewStatus.attributeTypeMap;\n }\n}\nexports.V1SubjectAccessReviewStatus = V1SubjectAccessReviewStatus;\nV1SubjectAccessReviewStatus.discriminator = undefined;\nV1SubjectAccessReviewStatus.attributeTypeMap = [\n {\n \"name\": \"allowed\",\n \"baseName\": \"allowed\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"denied\",\n \"baseName\": \"denied\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"evaluationError\",\n \"baseName\": \"evaluationError\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1SubjectAccessReviewStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1SubjectRulesReviewStatus = void 0;\n/**\n* SubjectRulesReviewStatus contains the result of a rules check. This check can be incomplete depending on the set of authorizers the server is configured with and any errors experienced during evaluation. Because authorization rules are additive, if a rule appears in a list it\\'s safe to assume the subject has that permission, even if that list is incomplete.\n*/\nclass V1SubjectRulesReviewStatus {\n static getAttributeTypeMap() {\n return V1SubjectRulesReviewStatus.attributeTypeMap;\n }\n}\nexports.V1SubjectRulesReviewStatus = V1SubjectRulesReviewStatus;\nV1SubjectRulesReviewStatus.discriminator = undefined;\nV1SubjectRulesReviewStatus.attributeTypeMap = [\n {\n \"name\": \"evaluationError\",\n \"baseName\": \"evaluationError\",\n \"type\": \"string\"\n },\n {\n \"name\": \"incomplete\",\n \"baseName\": \"incomplete\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"nonResourceRules\",\n \"baseName\": \"nonResourceRules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceRules\",\n \"baseName\": \"resourceRules\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1SubjectRulesReviewStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Sysctl = void 0;\n/**\n* Sysctl defines a kernel parameter to be set\n*/\nclass V1Sysctl {\n static getAttributeTypeMap() {\n return V1Sysctl.attributeTypeMap;\n }\n}\nexports.V1Sysctl = V1Sysctl;\nV1Sysctl.discriminator = undefined;\nV1Sysctl.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Sysctl.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TCPSocketAction = void 0;\n/**\n* TCPSocketAction describes an action based on opening a socket\n*/\nclass V1TCPSocketAction {\n static getAttributeTypeMap() {\n return V1TCPSocketAction.attributeTypeMap;\n }\n}\nexports.V1TCPSocketAction = V1TCPSocketAction;\nV1TCPSocketAction.discriminator = undefined;\nV1TCPSocketAction.attributeTypeMap = [\n {\n \"name\": \"host\",\n \"baseName\": \"host\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"IntOrString\"\n }\n];\n//# sourceMappingURL=v1TCPSocketAction.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Taint = void 0;\n/**\n* The node this Taint is attached to has the \\\"effect\\\" on any pod that does not tolerate the Taint.\n*/\nclass V1Taint {\n static getAttributeTypeMap() {\n return V1Taint.attributeTypeMap;\n }\n}\nexports.V1Taint = V1Taint;\nV1Taint.discriminator = undefined;\nV1Taint.attributeTypeMap = [\n {\n \"name\": \"effect\",\n \"baseName\": \"effect\",\n \"type\": \"string\"\n },\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"timeAdded\",\n \"baseName\": \"timeAdded\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Taint.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TokenRequestSpec = void 0;\n/**\n* TokenRequestSpec contains client provided parameters of a token request.\n*/\nclass V1TokenRequestSpec {\n static getAttributeTypeMap() {\n return V1TokenRequestSpec.attributeTypeMap;\n }\n}\nexports.V1TokenRequestSpec = V1TokenRequestSpec;\nV1TokenRequestSpec.discriminator = undefined;\nV1TokenRequestSpec.attributeTypeMap = [\n {\n \"name\": \"audiences\",\n \"baseName\": \"audiences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"boundObjectRef\",\n \"baseName\": \"boundObjectRef\",\n \"type\": \"V1BoundObjectReference\"\n },\n {\n \"name\": \"expirationSeconds\",\n \"baseName\": \"expirationSeconds\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1TokenRequestSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TokenRequestStatus = void 0;\n/**\n* TokenRequestStatus is the result of a token request.\n*/\nclass V1TokenRequestStatus {\n static getAttributeTypeMap() {\n return V1TokenRequestStatus.attributeTypeMap;\n }\n}\nexports.V1TokenRequestStatus = V1TokenRequestStatus;\nV1TokenRequestStatus.discriminator = undefined;\nV1TokenRequestStatus.attributeTypeMap = [\n {\n \"name\": \"expirationTimestamp\",\n \"baseName\": \"expirationTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"token\",\n \"baseName\": \"token\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1TokenRequestStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TokenReview = void 0;\n/**\n* TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.\n*/\nclass V1TokenReview {\n static getAttributeTypeMap() {\n return V1TokenReview.attributeTypeMap;\n }\n}\nexports.V1TokenReview = V1TokenReview;\nV1TokenReview.discriminator = undefined;\nV1TokenReview.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1TokenReviewSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1TokenReviewStatus\"\n }\n];\n//# sourceMappingURL=v1TokenReview.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TokenReviewSpec = void 0;\n/**\n* TokenReviewSpec is a description of the token authentication request.\n*/\nclass V1TokenReviewSpec {\n static getAttributeTypeMap() {\n return V1TokenReviewSpec.attributeTypeMap;\n }\n}\nexports.V1TokenReviewSpec = V1TokenReviewSpec;\nV1TokenReviewSpec.discriminator = undefined;\nV1TokenReviewSpec.attributeTypeMap = [\n {\n \"name\": \"audiences\",\n \"baseName\": \"audiences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"token\",\n \"baseName\": \"token\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1TokenReviewSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TokenReviewStatus = void 0;\n/**\n* TokenReviewStatus is the result of the token authentication request.\n*/\nclass V1TokenReviewStatus {\n static getAttributeTypeMap() {\n return V1TokenReviewStatus.attributeTypeMap;\n }\n}\nexports.V1TokenReviewStatus = V1TokenReviewStatus;\nV1TokenReviewStatus.discriminator = undefined;\nV1TokenReviewStatus.attributeTypeMap = [\n {\n \"name\": \"audiences\",\n \"baseName\": \"audiences\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"authenticated\",\n \"baseName\": \"authenticated\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"error\",\n \"baseName\": \"error\",\n \"type\": \"string\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"V1UserInfo\"\n }\n];\n//# sourceMappingURL=v1TokenReviewStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Toleration = void 0;\n/**\n* The pod this Toleration is attached to tolerates any taint that matches the triple using the matching operator .\n*/\nclass V1Toleration {\n static getAttributeTypeMap() {\n return V1Toleration.attributeTypeMap;\n }\n}\nexports.V1Toleration = V1Toleration;\nV1Toleration.discriminator = undefined;\nV1Toleration.attributeTypeMap = [\n {\n \"name\": \"effect\",\n \"baseName\": \"effect\",\n \"type\": \"string\"\n },\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"operator\",\n \"baseName\": \"operator\",\n \"type\": \"string\"\n },\n {\n \"name\": \"tolerationSeconds\",\n \"baseName\": \"tolerationSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1Toleration.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TopologySelectorLabelRequirement = void 0;\n/**\n* A topology selector requirement is a selector that matches given label. This is an alpha feature and may change in the future.\n*/\nclass V1TopologySelectorLabelRequirement {\n static getAttributeTypeMap() {\n return V1TopologySelectorLabelRequirement.attributeTypeMap;\n }\n}\nexports.V1TopologySelectorLabelRequirement = V1TopologySelectorLabelRequirement;\nV1TopologySelectorLabelRequirement.discriminator = undefined;\nV1TopologySelectorLabelRequirement.attributeTypeMap = [\n {\n \"name\": \"key\",\n \"baseName\": \"key\",\n \"type\": \"string\"\n },\n {\n \"name\": \"values\",\n \"baseName\": \"values\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1TopologySelectorLabelRequirement.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TopologySelectorTerm = void 0;\n/**\n* A topology selector term represents the result of label queries. A null or empty topology selector term matches no objects. The requirements of them are ANDed. It provides a subset of functionality as NodeSelectorTerm. This is an alpha feature and may change in the future.\n*/\nclass V1TopologySelectorTerm {\n static getAttributeTypeMap() {\n return V1TopologySelectorTerm.attributeTypeMap;\n }\n}\nexports.V1TopologySelectorTerm = V1TopologySelectorTerm;\nV1TopologySelectorTerm.discriminator = undefined;\nV1TopologySelectorTerm.attributeTypeMap = [\n {\n \"name\": \"matchLabelExpressions\",\n \"baseName\": \"matchLabelExpressions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1TopologySelectorTerm.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TopologySpreadConstraint = void 0;\n/**\n* TopologySpreadConstraint specifies how to spread matching pods among the given topology.\n*/\nclass V1TopologySpreadConstraint {\n static getAttributeTypeMap() {\n return V1TopologySpreadConstraint.attributeTypeMap;\n }\n}\nexports.V1TopologySpreadConstraint = V1TopologySpreadConstraint;\nV1TopologySpreadConstraint.discriminator = undefined;\nV1TopologySpreadConstraint.attributeTypeMap = [\n {\n \"name\": \"labelSelector\",\n \"baseName\": \"labelSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"maxSkew\",\n \"baseName\": \"maxSkew\",\n \"type\": \"number\"\n },\n {\n \"name\": \"topologyKey\",\n \"baseName\": \"topologyKey\",\n \"type\": \"string\"\n },\n {\n \"name\": \"whenUnsatisfiable\",\n \"baseName\": \"whenUnsatisfiable\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1TopologySpreadConstraint.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1TypedLocalObjectReference = void 0;\n/**\n* TypedLocalObjectReference contains enough information to let you locate the typed referenced object inside the same namespace.\n*/\nclass V1TypedLocalObjectReference {\n static getAttributeTypeMap() {\n return V1TypedLocalObjectReference.attributeTypeMap;\n }\n}\nexports.V1TypedLocalObjectReference = V1TypedLocalObjectReference;\nV1TypedLocalObjectReference.discriminator = undefined;\nV1TypedLocalObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1TypedLocalObjectReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1UncountedTerminatedPods = void 0;\n/**\n* UncountedTerminatedPods holds UIDs of Pods that have terminated but haven\\'t been accounted in Job status counters.\n*/\nclass V1UncountedTerminatedPods {\n static getAttributeTypeMap() {\n return V1UncountedTerminatedPods.attributeTypeMap;\n }\n}\nexports.V1UncountedTerminatedPods = V1UncountedTerminatedPods;\nV1UncountedTerminatedPods.discriminator = undefined;\nV1UncountedTerminatedPods.attributeTypeMap = [\n {\n \"name\": \"failed\",\n \"baseName\": \"failed\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"succeeded\",\n \"baseName\": \"succeeded\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1UncountedTerminatedPods.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1UserInfo = void 0;\n/**\n* UserInfo holds the information about the user needed to implement the user.Info interface.\n*/\nclass V1UserInfo {\n static getAttributeTypeMap() {\n return V1UserInfo.attributeTypeMap;\n }\n}\nexports.V1UserInfo = V1UserInfo;\nV1UserInfo.discriminator = undefined;\nV1UserInfo.attributeTypeMap = [\n {\n \"name\": \"extra\",\n \"baseName\": \"extra\",\n \"type\": \"{ [key: string]: Array; }\"\n },\n {\n \"name\": \"groups\",\n \"baseName\": \"groups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"uid\",\n \"baseName\": \"uid\",\n \"type\": \"string\"\n },\n {\n \"name\": \"username\",\n \"baseName\": \"username\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1UserInfo.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ValidatingWebhook = void 0;\n/**\n* ValidatingWebhook describes an admission webhook and the resources and operations it applies to.\n*/\nclass V1ValidatingWebhook {\n static getAttributeTypeMap() {\n return V1ValidatingWebhook.attributeTypeMap;\n }\n}\nexports.V1ValidatingWebhook = V1ValidatingWebhook;\nV1ValidatingWebhook.discriminator = undefined;\nV1ValidatingWebhook.attributeTypeMap = [\n {\n \"name\": \"admissionReviewVersions\",\n \"baseName\": \"admissionReviewVersions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"clientConfig\",\n \"baseName\": \"clientConfig\",\n \"type\": \"AdmissionregistrationV1WebhookClientConfig\"\n },\n {\n \"name\": \"failurePolicy\",\n \"baseName\": \"failurePolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"matchPolicy\",\n \"baseName\": \"matchPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespaceSelector\",\n \"baseName\": \"namespaceSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"objectSelector\",\n \"baseName\": \"objectSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"sideEffects\",\n \"baseName\": \"sideEffects\",\n \"type\": \"string\"\n },\n {\n \"name\": \"timeoutSeconds\",\n \"baseName\": \"timeoutSeconds\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1ValidatingWebhook.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ValidatingWebhookConfiguration = void 0;\n/**\n* ValidatingWebhookConfiguration describes the configuration of and admission webhook that accept or reject and object without changing it.\n*/\nclass V1ValidatingWebhookConfiguration {\n static getAttributeTypeMap() {\n return V1ValidatingWebhookConfiguration.attributeTypeMap;\n }\n}\nexports.V1ValidatingWebhookConfiguration = V1ValidatingWebhookConfiguration;\nV1ValidatingWebhookConfiguration.discriminator = undefined;\nV1ValidatingWebhookConfiguration.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"webhooks\",\n \"baseName\": \"webhooks\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1ValidatingWebhookConfiguration.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1ValidatingWebhookConfigurationList = void 0;\n/**\n* ValidatingWebhookConfigurationList is a list of ValidatingWebhookConfiguration.\n*/\nclass V1ValidatingWebhookConfigurationList {\n static getAttributeTypeMap() {\n return V1ValidatingWebhookConfigurationList.attributeTypeMap;\n }\n}\nexports.V1ValidatingWebhookConfigurationList = V1ValidatingWebhookConfigurationList;\nV1ValidatingWebhookConfigurationList.discriminator = undefined;\nV1ValidatingWebhookConfigurationList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1ValidatingWebhookConfigurationList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1Volume = void 0;\n/**\n* Volume represents a named volume in a pod that may be accessed by any container in the pod.\n*/\nclass V1Volume {\n static getAttributeTypeMap() {\n return V1Volume.attributeTypeMap;\n }\n}\nexports.V1Volume = V1Volume;\nV1Volume.discriminator = undefined;\nV1Volume.attributeTypeMap = [\n {\n \"name\": \"awsElasticBlockStore\",\n \"baseName\": \"awsElasticBlockStore\",\n \"type\": \"V1AWSElasticBlockStoreVolumeSource\"\n },\n {\n \"name\": \"azureDisk\",\n \"baseName\": \"azureDisk\",\n \"type\": \"V1AzureDiskVolumeSource\"\n },\n {\n \"name\": \"azureFile\",\n \"baseName\": \"azureFile\",\n \"type\": \"V1AzureFileVolumeSource\"\n },\n {\n \"name\": \"cephfs\",\n \"baseName\": \"cephfs\",\n \"type\": \"V1CephFSVolumeSource\"\n },\n {\n \"name\": \"cinder\",\n \"baseName\": \"cinder\",\n \"type\": \"V1CinderVolumeSource\"\n },\n {\n \"name\": \"configMap\",\n \"baseName\": \"configMap\",\n \"type\": \"V1ConfigMapVolumeSource\"\n },\n {\n \"name\": \"csi\",\n \"baseName\": \"csi\",\n \"type\": \"V1CSIVolumeSource\"\n },\n {\n \"name\": \"downwardAPI\",\n \"baseName\": \"downwardAPI\",\n \"type\": \"V1DownwardAPIVolumeSource\"\n },\n {\n \"name\": \"emptyDir\",\n \"baseName\": \"emptyDir\",\n \"type\": \"V1EmptyDirVolumeSource\"\n },\n {\n \"name\": \"ephemeral\",\n \"baseName\": \"ephemeral\",\n \"type\": \"V1EphemeralVolumeSource\"\n },\n {\n \"name\": \"fc\",\n \"baseName\": \"fc\",\n \"type\": \"V1FCVolumeSource\"\n },\n {\n \"name\": \"flexVolume\",\n \"baseName\": \"flexVolume\",\n \"type\": \"V1FlexVolumeSource\"\n },\n {\n \"name\": \"flocker\",\n \"baseName\": \"flocker\",\n \"type\": \"V1FlockerVolumeSource\"\n },\n {\n \"name\": \"gcePersistentDisk\",\n \"baseName\": \"gcePersistentDisk\",\n \"type\": \"V1GCEPersistentDiskVolumeSource\"\n },\n {\n \"name\": \"gitRepo\",\n \"baseName\": \"gitRepo\",\n \"type\": \"V1GitRepoVolumeSource\"\n },\n {\n \"name\": \"glusterfs\",\n \"baseName\": \"glusterfs\",\n \"type\": \"V1GlusterfsVolumeSource\"\n },\n {\n \"name\": \"hostPath\",\n \"baseName\": \"hostPath\",\n \"type\": \"V1HostPathVolumeSource\"\n },\n {\n \"name\": \"iscsi\",\n \"baseName\": \"iscsi\",\n \"type\": \"V1ISCSIVolumeSource\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nfs\",\n \"baseName\": \"nfs\",\n \"type\": \"V1NFSVolumeSource\"\n },\n {\n \"name\": \"persistentVolumeClaim\",\n \"baseName\": \"persistentVolumeClaim\",\n \"type\": \"V1PersistentVolumeClaimVolumeSource\"\n },\n {\n \"name\": \"photonPersistentDisk\",\n \"baseName\": \"photonPersistentDisk\",\n \"type\": \"V1PhotonPersistentDiskVolumeSource\"\n },\n {\n \"name\": \"portworxVolume\",\n \"baseName\": \"portworxVolume\",\n \"type\": \"V1PortworxVolumeSource\"\n },\n {\n \"name\": \"projected\",\n \"baseName\": \"projected\",\n \"type\": \"V1ProjectedVolumeSource\"\n },\n {\n \"name\": \"quobyte\",\n \"baseName\": \"quobyte\",\n \"type\": \"V1QuobyteVolumeSource\"\n },\n {\n \"name\": \"rbd\",\n \"baseName\": \"rbd\",\n \"type\": \"V1RBDVolumeSource\"\n },\n {\n \"name\": \"scaleIO\",\n \"baseName\": \"scaleIO\",\n \"type\": \"V1ScaleIOVolumeSource\"\n },\n {\n \"name\": \"secret\",\n \"baseName\": \"secret\",\n \"type\": \"V1SecretVolumeSource\"\n },\n {\n \"name\": \"storageos\",\n \"baseName\": \"storageos\",\n \"type\": \"V1StorageOSVolumeSource\"\n },\n {\n \"name\": \"vsphereVolume\",\n \"baseName\": \"vsphereVolume\",\n \"type\": \"V1VsphereVirtualDiskVolumeSource\"\n }\n];\n//# sourceMappingURL=v1Volume.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeAttachment = void 0;\n/**\n* VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced.\n*/\nclass V1VolumeAttachment {\n static getAttributeTypeMap() {\n return V1VolumeAttachment.attributeTypeMap;\n }\n}\nexports.V1VolumeAttachment = V1VolumeAttachment;\nV1VolumeAttachment.discriminator = undefined;\nV1VolumeAttachment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1VolumeAttachmentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1VolumeAttachmentStatus\"\n }\n];\n//# sourceMappingURL=v1VolumeAttachment.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeAttachmentList = void 0;\n/**\n* VolumeAttachmentList is a collection of VolumeAttachment objects.\n*/\nclass V1VolumeAttachmentList {\n static getAttributeTypeMap() {\n return V1VolumeAttachmentList.attributeTypeMap;\n }\n}\nexports.V1VolumeAttachmentList = V1VolumeAttachmentList;\nV1VolumeAttachmentList.discriminator = undefined;\nV1VolumeAttachmentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1VolumeAttachmentList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeAttachmentSource = void 0;\n/**\n* VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.\n*/\nclass V1VolumeAttachmentSource {\n static getAttributeTypeMap() {\n return V1VolumeAttachmentSource.attributeTypeMap;\n }\n}\nexports.V1VolumeAttachmentSource = V1VolumeAttachmentSource;\nV1VolumeAttachmentSource.discriminator = undefined;\nV1VolumeAttachmentSource.attributeTypeMap = [\n {\n \"name\": \"inlineVolumeSpec\",\n \"baseName\": \"inlineVolumeSpec\",\n \"type\": \"V1PersistentVolumeSpec\"\n },\n {\n \"name\": \"persistentVolumeName\",\n \"baseName\": \"persistentVolumeName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1VolumeAttachmentSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeAttachmentSpec = void 0;\n/**\n* VolumeAttachmentSpec is the specification of a VolumeAttachment request.\n*/\nclass V1VolumeAttachmentSpec {\n static getAttributeTypeMap() {\n return V1VolumeAttachmentSpec.attributeTypeMap;\n }\n}\nexports.V1VolumeAttachmentSpec = V1VolumeAttachmentSpec;\nV1VolumeAttachmentSpec.discriminator = undefined;\nV1VolumeAttachmentSpec.attributeTypeMap = [\n {\n \"name\": \"attacher\",\n \"baseName\": \"attacher\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"source\",\n \"baseName\": \"source\",\n \"type\": \"V1VolumeAttachmentSource\"\n }\n];\n//# sourceMappingURL=v1VolumeAttachmentSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeAttachmentStatus = void 0;\n/**\n* VolumeAttachmentStatus is the status of a VolumeAttachment request.\n*/\nclass V1VolumeAttachmentStatus {\n static getAttributeTypeMap() {\n return V1VolumeAttachmentStatus.attributeTypeMap;\n }\n}\nexports.V1VolumeAttachmentStatus = V1VolumeAttachmentStatus;\nV1VolumeAttachmentStatus.discriminator = undefined;\nV1VolumeAttachmentStatus.attributeTypeMap = [\n {\n \"name\": \"attachError\",\n \"baseName\": \"attachError\",\n \"type\": \"V1VolumeError\"\n },\n {\n \"name\": \"attached\",\n \"baseName\": \"attached\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"attachmentMetadata\",\n \"baseName\": \"attachmentMetadata\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"detachError\",\n \"baseName\": \"detachError\",\n \"type\": \"V1VolumeError\"\n }\n];\n//# sourceMappingURL=v1VolumeAttachmentStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeDevice = void 0;\n/**\n* volumeDevice describes a mapping of a raw block device within a container.\n*/\nclass V1VolumeDevice {\n static getAttributeTypeMap() {\n return V1VolumeDevice.attributeTypeMap;\n }\n}\nexports.V1VolumeDevice = V1VolumeDevice;\nV1VolumeDevice.discriminator = undefined;\nV1VolumeDevice.attributeTypeMap = [\n {\n \"name\": \"devicePath\",\n \"baseName\": \"devicePath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1VolumeDevice.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeError = void 0;\n/**\n* VolumeError captures an error encountered during a volume operation.\n*/\nclass V1VolumeError {\n static getAttributeTypeMap() {\n return V1VolumeError.attributeTypeMap;\n }\n}\nexports.V1VolumeError = V1VolumeError;\nV1VolumeError.discriminator = undefined;\nV1VolumeError.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"time\",\n \"baseName\": \"time\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1VolumeError.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeMount = void 0;\n/**\n* VolumeMount describes a mounting of a Volume within a container.\n*/\nclass V1VolumeMount {\n static getAttributeTypeMap() {\n return V1VolumeMount.attributeTypeMap;\n }\n}\nexports.V1VolumeMount = V1VolumeMount;\nV1VolumeMount.discriminator = undefined;\nV1VolumeMount.attributeTypeMap = [\n {\n \"name\": \"mountPath\",\n \"baseName\": \"mountPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"mountPropagation\",\n \"baseName\": \"mountPropagation\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"subPath\",\n \"baseName\": \"subPath\",\n \"type\": \"string\"\n },\n {\n \"name\": \"subPathExpr\",\n \"baseName\": \"subPathExpr\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1VolumeMount.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeNodeAffinity = void 0;\n/**\n* VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from.\n*/\nclass V1VolumeNodeAffinity {\n static getAttributeTypeMap() {\n return V1VolumeNodeAffinity.attributeTypeMap;\n }\n}\nexports.V1VolumeNodeAffinity = V1VolumeNodeAffinity;\nV1VolumeNodeAffinity.discriminator = undefined;\nV1VolumeNodeAffinity.attributeTypeMap = [\n {\n \"name\": \"required\",\n \"baseName\": \"required\",\n \"type\": \"V1NodeSelector\"\n }\n];\n//# sourceMappingURL=v1VolumeNodeAffinity.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeNodeResources = void 0;\n/**\n* VolumeNodeResources is a set of resource limits for scheduling of volumes.\n*/\nclass V1VolumeNodeResources {\n static getAttributeTypeMap() {\n return V1VolumeNodeResources.attributeTypeMap;\n }\n}\nexports.V1VolumeNodeResources = V1VolumeNodeResources;\nV1VolumeNodeResources.discriminator = undefined;\nV1VolumeNodeResources.attributeTypeMap = [\n {\n \"name\": \"count\",\n \"baseName\": \"count\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1VolumeNodeResources.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VolumeProjection = void 0;\n/**\n* Projection that may be projected along with other supported volume types\n*/\nclass V1VolumeProjection {\n static getAttributeTypeMap() {\n return V1VolumeProjection.attributeTypeMap;\n }\n}\nexports.V1VolumeProjection = V1VolumeProjection;\nV1VolumeProjection.discriminator = undefined;\nV1VolumeProjection.attributeTypeMap = [\n {\n \"name\": \"configMap\",\n \"baseName\": \"configMap\",\n \"type\": \"V1ConfigMapProjection\"\n },\n {\n \"name\": \"downwardAPI\",\n \"baseName\": \"downwardAPI\",\n \"type\": \"V1DownwardAPIProjection\"\n },\n {\n \"name\": \"secret\",\n \"baseName\": \"secret\",\n \"type\": \"V1SecretProjection\"\n },\n {\n \"name\": \"serviceAccountToken\",\n \"baseName\": \"serviceAccountToken\",\n \"type\": \"V1ServiceAccountTokenProjection\"\n }\n];\n//# sourceMappingURL=v1VolumeProjection.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1VsphereVirtualDiskVolumeSource = void 0;\n/**\n* Represents a vSphere volume resource.\n*/\nclass V1VsphereVirtualDiskVolumeSource {\n static getAttributeTypeMap() {\n return V1VsphereVirtualDiskVolumeSource.attributeTypeMap;\n }\n}\nexports.V1VsphereVirtualDiskVolumeSource = V1VsphereVirtualDiskVolumeSource;\nV1VsphereVirtualDiskVolumeSource.discriminator = undefined;\nV1VsphereVirtualDiskVolumeSource.attributeTypeMap = [\n {\n \"name\": \"fsType\",\n \"baseName\": \"fsType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storagePolicyID\",\n \"baseName\": \"storagePolicyID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"storagePolicyName\",\n \"baseName\": \"storagePolicyName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"volumePath\",\n \"baseName\": \"volumePath\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1VsphereVirtualDiskVolumeSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1WatchEvent = void 0;\n/**\n* Event represents a single event to a watched resource.\n*/\nclass V1WatchEvent {\n static getAttributeTypeMap() {\n return V1WatchEvent.attributeTypeMap;\n }\n}\nexports.V1WatchEvent = V1WatchEvent;\nV1WatchEvent.discriminator = undefined;\nV1WatchEvent.attributeTypeMap = [\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"object\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1WatchEvent.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1WebhookConversion = void 0;\n/**\n* WebhookConversion describes how to call a conversion webhook\n*/\nclass V1WebhookConversion {\n static getAttributeTypeMap() {\n return V1WebhookConversion.attributeTypeMap;\n }\n}\nexports.V1WebhookConversion = V1WebhookConversion;\nV1WebhookConversion.discriminator = undefined;\nV1WebhookConversion.attributeTypeMap = [\n {\n \"name\": \"clientConfig\",\n \"baseName\": \"clientConfig\",\n \"type\": \"ApiextensionsV1WebhookClientConfig\"\n },\n {\n \"name\": \"conversionReviewVersions\",\n \"baseName\": \"conversionReviewVersions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1WebhookConversion.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1WeightedPodAffinityTerm = void 0;\n/**\n* The weights of all of the matched WeightedPodAffinityTerm fields are added per-node to find the most preferred node(s)\n*/\nclass V1WeightedPodAffinityTerm {\n static getAttributeTypeMap() {\n return V1WeightedPodAffinityTerm.attributeTypeMap;\n }\n}\nexports.V1WeightedPodAffinityTerm = V1WeightedPodAffinityTerm;\nV1WeightedPodAffinityTerm.discriminator = undefined;\nV1WeightedPodAffinityTerm.attributeTypeMap = [\n {\n \"name\": \"podAffinityTerm\",\n \"baseName\": \"podAffinityTerm\",\n \"type\": \"V1PodAffinityTerm\"\n },\n {\n \"name\": \"weight\",\n \"baseName\": \"weight\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1WeightedPodAffinityTerm.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1WindowsSecurityContextOptions = void 0;\n/**\n* WindowsSecurityContextOptions contain Windows-specific options and credentials.\n*/\nclass V1WindowsSecurityContextOptions {\n static getAttributeTypeMap() {\n return V1WindowsSecurityContextOptions.attributeTypeMap;\n }\n}\nexports.V1WindowsSecurityContextOptions = V1WindowsSecurityContextOptions;\nV1WindowsSecurityContextOptions.discriminator = undefined;\nV1WindowsSecurityContextOptions.attributeTypeMap = [\n {\n \"name\": \"gmsaCredentialSpec\",\n \"baseName\": \"gmsaCredentialSpec\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gmsaCredentialSpecName\",\n \"baseName\": \"gmsaCredentialSpecName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"hostProcess\",\n \"baseName\": \"hostProcess\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"runAsUserName\",\n \"baseName\": \"runAsUserName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1WindowsSecurityContextOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1AggregationRule = void 0;\n/**\n* AggregationRule describes how to locate ClusterRoles to aggregate into the ClusterRole\n*/\nclass V1alpha1AggregationRule {\n static getAttributeTypeMap() {\n return V1alpha1AggregationRule.attributeTypeMap;\n }\n}\nexports.V1alpha1AggregationRule = V1alpha1AggregationRule;\nV1alpha1AggregationRule.discriminator = undefined;\nV1alpha1AggregationRule.attributeTypeMap = [\n {\n \"name\": \"clusterRoleSelectors\",\n \"baseName\": \"clusterRoleSelectors\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1alpha1AggregationRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1CSIStorageCapacity = void 0;\n/**\n* CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes. For example this can express things like: - StorageClass \\\"standard\\\" has \\\"1234 GiB\\\" available in \\\"topology.kubernetes.io/zone=us-east1\\\" - StorageClass \\\"localssd\\\" has \\\"10 GiB\\\" available in \\\"kubernetes.io/hostname=knode-abc123\\\" The following three cases all imply that no capacity is available for a certain combination: - no object exists with suitable topology and storage class name - such an object exists, but the capacity is unset - such an object exists, but the capacity is zero The producer of these objects can decide which approach is more suitable. They are consumed by the kube-scheduler if the CSIStorageCapacity beta feature gate is enabled there and a CSI driver opts into capacity-aware scheduling with CSIDriver.StorageCapacity.\n*/\nclass V1alpha1CSIStorageCapacity {\n static getAttributeTypeMap() {\n return V1alpha1CSIStorageCapacity.attributeTypeMap;\n }\n}\nexports.V1alpha1CSIStorageCapacity = V1alpha1CSIStorageCapacity;\nV1alpha1CSIStorageCapacity.discriminator = undefined;\nV1alpha1CSIStorageCapacity.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"capacity\",\n \"baseName\": \"capacity\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"maximumVolumeSize\",\n \"baseName\": \"maximumVolumeSize\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"nodeTopology\",\n \"baseName\": \"nodeTopology\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"storageClassName\",\n \"baseName\": \"storageClassName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1alpha1CSIStorageCapacity.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1CSIStorageCapacityList = void 0;\n/**\n* CSIStorageCapacityList is a collection of CSIStorageCapacity objects.\n*/\nclass V1alpha1CSIStorageCapacityList {\n static getAttributeTypeMap() {\n return V1alpha1CSIStorageCapacityList.attributeTypeMap;\n }\n}\nexports.V1alpha1CSIStorageCapacityList = V1alpha1CSIStorageCapacityList;\nV1alpha1CSIStorageCapacityList.discriminator = undefined;\nV1alpha1CSIStorageCapacityList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1CSIStorageCapacityList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1ClusterRole = void 0;\n/**\n* ClusterRole is a cluster level, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding or ClusterRoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRole, and will no longer be served in v1.22.\n*/\nclass V1alpha1ClusterRole {\n static getAttributeTypeMap() {\n return V1alpha1ClusterRole.attributeTypeMap;\n }\n}\nexports.V1alpha1ClusterRole = V1alpha1ClusterRole;\nV1alpha1ClusterRole.discriminator = undefined;\nV1alpha1ClusterRole.attributeTypeMap = [\n {\n \"name\": \"aggregationRule\",\n \"baseName\": \"aggregationRule\",\n \"type\": \"V1alpha1AggregationRule\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1alpha1ClusterRole.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1ClusterRoleBinding = void 0;\n/**\n* ClusterRoleBinding references a ClusterRole, but not contain it. It can reference a ClusterRole in the global namespace, and adds who information via Subject. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBinding, and will no longer be served in v1.22.\n*/\nclass V1alpha1ClusterRoleBinding {\n static getAttributeTypeMap() {\n return V1alpha1ClusterRoleBinding.attributeTypeMap;\n }\n}\nexports.V1alpha1ClusterRoleBinding = V1alpha1ClusterRoleBinding;\nV1alpha1ClusterRoleBinding.discriminator = undefined;\nV1alpha1ClusterRoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1alpha1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1alpha1ClusterRoleBinding.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1ClusterRoleBindingList = void 0;\n/**\n* ClusterRoleBindingList is a collection of ClusterRoleBindings. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoleBindings, and will no longer be served in v1.22.\n*/\nclass V1alpha1ClusterRoleBindingList {\n static getAttributeTypeMap() {\n return V1alpha1ClusterRoleBindingList.attributeTypeMap;\n }\n}\nexports.V1alpha1ClusterRoleBindingList = V1alpha1ClusterRoleBindingList;\nV1alpha1ClusterRoleBindingList.discriminator = undefined;\nV1alpha1ClusterRoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1ClusterRoleBindingList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1ClusterRoleList = void 0;\n/**\n* ClusterRoleList is a collection of ClusterRoles. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 ClusterRoles, and will no longer be served in v1.22.\n*/\nclass V1alpha1ClusterRoleList {\n static getAttributeTypeMap() {\n return V1alpha1ClusterRoleList.attributeTypeMap;\n }\n}\nexports.V1alpha1ClusterRoleList = V1alpha1ClusterRoleList;\nV1alpha1ClusterRoleList.discriminator = undefined;\nV1alpha1ClusterRoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1ClusterRoleList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1Overhead = void 0;\n/**\n* Overhead structure represents the resource overhead associated with running a pod.\n*/\nclass V1alpha1Overhead {\n static getAttributeTypeMap() {\n return V1alpha1Overhead.attributeTypeMap;\n }\n}\nexports.V1alpha1Overhead = V1alpha1Overhead;\nV1alpha1Overhead.discriminator = undefined;\nV1alpha1Overhead.attributeTypeMap = [\n {\n \"name\": \"podFixed\",\n \"baseName\": \"podFixed\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\n//# sourceMappingURL=v1alpha1Overhead.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1PolicyRule = void 0;\n/**\n* PolicyRule holds information that describes a policy rule, but does not contain information about who the rule applies to or which namespace the rule applies to.\n*/\nclass V1alpha1PolicyRule {\n static getAttributeTypeMap() {\n return V1alpha1PolicyRule.attributeTypeMap;\n }\n}\nexports.V1alpha1PolicyRule = V1alpha1PolicyRule;\nV1alpha1PolicyRule.discriminator = undefined;\nV1alpha1PolicyRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceNames\",\n \"baseName\": \"resourceNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1alpha1PolicyRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1PriorityClass = void 0;\n/**\n* DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.\n*/\nclass V1alpha1PriorityClass {\n static getAttributeTypeMap() {\n return V1alpha1PriorityClass.attributeTypeMap;\n }\n}\nexports.V1alpha1PriorityClass = V1alpha1PriorityClass;\nV1alpha1PriorityClass.discriminator = undefined;\nV1alpha1PriorityClass.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"description\",\n \"baseName\": \"description\",\n \"type\": \"string\"\n },\n {\n \"name\": \"globalDefault\",\n \"baseName\": \"globalDefault\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"preemptionPolicy\",\n \"baseName\": \"preemptionPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1alpha1PriorityClass.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1PriorityClassList = void 0;\n/**\n* PriorityClassList is a collection of priority classes.\n*/\nclass V1alpha1PriorityClassList {\n static getAttributeTypeMap() {\n return V1alpha1PriorityClassList.attributeTypeMap;\n }\n}\nexports.V1alpha1PriorityClassList = V1alpha1PriorityClassList;\nV1alpha1PriorityClassList.discriminator = undefined;\nV1alpha1PriorityClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1PriorityClassList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1Role = void 0;\n/**\n* Role is a namespaced, logical grouping of PolicyRules that can be referenced as a unit by a RoleBinding. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 Role, and will no longer be served in v1.22.\n*/\nclass V1alpha1Role {\n static getAttributeTypeMap() {\n return V1alpha1Role.attributeTypeMap;\n }\n}\nexports.V1alpha1Role = V1alpha1Role;\nV1alpha1Role.discriminator = undefined;\nV1alpha1Role.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1alpha1Role.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1RoleBinding = void 0;\n/**\n* RoleBinding references a role, but does not contain it. It can reference a Role in the same namespace or a ClusterRole in the global namespace. It adds who information via Subjects and namespace information by which namespace it exists in. RoleBindings in a given namespace only have effect in that namespace. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBinding, and will no longer be served in v1.22.\n*/\nclass V1alpha1RoleBinding {\n static getAttributeTypeMap() {\n return V1alpha1RoleBinding.attributeTypeMap;\n }\n}\nexports.V1alpha1RoleBinding = V1alpha1RoleBinding;\nV1alpha1RoleBinding.discriminator = undefined;\nV1alpha1RoleBinding.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"roleRef\",\n \"baseName\": \"roleRef\",\n \"type\": \"V1alpha1RoleRef\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1alpha1RoleBinding.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1RoleBindingList = void 0;\n/**\n* RoleBindingList is a collection of RoleBindings Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleBindingList, and will no longer be served in v1.22.\n*/\nclass V1alpha1RoleBindingList {\n static getAttributeTypeMap() {\n return V1alpha1RoleBindingList.attributeTypeMap;\n }\n}\nexports.V1alpha1RoleBindingList = V1alpha1RoleBindingList;\nV1alpha1RoleBindingList.discriminator = undefined;\nV1alpha1RoleBindingList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1RoleBindingList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1RoleList = void 0;\n/**\n* RoleList is a collection of Roles. Deprecated in v1.17 in favor of rbac.authorization.k8s.io/v1 RoleList, and will no longer be served in v1.22.\n*/\nclass V1alpha1RoleList {\n static getAttributeTypeMap() {\n return V1alpha1RoleList.attributeTypeMap;\n }\n}\nexports.V1alpha1RoleList = V1alpha1RoleList;\nV1alpha1RoleList.discriminator = undefined;\nV1alpha1RoleList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1RoleList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1RoleRef = void 0;\n/**\n* RoleRef contains information that points to the role being used\n*/\nclass V1alpha1RoleRef {\n static getAttributeTypeMap() {\n return V1alpha1RoleRef.attributeTypeMap;\n }\n}\nexports.V1alpha1RoleRef = V1alpha1RoleRef;\nV1alpha1RoleRef.discriminator = undefined;\nV1alpha1RoleRef.attributeTypeMap = [\n {\n \"name\": \"apiGroup\",\n \"baseName\": \"apiGroup\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1alpha1RoleRef.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1RuntimeClass = void 0;\n/**\n* RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class\n*/\nclass V1alpha1RuntimeClass {\n static getAttributeTypeMap() {\n return V1alpha1RuntimeClass.attributeTypeMap;\n }\n}\nexports.V1alpha1RuntimeClass = V1alpha1RuntimeClass;\nV1alpha1RuntimeClass.discriminator = undefined;\nV1alpha1RuntimeClass.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1alpha1RuntimeClassSpec\"\n }\n];\n//# sourceMappingURL=v1alpha1RuntimeClass.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1RuntimeClassList = void 0;\n/**\n* RuntimeClassList is a list of RuntimeClass objects.\n*/\nclass V1alpha1RuntimeClassList {\n static getAttributeTypeMap() {\n return V1alpha1RuntimeClassList.attributeTypeMap;\n }\n}\nexports.V1alpha1RuntimeClassList = V1alpha1RuntimeClassList;\nV1alpha1RuntimeClassList.discriminator = undefined;\nV1alpha1RuntimeClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1RuntimeClassList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1RuntimeClassSpec = void 0;\n/**\n* RuntimeClassSpec is a specification of a RuntimeClass. It contains parameters that are required to describe the RuntimeClass to the Container Runtime Interface (CRI) implementation, as well as any other components that need to understand how the pod will be run. The RuntimeClassSpec is immutable.\n*/\nclass V1alpha1RuntimeClassSpec {\n static getAttributeTypeMap() {\n return V1alpha1RuntimeClassSpec.attributeTypeMap;\n }\n}\nexports.V1alpha1RuntimeClassSpec = V1alpha1RuntimeClassSpec;\nV1alpha1RuntimeClassSpec.discriminator = undefined;\nV1alpha1RuntimeClassSpec.attributeTypeMap = [\n {\n \"name\": \"overhead\",\n \"baseName\": \"overhead\",\n \"type\": \"V1alpha1Overhead\"\n },\n {\n \"name\": \"runtimeHandler\",\n \"baseName\": \"runtimeHandler\",\n \"type\": \"string\"\n },\n {\n \"name\": \"scheduling\",\n \"baseName\": \"scheduling\",\n \"type\": \"V1alpha1Scheduling\"\n }\n];\n//# sourceMappingURL=v1alpha1RuntimeClassSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1Scheduling = void 0;\n/**\n* Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.\n*/\nclass V1alpha1Scheduling {\n static getAttributeTypeMap() {\n return V1alpha1Scheduling.attributeTypeMap;\n }\n}\nexports.V1alpha1Scheduling = V1alpha1Scheduling;\nV1alpha1Scheduling.discriminator = undefined;\nV1alpha1Scheduling.attributeTypeMap = [\n {\n \"name\": \"nodeSelector\",\n \"baseName\": \"nodeSelector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"tolerations\",\n \"baseName\": \"tolerations\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1alpha1Scheduling.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1ServerStorageVersion = void 0;\n/**\n* An API server instance reports the version it can decode and the version it encodes objects to when persisting objects in the backend.\n*/\nclass V1alpha1ServerStorageVersion {\n static getAttributeTypeMap() {\n return V1alpha1ServerStorageVersion.attributeTypeMap;\n }\n}\nexports.V1alpha1ServerStorageVersion = V1alpha1ServerStorageVersion;\nV1alpha1ServerStorageVersion.discriminator = undefined;\nV1alpha1ServerStorageVersion.attributeTypeMap = [\n {\n \"name\": \"apiServerID\",\n \"baseName\": \"apiServerID\",\n \"type\": \"string\"\n },\n {\n \"name\": \"decodableVersions\",\n \"baseName\": \"decodableVersions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"encodingVersion\",\n \"baseName\": \"encodingVersion\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1alpha1ServerStorageVersion.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1StorageVersion = void 0;\n/**\n* Storage version of a specific resource.\n*/\nclass V1alpha1StorageVersion {\n static getAttributeTypeMap() {\n return V1alpha1StorageVersion.attributeTypeMap;\n }\n}\nexports.V1alpha1StorageVersion = V1alpha1StorageVersion;\nV1alpha1StorageVersion.discriminator = undefined;\nV1alpha1StorageVersion.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"object\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1alpha1StorageVersionStatus\"\n }\n];\n//# sourceMappingURL=v1alpha1StorageVersion.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1StorageVersionCondition = void 0;\n/**\n* Describes the state of the storageVersion at a certain point.\n*/\nclass V1alpha1StorageVersionCondition {\n static getAttributeTypeMap() {\n return V1alpha1StorageVersionCondition.attributeTypeMap;\n }\n}\nexports.V1alpha1StorageVersionCondition = V1alpha1StorageVersionCondition;\nV1alpha1StorageVersionCondition.discriminator = undefined;\nV1alpha1StorageVersionCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1alpha1StorageVersionCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1StorageVersionList = void 0;\n/**\n* A list of StorageVersions.\n*/\nclass V1alpha1StorageVersionList {\n static getAttributeTypeMap() {\n return V1alpha1StorageVersionList.attributeTypeMap;\n }\n}\nexports.V1alpha1StorageVersionList = V1alpha1StorageVersionList;\nV1alpha1StorageVersionList.discriminator = undefined;\nV1alpha1StorageVersionList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1StorageVersionList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1StorageVersionStatus = void 0;\n/**\n* API server instances report the versions they can decode and the version they encode objects to when persisting objects in the backend.\n*/\nclass V1alpha1StorageVersionStatus {\n static getAttributeTypeMap() {\n return V1alpha1StorageVersionStatus.attributeTypeMap;\n }\n}\nexports.V1alpha1StorageVersionStatus = V1alpha1StorageVersionStatus;\nV1alpha1StorageVersionStatus.discriminator = undefined;\nV1alpha1StorageVersionStatus.attributeTypeMap = [\n {\n \"name\": \"commonEncodingVersion\",\n \"baseName\": \"commonEncodingVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"storageVersions\",\n \"baseName\": \"storageVersions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1alpha1StorageVersionStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1Subject = void 0;\n/**\n* Subject contains a reference to the object or user identities a role binding applies to. This can either hold a direct API object reference, or a value for non-objects such as user and group names.\n*/\nclass V1alpha1Subject {\n static getAttributeTypeMap() {\n return V1alpha1Subject.attributeTypeMap;\n }\n}\nexports.V1alpha1Subject = V1alpha1Subject;\nV1alpha1Subject.discriminator = undefined;\nV1alpha1Subject.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1alpha1Subject.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1VolumeAttachment = void 0;\n/**\n* VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node. VolumeAttachment objects are non-namespaced.\n*/\nclass V1alpha1VolumeAttachment {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachment.attributeTypeMap;\n }\n}\nexports.V1alpha1VolumeAttachment = V1alpha1VolumeAttachment;\nV1alpha1VolumeAttachment.discriminator = undefined;\nV1alpha1VolumeAttachment.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1alpha1VolumeAttachmentSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1alpha1VolumeAttachmentStatus\"\n }\n];\n//# sourceMappingURL=v1alpha1VolumeAttachment.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1VolumeAttachmentList = void 0;\n/**\n* VolumeAttachmentList is a collection of VolumeAttachment objects.\n*/\nclass V1alpha1VolumeAttachmentList {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachmentList.attributeTypeMap;\n }\n}\nexports.V1alpha1VolumeAttachmentList = V1alpha1VolumeAttachmentList;\nV1alpha1VolumeAttachmentList.discriminator = undefined;\nV1alpha1VolumeAttachmentList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1alpha1VolumeAttachmentList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1VolumeAttachmentSource = void 0;\n/**\n* VolumeAttachmentSource represents a volume that should be attached. Right now only PersistenVolumes can be attached via external attacher, in future we may allow also inline volumes in pods. Exactly one member can be set.\n*/\nclass V1alpha1VolumeAttachmentSource {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachmentSource.attributeTypeMap;\n }\n}\nexports.V1alpha1VolumeAttachmentSource = V1alpha1VolumeAttachmentSource;\nV1alpha1VolumeAttachmentSource.discriminator = undefined;\nV1alpha1VolumeAttachmentSource.attributeTypeMap = [\n {\n \"name\": \"inlineVolumeSpec\",\n \"baseName\": \"inlineVolumeSpec\",\n \"type\": \"V1PersistentVolumeSpec\"\n },\n {\n \"name\": \"persistentVolumeName\",\n \"baseName\": \"persistentVolumeName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1alpha1VolumeAttachmentSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1VolumeAttachmentSpec = void 0;\n/**\n* VolumeAttachmentSpec is the specification of a VolumeAttachment request.\n*/\nclass V1alpha1VolumeAttachmentSpec {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachmentSpec.attributeTypeMap;\n }\n}\nexports.V1alpha1VolumeAttachmentSpec = V1alpha1VolumeAttachmentSpec;\nV1alpha1VolumeAttachmentSpec.discriminator = undefined;\nV1alpha1VolumeAttachmentSpec.attributeTypeMap = [\n {\n \"name\": \"attacher\",\n \"baseName\": \"attacher\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"source\",\n \"baseName\": \"source\",\n \"type\": \"V1alpha1VolumeAttachmentSource\"\n }\n];\n//# sourceMappingURL=v1alpha1VolumeAttachmentSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1VolumeAttachmentStatus = void 0;\n/**\n* VolumeAttachmentStatus is the status of a VolumeAttachment request.\n*/\nclass V1alpha1VolumeAttachmentStatus {\n static getAttributeTypeMap() {\n return V1alpha1VolumeAttachmentStatus.attributeTypeMap;\n }\n}\nexports.V1alpha1VolumeAttachmentStatus = V1alpha1VolumeAttachmentStatus;\nV1alpha1VolumeAttachmentStatus.discriminator = undefined;\nV1alpha1VolumeAttachmentStatus.attributeTypeMap = [\n {\n \"name\": \"attachError\",\n \"baseName\": \"attachError\",\n \"type\": \"V1alpha1VolumeError\"\n },\n {\n \"name\": \"attached\",\n \"baseName\": \"attached\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"attachmentMetadata\",\n \"baseName\": \"attachmentMetadata\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"detachError\",\n \"baseName\": \"detachError\",\n \"type\": \"V1alpha1VolumeError\"\n }\n];\n//# sourceMappingURL=v1alpha1VolumeAttachmentStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1alpha1VolumeError = void 0;\n/**\n* VolumeError captures an error encountered during a volume operation.\n*/\nclass V1alpha1VolumeError {\n static getAttributeTypeMap() {\n return V1alpha1VolumeError.attributeTypeMap;\n }\n}\nexports.V1alpha1VolumeError = V1alpha1VolumeError;\nV1alpha1VolumeError.discriminator = undefined;\nV1alpha1VolumeError.attributeTypeMap = [\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"time\",\n \"baseName\": \"time\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1alpha1VolumeError.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1AllowedCSIDriver = void 0;\n/**\n* AllowedCSIDriver represents a single inline CSI Driver that is allowed to be used.\n*/\nclass V1beta1AllowedCSIDriver {\n static getAttributeTypeMap() {\n return V1beta1AllowedCSIDriver.attributeTypeMap;\n }\n}\nexports.V1beta1AllowedCSIDriver = V1beta1AllowedCSIDriver;\nV1beta1AllowedCSIDriver.discriminator = undefined;\nV1beta1AllowedCSIDriver.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1AllowedCSIDriver.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1AllowedFlexVolume = void 0;\n/**\n* AllowedFlexVolume represents a single Flexvolume that is allowed to be used.\n*/\nclass V1beta1AllowedFlexVolume {\n static getAttributeTypeMap() {\n return V1beta1AllowedFlexVolume.attributeTypeMap;\n }\n}\nexports.V1beta1AllowedFlexVolume = V1beta1AllowedFlexVolume;\nV1beta1AllowedFlexVolume.discriminator = undefined;\nV1beta1AllowedFlexVolume.attributeTypeMap = [\n {\n \"name\": \"driver\",\n \"baseName\": \"driver\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1AllowedFlexVolume.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1AllowedHostPath = void 0;\n/**\n* AllowedHostPath defines the host volume conditions that will be enabled by a policy for pods to use. It requires the path prefix to be defined.\n*/\nclass V1beta1AllowedHostPath {\n static getAttributeTypeMap() {\n return V1beta1AllowedHostPath.attributeTypeMap;\n }\n}\nexports.V1beta1AllowedHostPath = V1beta1AllowedHostPath;\nV1beta1AllowedHostPath.discriminator = undefined;\nV1beta1AllowedHostPath.attributeTypeMap = [\n {\n \"name\": \"pathPrefix\",\n \"baseName\": \"pathPrefix\",\n \"type\": \"string\"\n },\n {\n \"name\": \"readOnly\",\n \"baseName\": \"readOnly\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1beta1AllowedHostPath.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1CSIStorageCapacity = void 0;\n/**\n* CSIStorageCapacity stores the result of one CSI GetCapacity call. For a given StorageClass, this describes the available capacity in a particular topology segment. This can be used when considering where to instantiate new PersistentVolumes. For example this can express things like: - StorageClass \\\"standard\\\" has \\\"1234 GiB\\\" available in \\\"topology.kubernetes.io/zone=us-east1\\\" - StorageClass \\\"localssd\\\" has \\\"10 GiB\\\" available in \\\"kubernetes.io/hostname=knode-abc123\\\" The following three cases all imply that no capacity is available for a certain combination: - no object exists with suitable topology and storage class name - such an object exists, but the capacity is unset - such an object exists, but the capacity is zero The producer of these objects can decide which approach is more suitable. They are consumed by the kube-scheduler if the CSIStorageCapacity beta feature gate is enabled there and a CSI driver opts into capacity-aware scheduling with CSIDriver.StorageCapacity.\n*/\nclass V1beta1CSIStorageCapacity {\n static getAttributeTypeMap() {\n return V1beta1CSIStorageCapacity.attributeTypeMap;\n }\n}\nexports.V1beta1CSIStorageCapacity = V1beta1CSIStorageCapacity;\nV1beta1CSIStorageCapacity.discriminator = undefined;\nV1beta1CSIStorageCapacity.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"capacity\",\n \"baseName\": \"capacity\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"maximumVolumeSize\",\n \"baseName\": \"maximumVolumeSize\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"nodeTopology\",\n \"baseName\": \"nodeTopology\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"storageClassName\",\n \"baseName\": \"storageClassName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1CSIStorageCapacity.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1CSIStorageCapacityList = void 0;\n/**\n* CSIStorageCapacityList is a collection of CSIStorageCapacity objects.\n*/\nclass V1beta1CSIStorageCapacityList {\n static getAttributeTypeMap() {\n return V1beta1CSIStorageCapacityList.attributeTypeMap;\n }\n}\nexports.V1beta1CSIStorageCapacityList = V1beta1CSIStorageCapacityList;\nV1beta1CSIStorageCapacityList.discriminator = undefined;\nV1beta1CSIStorageCapacityList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1CSIStorageCapacityList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1CronJob = void 0;\n/**\n* CronJob represents the configuration of a single cron job.\n*/\nclass V1beta1CronJob {\n static getAttributeTypeMap() {\n return V1beta1CronJob.attributeTypeMap;\n }\n}\nexports.V1beta1CronJob = V1beta1CronJob;\nV1beta1CronJob.discriminator = undefined;\nV1beta1CronJob.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1CronJobSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1CronJobStatus\"\n }\n];\n//# sourceMappingURL=v1beta1CronJob.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1CronJobList = void 0;\n/**\n* CronJobList is a collection of cron jobs.\n*/\nclass V1beta1CronJobList {\n static getAttributeTypeMap() {\n return V1beta1CronJobList.attributeTypeMap;\n }\n}\nexports.V1beta1CronJobList = V1beta1CronJobList;\nV1beta1CronJobList.discriminator = undefined;\nV1beta1CronJobList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1CronJobList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1CronJobSpec = void 0;\n/**\n* CronJobSpec describes how the job execution will look like and when it will actually run.\n*/\nclass V1beta1CronJobSpec {\n static getAttributeTypeMap() {\n return V1beta1CronJobSpec.attributeTypeMap;\n }\n}\nexports.V1beta1CronJobSpec = V1beta1CronJobSpec;\nV1beta1CronJobSpec.discriminator = undefined;\nV1beta1CronJobSpec.attributeTypeMap = [\n {\n \"name\": \"concurrencyPolicy\",\n \"baseName\": \"concurrencyPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"failedJobsHistoryLimit\",\n \"baseName\": \"failedJobsHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"jobTemplate\",\n \"baseName\": \"jobTemplate\",\n \"type\": \"V1beta1JobTemplateSpec\"\n },\n {\n \"name\": \"schedule\",\n \"baseName\": \"schedule\",\n \"type\": \"string\"\n },\n {\n \"name\": \"startingDeadlineSeconds\",\n \"baseName\": \"startingDeadlineSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"successfulJobsHistoryLimit\",\n \"baseName\": \"successfulJobsHistoryLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"suspend\",\n \"baseName\": \"suspend\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1beta1CronJobSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1CronJobStatus = void 0;\n/**\n* CronJobStatus represents the current state of a cron job.\n*/\nclass V1beta1CronJobStatus {\n static getAttributeTypeMap() {\n return V1beta1CronJobStatus.attributeTypeMap;\n }\n}\nexports.V1beta1CronJobStatus = V1beta1CronJobStatus;\nV1beta1CronJobStatus.discriminator = undefined;\nV1beta1CronJobStatus.attributeTypeMap = [\n {\n \"name\": \"active\",\n \"baseName\": \"active\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"lastScheduleTime\",\n \"baseName\": \"lastScheduleTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"lastSuccessfulTime\",\n \"baseName\": \"lastSuccessfulTime\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1beta1CronJobStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1Endpoint = void 0;\n/**\n* Endpoint represents a single logical \\\"backend\\\" implementing a service.\n*/\nclass V1beta1Endpoint {\n static getAttributeTypeMap() {\n return V1beta1Endpoint.attributeTypeMap;\n }\n}\nexports.V1beta1Endpoint = V1beta1Endpoint;\nV1beta1Endpoint.discriminator = undefined;\nV1beta1Endpoint.attributeTypeMap = [\n {\n \"name\": \"addresses\",\n \"baseName\": \"addresses\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"V1beta1EndpointConditions\"\n },\n {\n \"name\": \"hints\",\n \"baseName\": \"hints\",\n \"type\": \"V1beta1EndpointHints\"\n },\n {\n \"name\": \"hostname\",\n \"baseName\": \"hostname\",\n \"type\": \"string\"\n },\n {\n \"name\": \"nodeName\",\n \"baseName\": \"nodeName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetRef\",\n \"baseName\": \"targetRef\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"topology\",\n \"baseName\": \"topology\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\n//# sourceMappingURL=v1beta1Endpoint.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1EndpointConditions = void 0;\n/**\n* EndpointConditions represents the current condition of an endpoint.\n*/\nclass V1beta1EndpointConditions {\n static getAttributeTypeMap() {\n return V1beta1EndpointConditions.attributeTypeMap;\n }\n}\nexports.V1beta1EndpointConditions = V1beta1EndpointConditions;\nV1beta1EndpointConditions.discriminator = undefined;\nV1beta1EndpointConditions.attributeTypeMap = [\n {\n \"name\": \"ready\",\n \"baseName\": \"ready\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"serving\",\n \"baseName\": \"serving\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"terminating\",\n \"baseName\": \"terminating\",\n \"type\": \"boolean\"\n }\n];\n//# sourceMappingURL=v1beta1EndpointConditions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1EndpointHints = void 0;\n/**\n* EndpointHints provides hints describing how an endpoint should be consumed.\n*/\nclass V1beta1EndpointHints {\n static getAttributeTypeMap() {\n return V1beta1EndpointHints.attributeTypeMap;\n }\n}\nexports.V1beta1EndpointHints = V1beta1EndpointHints;\nV1beta1EndpointHints.discriminator = undefined;\nV1beta1EndpointHints.attributeTypeMap = [\n {\n \"name\": \"forZones\",\n \"baseName\": \"forZones\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1EndpointHints.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1EndpointPort = void 0;\n/**\n* EndpointPort represents a Port used by an EndpointSlice\n*/\nclass V1beta1EndpointPort {\n static getAttributeTypeMap() {\n return V1beta1EndpointPort.attributeTypeMap;\n }\n}\nexports.V1beta1EndpointPort = V1beta1EndpointPort;\nV1beta1EndpointPort.discriminator = undefined;\nV1beta1EndpointPort.attributeTypeMap = [\n {\n \"name\": \"appProtocol\",\n \"baseName\": \"appProtocol\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"port\",\n \"baseName\": \"port\",\n \"type\": \"number\"\n },\n {\n \"name\": \"protocol\",\n \"baseName\": \"protocol\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1EndpointPort.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1EndpointSlice = void 0;\n/**\n* EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.\n*/\nclass V1beta1EndpointSlice {\n static getAttributeTypeMap() {\n return V1beta1EndpointSlice.attributeTypeMap;\n }\n}\nexports.V1beta1EndpointSlice = V1beta1EndpointSlice;\nV1beta1EndpointSlice.discriminator = undefined;\nV1beta1EndpointSlice.attributeTypeMap = [\n {\n \"name\": \"addressType\",\n \"baseName\": \"addressType\",\n \"type\": \"string\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"endpoints\",\n \"baseName\": \"endpoints\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"ports\",\n \"baseName\": \"ports\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1EndpointSlice.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1EndpointSliceList = void 0;\n/**\n* EndpointSliceList represents a list of endpoint slices\n*/\nclass V1beta1EndpointSliceList {\n static getAttributeTypeMap() {\n return V1beta1EndpointSliceList.attributeTypeMap;\n }\n}\nexports.V1beta1EndpointSliceList = V1beta1EndpointSliceList;\nV1beta1EndpointSliceList.discriminator = undefined;\nV1beta1EndpointSliceList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1EndpointSliceList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1Event = void 0;\n/**\n* Event is a report of an event somewhere in the cluster. It generally denotes some state change in the system. Events have a limited retention time and triggers and messages may evolve with time. Event consumers should not rely on the timing of an event with a given Reason reflecting a consistent underlying trigger, or the continued existence of events with that Reason. Events should be treated as informative, best-effort, supplemental data.\n*/\nclass V1beta1Event {\n static getAttributeTypeMap() {\n return V1beta1Event.attributeTypeMap;\n }\n}\nexports.V1beta1Event = V1beta1Event;\nV1beta1Event.discriminator = undefined;\nV1beta1Event.attributeTypeMap = [\n {\n \"name\": \"action\",\n \"baseName\": \"action\",\n \"type\": \"string\"\n },\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"deprecatedCount\",\n \"baseName\": \"deprecatedCount\",\n \"type\": \"number\"\n },\n {\n \"name\": \"deprecatedFirstTimestamp\",\n \"baseName\": \"deprecatedFirstTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"deprecatedLastTimestamp\",\n \"baseName\": \"deprecatedLastTimestamp\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"deprecatedSource\",\n \"baseName\": \"deprecatedSource\",\n \"type\": \"V1EventSource\"\n },\n {\n \"name\": \"eventTime\",\n \"baseName\": \"eventTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"note\",\n \"baseName\": \"note\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"regarding\",\n \"baseName\": \"regarding\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"related\",\n \"baseName\": \"related\",\n \"type\": \"V1ObjectReference\"\n },\n {\n \"name\": \"reportingController\",\n \"baseName\": \"reportingController\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reportingInstance\",\n \"baseName\": \"reportingInstance\",\n \"type\": \"string\"\n },\n {\n \"name\": \"series\",\n \"baseName\": \"series\",\n \"type\": \"V1beta1EventSeries\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1Event.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1EventList = void 0;\n/**\n* EventList is a list of Event objects.\n*/\nclass V1beta1EventList {\n static getAttributeTypeMap() {\n return V1beta1EventList.attributeTypeMap;\n }\n}\nexports.V1beta1EventList = V1beta1EventList;\nV1beta1EventList.discriminator = undefined;\nV1beta1EventList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1EventList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1EventSeries = void 0;\n/**\n* EventSeries contain information on series of events, i.e. thing that was/is happening continuously for some time.\n*/\nclass V1beta1EventSeries {\n static getAttributeTypeMap() {\n return V1beta1EventSeries.attributeTypeMap;\n }\n}\nexports.V1beta1EventSeries = V1beta1EventSeries;\nV1beta1EventSeries.discriminator = undefined;\nV1beta1EventSeries.attributeTypeMap = [\n {\n \"name\": \"count\",\n \"baseName\": \"count\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastObservedTime\",\n \"baseName\": \"lastObservedTime\",\n \"type\": \"Date\"\n }\n];\n//# sourceMappingURL=v1beta1EventSeries.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1FSGroupStrategyOptions = void 0;\n/**\n* FSGroupStrategyOptions defines the strategy type and options used to create the strategy.\n*/\nclass V1beta1FSGroupStrategyOptions {\n static getAttributeTypeMap() {\n return V1beta1FSGroupStrategyOptions.attributeTypeMap;\n }\n}\nexports.V1beta1FSGroupStrategyOptions = V1beta1FSGroupStrategyOptions;\nV1beta1FSGroupStrategyOptions.discriminator = undefined;\nV1beta1FSGroupStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1FSGroupStrategyOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1FlowDistinguisherMethod = void 0;\n/**\n* FlowDistinguisherMethod specifies the method of a flow distinguisher.\n*/\nclass V1beta1FlowDistinguisherMethod {\n static getAttributeTypeMap() {\n return V1beta1FlowDistinguisherMethod.attributeTypeMap;\n }\n}\nexports.V1beta1FlowDistinguisherMethod = V1beta1FlowDistinguisherMethod;\nV1beta1FlowDistinguisherMethod.discriminator = undefined;\nV1beta1FlowDistinguisherMethod.attributeTypeMap = [\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1FlowDistinguisherMethod.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1FlowSchema = void 0;\n/**\n* FlowSchema defines the schema of a group of flows. Note that a flow is made up of a set of inbound API requests with similar attributes and is identified by a pair of strings: the name of the FlowSchema and a \\\"flow distinguisher\\\".\n*/\nclass V1beta1FlowSchema {\n static getAttributeTypeMap() {\n return V1beta1FlowSchema.attributeTypeMap;\n }\n}\nexports.V1beta1FlowSchema = V1beta1FlowSchema;\nV1beta1FlowSchema.discriminator = undefined;\nV1beta1FlowSchema.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1FlowSchemaSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1FlowSchemaStatus\"\n }\n];\n//# sourceMappingURL=v1beta1FlowSchema.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1FlowSchemaCondition = void 0;\n/**\n* FlowSchemaCondition describes conditions for a FlowSchema.\n*/\nclass V1beta1FlowSchemaCondition {\n static getAttributeTypeMap() {\n return V1beta1FlowSchemaCondition.attributeTypeMap;\n }\n}\nexports.V1beta1FlowSchemaCondition = V1beta1FlowSchemaCondition;\nV1beta1FlowSchemaCondition.discriminator = undefined;\nV1beta1FlowSchemaCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1FlowSchemaCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1FlowSchemaList = void 0;\n/**\n* FlowSchemaList is a list of FlowSchema objects.\n*/\nclass V1beta1FlowSchemaList {\n static getAttributeTypeMap() {\n return V1beta1FlowSchemaList.attributeTypeMap;\n }\n}\nexports.V1beta1FlowSchemaList = V1beta1FlowSchemaList;\nV1beta1FlowSchemaList.discriminator = undefined;\nV1beta1FlowSchemaList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1FlowSchemaList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1FlowSchemaSpec = void 0;\n/**\n* FlowSchemaSpec describes how the FlowSchema\\'s specification looks like.\n*/\nclass V1beta1FlowSchemaSpec {\n static getAttributeTypeMap() {\n return V1beta1FlowSchemaSpec.attributeTypeMap;\n }\n}\nexports.V1beta1FlowSchemaSpec = V1beta1FlowSchemaSpec;\nV1beta1FlowSchemaSpec.discriminator = undefined;\nV1beta1FlowSchemaSpec.attributeTypeMap = [\n {\n \"name\": \"distinguisherMethod\",\n \"baseName\": \"distinguisherMethod\",\n \"type\": \"V1beta1FlowDistinguisherMethod\"\n },\n {\n \"name\": \"matchingPrecedence\",\n \"baseName\": \"matchingPrecedence\",\n \"type\": \"number\"\n },\n {\n \"name\": \"priorityLevelConfiguration\",\n \"baseName\": \"priorityLevelConfiguration\",\n \"type\": \"V1beta1PriorityLevelConfigurationReference\"\n },\n {\n \"name\": \"rules\",\n \"baseName\": \"rules\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1FlowSchemaSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1FlowSchemaStatus = void 0;\n/**\n* FlowSchemaStatus represents the current state of a FlowSchema.\n*/\nclass V1beta1FlowSchemaStatus {\n static getAttributeTypeMap() {\n return V1beta1FlowSchemaStatus.attributeTypeMap;\n }\n}\nexports.V1beta1FlowSchemaStatus = V1beta1FlowSchemaStatus;\nV1beta1FlowSchemaStatus.discriminator = undefined;\nV1beta1FlowSchemaStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1FlowSchemaStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1ForZone = void 0;\n/**\n* ForZone provides information about which zones should consume this endpoint.\n*/\nclass V1beta1ForZone {\n static getAttributeTypeMap() {\n return V1beta1ForZone.attributeTypeMap;\n }\n}\nexports.V1beta1ForZone = V1beta1ForZone;\nV1beta1ForZone.discriminator = undefined;\nV1beta1ForZone.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1ForZone.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1GroupSubject = void 0;\n/**\n* GroupSubject holds detailed information for group-kind subject.\n*/\nclass V1beta1GroupSubject {\n static getAttributeTypeMap() {\n return V1beta1GroupSubject.attributeTypeMap;\n }\n}\nexports.V1beta1GroupSubject = V1beta1GroupSubject;\nV1beta1GroupSubject.discriminator = undefined;\nV1beta1GroupSubject.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1GroupSubject.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1HostPortRange = void 0;\n/**\n* HostPortRange defines a range of host ports that will be enabled by a policy for pods to use. It requires both the start and end to be defined.\n*/\nclass V1beta1HostPortRange {\n static getAttributeTypeMap() {\n return V1beta1HostPortRange.attributeTypeMap;\n }\n}\nexports.V1beta1HostPortRange = V1beta1HostPortRange;\nV1beta1HostPortRange.discriminator = undefined;\nV1beta1HostPortRange.attributeTypeMap = [\n {\n \"name\": \"max\",\n \"baseName\": \"max\",\n \"type\": \"number\"\n },\n {\n \"name\": \"min\",\n \"baseName\": \"min\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1beta1HostPortRange.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1IDRange = void 0;\n/**\n* IDRange provides a min/max of an allowed range of IDs.\n*/\nclass V1beta1IDRange {\n static getAttributeTypeMap() {\n return V1beta1IDRange.attributeTypeMap;\n }\n}\nexports.V1beta1IDRange = V1beta1IDRange;\nV1beta1IDRange.discriminator = undefined;\nV1beta1IDRange.attributeTypeMap = [\n {\n \"name\": \"max\",\n \"baseName\": \"max\",\n \"type\": \"number\"\n },\n {\n \"name\": \"min\",\n \"baseName\": \"min\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1beta1IDRange.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1JobTemplateSpec = void 0;\n/**\n* JobTemplateSpec describes the data a Job should have when created from a template\n*/\nclass V1beta1JobTemplateSpec {\n static getAttributeTypeMap() {\n return V1beta1JobTemplateSpec.attributeTypeMap;\n }\n}\nexports.V1beta1JobTemplateSpec = V1beta1JobTemplateSpec;\nV1beta1JobTemplateSpec.discriminator = undefined;\nV1beta1JobTemplateSpec.attributeTypeMap = [\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1JobSpec\"\n }\n];\n//# sourceMappingURL=v1beta1JobTemplateSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1LimitResponse = void 0;\n/**\n* LimitResponse defines how to handle requests that can not be executed right now.\n*/\nclass V1beta1LimitResponse {\n static getAttributeTypeMap() {\n return V1beta1LimitResponse.attributeTypeMap;\n }\n}\nexports.V1beta1LimitResponse = V1beta1LimitResponse;\nV1beta1LimitResponse.discriminator = undefined;\nV1beta1LimitResponse.attributeTypeMap = [\n {\n \"name\": \"queuing\",\n \"baseName\": \"queuing\",\n \"type\": \"V1beta1QueuingConfiguration\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1LimitResponse.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1LimitedPriorityLevelConfiguration = void 0;\n/**\n* LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues: * How are requests for this priority level limited? * What should be done with requests that exceed the limit?\n*/\nclass V1beta1LimitedPriorityLevelConfiguration {\n static getAttributeTypeMap() {\n return V1beta1LimitedPriorityLevelConfiguration.attributeTypeMap;\n }\n}\nexports.V1beta1LimitedPriorityLevelConfiguration = V1beta1LimitedPriorityLevelConfiguration;\nV1beta1LimitedPriorityLevelConfiguration.discriminator = undefined;\nV1beta1LimitedPriorityLevelConfiguration.attributeTypeMap = [\n {\n \"name\": \"assuredConcurrencyShares\",\n \"baseName\": \"assuredConcurrencyShares\",\n \"type\": \"number\"\n },\n {\n \"name\": \"limitResponse\",\n \"baseName\": \"limitResponse\",\n \"type\": \"V1beta1LimitResponse\"\n }\n];\n//# sourceMappingURL=v1beta1LimitedPriorityLevelConfiguration.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1NonResourcePolicyRule = void 0;\n/**\n* NonResourcePolicyRule is a predicate that matches non-resource requests according to their verb and the target non-resource URL. A NonResourcePolicyRule matches a request if and only if both (a) at least one member of verbs matches the request and (b) at least one member of nonResourceURLs matches the request.\n*/\nclass V1beta1NonResourcePolicyRule {\n static getAttributeTypeMap() {\n return V1beta1NonResourcePolicyRule.attributeTypeMap;\n }\n}\nexports.V1beta1NonResourcePolicyRule = V1beta1NonResourcePolicyRule;\nV1beta1NonResourcePolicyRule.discriminator = undefined;\nV1beta1NonResourcePolicyRule.attributeTypeMap = [\n {\n \"name\": \"nonResourceURLs\",\n \"baseName\": \"nonResourceURLs\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1NonResourcePolicyRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1Overhead = void 0;\n/**\n* Overhead structure represents the resource overhead associated with running a pod.\n*/\nclass V1beta1Overhead {\n static getAttributeTypeMap() {\n return V1beta1Overhead.attributeTypeMap;\n }\n}\nexports.V1beta1Overhead = V1beta1Overhead;\nV1beta1Overhead.discriminator = undefined;\nV1beta1Overhead.attributeTypeMap = [\n {\n \"name\": \"podFixed\",\n \"baseName\": \"podFixed\",\n \"type\": \"{ [key: string]: string; }\"\n }\n];\n//# sourceMappingURL=v1beta1Overhead.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PodDisruptionBudget = void 0;\n/**\n* PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods\n*/\nclass V1beta1PodDisruptionBudget {\n static getAttributeTypeMap() {\n return V1beta1PodDisruptionBudget.attributeTypeMap;\n }\n}\nexports.V1beta1PodDisruptionBudget = V1beta1PodDisruptionBudget;\nV1beta1PodDisruptionBudget.discriminator = undefined;\nV1beta1PodDisruptionBudget.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1PodDisruptionBudgetSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1PodDisruptionBudgetStatus\"\n }\n];\n//# sourceMappingURL=v1beta1PodDisruptionBudget.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PodDisruptionBudgetList = void 0;\n/**\n* PodDisruptionBudgetList is a collection of PodDisruptionBudgets.\n*/\nclass V1beta1PodDisruptionBudgetList {\n static getAttributeTypeMap() {\n return V1beta1PodDisruptionBudgetList.attributeTypeMap;\n }\n}\nexports.V1beta1PodDisruptionBudgetList = V1beta1PodDisruptionBudgetList;\nV1beta1PodDisruptionBudgetList.discriminator = undefined;\nV1beta1PodDisruptionBudgetList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1PodDisruptionBudgetList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PodDisruptionBudgetSpec = void 0;\n/**\n* PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.\n*/\nclass V1beta1PodDisruptionBudgetSpec {\n static getAttributeTypeMap() {\n return V1beta1PodDisruptionBudgetSpec.attributeTypeMap;\n }\n}\nexports.V1beta1PodDisruptionBudgetSpec = V1beta1PodDisruptionBudgetSpec;\nV1beta1PodDisruptionBudgetSpec.discriminator = undefined;\nV1beta1PodDisruptionBudgetSpec.attributeTypeMap = [\n {\n \"name\": \"maxUnavailable\",\n \"baseName\": \"maxUnavailable\",\n \"type\": \"IntOrString\"\n },\n {\n \"name\": \"minAvailable\",\n \"baseName\": \"minAvailable\",\n \"type\": \"IntOrString\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n }\n];\n//# sourceMappingURL=v1beta1PodDisruptionBudgetSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PodDisruptionBudgetStatus = void 0;\n/**\n* PodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.\n*/\nclass V1beta1PodDisruptionBudgetStatus {\n static getAttributeTypeMap() {\n return V1beta1PodDisruptionBudgetStatus.attributeTypeMap;\n }\n}\nexports.V1beta1PodDisruptionBudgetStatus = V1beta1PodDisruptionBudgetStatus;\nV1beta1PodDisruptionBudgetStatus.discriminator = undefined;\nV1beta1PodDisruptionBudgetStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentHealthy\",\n \"baseName\": \"currentHealthy\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredHealthy\",\n \"baseName\": \"desiredHealthy\",\n \"type\": \"number\"\n },\n {\n \"name\": \"disruptedPods\",\n \"baseName\": \"disruptedPods\",\n \"type\": \"{ [key: string]: Date; }\"\n },\n {\n \"name\": \"disruptionsAllowed\",\n \"baseName\": \"disruptionsAllowed\",\n \"type\": \"number\"\n },\n {\n \"name\": \"expectedPods\",\n \"baseName\": \"expectedPods\",\n \"type\": \"number\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1beta1PodDisruptionBudgetStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PodSecurityPolicy = void 0;\n/**\n* PodSecurityPolicy governs the ability to make requests that affect the Security Context that will be applied to a pod and container. Deprecated in 1.21.\n*/\nclass V1beta1PodSecurityPolicy {\n static getAttributeTypeMap() {\n return V1beta1PodSecurityPolicy.attributeTypeMap;\n }\n}\nexports.V1beta1PodSecurityPolicy = V1beta1PodSecurityPolicy;\nV1beta1PodSecurityPolicy.discriminator = undefined;\nV1beta1PodSecurityPolicy.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1PodSecurityPolicySpec\"\n }\n];\n//# sourceMappingURL=v1beta1PodSecurityPolicy.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PodSecurityPolicyList = void 0;\n/**\n* PodSecurityPolicyList is a list of PodSecurityPolicy objects.\n*/\nclass V1beta1PodSecurityPolicyList {\n static getAttributeTypeMap() {\n return V1beta1PodSecurityPolicyList.attributeTypeMap;\n }\n}\nexports.V1beta1PodSecurityPolicyList = V1beta1PodSecurityPolicyList;\nV1beta1PodSecurityPolicyList.discriminator = undefined;\nV1beta1PodSecurityPolicyList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1PodSecurityPolicyList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PodSecurityPolicySpec = void 0;\n/**\n* PodSecurityPolicySpec defines the policy enforced.\n*/\nclass V1beta1PodSecurityPolicySpec {\n static getAttributeTypeMap() {\n return V1beta1PodSecurityPolicySpec.attributeTypeMap;\n }\n}\nexports.V1beta1PodSecurityPolicySpec = V1beta1PodSecurityPolicySpec;\nV1beta1PodSecurityPolicySpec.discriminator = undefined;\nV1beta1PodSecurityPolicySpec.attributeTypeMap = [\n {\n \"name\": \"allowPrivilegeEscalation\",\n \"baseName\": \"allowPrivilegeEscalation\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"allowedCSIDrivers\",\n \"baseName\": \"allowedCSIDrivers\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedCapabilities\",\n \"baseName\": \"allowedCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedFlexVolumes\",\n \"baseName\": \"allowedFlexVolumes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedHostPaths\",\n \"baseName\": \"allowedHostPaths\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedProcMountTypes\",\n \"baseName\": \"allowedProcMountTypes\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"allowedUnsafeSysctls\",\n \"baseName\": \"allowedUnsafeSysctls\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"defaultAddCapabilities\",\n \"baseName\": \"defaultAddCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"defaultAllowPrivilegeEscalation\",\n \"baseName\": \"defaultAllowPrivilegeEscalation\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"forbiddenSysctls\",\n \"baseName\": \"forbiddenSysctls\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"fsGroup\",\n \"baseName\": \"fsGroup\",\n \"type\": \"V1beta1FSGroupStrategyOptions\"\n },\n {\n \"name\": \"hostIPC\",\n \"baseName\": \"hostIPC\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostNetwork\",\n \"baseName\": \"hostNetwork\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostPID\",\n \"baseName\": \"hostPID\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"hostPorts\",\n \"baseName\": \"hostPorts\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"privileged\",\n \"baseName\": \"privileged\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"readOnlyRootFilesystem\",\n \"baseName\": \"readOnlyRootFilesystem\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"requiredDropCapabilities\",\n \"baseName\": \"requiredDropCapabilities\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"runAsGroup\",\n \"baseName\": \"runAsGroup\",\n \"type\": \"V1beta1RunAsGroupStrategyOptions\"\n },\n {\n \"name\": \"runAsUser\",\n \"baseName\": \"runAsUser\",\n \"type\": \"V1beta1RunAsUserStrategyOptions\"\n },\n {\n \"name\": \"runtimeClass\",\n \"baseName\": \"runtimeClass\",\n \"type\": \"V1beta1RuntimeClassStrategyOptions\"\n },\n {\n \"name\": \"seLinux\",\n \"baseName\": \"seLinux\",\n \"type\": \"V1beta1SELinuxStrategyOptions\"\n },\n {\n \"name\": \"supplementalGroups\",\n \"baseName\": \"supplementalGroups\",\n \"type\": \"V1beta1SupplementalGroupsStrategyOptions\"\n },\n {\n \"name\": \"volumes\",\n \"baseName\": \"volumes\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1PodSecurityPolicySpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PolicyRulesWithSubjects = void 0;\n/**\n* PolicyRulesWithSubjects prescribes a test that applies to a request to an apiserver. The test considers the subject making the request, the verb being requested, and the resource to be acted upon. This PolicyRulesWithSubjects matches a request if and only if both (a) at least one member of subjects matches the request and (b) at least one member of resourceRules or nonResourceRules matches the request.\n*/\nclass V1beta1PolicyRulesWithSubjects {\n static getAttributeTypeMap() {\n return V1beta1PolicyRulesWithSubjects.attributeTypeMap;\n }\n}\nexports.V1beta1PolicyRulesWithSubjects = V1beta1PolicyRulesWithSubjects;\nV1beta1PolicyRulesWithSubjects.discriminator = undefined;\nV1beta1PolicyRulesWithSubjects.attributeTypeMap = [\n {\n \"name\": \"nonResourceRules\",\n \"baseName\": \"nonResourceRules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resourceRules\",\n \"baseName\": \"resourceRules\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"subjects\",\n \"baseName\": \"subjects\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1PolicyRulesWithSubjects.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PriorityLevelConfiguration = void 0;\n/**\n* PriorityLevelConfiguration represents the configuration of a priority level.\n*/\nclass V1beta1PriorityLevelConfiguration {\n static getAttributeTypeMap() {\n return V1beta1PriorityLevelConfiguration.attributeTypeMap;\n }\n}\nexports.V1beta1PriorityLevelConfiguration = V1beta1PriorityLevelConfiguration;\nV1beta1PriorityLevelConfiguration.discriminator = undefined;\nV1beta1PriorityLevelConfiguration.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V1beta1PriorityLevelConfigurationSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V1beta1PriorityLevelConfigurationStatus\"\n }\n];\n//# sourceMappingURL=v1beta1PriorityLevelConfiguration.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PriorityLevelConfigurationCondition = void 0;\n/**\n* PriorityLevelConfigurationCondition defines the condition of priority level.\n*/\nclass V1beta1PriorityLevelConfigurationCondition {\n static getAttributeTypeMap() {\n return V1beta1PriorityLevelConfigurationCondition.attributeTypeMap;\n }\n}\nexports.V1beta1PriorityLevelConfigurationCondition = V1beta1PriorityLevelConfigurationCondition;\nV1beta1PriorityLevelConfigurationCondition.discriminator = undefined;\nV1beta1PriorityLevelConfigurationCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1PriorityLevelConfigurationCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PriorityLevelConfigurationList = void 0;\n/**\n* PriorityLevelConfigurationList is a list of PriorityLevelConfiguration objects.\n*/\nclass V1beta1PriorityLevelConfigurationList {\n static getAttributeTypeMap() {\n return V1beta1PriorityLevelConfigurationList.attributeTypeMap;\n }\n}\nexports.V1beta1PriorityLevelConfigurationList = V1beta1PriorityLevelConfigurationList;\nV1beta1PriorityLevelConfigurationList.discriminator = undefined;\nV1beta1PriorityLevelConfigurationList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1PriorityLevelConfigurationList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PriorityLevelConfigurationReference = void 0;\n/**\n* PriorityLevelConfigurationReference contains information that points to the \\\"request-priority\\\" being used.\n*/\nclass V1beta1PriorityLevelConfigurationReference {\n static getAttributeTypeMap() {\n return V1beta1PriorityLevelConfigurationReference.attributeTypeMap;\n }\n}\nexports.V1beta1PriorityLevelConfigurationReference = V1beta1PriorityLevelConfigurationReference;\nV1beta1PriorityLevelConfigurationReference.discriminator = undefined;\nV1beta1PriorityLevelConfigurationReference.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1PriorityLevelConfigurationReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PriorityLevelConfigurationSpec = void 0;\n/**\n* PriorityLevelConfigurationSpec specifies the configuration of a priority level.\n*/\nclass V1beta1PriorityLevelConfigurationSpec {\n static getAttributeTypeMap() {\n return V1beta1PriorityLevelConfigurationSpec.attributeTypeMap;\n }\n}\nexports.V1beta1PriorityLevelConfigurationSpec = V1beta1PriorityLevelConfigurationSpec;\nV1beta1PriorityLevelConfigurationSpec.discriminator = undefined;\nV1beta1PriorityLevelConfigurationSpec.attributeTypeMap = [\n {\n \"name\": \"limited\",\n \"baseName\": \"limited\",\n \"type\": \"V1beta1LimitedPriorityLevelConfiguration\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1PriorityLevelConfigurationSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1PriorityLevelConfigurationStatus = void 0;\n/**\n* PriorityLevelConfigurationStatus represents the current state of a \\\"request-priority\\\".\n*/\nclass V1beta1PriorityLevelConfigurationStatus {\n static getAttributeTypeMap() {\n return V1beta1PriorityLevelConfigurationStatus.attributeTypeMap;\n }\n}\nexports.V1beta1PriorityLevelConfigurationStatus = V1beta1PriorityLevelConfigurationStatus;\nV1beta1PriorityLevelConfigurationStatus.discriminator = undefined;\nV1beta1PriorityLevelConfigurationStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1PriorityLevelConfigurationStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1QueuingConfiguration = void 0;\n/**\n* QueuingConfiguration holds the configuration parameters for queuing\n*/\nclass V1beta1QueuingConfiguration {\n static getAttributeTypeMap() {\n return V1beta1QueuingConfiguration.attributeTypeMap;\n }\n}\nexports.V1beta1QueuingConfiguration = V1beta1QueuingConfiguration;\nV1beta1QueuingConfiguration.discriminator = undefined;\nV1beta1QueuingConfiguration.attributeTypeMap = [\n {\n \"name\": \"handSize\",\n \"baseName\": \"handSize\",\n \"type\": \"number\"\n },\n {\n \"name\": \"queueLengthLimit\",\n \"baseName\": \"queueLengthLimit\",\n \"type\": \"number\"\n },\n {\n \"name\": \"queues\",\n \"baseName\": \"queues\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v1beta1QueuingConfiguration.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1ResourcePolicyRule = void 0;\n/**\n* ResourcePolicyRule is a predicate that matches some resource requests, testing the request\\'s verb and the target resource. A ResourcePolicyRule matches a resource request if and only if: (a) at least one member of verbs matches the request, (b) at least one member of apiGroups matches the request, (c) at least one member of resources matches the request, and (d) least one member of namespaces matches the request.\n*/\nclass V1beta1ResourcePolicyRule {\n static getAttributeTypeMap() {\n return V1beta1ResourcePolicyRule.attributeTypeMap;\n }\n}\nexports.V1beta1ResourcePolicyRule = V1beta1ResourcePolicyRule;\nV1beta1ResourcePolicyRule.discriminator = undefined;\nV1beta1ResourcePolicyRule.attributeTypeMap = [\n {\n \"name\": \"apiGroups\",\n \"baseName\": \"apiGroups\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"clusterScope\",\n \"baseName\": \"clusterScope\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"namespaces\",\n \"baseName\": \"namespaces\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"resources\",\n \"baseName\": \"resources\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"verbs\",\n \"baseName\": \"verbs\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1ResourcePolicyRule.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1RunAsGroupStrategyOptions = void 0;\n/**\n* RunAsGroupStrategyOptions defines the strategy type and any options used to create the strategy.\n*/\nclass V1beta1RunAsGroupStrategyOptions {\n static getAttributeTypeMap() {\n return V1beta1RunAsGroupStrategyOptions.attributeTypeMap;\n }\n}\nexports.V1beta1RunAsGroupStrategyOptions = V1beta1RunAsGroupStrategyOptions;\nV1beta1RunAsGroupStrategyOptions.discriminator = undefined;\nV1beta1RunAsGroupStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1RunAsGroupStrategyOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1RunAsUserStrategyOptions = void 0;\n/**\n* RunAsUserStrategyOptions defines the strategy type and any options used to create the strategy.\n*/\nclass V1beta1RunAsUserStrategyOptions {\n static getAttributeTypeMap() {\n return V1beta1RunAsUserStrategyOptions.attributeTypeMap;\n }\n}\nexports.V1beta1RunAsUserStrategyOptions = V1beta1RunAsUserStrategyOptions;\nV1beta1RunAsUserStrategyOptions.discriminator = undefined;\nV1beta1RunAsUserStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1RunAsUserStrategyOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1RuntimeClass = void 0;\n/**\n* RuntimeClass defines a class of container runtime supported in the cluster. The RuntimeClass is used to determine which container runtime is used to run all containers in a pod. RuntimeClasses are (currently) manually defined by a user or cluster provisioner, and referenced in the PodSpec. The Kubelet is responsible for resolving the RuntimeClassName reference before running the pod. For more details, see https://git.k8s.io/enhancements/keps/sig-node/585-runtime-class\n*/\nclass V1beta1RuntimeClass {\n static getAttributeTypeMap() {\n return V1beta1RuntimeClass.attributeTypeMap;\n }\n}\nexports.V1beta1RuntimeClass = V1beta1RuntimeClass;\nV1beta1RuntimeClass.discriminator = undefined;\nV1beta1RuntimeClass.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"handler\",\n \"baseName\": \"handler\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"overhead\",\n \"baseName\": \"overhead\",\n \"type\": \"V1beta1Overhead\"\n },\n {\n \"name\": \"scheduling\",\n \"baseName\": \"scheduling\",\n \"type\": \"V1beta1Scheduling\"\n }\n];\n//# sourceMappingURL=v1beta1RuntimeClass.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1RuntimeClassList = void 0;\n/**\n* RuntimeClassList is a list of RuntimeClass objects.\n*/\nclass V1beta1RuntimeClassList {\n static getAttributeTypeMap() {\n return V1beta1RuntimeClassList.attributeTypeMap;\n }\n}\nexports.V1beta1RuntimeClassList = V1beta1RuntimeClassList;\nV1beta1RuntimeClassList.discriminator = undefined;\nV1beta1RuntimeClassList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v1beta1RuntimeClassList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1RuntimeClassStrategyOptions = void 0;\n/**\n* RuntimeClassStrategyOptions define the strategy that will dictate the allowable RuntimeClasses for a pod.\n*/\nclass V1beta1RuntimeClassStrategyOptions {\n static getAttributeTypeMap() {\n return V1beta1RuntimeClassStrategyOptions.attributeTypeMap;\n }\n}\nexports.V1beta1RuntimeClassStrategyOptions = V1beta1RuntimeClassStrategyOptions;\nV1beta1RuntimeClassStrategyOptions.discriminator = undefined;\nV1beta1RuntimeClassStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"allowedRuntimeClassNames\",\n \"baseName\": \"allowedRuntimeClassNames\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"defaultRuntimeClassName\",\n \"baseName\": \"defaultRuntimeClassName\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1RuntimeClassStrategyOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1SELinuxStrategyOptions = void 0;\n/**\n* SELinuxStrategyOptions defines the strategy type and any options used to create the strategy.\n*/\nclass V1beta1SELinuxStrategyOptions {\n static getAttributeTypeMap() {\n return V1beta1SELinuxStrategyOptions.attributeTypeMap;\n }\n}\nexports.V1beta1SELinuxStrategyOptions = V1beta1SELinuxStrategyOptions;\nV1beta1SELinuxStrategyOptions.discriminator = undefined;\nV1beta1SELinuxStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n },\n {\n \"name\": \"seLinuxOptions\",\n \"baseName\": \"seLinuxOptions\",\n \"type\": \"V1SELinuxOptions\"\n }\n];\n//# sourceMappingURL=v1beta1SELinuxStrategyOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1Scheduling = void 0;\n/**\n* Scheduling specifies the scheduling constraints for nodes supporting a RuntimeClass.\n*/\nclass V1beta1Scheduling {\n static getAttributeTypeMap() {\n return V1beta1Scheduling.attributeTypeMap;\n }\n}\nexports.V1beta1Scheduling = V1beta1Scheduling;\nV1beta1Scheduling.discriminator = undefined;\nV1beta1Scheduling.attributeTypeMap = [\n {\n \"name\": \"nodeSelector\",\n \"baseName\": \"nodeSelector\",\n \"type\": \"{ [key: string]: string; }\"\n },\n {\n \"name\": \"tolerations\",\n \"baseName\": \"tolerations\",\n \"type\": \"Array\"\n }\n];\n//# sourceMappingURL=v1beta1Scheduling.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1ServiceAccountSubject = void 0;\n/**\n* ServiceAccountSubject holds detailed information for service-account-kind subject.\n*/\nclass V1beta1ServiceAccountSubject {\n static getAttributeTypeMap() {\n return V1beta1ServiceAccountSubject.attributeTypeMap;\n }\n}\nexports.V1beta1ServiceAccountSubject = V1beta1ServiceAccountSubject;\nV1beta1ServiceAccountSubject.discriminator = undefined;\nV1beta1ServiceAccountSubject.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"namespace\",\n \"baseName\": \"namespace\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1ServiceAccountSubject.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1Subject = void 0;\n/**\n* Subject matches the originator of a request, as identified by the request authentication system. There are three ways of matching an originator; by user, group, or service account.\n*/\nclass V1beta1Subject {\n static getAttributeTypeMap() {\n return V1beta1Subject.attributeTypeMap;\n }\n}\nexports.V1beta1Subject = V1beta1Subject;\nV1beta1Subject.discriminator = undefined;\nV1beta1Subject.attributeTypeMap = [\n {\n \"name\": \"group\",\n \"baseName\": \"group\",\n \"type\": \"V1beta1GroupSubject\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"serviceAccount\",\n \"baseName\": \"serviceAccount\",\n \"type\": \"V1beta1ServiceAccountSubject\"\n },\n {\n \"name\": \"user\",\n \"baseName\": \"user\",\n \"type\": \"V1beta1UserSubject\"\n }\n];\n//# sourceMappingURL=v1beta1Subject.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1SupplementalGroupsStrategyOptions = void 0;\n/**\n* SupplementalGroupsStrategyOptions defines the strategy type and options used to create the strategy.\n*/\nclass V1beta1SupplementalGroupsStrategyOptions {\n static getAttributeTypeMap() {\n return V1beta1SupplementalGroupsStrategyOptions.attributeTypeMap;\n }\n}\nexports.V1beta1SupplementalGroupsStrategyOptions = V1beta1SupplementalGroupsStrategyOptions;\nV1beta1SupplementalGroupsStrategyOptions.discriminator = undefined;\nV1beta1SupplementalGroupsStrategyOptions.attributeTypeMap = [\n {\n \"name\": \"ranges\",\n \"baseName\": \"ranges\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"rule\",\n \"baseName\": \"rule\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1SupplementalGroupsStrategyOptions.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V1beta1UserSubject = void 0;\n/**\n* UserSubject holds detailed information for user-kind subject.\n*/\nclass V1beta1UserSubject {\n static getAttributeTypeMap() {\n return V1beta1UserSubject.attributeTypeMap;\n }\n}\nexports.V1beta1UserSubject = V1beta1UserSubject;\nV1beta1UserSubject.discriminator = undefined;\nV1beta1UserSubject.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v1beta1UserSubject.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1ContainerResourceMetricSource = void 0;\n/**\n* ContainerResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source. Only one \\\"target\\\" type should be set.\n*/\nclass V2beta1ContainerResourceMetricSource {\n static getAttributeTypeMap() {\n return V2beta1ContainerResourceMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta1ContainerResourceMetricSource = V2beta1ContainerResourceMetricSource;\nV2beta1ContainerResourceMetricSource.discriminator = undefined;\nV2beta1ContainerResourceMetricSource.attributeTypeMap = [\n {\n \"name\": \"container\",\n \"baseName\": \"container\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetAverageUtilization\",\n \"baseName\": \"targetAverageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"targetAverageValue\",\n \"baseName\": \"targetAverageValue\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1ContainerResourceMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1ContainerResourceMetricStatus = void 0;\n/**\n* ContainerResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source.\n*/\nclass V2beta1ContainerResourceMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1ContainerResourceMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta1ContainerResourceMetricStatus = V2beta1ContainerResourceMetricStatus;\nV2beta1ContainerResourceMetricStatus.discriminator = undefined;\nV2beta1ContainerResourceMetricStatus.attributeTypeMap = [\n {\n \"name\": \"container\",\n \"baseName\": \"container\",\n \"type\": \"string\"\n },\n {\n \"name\": \"currentAverageUtilization\",\n \"baseName\": \"currentAverageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentAverageValue\",\n \"baseName\": \"currentAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1ContainerResourceMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1CrossVersionObjectReference = void 0;\n/**\n* CrossVersionObjectReference contains enough information to let you identify the referred resource.\n*/\nclass V2beta1CrossVersionObjectReference {\n static getAttributeTypeMap() {\n return V2beta1CrossVersionObjectReference.attributeTypeMap;\n }\n}\nexports.V2beta1CrossVersionObjectReference = V2beta1CrossVersionObjectReference;\nV2beta1CrossVersionObjectReference.discriminator = undefined;\nV2beta1CrossVersionObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1CrossVersionObjectReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1ExternalMetricSource = void 0;\n/**\n* ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster). Exactly one \\\"target\\\" type should be set.\n*/\nclass V2beta1ExternalMetricSource {\n static getAttributeTypeMap() {\n return V2beta1ExternalMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta1ExternalMetricSource = V2beta1ExternalMetricSource;\nV2beta1ExternalMetricSource.discriminator = undefined;\nV2beta1ExternalMetricSource.attributeTypeMap = [\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricSelector\",\n \"baseName\": \"metricSelector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"targetAverageValue\",\n \"baseName\": \"targetAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetValue\",\n \"baseName\": \"targetValue\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1ExternalMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1ExternalMetricStatus = void 0;\n/**\n* ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.\n*/\nclass V2beta1ExternalMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1ExternalMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta1ExternalMetricStatus = V2beta1ExternalMetricStatus;\nV2beta1ExternalMetricStatus.discriminator = undefined;\nV2beta1ExternalMetricStatus.attributeTypeMap = [\n {\n \"name\": \"currentAverageValue\",\n \"baseName\": \"currentAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"currentValue\",\n \"baseName\": \"currentValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricSelector\",\n \"baseName\": \"metricSelector\",\n \"type\": \"V1LabelSelector\"\n }\n];\n//# sourceMappingURL=v2beta1ExternalMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1HorizontalPodAutoscaler = void 0;\n/**\n* HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.\n*/\nclass V2beta1HorizontalPodAutoscaler {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscaler.attributeTypeMap;\n }\n}\nexports.V2beta1HorizontalPodAutoscaler = V2beta1HorizontalPodAutoscaler;\nV2beta1HorizontalPodAutoscaler.discriminator = undefined;\nV2beta1HorizontalPodAutoscaler.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V2beta1HorizontalPodAutoscalerSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V2beta1HorizontalPodAutoscalerStatus\"\n }\n];\n//# sourceMappingURL=v2beta1HorizontalPodAutoscaler.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1HorizontalPodAutoscalerCondition = void 0;\n/**\n* HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.\n*/\nclass V2beta1HorizontalPodAutoscalerCondition {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscalerCondition.attributeTypeMap;\n }\n}\nexports.V2beta1HorizontalPodAutoscalerCondition = V2beta1HorizontalPodAutoscalerCondition;\nV2beta1HorizontalPodAutoscalerCondition.discriminator = undefined;\nV2beta1HorizontalPodAutoscalerCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1HorizontalPodAutoscalerCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1HorizontalPodAutoscalerList = void 0;\n/**\n* HorizontalPodAutoscaler is a list of horizontal pod autoscaler objects.\n*/\nclass V2beta1HorizontalPodAutoscalerList {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscalerList.attributeTypeMap;\n }\n}\nexports.V2beta1HorizontalPodAutoscalerList = V2beta1HorizontalPodAutoscalerList;\nV2beta1HorizontalPodAutoscalerList.discriminator = undefined;\nV2beta1HorizontalPodAutoscalerList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v2beta1HorizontalPodAutoscalerList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1HorizontalPodAutoscalerSpec = void 0;\n/**\n* HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.\n*/\nclass V2beta1HorizontalPodAutoscalerSpec {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscalerSpec.attributeTypeMap;\n }\n}\nexports.V2beta1HorizontalPodAutoscalerSpec = V2beta1HorizontalPodAutoscalerSpec;\nV2beta1HorizontalPodAutoscalerSpec.discriminator = undefined;\nV2beta1HorizontalPodAutoscalerSpec.attributeTypeMap = [\n {\n \"name\": \"maxReplicas\",\n \"baseName\": \"maxReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"metrics\",\n \"baseName\": \"metrics\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"minReplicas\",\n \"baseName\": \"minReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"scaleTargetRef\",\n \"baseName\": \"scaleTargetRef\",\n \"type\": \"V2beta1CrossVersionObjectReference\"\n }\n];\n//# sourceMappingURL=v2beta1HorizontalPodAutoscalerSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1HorizontalPodAutoscalerStatus = void 0;\n/**\n* HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.\n*/\nclass V2beta1HorizontalPodAutoscalerStatus {\n static getAttributeTypeMap() {\n return V2beta1HorizontalPodAutoscalerStatus.attributeTypeMap;\n }\n}\nexports.V2beta1HorizontalPodAutoscalerStatus = V2beta1HorizontalPodAutoscalerStatus;\nV2beta1HorizontalPodAutoscalerStatus.discriminator = undefined;\nV2beta1HorizontalPodAutoscalerStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentMetrics\",\n \"baseName\": \"currentMetrics\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredReplicas\",\n \"baseName\": \"desiredReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastScaleTime\",\n \"baseName\": \"lastScaleTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v2beta1HorizontalPodAutoscalerStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1MetricSpec = void 0;\n/**\n* MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).\n*/\nclass V2beta1MetricSpec {\n static getAttributeTypeMap() {\n return V2beta1MetricSpec.attributeTypeMap;\n }\n}\nexports.V2beta1MetricSpec = V2beta1MetricSpec;\nV2beta1MetricSpec.discriminator = undefined;\nV2beta1MetricSpec.attributeTypeMap = [\n {\n \"name\": \"containerResource\",\n \"baseName\": \"containerResource\",\n \"type\": \"V2beta1ContainerResourceMetricSource\"\n },\n {\n \"name\": \"external\",\n \"baseName\": \"external\",\n \"type\": \"V2beta1ExternalMetricSource\"\n },\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"V2beta1ObjectMetricSource\"\n },\n {\n \"name\": \"pods\",\n \"baseName\": \"pods\",\n \"type\": \"V2beta1PodsMetricSource\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V2beta1ResourceMetricSource\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1MetricSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1MetricStatus = void 0;\n/**\n* MetricStatus describes the last-read state of a single metric.\n*/\nclass V2beta1MetricStatus {\n static getAttributeTypeMap() {\n return V2beta1MetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta1MetricStatus = V2beta1MetricStatus;\nV2beta1MetricStatus.discriminator = undefined;\nV2beta1MetricStatus.attributeTypeMap = [\n {\n \"name\": \"containerResource\",\n \"baseName\": \"containerResource\",\n \"type\": \"V2beta1ContainerResourceMetricStatus\"\n },\n {\n \"name\": \"external\",\n \"baseName\": \"external\",\n \"type\": \"V2beta1ExternalMetricStatus\"\n },\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"V2beta1ObjectMetricStatus\"\n },\n {\n \"name\": \"pods\",\n \"baseName\": \"pods\",\n \"type\": \"V2beta1PodsMetricStatus\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V2beta1ResourceMetricStatus\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1MetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1ObjectMetricSource = void 0;\n/**\n* ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).\n*/\nclass V2beta1ObjectMetricSource {\n static getAttributeTypeMap() {\n return V2beta1ObjectMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta1ObjectMetricSource = V2beta1ObjectMetricSource;\nV2beta1ObjectMetricSource.discriminator = undefined;\nV2beta1ObjectMetricSource.attributeTypeMap = [\n {\n \"name\": \"averageValue\",\n \"baseName\": \"averageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta1CrossVersionObjectReference\"\n },\n {\n \"name\": \"targetValue\",\n \"baseName\": \"targetValue\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1ObjectMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1ObjectMetricStatus = void 0;\n/**\n* ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).\n*/\nclass V2beta1ObjectMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1ObjectMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta1ObjectMetricStatus = V2beta1ObjectMetricStatus;\nV2beta1ObjectMetricStatus.discriminator = undefined;\nV2beta1ObjectMetricStatus.attributeTypeMap = [\n {\n \"name\": \"averageValue\",\n \"baseName\": \"averageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"currentValue\",\n \"baseName\": \"currentValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta1CrossVersionObjectReference\"\n }\n];\n//# sourceMappingURL=v2beta1ObjectMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1PodsMetricSource = void 0;\n/**\n* PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.\n*/\nclass V2beta1PodsMetricSource {\n static getAttributeTypeMap() {\n return V2beta1PodsMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta1PodsMetricSource = V2beta1PodsMetricSource;\nV2beta1PodsMetricSource.discriminator = undefined;\nV2beta1PodsMetricSource.attributeTypeMap = [\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n },\n {\n \"name\": \"targetAverageValue\",\n \"baseName\": \"targetAverageValue\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1PodsMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1PodsMetricStatus = void 0;\n/**\n* PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).\n*/\nclass V2beta1PodsMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1PodsMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta1PodsMetricStatus = V2beta1PodsMetricStatus;\nV2beta1PodsMetricStatus.discriminator = undefined;\nV2beta1PodsMetricStatus.attributeTypeMap = [\n {\n \"name\": \"currentAverageValue\",\n \"baseName\": \"currentAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metricName\",\n \"baseName\": \"metricName\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n }\n];\n//# sourceMappingURL=v2beta1PodsMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1ResourceMetricSource = void 0;\n/**\n* ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source. Only one \\\"target\\\" type should be set.\n*/\nclass V2beta1ResourceMetricSource {\n static getAttributeTypeMap() {\n return V2beta1ResourceMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta1ResourceMetricSource = V2beta1ResourceMetricSource;\nV2beta1ResourceMetricSource.discriminator = undefined;\nV2beta1ResourceMetricSource.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"targetAverageUtilization\",\n \"baseName\": \"targetAverageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"targetAverageValue\",\n \"baseName\": \"targetAverageValue\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1ResourceMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta1ResourceMetricStatus = void 0;\n/**\n* ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source.\n*/\nclass V2beta1ResourceMetricStatus {\n static getAttributeTypeMap() {\n return V2beta1ResourceMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta1ResourceMetricStatus = V2beta1ResourceMetricStatus;\nV2beta1ResourceMetricStatus.discriminator = undefined;\nV2beta1ResourceMetricStatus.attributeTypeMap = [\n {\n \"name\": \"currentAverageUtilization\",\n \"baseName\": \"currentAverageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"currentAverageValue\",\n \"baseName\": \"currentAverageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta1ResourceMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2ContainerResourceMetricSource = void 0;\n/**\n* ContainerResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source. Only one \\\"target\\\" type should be set.\n*/\nclass V2beta2ContainerResourceMetricSource {\n static getAttributeTypeMap() {\n return V2beta2ContainerResourceMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta2ContainerResourceMetricSource = V2beta2ContainerResourceMetricSource;\nV2beta2ContainerResourceMetricSource.discriminator = undefined;\nV2beta2ContainerResourceMetricSource.attributeTypeMap = [\n {\n \"name\": \"container\",\n \"baseName\": \"container\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\n//# sourceMappingURL=v2beta2ContainerResourceMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2ContainerResourceMetricStatus = void 0;\n/**\n* ContainerResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing a single container in each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source.\n*/\nclass V2beta2ContainerResourceMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2ContainerResourceMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta2ContainerResourceMetricStatus = V2beta2ContainerResourceMetricStatus;\nV2beta2ContainerResourceMetricStatus.discriminator = undefined;\nV2beta2ContainerResourceMetricStatus.attributeTypeMap = [\n {\n \"name\": \"container\",\n \"baseName\": \"container\",\n \"type\": \"string\"\n },\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta2ContainerResourceMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2CrossVersionObjectReference = void 0;\n/**\n* CrossVersionObjectReference contains enough information to let you identify the referred resource.\n*/\nclass V2beta2CrossVersionObjectReference {\n static getAttributeTypeMap() {\n return V2beta2CrossVersionObjectReference.attributeTypeMap;\n }\n}\nexports.V2beta2CrossVersionObjectReference = V2beta2CrossVersionObjectReference;\nV2beta2CrossVersionObjectReference.discriminator = undefined;\nV2beta2CrossVersionObjectReference.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta2CrossVersionObjectReference.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2ExternalMetricSource = void 0;\n/**\n* ExternalMetricSource indicates how to scale on a metric not associated with any Kubernetes object (for example length of queue in cloud messaging service, or QPS from loadbalancer running outside of cluster).\n*/\nclass V2beta2ExternalMetricSource {\n static getAttributeTypeMap() {\n return V2beta2ExternalMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta2ExternalMetricSource = V2beta2ExternalMetricSource;\nV2beta2ExternalMetricSource.discriminator = undefined;\nV2beta2ExternalMetricSource.attributeTypeMap = [\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\n//# sourceMappingURL=v2beta2ExternalMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2ExternalMetricStatus = void 0;\n/**\n* ExternalMetricStatus indicates the current value of a global metric not associated with any Kubernetes object.\n*/\nclass V2beta2ExternalMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2ExternalMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta2ExternalMetricStatus = V2beta2ExternalMetricStatus;\nV2beta2ExternalMetricStatus.discriminator = undefined;\nV2beta2ExternalMetricStatus.attributeTypeMap = [\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n }\n];\n//# sourceMappingURL=v2beta2ExternalMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2HPAScalingPolicy = void 0;\n/**\n* HPAScalingPolicy is a single policy which must hold true for a specified past interval.\n*/\nclass V2beta2HPAScalingPolicy {\n static getAttributeTypeMap() {\n return V2beta2HPAScalingPolicy.attributeTypeMap;\n }\n}\nexports.V2beta2HPAScalingPolicy = V2beta2HPAScalingPolicy;\nV2beta2HPAScalingPolicy.discriminator = undefined;\nV2beta2HPAScalingPolicy.attributeTypeMap = [\n {\n \"name\": \"periodSeconds\",\n \"baseName\": \"periodSeconds\",\n \"type\": \"number\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v2beta2HPAScalingPolicy.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2HPAScalingRules = void 0;\n/**\n* HPAScalingRules configures the scaling behavior for one direction. These Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.\n*/\nclass V2beta2HPAScalingRules {\n static getAttributeTypeMap() {\n return V2beta2HPAScalingRules.attributeTypeMap;\n }\n}\nexports.V2beta2HPAScalingRules = V2beta2HPAScalingRules;\nV2beta2HPAScalingRules.discriminator = undefined;\nV2beta2HPAScalingRules.attributeTypeMap = [\n {\n \"name\": \"policies\",\n \"baseName\": \"policies\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"selectPolicy\",\n \"baseName\": \"selectPolicy\",\n \"type\": \"string\"\n },\n {\n \"name\": \"stabilizationWindowSeconds\",\n \"baseName\": \"stabilizationWindowSeconds\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v2beta2HPAScalingRules.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2HorizontalPodAutoscaler = void 0;\n/**\n* HorizontalPodAutoscaler is the configuration for a horizontal pod autoscaler, which automatically manages the replica count of any resource implementing the scale subresource based on the metrics specified.\n*/\nclass V2beta2HorizontalPodAutoscaler {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscaler.attributeTypeMap;\n }\n}\nexports.V2beta2HorizontalPodAutoscaler = V2beta2HorizontalPodAutoscaler;\nV2beta2HorizontalPodAutoscaler.discriminator = undefined;\nV2beta2HorizontalPodAutoscaler.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ObjectMeta\"\n },\n {\n \"name\": \"spec\",\n \"baseName\": \"spec\",\n \"type\": \"V2beta2HorizontalPodAutoscalerSpec\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"V2beta2HorizontalPodAutoscalerStatus\"\n }\n];\n//# sourceMappingURL=v2beta2HorizontalPodAutoscaler.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2HorizontalPodAutoscalerBehavior = void 0;\n/**\n* HorizontalPodAutoscalerBehavior configures the scaling behavior of the target in both Up and Down directions (scaleUp and scaleDown fields respectively).\n*/\nclass V2beta2HorizontalPodAutoscalerBehavior {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerBehavior.attributeTypeMap;\n }\n}\nexports.V2beta2HorizontalPodAutoscalerBehavior = V2beta2HorizontalPodAutoscalerBehavior;\nV2beta2HorizontalPodAutoscalerBehavior.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerBehavior.attributeTypeMap = [\n {\n \"name\": \"scaleDown\",\n \"baseName\": \"scaleDown\",\n \"type\": \"V2beta2HPAScalingRules\"\n },\n {\n \"name\": \"scaleUp\",\n \"baseName\": \"scaleUp\",\n \"type\": \"V2beta2HPAScalingRules\"\n }\n];\n//# sourceMappingURL=v2beta2HorizontalPodAutoscalerBehavior.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2HorizontalPodAutoscalerCondition = void 0;\n/**\n* HorizontalPodAutoscalerCondition describes the state of a HorizontalPodAutoscaler at a certain point.\n*/\nclass V2beta2HorizontalPodAutoscalerCondition {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerCondition.attributeTypeMap;\n }\n}\nexports.V2beta2HorizontalPodAutoscalerCondition = V2beta2HorizontalPodAutoscalerCondition;\nV2beta2HorizontalPodAutoscalerCondition.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerCondition.attributeTypeMap = [\n {\n \"name\": \"lastTransitionTime\",\n \"baseName\": \"lastTransitionTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"message\",\n \"baseName\": \"message\",\n \"type\": \"string\"\n },\n {\n \"name\": \"reason\",\n \"baseName\": \"reason\",\n \"type\": \"string\"\n },\n {\n \"name\": \"status\",\n \"baseName\": \"status\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta2HorizontalPodAutoscalerCondition.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2HorizontalPodAutoscalerList = void 0;\n/**\n* HorizontalPodAutoscalerList is a list of horizontal pod autoscaler objects.\n*/\nclass V2beta2HorizontalPodAutoscalerList {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerList.attributeTypeMap;\n }\n}\nexports.V2beta2HorizontalPodAutoscalerList = V2beta2HorizontalPodAutoscalerList;\nV2beta2HorizontalPodAutoscalerList.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerList.attributeTypeMap = [\n {\n \"name\": \"apiVersion\",\n \"baseName\": \"apiVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"items\",\n \"baseName\": \"items\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"kind\",\n \"baseName\": \"kind\",\n \"type\": \"string\"\n },\n {\n \"name\": \"metadata\",\n \"baseName\": \"metadata\",\n \"type\": \"V1ListMeta\"\n }\n];\n//# sourceMappingURL=v2beta2HorizontalPodAutoscalerList.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2HorizontalPodAutoscalerSpec = void 0;\n/**\n* HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.\n*/\nclass V2beta2HorizontalPodAutoscalerSpec {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerSpec.attributeTypeMap;\n }\n}\nexports.V2beta2HorizontalPodAutoscalerSpec = V2beta2HorizontalPodAutoscalerSpec;\nV2beta2HorizontalPodAutoscalerSpec.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerSpec.attributeTypeMap = [\n {\n \"name\": \"behavior\",\n \"baseName\": \"behavior\",\n \"type\": \"V2beta2HorizontalPodAutoscalerBehavior\"\n },\n {\n \"name\": \"maxReplicas\",\n \"baseName\": \"maxReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"metrics\",\n \"baseName\": \"metrics\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"minReplicas\",\n \"baseName\": \"minReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"scaleTargetRef\",\n \"baseName\": \"scaleTargetRef\",\n \"type\": \"V2beta2CrossVersionObjectReference\"\n }\n];\n//# sourceMappingURL=v2beta2HorizontalPodAutoscalerSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2HorizontalPodAutoscalerStatus = void 0;\n/**\n* HorizontalPodAutoscalerStatus describes the current status of a horizontal pod autoscaler.\n*/\nclass V2beta2HorizontalPodAutoscalerStatus {\n static getAttributeTypeMap() {\n return V2beta2HorizontalPodAutoscalerStatus.attributeTypeMap;\n }\n}\nexports.V2beta2HorizontalPodAutoscalerStatus = V2beta2HorizontalPodAutoscalerStatus;\nV2beta2HorizontalPodAutoscalerStatus.discriminator = undefined;\nV2beta2HorizontalPodAutoscalerStatus.attributeTypeMap = [\n {\n \"name\": \"conditions\",\n \"baseName\": \"conditions\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentMetrics\",\n \"baseName\": \"currentMetrics\",\n \"type\": \"Array\"\n },\n {\n \"name\": \"currentReplicas\",\n \"baseName\": \"currentReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"desiredReplicas\",\n \"baseName\": \"desiredReplicas\",\n \"type\": \"number\"\n },\n {\n \"name\": \"lastScaleTime\",\n \"baseName\": \"lastScaleTime\",\n \"type\": \"Date\"\n },\n {\n \"name\": \"observedGeneration\",\n \"baseName\": \"observedGeneration\",\n \"type\": \"number\"\n }\n];\n//# sourceMappingURL=v2beta2HorizontalPodAutoscalerStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2MetricIdentifier = void 0;\n/**\n* MetricIdentifier defines the name and optionally selector for a metric\n*/\nclass V2beta2MetricIdentifier {\n static getAttributeTypeMap() {\n return V2beta2MetricIdentifier.attributeTypeMap;\n }\n}\nexports.V2beta2MetricIdentifier = V2beta2MetricIdentifier;\nV2beta2MetricIdentifier.discriminator = undefined;\nV2beta2MetricIdentifier.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"selector\",\n \"baseName\": \"selector\",\n \"type\": \"V1LabelSelector\"\n }\n];\n//# sourceMappingURL=v2beta2MetricIdentifier.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2MetricSpec = void 0;\n/**\n* MetricSpec specifies how to scale based on a single metric (only `type` and one other matching field should be set at once).\n*/\nclass V2beta2MetricSpec {\n static getAttributeTypeMap() {\n return V2beta2MetricSpec.attributeTypeMap;\n }\n}\nexports.V2beta2MetricSpec = V2beta2MetricSpec;\nV2beta2MetricSpec.discriminator = undefined;\nV2beta2MetricSpec.attributeTypeMap = [\n {\n \"name\": \"containerResource\",\n \"baseName\": \"containerResource\",\n \"type\": \"V2beta2ContainerResourceMetricSource\"\n },\n {\n \"name\": \"external\",\n \"baseName\": \"external\",\n \"type\": \"V2beta2ExternalMetricSource\"\n },\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"V2beta2ObjectMetricSource\"\n },\n {\n \"name\": \"pods\",\n \"baseName\": \"pods\",\n \"type\": \"V2beta2PodsMetricSource\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V2beta2ResourceMetricSource\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta2MetricSpec.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2MetricStatus = void 0;\n/**\n* MetricStatus describes the last-read state of a single metric.\n*/\nclass V2beta2MetricStatus {\n static getAttributeTypeMap() {\n return V2beta2MetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta2MetricStatus = V2beta2MetricStatus;\nV2beta2MetricStatus.discriminator = undefined;\nV2beta2MetricStatus.attributeTypeMap = [\n {\n \"name\": \"containerResource\",\n \"baseName\": \"containerResource\",\n \"type\": \"V2beta2ContainerResourceMetricStatus\"\n },\n {\n \"name\": \"external\",\n \"baseName\": \"external\",\n \"type\": \"V2beta2ExternalMetricStatus\"\n },\n {\n \"name\": \"object\",\n \"baseName\": \"object\",\n \"type\": \"V2beta2ObjectMetricStatus\"\n },\n {\n \"name\": \"pods\",\n \"baseName\": \"pods\",\n \"type\": \"V2beta2PodsMetricStatus\"\n },\n {\n \"name\": \"resource\",\n \"baseName\": \"resource\",\n \"type\": \"V2beta2ResourceMetricStatus\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta2MetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2MetricTarget = void 0;\n/**\n* MetricTarget defines the target value, average value, or average utilization of a specific metric\n*/\nclass V2beta2MetricTarget {\n static getAttributeTypeMap() {\n return V2beta2MetricTarget.attributeTypeMap;\n }\n}\nexports.V2beta2MetricTarget = V2beta2MetricTarget;\nV2beta2MetricTarget.discriminator = undefined;\nV2beta2MetricTarget.attributeTypeMap = [\n {\n \"name\": \"averageUtilization\",\n \"baseName\": \"averageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"averageValue\",\n \"baseName\": \"averageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"type\",\n \"baseName\": \"type\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta2MetricTarget.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2MetricValueStatus = void 0;\n/**\n* MetricValueStatus holds the current value for a metric\n*/\nclass V2beta2MetricValueStatus {\n static getAttributeTypeMap() {\n return V2beta2MetricValueStatus.attributeTypeMap;\n }\n}\nexports.V2beta2MetricValueStatus = V2beta2MetricValueStatus;\nV2beta2MetricValueStatus.discriminator = undefined;\nV2beta2MetricValueStatus.attributeTypeMap = [\n {\n \"name\": \"averageUtilization\",\n \"baseName\": \"averageUtilization\",\n \"type\": \"number\"\n },\n {\n \"name\": \"averageValue\",\n \"baseName\": \"averageValue\",\n \"type\": \"string\"\n },\n {\n \"name\": \"value\",\n \"baseName\": \"value\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta2MetricValueStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2ObjectMetricSource = void 0;\n/**\n* ObjectMetricSource indicates how to scale on a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).\n*/\nclass V2beta2ObjectMetricSource {\n static getAttributeTypeMap() {\n return V2beta2ObjectMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta2ObjectMetricSource = V2beta2ObjectMetricSource;\nV2beta2ObjectMetricSource.discriminator = undefined;\nV2beta2ObjectMetricSource.attributeTypeMap = [\n {\n \"name\": \"describedObject\",\n \"baseName\": \"describedObject\",\n \"type\": \"V2beta2CrossVersionObjectReference\"\n },\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\n//# sourceMappingURL=v2beta2ObjectMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2ObjectMetricStatus = void 0;\n/**\n* ObjectMetricStatus indicates the current value of a metric describing a kubernetes object (for example, hits-per-second on an Ingress object).\n*/\nclass V2beta2ObjectMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2ObjectMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta2ObjectMetricStatus = V2beta2ObjectMetricStatus;\nV2beta2ObjectMetricStatus.discriminator = undefined;\nV2beta2ObjectMetricStatus.attributeTypeMap = [\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"describedObject\",\n \"baseName\": \"describedObject\",\n \"type\": \"V2beta2CrossVersionObjectReference\"\n },\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n }\n];\n//# sourceMappingURL=v2beta2ObjectMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2PodsMetricSource = void 0;\n/**\n* PodsMetricSource indicates how to scale on a metric describing each pod in the current scale target (for example, transactions-processed-per-second). The values will be averaged together before being compared to the target value.\n*/\nclass V2beta2PodsMetricSource {\n static getAttributeTypeMap() {\n return V2beta2PodsMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta2PodsMetricSource = V2beta2PodsMetricSource;\nV2beta2PodsMetricSource.discriminator = undefined;\nV2beta2PodsMetricSource.attributeTypeMap = [\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\n//# sourceMappingURL=v2beta2PodsMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2PodsMetricStatus = void 0;\n/**\n* PodsMetricStatus indicates the current value of a metric describing each pod in the current scale target (for example, transactions-processed-per-second).\n*/\nclass V2beta2PodsMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2PodsMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta2PodsMetricStatus = V2beta2PodsMetricStatus;\nV2beta2PodsMetricStatus.discriminator = undefined;\nV2beta2PodsMetricStatus.attributeTypeMap = [\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"metric\",\n \"baseName\": \"metric\",\n \"type\": \"V2beta2MetricIdentifier\"\n }\n];\n//# sourceMappingURL=v2beta2PodsMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2ResourceMetricSource = void 0;\n/**\n* ResourceMetricSource indicates how to scale on a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). The values will be averaged together before being compared to the target. Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source. Only one \\\"target\\\" type should be set.\n*/\nclass V2beta2ResourceMetricSource {\n static getAttributeTypeMap() {\n return V2beta2ResourceMetricSource.attributeTypeMap;\n }\n}\nexports.V2beta2ResourceMetricSource = V2beta2ResourceMetricSource;\nV2beta2ResourceMetricSource.discriminator = undefined;\nV2beta2ResourceMetricSource.attributeTypeMap = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n },\n {\n \"name\": \"target\",\n \"baseName\": \"target\",\n \"type\": \"V2beta2MetricTarget\"\n }\n];\n//# sourceMappingURL=v2beta2ResourceMetricSource.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.V2beta2ResourceMetricStatus = void 0;\n/**\n* ResourceMetricStatus indicates the current value of a resource metric known to Kubernetes, as specified in requests and limits, describing each pod in the current scale target (e.g. CPU or memory). Such metrics are built in to Kubernetes, and have special scaling options on top of those available to normal per-pod metrics using the \\\"pods\\\" source.\n*/\nclass V2beta2ResourceMetricStatus {\n static getAttributeTypeMap() {\n return V2beta2ResourceMetricStatus.attributeTypeMap;\n }\n}\nexports.V2beta2ResourceMetricStatus = V2beta2ResourceMetricStatus;\nV2beta2ResourceMetricStatus.discriminator = undefined;\nV2beta2ResourceMetricStatus.attributeTypeMap = [\n {\n \"name\": \"current\",\n \"baseName\": \"current\",\n \"type\": \"V2beta2MetricValueStatus\"\n },\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=v2beta2ResourceMetricStatus.js.map","\"use strict\";\n/**\n * Kubernetes\n * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)\n *\n * The version of the OpenAPI document: v1.22.2\n *\n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VersionInfo = void 0;\n/**\n* Info contains versioning information. how we\\'ll want to distribute that information.\n*/\nclass VersionInfo {\n static getAttributeTypeMap() {\n return VersionInfo.attributeTypeMap;\n }\n}\nexports.VersionInfo = VersionInfo;\nVersionInfo.discriminator = undefined;\nVersionInfo.attributeTypeMap = [\n {\n \"name\": \"buildDate\",\n \"baseName\": \"buildDate\",\n \"type\": \"string\"\n },\n {\n \"name\": \"compiler\",\n \"baseName\": \"compiler\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gitCommit\",\n \"baseName\": \"gitCommit\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gitTreeState\",\n \"baseName\": \"gitTreeState\",\n \"type\": \"string\"\n },\n {\n \"name\": \"gitVersion\",\n \"baseName\": \"gitVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"goVersion\",\n \"baseName\": \"goVersion\",\n \"type\": \"string\"\n },\n {\n \"name\": \"major\",\n \"baseName\": \"major\",\n \"type\": \"string\"\n },\n {\n \"name\": \"minor\",\n \"baseName\": \"minor\",\n \"type\": \"string\"\n },\n {\n \"name\": \"platform\",\n \"baseName\": \"platform\",\n \"type\": \"string\"\n }\n];\n//# sourceMappingURL=versionInfo.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./config\"), exports);\ntslib_1.__exportStar(require(\"./cache\"), exports);\ntslib_1.__exportStar(require(\"./api\"), exports);\ntslib_1.__exportStar(require(\"./attach\"), exports);\ntslib_1.__exportStar(require(\"./watch\"), exports);\ntslib_1.__exportStar(require(\"./exec\"), exports);\ntslib_1.__exportStar(require(\"./portforward\"), exports);\ntslib_1.__exportStar(require(\"./types\"), exports);\ntslib_1.__exportStar(require(\"./yaml\"), exports);\ntslib_1.__exportStar(require(\"./log\"), exports);\ntslib_1.__exportStar(require(\"./informer\"), exports);\ntslib_1.__exportStar(require(\"./top\"), exports);\ntslib_1.__exportStar(require(\"./object\"), exports);\ntslib_1.__exportStar(require(\"./cp\"), exports);\ntslib_1.__exportStar(require(\"./patch\"), exports);\ntslib_1.__exportStar(require(\"./metrics\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.makeInformer = exports.ERROR = exports.CONNECT = exports.DELETE = exports.CHANGE = exports.UPDATE = exports.ADD = void 0;\nconst cache_1 = require(\"./cache\");\nconst watch_1 = require(\"./watch\");\n// These are issued per object\nexports.ADD = 'add';\nexports.UPDATE = 'update';\nexports.CHANGE = 'change';\nexports.DELETE = 'delete';\n// This is issued when a watch connects or reconnects\nexports.CONNECT = 'connect';\n// This is issued when there is an error\nexports.ERROR = 'error';\nfunction makeInformer(kubeconfig, path, listPromiseFn, labelSelector) {\n const watch = new watch_1.Watch(kubeconfig);\n return new cache_1.ListWatch(path, watch, listPromiseFn, false, labelSelector);\n}\nexports.makeInformer = makeInformer;\n//# sourceMappingURL=informer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Log = void 0;\nconst request = require(\"request\");\nconst api_1 = require(\"./gen/api\");\nclass Log {\n constructor(config) {\n this.config = config;\n }\n async log(namespace, podName, containerName, stream, doneOrOptions, options) {\n let done = () => undefined;\n if (typeof doneOrOptions === 'function') {\n done = doneOrOptions;\n }\n else {\n options = doneOrOptions;\n }\n const path = `/api/v1/namespaces/${namespace}/pods/${podName}/log`;\n const cluster = this.config.getCurrentCluster();\n if (!cluster) {\n throw new Error('No currently active cluster');\n }\n const url = cluster.server + path;\n const requestOptions = {\n method: 'GET',\n qs: {\n ...options,\n container: containerName,\n },\n uri: url,\n };\n await this.config.applyToRequest(requestOptions);\n return new Promise((resolve, reject) => {\n const req = request(requestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n done(error);\n }\n else if (response.statusCode !== 200) {\n try {\n const deserializedBody = api_1.ObjectSerializer.deserialize(JSON.parse(body), 'V1Status');\n reject(new api_1.HttpError(response, deserializedBody, response.statusCode));\n }\n catch (e) {\n reject(new api_1.HttpError(response, body, response.statusCode));\n }\n done(body);\n }\n else {\n done(null);\n }\n }).on('response', (response) => {\n if (response.statusCode === 200) {\n req.pipe(stream);\n resolve(req);\n }\n });\n });\n }\n}\nexports.Log = Log;\n//# sourceMappingURL=log.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Metrics = void 0;\nconst request = require(\"request\");\nconst api_1 = require(\"./gen/api\");\nclass Metrics {\n constructor(config) {\n this.config = config;\n }\n async getNodeMetrics() {\n return this.metricsApiRequest('/apis/metrics.k8s.io/v1beta1/nodes');\n }\n async getPodMetrics(namespace) {\n let path;\n if (namespace !== undefined && namespace.length > 0) {\n path = `/apis/metrics.k8s.io/v1beta1/namespaces/${namespace}/pods`;\n }\n else {\n path = '/apis/metrics.k8s.io/v1beta1/pods';\n }\n return this.metricsApiRequest(path);\n }\n async metricsApiRequest(path) {\n const cluster = this.config.getCurrentCluster();\n if (!cluster) {\n throw new Error('No currently active cluster');\n }\n const requestOptions = {\n method: 'GET',\n uri: cluster.server + path,\n };\n await this.config.applyToRequest(requestOptions);\n return new Promise((resolve, reject) => {\n const req = request(requestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else if (response.statusCode !== 200) {\n try {\n const deserializedBody = api_1.ObjectSerializer.deserialize(JSON.parse(body), 'V1Status');\n reject(new api_1.HttpError(response, deserializedBody, response.statusCode));\n }\n catch (e) {\n reject(new api_1.HttpError(response, body, response.statusCode));\n }\n }\n else {\n resolve(JSON.parse(body));\n }\n });\n });\n }\n}\nexports.Metrics = Metrics;\n//# sourceMappingURL=metrics.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.KubernetesObjectApi = void 0;\nconst request = require(\"request\");\nconst api_1 = require(\"./api\");\n/**\n * Valid Content-Type header values for patch operations. See\n * https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/\n * for details.\n */\nvar KubernetesPatchStrategies;\n(function (KubernetesPatchStrategies) {\n /** Diff-like JSON format. */\n KubernetesPatchStrategies[\"JsonPatch\"] = \"application/json-patch+json\";\n /** Simple merge. */\n KubernetesPatchStrategies[\"MergePatch\"] = \"application/merge-patch+json\";\n /** Merge with different strategies depending on field metadata. */\n KubernetesPatchStrategies[\"StrategicMergePatch\"] = \"application/strategic-merge-patch+json\";\n})(KubernetesPatchStrategies || (KubernetesPatchStrategies = {}));\n/**\n * Dynamically construct Kubernetes API request URIs so client does not have to know what type of object it is acting\n * on.\n */\nclass KubernetesObjectApi extends api_1.ApisApi {\n constructor() {\n super(...arguments);\n /** Initialize the default namespace. May be overwritten by context. */\n this.defaultNamespace = 'default';\n /** Cache resource API response. */\n this.apiVersionResourceCache = {};\n }\n /**\n * Create a KubernetesObjectApi object from the provided KubeConfig. This method should be used rather than\n * [[KubeConfig.makeApiClient]] so we can properly determine the default namespace if one is provided by the current\n * context.\n *\n * @param kc Valid Kubernetes config\n * @return Properly instantiated [[KubernetesObjectApi]] object\n */\n static makeApiClient(kc) {\n const client = kc.makeApiClient(KubernetesObjectApi);\n client.setDefaultNamespace(kc);\n return client;\n }\n /**\n * Create any Kubernetes resource.\n * @param spec Kubernetes resource spec.\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized\n * dryRun directive will result in an error response and no further processing of the request. Valid values\n * are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The\n * value must be less than or 128 characters long, and only contain printable characters, as defined by\n * https://golang.org/pkg/unicode/#IsPrint.\n * @param options Optional headers to use in the request.\n * @return Promise containing the request response and [[KubernetesObject]].\n */\n async create(spec, pretty, dryRun, fieldManager, options = { headers: {} }) {\n // verify required parameter 'spec' is not null or undefined\n if (spec === null || spec === undefined) {\n throw new Error('Required parameter spec was null or undefined when calling create.');\n }\n const localVarPath = await this.specUriPath(spec, 'create');\n const localVarQueryParameters = {};\n const localVarHeaderParams = this.generateHeaders(options.headers);\n if (pretty !== undefined) {\n localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters.dryRun = api_1.ObjectSerializer.serialize(dryRun, 'string');\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters.fieldManager = api_1.ObjectSerializer.serialize(fieldManager, 'string');\n }\n const localVarRequestOptions = {\n method: 'POST',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: api_1.ObjectSerializer.serialize(spec, 'KubernetesObject'),\n };\n return this.requestPromise(localVarRequestOptions);\n }\n /**\n * Delete any Kubernetes resource.\n * @param spec Kubernetes resource spec\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized\n * dryRun directive will result in an error response and no further processing of the request. Valid values\n * are: - All: all dry run stages will be processed\n * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value must be non-negative\n * integer. The value zero indicates delete immediately. If this value is nil, the default grace period for\n * the specified type will be used. Defaults to a per object value if not specified. zero means delete\n * immediately.\n * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be deprecated in\n * 1.7. Should the dependent objects be orphaned. If true/false, the \\"orphan\\" finalizer will be\n * added to/removed from the object\\'s finalizers list. Either this field or PropagationPolicy may be\n * set, but not both.\n * @param propagationPolicy Whether and how garbage collection will be performed. Either this field or\n * OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in\n * the metadata.finalizers and the resource-specific default policy. Acceptable values are:\n * \\'Orphan\\' - orphan the dependents; \\'Background\\' - allow the garbage collector to delete\n * the dependents in the background; \\'Foreground\\' - a cascading policy that deletes all dependents\n * in the foreground.\n * @param body See [[V1DeleteOptions]].\n * @param options Optional headers to use in the request.\n * @return Promise containing the request response and a Kubernetes [[V1Status]].\n */\n async delete(spec, pretty, dryRun, gracePeriodSeconds, orphanDependents, propagationPolicy, body, options = { headers: {} }) {\n // verify required parameter 'spec' is not null or undefined\n if (spec === null || spec === undefined) {\n throw new Error('Required parameter spec was null or undefined when calling delete.');\n }\n const localVarPath = await this.specUriPath(spec, 'delete');\n const localVarQueryParameters = {};\n const localVarHeaderParams = this.generateHeaders(options.headers);\n if (pretty !== undefined) {\n localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters.dryRun = api_1.ObjectSerializer.serialize(dryRun, 'string');\n }\n if (gracePeriodSeconds !== undefined) {\n localVarQueryParameters.gracePeriodSeconds = api_1.ObjectSerializer.serialize(gracePeriodSeconds, 'number');\n }\n if (orphanDependents !== undefined) {\n localVarQueryParameters.orphanDependents = api_1.ObjectSerializer.serialize(orphanDependents, 'boolean');\n }\n if (propagationPolicy !== undefined) {\n localVarQueryParameters.propagationPolicy = api_1.ObjectSerializer.serialize(propagationPolicy, 'string');\n }\n const localVarRequestOptions = {\n method: 'DELETE',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: api_1.ObjectSerializer.serialize(body, 'V1DeleteOptions'),\n };\n return this.requestPromise(localVarRequestOptions, 'V1Status');\n }\n /**\n * Patch any Kubernetes resource.\n * @param spec Kubernetes resource spec\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized\n * dryRun directive will result in an error response and no further processing of the request. Valid values\n * are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The\n * value must be less than or 128 characters long, and only contain printable characters, as defined by\n * https://golang.org/pkg/unicode/#IsPrint. This field is required for apply requests\n * (application/apply-patch) but optional for non-apply patch types (JsonPatch, MergePatch,\n * StrategicMergePatch).\n * @param force Force is going to \\"force\\" Apply requests. It means user will re-acquire conflicting\n * fields owned by other people. Force flag must be unset for non-apply patch requests.\n * @param options Optional headers to use in the request.\n * @return Promise containing the request response and [[KubernetesObject]].\n */\n async patch(spec, pretty, dryRun, fieldManager, force, options = { headers: {} }) {\n // verify required parameter 'spec' is not null or undefined\n if (spec === null || spec === undefined) {\n throw new Error('Required parameter spec was null or undefined when calling patch.');\n }\n const localVarPath = await this.specUriPath(spec, 'patch');\n const localVarQueryParameters = {};\n const localVarHeaderParams = this.generateHeaders(options.headers, 'PATCH');\n if (pretty !== undefined) {\n localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters.dryRun = api_1.ObjectSerializer.serialize(dryRun, 'string');\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters.fieldManager = api_1.ObjectSerializer.serialize(fieldManager, 'string');\n }\n if (force !== undefined) {\n localVarQueryParameters.force = api_1.ObjectSerializer.serialize(force, 'boolean');\n }\n const localVarRequestOptions = {\n method: 'PATCH',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: api_1.ObjectSerializer.serialize(spec, 'object'),\n };\n return this.requestPromise(localVarRequestOptions);\n }\n /**\n * Read any Kubernetes resource.\n * @param spec Kubernetes resource spec\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like\n * \\'Namespace\\'. Deprecated. Planned for removal in 1.18.\n * @param exportt Should this value be exported. Export strips fields that a user can not\n * specify. Deprecated. Planned for removal in 1.18.\n * @param options Optional headers to use in the request.\n * @return Promise containing the request response and [[KubernetesObject]].\n */\n async read(spec, pretty, exact, exportt, options = { headers: {} }) {\n // verify required parameter 'spec' is not null or undefined\n if (spec === null || spec === undefined) {\n throw new Error('Required parameter spec was null or undefined when calling read.');\n }\n const localVarPath = await this.specUriPath(spec, 'read');\n const localVarQueryParameters = {};\n const localVarHeaderParams = this.generateHeaders(options.headers);\n if (pretty !== undefined) {\n localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string');\n }\n if (exact !== undefined) {\n localVarQueryParameters.exact = api_1.ObjectSerializer.serialize(exact, 'boolean');\n }\n if (exportt !== undefined) {\n localVarQueryParameters.export = api_1.ObjectSerializer.serialize(exportt, 'boolean');\n }\n const localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n return this.requestPromise(localVarRequestOptions);\n }\n /**\n * List any Kubernetes resources.\n * @param apiVersion api group and version of the form /\n * @param kind Kubernetes resource kind\n * @param namespace list resources in this namespace\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param exact Should the export be exact. Exact export maintains cluster-specific fields like\n * \\'Namespace\\'. Deprecated. Planned for removal in 1.18.\n * @param exportt Should this value be exported. Export strips fields that a user can not\n * specify. Deprecated. Planned for removal in 1.18.\n * @param fieldSelector A selector to restrict the list of returned objects by their fields. Defaults to everything.\n * @param labelSelector A selector to restrict the list of returned objects by their labels. Defaults to everything.\n * @param limit Number of returned resources.\n * @param options Optional headers to use in the request.\n * @return Promise containing the request response and [[KubernetesListObject]].\n */\n async list(apiVersion, kind, namespace, pretty, exact, exportt, fieldSelector, labelSelector, limit, continueToken, options = { headers: {} }) {\n // verify required parameters 'apiVersion', 'kind' is not null or undefined\n if (apiVersion === null || apiVersion === undefined) {\n throw new Error('Required parameter apiVersion was null or undefined when calling list.');\n }\n if (kind === null || kind === undefined) {\n throw new Error('Required parameter kind was null or undefined when calling list.');\n }\n const localVarPath = await this.specUriPath({\n apiVersion,\n kind,\n metadata: {\n namespace,\n },\n }, 'list');\n const localVarQueryParameters = {};\n const localVarHeaderParams = this.generateHeaders(options.headers);\n if (pretty !== undefined) {\n localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string');\n }\n if (exact !== undefined) {\n localVarQueryParameters.exact = api_1.ObjectSerializer.serialize(exact, 'boolean');\n }\n if (exportt !== undefined) {\n localVarQueryParameters.export = api_1.ObjectSerializer.serialize(exportt, 'boolean');\n }\n if (fieldSelector !== undefined) {\n localVarQueryParameters.fieldSelector = api_1.ObjectSerializer.serialize(fieldSelector, 'string');\n }\n if (labelSelector !== undefined) {\n localVarQueryParameters.labelSelector = api_1.ObjectSerializer.serialize(labelSelector, 'string');\n }\n if (limit !== undefined) {\n localVarQueryParameters.limit = api_1.ObjectSerializer.serialize(limit, 'number');\n }\n if (continueToken !== undefined) {\n localVarQueryParameters.continue = api_1.ObjectSerializer.serialize(continueToken, 'string');\n }\n const localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n return this.requestPromise(localVarRequestOptions);\n }\n /**\n * Replace any Kubernetes resource.\n * @param spec Kubernetes resource spec\n * @param pretty If \\'true\\', then the output is pretty printed.\n * @param dryRun When present, indicates that modifications should not be persisted. An invalid or unrecognized\n * dryRun directive will result in an error response and no further processing of the request. Valid values\n * are: - All: all dry run stages will be processed\n * @param fieldManager fieldManager is a name associated with the actor or entity that is making these changes. The\n * value must be less than or 128 characters long, and only contain printable characters, as defined by\n * https://golang.org/pkg/unicode/#IsPrint.\n * @param options Optional headers to use in the request.\n * @return Promise containing the request response and [[KubernetesObject]].\n */\n async replace(spec, pretty, dryRun, fieldManager, options = { headers: {} }) {\n // verify required parameter 'spec' is not null or undefined\n if (spec === null || spec === undefined) {\n throw new Error('Required parameter spec was null or undefined when calling replace.');\n }\n const localVarPath = await this.specUriPath(spec, 'replace');\n const localVarQueryParameters = {};\n const localVarHeaderParams = this.generateHeaders(options.headers);\n if (pretty !== undefined) {\n localVarQueryParameters.pretty = api_1.ObjectSerializer.serialize(pretty, 'string');\n }\n if (dryRun !== undefined) {\n localVarQueryParameters.dryRun = api_1.ObjectSerializer.serialize(dryRun, 'string');\n }\n if (fieldManager !== undefined) {\n localVarQueryParameters.fieldManager = api_1.ObjectSerializer.serialize(fieldManager, 'string');\n }\n const localVarRequestOptions = {\n method: 'PUT',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n body: api_1.ObjectSerializer.serialize(spec, 'KubernetesObject'),\n };\n return this.requestPromise(localVarRequestOptions);\n }\n /** Set default namespace from current context, if available. */\n setDefaultNamespace(kc) {\n if (kc.currentContext) {\n const currentContext = kc.getContextObject(kc.currentContext);\n if (currentContext && currentContext.namespace) {\n this.defaultNamespace = currentContext.namespace;\n }\n }\n return this.defaultNamespace;\n }\n /**\n * Use spec information to construct resource URI path. If any required information in not provided, an Error is\n * thrown. If an `apiVersion` is not provided, 'v1' is used. If a `metadata.namespace` is not provided for a\n * request that requires one, the context default is used, if available, if not, 'default' is used.\n *\n * @param spec Kubernetes resource spec which must define kind and apiVersion properties.\n * @param action API action, see [[K8sApiAction]].\n * @return tail of resource-specific URI\n */\n async specUriPath(spec, action) {\n if (!spec.kind) {\n throw new Error('Required spec property kind is not set');\n }\n if (!spec.apiVersion) {\n spec.apiVersion = 'v1';\n }\n if (!spec.metadata) {\n spec.metadata = {};\n }\n const resource = await this.resource(spec.apiVersion, spec.kind);\n if (!resource) {\n throw new Error(`Unrecognized API version and kind: ${spec.apiVersion} ${spec.kind}`);\n }\n if (resource.namespaced && !spec.metadata.namespace && action !== 'list') {\n spec.metadata.namespace = this.defaultNamespace;\n }\n const parts = [this.apiVersionPath(spec.apiVersion)];\n if (resource.namespaced && spec.metadata.namespace) {\n parts.push('namespaces', encodeURIComponent(String(spec.metadata.namespace)));\n }\n parts.push(resource.name);\n if (action !== 'create' && action !== 'list') {\n if (!spec.metadata.name) {\n throw new Error('Required spec property name is not set');\n }\n parts.push(encodeURIComponent(String(spec.metadata.name)));\n }\n return parts.join('/').toLowerCase();\n }\n /** Return root of API path up to API version. */\n apiVersionPath(apiVersion) {\n const api = apiVersion.includes('/') ? 'apis' : 'api';\n return [this.basePath, api, apiVersion].join('/');\n }\n /**\n * Merge default headers and provided headers, setting the 'Accept' header to 'application/json' and, if the\n * `action` is 'PATCH', the 'Content-Type' header to [[KubernetesPatchStrategies.StrategicMergePatch]]. Both of\n * these defaults can be overriden by values provided in `optionsHeaders`.\n *\n * @param optionHeaders Headers from method's options argument.\n * @param action HTTP action headers are being generated for.\n * @return Headers to use in request.\n */\n generateHeaders(optionsHeaders, action = 'GET') {\n const headers = Object.assign({}, this._defaultHeaders);\n headers.accept = 'application/json';\n if (action === 'PATCH') {\n headers['content-type'] = KubernetesPatchStrategies.StrategicMergePatch;\n }\n Object.assign(headers, optionsHeaders);\n return headers;\n }\n /**\n * Get metadata from Kubernetes API for resources described by `kind` and `apiVersion`. If it is unable to find the\n * resource `kind` under the provided `apiVersion`, `undefined` is returned.\n *\n * This method caches responses from the Kubernetes API to use for future requests. If the cache for apiVersion\n * exists but the kind is not found the request is attempted again.\n *\n * @param apiVersion Kubernetes API version, e.g., 'v1' or 'apps/v1'.\n * @param kind Kubernetes resource kind, e.g., 'Pod' or 'Namespace'.\n * @return Promise of the resource metadata or `undefined` if the resource is not found.\n */\n async resource(apiVersion, kind) {\n // verify required parameter 'apiVersion' is not null or undefined\n if (apiVersion === null || apiVersion === undefined) {\n throw new Error('Required parameter apiVersion was null or undefined when calling resource');\n }\n // verify required parameter 'kind' is not null or undefined\n if (kind === null || kind === undefined) {\n throw new Error('Required parameter kind was null or undefined when calling resource');\n }\n if (this.apiVersionResourceCache[apiVersion]) {\n const resource = this.apiVersionResourceCache[apiVersion].resources.find((r) => r.kind === kind);\n if (resource) {\n return resource;\n }\n }\n const localVarPath = this.apiVersionPath(apiVersion);\n const localVarQueryParameters = {};\n const localVarHeaderParams = this.generateHeaders({});\n const localVarRequestOptions = {\n method: 'GET',\n qs: localVarQueryParameters,\n headers: localVarHeaderParams,\n uri: localVarPath,\n useQuerystring: this._useQuerystring,\n json: true,\n };\n try {\n const getApiResponse = await this.requestPromise(localVarRequestOptions, 'V1APIResourceList');\n this.apiVersionResourceCache[apiVersion] = getApiResponse.body;\n return this.apiVersionResourceCache[apiVersion].resources.find((r) => r.kind === kind);\n }\n catch (e) {\n e.message = `Failed to fetch resource metadata for ${apiVersion}/${kind}: ${e.message}`;\n throw e;\n }\n }\n /**\n * Standard Kubernetes request wrapped in a Promise.\n */\n async requestPromise(requestOptions, tipe = 'KubernetesObject') {\n let authenticationPromise = Promise.resolve();\n if (this.authentications.BearerToken.apiKey) {\n authenticationPromise = authenticationPromise.then(() => this.authentications.BearerToken.applyToRequest(requestOptions));\n }\n authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(requestOptions));\n let interceptorPromise = authenticationPromise;\n for (const interceptor of this.interceptors) {\n interceptorPromise = interceptorPromise.then(() => interceptor(requestOptions));\n }\n await interceptorPromise;\n return new Promise((resolve, reject) => {\n request(requestOptions, (error, response, body) => {\n if (error) {\n reject(error);\n }\n else {\n body = api_1.ObjectSerializer.deserialize(body, tipe);\n if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {\n resolve({ response, body });\n }\n else {\n reject(new api_1.HttpError(response, body, response.statusCode));\n }\n }\n });\n });\n }\n}\nexports.KubernetesObjectApi = KubernetesObjectApi;\n//# sourceMappingURL=object.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.OpenIDConnectAuth = void 0;\nconst openid_client_1 = require(\"openid-client\");\nconst rfc4648_1 = require(\"rfc4648\");\nconst util_1 = require(\"util\");\nclass OpenIDConnectAuth {\n constructor() {\n // public for testing purposes.\n this.currentTokenExpiration = 0;\n }\n static decodeJWT(token) {\n const parts = token.split('.');\n if (parts.length !== 3) {\n return null;\n }\n const header = JSON.parse(new util_1.TextDecoder().decode(rfc4648_1.base64url.parse(parts[0], { loose: true })));\n const payload = JSON.parse(new util_1.TextDecoder().decode(rfc4648_1.base64url.parse(parts[1], { loose: true })));\n const signature = parts[2];\n return {\n header,\n payload,\n signature,\n };\n }\n static expirationFromToken(token) {\n const jwt = OpenIDConnectAuth.decodeJWT(token);\n if (!jwt) {\n return 0;\n }\n return jwt.payload.exp;\n }\n isAuthProvider(user) {\n if (!user.authProvider) {\n return false;\n }\n return user.authProvider.name === 'oidc';\n }\n /**\n * Setup the authentication header for oidc authed clients\n * @param user user info\n * @param opts request options\n * @param overrideClient for testing, a preconfigured oidc client\n */\n async applyAuthentication(user, opts, overrideClient) {\n const token = await this.getToken(user, overrideClient);\n if (token) {\n opts.headers.Authorization = `Bearer ${token}`;\n }\n }\n async getToken(user, overrideClient) {\n if (!user.authProvider.config) {\n return null;\n }\n if (!user.authProvider.config['client-secret']) {\n user.authProvider.config['client-secret'] = '';\n }\n if (!user.authProvider.config || !user.authProvider.config['id-token']) {\n return null;\n }\n return this.refresh(user, overrideClient);\n }\n async refresh(user, overrideClient) {\n if (this.currentTokenExpiration === 0) {\n this.currentTokenExpiration = OpenIDConnectAuth.expirationFromToken(user.authProvider.config['id-token']);\n }\n if (Date.now() / 1000 > this.currentTokenExpiration) {\n if (!user.authProvider.config['client-id'] ||\n !user.authProvider.config['refresh-token'] ||\n !user.authProvider.config['idp-issuer-url']) {\n return null;\n }\n const client = overrideClient ? overrideClient : await this.getClient(user);\n const newToken = await client.refresh(user.authProvider.config['refresh-token']);\n user.authProvider.config['id-token'] = newToken.id_token;\n user.authProvider.config['refresh-token'] = newToken.refresh_token;\n this.currentTokenExpiration = newToken.expires_at || 0;\n }\n return user.authProvider.config['id-token'];\n }\n async getClient(user) {\n const oidcIssuer = await openid_client_1.Issuer.discover(user.authProvider.config['idp-issuer-url']);\n return new oidcIssuer.Client({\n client_id: user.authProvider.config['client-id'],\n client_secret: user.authProvider.config['client-secret'],\n });\n }\n}\nexports.OpenIDConnectAuth = OpenIDConnectAuth;\n//# sourceMappingURL=oidc_auth.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PatchUtils = void 0;\nclass PatchUtils {\n}\nexports.PatchUtils = PatchUtils;\nPatchUtils.PATCH_FORMAT_JSON_PATCH = 'application/json-patch+json';\nPatchUtils.PATCH_FORMAT_JSON_MERGE_PATCH = 'application/merge-patch+json';\nPatchUtils.PATCH_FORMAT_STRATEGIC_MERGE_PATCH = 'application/strategic-merge-patch+json';\nPatchUtils.PATCH_FORMAT_APPLY_YAML = 'application/apply-patch+yaml';\n//# sourceMappingURL=patch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PortForward = void 0;\nconst querystring = require(\"querystring\");\nconst util_1 = require(\"util\");\nconst web_socket_handler_1 = require(\"./web-socket-handler\");\nclass PortForward {\n // handler is a parameter really only for injecting for testing.\n constructor(config, disconnectOnErr, handler) {\n this.handler = handler || new web_socket_handler_1.WebSocketHandler(config);\n this.disconnectOnErr = util_1.isUndefined(disconnectOnErr) ? true : disconnectOnErr;\n }\n // TODO: support multiple ports for real...\n async portForward(namespace, podName, targetPorts, output, err, input, retryCount = 0) {\n if (targetPorts.length === 0) {\n throw new Error('You must provide at least one port to forward to.');\n }\n if (targetPorts.length > 1) {\n throw new Error('Only one port is currently supported for port-forward');\n }\n const query = {\n ports: targetPorts[0],\n };\n const queryStr = querystring.stringify(query);\n const needsToReadPortNumber = [];\n targetPorts.forEach((value, index) => {\n needsToReadPortNumber[index * 2] = true;\n needsToReadPortNumber[index * 2 + 1] = true;\n });\n const path = `/api/v1/namespaces/${namespace}/pods/${podName}/portforward?${queryStr}`;\n const createWebSocket = () => {\n return this.handler.connect(path, null, (streamNum, buff) => {\n if (streamNum >= targetPorts.length * 2) {\n return !this.disconnectOnErr;\n }\n // First two bytes of each stream are the port number\n if (needsToReadPortNumber[streamNum]) {\n buff = buff.slice(2);\n needsToReadPortNumber[streamNum] = false;\n }\n if (streamNum % 2 === 1) {\n if (err) {\n err.write(buff);\n }\n }\n else {\n output.write(buff);\n }\n return true;\n });\n };\n if (retryCount < 1) {\n const ws = await createWebSocket();\n web_socket_handler_1.WebSocketHandler.handleStandardInput(ws, input, 0);\n return ws;\n }\n return web_socket_handler_1.WebSocketHandler.restartableHandleStandardInput(createWebSocket, input, 0, retryCount);\n }\n}\nexports.PortForward = PortForward;\n//# sourceMappingURL=portforward.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isResizable = exports.TerminalSizeQueue = void 0;\nconst stream_1 = require(\"stream\");\nclass TerminalSizeQueue extends stream_1.Readable {\n constructor(opts = {}) {\n super({\n ...opts,\n // tslint:disable-next-line:no-empty\n read() { },\n });\n }\n handleResizes(writeStream) {\n // Set initial size\n this.resize(getTerminalSize(writeStream));\n // Handle future size updates\n writeStream.on('resize', () => this.resize(getTerminalSize(writeStream)));\n }\n resize(size) {\n this.push(JSON.stringify(size));\n }\n}\nexports.TerminalSizeQueue = TerminalSizeQueue;\nfunction isResizable(stream) {\n if (stream == null) {\n return false;\n }\n const hasRows = 'rows' in stream;\n const hasColumns = 'columns' in stream;\n const hasOn = typeof stream.on === 'function';\n return hasRows && hasColumns && hasOn;\n}\nexports.isResizable = isResizable;\nfunction getTerminalSize(writeStream) {\n return { height: writeStream.rows, width: writeStream.columns };\n}\n//# sourceMappingURL=terminal-size-queue.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.topPods = exports.topNodes = exports.PodStatus = exports.ContainerStatus = exports.NodeStatus = exports.CurrentResourceUsage = exports.ResourceUsage = void 0;\nconst util_1 = require(\"./util\");\nclass ResourceUsage {\n constructor(Capacity, RequestTotal, LimitTotal) {\n this.Capacity = Capacity;\n this.RequestTotal = RequestTotal;\n this.LimitTotal = LimitTotal;\n }\n}\nexports.ResourceUsage = ResourceUsage;\nclass CurrentResourceUsage {\n constructor(CurrentUsage, RequestTotal, LimitTotal) {\n this.CurrentUsage = CurrentUsage;\n this.RequestTotal = RequestTotal;\n this.LimitTotal = LimitTotal;\n }\n}\nexports.CurrentResourceUsage = CurrentResourceUsage;\nclass NodeStatus {\n constructor(Node, CPU, Memory) {\n this.Node = Node;\n this.CPU = CPU;\n this.Memory = Memory;\n }\n}\nexports.NodeStatus = NodeStatus;\nclass ContainerStatus {\n constructor(Container, CPUUsage, MemoryUsage) {\n this.Container = Container;\n this.CPUUsage = CPUUsage;\n this.MemoryUsage = MemoryUsage;\n }\n}\nexports.ContainerStatus = ContainerStatus;\nclass PodStatus {\n constructor(Pod, CPU, Memory, Containers) {\n this.Pod = Pod;\n this.CPU = CPU;\n this.Memory = Memory;\n this.Containers = Containers;\n }\n}\nexports.PodStatus = PodStatus;\nasync function topNodes(api) {\n // TODO: Support metrics APIs in the client and this library\n const nodes = await api.listNode();\n const result = [];\n for (const node of nodes.body.items) {\n const availableCPU = util_1.quantityToScalar(node.status.allocatable.cpu);\n const availableMem = util_1.quantityToScalar(node.status.allocatable.memory);\n let totalPodCPU = 0;\n let totalPodCPULimit = 0;\n let totalPodMem = 0;\n let totalPodMemLimit = 0;\n let pods = await util_1.podsForNode(api, node.metadata.name);\n pods = pods.filter((pod) => pod.status.phase === 'Running');\n pods.forEach((pod) => {\n const cpuTotal = util_1.totalCPU(pod);\n totalPodCPU = util_1.add(totalPodCPU, cpuTotal.request);\n totalPodCPULimit = util_1.add(totalPodCPULimit, cpuTotal.limit);\n const memTotal = util_1.totalMemory(pod);\n totalPodMem = util_1.add(totalPodMem, memTotal.request);\n totalPodMemLimit = util_1.add(totalPodMemLimit, memTotal.limit);\n });\n const cpuUsage = new ResourceUsage(availableCPU, totalPodCPU, totalPodCPULimit);\n const memUsage = new ResourceUsage(availableMem, totalPodMem, totalPodMemLimit);\n result.push(new NodeStatus(node, cpuUsage, memUsage));\n }\n return result;\n}\nexports.topNodes = topNodes;\n// Returns the current pod CPU/Memory usage including the CPU/Memory usage of each container\nasync function topPods(api, metrics, namespace) {\n // Figure out which pod list endpoint to call\n const getPodList = async () => {\n if (namespace) {\n return (await api.listNamespacedPod(namespace)).body;\n }\n return (await api.listPodForAllNamespaces()).body;\n };\n const [podMetrics, podList] = await Promise.all([metrics.getPodMetrics(namespace), getPodList()]);\n // Create a map of pod names to their metric usage\n // to make it easier to look up when we need it later\n const podMetricsMap = podMetrics.items.reduce((accum, next) => {\n accum.set(next.metadata.name, next);\n return accum;\n }, new Map());\n const result = [];\n for (const pod of podList.items) {\n const podMetric = podMetricsMap.get(pod.metadata.name);\n const containerStatuses = [];\n let currentPodCPU = 0;\n let currentPodMem = 0;\n let podRequestsCPU = 0;\n let podLimitsCPU = 0;\n let podRequestsMem = 0;\n let podLimitsMem = 0;\n pod.spec.containers.forEach((container) => {\n // get the the container CPU/Memory container.resources.requests/limits\n const containerCpuTotal = util_1.totalCPUForContainer(container);\n const containerMemTotal = util_1.totalMemoryForContainer(container);\n // sum each container's CPU/Memory container.resources.requests/limits\n // to get the pod's overall requests/limits\n podRequestsCPU = util_1.add(podRequestsCPU, containerCpuTotal.request);\n podLimitsCPU = util_1.add(podLimitsCPU, containerCpuTotal.limit);\n podRequestsMem = util_1.add(podLimitsMem, containerMemTotal.request);\n podLimitsMem = util_1.add(podLimitsMem, containerMemTotal.limit);\n // Find the container metrics by container.name\n // if both the pod and container metrics exist\n const containerMetrics = podMetric !== undefined\n ? podMetric.containers.find((c) => c.name === container.name)\n : undefined;\n // Store the current usage of each container\n // Sum each container to get the overall pod usage\n if (containerMetrics !== undefined) {\n const currentContainerCPUUsage = util_1.quantityToScalar(containerMetrics.usage.cpu);\n const currentContainerMemUsage = util_1.quantityToScalar(containerMetrics.usage.memory);\n currentPodCPU = util_1.add(currentPodCPU, currentContainerCPUUsage);\n currentPodMem = util_1.add(currentPodMem, currentContainerMemUsage);\n const containerCpuUsage = new CurrentResourceUsage(currentContainerCPUUsage, containerCpuTotal.request, containerCpuTotal.limit);\n const containerMemUsage = new CurrentResourceUsage(currentContainerMemUsage, containerMemTotal.request, containerMemTotal.limit);\n containerStatuses.push(new ContainerStatus(containerMetrics.name, containerCpuUsage, containerMemUsage));\n }\n });\n const podCpuUsage = new CurrentResourceUsage(currentPodCPU, podRequestsCPU, podLimitsCPU);\n const podMemUsage = new CurrentResourceUsage(currentPodMem, podRequestsMem, podLimitsMem);\n result.push(new PodStatus(pod, podCpuUsage, podMemUsage, containerStatuses));\n }\n return result;\n}\nexports.topPods = topPods;\n//# sourceMappingURL=top.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.totalForResource = exports.containerTotalForResource = exports.add = exports.totalMemory = exports.totalCPU = exports.totalMemoryForContainer = exports.totalCPUForContainer = exports.ResourceStatus = exports.quantityToScalar = exports.findSuffix = exports.podsForNode = void 0;\nconst underscore_1 = require(\"underscore\");\nasync function podsForNode(api, nodeName) {\n const allPods = await api.listPodForAllNamespaces();\n return allPods.body.items.filter((pod) => pod.spec.nodeName === nodeName);\n}\nexports.podsForNode = podsForNode;\nfunction findSuffix(quantity) {\n let ix = quantity.length - 1;\n while (ix >= 0 && !/[\\.0-9]/.test(quantity.charAt(ix))) {\n ix--;\n }\n return ix === -1 ? '' : quantity.substring(ix + 1);\n}\nexports.findSuffix = findSuffix;\nfunction quantityToScalar(quantity) {\n if (!quantity) {\n return 0;\n }\n const suffix = findSuffix(quantity);\n if (suffix === '') {\n const num = Number(quantity).valueOf();\n if (isNaN(num)) {\n throw new Error('Unknown quantity ' + quantity);\n }\n return num;\n }\n switch (suffix) {\n case 'n':\n return Number(quantity.substr(0, quantity.length - 1)).valueOf() / 1000000000;\n case 'u':\n return Number(quantity.substr(0, quantity.length - 1)).valueOf() / 1000000;\n case 'm':\n return Number(quantity.substr(0, quantity.length - 1)).valueOf() / 1000.0;\n case 'k':\n return BigInt(quantity.substr(0, quantity.length - 1)) * BigInt(1000);\n case 'M':\n return BigInt(quantity.substr(0, quantity.length - 1)) * BigInt(1000 * 1000);\n case 'G':\n return BigInt(quantity.substr(0, quantity.length - 1)) * BigInt(1000 * 1000 * 1000);\n case 'T':\n return (BigInt(quantity.substr(0, quantity.length - 1)) * BigInt(1000 * 1000 * 1000) * BigInt(1000));\n case 'P':\n return (BigInt(quantity.substr(0, quantity.length - 1)) *\n BigInt(1000 * 1000 * 1000) *\n BigInt(1000 * 1000));\n case 'E':\n return (BigInt(quantity.substr(0, quantity.length - 1)) *\n BigInt(1000 * 1000 * 1000) *\n BigInt(1000 * 1000 * 1000));\n case 'Ki':\n return BigInt(quantity.substr(0, quantity.length - 2)) * BigInt(1024);\n case 'Mi':\n return BigInt(quantity.substr(0, quantity.length - 2)) * BigInt(1024 * 1024);\n case 'Gi':\n return BigInt(quantity.substr(0, quantity.length - 2)) * BigInt(1024 * 1024 * 1024);\n case 'Ti':\n return (BigInt(quantity.substr(0, quantity.length - 2)) * BigInt(1024 * 1024 * 1024) * BigInt(1024));\n case 'Pi':\n return (BigInt(quantity.substr(0, quantity.length - 2)) *\n BigInt(1024 * 1024 * 1024) *\n BigInt(1024 * 1024));\n case 'Ei':\n return (BigInt(quantity.substr(0, quantity.length - 2)) *\n BigInt(1024 * 1024 * 1024) *\n BigInt(1024 * 1024 * 1024));\n default:\n throw new Error(`Unknown suffix: ${suffix}`);\n }\n}\nexports.quantityToScalar = quantityToScalar;\nclass ResourceStatus {\n constructor(request, limit, resourceType) {\n this.request = request;\n this.limit = limit;\n this.resourceType = resourceType;\n }\n}\nexports.ResourceStatus = ResourceStatus;\nfunction totalCPUForContainer(container) {\n return containerTotalForResource(container, 'cpu');\n}\nexports.totalCPUForContainer = totalCPUForContainer;\nfunction totalMemoryForContainer(container) {\n return containerTotalForResource(container, 'memory');\n}\nexports.totalMemoryForContainer = totalMemoryForContainer;\nfunction totalCPU(pod) {\n return totalForResource(pod, 'cpu');\n}\nexports.totalCPU = totalCPU;\nfunction totalMemory(pod) {\n return totalForResource(pod, 'memory');\n}\nexports.totalMemory = totalMemory;\nfunction add(n1, n2) {\n if (underscore_1.isNumber(n1) && underscore_1.isNumber(n2)) {\n return n1 + n2;\n }\n if (underscore_1.isNumber(n1)) {\n return BigInt(Math.round(n1)) + n2;\n }\n else if (underscore_1.isNumber(n2)) {\n return n1 + BigInt(Math.round(n2));\n }\n return (n1 + n2);\n}\nexports.add = add;\nfunction containerTotalForResource(container, resource) {\n let reqTotal = 0;\n let limitTotal = 0;\n if (container.resources) {\n if (container.resources.requests) {\n reqTotal = add(reqTotal, quantityToScalar(container.resources.requests[resource]));\n }\n if (container.resources.limits) {\n limitTotal = add(limitTotal, quantityToScalar(container.resources.limits[resource]));\n }\n }\n return new ResourceStatus(reqTotal, limitTotal, resource);\n}\nexports.containerTotalForResource = containerTotalForResource;\nfunction totalForResource(pod, resource) {\n let reqTotal = 0;\n let limitTotal = 0;\n pod.spec.containers.forEach((container) => {\n const containerTotal = containerTotalForResource(container, resource);\n reqTotal = add(reqTotal, containerTotal.request);\n limitTotal = add(limitTotal, containerTotal.limit);\n });\n return new ResourceStatus(reqTotal, limitTotal, resource);\n}\nexports.totalForResource = totalForResource;\n//# sourceMappingURL=util.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Watch = exports.DefaultRequest = void 0;\nconst byline = require(\"byline\");\nconst request = require(\"request\");\nclass DefaultRequest {\n constructor(requestImpl) {\n this.requestImpl = requestImpl ? requestImpl : request;\n }\n // Using request lib can be confusing when combining Stream- with Callback-\n // style API. We avoid the callback and handle HTTP response errors, that\n // would otherwise require a different error handling, in a transparent way\n // to the user (see github issue request/request#647 for more info).\n webRequest(opts) {\n const req = this.requestImpl(opts);\n // pause the stream until we get a response not to miss any bytes\n req.pause();\n req.on('response', (resp) => {\n if (resp.statusCode === 200) {\n req.resume();\n }\n else {\n const error = new Error(resp.statusMessage);\n error.statusCode = resp.statusCode;\n req.emit('error', error);\n }\n });\n return req;\n }\n}\nexports.DefaultRequest = DefaultRequest;\nclass Watch {\n constructor(config, requestImpl) {\n this.config = config;\n if (requestImpl) {\n this.requestImpl = requestImpl;\n }\n else {\n this.requestImpl = new DefaultRequest();\n }\n }\n // Watch the resource and call provided callback with parsed json object\n // upon event received over the watcher connection.\n //\n // \"done\" callback is called either when connection is closed or when there\n // is an error. In either case, watcher takes care of properly closing the\n // underlaying connection so that it doesn't leak any resources.\n async watch(path, queryParams, callback, done) {\n const cluster = this.config.getCurrentCluster();\n if (!cluster) {\n throw new Error('No currently active cluster');\n }\n const url = cluster.server + path;\n queryParams.watch = true;\n const headerParams = {};\n const requestOptions = {\n method: 'GET',\n qs: queryParams,\n headers: headerParams,\n uri: url,\n useQuerystring: true,\n json: true,\n pool: false,\n };\n await this.config.applyToRequest(requestOptions);\n let req;\n let doneCalled = false;\n const doneCallOnce = (err) => {\n if (!doneCalled) {\n req.abort();\n doneCalled = true;\n done(err);\n }\n };\n req = this.requestImpl.webRequest(requestOptions);\n const stream = byline.createStream();\n req.on('error', doneCallOnce);\n req.on('socket', (socket) => {\n socket.setTimeout(30000);\n socket.setKeepAlive(true, 30000);\n });\n stream.on('error', doneCallOnce);\n stream.on('close', () => doneCallOnce(null));\n stream.on('data', (line) => {\n try {\n const data = JSON.parse(line);\n callback(data.type, data.object, data);\n }\n catch (ignore) {\n // ignore parse errors\n }\n });\n req.pipe(stream);\n return req;\n }\n}\nexports.Watch = Watch;\nWatch.SERVER_SIDE_CLOSE = { error: 'Connection closed on server' };\n//# sourceMappingURL=watch.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WebSocketHandler = void 0;\nconst WebSocket = require(\"isomorphic-ws\");\nconst protocols = ['v4.channel.k8s.io', 'v3.channel.k8s.io', 'v2.channel.k8s.io', 'channel.k8s.io'];\nclass WebSocketHandler {\n // factory is really just for test injection\n constructor(config, socketFactory) {\n this.config = config;\n this.socketFactory = socketFactory;\n }\n static handleStandardStreams(streamNum, buff, stdout, stderr) {\n if (buff.length < 1) {\n return null;\n }\n if (stdout && streamNum === WebSocketHandler.StdoutStream) {\n stdout.write(buff);\n }\n else if (stderr && streamNum === WebSocketHandler.StderrStream) {\n stderr.write(buff);\n }\n else if (streamNum === WebSocketHandler.StatusStream) {\n // stream closing.\n if (stdout && stdout !== process.stdout) {\n stdout.end();\n }\n if (stderr && stderr !== process.stderr) {\n stderr.end();\n }\n return JSON.parse(buff.toString('utf8'));\n }\n else {\n throw new Error('Unknown stream: ' + streamNum);\n }\n return null;\n }\n static handleStandardInput(ws, stdin, streamNum = 0) {\n stdin.on('data', (data) => {\n const buff = Buffer.alloc(data.length + 1);\n buff.writeInt8(streamNum, 0);\n if (data instanceof Buffer) {\n data.copy(buff, 1);\n }\n else {\n buff.write(data, 1);\n }\n ws.send(buff);\n });\n stdin.on('end', () => {\n ws.close();\n });\n // Keep the stream open\n return true;\n }\n static async processData(data, ws, createWS, streamNum = 0, retryCount = 3) {\n const buff = Buffer.alloc(data.length + 1);\n buff.writeInt8(streamNum, 0);\n if (data instanceof Buffer) {\n data.copy(buff, 1);\n }\n else {\n buff.write(data, 1);\n }\n let i = 0;\n for (; i < retryCount; ++i) {\n if (ws !== null && ws.readyState === WebSocket.OPEN) {\n ws.send(buff);\n break;\n }\n else {\n ws = await createWS();\n }\n }\n // This throw doesn't go anywhere.\n // TODO: Figure out the right way to return an error.\n if (i >= retryCount) {\n throw new Error(\"can't send data to ws\");\n }\n return ws;\n }\n static restartableHandleStandardInput(createWS, stdin, streamNum = 0, retryCount = 3) {\n if (retryCount < 0) {\n throw new Error(\"retryCount can't be lower than 0.\");\n }\n let queue = Promise.resolve();\n let ws = null;\n stdin.on('data', (data) => {\n queue = queue.then(async () => {\n ws = await WebSocketHandler.processData(data, ws, createWS, streamNum, retryCount);\n });\n });\n stdin.on('end', () => {\n if (ws) {\n ws.close();\n }\n });\n return () => ws;\n }\n /**\n * Connect to a web socket endpoint.\n * @param path The HTTP Path to connect to on the server.\n * @param textHandler Callback for text over the web socket.\n * Returns true if the connection should be kept alive, false to disconnect.\n * @param binaryHandler Callback for binary data over the web socket.\n * Returns true if the connection should be kept alive, false to disconnect.\n */\n async connect(path, textHandler, binaryHandler) {\n const cluster = this.config.getCurrentCluster();\n if (!cluster) {\n throw new Error('No cluster is defined.');\n }\n const server = cluster.server;\n const ssl = server.startsWith('https://');\n const target = ssl ? server.substr(8) : server.substr(7);\n const proto = ssl ? 'wss' : 'ws';\n const uri = `${proto}://${target}${path}`;\n const opts = {};\n await this.config.applytoHTTPSOptions(opts);\n return await new Promise((resolve, reject) => {\n const client = this.socketFactory\n ? this.socketFactory(uri, opts)\n : new WebSocket(uri, protocols, opts);\n let resolved = false;\n client.onopen = () => {\n resolved = true;\n resolve(client);\n };\n client.onerror = (err) => {\n if (!resolved) {\n reject(err);\n }\n };\n client.onmessage = ({ data }) => {\n // TODO: support ArrayBuffer and Buffer[] data types?\n if (typeof data === 'string') {\n if (textHandler && !textHandler(data)) {\n client.close();\n }\n }\n else if (data instanceof Buffer) {\n const streamNum = data.readInt8(0);\n if (binaryHandler && !binaryHandler(streamNum, data.slice(1))) {\n client.close();\n }\n }\n };\n });\n }\n}\nexports.WebSocketHandler = WebSocketHandler;\nWebSocketHandler.StdinStream = 0;\nWebSocketHandler.StdoutStream = 1;\nWebSocketHandler.StderrStream = 2;\nWebSocketHandler.StatusStream = 3;\nWebSocketHandler.ResizeStream = 4;\n//# sourceMappingURL=web-socket-handler.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.dumpYaml = exports.loadAllYaml = exports.loadYaml = void 0;\nconst tslib_1 = require(\"tslib\");\nconst yaml = tslib_1.__importStar(require(\"js-yaml\"));\nfunction loadYaml(data, opts) {\n return yaml.load(data, opts);\n}\nexports.loadYaml = loadYaml;\nfunction loadAllYaml(data, opts) {\n return yaml.loadAll(data, undefined, opts);\n}\nexports.loadAllYaml = loadAllYaml;\nfunction dumpYaml(object, opts) {\n return yaml.dump(object, opts);\n}\nexports.dumpYaml = dumpYaml;\n//# sourceMappingURL=yaml.js.map","'use strict';\nconst path = require('path');\nconst childProcess = require('child_process');\nconst crossSpawn = require('cross-spawn');\nconst stripFinalNewline = require('strip-final-newline');\nconst npmRunPath = require('npm-run-path');\nconst onetime = require('onetime');\nconst makeError = require('./lib/error');\nconst normalizeStdio = require('./lib/stdio');\nconst {spawnedKill, spawnedCancel, setupTimeout, setExitHandler} = require('./lib/kill');\nconst {handleInput, getSpawnedResult, makeAllStream, validateInputSync} = require('./lib/stream.js');\nconst {mergePromise, getSpawnedPromise} = require('./lib/promise.js');\nconst {joinCommand, parseCommand} = require('./lib/command.js');\n\nconst DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;\n\nconst getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {\n\tconst env = extendEnv ? {...process.env, ...envOption} : envOption;\n\n\tif (preferLocal) {\n\t\treturn npmRunPath.env({env, cwd: localDir, execPath});\n\t}\n\n\treturn env;\n};\n\nconst handleArguments = (file, args, options = {}) => {\n\tconst parsed = crossSpawn._parse(file, args, options);\n\tfile = parsed.command;\n\targs = parsed.args;\n\toptions = parsed.options;\n\n\toptions = {\n\t\tmaxBuffer: DEFAULT_MAX_BUFFER,\n\t\tbuffer: true,\n\t\tstripFinalNewline: true,\n\t\textendEnv: true,\n\t\tpreferLocal: false,\n\t\tlocalDir: options.cwd || process.cwd(),\n\t\texecPath: process.execPath,\n\t\tencoding: 'utf8',\n\t\treject: true,\n\t\tcleanup: true,\n\t\tall: false,\n\t\twindowsHide: true,\n\t\t...options\n\t};\n\n\toptions.env = getEnv(options);\n\n\toptions.stdio = normalizeStdio(options);\n\n\tif (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {\n\t\t// #116\n\t\targs.unshift('/q');\n\t}\n\n\treturn {file, args, options, parsed};\n};\n\nconst handleOutput = (options, value, error) => {\n\tif (typeof value !== 'string' && !Buffer.isBuffer(value)) {\n\t\t// When `execa.sync()` errors, we normalize it to '' to mimic `execa()`\n\t\treturn error === undefined ? undefined : '';\n\t}\n\n\tif (options.stripFinalNewline) {\n\t\treturn stripFinalNewline(value);\n\t}\n\n\treturn value;\n};\n\nconst execa = (file, args, options) => {\n\tconst parsed = handleArguments(file, args, options);\n\tconst command = joinCommand(file, args);\n\n\tlet spawned;\n\ttry {\n\t\tspawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);\n\t} catch (error) {\n\t\t// Ensure the returned error is always both a promise and a child process\n\t\tconst dummySpawned = new childProcess.ChildProcess();\n\t\tconst errorPromise = Promise.reject(makeError({\n\t\t\terror,\n\t\t\tstdout: '',\n\t\t\tstderr: '',\n\t\t\tall: '',\n\t\t\tcommand,\n\t\t\tparsed,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false\n\t\t}));\n\t\treturn mergePromise(dummySpawned, errorPromise);\n\t}\n\n\tconst spawnedPromise = getSpawnedPromise(spawned);\n\tconst timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);\n\tconst processDone = setExitHandler(spawned, parsed.options, timedPromise);\n\n\tconst context = {isCanceled: false};\n\n\tspawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));\n\tspawned.cancel = spawnedCancel.bind(null, spawned, context);\n\n\tconst handlePromise = async () => {\n\t\tconst [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);\n\t\tconst stdout = handleOutput(parsed.options, stdoutResult);\n\t\tconst stderr = handleOutput(parsed.options, stderrResult);\n\t\tconst all = handleOutput(parsed.options, allResult);\n\n\t\tif (error || exitCode !== 0 || signal !== null) {\n\t\t\tconst returnedError = makeError({\n\t\t\t\terror,\n\t\t\t\texitCode,\n\t\t\t\tsignal,\n\t\t\t\tstdout,\n\t\t\t\tstderr,\n\t\t\t\tall,\n\t\t\t\tcommand,\n\t\t\t\tparsed,\n\t\t\t\ttimedOut,\n\t\t\t\tisCanceled: context.isCanceled,\n\t\t\t\tkilled: spawned.killed\n\t\t\t});\n\n\t\t\tif (!parsed.options.reject) {\n\t\t\t\treturn returnedError;\n\t\t\t}\n\n\t\t\tthrow returnedError;\n\t\t}\n\n\t\treturn {\n\t\t\tcommand,\n\t\t\texitCode: 0,\n\t\t\tstdout,\n\t\t\tstderr,\n\t\t\tall,\n\t\t\tfailed: false,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false\n\t\t};\n\t};\n\n\tconst handlePromiseOnce = onetime(handlePromise);\n\n\thandleInput(spawned, parsed.options.input);\n\n\tspawned.all = makeAllStream(spawned, parsed.options);\n\n\treturn mergePromise(spawned, handlePromiseOnce);\n};\n\nmodule.exports = execa;\n\nmodule.exports.sync = (file, args, options) => {\n\tconst parsed = handleArguments(file, args, options);\n\tconst command = joinCommand(file, args);\n\n\tvalidateInputSync(parsed.options);\n\n\tlet result;\n\ttry {\n\t\tresult = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);\n\t} catch (error) {\n\t\tthrow makeError({\n\t\t\terror,\n\t\t\tstdout: '',\n\t\t\tstderr: '',\n\t\t\tall: '',\n\t\t\tcommand,\n\t\t\tparsed,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false\n\t\t});\n\t}\n\n\tconst stdout = handleOutput(parsed.options, result.stdout, result.error);\n\tconst stderr = handleOutput(parsed.options, result.stderr, result.error);\n\n\tif (result.error || result.status !== 0 || result.signal !== null) {\n\t\tconst error = makeError({\n\t\t\tstdout,\n\t\t\tstderr,\n\t\t\terror: result.error,\n\t\t\tsignal: result.signal,\n\t\t\texitCode: result.status,\n\t\t\tcommand,\n\t\t\tparsed,\n\t\t\ttimedOut: result.error && result.error.code === 'ETIMEDOUT',\n\t\t\tisCanceled: false,\n\t\t\tkilled: result.signal !== null\n\t\t});\n\n\t\tif (!parsed.options.reject) {\n\t\t\treturn error;\n\t\t}\n\n\t\tthrow error;\n\t}\n\n\treturn {\n\t\tcommand,\n\t\texitCode: 0,\n\t\tstdout,\n\t\tstderr,\n\t\tfailed: false,\n\t\ttimedOut: false,\n\t\tisCanceled: false,\n\t\tkilled: false\n\t};\n};\n\nmodule.exports.command = (command, options) => {\n\tconst [file, ...args] = parseCommand(command);\n\treturn execa(file, args, options);\n};\n\nmodule.exports.commandSync = (command, options) => {\n\tconst [file, ...args] = parseCommand(command);\n\treturn execa.sync(file, args, options);\n};\n\nmodule.exports.node = (scriptPath, args, options = {}) => {\n\tif (args && !Array.isArray(args) && typeof args === 'object') {\n\t\toptions = args;\n\t\targs = [];\n\t}\n\n\tconst stdio = normalizeStdio.node(options);\n\tconst defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));\n\n\tconst {\n\t\tnodePath = process.execPath,\n\t\tnodeOptions = defaultExecArgv\n\t} = options;\n\n\treturn execa(\n\t\tnodePath,\n\t\t[\n\t\t\t...nodeOptions,\n\t\t\tscriptPath,\n\t\t\t...(Array.isArray(args) ? args : [])\n\t\t],\n\t\t{\n\t\t\t...options,\n\t\t\tstdin: undefined,\n\t\t\tstdout: undefined,\n\t\t\tstderr: undefined,\n\t\t\tstdio,\n\t\t\tshell: false\n\t\t}\n\t);\n};\n","'use strict';\nconst SPACES_REGEXP = / +/g;\n\nconst joinCommand = (file, args = []) => {\n\tif (!Array.isArray(args)) {\n\t\treturn file;\n\t}\n\n\treturn [file, ...args].join(' ');\n};\n\n// Handle `execa.command()`\nconst parseCommand = command => {\n\tconst tokens = [];\n\tfor (const token of command.trim().split(SPACES_REGEXP)) {\n\t\t// Allow spaces to be escaped by a backslash if not meant as a delimiter\n\t\tconst previousToken = tokens[tokens.length - 1];\n\t\tif (previousToken && previousToken.endsWith('\\\\')) {\n\t\t\t// Merge previous token with current one\n\t\t\ttokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;\n\t\t} else {\n\t\t\ttokens.push(token);\n\t\t}\n\t}\n\n\treturn tokens;\n};\n\nmodule.exports = {\n\tjoinCommand,\n\tparseCommand\n};\n","'use strict';\nconst {signalsByName} = require('human-signals');\n\nconst getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => {\n\tif (timedOut) {\n\t\treturn `timed out after ${timeout} milliseconds`;\n\t}\n\n\tif (isCanceled) {\n\t\treturn 'was canceled';\n\t}\n\n\tif (errorCode !== undefined) {\n\t\treturn `failed with ${errorCode}`;\n\t}\n\n\tif (signal !== undefined) {\n\t\treturn `was killed with ${signal} (${signalDescription})`;\n\t}\n\n\tif (exitCode !== undefined) {\n\t\treturn `failed with exit code ${exitCode}`;\n\t}\n\n\treturn 'failed';\n};\n\nconst makeError = ({\n\tstdout,\n\tstderr,\n\tall,\n\terror,\n\tsignal,\n\texitCode,\n\tcommand,\n\ttimedOut,\n\tisCanceled,\n\tkilled,\n\tparsed: {options: {timeout}}\n}) => {\n\t// `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`.\n\t// We normalize them to `undefined`\n\texitCode = exitCode === null ? undefined : exitCode;\n\tsignal = signal === null ? undefined : signal;\n\tconst signalDescription = signal === undefined ? undefined : signalsByName[signal].description;\n\n\tconst errorCode = error && error.code;\n\n\tconst prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled});\n\tconst execaMessage = `Command ${prefix}: ${command}`;\n\tconst isError = Object.prototype.toString.call(error) === '[object Error]';\n\tconst shortMessage = isError ? `${execaMessage}\\n${error.message}` : execaMessage;\n\tconst message = [shortMessage, stderr, stdout].filter(Boolean).join('\\n');\n\n\tif (isError) {\n\t\terror.originalMessage = error.message;\n\t\terror.message = message;\n\t} else {\n\t\terror = new Error(message);\n\t}\n\n\terror.shortMessage = shortMessage;\n\terror.command = command;\n\terror.exitCode = exitCode;\n\terror.signal = signal;\n\terror.signalDescription = signalDescription;\n\terror.stdout = stdout;\n\terror.stderr = stderr;\n\n\tif (all !== undefined) {\n\t\terror.all = all;\n\t}\n\n\tif ('bufferedData' in error) {\n\t\tdelete error.bufferedData;\n\t}\n\n\terror.failed = true;\n\terror.timedOut = Boolean(timedOut);\n\terror.isCanceled = isCanceled;\n\terror.killed = killed && !timedOut;\n\n\treturn error;\n};\n\nmodule.exports = makeError;\n","'use strict';\nconst os = require('os');\nconst onExit = require('signal-exit');\n\nconst DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;\n\n// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior\nconst spawnedKill = (kill, signal = 'SIGTERM', options = {}) => {\n\tconst killResult = kill(signal);\n\tsetKillTimeout(kill, signal, options, killResult);\n\treturn killResult;\n};\n\nconst setKillTimeout = (kill, signal, options, killResult) => {\n\tif (!shouldForceKill(signal, options, killResult)) {\n\t\treturn;\n\t}\n\n\tconst timeout = getForceKillAfterTimeout(options);\n\tconst t = setTimeout(() => {\n\t\tkill('SIGKILL');\n\t}, timeout);\n\n\t// Guarded because there's no `.unref()` when `execa` is used in the renderer\n\t// process in Electron. This cannot be tested since we don't run tests in\n\t// Electron.\n\t// istanbul ignore else\n\tif (t.unref) {\n\t\tt.unref();\n\t}\n};\n\nconst shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => {\n\treturn isSigterm(signal) && forceKillAfterTimeout !== false && killResult;\n};\n\nconst isSigterm = signal => {\n\treturn signal === os.constants.signals.SIGTERM ||\n\t\t(typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM');\n};\n\nconst getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => {\n\tif (forceKillAfterTimeout === true) {\n\t\treturn DEFAULT_FORCE_KILL_TIMEOUT;\n\t}\n\n\tif (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {\n\t\tthrow new TypeError(`Expected the \\`forceKillAfterTimeout\\` option to be a non-negative integer, got \\`${forceKillAfterTimeout}\\` (${typeof forceKillAfterTimeout})`);\n\t}\n\n\treturn forceKillAfterTimeout;\n};\n\n// `childProcess.cancel()`\nconst spawnedCancel = (spawned, context) => {\n\tconst killResult = spawned.kill();\n\n\tif (killResult) {\n\t\tcontext.isCanceled = true;\n\t}\n};\n\nconst timeoutKill = (spawned, signal, reject) => {\n\tspawned.kill(signal);\n\treject(Object.assign(new Error('Timed out'), {timedOut: true, signal}));\n};\n\n// `timeout` option handling\nconst setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => {\n\tif (timeout === 0 || timeout === undefined) {\n\t\treturn spawnedPromise;\n\t}\n\n\tif (!Number.isFinite(timeout) || timeout < 0) {\n\t\tthrow new TypeError(`Expected the \\`timeout\\` option to be a non-negative integer, got \\`${timeout}\\` (${typeof timeout})`);\n\t}\n\n\tlet timeoutId;\n\tconst timeoutPromise = new Promise((resolve, reject) => {\n\t\ttimeoutId = setTimeout(() => {\n\t\t\ttimeoutKill(spawned, killSignal, reject);\n\t\t}, timeout);\n\t});\n\n\tconst safeSpawnedPromise = spawnedPromise.finally(() => {\n\t\tclearTimeout(timeoutId);\n\t});\n\n\treturn Promise.race([timeoutPromise, safeSpawnedPromise]);\n};\n\n// `cleanup` option handling\nconst setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => {\n\tif (!cleanup || detached) {\n\t\treturn timedPromise;\n\t}\n\n\tconst removeExitHandler = onExit(() => {\n\t\tspawned.kill();\n\t});\n\n\treturn timedPromise.finally(() => {\n\t\tremoveExitHandler();\n\t});\n};\n\nmodule.exports = {\n\tspawnedKill,\n\tspawnedCancel,\n\tsetupTimeout,\n\tsetExitHandler\n};\n","'use strict';\n\nconst nativePromisePrototype = (async () => {})().constructor.prototype;\nconst descriptors = ['then', 'catch', 'finally'].map(property => [\n\tproperty,\n\tReflect.getOwnPropertyDescriptor(nativePromisePrototype, property)\n]);\n\n// The return value is a mixin of `childProcess` and `Promise`\nconst mergePromise = (spawned, promise) => {\n\tfor (const [property, descriptor] of descriptors) {\n\t\t// Starting the main `promise` is deferred to avoid consuming streams\n\t\tconst value = typeof promise === 'function' ?\n\t\t\t(...args) => Reflect.apply(descriptor.value, promise(), args) :\n\t\t\tdescriptor.value.bind(promise);\n\n\t\tReflect.defineProperty(spawned, property, {...descriptor, value});\n\t}\n\n\treturn spawned;\n};\n\n// Use promises instead of `child_process` events\nconst getSpawnedPromise = spawned => {\n\treturn new Promise((resolve, reject) => {\n\t\tspawned.on('exit', (exitCode, signal) => {\n\t\t\tresolve({exitCode, signal});\n\t\t});\n\n\t\tspawned.on('error', error => {\n\t\t\treject(error);\n\t\t});\n\n\t\tif (spawned.stdin) {\n\t\t\tspawned.stdin.on('error', error => {\n\t\t\t\treject(error);\n\t\t\t});\n\t\t}\n\t});\n};\n\nmodule.exports = {\n\tmergePromise,\n\tgetSpawnedPromise\n};\n\n","'use strict';\nconst aliases = ['stdin', 'stdout', 'stderr'];\n\nconst hasAlias = options => aliases.some(alias => options[alias] !== undefined);\n\nconst normalizeStdio = options => {\n\tif (!options) {\n\t\treturn;\n\t}\n\n\tconst {stdio} = options;\n\n\tif (stdio === undefined) {\n\t\treturn aliases.map(alias => options[alias]);\n\t}\n\n\tif (hasAlias(options)) {\n\t\tthrow new Error(`It's not possible to provide \\`stdio\\` in combination with one of ${aliases.map(alias => `\\`${alias}\\``).join(', ')}`);\n\t}\n\n\tif (typeof stdio === 'string') {\n\t\treturn stdio;\n\t}\n\n\tif (!Array.isArray(stdio)) {\n\t\tthrow new TypeError(`Expected \\`stdio\\` to be of type \\`string\\` or \\`Array\\`, got \\`${typeof stdio}\\``);\n\t}\n\n\tconst length = Math.max(stdio.length, aliases.length);\n\treturn Array.from({length}, (value, index) => stdio[index]);\n};\n\nmodule.exports = normalizeStdio;\n\n// `ipc` is pushed unless it is already present\nmodule.exports.node = options => {\n\tconst stdio = normalizeStdio(options);\n\n\tif (stdio === 'ipc') {\n\t\treturn 'ipc';\n\t}\n\n\tif (stdio === undefined || typeof stdio === 'string') {\n\t\treturn [stdio, stdio, stdio, 'ipc'];\n\t}\n\n\tif (stdio.includes('ipc')) {\n\t\treturn stdio;\n\t}\n\n\treturn [...stdio, 'ipc'];\n};\n","'use strict';\nconst isStream = require('is-stream');\nconst getStream = require('get-stream');\nconst mergeStream = require('merge-stream');\n\n// `input` option\nconst handleInput = (spawned, input) => {\n\t// Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852\n\t// TODO: Remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0\n\tif (input === undefined || spawned.stdin === undefined) {\n\t\treturn;\n\t}\n\n\tif (isStream(input)) {\n\t\tinput.pipe(spawned.stdin);\n\t} else {\n\t\tspawned.stdin.end(input);\n\t}\n};\n\n// `all` interleaves `stdout` and `stderr`\nconst makeAllStream = (spawned, {all}) => {\n\tif (!all || (!spawned.stdout && !spawned.stderr)) {\n\t\treturn;\n\t}\n\n\tconst mixed = mergeStream();\n\n\tif (spawned.stdout) {\n\t\tmixed.add(spawned.stdout);\n\t}\n\n\tif (spawned.stderr) {\n\t\tmixed.add(spawned.stderr);\n\t}\n\n\treturn mixed;\n};\n\n// On failure, `result.stdout|stderr|all` should contain the currently buffered stream\nconst getBufferedData = async (stream, streamPromise) => {\n\tif (!stream) {\n\t\treturn;\n\t}\n\n\tstream.destroy();\n\n\ttry {\n\t\treturn await streamPromise;\n\t} catch (error) {\n\t\treturn error.bufferedData;\n\t}\n};\n\nconst getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => {\n\tif (!stream || !buffer) {\n\t\treturn;\n\t}\n\n\tif (encoding) {\n\t\treturn getStream(stream, {encoding, maxBuffer});\n\t}\n\n\treturn getStream.buffer(stream, {maxBuffer});\n};\n\n// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all)\nconst getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => {\n\tconst stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer});\n\tconst stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer});\n\tconst allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2});\n\n\ttry {\n\t\treturn await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);\n\t} catch (error) {\n\t\treturn Promise.all([\n\t\t\t{error, signal: error.signal, timedOut: error.timedOut},\n\t\t\tgetBufferedData(stdout, stdoutPromise),\n\t\t\tgetBufferedData(stderr, stderrPromise),\n\t\t\tgetBufferedData(all, allPromise)\n\t\t]);\n\t}\n};\n\nconst validateInputSync = ({input}) => {\n\tif (isStream(input)) {\n\t\tthrow new TypeError('The `input` option cannot be a stream in sync mode');\n\t}\n};\n\nmodule.exports = {\n\thandleInput,\n\tmakeAllStream,\n\tgetSpawnedResult,\n\tvalidateInputSync\n};\n\n","const CODES = {\n JOSEAlgNotWhitelisted: 'ERR_JOSE_ALG_NOT_WHITELISTED',\n JOSECritNotUnderstood: 'ERR_JOSE_CRIT_NOT_UNDERSTOOD',\n JOSEInvalidEncoding: 'ERR_JOSE_INVALID_ENCODING',\n JOSEMultiError: 'ERR_JOSE_MULTIPLE_ERRORS',\n JOSENotSupported: 'ERR_JOSE_NOT_SUPPORTED',\n JWEDecryptionFailed: 'ERR_JWE_DECRYPTION_FAILED',\n JWEInvalid: 'ERR_JWE_INVALID',\n JWKImportFailed: 'ERR_JWK_IMPORT_FAILED',\n JWKInvalid: 'ERR_JWK_INVALID',\n JWKKeySupport: 'ERR_JWK_KEY_SUPPORT',\n JWKSNoMatchingKey: 'ERR_JWKS_NO_MATCHING_KEY',\n JWSInvalid: 'ERR_JWS_INVALID',\n JWSVerificationFailed: 'ERR_JWS_VERIFICATION_FAILED',\n JWTClaimInvalid: 'ERR_JWT_CLAIM_INVALID',\n JWTExpired: 'ERR_JWT_EXPIRED',\n JWTMalformed: 'ERR_JWT_MALFORMED'\n}\n\nconst DEFAULT_MESSAGES = {\n JWEDecryptionFailed: 'decryption operation failed',\n JWEInvalid: 'JWE invalid',\n JWKSNoMatchingKey: 'no matching key found in the KeyStore',\n JWSInvalid: 'JWS invalid',\n JWSVerificationFailed: 'signature verification failed'\n}\n\nclass JOSEError extends Error {\n constructor (message) {\n super(message)\n if (message === undefined) {\n this.message = DEFAULT_MESSAGES[this.constructor.name]\n }\n this.name = this.constructor.name\n this.code = CODES[this.constructor.name]\n Error.captureStackTrace(this, this.constructor)\n }\n}\n\nconst isMulti = e => e instanceof JOSEMultiError\nclass JOSEMultiError extends JOSEError {\n constructor (errors) {\n super()\n let i\n while ((i = errors.findIndex(isMulti)) && i !== -1) {\n errors.splice(i, 1, ...errors[i])\n }\n Object.defineProperty(this, 'errors', { value: errors })\n }\n\n * [Symbol.iterator] () {\n for (const error of this.errors) {\n yield error\n }\n }\n}\nmodule.exports.JOSEError = JOSEError\n\nmodule.exports.JOSEAlgNotWhitelisted = class JOSEAlgNotWhitelisted extends JOSEError {}\nmodule.exports.JOSECritNotUnderstood = class JOSECritNotUnderstood extends JOSEError {}\nmodule.exports.JOSEInvalidEncoding = class JOSEInvalidEncoding extends JOSEError {}\nmodule.exports.JOSEMultiError = JOSEMultiError\nmodule.exports.JOSENotSupported = class JOSENotSupported extends JOSEError {}\n\nmodule.exports.JWEDecryptionFailed = class JWEDecryptionFailed extends JOSEError {}\nmodule.exports.JWEInvalid = class JWEInvalid extends JOSEError {}\n\nmodule.exports.JWKImportFailed = class JWKImportFailed extends JOSEError {}\nmodule.exports.JWKInvalid = class JWKInvalid extends JOSEError {}\nmodule.exports.JWKKeySupport = class JWKKeySupport extends JOSEError {}\n\nmodule.exports.JWKSNoMatchingKey = class JWKSNoMatchingKey extends JOSEError {}\n\nmodule.exports.JWSInvalid = class JWSInvalid extends JOSEError {}\nmodule.exports.JWSVerificationFailed = class JWSVerificationFailed extends JOSEError {}\n\nclass JWTClaimInvalid extends JOSEError {\n constructor (message, claim = 'unspecified', reason = 'unspecified') {\n super(message)\n this.claim = claim\n this.reason = reason\n }\n}\nmodule.exports.JWTClaimInvalid = JWTClaimInvalid\nmodule.exports.JWTExpired = class JWTExpired extends JWTClaimInvalid {}\nmodule.exports.JWTMalformed = class JWTMalformed extends JOSEError {}\n","const oids = require('./oids')\n\nmodule.exports = function () {\n this.seq().obj(\n this.key('algorithm').objid(oids),\n this.key('parameters').optional().choice({ namedCurve: this.objid(oids), null: this.null_() })\n )\n}\n","const oids = require('./oids')\n\nmodule.exports = function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('privateKey').octstr(),\n this.key('parameters').explicit(0).optional().choice({ namedCurve: this.objid(oids) }),\n this.key('publicKey').explicit(1).optional().bitstr()\n )\n}\n","const asn1 = require('@panva/asn1.js')\n\nconst types = new Map()\n\nconst AlgorithmIdentifier = asn1.define('AlgorithmIdentifier', require('./algorithm_identifier'))\ntypes.set('AlgorithmIdentifier', AlgorithmIdentifier)\n\nconst ECPrivateKey = asn1.define('ECPrivateKey', require('./ec_private_key'))\ntypes.set('ECPrivateKey', ECPrivateKey)\n\nconst PrivateKeyInfo = asn1.define('PrivateKeyInfo', require('./private_key_info')(AlgorithmIdentifier))\ntypes.set('PrivateKeyInfo', PrivateKeyInfo)\n\nconst PublicKeyInfo = asn1.define('PublicKeyInfo', require('./public_key_info')(AlgorithmIdentifier))\ntypes.set('PublicKeyInfo', PublicKeyInfo)\n\nconst PrivateKey = asn1.define('PrivateKey', require('./private_key'))\ntypes.set('PrivateKey', PrivateKey)\n\nconst OneAsymmetricKey = asn1.define('OneAsymmetricKey', require('./one_asymmetric_key')(AlgorithmIdentifier, PrivateKey))\ntypes.set('OneAsymmetricKey', OneAsymmetricKey)\n\nconst RSAPrivateKey = asn1.define('RSAPrivateKey', require('./rsa_private_key'))\ntypes.set('RSAPrivateKey', RSAPrivateKey)\n\nconst RSAPublicKey = asn1.define('RSAPublicKey', require('./rsa_public_key'))\ntypes.set('RSAPublicKey', RSAPublicKey)\n\nmodule.exports = types\n","const oids = {\n '1 2 840 10045 3 1 7': 'P-256',\n '1 3 132 0 10': 'secp256k1',\n '1 3 132 0 34': 'P-384',\n '1 3 132 0 35': 'P-521',\n '1 2 840 10045 2 1': 'ecPublicKey',\n '1 2 840 113549 1 1 1': 'rsaEncryption',\n '1 3 101 110': 'X25519',\n '1 3 101 111': 'X448',\n '1 3 101 112': 'Ed25519',\n '1 3 101 113': 'Ed448'\n}\n\nmodule.exports = oids\n","module.exports = (AlgorithmIdentifier, PrivateKey) => function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('privateKey').use(PrivateKey)\n )\n}\n","module.exports = function () {\n this.octstr().contains().obj(\n this.key('privateKey').octstr()\n )\n}\n","module.exports = (AlgorithmIdentifier) => function () {\n this.seq().obj(\n this.key('version').int(),\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('privateKey').octstr()\n )\n}\n","module.exports = AlgorithmIdentifier => function () {\n this.seq().obj(\n this.key('algorithm').use(AlgorithmIdentifier),\n this.key('publicKey').bitstr()\n )\n}\n","module.exports = function () {\n this.seq().obj(\n this.key('version').int({ 0: 'two-prime', 1: 'multi' }),\n this.key('n').int(),\n this.key('e').int(),\n this.key('d').int(),\n this.key('p').int(),\n this.key('q').int(),\n this.key('dp').int(),\n this.key('dq').int(),\n this.key('qi').int()\n )\n}\n","module.exports = function () {\n this.seq().obj(\n this.key('n').int(),\n this.key('e').int()\n )\n}\n","let encode\nlet encodeBuffer\nif (Buffer.isEncoding('base64url')) {\n encode = (input, encoding = 'utf8') => Buffer.from(input, encoding).toString('base64url')\n encodeBuffer = (buf) => buf.toString('base64url')\n} else {\n const fromBase64 = (base64) => base64.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_')\n encode = (input, encoding = 'utf8') => fromBase64(Buffer.from(input, encoding).toString('base64'))\n encodeBuffer = (buf) => fromBase64(buf.toString('base64'))\n}\n\nconst decodeToBuffer = (input) => {\n return Buffer.from(input, 'base64')\n}\n\nconst decode = (input, encoding = 'utf8') => {\n return decodeToBuffer(input).toString(encoding)\n}\n\nconst b64uJSON = {\n encode: (input) => {\n return encode(JSON.stringify(input))\n },\n decode: (input, encoding = 'utf8') => {\n return JSON.parse(decode(input, encoding))\n }\n}\n\nb64uJSON.decode.try = (input, encoding = 'utf8') => {\n try {\n return b64uJSON.decode(input, encoding)\n } catch (err) {\n return decode(input, encoding)\n }\n}\n\nconst bnToBuf = (bn) => {\n let hex = BigInt(bn).toString(16)\n if (hex.length % 2) {\n hex = `0${hex}`\n }\n\n const len = hex.length / 2\n const u8 = new Uint8Array(len)\n\n let i = 0\n let j = 0\n while (i < len) {\n u8[i] = parseInt(hex.slice(j, j + 2), 16)\n i += 1\n j += 2\n }\n\n return u8\n}\n\nconst encodeBigInt = (bn) => encodeBuffer(Buffer.from(bnToBuf(bn)))\n\nmodule.exports.decode = decode\nmodule.exports.decodeToBuffer = decodeToBuffer\nmodule.exports.encode = encode\nmodule.exports.encodeBuffer = encodeBuffer\nmodule.exports.JSON = b64uJSON\nmodule.exports.encodeBigInt = encodeBigInt\n","module.exports.KEYOBJECT = Symbol('KEYOBJECT')\nmodule.exports.PRIVATE_MEMBERS = Symbol('PRIVATE_MEMBERS')\nmodule.exports.PUBLIC_MEMBERS = Symbol('PUBLIC_MEMBERS')\nmodule.exports.THUMBPRINT_MATERIAL = Symbol('THUMBPRINT_MATERIAL')\nmodule.exports.JWK_MEMBERS = Symbol('JWK_MEMBERS')\nmodule.exports.KEY_MANAGEMENT_ENCRYPT = Symbol('KEY_MANAGEMENT_ENCRYPT')\nmodule.exports.KEY_MANAGEMENT_DECRYPT = Symbol('KEY_MANAGEMENT_DECRYPT')\n\nconst USES_MAPPING = {\n sig: new Set(['sign', 'verify']),\n enc: new Set(['encrypt', 'decrypt', 'wrapKey', 'unwrapKey', 'deriveKey'])\n}\nconst OPS = new Set([...USES_MAPPING.sig, ...USES_MAPPING.enc])\nconst USES = new Set(Object.keys(USES_MAPPING))\n\nmodule.exports.USES_MAPPING = USES_MAPPING\nmodule.exports.OPS = OPS\nmodule.exports.USES = USES\n","module.exports = obj => JSON.parse(JSON.stringify(obj))\n","const MAX_OCTET = 0x80\nconst CLASS_UNIVERSAL = 0\nconst PRIMITIVE_BIT = 0x20\nconst TAG_SEQ = 0x10\nconst TAG_INT = 0x02\nconst ENCODED_TAG_SEQ = (TAG_SEQ | PRIMITIVE_BIT) | (CLASS_UNIVERSAL << 6)\nconst ENCODED_TAG_INT = TAG_INT | (CLASS_UNIVERSAL << 6)\n\nconst getParamSize = keySize => ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1)\n\nconst paramBytesForAlg = {\n ES256: getParamSize(256),\n ES256K: getParamSize(256),\n ES384: getParamSize(384),\n ES512: getParamSize(521)\n}\n\nconst countPadding = (buf, start, stop) => {\n let padding = 0\n while (start + padding < stop && buf[start + padding] === 0) {\n ++padding\n }\n\n const needsSign = buf[start + padding] >= MAX_OCTET\n if (needsSign) {\n --padding\n }\n\n return padding\n}\n\nmodule.exports.derToJose = (signature, alg) => {\n if (!Buffer.isBuffer(signature)) {\n throw new TypeError('ECDSA signature must be a Buffer')\n }\n\n if (!paramBytesForAlg[alg]) {\n throw new Error(`Unknown algorithm \"${alg}\"`)\n }\n\n const paramBytes = paramBytesForAlg[alg]\n\n // the DER encoded param should at most be the param size, plus a padding\n // zero, since due to being a signed integer\n const maxEncodedParamLength = paramBytes + 1\n\n const inputLength = signature.length\n\n let offset = 0\n if (signature[offset++] !== ENCODED_TAG_SEQ) {\n throw new Error('Could not find expected \"seq\"')\n }\n\n let seqLength = signature[offset++]\n if (seqLength === (MAX_OCTET | 1)) {\n seqLength = signature[offset++]\n }\n\n if (inputLength - offset < seqLength) {\n throw new Error(`\"seq\" specified length of ${seqLength}\", only ${inputLength - offset}\" remaining`)\n }\n\n if (signature[offset++] !== ENCODED_TAG_INT) {\n throw new Error('Could not find expected \"int\" for \"r\"')\n }\n\n const rLength = signature[offset++]\n\n if (inputLength - offset - 2 < rLength) {\n throw new Error(`\"r\" specified length of \"${rLength}\", only \"${inputLength - offset - 2}\" available`)\n }\n\n if (maxEncodedParamLength < rLength) {\n throw new Error(`\"r\" specified length of \"${rLength}\", max of \"${maxEncodedParamLength}\" is acceptable`)\n }\n\n const rOffset = offset\n offset += rLength\n\n if (signature[offset++] !== ENCODED_TAG_INT) {\n throw new Error('Could not find expected \"int\" for \"s\"')\n }\n\n const sLength = signature[offset++]\n\n if (inputLength - offset !== sLength) {\n throw new Error(`\"s\" specified length of \"${sLength}\", expected \"${inputLength - offset}\"`)\n }\n\n if (maxEncodedParamLength < sLength) {\n throw new Error(`\"s\" specified length of \"${sLength}\", max of \"${maxEncodedParamLength}\" is acceptable`)\n }\n\n const sOffset = offset\n offset += sLength\n\n if (offset !== inputLength) {\n throw new Error(`Expected to consume entire buffer, but \"${inputLength - offset}\" bytes remain`)\n }\n\n const rPadding = paramBytes - rLength\n\n const sPadding = paramBytes - sLength\n\n const dst = Buffer.allocUnsafe(rPadding + rLength + sPadding + sLength)\n\n for (offset = 0; offset < rPadding; ++offset) {\n dst[offset] = 0\n }\n signature.copy(dst, offset, rOffset + Math.max(-rPadding, 0), rOffset + rLength)\n\n offset = paramBytes\n\n for (const o = offset; offset < o + sPadding; ++offset) {\n dst[offset] = 0\n }\n signature.copy(dst, offset, sOffset + Math.max(-sPadding, 0), sOffset + sLength)\n\n return dst\n}\n\nmodule.exports.joseToDer = (signature, alg) => {\n if (!Buffer.isBuffer(signature)) {\n throw new TypeError('ECDSA signature must be a Buffer')\n }\n\n if (!paramBytesForAlg[alg]) {\n throw new TypeError(`Unknown algorithm \"${alg}\"`)\n }\n\n const paramBytes = paramBytesForAlg[alg]\n\n const signatureBytes = signature.length\n if (signatureBytes !== paramBytes * 2) {\n throw new Error(`\"${alg}\" signatures must be \"${paramBytes * 2}\" bytes, saw \"${signatureBytes}\"`)\n }\n\n const rPadding = countPadding(signature, 0, paramBytes)\n const sPadding = countPadding(signature, paramBytes, signature.length)\n const rLength = paramBytes - rPadding\n const sLength = paramBytes - sPadding\n\n const rsBytes = 1 + 1 + rLength + 1 + 1 + sLength\n\n const shortLength = rsBytes < MAX_OCTET\n\n const dst = Buffer.allocUnsafe((shortLength ? 2 : 3) + rsBytes)\n\n let offset = 0\n dst[offset++] = ENCODED_TAG_SEQ\n if (shortLength) {\n // Bit 8 has value \"0\"\n // bits 7-1 give the length.\n dst[offset++] = rsBytes\n } else {\n // Bit 8 of first octet has value \"1\"\n // bits 7-1 give the number of additional length octets.\n dst[offset++] = MAX_OCTET\t| 1 // eslint-disable-line no-tabs\n // length, base 256\n dst[offset++] = rsBytes & 0xff\n }\n dst[offset++] = ENCODED_TAG_INT\n dst[offset++] = rLength\n if (rPadding < 0) {\n dst[offset++] = 0\n offset += signature.copy(dst, offset, 0, paramBytes)\n } else {\n offset += signature.copy(dst, offset, rPadding, paramBytes)\n }\n dst[offset++] = ENCODED_TAG_INT\n dst[offset++] = sLength\n if (sPadding < 0) {\n dst[offset++] = 0\n signature.copy(dst, offset, paramBytes)\n } else {\n signature.copy(dst, offset, paramBytes + sPadding)\n }\n\n return dst\n}\n","module.exports = (date) => Math.floor(date.getTime() / 1000)\n","const { randomBytes } = require('crypto')\n\nconst { IVLENGTHS } = require('../registry')\n\nmodule.exports = alg => randomBytes(IVLENGTHS.get(alg) / 8)\n","const errors = require('../errors')\nconst Key = require('../jwk/key/base')\nconst importKey = require('../jwk/import')\nconst { KeyStore } = require('../jwks/keystore')\n\nmodule.exports = (input, keyStoreAllowed = false) => {\n if (input instanceof Key) {\n return input\n }\n\n if (input instanceof KeyStore) {\n if (!keyStoreAllowed) {\n throw new TypeError('key argument for this operation must not be a JWKS.KeyStore instance')\n }\n\n return input\n }\n\n try {\n return importKey(input)\n } catch (err) {\n if (err instanceof errors.JOSEError && !(err instanceof errors.JWKImportFailed)) {\n throw err\n }\n\n let msg\n if (keyStoreAllowed) {\n msg = 'key must be an instance of a key instantiated by JWK.asKey, a valid JWK.asKey input, or a JWKS.KeyStore instance'\n } else {\n msg = 'key must be an instance of a key instantiated by JWK.asKey, or a valid JWK.asKey input'\n }\n\n throw new TypeError(msg)\n }\n}\n","module.exports = (a = {}, b = {}) => {\n const keysA = Object.keys(a)\n const keysB = new Set(Object.keys(b))\n return !keysA.some((ka) => keysB.has(ka))\n}\n","module.exports = a => !!a && a.constructor === Object\n","const { keyObjectSupported } = require('./runtime_support')\n\nlet createPublicKey\nlet createPrivateKey\nlet createSecretKey\nlet KeyObject\nlet asInput\n\nif (keyObjectSupported) {\n ({ createPublicKey, createPrivateKey, createSecretKey, KeyObject } = require('crypto'))\n asInput = (input) => input\n} else {\n const { EOL } = require('os')\n\n const errors = require('../errors')\n const isObject = require('./is_object')\n const asn1 = require('./asn1')\n const toInput = Symbol('toInput')\n\n const namedCurve = Symbol('namedCurve')\n\n asInput = (keyObject, needsPublic) => {\n if (keyObject instanceof KeyObject) {\n return keyObject[toInput](needsPublic)\n }\n\n return createSecretKey(keyObject)[toInput](needsPublic)\n }\n\n const pemToDer = pem => Buffer.from(pem.replace(/(?:-----(?:BEGIN|END)(?: (?:RSA|EC))? (?:PRIVATE|PUBLIC) KEY-----|\\s)/g, ''), 'base64')\n const derToPem = (der, label) => `-----BEGIN ${label}-----${EOL}${(der.toString('base64').match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END ${label}-----`\n const unsupported = (input) => {\n const label = typeof input === 'string' ? input : `OID ${input.join('.')}`\n throw new errors.JOSENotSupported(`${label} is not supported in your Node.js runtime version`)\n }\n\n KeyObject = class KeyObject {\n export ({ cipher, passphrase, type, format } = {}) {\n if (this._type === 'secret') {\n return this._buffer\n }\n\n if (this._type === 'public') {\n if (this.asymmetricKeyType === 'rsa') {\n switch (type) {\n case 'pkcs1':\n if (format === 'pem') {\n return this._pem\n }\n\n return pemToDer(this._pem)\n case 'spki': {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n const pem = PublicKeyInfo.encode({\n algorithm: {\n algorithm: 'rsaEncryption',\n parameters: { type: 'null' }\n },\n publicKey: {\n unused: 0,\n data: pemToDer(this._pem)\n }\n }, 'pem', { label: 'PUBLIC KEY' })\n\n return format === 'pem' ? pem : pemToDer(pem)\n }\n default:\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n }\n\n if (this.asymmetricKeyType === 'ec') {\n if (type !== 'spki') {\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n\n if (format === 'pem') {\n return this._pem\n }\n\n return pemToDer(this._pem)\n }\n }\n\n if (this._type === 'private') {\n if (passphrase !== undefined || cipher !== undefined) {\n throw new errors.JOSENotSupported('encrypted private keys are not supported in your Node.js runtime version')\n }\n\n if (type === 'pkcs8') {\n if (this._pkcs8) {\n if (format === 'der' && typeof this._pkcs8 === 'string') {\n return pemToDer(this._pkcs8)\n }\n\n if (format === 'pem' && Buffer.isBuffer(this._pkcs8)) {\n return derToPem(this._pkcs8, 'PRIVATE KEY')\n }\n\n return this._pkcs8\n }\n\n if (this.asymmetricKeyType === 'rsa') {\n const parsed = this._asn1\n const RSAPrivateKey = asn1.get('RSAPrivateKey')\n const privateKey = RSAPrivateKey.encode(parsed)\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const pkcs8 = PrivateKeyInfo.encode({\n version: 0,\n privateKey,\n algorithm: {\n algorithm: 'rsaEncryption',\n parameters: { type: 'null' }\n }\n })\n\n this._pkcs8 = pkcs8\n\n return this.export({ type, format })\n }\n\n if (this.asymmetricKeyType === 'ec') {\n const parsed = this._asn1\n const ECPrivateKey = asn1.get('ECPrivateKey')\n const privateKey = ECPrivateKey.encode({\n version: parsed.version,\n privateKey: parsed.privateKey,\n publicKey: parsed.publicKey\n })\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const pkcs8 = PrivateKeyInfo.encode({\n version: 0,\n privateKey,\n algorithm: {\n algorithm: 'ecPublicKey',\n parameters: this._asn1.parameters\n }\n })\n\n this._pkcs8 = pkcs8\n\n return this.export({ type, format })\n }\n }\n\n if (this.asymmetricKeyType === 'rsa' && type === 'pkcs1') {\n if (format === 'pem') {\n return this._pem\n }\n\n return pemToDer(this._pem)\n } else if (this.asymmetricKeyType === 'ec' && type === 'sec1') {\n if (format === 'pem') {\n return this._pem\n }\n\n return pemToDer(this._pem)\n } else {\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n }\n }\n\n get type () {\n return this._type\n }\n\n get asymmetricKeyType () {\n return this._asymmetricKeyType\n }\n\n get symmetricKeySize () {\n return this._symmetricKeySize\n }\n\n [toInput] (needsPublic) {\n switch (this._type) {\n case 'secret':\n return this._buffer\n case 'public':\n return this._pem\n default:\n if (needsPublic) {\n if (!('_pub' in this)) {\n this._pub = createPublicKey(this)\n }\n\n return this._pub[toInput](false)\n }\n\n return this._pem\n }\n }\n }\n\n createSecretKey = (buffer) => {\n if (!Buffer.isBuffer(buffer) || !buffer.length) {\n throw new TypeError('input must be a non-empty Buffer instance')\n }\n\n const keyObject = new KeyObject()\n keyObject._buffer = Buffer.from(buffer)\n keyObject._symmetricKeySize = buffer.length\n keyObject._type = 'secret'\n\n return keyObject\n }\n\n createPublicKey = (input) => {\n if (input instanceof KeyObject) {\n if (input.type !== 'private') {\n throw new TypeError(`Invalid key object type ${input.type}, expected private.`)\n }\n\n switch (input.asymmetricKeyType) {\n case 'ec': {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n const key = PublicKeyInfo.encode({\n algorithm: {\n algorithm: 'ecPublicKey',\n parameters: input._asn1.parameters\n },\n publicKey: input._asn1.publicKey\n })\n\n return createPublicKey({ key, format: 'der', type: 'spki' })\n }\n case 'rsa': {\n const RSAPublicKey = asn1.get('RSAPublicKey')\n const key = RSAPublicKey.encode(input._asn1)\n return createPublicKey({ key, format: 'der', type: 'pkcs1' })\n }\n }\n }\n\n if (typeof input === 'string' || Buffer.isBuffer(input)) {\n input = { key: input, format: 'pem' }\n }\n\n if (!isObject(input)) {\n throw new TypeError('input must be a string, Buffer or an object')\n }\n\n const { format, passphrase } = input\n let { key, type } = input\n\n if (typeof key !== 'string' && !Buffer.isBuffer(key)) {\n throw new TypeError('key must be a string or Buffer')\n }\n\n if (format !== 'pem' && format !== 'der') {\n throw new TypeError('format must be one of \"pem\" or \"der\"')\n }\n\n let label\n if (format === 'pem') {\n key = key.toString()\n switch (key.split(/\\r?\\n/g)[0].toString()) {\n case '-----BEGIN PUBLIC KEY-----':\n type = 'spki'\n label = 'PUBLIC KEY'\n break\n case '-----BEGIN RSA PUBLIC KEY-----':\n type = 'pkcs1'\n label = 'RSA PUBLIC KEY'\n break\n case '-----BEGIN CERTIFICATE-----':\n throw new errors.JOSENotSupported('X.509 certificates are not supported in your Node.js runtime version')\n case '-----BEGIN PRIVATE KEY-----':\n case '-----BEGIN EC PRIVATE KEY-----':\n case '-----BEGIN RSA PRIVATE KEY-----':\n return createPublicKey(createPrivateKey(key))\n default:\n throw new TypeError('unknown/unsupported PEM type')\n }\n }\n\n switch (type) {\n case 'spki': {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n const parsed = PublicKeyInfo.decode(key, format, { label })\n\n let type, keyObject\n switch (parsed.algorithm.algorithm) {\n case 'ecPublicKey': {\n keyObject = new KeyObject()\n keyObject._asn1 = parsed\n keyObject._asymmetricKeyType = 'ec'\n keyObject._type = 'public'\n keyObject._pem = PublicKeyInfo.encode(parsed, 'pem', { label: 'PUBLIC KEY' })\n\n break\n }\n case 'rsaEncryption': {\n type = 'pkcs1'\n keyObject = createPublicKey({ type, key: parsed.publicKey.data, format: 'der' })\n break\n }\n default:\n unsupported(parsed.algorithm.algorithm)\n }\n\n return keyObject\n }\n case 'pkcs1': {\n const RSAPublicKey = asn1.get('RSAPublicKey')\n const parsed = RSAPublicKey.decode(key, format, { label })\n\n // special case when private pkcs1 PEM / DER is used with createPublicKey\n if (parsed.n === BigInt(0)) {\n return createPublicKey(createPrivateKey({ key, format, type, passphrase }))\n }\n\n const keyObject = new KeyObject()\n keyObject._asn1 = parsed\n keyObject._asymmetricKeyType = 'rsa'\n keyObject._type = 'public'\n keyObject._pem = RSAPublicKey.encode(parsed, 'pem', { label: 'RSA PUBLIC KEY' })\n\n return keyObject\n }\n case 'pkcs8':\n case 'sec1':\n return createPublicKey(createPrivateKey({ format, key, type, passphrase }))\n default:\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n }\n\n createPrivateKey = (input, hints) => {\n if (typeof input === 'string' || Buffer.isBuffer(input)) {\n input = { key: input, format: 'pem' }\n }\n\n if (!isObject(input)) {\n throw new TypeError('input must be a string, Buffer or an object')\n }\n\n const { format, passphrase } = input\n let { key, type } = input\n\n if (typeof key !== 'string' && !Buffer.isBuffer(key)) {\n throw new TypeError('key must be a string or Buffer')\n }\n\n if (passphrase !== undefined) {\n throw new errors.JOSENotSupported('encrypted private keys are not supported in your Node.js runtime version')\n }\n\n if (format !== 'pem' && format !== 'der') {\n throw new TypeError('format must be one of \"pem\" or \"der\"')\n }\n\n let label\n if (format === 'pem') {\n key = key.toString()\n switch (key.split(/\\r?\\n/g)[0].toString()) {\n case '-----BEGIN PRIVATE KEY-----':\n type = 'pkcs8'\n label = 'PRIVATE KEY'\n break\n case '-----BEGIN EC PRIVATE KEY-----':\n type = 'sec1'\n label = 'EC PRIVATE KEY'\n break\n case '-----BEGIN RSA PRIVATE KEY-----':\n type = 'pkcs1'\n label = 'RSA PRIVATE KEY'\n break\n default:\n throw new TypeError('unknown/unsupported PEM type')\n }\n }\n\n switch (type) {\n case 'pkcs8': {\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const parsed = PrivateKeyInfo.decode(key, format, { label })\n\n let type, keyObject\n switch (parsed.algorithm.algorithm) {\n case 'ecPublicKey': {\n type = 'sec1'\n keyObject = createPrivateKey({ type, key: parsed.privateKey, format: 'der' }, { [namedCurve]: parsed.algorithm.parameters.value })\n break\n }\n case 'rsaEncryption': {\n type = 'pkcs1'\n keyObject = createPrivateKey({ type, key: parsed.privateKey, format: 'der' })\n break\n }\n default:\n unsupported(parsed.algorithm.algorithm)\n }\n\n keyObject._pkcs8 = key\n return keyObject\n }\n case 'pkcs1': {\n const RSAPrivateKey = asn1.get('RSAPrivateKey')\n const parsed = RSAPrivateKey.decode(key, format, { label })\n\n const keyObject = new KeyObject()\n keyObject._asn1 = parsed\n keyObject._asymmetricKeyType = 'rsa'\n keyObject._type = 'private'\n keyObject._pem = RSAPrivateKey.encode(parsed, 'pem', { label: 'RSA PRIVATE KEY' })\n\n return keyObject\n }\n case 'sec1': {\n const ECPrivateKey = asn1.get('ECPrivateKey')\n let parsed = ECPrivateKey.decode(key, format, { label })\n\n if (!('parameters' in parsed) && !hints[namedCurve]) {\n throw new Error('invalid sec1')\n } else if (!('parameters' in parsed)) {\n parsed = { ...parsed, parameters: { type: 'namedCurve', value: hints[namedCurve] } }\n }\n\n const keyObject = new KeyObject()\n keyObject._asn1 = parsed\n keyObject._asymmetricKeyType = 'ec'\n keyObject._type = 'private'\n keyObject._pem = ECPrivateKey.encode(parsed, 'pem', { label: 'EC PRIVATE KEY' })\n\n return keyObject\n }\n default:\n throw new TypeError(`The value ${type} is invalid for option \"type\"`)\n }\n }\n}\n\nmodule.exports = { createPublicKey, createPrivateKey, createSecretKey, KeyObject, asInput }\n","const { EOL } = require('os')\n\nconst errors = require('../errors')\n\nconst { keyObjectSupported } = require('./runtime_support')\nconst { createPublicKey } = require('./key_object')\nconst base64url = require('./base64url')\nconst asn1 = require('./asn1')\nconst computePrimes = require('./rsa_primes')\nconst { OKP_CURVES, EC_CURVES } = require('../registry')\n\nconst formatPem = (base64pem, descriptor) => `-----BEGIN ${descriptor} KEY-----${EOL}${(base64pem.match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END ${descriptor} KEY-----`\n\nconst okpToJWK = {\n private (crv, keyObject) {\n const der = keyObject.export({ type: 'pkcs8', format: 'der' })\n const OneAsymmetricKey = asn1.get('OneAsymmetricKey')\n const { privateKey: { privateKey: d } } = OneAsymmetricKey.decode(der)\n\n return {\n ...okpToJWK.public(crv, createPublicKey(keyObject)),\n d: base64url.encodeBuffer(d)\n }\n },\n public (crv, keyObject) {\n const der = keyObject.export({ type: 'spki', format: 'der' })\n\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n\n const { publicKey: { data: x } } = PublicKeyInfo.decode(der)\n\n return {\n kty: 'OKP',\n crv,\n x: base64url.encodeBuffer(x)\n }\n }\n}\n\nconst keyObjectToJWK = {\n rsa: {\n private (keyObject) {\n const der = keyObject.export({ type: 'pkcs8', format: 'der' })\n\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const RSAPrivateKey = asn1.get('RSAPrivateKey')\n\n const { privateKey } = PrivateKeyInfo.decode(der)\n const { version, n, e, d, p, q, dp, dq, qi } = RSAPrivateKey.decode(privateKey)\n\n if (version !== 'two-prime') {\n throw new errors.JOSENotSupported('Private RSA keys with more than two primes are not supported')\n }\n\n return {\n kty: 'RSA',\n n: base64url.encodeBigInt(n),\n e: base64url.encodeBigInt(e),\n d: base64url.encodeBigInt(d),\n p: base64url.encodeBigInt(p),\n q: base64url.encodeBigInt(q),\n dp: base64url.encodeBigInt(dp),\n dq: base64url.encodeBigInt(dq),\n qi: base64url.encodeBigInt(qi)\n }\n },\n public (keyObject) {\n const der = keyObject.export({ type: 'spki', format: 'der' })\n\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n const RSAPublicKey = asn1.get('RSAPublicKey')\n\n const { publicKey: { data: publicKey } } = PublicKeyInfo.decode(der)\n const { n, e } = RSAPublicKey.decode(publicKey)\n\n return {\n kty: 'RSA',\n n: base64url.encodeBigInt(n),\n e: base64url.encodeBigInt(e)\n }\n }\n },\n ec: {\n private (keyObject) {\n const der = keyObject.export({ type: 'pkcs8', format: 'der' })\n\n const PrivateKeyInfo = asn1.get('PrivateKeyInfo')\n const ECPrivateKey = asn1.get('ECPrivateKey')\n\n const { privateKey, algorithm: { parameters: { value: crv } } } = PrivateKeyInfo.decode(der)\n const { privateKey: d, publicKey } = ECPrivateKey.decode(privateKey)\n\n if (typeof publicKey === 'undefined') {\n if (keyObjectSupported) {\n return {\n ...keyObjectToJWK.ec.public(createPublicKey(keyObject)),\n d: base64url.encodeBuffer(d)\n }\n }\n\n throw new errors.JOSENotSupported('Private EC keys without the public key embedded are not supported in your Node.js runtime version')\n }\n\n const x = publicKey.data.slice(1, ((publicKey.data.length - 1) / 2) + 1)\n const y = publicKey.data.slice(((publicKey.data.length - 1) / 2) + 1)\n\n return {\n kty: 'EC',\n crv,\n d: base64url.encodeBuffer(d),\n x: base64url.encodeBuffer(x),\n y: base64url.encodeBuffer(y)\n }\n },\n public (keyObject) {\n const der = keyObject.export({ type: 'spki', format: 'der' })\n\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n\n const { publicKey: { data: publicKey }, algorithm: { parameters: { value: crv } } } = PublicKeyInfo.decode(der)\n\n const x = publicKey.slice(1, ((publicKey.length - 1) / 2) + 1)\n const y = publicKey.slice(((publicKey.length - 1) / 2) + 1)\n\n return {\n kty: 'EC',\n crv,\n x: base64url.encodeBuffer(x),\n y: base64url.encodeBuffer(y)\n }\n }\n },\n ed25519: {\n private (keyObject) {\n return okpToJWK.private('Ed25519', keyObject)\n },\n public (keyObject) {\n return okpToJWK.public('Ed25519', keyObject)\n }\n },\n ed448: {\n private (keyObject) {\n return okpToJWK.private('Ed448', keyObject)\n },\n public (keyObject) {\n return okpToJWK.public('Ed448', keyObject)\n }\n },\n x25519: {\n private (keyObject) {\n return okpToJWK.private('X25519', keyObject)\n },\n public (keyObject) {\n return okpToJWK.public('X25519', keyObject)\n }\n },\n x448: {\n private (keyObject) {\n return okpToJWK.private('X448', keyObject)\n },\n public (keyObject) {\n return okpToJWK.public('X448', keyObject)\n }\n }\n}\n\nmodule.exports.keyObjectToJWK = (keyObject) => {\n if (keyObject.type === 'private') {\n return keyObjectToJWK[keyObject.asymmetricKeyType].private(keyObject)\n }\n\n return keyObjectToJWK[keyObject.asymmetricKeyType].public(keyObject)\n}\n\nconst concatEcPublicKey = (x, y) => ({\n unused: 0,\n data: Buffer.concat([\n Buffer.alloc(1, 4),\n base64url.decodeToBuffer(x),\n base64url.decodeToBuffer(y)\n ])\n})\n\nconst jwkToPem = {\n RSA: {\n private (jwk, { calculateMissingRSAPrimes }) {\n const RSAPrivateKey = asn1.get('RSAPrivateKey')\n\n if ('oth' in jwk) {\n throw new errors.JOSENotSupported('Private RSA keys with more than two primes are not supported')\n }\n\n if (jwk.p || jwk.q || jwk.dp || jwk.dq || jwk.qi) {\n if (!(jwk.p && jwk.q && jwk.dp && jwk.dq && jwk.qi)) {\n throw new errors.JWKInvalid('all other private key parameters must be present when any one of them is present')\n }\n } else if (calculateMissingRSAPrimes) {\n jwk = computePrimes(jwk)\n } else if (!calculateMissingRSAPrimes) {\n throw new errors.JOSENotSupported('importing private RSA keys without all other private key parameters is not enabled, see documentation and its advisory on how and when its ok to enable it')\n }\n\n return RSAPrivateKey.encode({\n version: 0,\n n: BigInt(`0x${base64url.decodeToBuffer(jwk.n).toString('hex')}`),\n e: BigInt(`0x${base64url.decodeToBuffer(jwk.e).toString('hex')}`),\n d: BigInt(`0x${base64url.decodeToBuffer(jwk.d).toString('hex')}`),\n p: BigInt(`0x${base64url.decodeToBuffer(jwk.p).toString('hex')}`),\n q: BigInt(`0x${base64url.decodeToBuffer(jwk.q).toString('hex')}`),\n dp: BigInt(`0x${base64url.decodeToBuffer(jwk.dp).toString('hex')}`),\n dq: BigInt(`0x${base64url.decodeToBuffer(jwk.dq).toString('hex')}`),\n qi: BigInt(`0x${base64url.decodeToBuffer(jwk.qi).toString('hex')}`)\n }, 'pem', { label: 'RSA PRIVATE KEY' })\n },\n public (jwk) {\n const RSAPublicKey = asn1.get('RSAPublicKey')\n\n return RSAPublicKey.encode({\n version: 0,\n n: BigInt(`0x${base64url.decodeToBuffer(jwk.n).toString('hex')}`),\n e: BigInt(`0x${base64url.decodeToBuffer(jwk.e).toString('hex')}`)\n }, 'pem', { label: 'RSA PUBLIC KEY' })\n }\n },\n EC: {\n private (jwk) {\n const ECPrivateKey = asn1.get('ECPrivateKey')\n\n return ECPrivateKey.encode({\n version: 1,\n privateKey: base64url.decodeToBuffer(jwk.d),\n parameters: { type: 'namedCurve', value: jwk.crv },\n publicKey: concatEcPublicKey(jwk.x, jwk.y)\n }, 'pem', { label: 'EC PRIVATE KEY' })\n },\n public (jwk) {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n\n return PublicKeyInfo.encode({\n algorithm: {\n algorithm: 'ecPublicKey',\n parameters: { type: 'namedCurve', value: jwk.crv }\n },\n publicKey: concatEcPublicKey(jwk.x, jwk.y)\n }, 'pem', { label: 'PUBLIC KEY' })\n }\n },\n OKP: {\n private (jwk) {\n const OneAsymmetricKey = asn1.get('OneAsymmetricKey')\n\n const b64 = OneAsymmetricKey.encode({\n version: 0,\n privateKey: { privateKey: base64url.decodeToBuffer(jwk.d) },\n algorithm: { algorithm: jwk.crv }\n }, 'der')\n\n // TODO: WHYYY? https://github.com/indutny/asn1.js/issues/110\n b64.write('04', 12, 1, 'hex')\n\n return formatPem(b64.toString('base64'), 'PRIVATE')\n },\n public (jwk) {\n const PublicKeyInfo = asn1.get('PublicKeyInfo')\n\n return PublicKeyInfo.encode({\n algorithm: { algorithm: jwk.crv },\n publicKey: {\n unused: 0,\n data: base64url.decodeToBuffer(jwk.x)\n }\n }, 'pem', { label: 'PUBLIC KEY' })\n }\n }\n}\n\nmodule.exports.jwkToPem = (jwk, { calculateMissingRSAPrimes = false } = {}) => {\n switch (jwk.kty) {\n case 'EC':\n if (!EC_CURVES.has(jwk.crv)) {\n throw new errors.JOSENotSupported(`unsupported EC key curve: ${jwk.crv}`)\n }\n break\n case 'OKP':\n if (!OKP_CURVES.has(jwk.crv)) {\n throw new errors.JOSENotSupported(`unsupported OKP key curve: ${jwk.crv}`)\n }\n break\n case 'RSA':\n break\n default:\n throw new errors.JOSENotSupported(`unsupported key type: ${jwk.kty}`)\n }\n\n if (jwk.d) {\n return jwkToPem[jwk.kty].private(jwk, { calculateMissingRSAPrimes })\n }\n\n return jwkToPem[jwk.kty].public(jwk)\n}\n","module.exports = alg => `sha${alg.substr(2, 3)}`\n","const { randomBytes } = require('crypto')\n\nconst base64url = require('./base64url')\nconst errors = require('../errors')\n\nconst ZERO = BigInt(0)\nconst ONE = BigInt(1)\nconst TWO = BigInt(2)\n\nconst toJWKParameter = (n) => {\n const hex = n.toString(16)\n return base64url.encodeBuffer(Buffer.from(hex.length % 2 ? `0${hex}` : hex, 'hex'))\n}\nconst fromBuffer = buf => BigInt(`0x${buf.toString('hex')}`)\nconst bitLength = n => n.toString(2).length\n\nconst eGcdX = (a, b) => {\n let x = ZERO\n let y = ONE\n let u = ONE\n let v = ZERO\n\n while (a !== ZERO) {\n const q = b / a\n const r = b % a\n const m = x - (u * q)\n const n = y - (v * q)\n b = a\n a = r\n x = u\n y = v\n u = m\n v = n\n }\n return x\n}\n\nconst gcd = (a, b) => {\n let shift = ZERO\n while (!((a | b) & ONE)) {\n a >>= ONE\n b >>= ONE\n shift++\n }\n while (!(a & ONE)) {\n a >>= ONE\n }\n do {\n while (!(b & ONE)) {\n b >>= ONE\n }\n if (a > b) {\n const x = a\n a = b\n b = x\n }\n b -= a\n } while (b)\n\n return a << shift\n}\n\nconst modPow = (a, b, n) => {\n a = toZn(a, n)\n let result = ONE\n let x = a\n while (b > 0) {\n const leastSignificantBit = b % TWO\n b = b / TWO\n if (leastSignificantBit === ONE) {\n result = result * x\n result = result % n\n }\n x = x * x\n x = x % n\n }\n return result\n}\n\nconst randBetween = (min, max) => {\n const interval = max - min\n const bitLen = bitLength(interval)\n let rnd\n do {\n rnd = fromBuffer(randBits(bitLen))\n } while (rnd > interval)\n return rnd + min\n}\n\nconst randBits = (bitLength) => {\n const byteLength = Math.ceil(bitLength / 8)\n const rndBytes = randomBytes(byteLength)\n // Fill with 0's the extra bits\n rndBytes[0] = rndBytes[0] & (2 ** (bitLength % 8) - 1)\n return rndBytes\n}\n\nconst toZn = (a, n) => {\n a = a % n\n return (a < 0) ? a + n : a\n}\n\nconst odd = (n) => {\n let r = n\n while (r % TWO === ZERO) {\n r = r / TWO\n }\n return r\n}\n\n// not sold on these values\nconst maxCountWhileNoY = 30\nconst maxCountWhileInot0 = 22\n\nconst getPrimeFactors = (e, d, n) => {\n const r = odd(e * d - ONE)\n\n let countWhileNoY = 0\n let y\n do {\n countWhileNoY++\n if (countWhileNoY === maxCountWhileNoY) {\n throw new errors.JWKImportFailed('failed to calculate missing primes')\n }\n\n let countWhileInot0 = 0\n let i = modPow(randBetween(TWO, n), r, n)\n let o = ZERO\n while (i !== ONE) {\n countWhileInot0++\n if (countWhileInot0 === maxCountWhileInot0) {\n throw new errors.JWKImportFailed('failed to calculate missing primes')\n }\n o = i\n i = (i * i) % n\n }\n if (o !== (n - ONE)) {\n y = o\n }\n } while (!y)\n\n const p = gcd(y - ONE, n)\n const q = n / p\n\n return p > q ? { p, q } : { p: q, q: p }\n}\n\nmodule.exports = (jwk) => {\n const e = fromBuffer(base64url.decodeToBuffer(jwk.e))\n const d = fromBuffer(base64url.decodeToBuffer(jwk.d))\n const n = fromBuffer(base64url.decodeToBuffer(jwk.n))\n\n if (d >= n) {\n throw new errors.JWKInvalid('invalid RSA private exponent')\n }\n\n const { p, q } = getPrimeFactors(e, d, n)\n const dp = d % (p - ONE)\n const dq = d % (q - ONE)\n const qi = toZn(eGcdX(toZn(q, p), p), p)\n\n return {\n ...jwk,\n p: toJWKParameter(p),\n q: toJWKParameter(q),\n dp: toJWKParameter(dp),\n dq: toJWKParameter(dq),\n qi: toJWKParameter(qi)\n }\n}\n","const { diffieHellman, KeyObject, sign, verify } = require('crypto')\n\nconst [major, minor] = process.version.substr(1).split('.').map(x => parseInt(x, 10))\n\nmodule.exports = {\n oaepHashSupported: major > 12 || (major === 12 && minor >= 9),\n keyObjectSupported: !!KeyObject && major >= 12,\n edDSASupported: !!sign && !!verify,\n dsaEncodingSupported: major > 13 || (major === 13 && minor >= 2) || (major === 12 && minor >= 16),\n improvedDH: !!diffieHellman\n}\n","const minute = 60\nconst hour = minute * 60\nconst day = hour * 24\nconst week = day * 7\nconst year = day * 365.25\n\nconst REGEX = /^(\\d+|\\d+\\.\\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)$/i\n\nmodule.exports = (str) => {\n const matched = REGEX.exec(str)\n\n if (!matched) {\n throw new TypeError(`invalid time period format (\"${str}\")`)\n }\n\n const value = parseFloat(matched[1])\n const unit = matched[2].toLowerCase()\n\n switch (unit) {\n case 'sec':\n case 'secs':\n case 'second':\n case 'seconds':\n case 's':\n return Math.round(value)\n case 'minute':\n case 'minutes':\n case 'min':\n case 'mins':\n case 'm':\n return Math.round(value * minute)\n case 'hour':\n case 'hours':\n case 'hr':\n case 'hrs':\n case 'h':\n return Math.round(value * hour)\n case 'day':\n case 'days':\n case 'd':\n return Math.round(value * day)\n case 'week':\n case 'weeks':\n case 'w':\n return Math.round(value * week)\n case 'year':\n case 'years':\n case 'yr':\n case 'yrs':\n case 'y':\n return Math.round(value * year)\n }\n}\n","const { timingSafeEqual: TSE } = require('crypto')\n\nconst paddedBuffer = (input, length) => {\n if (input.length === length) {\n return input\n }\n\n const buffer = Buffer.alloc(length)\n input.copy(buffer)\n return buffer\n}\n\nconst timingSafeEqual = (a, b) => {\n const length = Math.max(a.length, b.length)\n return TSE(paddedBuffer(a, length), paddedBuffer(b, length))\n}\n\nmodule.exports = timingSafeEqual\n","const MAX_INT32 = Math.pow(2, 32)\n\nmodule.exports = (value, buf = Buffer.allocUnsafe(8)) => {\n const high = Math.floor(value / MAX_INT32)\n const low = value % MAX_INT32\n\n buf.writeUInt32BE(high, 0)\n buf.writeUInt32BE(low, 4)\n return buf\n}\n","const { JOSECritNotUnderstood, JWSInvalid } = require('../errors')\n\nconst DEFINED = new Set([\n 'alg', 'jku', 'jwk', 'kid', 'x5u', 'x5c', 'x5t', 'x5t#S256', 'typ', 'cty',\n 'crit', 'enc', 'zip', 'epk', 'apu', 'apv', 'iv', 'tag', 'p2s', 'p2c'\n])\n\nmodule.exports = function validateCrit (Err, protectedHeader, unprotectedHeader, understood) {\n if (protectedHeader && 'crit' in protectedHeader) {\n if (\n !Array.isArray(protectedHeader.crit) ||\n protectedHeader.crit.length === 0 ||\n protectedHeader.crit.some(s => typeof s !== 'string' || !s)\n ) {\n throw new Err('\"crit\" Header Parameter MUST be an array of non-empty strings when present')\n }\n const whitelisted = new Set(understood)\n const combined = { ...protectedHeader, ...unprotectedHeader }\n protectedHeader.crit.forEach((parameter) => {\n if (DEFINED.has(parameter)) {\n throw new Err(`The critical list contains a non-extension Header Parameter ${parameter}`)\n }\n if (!whitelisted.has(parameter)) {\n throw new JOSECritNotUnderstood(`critical \"${parameter}\" is not understood`)\n }\n if (parameter === 'b64') {\n if (!('b64' in protectedHeader)) {\n throw new JWSInvalid('\"b64\" critical parameter must be integrity protected')\n }\n if (typeof protectedHeader.b64 !== 'boolean') {\n throw new JWSInvalid('\"b64\" critical parameter must be a boolean')\n }\n } else if (!(parameter in combined)) {\n throw new Err(`critical parameter \"${parameter}\" is missing`)\n }\n })\n }\n if (unprotectedHeader && 'crit' in unprotectedHeader) {\n throw new Err('\"crit\" Header Parameter MUST be integrity protected when present')\n }\n}\n","module.exports = {\n JWE: require('./jwe'),\n JWK: require('./jwk'),\n JWKS: require('./jwks'),\n JWS: require('./jws'),\n JWT: require('./jwt'),\n errors: require('./errors')\n}\n","const { createCipheriv, createDecipheriv, getCiphers } = require('crypto')\n\nconst uint64be = require('../help/uint64be')\nconst timingSafeEqual = require('../help/timing_safe_equal')\nconst { KEYOBJECT } = require('../help/consts')\nconst { JWEInvalid, JWEDecryptionFailed } = require('../errors')\n\nconst checkInput = function (size, iv, tag) {\n if (iv.length !== 16) {\n throw new JWEInvalid('invalid iv')\n }\n if (arguments.length === 3) {\n if (tag.length !== size / 8) {\n throw new JWEInvalid('invalid tag')\n }\n }\n}\n\nconst encrypt = (size, sign, { [KEYOBJECT]: keyObject }, cleartext, { iv, aad = Buffer.alloc(0) }) => {\n const key = keyObject.export()\n checkInput(size, iv)\n\n const keySize = size / 8\n const encKey = key.slice(keySize)\n const cipher = createCipheriv(`aes-${size}-cbc`, encKey, iv)\n const ciphertext = Buffer.concat([cipher.update(cleartext), cipher.final()])\n const macData = Buffer.concat([aad, iv, ciphertext, uint64be(aad.length * 8)])\n\n const macKey = key.slice(0, keySize)\n const tag = sign({ [KEYOBJECT]: macKey }, macData).slice(0, keySize)\n\n return { ciphertext, tag }\n}\n\nconst decrypt = (size, sign, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag = Buffer.alloc(0), aad = Buffer.alloc(0) }) => {\n checkInput(size, iv, tag)\n\n const keySize = size / 8\n const key = keyObject.export()\n const encKey = key.slice(keySize)\n const macKey = key.slice(0, keySize)\n\n const macData = Buffer.concat([aad, iv, ciphertext, uint64be(aad.length * 8)])\n const expectedTag = sign({ [KEYOBJECT]: macKey }, macData, tag).slice(0, keySize)\n const macCheckPassed = timingSafeEqual(tag, expectedTag)\n\n if (!macCheckPassed) {\n throw new JWEDecryptionFailed()\n }\n\n let cleartext\n try {\n const cipher = createDecipheriv(`aes-${size}-cbc`, encKey, iv)\n cleartext = Buffer.concat([cipher.update(ciphertext), cipher.final()])\n } catch (err) {}\n\n if (!cleartext) {\n throw new JWEDecryptionFailed()\n }\n\n return cleartext\n}\n\nmodule.exports = (JWA, JWK) => {\n ['A128CBC-HS256', 'A192CBC-HS384', 'A256CBC-HS512'].forEach((jwaAlg) => {\n const size = parseInt(jwaAlg.substr(1, 3), 10)\n const sign = JWA.sign.get(`HS${size * 2}`)\n if (getCiphers().includes(`aes-${size}-cbc`)) {\n JWA.encrypt.set(jwaAlg, encrypt.bind(undefined, size, sign))\n JWA.decrypt.set(jwaAlg, decrypt.bind(undefined, size, sign))\n JWK.oct.encrypt[jwaAlg] = JWK.oct.decrypt[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length / 2 === size\n }\n })\n}\n","const { createCipheriv, createDecipheriv, getCiphers } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst { JWEInvalid, JWEDecryptionFailed } = require('../errors')\nconst { asInput } = require('../help/key_object')\n\nconst checkInput = function (size, iv, tag) {\n if (iv.length !== 12) {\n throw new JWEInvalid('invalid iv')\n }\n if (arguments.length === 3) {\n if (tag.length !== 16) {\n throw new JWEInvalid('invalid tag')\n }\n }\n}\n\nconst encrypt = (size, { [KEYOBJECT]: keyObject }, cleartext, { iv, aad = Buffer.alloc(0) }) => {\n const key = asInput(keyObject, false)\n checkInput(size, iv)\n\n const cipher = createCipheriv(`aes-${size}-gcm`, key, iv, { authTagLength: 16 })\n cipher.setAAD(aad)\n\n const ciphertext = Buffer.concat([cipher.update(cleartext), cipher.final()])\n const tag = cipher.getAuthTag()\n\n return { ciphertext, tag }\n}\n\nconst decrypt = (size, { [KEYOBJECT]: keyObject }, ciphertext, { iv, tag = Buffer.alloc(0), aad = Buffer.alloc(0) }) => {\n const key = asInput(keyObject, false)\n checkInput(size, iv, tag)\n\n try {\n const cipher = createDecipheriv(`aes-${size}-gcm`, key, iv, { authTagLength: 16 })\n cipher.setAuthTag(tag)\n cipher.setAAD(aad)\n\n return Buffer.concat([cipher.update(ciphertext), cipher.final()])\n } catch (err) {\n throw new JWEDecryptionFailed()\n }\n}\n\nmodule.exports = (JWA, JWK) => {\n ['A128GCM', 'A192GCM', 'A256GCM'].forEach((jwaAlg) => {\n const size = parseInt(jwaAlg.substr(1, 3), 10)\n if (getCiphers().includes(`aes-${size}-gcm`)) {\n JWA.encrypt.set(jwaAlg, encrypt.bind(undefined, size))\n JWA.decrypt.set(jwaAlg, decrypt.bind(undefined, size))\n JWK.oct.encrypt[jwaAlg] = JWK.oct.decrypt[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size\n }\n })\n}\n","const generateIV = require('../help/generate_iv')\nconst base64url = require('../help/base64url')\n\nmodule.exports = (JWA, JWK) => {\n ['A128GCMKW', 'A192GCMKW', 'A256GCMKW'].forEach((jwaAlg) => {\n const encAlg = jwaAlg.substr(0, 7)\n const size = parseInt(jwaAlg.substr(1, 3), 10)\n const encrypt = JWA.encrypt.get(encAlg)\n const decrypt = JWA.decrypt.get(encAlg)\n\n if (encrypt && decrypt) {\n JWA.keyManagementEncrypt.set(jwaAlg, (key, payload) => {\n const iv = generateIV(jwaAlg)\n const { ciphertext, tag } = encrypt(key, payload, { iv })\n return {\n wrapped: ciphertext,\n header: { tag: base64url.encodeBuffer(tag), iv: base64url.encodeBuffer(iv) }\n }\n })\n JWA.keyManagementDecrypt.set(jwaAlg, decrypt)\n JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size\n }\n })\n}\n","const { createCipheriv, createDecipheriv, getCiphers } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst { asInput } = require('../help/key_object')\n\nconst checkInput = (data) => {\n if (data !== undefined && data.length % 8 !== 0) {\n throw new Error('invalid data length')\n }\n}\n\nconst wrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, false)\n const cipher = createCipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex'))\n\n return { wrapped: Buffer.concat([cipher.update(payload), cipher.final()]) }\n}\n\nconst unwrapKey = (alg, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, false)\n checkInput(payload)\n const cipher = createDecipheriv(alg, key, Buffer.alloc(8, 'a6', 'hex'))\n\n return Buffer.concat([cipher.update(payload), cipher.final()])\n}\n\nmodule.exports = (JWA, JWK) => {\n ['A128KW', 'A192KW', 'A256KW'].forEach((jwaAlg) => {\n const size = parseInt(jwaAlg.substr(1, 3), 10)\n const alg = `aes${size}-wrap`\n if (getCiphers().includes(alg)) {\n JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, alg))\n JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, alg))\n JWK.oct.wrapKey[jwaAlg] = JWK.oct.unwrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length === size\n }\n })\n}\n","const { improvedDH } = require('../../help/runtime_support')\n\nif (improvedDH) {\n const { diffieHellman } = require('crypto')\n\n const { KeyObject } = require('../../help/key_object')\n const importKey = require('../../jwk/import')\n\n module.exports = ({ keyObject: privateKey }, publicKey) => {\n if (!(publicKey instanceof KeyObject)) {\n ({ keyObject: publicKey } = importKey(publicKey))\n }\n\n return diffieHellman({ privateKey, publicKey })\n }\n} else {\n const { createECDH, constants: { POINT_CONVERSION_UNCOMPRESSED } } = require('crypto')\n\n const base64url = require('../../help/base64url')\n\n const crvToCurve = (crv) => {\n switch (crv) {\n case 'P-256':\n return 'prime256v1'\n case 'P-384':\n return 'secp384r1'\n case 'P-521':\n return 'secp521r1'\n }\n }\n\n const UNCOMPRESSED = Buffer.alloc(1, POINT_CONVERSION_UNCOMPRESSED)\n const pubToBuffer = (x, y) => Buffer.concat([UNCOMPRESSED, base64url.decodeToBuffer(x), base64url.decodeToBuffer(y)])\n\n module.exports = ({ crv, d }, { x, y }) => {\n const curve = crvToCurve(crv)\n const exchange = createECDH(curve)\n\n exchange.setPrivateKey(base64url.decodeToBuffer(d))\n\n return exchange.computeSecret(pubToBuffer(x, y))\n }\n}\n","const { createHash } = require('crypto')\nconst ecdhComputeSecret = require('./compute_secret')\n\nconst concat = (key, length, value) => {\n const iterations = Math.ceil(length / 32)\n let res\n\n for (let iter = 1; iter <= iterations; iter++) {\n const buf = Buffer.allocUnsafe(4 + key.length + value.length)\n buf.writeUInt32BE(iter, 0)\n key.copy(buf, 4)\n value.copy(buf, 4 + key.length)\n if (!res) {\n res = createHash('sha256').update(buf).digest()\n } else {\n res = Buffer.concat([res, createHash('sha256').update(buf).digest()])\n }\n }\n\n return res.slice(0, length)\n}\n\nconst uint32be = (value, buf = Buffer.allocUnsafe(4)) => {\n buf.writeUInt32BE(value)\n return buf\n}\n\nconst lengthAndInput = input => Buffer.concat([uint32be(input.length), input])\n\nmodule.exports = (alg, keyLen, privKey, pubKey, { apu = Buffer.alloc(0), apv = Buffer.alloc(0) } = {}, computeSecret = ecdhComputeSecret) => {\n const value = Buffer.concat([\n lengthAndInput(Buffer.from(alg)),\n lengthAndInput(apu),\n lengthAndInput(apv),\n uint32be(keyLen)\n ])\n\n const sharedSecret = computeSecret(privKey, pubKey)\n return concat(sharedSecret, keyLen / 8, value)\n}\n","const { improvedDH } = require('../../help/runtime_support')\nconst { KEYLENGTHS } = require('../../registry')\nconst { generateSync } = require('../../jwk/generate')\n\nconst derive = require('./derive')\n\nconst wrapKey = (key, payload, { enc }) => {\n const epk = generateSync(key.kty, key.crv)\n\n const derivedKey = derive(enc, KEYLENGTHS.get(enc), epk, key)\n\n return {\n wrapped: derivedKey,\n header: { epk: { kty: key.kty, crv: key.crv, x: epk.x, y: epk.y } }\n }\n}\n\nconst unwrapKey = (key, payload, header) => {\n const { enc, epk } = header\n return derive(enc, KEYLENGTHS.get(enc), key, epk, header)\n}\n\nmodule.exports = (JWA, JWK) => {\n JWA.keyManagementEncrypt.set('ECDH-ES', wrapKey)\n JWA.keyManagementDecrypt.set('ECDH-ES', unwrapKey)\n JWK.EC.deriveKey['ECDH-ES'] = key => (key.use === 'enc' || key.use === undefined) && key.crv !== 'secp256k1'\n\n if (improvedDH) {\n JWK.OKP.deriveKey['ECDH-ES'] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x')\n }\n}\n","const { improvedDH } = require('../../help/runtime_support')\nconst { KEYOBJECT } = require('../../help/consts')\nconst { generateSync } = require('../../jwk/generate')\nconst { ECDH_DERIVE_LENGTHS } = require('../../registry')\n\nconst derive = require('./derive')\n\nconst wrapKey = (wrap, derive, key, payload) => {\n const epk = generateSync(key.kty, key.crv)\n\n const derivedKey = derive(epk, key, payload)\n\n const result = wrap({ [KEYOBJECT]: derivedKey }, payload)\n result.header = result.header || {}\n Object.assign(result.header, { epk: { kty: key.kty, crv: key.crv, x: epk.x, y: epk.y } })\n\n return result\n}\n\nconst unwrapKey = (unwrap, derive, key, payload, header) => {\n const { epk } = header\n const derivedKey = derive(key, epk, header)\n\n return unwrap({ [KEYOBJECT]: derivedKey }, payload, header)\n}\n\nmodule.exports = (JWA, JWK) => {\n ['ECDH-ES+A128KW', 'ECDH-ES+A192KW', 'ECDH-ES+A256KW'].forEach((jwaAlg) => {\n const kw = jwaAlg.substr(-6)\n const kwWrap = JWA.keyManagementEncrypt.get(kw)\n const kwUnwrap = JWA.keyManagementDecrypt.get(kw)\n const keylen = parseInt(jwaAlg.substr(9, 3), 10)\n ECDH_DERIVE_LENGTHS.set(jwaAlg, keylen)\n\n if (kwWrap && kwUnwrap) {\n JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, kwWrap, derive.bind(undefined, jwaAlg, keylen)))\n JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, kwUnwrap, derive.bind(undefined, jwaAlg, keylen)))\n JWK.EC.deriveKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.crv !== 'secp256k1'\n\n if (improvedDH) {\n JWK.OKP.deriveKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('x')\n }\n }\n })\n}\nmodule.exports.wrapKey = wrapKey\nmodule.exports.unwrapKey = unwrapKey\n","const { sign: signOneShot, verify: verifyOneShot, createSign, createVerify, getCurves } = require('crypto')\n\nconst { derToJose, joseToDer } = require('../help/ecdsa_signatures')\nconst { KEYOBJECT } = require('../help/consts')\nconst resolveNodeAlg = require('../help/node_alg')\nconst { asInput } = require('../help/key_object')\nconst { dsaEncodingSupported } = require('../help/runtime_support')\n\nlet sign, verify\n\nif (dsaEncodingSupported) {\n sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => {\n if (typeof payload === 'string') {\n payload = Buffer.from(payload)\n }\n return signOneShot(nodeAlg, payload, { key: asInput(keyObject, false), dsaEncoding: 'ieee-p1363' })\n }\n verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => {\n try {\n return verifyOneShot(nodeAlg, payload, { key: asInput(keyObject, true), dsaEncoding: 'ieee-p1363' }, signature)\n } catch (err) {\n return false\n }\n }\n} else {\n sign = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload) => {\n return derToJose(createSign(nodeAlg).update(payload).sign(asInput(keyObject, false)), jwaAlg)\n }\n verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => {\n try {\n return createVerify(nodeAlg).update(payload).verify(asInput(keyObject, true), joseToDer(signature, jwaAlg))\n } catch (err) {\n return false\n }\n }\n}\n\nconst crvToAlg = (crv) => {\n switch (crv) {\n case 'P-256':\n return 'ES256'\n case 'secp256k1':\n return 'ES256K'\n case 'P-384':\n return 'ES384'\n case 'P-521':\n return 'ES512'\n }\n}\n\nmodule.exports = (JWA, JWK) => {\n const algs = []\n\n if (getCurves().includes('prime256v1')) {\n algs.push('ES256')\n }\n\n if (getCurves().includes('secp256k1')) {\n algs.push('ES256K')\n }\n\n if (getCurves().includes('secp384r1')) {\n algs.push('ES384')\n }\n\n if (getCurves().includes('secp521r1')) {\n algs.push('ES512')\n }\n\n algs.forEach((jwaAlg) => {\n const nodeAlg = resolveNodeAlg(jwaAlg)\n JWA.sign.set(jwaAlg, sign.bind(undefined, jwaAlg, nodeAlg))\n JWA.verify.set(jwaAlg, verify.bind(undefined, jwaAlg, nodeAlg))\n JWK.EC.sign[jwaAlg] = key => key.private && JWK.EC.verify[jwaAlg](key)\n JWK.EC.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && crvToAlg(key.crv) === jwaAlg\n })\n}\n","const { sign: signOneShot, verify: verifyOneShot } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst { edDSASupported } = require('../help/runtime_support')\n\nconst sign = ({ [KEYOBJECT]: keyObject }, payload) => {\n if (typeof payload === 'string') {\n payload = Buffer.from(payload)\n }\n return signOneShot(undefined, payload, keyObject)\n}\n\nconst verify = ({ [KEYOBJECT]: keyObject }, payload, signature) => {\n return verifyOneShot(undefined, payload, keyObject, signature)\n}\n\nmodule.exports = (JWA, JWK) => {\n if (edDSASupported) {\n JWA.sign.set('EdDSA', sign)\n JWA.verify.set('EdDSA', verify)\n JWK.OKP.sign.EdDSA = key => key.private && JWK.OKP.verify.EdDSA(key)\n JWK.OKP.verify.EdDSA = key => (key.use === 'sig' || key.use === undefined) && key.keyObject.asymmetricKeyType.startsWith('ed')\n }\n}\n","const { createHmac } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst timingSafeEqual = require('../help/timing_safe_equal')\nconst resolveNodeAlg = require('../help/node_alg')\nconst { asInput } = require('../help/key_object')\n\nconst sign = (jwaAlg, hmacAlg, { [KEYOBJECT]: keyObject }, payload) => {\n const hmac = createHmac(hmacAlg, asInput(keyObject, false))\n hmac.update(payload)\n return hmac.digest()\n}\n\nconst verify = (jwaAlg, hmacAlg, key, payload, signature) => {\n const expected = sign(jwaAlg, hmacAlg, key, payload)\n const actual = signature\n\n return timingSafeEqual(actual, expected)\n}\n\nmodule.exports = (JWA, JWK) => {\n ['HS256', 'HS384', 'HS512'].forEach((jwaAlg) => {\n const hmacAlg = resolveNodeAlg(jwaAlg)\n JWA.sign.set(jwaAlg, sign.bind(undefined, jwaAlg, hmacAlg))\n JWA.verify.set(jwaAlg, verify.bind(undefined, jwaAlg, hmacAlg))\n JWK.oct.sign[jwaAlg] = JWK.oct.verify[jwaAlg] = key => key.use === 'sig' || key.use === undefined\n })\n}\n","const { JWKKeySupport, JOSENotSupported } = require('../errors')\nconst { KEY_MANAGEMENT_ENCRYPT, KEY_MANAGEMENT_DECRYPT } = require('../help/consts')\n\nconst { JWA, JWK } = require('../registry')\n\n// sign, verify\nrequire('./hmac')(JWA, JWK)\nrequire('./ecdsa')(JWA, JWK)\nrequire('./eddsa')(JWA, JWK)\nrequire('./rsassa_pss')(JWA, JWK)\nrequire('./rsassa')(JWA, JWK)\nrequire('./none')(JWA)\n\n// encrypt, decrypt\nrequire('./aes_cbc_hmac_sha2')(JWA, JWK)\nrequire('./aes_gcm')(JWA, JWK)\n\n// wrapKey, unwrapKey\nrequire('./rsaes')(JWA, JWK)\nrequire('./aes_kw')(JWA, JWK)\nrequire('./aes_gcm_kw')(JWA, JWK)\n\n// deriveKey\nrequire('./pbes2')(JWA, JWK)\nrequire('./ecdh/dir')(JWA, JWK)\nrequire('./ecdh/kw')(JWA, JWK)\n\nconst check = (key, op, alg) => {\n const cache = `_${op}_${alg}`\n\n let label\n let keyOp\n if (op === 'keyManagementEncrypt') {\n label = 'key management (encryption)'\n keyOp = KEY_MANAGEMENT_ENCRYPT\n } else if (op === 'keyManagementDecrypt') {\n label = 'key management (decryption)'\n keyOp = KEY_MANAGEMENT_DECRYPT\n }\n\n if (cache in key) {\n if (key[cache]) {\n return\n }\n throw new JWKKeySupport(`the key does not support ${alg} ${label || op} algorithm`)\n }\n\n let value = true\n if (!JWA[op].has(alg)) {\n throw new JOSENotSupported(`unsupported ${label || op} alg: ${alg}`)\n } else if (!key.algorithms(keyOp).has(alg)) {\n value = false\n }\n\n Object.defineProperty(key, cache, { value, enumerable: false })\n\n if (!value) {\n return check(key, op, alg)\n }\n}\n\nmodule.exports = {\n check,\n sign: (alg, key, payload) => {\n check(key, 'sign', alg)\n return JWA.sign.get(alg)(key, payload)\n },\n verify: (alg, key, payload, signature) => {\n check(key, 'verify', alg)\n return JWA.verify.get(alg)(key, payload, signature)\n },\n keyManagementEncrypt: (alg, key, payload, opts) => {\n check(key, 'keyManagementEncrypt', alg)\n return JWA.keyManagementEncrypt.get(alg)(key, payload, opts)\n },\n keyManagementDecrypt: (alg, key, payload, opts) => {\n check(key, 'keyManagementDecrypt', alg)\n return JWA.keyManagementDecrypt.get(alg)(key, payload, opts)\n },\n encrypt: (alg, key, cleartext, opts) => {\n check(key, 'encrypt', alg)\n return JWA.encrypt.get(alg)(key, cleartext, opts)\n },\n decrypt: (alg, key, ciphertext, opts) => {\n check(key, 'decrypt', alg)\n return JWA.decrypt.get(alg)(key, ciphertext, opts)\n }\n}\n","const sign = () => Buffer.from('')\nconst verify = (key, payload, signature) => !signature.length\n\nmodule.exports = (JWA, JWK) => {\n JWA.sign.set('none', sign)\n JWA.verify.set('none', verify)\n}\n","const { pbkdf2Sync: pbkdf2, randomBytes } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst base64url = require('../help/base64url')\n\nconst SALT_LENGTH = 16\nconst NULL_BUFFER = Buffer.alloc(1, 0)\n\nconst concatSalt = (alg, p2s) => {\n return Buffer.concat([\n Buffer.from(alg, 'utf8'),\n NULL_BUFFER,\n p2s\n ])\n}\n\nconst wrapKey = (keylen, sha, concat, wrap, { [KEYOBJECT]: keyObject }, payload) => {\n // Note that if password-based encryption is used for multiple\n // recipients, it is expected that each recipient use different values\n // for the PBES2 parameters \"p2s\" and \"p2c\".\n // here we generate p2c between 2048 and 4096 and random p2s\n const p2c = Math.floor((Math.random() * 2049) + 2048)\n const p2s = randomBytes(SALT_LENGTH)\n const salt = concat(p2s)\n\n const derivedKey = pbkdf2(keyObject.export(), salt, p2c, keylen, sha)\n\n const result = wrap({ [KEYOBJECT]: derivedKey }, payload)\n result.header = result.header || {}\n Object.assign(result.header, { p2c, p2s: base64url.encodeBuffer(p2s) })\n\n return result\n}\n\nconst unwrapKey = (keylen, sha, concat, unwrap, { [KEYOBJECT]: keyObject }, payload, header) => {\n const { p2s, p2c } = header\n const salt = concat(p2s)\n const derivedKey = pbkdf2(keyObject.export(), salt, p2c, keylen, sha)\n return unwrap({ [KEYOBJECT]: derivedKey }, payload, header)\n}\n\nmodule.exports = (JWA, JWK) => {\n ['PBES2-HS256+A128KW', 'PBES2-HS384+A192KW', 'PBES2-HS512+A256KW'].forEach((jwaAlg) => {\n const kw = jwaAlg.substr(-6)\n const kwWrap = JWA.keyManagementEncrypt.get(kw)\n const kwUnwrap = JWA.keyManagementDecrypt.get(kw)\n const keylen = parseInt(jwaAlg.substr(13, 3), 10) / 8\n const sha = `sha${jwaAlg.substr(8, 3)}`\n\n if (kwWrap && kwUnwrap) {\n JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwWrap))\n JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, keylen, sha, concatSalt.bind(undefined, jwaAlg), kwUnwrap))\n JWK.oct.deriveKey[jwaAlg] = key => key.use === 'enc' || key.use === undefined\n }\n })\n}\n","const { publicEncrypt, privateDecrypt, constants } = require('crypto')\n\nconst { oaepHashSupported } = require('../help/runtime_support')\nconst { KEYOBJECT } = require('../help/consts')\nconst { asInput } = require('../help/key_object')\n\nconst resolvePadding = (alg) => {\n switch (alg) {\n case 'RSA-OAEP':\n case 'RSA-OAEP-256':\n case 'RSA-OAEP-384':\n case 'RSA-OAEP-512':\n return constants.RSA_PKCS1_OAEP_PADDING\n case 'RSA1_5':\n return constants.RSA_PKCS1_PADDING\n }\n}\n\nconst resolveOaepHash = (alg) => {\n switch (alg) {\n case 'RSA-OAEP':\n return 'sha1'\n case 'RSA-OAEP-256':\n return 'sha256'\n case 'RSA-OAEP-384':\n return 'sha384'\n case 'RSA-OAEP-512':\n return 'sha512'\n default:\n return undefined\n }\n}\n\nconst wrapKey = (padding, oaepHash, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, true)\n return { wrapped: publicEncrypt({ key, oaepHash, padding }, payload) }\n}\n\nconst unwrapKey = (padding, oaepHash, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, false)\n return privateDecrypt({ key, oaepHash, padding }, payload)\n}\n\nconst LENGTHS = {\n RSA1_5: 0,\n 'RSA-OAEP': 592,\n 'RSA-OAEP-256': 784,\n 'RSA-OAEP-384': 1040,\n 'RSA-OAEP-512': 1296\n}\n\nmodule.exports = (JWA, JWK) => {\n const algs = ['RSA-OAEP', 'RSA1_5']\n\n if (oaepHashSupported) {\n algs.splice(1, 0, 'RSA-OAEP-256', 'RSA-OAEP-384', 'RSA-OAEP-512')\n }\n\n algs.forEach((jwaAlg) => {\n const padding = resolvePadding(jwaAlg)\n const oaepHash = resolveOaepHash(jwaAlg)\n JWA.keyManagementEncrypt.set(jwaAlg, wrapKey.bind(undefined, padding, oaepHash))\n JWA.keyManagementDecrypt.set(jwaAlg, unwrapKey.bind(undefined, padding, oaepHash))\n JWK.RSA.wrapKey[jwaAlg] = key => (key.use === 'enc' || key.use === undefined) && key.length >= LENGTHS[jwaAlg]\n JWK.RSA.unwrapKey[jwaAlg] = key => key.private && (key.use === 'enc' || key.use === undefined) && key.length >= LENGTHS[jwaAlg]\n })\n}\n","const { createSign, createVerify } = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst resolveNodeAlg = require('../help/node_alg')\nconst { asInput } = require('../help/key_object')\n\nconst sign = (nodeAlg, { [KEYOBJECT]: keyObject }, payload) => {\n return createSign(nodeAlg).update(payload).sign(asInput(keyObject, false))\n}\n\nconst verify = (nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => {\n return createVerify(nodeAlg).update(payload).verify(asInput(keyObject, true), signature)\n}\n\nconst LENGTHS = {\n RS256: 0,\n RS384: 624,\n RS512: 752\n}\n\nmodule.exports = (JWA, JWK) => {\n ['RS256', 'RS384', 'RS512'].forEach((jwaAlg) => {\n const nodeAlg = resolveNodeAlg(jwaAlg)\n JWA.sign.set(jwaAlg, sign.bind(undefined, nodeAlg))\n JWA.verify.set(jwaAlg, verify.bind(undefined, nodeAlg))\n JWK.RSA.sign[jwaAlg] = key => key.private && JWK.RSA.verify[jwaAlg](key)\n JWK.RSA.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && key.length >= LENGTHS[jwaAlg]\n })\n}\n","const {\n createSign,\n createVerify,\n constants\n} = require('crypto')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst resolveNodeAlg = require('../help/node_alg')\nconst { asInput } = require('../help/key_object')\n\nconst sign = (nodeAlg, { [KEYOBJECT]: keyObject }, payload) => {\n const key = asInput(keyObject, false)\n return createSign(nodeAlg).update(payload).sign({\n key,\n padding: constants.RSA_PKCS1_PSS_PADDING,\n saltLength: constants.RSA_PSS_SALTLEN_DIGEST\n })\n}\n\nconst verify = (nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature) => {\n const key = asInput(keyObject, true)\n return createVerify(nodeAlg).update(payload).verify({\n key,\n padding: constants.RSA_PKCS1_PSS_PADDING,\n saltLength: constants.RSA_PSS_SALTLEN_DIGEST\n }, signature)\n}\n\nconst LENGTHS = {\n PS256: 528,\n PS384: 784,\n PS512: 1040\n}\n\nmodule.exports = (JWA, JWK) => {\n ['PS256', 'PS384', 'PS512'].forEach((jwaAlg) => {\n const nodeAlg = resolveNodeAlg(jwaAlg)\n JWA.sign.set(jwaAlg, sign.bind(undefined, nodeAlg))\n JWA.verify.set(jwaAlg, verify.bind(undefined, nodeAlg))\n JWK.RSA.sign[jwaAlg] = key => key.private && JWK.RSA.verify[jwaAlg](key)\n JWK.RSA.verify[jwaAlg] = key => (key.use === 'sig' || key.use === undefined) && key.length >= LENGTHS[jwaAlg]\n })\n}\n","const { inflateRawSync } = require('zlib')\n\nconst base64url = require('../help/base64url')\nconst getKey = require('../help/get_key')\nconst { KeyStore } = require('../jwks')\nconst errors = require('../errors')\nconst { check, decrypt, keyManagementDecrypt } = require('../jwa')\nconst JWK = require('../jwk')\n\nconst { createSecretKey } = require('../help/key_object')\nconst generateCEK = require('./generate_cek')\nconst validateHeaders = require('./validate_headers')\nconst { detect: resolveSerialization } = require('./serializers')\n\nconst SINGLE_RECIPIENT = new Set(['compact', 'flattened'])\n\nconst combineHeader = (prot = {}, unprotected = {}, header = {}) => {\n if (typeof prot === 'string') {\n prot = base64url.JSON.decode(prot)\n }\n\n const p2s = prot.p2s || unprotected.p2s || header.p2s\n const apu = prot.apu || unprotected.apu || header.apu\n const apv = prot.apv || unprotected.apv || header.apv\n const iv = prot.iv || unprotected.iv || header.iv\n const tag = prot.tag || unprotected.tag || header.tag\n\n return {\n ...prot,\n ...unprotected,\n ...header,\n ...(typeof p2s === 'string' ? { p2s: base64url.decodeToBuffer(p2s) } : undefined),\n ...(typeof apu === 'string' ? { apu: base64url.decodeToBuffer(apu) } : undefined),\n ...(typeof apv === 'string' ? { apv: base64url.decodeToBuffer(apv) } : undefined),\n ...(typeof iv === 'string' ? { iv: base64url.decodeToBuffer(iv) } : undefined),\n ...(typeof tag === 'string' ? { tag: base64url.decodeToBuffer(tag) } : undefined)\n }\n}\n\nconst validateAlgorithms = (algorithms, option) => {\n if (algorithms !== undefined && (!Array.isArray(algorithms) || algorithms.some(s => typeof s !== 'string' || !s))) {\n throw new TypeError(`\"${option}\" option must be an array of non-empty strings`)\n }\n\n if (!algorithms) {\n return undefined\n }\n\n return new Set(algorithms)\n}\n\n/*\n * @public\n */\nconst jweDecrypt = (skipValidateHeaders, serialization, jwe, key, { crit = [], complete = false, keyManagementAlgorithms, contentEncryptionAlgorithms, maxPBES2Count = 10000 } = {}) => {\n key = getKey(key, true)\n\n keyManagementAlgorithms = validateAlgorithms(keyManagementAlgorithms, 'keyManagementAlgorithms')\n contentEncryptionAlgorithms = validateAlgorithms(contentEncryptionAlgorithms, 'contentEncryptionAlgorithms')\n\n if (!Array.isArray(crit) || crit.some(s => typeof s !== 'string' || !s)) {\n throw new TypeError('\"crit\" option must be an array of non-empty strings')\n }\n\n if (!serialization) {\n serialization = resolveSerialization(jwe)\n }\n\n let alg, ciphertext, enc, encryptedKey, iv, opts, prot, tag, unprotected, cek, aad, header\n\n // treat general format with one recipient as flattened\n // skips iteration and avoids multi errors in this case\n if (serialization === 'general' && jwe.recipients.length === 1) {\n serialization = 'flattened'\n const { recipients, ...root } = jwe\n jwe = { ...root, ...recipients[0] }\n }\n\n if (SINGLE_RECIPIENT.has(serialization)) {\n if (serialization === 'compact') { // compact serialization format\n ([prot, encryptedKey, iv, ciphertext, tag] = jwe.split('.'))\n } else { // flattened serialization format\n ({ protected: prot, encrypted_key: encryptedKey, iv, ciphertext, tag, unprotected, aad, header } = jwe)\n }\n\n if (!skipValidateHeaders) {\n validateHeaders(prot, unprotected, [{ header }], true, crit)\n }\n\n opts = combineHeader(prot, unprotected, header)\n\n ;({ alg, enc } = opts)\n\n if (keyManagementAlgorithms && !keyManagementAlgorithms.has(alg)) {\n throw new errors.JOSEAlgNotWhitelisted('key management algorithm not whitelisted')\n }\n\n if (contentEncryptionAlgorithms && !contentEncryptionAlgorithms.has(enc)) {\n throw new errors.JOSEAlgNotWhitelisted('content encryption algorithm not whitelisted')\n }\n\n if (key instanceof KeyStore) {\n const keystore = key\n let keys\n if (opts.alg === 'dir') {\n keys = keystore.all({ kid: opts.kid, alg: opts.enc, key_ops: ['decrypt'] })\n } else {\n keys = keystore.all({ kid: opts.kid, alg: opts.alg, key_ops: ['unwrapKey'] })\n }\n switch (keys.length) {\n case 0:\n throw new errors.JWKSNoMatchingKey()\n case 1:\n // treat the call as if a Key instance was passed in\n // skips iteration and avoids multi errors in this case\n key = keys[0]\n break\n default: {\n const errs = []\n for (const key of keys) {\n try {\n return jweDecrypt(true, serialization, jwe, key, {\n crit,\n complete,\n contentEncryptionAlgorithms: contentEncryptionAlgorithms ? [...contentEncryptionAlgorithms] : undefined,\n keyManagementAlgorithms: keyManagementAlgorithms ? [...keyManagementAlgorithms] : undefined\n })\n } catch (err) {\n errs.push(err)\n continue\n }\n }\n\n const multi = new errors.JOSEMultiError(errs)\n if ([...multi].some(e => e instanceof errors.JWEDecryptionFailed)) {\n throw new errors.JWEDecryptionFailed()\n }\n throw multi\n }\n }\n }\n\n check(key, ...(alg === 'dir' ? ['decrypt', enc] : ['keyManagementDecrypt', alg]))\n\n if (alg.startsWith('PBES2')) {\n if (opts && opts.p2c > maxPBES2Count) {\n throw new errors.JWEInvalid('JOSE Header \"p2c\" (PBES2 Count) out is of acceptable bounds')\n }\n }\n\n try {\n if (alg === 'dir') {\n cek = JWK.asKey(key, { alg: enc, use: 'enc' })\n } else if (alg === 'ECDH-ES') {\n const unwrapped = keyManagementDecrypt(alg, key, undefined, opts)\n cek = JWK.asKey(createSecretKey(unwrapped), { alg: enc, use: 'enc' })\n } else {\n const unwrapped = keyManagementDecrypt(alg, key, base64url.decodeToBuffer(encryptedKey), opts)\n cek = JWK.asKey(createSecretKey(unwrapped), { alg: enc, use: 'enc' })\n }\n } catch (err) {\n // To mitigate the attacks described in RFC 3218, the\n // recipient MUST NOT distinguish between format, padding, and length\n // errors of encrypted keys. It is strongly recommended, in the event\n // of receiving an improperly formatted key, that the recipient\n // substitute a randomly generated CEK and proceed to the next step, to\n // mitigate timing attacks.\n cek = generateCEK(enc)\n }\n\n let adata\n if (aad) {\n adata = Buffer.concat([\n Buffer.from(prot || ''),\n Buffer.from('.'),\n Buffer.from(aad)\n ])\n } else {\n adata = Buffer.from(prot || '')\n }\n\n try {\n iv = base64url.decodeToBuffer(iv)\n } catch (err) {}\n try {\n tag = base64url.decodeToBuffer(tag)\n } catch (err) {}\n\n let cleartext = decrypt(enc, cek, base64url.decodeToBuffer(ciphertext), { iv, tag, aad: adata })\n\n if (opts.zip) {\n cleartext = inflateRawSync(cleartext)\n }\n\n if (complete) {\n const result = { cleartext, key, cek }\n if (aad) result.aad = aad\n if (header) result.header = header\n if (unprotected) result.unprotected = unprotected\n if (prot) result.protected = base64url.JSON.decode(prot)\n return result\n }\n\n return cleartext\n }\n\n validateHeaders(jwe.protected, jwe.unprotected, jwe.recipients.map(({ header }) => ({ header })), true, crit)\n\n // general serialization format\n const { recipients, ...root } = jwe\n const errs = []\n for (const recipient of recipients) {\n try {\n return jweDecrypt(true, 'flattened', { ...root, ...recipient }, key, {\n crit,\n complete,\n contentEncryptionAlgorithms: contentEncryptionAlgorithms ? [...contentEncryptionAlgorithms] : undefined,\n keyManagementAlgorithms: keyManagementAlgorithms ? [...keyManagementAlgorithms] : undefined\n })\n } catch (err) {\n errs.push(err)\n continue\n }\n }\n\n const multi = new errors.JOSEMultiError(errs)\n if ([...multi].some(e => e instanceof errors.JWEDecryptionFailed)) {\n throw new errors.JWEDecryptionFailed()\n } else if ([...multi].every(e => e instanceof errors.JWKSNoMatchingKey)) {\n throw new errors.JWKSNoMatchingKey()\n }\n throw multi\n}\n\nmodule.exports = jweDecrypt.bind(undefined, false, undefined)\n","const { deflateRawSync } = require('zlib')\n\nconst { KEYOBJECT } = require('../help/consts')\nconst generateIV = require('../help/generate_iv')\nconst base64url = require('../help/base64url')\nconst getKey = require('../help/get_key')\nconst isObject = require('../help/is_object')\nconst { createSecretKey } = require('../help/key_object')\nconst deepClone = require('../help/deep_clone')\nconst importKey = require('../jwk/import')\nconst { JWEInvalid } = require('../errors')\nconst { check, keyManagementEncrypt, encrypt } = require('../jwa')\n\nconst serializers = require('./serializers')\nconst generateCEK = require('./generate_cek')\nconst validateHeaders = require('./validate_headers')\n\nconst PROCESS_RECIPIENT = Symbol('PROCESS_RECIPIENT')\n\nclass Encrypt {\n constructor (cleartext, protectedHeader, aad, unprotectedHeader) {\n if (!Buffer.isBuffer(cleartext) && typeof cleartext !== 'string') {\n throw new TypeError('cleartext argument must be a Buffer or a string')\n }\n cleartext = Buffer.from(cleartext)\n\n if (aad !== undefined && !Buffer.isBuffer(aad) && typeof aad !== 'string') {\n throw new TypeError('aad argument must be a Buffer or a string when provided')\n }\n aad = aad ? Buffer.from(aad) : undefined\n\n if (protectedHeader !== undefined && !isObject(protectedHeader)) {\n throw new TypeError('protectedHeader argument must be a plain object when provided')\n }\n\n if (unprotectedHeader !== undefined && !isObject(unprotectedHeader)) {\n throw new TypeError('unprotectedHeader argument must be a plain object when provided')\n }\n\n this._recipients = []\n this._cleartext = cleartext\n this._aad = aad\n this._unprotected = unprotectedHeader ? deepClone(unprotectedHeader) : undefined\n this._protected = protectedHeader ? deepClone(protectedHeader) : undefined\n }\n\n /*\n * @public\n */\n recipient (key, header) {\n key = getKey(key)\n\n if (header !== undefined && !isObject(header)) {\n throw new TypeError('header argument must be a plain object when provided')\n }\n\n this._recipients.push({\n key,\n header: header ? deepClone(header) : undefined\n })\n\n return this\n }\n\n /*\n * @private\n */\n [PROCESS_RECIPIENT] (recipient) {\n const unprotectedHeader = this._unprotected\n const protectedHeader = this._protected\n const { length: recipientCount } = this._recipients\n\n const jweHeader = {\n ...protectedHeader,\n ...unprotectedHeader,\n ...recipient.header\n }\n const { key } = recipient\n\n const enc = jweHeader.enc\n let alg = jweHeader.alg\n\n if (key.use === 'sig') {\n throw new TypeError('a key with \"use\":\"sig\" is not usable for encryption')\n }\n\n if (alg === 'dir') {\n check(key, 'encrypt', enc)\n } else if (alg) {\n check(key, 'keyManagementEncrypt', alg)\n } else {\n alg = key.alg || [...key.algorithms('wrapKey')][0] || [...key.algorithms('deriveKey')][0]\n\n if (alg === 'ECDH-ES' && recipientCount !== 1) {\n alg = [...key.algorithms('deriveKey')][1]\n }\n\n if (!alg) {\n throw new JWEInvalid('could not resolve a usable \"alg\" for a recipient')\n }\n\n if (recipientCount === 1) {\n if (protectedHeader) {\n protectedHeader.alg = alg\n } else {\n this._protected = { alg }\n }\n } else {\n if (recipient.header) {\n recipient.header.alg = alg\n } else {\n recipient.header = { alg }\n }\n }\n }\n\n let wrapped\n let generatedHeader\n\n if (key.kty === 'oct' && alg === 'dir') {\n this._cek = importKey(key[KEYOBJECT], { use: 'enc', alg: enc })\n } else {\n check(this._cek, 'encrypt', enc)\n ;({ wrapped, header: generatedHeader } = keyManagementEncrypt(alg, key, this._cek[KEYOBJECT].export(), { enc, alg }))\n if (alg === 'ECDH-ES') {\n this._cek = importKey(createSecretKey(wrapped), { use: 'enc', alg: enc })\n }\n }\n\n if (alg === 'dir' || alg === 'ECDH-ES') {\n recipient.encrypted_key = ''\n } else {\n recipient.encrypted_key = base64url.encodeBuffer(wrapped)\n }\n\n if (generatedHeader) {\n recipient.generatedHeader = generatedHeader\n }\n }\n\n /*\n * @public\n */\n encrypt (serialization) {\n const serializer = serializers[serialization]\n if (!serializer) {\n throw new TypeError('serialization must be one of \"compact\", \"flattened\", \"general\"')\n }\n\n if (!this._recipients.length) {\n throw new JWEInvalid('missing recipients')\n }\n\n serializer.validate(this._protected, this._unprotected, this._aad, this._recipients)\n\n let enc = validateHeaders(this._protected, this._unprotected, this._recipients, false, this._protected ? this._protected.crit : undefined)\n if (!enc) {\n enc = 'A128CBC-HS256'\n if (this._protected) {\n this._protected.enc = enc\n } else {\n this._protected = { enc }\n }\n }\n const final = {}\n this._cek = generateCEK(enc)\n\n for (const recipient of this._recipients) {\n this[PROCESS_RECIPIENT](recipient)\n }\n\n const iv = generateIV(enc)\n final.iv = base64url.encodeBuffer(iv)\n\n if (this._recipients.length === 1 && this._recipients[0].generatedHeader) {\n const [{ generatedHeader }] = this._recipients\n delete this._recipients[0].generatedHeader\n this._protected = {\n ...this._protected,\n ...generatedHeader\n }\n }\n\n if (this._protected) {\n final.protected = base64url.JSON.encode(this._protected)\n }\n final.unprotected = this._unprotected\n\n let aad\n if (this._aad) {\n final.aad = base64url.encode(this._aad)\n aad = Buffer.concat([\n Buffer.from(final.protected || ''),\n Buffer.from('.'),\n Buffer.from(final.aad)\n ])\n } else {\n aad = Buffer.from(final.protected || '')\n }\n\n let cleartext = this._cleartext\n if (this._protected && 'zip' in this._protected) {\n cleartext = deflateRawSync(cleartext)\n }\n\n const { ciphertext, tag } = encrypt(enc, this._cek, cleartext, { iv, aad })\n final.tag = base64url.encodeBuffer(tag)\n final.ciphertext = base64url.encodeBuffer(ciphertext)\n\n return serializer(final, this._recipients)\n }\n}\n\nmodule.exports = Encrypt\n","const { randomBytes } = require('crypto')\n\nconst { createSecretKey } = require('../help/key_object')\nconst { KEYLENGTHS } = require('../registry')\nconst Key = require('../jwk/key/oct')\n\nmodule.exports = (alg) => {\n const keyLength = KEYLENGTHS.get(alg)\n\n if (!keyLength) {\n return new Key({ type: 'secret' })\n }\n\n return new Key(createSecretKey(randomBytes(keyLength / 8)), { use: 'enc', alg })\n}\n","const Encrypt = require('./encrypt')\nconst decrypt = require('./decrypt')\n\nconst single = (serialization, cleartext, key, protectedHeader, aad, unprotectedHeader) => {\n return new Encrypt(cleartext, protectedHeader, aad, unprotectedHeader)\n .recipient(key)\n .encrypt(serialization)\n}\n\nmodule.exports.Encrypt = Encrypt\nmodule.exports.encrypt = single.bind(undefined, 'compact')\nmodule.exports.encrypt.flattened = single.bind(undefined, 'flattened')\nmodule.exports.encrypt.general = single.bind(undefined, 'general')\n\nmodule.exports.decrypt = decrypt\n","const isObject = require('../help/is_object')\nlet validateCrit = require('../help/validate_crit')\n\nconst { JWEInvalid } = require('../errors')\n\nvalidateCrit = validateCrit.bind(undefined, JWEInvalid)\n\nconst compactSerializer = (final, [recipient]) => {\n return `${final.protected}.${recipient.encrypted_key}.${final.iv}.${final.ciphertext}.${final.tag}`\n}\ncompactSerializer.validate = (protectedHeader, unprotectedHeader, aad, { 0: { header }, length }) => {\n if (length !== 1 || aad || unprotectedHeader || header) {\n throw new JWEInvalid('JWE Compact Serialization doesn\\'t support multiple recipients, JWE unprotected headers or AAD')\n }\n validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined)\n}\n\nconst flattenedSerializer = (final, [recipient]) => {\n const { header, encrypted_key: encryptedKey } = recipient\n\n return {\n ...(final.protected ? { protected: final.protected } : undefined),\n ...(final.unprotected ? { unprotected: final.unprotected } : undefined),\n ...(header ? { header } : undefined),\n ...(encryptedKey ? { encrypted_key: encryptedKey } : undefined),\n ...(final.aad ? { aad: final.aad } : undefined),\n iv: final.iv,\n ciphertext: final.ciphertext,\n tag: final.tag\n }\n}\nflattenedSerializer.validate = (protectedHeader, unprotectedHeader, aad, { 0: { header }, length }) => {\n if (length !== 1) {\n throw new JWEInvalid('Flattened JWE JSON Serialization doesn\\'t support multiple recipients')\n }\n validateCrit(protectedHeader, { ...unprotectedHeader, ...header }, protectedHeader ? protectedHeader.crit : undefined)\n}\n\nconst generalSerializer = (final, recipients) => {\n const result = {\n ...(final.protected ? { protected: final.protected } : undefined),\n ...(final.unprotected ? { unprotected: final.unprotected } : undefined),\n recipients: recipients.map(({ header, encrypted_key: encryptedKey, generatedHeader }) => {\n if (!header && !encryptedKey && !generatedHeader) {\n return false\n }\n\n return {\n ...(header || generatedHeader ? { header: { ...header, ...generatedHeader } } : undefined),\n ...(encryptedKey ? { encrypted_key: encryptedKey } : undefined)\n }\n }).filter(Boolean),\n ...(final.aad ? { aad: final.aad } : undefined),\n iv: final.iv,\n ciphertext: final.ciphertext,\n tag: final.tag\n }\n\n if (!result.recipients.length) {\n delete result.recipients\n }\n\n return result\n}\ngeneralSerializer.validate = (protectedHeader, unprotectedHeader, aad, recipients) => {\n recipients.forEach(({ header }) => {\n validateCrit(protectedHeader, { ...header, ...unprotectedHeader }, protectedHeader ? protectedHeader.crit : undefined)\n })\n}\n\nconst isJSON = (input) => {\n return isObject(input) &&\n typeof input.ciphertext === 'string' &&\n typeof input.iv === 'string' &&\n typeof input.tag === 'string' &&\n (input.unprotected === undefined || isObject(input.unprotected)) &&\n (input.protected === undefined || typeof input.protected === 'string') &&\n (input.aad === undefined || typeof input.aad === 'string')\n}\n\nconst isSingleRecipient = (input) => {\n return (input.encrypted_key === undefined || typeof input.encrypted_key === 'string') &&\n (input.header === undefined || isObject(input.header))\n}\n\nconst isValidRecipient = (recipient) => {\n return isObject(recipient) && typeof recipient.encrypted_key === 'string' && (recipient.header === undefined || isObject(recipient.header))\n}\n\nconst isMultiRecipient = (input) => {\n if (Array.isArray(input.recipients) && input.recipients.every(isValidRecipient)) {\n return true\n }\n\n return false\n}\n\nconst detect = (input) => {\n if (typeof input === 'string' && input.split('.').length === 5) {\n return 'compact'\n }\n\n if (isJSON(input)) {\n if (isMultiRecipient(input)) {\n return 'general'\n }\n\n if (isSingleRecipient(input)) {\n return 'flattened'\n }\n }\n\n throw new JWEInvalid('JWE malformed or invalid serialization')\n}\n\nmodule.exports = {\n compact: compactSerializer,\n flattened: flattenedSerializer,\n general: generalSerializer,\n detect\n}\n","const isDisjoint = require('../help/is_disjoint')\nconst base64url = require('../help/base64url')\nlet validateCrit = require('../help/validate_crit')\nconst { JWEInvalid, JOSENotSupported } = require('../errors')\n\nvalidateCrit = validateCrit.bind(undefined, JWEInvalid)\n\nmodule.exports = (prot, unprotected, recipients, checkAlgorithms, crit) => {\n if (typeof prot === 'string') {\n try {\n prot = base64url.JSON.decode(prot)\n } catch (err) {\n throw new JWEInvalid('could not parse JWE protected header')\n }\n }\n\n let alg = []\n const enc = new Set()\n if (!isDisjoint(prot, unprotected) || !recipients.every(({ header }) => {\n if (typeof header === 'object') {\n alg.push(header.alg)\n enc.add(header.enc)\n }\n const combined = { ...unprotected, ...header }\n validateCrit(prot, combined, crit)\n if ('zip' in combined) {\n throw new JWEInvalid('\"zip\" Header Parameter MUST be integrity protected')\n } else if (prot && 'zip' in prot && prot.zip !== 'DEF') {\n throw new JOSENotSupported('only \"DEF\" compression algorithm is supported')\n }\n return isDisjoint(header, prot) && isDisjoint(header, unprotected)\n })) {\n throw new JWEInvalid('JWE Shared Protected, JWE Shared Unprotected and JWE Per-Recipient Header Parameter names must be disjoint')\n }\n\n if (typeof prot === 'object') {\n alg.push(prot.alg)\n enc.add(prot.enc)\n }\n if (typeof unprotected === 'object') {\n alg.push(unprotected.alg)\n enc.add(unprotected.enc)\n }\n\n alg = alg.filter(Boolean)\n enc.delete(undefined)\n\n if (recipients.length !== 1) {\n if (alg.includes('dir') || alg.includes('ECDH-ES')) {\n throw new JWEInvalid('dir and ECDH-ES alg may only be used with a single recipient')\n }\n }\n\n if (checkAlgorithms) {\n if (alg.length !== recipients.length) {\n throw new JWEInvalid('missing Key Management algorithm')\n }\n if (enc.size === 0) {\n throw new JWEInvalid('missing Content Encryption algorithm')\n } else if (enc.size !== 1) {\n throw new JWEInvalid('there must only be one Content Encryption algorithm')\n }\n } else {\n if (enc.size > 1) {\n throw new JWEInvalid('there must only be one Content Encryption algorithm')\n }\n }\n\n return [...enc][0]\n}\n","const errors = require('../errors')\n\nconst importKey = require('./import')\n\nconst RSAKey = require('./key/rsa')\nconst ECKey = require('./key/ec')\nconst OKPKey = require('./key/okp')\nconst OctKey = require('./key/oct')\n\nconst generate = async (kty, crvOrSize, params, generatePrivate = true) => {\n switch (kty) {\n case 'RSA':\n return importKey(\n await RSAKey.generate(crvOrSize, generatePrivate),\n params\n )\n case 'EC':\n return importKey(\n await ECKey.generate(crvOrSize, generatePrivate),\n params\n )\n case 'OKP':\n return importKey(\n await OKPKey.generate(crvOrSize, generatePrivate),\n params\n )\n case 'oct':\n return importKey(\n await OctKey.generate(crvOrSize, generatePrivate),\n params\n )\n default:\n throw new errors.JOSENotSupported(`unsupported key type: ${kty}`)\n }\n}\n\nconst generateSync = (kty, crvOrSize, params, generatePrivate = true) => {\n switch (kty) {\n case 'RSA':\n return importKey(RSAKey.generateSync(crvOrSize, generatePrivate), params)\n case 'EC':\n return importKey(ECKey.generateSync(crvOrSize, generatePrivate), params)\n case 'OKP':\n return importKey(OKPKey.generateSync(crvOrSize, generatePrivate), params)\n case 'oct':\n return importKey(OctKey.generateSync(crvOrSize, generatePrivate), params)\n default:\n throw new errors.JOSENotSupported(`unsupported key type: ${kty}`)\n }\n}\n\nmodule.exports.generate = generate\nmodule.exports.generateSync = generateSync\n","const { createPublicKey, createPrivateKey, createSecretKey, KeyObject } = require('../help/key_object')\nconst base64url = require('../help/base64url')\nconst isObject = require('../help/is_object')\nconst { jwkToPem } = require('../help/key_utils')\nconst errors = require('../errors')\n\nconst RSAKey = require('./key/rsa')\nconst ECKey = require('./key/ec')\nconst OKPKey = require('./key/okp')\nconst OctKey = require('./key/oct')\n\nconst importable = new Set(['string', 'buffer', 'object'])\n\nconst mergedParameters = (target = {}, source = {}) => {\n return {\n alg: source.alg,\n key_ops: source.key_ops,\n kid: source.kid,\n use: source.use,\n x5c: source.x5c,\n x5t: source.x5t,\n 'x5t#S256': source['x5t#S256'],\n ...target\n }\n}\n\nconst openSSHpublicKey = /^[a-zA-Z0-9-]+ AAAA(?:[0-9A-Za-z+/])+(?:==|=)?(?: .*)?$/\n\nconst asKey = (key, parameters, { calculateMissingRSAPrimes = false } = {}) => {\n let privateKey, publicKey, secret\n\n if (!importable.has(typeof key)) {\n throw new TypeError('key argument must be a string, buffer or an object')\n }\n\n if (parameters !== undefined && !isObject(parameters)) {\n throw new TypeError('parameters argument must be a plain object when provided')\n }\n\n if (key instanceof KeyObject) {\n switch (key.type) {\n case 'private':\n privateKey = key\n break\n case 'public':\n publicKey = key\n break\n case 'secret':\n secret = key\n break\n }\n } else if (typeof key === 'object' && key && 'kty' in key && key.kty === 'oct') { // symmetric key \n try {\n secret = createSecretKey(base64url.decodeToBuffer(key.k))\n } catch (err) {\n if (!('k' in key)) {\n secret = { type: 'secret' }\n }\n }\n parameters = mergedParameters(parameters, key)\n } else if (typeof key === 'object' && key && 'kty' in key) { // assume JWK formatted asymmetric key \n ({ calculateMissingRSAPrimes = false } = parameters || { calculateMissingRSAPrimes })\n let pem\n\n try {\n pem = jwkToPem(key, { calculateMissingRSAPrimes })\n } catch (err) {\n if (err instanceof errors.JOSEError) {\n throw err\n }\n }\n\n if (pem && key.d) {\n privateKey = createPrivateKey(pem)\n } else if (pem) {\n publicKey = createPublicKey(pem)\n }\n\n parameters = mergedParameters({}, key)\n } else if (key && (typeof key === 'object' || typeof key === 'string')) { // | | passed to crypto.createPrivateKey or crypto.createPublicKey or passed to crypto.createSecretKey\n try {\n privateKey = createPrivateKey(key)\n } catch (err) {\n if (err instanceof errors.JOSEError) {\n throw err\n }\n }\n\n try {\n publicKey = createPublicKey(key)\n if (key.startsWith('-----BEGIN CERTIFICATE-----') && (!parameters || !('x5c' in parameters))) {\n parameters = mergedParameters(parameters, {\n x5c: [key.replace(/(?:-----(?:BEGIN|END) CERTIFICATE-----|\\s)/g, '')]\n })\n }\n } catch (err) {\n if (err instanceof errors.JOSEError) {\n throw err\n }\n }\n\n try {\n // this is to filter out invalid PEM keys and certs, i'll rather have them fail import then\n // have them imported as symmetric \"oct\" keys\n if (!key.includes('-----BEGIN') && !openSSHpublicKey.test(key.toString('ascii').replace(/[\\r\\n]/g, ''))) {\n secret = createSecretKey(Buffer.isBuffer(key) ? key : Buffer.from(key))\n }\n } catch (err) {}\n }\n\n const keyObject = privateKey || publicKey || secret\n\n if (privateKey || publicKey) {\n switch (keyObject.asymmetricKeyType) {\n case 'rsa':\n return new RSAKey(keyObject, parameters)\n case 'ec':\n return new ECKey(keyObject, parameters)\n case 'ed25519':\n case 'ed448':\n case 'x25519':\n case 'x448':\n return new OKPKey(keyObject, parameters)\n default:\n throw new errors.JOSENotSupported('only RSA, EC and OKP asymmetric keys are supported')\n }\n } else if (secret) {\n return new OctKey(keyObject, parameters)\n }\n\n throw new errors.JWKImportFailed('key import failed')\n}\n\nmodule.exports = asKey\n","const Key = require('./key/base')\nconst None = require('./key/none')\nconst EmbeddedJWK = require('./key/embedded.jwk')\nconst EmbeddedX5C = require('./key/embedded.x5c')\nconst importKey = require('./import')\nconst generate = require('./generate')\n\nmodule.exports = {\n ...generate,\n asKey: importKey,\n isKey: input => input instanceof Key,\n None,\n EmbeddedJWK,\n EmbeddedX5C\n}\n","const { strict: assert } = require('assert')\nconst { inspect } = require('util')\nconst { EOL } = require('os')\n\nconst { keyObjectSupported } = require('../../help/runtime_support')\nconst { createPublicKey } = require('../../help/key_object')\nconst { keyObjectToJWK } = require('../../help/key_utils')\nconst {\n THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS, JWK_MEMBERS, KEYOBJECT,\n USES_MAPPING, OPS, USES\n} = require('../../help/consts')\nconst isObject = require('../../help/is_object')\nconst thumbprint = require('../thumbprint')\nconst errors = require('../../errors')\n\nconst privateApi = Symbol('privateApi')\nconst { JWK } = require('../../registry')\n\nclass Key {\n constructor (keyObject, { alg, use, kid, key_ops: ops, x5c, x5t, 'x5t#S256': x5t256 } = {}) {\n if (use !== undefined) {\n if (typeof use !== 'string' || !USES.has(use)) {\n throw new TypeError('`use` must be either \"sig\" or \"enc\" string when provided')\n }\n }\n\n if (alg !== undefined) {\n if (typeof alg !== 'string' || !alg) {\n throw new TypeError('`alg` must be a non-empty string when provided')\n }\n }\n\n if (kid !== undefined) {\n if (typeof kid !== 'string' || !kid) {\n throw new TypeError('`kid` must be a non-empty string when provided')\n }\n }\n\n if (ops !== undefined) {\n if (!Array.isArray(ops) || !ops.length || ops.some(o => typeof o !== 'string')) {\n throw new TypeError('`key_ops` must be a non-empty array of strings when provided')\n }\n ops = Array.from(new Set(ops)).filter(x => OPS.has(x))\n }\n\n if (ops && use) {\n if (\n (use === 'enc' && ops.some(x => USES_MAPPING.sig.has(x))) ||\n (use === 'sig' && ops.some(x => USES_MAPPING.enc.has(x)))\n ) {\n throw new errors.JWKInvalid('inconsistent JWK \"use\" and \"key_ops\"')\n }\n }\n\n if (keyObjectSupported && x5c !== undefined) {\n if (!Array.isArray(x5c) || !x5c.length || x5c.some(c => typeof c !== 'string')) {\n throw new TypeError('`x5c` must be an array of one or more PKIX certificates when provided')\n }\n\n x5c.forEach((cert, i) => {\n let publicKey\n try {\n publicKey = createPublicKey({\n key: `-----BEGIN CERTIFICATE-----${EOL}${(cert.match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END CERTIFICATE-----`, format: 'pem'\n })\n } catch (err) {\n throw new errors.JWKInvalid(`\\`x5c\\` member at index ${i} is not a valid base64-encoded DER PKIX certificate`)\n }\n if (i === 0) {\n try {\n assert.deepEqual(\n publicKey.export({ type: 'spki', format: 'der' }),\n (keyObject.type === 'public' ? keyObject : createPublicKey(keyObject)).export({ type: 'spki', format: 'der' })\n )\n } catch (err) {\n throw new errors.JWKInvalid('The key in the first `x5c` certificate MUST match the public key represented by the JWK')\n }\n }\n })\n }\n\n Object.defineProperties(this, {\n [KEYOBJECT]: { value: isObject(keyObject) ? undefined : keyObject },\n keyObject: {\n get () {\n if (!keyObjectSupported) {\n throw new errors.JOSENotSupported('KeyObject class is not supported in your Node.js runtime version')\n }\n\n return this[KEYOBJECT]\n }\n },\n type: { value: keyObject.type },\n private: { value: keyObject.type === 'private' },\n public: { value: keyObject.type === 'public' },\n secret: { value: keyObject.type === 'secret' },\n alg: { value: alg, enumerable: alg !== undefined },\n use: { value: use, enumerable: use !== undefined },\n x5c: {\n enumerable: x5c !== undefined,\n ...(x5c ? { get () { return [...x5c] } } : { value: undefined })\n },\n key_ops: {\n enumerable: ops !== undefined,\n ...(ops ? { get () { return [...ops] } } : { value: undefined })\n },\n kid: {\n enumerable: true,\n ...(kid\n ? { value: kid }\n : {\n get () {\n Object.defineProperty(this, 'kid', { value: this.thumbprint, configurable: false })\n return this.kid\n },\n configurable: true\n })\n },\n ...(x5c\n ? {\n x5t: {\n enumerable: true,\n ...(x5t\n ? { value: x5t }\n : {\n get () {\n Object.defineProperty(this, 'x5t', { value: thumbprint.x5t(this.x5c[0]), configurable: false })\n return this.x5t\n },\n configurable: true\n })\n }\n }\n : undefined),\n ...(x5c\n ? {\n 'x5t#S256': {\n enumerable: true,\n ...(x5t256\n ? { value: x5t256 }\n : {\n get () {\n Object.defineProperty(this, 'x5t#S256', { value: thumbprint['x5t#S256'](this.x5c[0]), configurable: false })\n return this['x5t#S256']\n },\n configurable: true\n })\n }\n }\n : undefined),\n thumbprint: {\n get () {\n Object.defineProperty(this, 'thumbprint', { value: thumbprint.kid(this[THUMBPRINT_MATERIAL]()), configurable: false })\n return this.thumbprint\n },\n configurable: true\n }\n })\n }\n\n toPEM (priv = false, encoding = {}) {\n if (this.secret) {\n throw new TypeError('symmetric keys cannot be exported as PEM')\n }\n\n if (priv && this.public === true) {\n throw new TypeError('public key cannot be exported as private')\n }\n\n const { type = priv ? 'pkcs8' : 'spki', cipher, passphrase } = encoding\n\n let keyObject = this[KEYOBJECT]\n\n if (!priv) {\n if (this.private) {\n keyObject = createPublicKey(keyObject)\n }\n if (cipher || passphrase) {\n throw new TypeError('cipher and passphrase can only be applied when exporting private keys')\n }\n }\n\n if (priv) {\n return keyObject.export({ format: 'pem', type, cipher, passphrase })\n }\n\n return keyObject.export({ format: 'pem', type })\n }\n\n toJWK (priv = false) {\n if (priv && this.public === true) {\n throw new TypeError('public key cannot be exported as private')\n }\n\n const components = [...this.constructor[priv ? PRIVATE_MEMBERS : PUBLIC_MEMBERS]]\n .map(k => [k, this[k]])\n\n const result = {}\n\n Object.keys(components).forEach((key) => {\n const [k, v] = components[key]\n\n result[k] = v\n })\n\n result.kty = this.kty\n result.kid = this.kid\n\n if (this.alg) {\n result.alg = this.alg\n }\n\n if (this.key_ops && this.key_ops.length) {\n result.key_ops = this.key_ops\n }\n\n if (this.use) {\n result.use = this.use\n }\n\n if (this.x5c) {\n result.x5c = this.x5c\n }\n\n if (this.x5t) {\n result.x5t = this.x5t\n }\n\n if (this['x5t#S256']) {\n result['x5t#S256'] = this['x5t#S256']\n }\n\n return result\n }\n\n [JWK_MEMBERS] () {\n const props = this[KEYOBJECT].type === 'private' ? this.constructor[PRIVATE_MEMBERS] : this.constructor[PUBLIC_MEMBERS]\n Object.defineProperties(this, [...props].reduce((acc, component) => {\n acc[component] = {\n get () {\n const jwk = keyObjectToJWK(this[KEYOBJECT])\n Object.defineProperties(\n this,\n Object.entries(jwk)\n .filter(([key]) => props.has(key))\n .reduce((acc, [key, value]) => {\n acc[key] = { value, enumerable: this.constructor[PUBLIC_MEMBERS].has(key), configurable: false }\n return acc\n }, {})\n )\n\n return this[component]\n },\n enumerable: this.constructor[PUBLIC_MEMBERS].has(component),\n configurable: true\n }\n return acc\n }, {}))\n }\n\n /* c8 ignore next 8 */\n [inspect.custom] () {\n return `${this.constructor.name} ${inspect(this.toJWK(false), {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true\n })}`\n }\n\n /* c8 ignore next 3 */\n [THUMBPRINT_MATERIAL] () {\n throw new Error(`\"[THUMBPRINT_MATERIAL]()\" is not implemented on ${this.constructor.name}`)\n }\n\n algorithms (operation, /* the rest is private API */ int, opts) {\n const { use = this.use, alg = this.alg, key_ops: ops = this.key_ops } = int === privateApi ? opts : {}\n if (alg) {\n return new Set(this.algorithms(operation, privateApi, { alg: null, use, key_ops: ops }).has(alg) ? [alg] : undefined)\n }\n\n if (typeof operation === 'symbol') {\n try {\n return this[operation]()\n } catch (err) {\n return new Set()\n }\n }\n\n if (operation && ops && !ops.includes(operation)) {\n return new Set()\n }\n\n switch (operation) {\n case 'decrypt':\n case 'deriveKey':\n case 'encrypt':\n case 'sign':\n case 'unwrapKey':\n case 'verify':\n case 'wrapKey':\n return new Set(Object.entries(JWK[this.kty][operation]).map(([alg, fn]) => fn(this) ? alg : undefined).filter(Boolean))\n case undefined:\n return new Set([\n ...this.algorithms('sign'),\n ...this.algorithms('verify'),\n ...this.algorithms('decrypt'),\n ...this.algorithms('encrypt'),\n ...this.algorithms('unwrapKey'),\n ...this.algorithms('wrapKey'),\n ...this.algorithms('deriveKey')\n ])\n default:\n throw new TypeError('invalid key operation')\n }\n }\n\n /* c8 ignore next 3 */\n static async generate () {\n throw new Error(`\"static async generate()\" is not implemented on ${this.name}`)\n }\n\n /* c8 ignore next 3 */\n static generateSync () {\n throw new Error(`\"static generateSync()\" is not implemented on ${this.name}`)\n }\n\n /* c8 ignore next 3 */\n static get [PUBLIC_MEMBERS] () {\n throw new Error(`\"static get [PUBLIC_MEMBERS]()\" is not implemented on ${this.name}`)\n }\n\n /* c8 ignore next 3 */\n static get [PRIVATE_MEMBERS] () {\n throw new Error(`\"static get [PRIVATE_MEMBERS]()\" is not implemented on ${this.name}`)\n }\n}\n\nmodule.exports = Key\n","const { generateKeyPairSync, generateKeyPair: async } = require('crypto')\nconst { promisify } = require('util')\n\nconst {\n THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS,\n PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT\n} = require('../../help/consts')\nconst { EC_CURVES } = require('../../registry')\nconst { keyObjectSupported } = require('../../help/runtime_support')\nconst { createPublicKey, createPrivateKey } = require('../../help/key_object')\n\nconst errors = require('../../errors')\n\nconst Key = require('./base')\n\nconst generateKeyPair = promisify(async)\n\nconst EC_PUBLIC = new Set(['crv', 'x', 'y'])\nObject.freeze(EC_PUBLIC)\nconst EC_PRIVATE = new Set([...EC_PUBLIC, 'd'])\nObject.freeze(EC_PRIVATE)\n\n// Elliptic Curve Key Type\nclass ECKey extends Key {\n constructor (...args) {\n super(...args)\n this[JWK_MEMBERS]()\n Object.defineProperty(this, 'kty', { value: 'EC', enumerable: true })\n if (!EC_CURVES.has(this.crv)) {\n throw new errors.JOSENotSupported('unsupported EC key curve')\n }\n }\n\n static get [PUBLIC_MEMBERS] () {\n return EC_PUBLIC\n }\n\n static get [PRIVATE_MEMBERS] () {\n return EC_PRIVATE\n }\n\n // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special\n // JSON.stringify handling in V8\n [THUMBPRINT_MATERIAL] () {\n return { crv: this.crv, kty: 'EC', x: this.x, y: this.y }\n }\n\n [KEY_MANAGEMENT_ENCRYPT] () {\n return this.algorithms('deriveKey')\n }\n\n [KEY_MANAGEMENT_DECRYPT] () {\n if (this.public) {\n return new Set()\n }\n return this.algorithms('deriveKey')\n }\n\n static async generate (crv = 'P-256', privat = true) {\n if (!EC_CURVES.has(crv)) {\n throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`)\n }\n\n let privateKey, publicKey\n\n if (keyObjectSupported) {\n ({ privateKey, publicKey } = await generateKeyPair('ec', { namedCurve: crv }))\n return privat ? privateKey : publicKey\n }\n\n ({ privateKey, publicKey } = await generateKeyPair('ec', {\n namedCurve: crv,\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs8', format: 'pem' }\n }))\n\n if (privat) {\n return createPrivateKey(privateKey)\n } else {\n return createPublicKey(publicKey)\n }\n }\n\n static generateSync (crv = 'P-256', privat = true) {\n if (!EC_CURVES.has(crv)) {\n throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`)\n }\n\n let privateKey, publicKey\n\n if (keyObjectSupported) {\n ({ privateKey, publicKey } = generateKeyPairSync('ec', { namedCurve: crv }))\n return privat ? privateKey : publicKey\n }\n\n ({ privateKey, publicKey } = generateKeyPairSync('ec', {\n namedCurve: crv,\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs8', format: 'pem' }\n }))\n\n if (privat) {\n return createPrivateKey(privateKey)\n } else {\n return createPublicKey(publicKey)\n }\n }\n}\n\nmodule.exports = ECKey\n","const { inspect } = require('util')\n\nconst Key = require('./base')\n\nclass EmbeddedJWK extends Key {\n constructor () {\n super({ type: 'embedded' })\n Object.defineProperties(this, {\n kid: { value: undefined },\n kty: { value: undefined },\n thumbprint: { value: undefined },\n toJWK: { value: undefined },\n toPEM: { value: undefined }\n })\n }\n\n /* c8 ignore next 3 */\n [inspect.custom] () {\n return 'Embedded.JWK {}'\n }\n\n algorithms () {\n return new Set()\n }\n}\n\nmodule.exports = new EmbeddedJWK()\n","const { inspect } = require('util')\n\nconst Key = require('./base')\n\nclass EmbeddedX5C extends Key {\n constructor () {\n super({ type: 'embedded' })\n Object.defineProperties(this, {\n kid: { value: undefined },\n kty: { value: undefined },\n thumbprint: { value: undefined },\n toJWK: { value: undefined },\n toPEM: { value: undefined }\n })\n }\n\n /* c8 ignore next 3 */\n [inspect.custom] () {\n return 'Embedded.X5C {}'\n }\n\n algorithms () {\n return new Set()\n }\n}\n\nmodule.exports = new EmbeddedX5C()\n","const { inspect } = require('util')\n\nconst Key = require('./base')\n\nclass NoneKey extends Key {\n constructor () {\n super({ type: 'unsecured' }, { alg: 'none' })\n Object.defineProperties(this, {\n kid: { value: undefined },\n kty: { value: undefined },\n thumbprint: { value: undefined },\n toJWK: { value: undefined },\n toPEM: { value: undefined }\n })\n }\n\n /* c8 ignore next 3 */\n [inspect.custom] () {\n return 'None {}'\n }\n\n algorithms (operation) {\n switch (operation) {\n case 'sign':\n case 'verify':\n case undefined:\n return new Set(['none'])\n default:\n return new Set()\n }\n }\n}\n\nmodule.exports = new NoneKey()\n","const { randomBytes } = require('crypto')\n\nconst { createSecretKey } = require('../../help/key_object')\nconst base64url = require('../../help/base64url')\nconst {\n THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS,\n KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT, KEYOBJECT\n} = require('../../help/consts')\n\nconst Key = require('./base')\n\nconst OCT_PUBLIC = new Set()\nObject.freeze(OCT_PUBLIC)\nconst OCT_PRIVATE = new Set(['k'])\nObject.freeze(OCT_PRIVATE)\n\n// Octet sequence Key Type\nclass OctKey extends Key {\n constructor (...args) {\n super(...args)\n Object.defineProperties(this, {\n kty: {\n value: 'oct',\n enumerable: true\n },\n length: {\n value: this[KEYOBJECT] ? this[KEYOBJECT].symmetricKeySize * 8 : undefined\n },\n k: {\n enumerable: false,\n get () {\n if (this[KEYOBJECT]) {\n Object.defineProperty(this, 'k', {\n value: base64url.encodeBuffer(this[KEYOBJECT].export()),\n configurable: false\n })\n } else {\n Object.defineProperty(this, 'k', {\n value: undefined,\n configurable: false\n })\n }\n\n return this.k\n },\n configurable: true\n }\n })\n }\n\n static get [PUBLIC_MEMBERS] () {\n return OCT_PUBLIC\n }\n\n static get [PRIVATE_MEMBERS] () {\n return OCT_PRIVATE\n }\n\n // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special\n // JSON.stringify handling in V8\n [THUMBPRINT_MATERIAL] () {\n if (!this[KEYOBJECT]) {\n throw new TypeError('reference \"oct\" keys without \"k\" cannot have their thumbprint calculated')\n }\n return { k: this.k, kty: 'oct' }\n }\n\n [KEY_MANAGEMENT_ENCRYPT] () {\n return new Set([\n ...this.algorithms('wrapKey'),\n ...this.algorithms('deriveKey')\n ])\n }\n\n [KEY_MANAGEMENT_DECRYPT] () {\n return this[KEY_MANAGEMENT_ENCRYPT]()\n }\n\n algorithms (...args) {\n if (!this[KEYOBJECT]) {\n return new Set()\n }\n\n return Key.prototype.algorithms.call(this, ...args)\n }\n\n static async generate (...args) {\n return this.generateSync(...args)\n }\n\n static generateSync (len = 256, privat = true) {\n if (!privat) {\n throw new TypeError('\"oct\" keys cannot be generated as public')\n }\n if (!Number.isSafeInteger(len) || !len || len % 8 !== 0) {\n throw new TypeError('invalid bit length')\n }\n\n return createSecretKey(randomBytes(len / 8))\n }\n}\n\nmodule.exports = OctKey\n","const { generateKeyPairSync, generateKeyPair: async } = require('crypto')\nconst { promisify } = require('util')\n\nconst {\n THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS,\n PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT\n} = require('../../help/consts')\nconst { OKP_CURVES } = require('../../registry')\nconst { edDSASupported } = require('../../help/runtime_support')\nconst errors = require('../../errors')\n\nconst Key = require('./base')\n\nconst generateKeyPair = promisify(async)\n\nconst OKP_PUBLIC = new Set(['crv', 'x'])\nObject.freeze(OKP_PUBLIC)\nconst OKP_PRIVATE = new Set([...OKP_PUBLIC, 'd'])\nObject.freeze(OKP_PRIVATE)\n\n// Octet string key pairs Key Type\nclass OKPKey extends Key {\n constructor (...args) {\n super(...args)\n this[JWK_MEMBERS]()\n Object.defineProperty(this, 'kty', { value: 'OKP', enumerable: true })\n if (!OKP_CURVES.has(this.crv)) {\n throw new errors.JOSENotSupported('unsupported OKP key curve')\n }\n }\n\n static get [PUBLIC_MEMBERS] () {\n return OKP_PUBLIC\n }\n\n static get [PRIVATE_MEMBERS] () {\n return OKP_PRIVATE\n }\n\n // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special\n // JSON.stringify handling in V8\n [THUMBPRINT_MATERIAL] () {\n return { crv: this.crv, kty: 'OKP', x: this.x }\n }\n\n [KEY_MANAGEMENT_ENCRYPT] () {\n return this.algorithms('deriveKey')\n }\n\n [KEY_MANAGEMENT_DECRYPT] () {\n if (this.public) {\n return new Set()\n }\n return this.algorithms('deriveKey')\n }\n\n static async generate (crv = 'Ed25519', privat = true) {\n if (!edDSASupported) {\n throw new errors.JOSENotSupported('OKP keys are not supported in your Node.js runtime version')\n }\n\n if (!OKP_CURVES.has(crv)) {\n throw new errors.JOSENotSupported(`unsupported OKP key curve: ${crv}`)\n }\n\n const { privateKey, publicKey } = await generateKeyPair(crv.toLowerCase())\n\n return privat ? privateKey : publicKey\n }\n\n static generateSync (crv = 'Ed25519', privat = true) {\n if (!edDSASupported) {\n throw new errors.JOSENotSupported('OKP keys are not supported in your Node.js runtime version')\n }\n\n if (!OKP_CURVES.has(crv)) {\n throw new errors.JOSENotSupported(`unsupported OKP key curve: ${crv}`)\n }\n\n const { privateKey, publicKey } = generateKeyPairSync(crv.toLowerCase())\n\n return privat ? privateKey : publicKey\n }\n}\n\nmodule.exports = OKPKey\n","const { generateKeyPairSync, generateKeyPair: async } = require('crypto')\nconst { promisify } = require('util')\n\nconst {\n THUMBPRINT_MATERIAL, JWK_MEMBERS, PUBLIC_MEMBERS,\n PRIVATE_MEMBERS, KEY_MANAGEMENT_DECRYPT, KEY_MANAGEMENT_ENCRYPT\n} = require('../../help/consts')\nconst { keyObjectSupported } = require('../../help/runtime_support')\nconst { createPublicKey, createPrivateKey } = require('../../help/key_object')\n\nconst Key = require('./base')\n\nconst generateKeyPair = promisify(async)\n\nconst RSA_PUBLIC = new Set(['e', 'n'])\nObject.freeze(RSA_PUBLIC)\nconst RSA_PRIVATE = new Set([...RSA_PUBLIC, 'd', 'p', 'q', 'dp', 'dq', 'qi'])\nObject.freeze(RSA_PRIVATE)\n\n// RSA Key Type\nclass RSAKey extends Key {\n constructor (...args) {\n super(...args)\n this[JWK_MEMBERS]()\n Object.defineProperties(this, {\n kty: {\n value: 'RSA',\n enumerable: true\n },\n length: {\n get () {\n Object.defineProperty(this, 'length', {\n value: Buffer.byteLength(this.n, 'base64') * 8,\n configurable: false\n })\n\n return this.length\n },\n configurable: true\n }\n })\n }\n\n static get [PUBLIC_MEMBERS] () {\n return RSA_PUBLIC\n }\n\n static get [PRIVATE_MEMBERS] () {\n return RSA_PRIVATE\n }\n\n // https://tc39.github.io/ecma262/#sec-ordinaryownpropertykeys no need for any special\n // JSON.stringify handling in V8\n [THUMBPRINT_MATERIAL] () {\n return { e: this.e, kty: 'RSA', n: this.n }\n }\n\n [KEY_MANAGEMENT_ENCRYPT] () {\n return this.algorithms('wrapKey')\n }\n\n [KEY_MANAGEMENT_DECRYPT] () {\n return this.algorithms('unwrapKey')\n }\n\n static async generate (len = 2048, privat = true) {\n if (!Number.isSafeInteger(len) || len < 512 || len % 8 !== 0 || (('electron' in process.versions) && len % 128 !== 0)) {\n throw new TypeError('invalid bit length')\n }\n\n let privateKey, publicKey\n\n if (keyObjectSupported) {\n ({ privateKey, publicKey } = await generateKeyPair('rsa', { modulusLength: len }))\n return privat ? privateKey : publicKey\n }\n\n ({ privateKey, publicKey } = await generateKeyPair('rsa', {\n modulusLength: len,\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs8', format: 'pem' }\n }))\n\n if (privat) {\n return createPrivateKey(privateKey)\n } else {\n return createPublicKey(publicKey)\n }\n }\n\n static generateSync (len = 2048, privat = true) {\n if (!Number.isSafeInteger(len) || len < 512 || len % 8 !== 0 || (('electron' in process.versions) && len % 128 !== 0)) {\n throw new TypeError('invalid bit length')\n }\n\n let privateKey, publicKey\n\n if (keyObjectSupported) {\n ({ privateKey, publicKey } = generateKeyPairSync('rsa', { modulusLength: len }))\n return privat ? privateKey : publicKey\n }\n\n ({ privateKey, publicKey } = generateKeyPairSync('rsa', {\n modulusLength: len,\n publicKeyEncoding: { type: 'spki', format: 'pem' },\n privateKeyEncoding: { type: 'pkcs8', format: 'pem' }\n }))\n\n if (privat) {\n return createPrivateKey(privateKey)\n } else {\n return createPublicKey(publicKey)\n }\n }\n}\n\nmodule.exports = RSAKey\n","const { createHash } = require('crypto')\n\nconst base64url = require('../help/base64url')\n\nconst x5t = (hash, cert) => base64url.encodeBuffer(createHash(hash).update(Buffer.from(cert, 'base64')).digest())\n\nmodule.exports.kid = components => base64url.encodeBuffer(createHash('sha256').update(JSON.stringify(components)).digest())\nmodule.exports.x5t = x5t.bind(undefined, 'sha1')\nmodule.exports['x5t#S256'] = x5t.bind(undefined, 'sha256')\n","const KeyStore = require('./keystore')\n\nmodule.exports = KeyStore\n","const { inspect } = require('util')\n\nconst isObject = require('../help/is_object')\nconst { generate, generateSync } = require('../jwk/generate')\nconst { USES_MAPPING } = require('../help/consts')\nconst { isKey, asKey: importKey } = require('../jwk')\n\nconst keyscore = (key, { alg, use, ops }) => {\n let score = 0\n\n if (alg && key.alg) {\n score++\n }\n\n if (use && key.use) {\n score++\n }\n\n if (ops && key.key_ops) {\n score++\n }\n\n return score\n}\n\nclass KeyStore {\n constructor (...keys) {\n while (keys.some(Array.isArray)) {\n keys = keys.flat\n ? keys.flat()\n : keys.reduce((acc, val) => {\n if (Array.isArray(val)) {\n return [...acc, ...val]\n }\n\n acc.push(val)\n return acc\n }, [])\n }\n if (keys.some(k => !isKey(k) || !k.kty)) {\n throw new TypeError('all keys must be instances of a key instantiated by JWK.asKey')\n }\n\n this._keys = new Set(keys)\n }\n\n all ({ alg, kid, thumbprint, use, kty, key_ops: ops, x5t, 'x5t#S256': x5t256, crv } = {}) {\n if (ops !== undefined && (!Array.isArray(ops) || !ops.length || ops.some(x => typeof x !== 'string'))) {\n throw new TypeError('`key_ops` must be a non-empty array of strings')\n }\n\n const search = { alg, use, ops }\n return [...this._keys]\n .filter((key) => {\n let candidate = true\n\n if (candidate && kid !== undefined && key.kid !== kid) {\n candidate = false\n }\n\n if (candidate && thumbprint !== undefined && key.thumbprint !== thumbprint) {\n candidate = false\n }\n\n if (candidate && x5t !== undefined && key.x5t !== x5t) {\n candidate = false\n }\n\n if (candidate && x5t256 !== undefined && key['x5t#S256'] !== x5t256) {\n candidate = false\n }\n\n if (candidate && kty !== undefined && key.kty !== kty) {\n candidate = false\n }\n\n if (candidate && crv !== undefined && (key.crv !== crv)) {\n candidate = false\n }\n\n if (alg !== undefined && !key.algorithms().has(alg)) {\n candidate = false\n }\n\n if (candidate && use !== undefined && (key.use !== undefined && key.use !== use)) {\n candidate = false\n }\n\n // TODO:\n if (candidate && ops !== undefined && (key.key_ops !== undefined || key.use !== undefined)) {\n let keyOps\n if (key.key_ops) {\n keyOps = new Set(key.key_ops)\n } else {\n keyOps = USES_MAPPING[key.use]\n }\n if (ops.some(x => !keyOps.has(x))) {\n candidate = false\n }\n }\n\n return candidate\n })\n .sort((first, second) => keyscore(second, search) - keyscore(first, search))\n }\n\n get (...args) {\n return this.all(...args)[0]\n }\n\n add (key) {\n if (!isKey(key) || !key.kty) {\n throw new TypeError('key must be an instance of a key instantiated by JWK.asKey')\n }\n\n this._keys.add(key)\n }\n\n remove (key) {\n if (!isKey(key)) {\n throw new TypeError('key must be an instance of a key instantiated by JWK.asKey')\n }\n\n this._keys.delete(key)\n }\n\n toJWKS (priv = false) {\n return {\n keys: [...this._keys.values()].map(\n key => key.toJWK(priv && (key.private || (key.secret && key.k)))\n )\n }\n }\n\n async generate (...args) {\n this._keys.add(await generate(...args))\n }\n\n generateSync (...args) {\n this._keys.add(generateSync(...args))\n }\n\n get size () {\n return this._keys.size\n }\n\n /* c8 ignore next 8 */\n [inspect.custom] () {\n return `${this.constructor.name} ${inspect(this.toJWKS(false), {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true\n })}`\n }\n\n * [Symbol.iterator] () {\n for (const key of this._keys) {\n yield key\n }\n }\n}\n\nfunction asKeyStore (jwks, { ignoreErrors = false, calculateMissingRSAPrimes = false } = {}) {\n if (!isObject(jwks) || !Array.isArray(jwks.keys) || jwks.keys.some(k => !isObject(k) || !('kty' in k))) {\n throw new TypeError('jwks must be a JSON Web Key Set formatted object')\n }\n\n const keys = jwks.keys.map((jwk) => {\n try {\n return importKey(jwk, { calculateMissingRSAPrimes })\n } catch (err) {\n if (!ignoreErrors) {\n throw err\n }\n return undefined\n }\n }).filter(Boolean)\n\n return new KeyStore(...keys)\n}\n\nmodule.exports = { KeyStore, asKeyStore }\n","const Sign = require('./sign')\nconst { verify } = require('./verify')\n\nconst single = (serialization, payload, key, protectedHeader, unprotectedHeader) => {\n return new Sign(payload)\n .recipient(key, protectedHeader, unprotectedHeader)\n .sign(serialization)\n}\n\nmodule.exports.Sign = Sign\nmodule.exports.sign = single.bind(undefined, 'compact')\nmodule.exports.sign.flattened = single.bind(undefined, 'flattened')\nmodule.exports.sign.general = single.bind(undefined, 'general')\n\nmodule.exports.verify = verify\n","const isObject = require('../help/is_object')\nlet validateCrit = require('../help/validate_crit')\nconst { JWSInvalid } = require('../errors')\n\nvalidateCrit = validateCrit.bind(undefined, JWSInvalid)\n\nconst compactSerializer = (payload, [recipient]) => {\n return `${recipient.protected}.${payload}.${recipient.signature}`\n}\ncompactSerializer.validate = (jws, { 0: { unprotectedHeader, protectedHeader }, length }) => {\n if (length !== 1 || unprotectedHeader) {\n throw new JWSInvalid('JWS Compact Serialization doesn\\'t support multiple recipients or JWS unprotected headers')\n }\n validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined)\n}\n\nconst flattenedSerializer = (payload, [recipient]) => {\n const { header, signature, protected: prot } = recipient\n\n return {\n payload,\n ...prot ? { protected: prot } : undefined,\n ...header ? { header } : undefined,\n signature\n }\n}\nflattenedSerializer.validate = (jws, { 0: { unprotectedHeader, protectedHeader }, length }) => {\n if (length !== 1) {\n throw new JWSInvalid('Flattened JWS JSON Serialization doesn\\'t support multiple recipients')\n }\n validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined)\n}\n\nconst generalSerializer = (payload, recipients) => {\n return {\n payload,\n signatures: recipients.map(({ header, signature, protected: prot }) => {\n return {\n ...prot ? { protected: prot } : undefined,\n ...header ? { header } : undefined,\n signature\n }\n })\n }\n}\ngeneralSerializer.validate = (jws, recipients) => {\n let validateB64 = false\n recipients.forEach(({ protectedHeader, unprotectedHeader }) => {\n if (protectedHeader && !validateB64 && 'b64' in protectedHeader) {\n validateB64 = true\n }\n validateCrit(protectedHeader, unprotectedHeader, protectedHeader ? protectedHeader.crit : undefined)\n })\n\n if (validateB64) {\n const values = recipients.map(({ protectedHeader }) => protectedHeader && protectedHeader.b64)\n if (!values.every((actual, i, [expected]) => actual === expected)) {\n throw new JWSInvalid('the \"b64\" Header Parameter value MUST be the same for all recipients')\n }\n }\n}\n\nconst isJSON = (input) => {\n return isObject(input) && (typeof input.payload === 'string' || Buffer.isBuffer(input.payload))\n}\n\nconst isValidRecipient = (recipient) => {\n return isObject(recipient) && typeof recipient.signature === 'string' &&\n (recipient.header === undefined || isObject(recipient.header)) &&\n (recipient.protected === undefined || typeof recipient.protected === 'string')\n}\n\nconst isMultiRecipient = (input) => {\n if (Array.isArray(input.signatures) && input.signatures.every(isValidRecipient)) {\n return true\n }\n\n return false\n}\n\nconst detect = (input) => {\n if (typeof input === 'string' && input.split('.').length === 3) {\n return 'compact'\n }\n\n if (isJSON(input)) {\n if (isMultiRecipient(input)) {\n return 'general'\n }\n\n if (isValidRecipient(input)) {\n return 'flattened'\n }\n }\n\n throw new JWSInvalid('JWS malformed or invalid serialization')\n}\n\nmodule.exports = {\n compact: compactSerializer,\n flattened: flattenedSerializer,\n general: generalSerializer,\n detect\n}\n","const base64url = require('../help/base64url')\nconst isDisjoint = require('../help/is_disjoint')\nconst isObject = require('../help/is_object')\nconst deepClone = require('../help/deep_clone')\nconst { JWSInvalid } = require('../errors')\nconst { sign } = require('../jwa')\nconst getKey = require('../help/get_key')\n\nconst serializers = require('./serializers')\n\nconst PROCESS_RECIPIENT = Symbol('PROCESS_RECIPIENT')\n\nclass Sign {\n constructor (payload) {\n if (typeof payload === 'string') {\n payload = base64url.encode(payload)\n } else if (Buffer.isBuffer(payload)) {\n payload = base64url.encodeBuffer(payload)\n this._binary = true\n } else if (isObject(payload)) {\n payload = base64url.JSON.encode(payload)\n } else {\n throw new TypeError('payload argument must be a Buffer, string or an object')\n }\n\n this._payload = payload\n this._recipients = []\n }\n\n /*\n * @public\n */\n recipient (key, protectedHeader, unprotectedHeader) {\n key = getKey(key)\n\n if (protectedHeader !== undefined && !isObject(protectedHeader)) {\n throw new TypeError('protectedHeader argument must be a plain object when provided')\n }\n\n if (unprotectedHeader !== undefined && !isObject(unprotectedHeader)) {\n throw new TypeError('unprotectedHeader argument must be a plain object when provided')\n }\n\n if (!isDisjoint(protectedHeader, unprotectedHeader)) {\n throw new JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint')\n }\n\n this._recipients.push({\n key,\n protectedHeader: protectedHeader ? deepClone(protectedHeader) : undefined,\n unprotectedHeader: unprotectedHeader ? deepClone(unprotectedHeader) : undefined\n })\n\n return this\n }\n\n /*\n * @private\n */\n [PROCESS_RECIPIENT] (recipient, first) {\n const { key, protectedHeader, unprotectedHeader } = recipient\n\n if (key.use === 'enc') {\n throw new TypeError('a key with \"use\":\"enc\" is not usable for signing')\n }\n\n const joseHeader = {\n protected: protectedHeader || {},\n unprotected: unprotectedHeader || {}\n }\n\n let alg = joseHeader.protected.alg || joseHeader.unprotected.alg\n\n if (!alg) {\n alg = key.alg || [...key.algorithms('sign')][0]\n if (recipient.protectedHeader) {\n joseHeader.protected.alg = recipient.protectedHeader.alg = alg\n } else {\n joseHeader.protected = recipient.protectedHeader = { alg }\n }\n }\n\n if (!alg) {\n throw new JWSInvalid('could not resolve a usable \"alg\" for a recipient')\n }\n\n recipient.header = unprotectedHeader\n recipient.protected = Object.keys(joseHeader.protected).length ? base64url.JSON.encode(joseHeader.protected) : ''\n\n if (first && joseHeader.protected.crit && joseHeader.protected.crit.includes('b64') && joseHeader.protected.b64 === false) {\n if (this._binary) {\n this._payload = base64url.decodeToBuffer(this._payload)\n } else {\n this._payload = base64url.decode(this._payload)\n }\n }\n\n const data = Buffer.concat([\n Buffer.from(recipient.protected || ''),\n Buffer.from('.'),\n Buffer.from(this._payload)\n ])\n\n recipient.signature = base64url.encodeBuffer(sign(alg, key, data))\n }\n\n /*\n * @public\n */\n sign (serialization) {\n const serializer = serializers[serialization]\n if (!serializer) {\n throw new TypeError('serialization must be one of \"compact\", \"flattened\", \"general\"')\n }\n\n if (!this._recipients.length) {\n throw new JWSInvalid('missing recipients')\n }\n\n serializer.validate(this, this._recipients)\n\n this._recipients.forEach((recipient, i) => {\n this[PROCESS_RECIPIENT](recipient, i === 0)\n })\n\n return serializer(this._payload, this._recipients)\n }\n}\n\nmodule.exports = Sign\n","const { EOL } = require('os')\n\nconst base64url = require('../help/base64url')\nconst isDisjoint = require('../help/is_disjoint')\nconst isObject = require('../help/is_object')\nlet validateCrit = require('../help/validate_crit')\nconst getKey = require('../help/get_key')\nconst { KeyStore } = require('../jwks')\nconst errors = require('../errors')\nconst { check, verify } = require('../jwa')\nconst JWK = require('../jwk')\n\nconst { detect: resolveSerialization } = require('./serializers')\n\nvalidateCrit = validateCrit.bind(undefined, errors.JWSInvalid)\nconst SINGLE_RECIPIENT = new Set(['compact', 'flattened', 'preparsed'])\n\n/*\n * @public\n */\nconst jwsVerify = (skipDisjointCheck, serialization, jws, key, { crit = [], complete = false, algorithms } = {}) => {\n key = getKey(key, true)\n\n if (algorithms !== undefined && (!Array.isArray(algorithms) || algorithms.some(s => typeof s !== 'string' || !s))) {\n throw new TypeError('\"algorithms\" option must be an array of non-empty strings')\n } else if (algorithms) {\n algorithms = new Set(algorithms)\n }\n\n if (!Array.isArray(crit) || crit.some(s => typeof s !== 'string' || !s)) {\n throw new TypeError('\"crit\" option must be an array of non-empty strings')\n }\n\n if (!serialization) {\n serialization = resolveSerialization(jws)\n }\n\n let prot // protected header\n let header // unprotected header\n let payload\n let signature\n let alg\n\n // treat general format with one recipient as flattened\n // skips iteration and avoids multi errors in this case\n if (serialization === 'general' && jws.signatures.length === 1) {\n serialization = 'flattened'\n const { signatures, ...root } = jws\n jws = { ...root, ...signatures[0] }\n }\n\n let decoded\n\n if (SINGLE_RECIPIENT.has(serialization)) {\n let parsedProt = {}\n\n switch (serialization) {\n case 'compact': // compact serialization format\n ([prot, payload, signature] = jws.split('.'))\n break\n case 'flattened': // flattened serialization format\n ({ protected: prot, payload, signature, header } = jws)\n break\n case 'preparsed': { // from the JWT module\n ({ decoded } = jws);\n ([prot, payload, signature] = jws.token.split('.'))\n break\n }\n }\n\n if (!header) {\n skipDisjointCheck = true\n }\n\n if (decoded) {\n parsedProt = decoded.header\n } else if (prot) {\n try {\n parsedProt = base64url.JSON.decode(prot)\n } catch (err) {\n throw new errors.JWSInvalid('could not parse JWS protected header')\n }\n } else {\n skipDisjointCheck = skipDisjointCheck || true\n }\n\n if (!skipDisjointCheck && !isDisjoint(parsedProt, header)) {\n throw new errors.JWSInvalid('JWS Protected and JWS Unprotected Header Parameter names must be disjoint')\n }\n\n const combinedHeader = { ...parsedProt, ...header }\n validateCrit(parsedProt, header, crit)\n\n alg = parsedProt.alg || (header && header.alg)\n if (!alg) {\n throw new errors.JWSInvalid('missing JWS signature algorithm')\n } else if (algorithms && !algorithms.has(alg)) {\n throw new errors.JOSEAlgNotWhitelisted('alg not whitelisted')\n }\n\n if (key instanceof KeyStore) {\n const keystore = key\n const keys = keystore.all({ kid: combinedHeader.kid, alg: combinedHeader.alg, key_ops: ['verify'] })\n switch (keys.length) {\n case 0:\n throw new errors.JWKSNoMatchingKey()\n case 1:\n // treat the call as if a Key instance was passed in\n // skips iteration and avoids multi errors in this case\n key = keys[0]\n break\n default: {\n const errs = []\n for (const key of keys) {\n try {\n return jwsVerify(true, serialization, jws, key, { crit, complete, algorithms: algorithms ? [...algorithms] : undefined })\n } catch (err) {\n errs.push(err)\n continue\n }\n }\n\n const multi = new errors.JOSEMultiError(errs)\n if ([...multi].some(e => e instanceof errors.JWSVerificationFailed)) {\n throw new errors.JWSVerificationFailed()\n }\n throw multi\n }\n }\n }\n\n if (key === JWK.EmbeddedJWK) {\n if (!isObject(combinedHeader.jwk)) {\n throw new errors.JWSInvalid('JWS Header Parameter \"jwk\" must be a JSON object')\n }\n key = JWK.asKey(combinedHeader.jwk)\n if (key.type !== 'public') {\n throw new errors.JWSInvalid('JWS Header Parameter \"jwk\" must be a public key')\n }\n } else if (key === JWK.EmbeddedX5C) {\n if (!Array.isArray(combinedHeader.x5c) || !combinedHeader.x5c.length || combinedHeader.x5c.some(c => typeof c !== 'string' || !c)) {\n throw new errors.JWSInvalid('JWS Header Parameter \"x5c\" must be a JSON array of certificate value strings')\n }\n key = JWK.asKey(\n `-----BEGIN CERTIFICATE-----${EOL}${(combinedHeader.x5c[0].match(/.{1,64}/g) || []).join(EOL)}${EOL}-----END CERTIFICATE-----`,\n { x5c: combinedHeader.x5c }\n )\n }\n\n check(key, 'verify', alg)\n\n const toBeVerified = Buffer.concat([\n Buffer.from(prot || ''),\n Buffer.from('.'),\n Buffer.isBuffer(payload) ? payload : Buffer.from(payload)\n ])\n\n if (!verify(alg, key, toBeVerified, base64url.decodeToBuffer(signature))) {\n throw new errors.JWSVerificationFailed()\n }\n\n if (combinedHeader.b64 === false) {\n payload = Buffer.from(payload)\n } else {\n payload = base64url.decodeToBuffer(payload)\n }\n\n if (complete) {\n const result = { payload, key }\n if (prot) result.protected = parsedProt\n if (header) result.header = header\n return result\n }\n\n return payload\n }\n\n // general serialization format\n const { signatures, ...root } = jws\n const errs = []\n for (const recipient of signatures) {\n try {\n return jwsVerify(false, 'flattened', { ...root, ...recipient }, key, { crit, complete, algorithms: algorithms ? [...algorithms] : undefined })\n } catch (err) {\n errs.push(err)\n continue\n }\n }\n\n const multi = new errors.JOSEMultiError(errs)\n if ([...multi].some(e => e instanceof errors.JWSVerificationFailed)) {\n throw new errors.JWSVerificationFailed()\n } else if ([...multi].every(e => e instanceof errors.JWKSNoMatchingKey)) {\n throw new errors.JWKSNoMatchingKey()\n }\n throw multi\n}\n\nmodule.exports = {\n bare: jwsVerify,\n verify: jwsVerify.bind(undefined, false, undefined)\n}\n","const base64url = require('../help/base64url')\nconst errors = require('../errors')\n\nmodule.exports = (token, { complete = false } = {}) => {\n if (typeof token !== 'string' || !token) {\n throw new TypeError('JWT must be a string')\n }\n\n const { 0: header, 1: payload, 2: signature, length } = token.split('.')\n\n if (length === 5) {\n throw new TypeError('encrypted JWTs cannot be decoded')\n }\n\n if (length !== 3) {\n throw new errors.JWTMalformed('JWTs must have three components')\n }\n\n try {\n const result = {\n header: base64url.JSON.decode(header),\n payload: base64url.JSON.decode(payload),\n signature\n }\n\n return complete ? result : result.payload\n } catch (err) {\n throw new errors.JWTMalformed('JWT is malformed')\n }\n}\n","const decode = require('./decode')\nconst sign = require('./sign')\nconst verify = require('./verify')\nconst profiles = require('./profiles')\n\nmodule.exports = {\n sign,\n verify,\n ...profiles\n}\n\nObject.defineProperty(module.exports, 'decode', {\n enumerable: false,\n configurable: true,\n value: decode\n})\n","const { JWTClaimInvalid } = require('../errors')\nconst secs = require('../help/secs')\nconst epoch = require('../help/epoch')\nconst isObject = require('../help/is_object')\n\nconst verify = require('./verify')\nconst {\n isString,\n isRequired,\n isTimestamp,\n isStringOrArrayOfStrings\n} = require('./shared_validations')\n\nconst isPayloadRequired = isRequired.bind(undefined, JWTClaimInvalid)\nconst isPayloadString = isString.bind(undefined, JWTClaimInvalid)\nconst isOptionString = isString.bind(undefined, TypeError)\n\nconst defineLazyExportWithWarning = (obj, property, name, definition) => {\n Object.defineProperty(obj, property, {\n enumerable: true,\n configurable: true,\n value (...args) {\n process.emitWarning(\n `The ${name} API implements an IETF draft. Breaking draft implementations are included as minor versions of the jose library, therefore, the ~ semver operator should be used and close attention be payed to library changelog as well as the drafts themselves.`,\n 'DraftWarning'\n )\n Object.defineProperty(obj, property, {\n enumerable: true,\n configurable: true,\n value: definition\n })\n return obj[property](...args)\n }\n })\n}\n\nconst validateCommonOptions = (options, profile) => {\n if (!isObject(options)) {\n throw new TypeError('options must be an object')\n }\n\n if (!options.issuer) {\n throw new TypeError(`\"issuer\" option is required to validate ${profile}`)\n }\n\n if (!options.audience) {\n throw new TypeError(`\"audience\" option is required to validate ${profile}`)\n }\n}\n\nmodule.exports = {\n IdToken: {\n verify: (token, key, options = {}) => {\n validateCommonOptions(options, 'an ID Token')\n\n if ('maxAuthAge' in options) {\n isOptionString(options.maxAuthAge, 'options.maxAuthAge')\n }\n if ('nonce' in options) {\n isOptionString(options.nonce, 'options.nonce')\n }\n\n const unix = epoch(options.now || new Date())\n const result = verify(token, key, { ...options })\n const payload = options.complete ? result.payload : result\n\n if (Array.isArray(payload.aud) && payload.aud.length > 1) {\n isPayloadRequired(payload.azp, '\"azp\" claim', 'azp')\n }\n isPayloadRequired(payload.iat, '\"iat\" claim', 'iat')\n isPayloadRequired(payload.sub, '\"sub\" claim', 'sub')\n isPayloadRequired(payload.exp, '\"exp\" claim', 'exp')\n isTimestamp(payload.auth_time, 'auth_time', !!options.maxAuthAge)\n isPayloadString(payload.nonce, '\"nonce\" claim', 'nonce', !!options.nonce)\n isPayloadString(payload.acr, '\"acr\" claim', 'acr')\n isStringOrArrayOfStrings(payload.amr, 'amr')\n\n if (options.nonce && payload.nonce !== options.nonce) {\n throw new JWTClaimInvalid('unexpected \"nonce\" claim value', 'nonce', 'check_failed')\n }\n\n const tolerance = options.clockTolerance ? secs(options.clockTolerance) : 0\n\n if (options.maxAuthAge) {\n const maxAuthAgeSeconds = secs(options.maxAuthAge)\n if (payload.auth_time + maxAuthAgeSeconds < unix - tolerance) {\n throw new JWTClaimInvalid('\"auth_time\" claim timestamp check failed (too much time has elapsed since the last End-User authentication)', 'auth_time', 'check_failed')\n }\n }\n\n if (Array.isArray(payload.aud) && payload.aud.length > 1 && payload.azp !== options.audience) {\n throw new JWTClaimInvalid('unexpected \"azp\" claim value', 'azp', 'check_failed')\n }\n\n return result\n }\n },\n LogoutToken: {},\n AccessToken: {}\n}\n\ndefineLazyExportWithWarning(module.exports.LogoutToken, 'verify', 'jose.JWT.LogoutToken.verify', (token, key, options = {}) => {\n validateCommonOptions(options, 'a Logout Token')\n\n const result = verify(token, key, { ...options })\n const payload = options.complete ? result.payload : result\n\n isPayloadRequired(payload.iat, '\"iat\" claim', 'iat')\n isPayloadRequired(payload.jti, '\"jti\" claim', 'jti')\n isPayloadString(payload.sid, '\"sid\" claim', 'sid')\n\n if (!('sid' in payload) && !('sub' in payload)) {\n throw new JWTClaimInvalid('either \"sid\" or \"sub\" (or both) claims must be present')\n }\n\n if ('nonce' in payload) {\n throw new JWTClaimInvalid('\"nonce\" claim is prohibited', 'nonce', 'prohibited')\n }\n\n if (!('events' in payload)) {\n throw new JWTClaimInvalid('\"events\" claim is missing', 'events', 'missing')\n }\n\n if (!isObject(payload.events)) {\n throw new JWTClaimInvalid('\"events\" claim must be an object', 'events', 'invalid')\n }\n\n if (!('http://schemas.openid.net/event/backchannel-logout' in payload.events)) {\n throw new JWTClaimInvalid('\"http://schemas.openid.net/event/backchannel-logout\" member is missing in the \"events\" claim', 'events', 'invalid')\n }\n\n if (!isObject(payload.events['http://schemas.openid.net/event/backchannel-logout'])) {\n throw new JWTClaimInvalid('\"http://schemas.openid.net/event/backchannel-logout\" member in the \"events\" claim must be an object', 'events', 'invalid')\n }\n\n return result\n})\n\ndefineLazyExportWithWarning(module.exports.AccessToken, 'verify', 'jose.JWT.AccessToken.verify', (token, key, options = {}) => {\n validateCommonOptions(options, 'a JWT Access Token')\n\n isOptionString(options.maxAuthAge, 'options.maxAuthAge')\n\n const unix = epoch(options.now || new Date())\n const typ = 'at+JWT'\n const result = verify(token, key, { ...options, typ })\n const payload = options.complete ? result.payload : result\n\n isPayloadRequired(payload.iat, '\"iat\" claim', 'iat')\n isPayloadRequired(payload.exp, '\"exp\" claim', 'exp')\n isPayloadRequired(payload.sub, '\"sub\" claim', 'sub')\n isPayloadRequired(payload.jti, '\"jti\" claim', 'jti')\n isPayloadString(payload.client_id, '\"client_id\" claim', 'client_id', true)\n isTimestamp(payload.auth_time, 'auth_time', !!options.maxAuthAge)\n isPayloadString(payload.acr, '\"acr\" claim', 'acr')\n isStringOrArrayOfStrings(payload.amr, 'amr')\n\n const tolerance = options.clockTolerance ? secs(options.clockTolerance) : 0\n\n if (options.maxAuthAge) {\n const maxAuthAgeSeconds = secs(options.maxAuthAge)\n if (payload.auth_time + maxAuthAgeSeconds < unix - tolerance) {\n throw new JWTClaimInvalid('\"auth_time\" claim timestamp check failed (too much time has elapsed since the last End-User authentication)', 'auth_time', 'check_failed')\n }\n }\n\n return result\n})\n","const { JWTClaimInvalid } = require('../errors')\n\nconst isNotString = val => typeof val !== 'string' || val.length === 0\nconst isNotArrayOfStrings = val => !Array.isArray(val) || val.length === 0 || val.some(isNotString)\nconst isRequired = (Err, value, label, claim) => {\n if (value === undefined) {\n throw new Err(`${label} is missing`, claim, 'missing')\n }\n}\nconst isString = (Err, value, label, claim, required = false) => {\n if (required) {\n isRequired(Err, value, label, claim)\n }\n\n if (value !== undefined && isNotString(value)) {\n throw new Err(`${label} must be a string`, claim, 'invalid')\n }\n}\nconst isTimestamp = (value, label, required = false) => {\n if (required && value === undefined) {\n throw new JWTClaimInvalid(`\"${label}\" claim is missing`, label, 'missing')\n }\n\n if (value !== undefined && (typeof value !== 'number')) {\n throw new JWTClaimInvalid(`\"${label}\" claim must be a JSON numeric value`, label, 'invalid')\n }\n}\nconst isStringOrArrayOfStrings = (value, label, required = false) => {\n if (required && value === undefined) {\n throw new JWTClaimInvalid(`\"${label}\" claim is missing`, label, 'missing')\n }\n\n if (value !== undefined && (isNotString(value) && isNotArrayOfStrings(value))) {\n throw new JWTClaimInvalid(`\"${label}\" claim must be a string or array of strings`, label, 'invalid')\n }\n}\n\nmodule.exports = {\n isNotArrayOfStrings,\n isRequired,\n isNotString,\n isString,\n isTimestamp,\n isStringOrArrayOfStrings\n}\n","const isObject = require('../help/is_object')\nconst secs = require('../help/secs')\nconst epoch = require('../help/epoch')\nconst getKey = require('../help/get_key')\nconst JWS = require('../jws')\n\nconst isString = require('./shared_validations').isString.bind(undefined, TypeError)\n\nconst validateOptions = (options) => {\n if (typeof options.iat !== 'boolean') {\n throw new TypeError('options.iat must be a boolean')\n }\n\n if (typeof options.kid !== 'boolean') {\n throw new TypeError('options.kid must be a boolean')\n }\n\n isString(options.subject, 'options.subject')\n isString(options.issuer, 'options.issuer')\n\n if (\n options.audience !== undefined &&\n (\n (typeof options.audience !== 'string' || !options.audience) &&\n (!Array.isArray(options.audience) || options.audience.length === 0 || options.audience.some(a => !a || typeof a !== 'string'))\n )\n ) {\n throw new TypeError('options.audience must be a string or an array of strings')\n }\n\n if (!isObject(options.header)) {\n throw new TypeError('options.header must be an object')\n }\n\n isString(options.algorithm, 'options.algorithm')\n isString(options.expiresIn, 'options.expiresIn')\n isString(options.notBefore, 'options.notBefore')\n isString(options.jti, 'options.jti')\n\n if (options.now !== undefined && (!(options.now instanceof Date) || !options.now.getTime())) {\n throw new TypeError('options.now must be a valid Date object')\n }\n}\n\nmodule.exports = (payload, key, options = {}) => {\n if (!isObject(options)) {\n throw new TypeError('options must be an object')\n }\n\n const {\n algorithm, audience, expiresIn, header = {}, iat = true,\n issuer, jti, kid = true, notBefore, subject, now\n } = options\n\n validateOptions({\n algorithm, audience, expiresIn, header, iat, issuer, jti, kid, notBefore, now, subject\n })\n\n if (!isObject(payload)) {\n throw new TypeError('payload must be an object')\n }\n\n let unix\n if (expiresIn || notBefore || iat) {\n unix = epoch(now || new Date())\n }\n\n payload = {\n ...payload,\n sub: subject || payload.sub,\n aud: audience || payload.aud,\n iss: issuer || payload.iss,\n jti: jti || payload.jti,\n iat: iat ? unix : payload.iat,\n exp: expiresIn ? unix + secs(expiresIn) : payload.exp,\n nbf: notBefore ? unix + secs(notBefore) : payload.nbf\n }\n\n key = getKey(key)\n\n let includeKid\n\n if (typeof options.kid === 'boolean') {\n includeKid = kid\n } else {\n includeKid = !key.secret\n }\n\n return JWS.sign(JSON.stringify(payload), key, {\n ...header,\n alg: algorithm || header.alg,\n kid: includeKid ? key.kid : header.kid\n })\n}\n","const isObject = require('../help/is_object')\nconst epoch = require('../help/epoch')\nconst secs = require('../help/secs')\nconst getKey = require('../help/get_key')\nconst { bare: verify } = require('../jws/verify')\nconst { JWTClaimInvalid, JWTExpired } = require('../errors')\n\nconst {\n isString,\n isNotString,\n isNotArrayOfStrings,\n isTimestamp,\n isStringOrArrayOfStrings\n} = require('./shared_validations')\nconst decode = require('./decode')\n\nconst isPayloadString = isString.bind(undefined, JWTClaimInvalid)\nconst isOptionString = isString.bind(undefined, TypeError)\n\nconst normalizeTyp = (value) => value.toLowerCase().replace(/^application\\//, '')\n\nconst validateOptions = ({\n algorithms, audience, clockTolerance, complete = false, crit, ignoreExp = false,\n ignoreIat = false, ignoreNbf = false, issuer, jti, maxTokenAge, now = new Date(),\n subject, typ\n}) => {\n if (typeof complete !== 'boolean') {\n throw new TypeError('options.complete must be a boolean')\n }\n\n if (typeof ignoreExp !== 'boolean') {\n throw new TypeError('options.ignoreExp must be a boolean')\n }\n\n if (typeof ignoreNbf !== 'boolean') {\n throw new TypeError('options.ignoreNbf must be a boolean')\n }\n\n if (typeof ignoreIat !== 'boolean') {\n throw new TypeError('options.ignoreIat must be a boolean')\n }\n\n isOptionString(maxTokenAge, 'options.maxTokenAge')\n isOptionString(subject, 'options.subject')\n isOptionString(jti, 'options.jti')\n isOptionString(clockTolerance, 'options.clockTolerance')\n isOptionString(typ, 'options.typ')\n\n if (issuer !== undefined && (isNotString(issuer) && isNotArrayOfStrings(issuer))) {\n throw new TypeError('options.issuer must be a string or an array of strings')\n }\n\n if (audience !== undefined && (isNotString(audience) && isNotArrayOfStrings(audience))) {\n throw new TypeError('options.audience must be a string or an array of strings')\n }\n\n if (algorithms !== undefined && isNotArrayOfStrings(algorithms)) {\n throw new TypeError('options.algorithms must be an array of strings')\n }\n\n if (!(now instanceof Date) || !now.getTime()) {\n throw new TypeError('options.now must be a valid Date object')\n }\n\n if (ignoreIat && maxTokenAge !== undefined) {\n throw new TypeError('options.ignoreIat and options.maxTokenAge cannot used together')\n }\n\n if (crit !== undefined && isNotArrayOfStrings(crit)) {\n throw new TypeError('options.crit must be an array of strings')\n }\n\n return {\n algorithms,\n audience,\n clockTolerance,\n complete,\n crit,\n ignoreExp,\n ignoreIat,\n ignoreNbf,\n issuer,\n jti,\n maxTokenAge,\n now,\n subject,\n typ\n }\n}\n\nconst validateTypes = ({ header, payload }, options) => {\n isPayloadString(header.alg, '\"alg\" header parameter', 'alg', true)\n\n isTimestamp(payload.iat, 'iat', !!options.maxTokenAge)\n isTimestamp(payload.exp, 'exp')\n isTimestamp(payload.nbf, 'nbf')\n isPayloadString(payload.jti, '\"jti\" claim', 'jti', !!options.jti)\n isStringOrArrayOfStrings(payload.iss, 'iss', !!options.issuer)\n isPayloadString(payload.sub, '\"sub\" claim', 'sub', !!options.subject)\n isStringOrArrayOfStrings(payload.aud, 'aud', !!options.audience)\n isPayloadString(header.typ, '\"typ\" header parameter', 'typ', !!options.typ)\n}\n\nconst checkAudiencePresence = (audPayload, audOption) => {\n if (typeof audPayload === 'string') {\n return audOption.includes(audPayload)\n }\n\n // Each principal intended to process the JWT MUST\n // identify itself with a value in the audience claim\n audPayload = new Set(audPayload)\n return audOption.some(Set.prototype.has.bind(audPayload))\n}\n\nmodule.exports = (token, key, options = {}) => {\n if (!isObject(options)) {\n throw new TypeError('options must be an object')\n }\n\n const {\n algorithms, audience, clockTolerance, complete, crit, ignoreExp, ignoreIat, ignoreNbf, issuer,\n jti, maxTokenAge, now, subject, typ\n } = options = validateOptions(options)\n\n const decoded = decode(token, { complete: true })\n key = getKey(key, true)\n\n if (complete) {\n ({ key } = verify(true, 'preparsed', { decoded, token }, key, { crit, algorithms, complete: true }))\n decoded.key = key\n } else {\n verify(true, 'preparsed', { decoded, token }, key, { crit, algorithms })\n }\n\n const unix = epoch(now)\n validateTypes(decoded, options)\n\n if (issuer && (typeof decoded.payload.iss !== 'string' || !(typeof issuer === 'string' ? [issuer] : issuer).includes(decoded.payload.iss))) {\n throw new JWTClaimInvalid('unexpected \"iss\" claim value', 'iss', 'check_failed')\n }\n\n if (subject && decoded.payload.sub !== subject) {\n throw new JWTClaimInvalid('unexpected \"sub\" claim value', 'sub', 'check_failed')\n }\n\n if (jti && decoded.payload.jti !== jti) {\n throw new JWTClaimInvalid('unexpected \"jti\" claim value', 'jti', 'check_failed')\n }\n\n if (audience && !checkAudiencePresence(decoded.payload.aud, typeof audience === 'string' ? [audience] : audience)) {\n throw new JWTClaimInvalid('unexpected \"aud\" claim value', 'aud', 'check_failed')\n }\n\n if (typ && normalizeTyp(decoded.header.typ) !== normalizeTyp(typ)) {\n throw new JWTClaimInvalid('unexpected \"typ\" JWT header value', 'typ', 'check_failed')\n }\n\n const tolerance = clockTolerance ? secs(clockTolerance) : 0\n\n if (!ignoreIat && !('exp' in decoded.payload) && 'iat' in decoded.payload && decoded.payload.iat > unix + tolerance) {\n throw new JWTClaimInvalid('\"iat\" claim timestamp check failed (it should be in the past)', 'iat', 'check_failed')\n }\n\n if (!ignoreNbf && 'nbf' in decoded.payload && decoded.payload.nbf > unix + tolerance) {\n throw new JWTClaimInvalid('\"nbf\" claim timestamp check failed', 'nbf', 'check_failed')\n }\n\n if (!ignoreExp && 'exp' in decoded.payload && decoded.payload.exp <= unix - tolerance) {\n throw new JWTExpired('\"exp\" claim timestamp check failed', 'exp', 'check_failed')\n }\n\n if (maxTokenAge) {\n const age = unix - decoded.payload.iat\n const max = secs(maxTokenAge)\n\n if (age - tolerance > max) {\n throw new JWTExpired('\"iat\" claim timestamp check failed (too far in the past)', 'iat', 'check_failed')\n }\n\n if (age < 0 - tolerance) {\n throw new JWTClaimInvalid('\"iat\" claim timestamp check failed (it should be in the past)', 'iat', 'check_failed')\n }\n }\n\n return complete ? decoded : decoded.payload\n}\n","const { getCurves } = require('crypto')\n\nconst curves = new Set()\n\nif (getCurves().includes('prime256v1')) {\n curves.add('P-256')\n}\n\nif (getCurves().includes('secp256k1')) {\n curves.add('secp256k1')\n}\n\nif (getCurves().includes('secp384r1')) {\n curves.add('P-384')\n}\n\nif (getCurves().includes('secp521r1')) {\n curves.add('P-521')\n}\n\nmodule.exports = curves\n","module.exports = new Map()\n","const EC_CURVES = require('./ec_curves')\nconst IVLENGTHS = require('./iv_lengths')\nconst JWA = require('./jwa')\nconst JWK = require('./jwk')\nconst KEYLENGTHS = require('./key_lengths')\nconst OKP_CURVES = require('./okp_curves')\nconst ECDH_DERIVE_LENGTHS = require('./ecdh_derive_lengths')\n\nmodule.exports = {\n EC_CURVES,\n ECDH_DERIVE_LENGTHS,\n IVLENGTHS,\n JWA,\n JWK,\n KEYLENGTHS,\n OKP_CURVES\n}\n","module.exports = new Map([\n ['A128CBC-HS256', 128],\n ['A128GCM', 96],\n ['A128GCMKW', 96],\n ['A192CBC-HS384', 128],\n ['A192GCM', 96],\n ['A192GCMKW', 96],\n ['A256CBC-HS512', 128],\n ['A256GCM', 96],\n ['A256GCMKW', 96]\n])\n","module.exports = {\n sign: new Map(),\n verify: new Map(),\n keyManagementEncrypt: new Map(),\n keyManagementDecrypt: new Map(),\n encrypt: new Map(),\n decrypt: new Map()\n}\n","module.exports = {\n oct: {\n decrypt: {},\n deriveKey: {},\n encrypt: {},\n sign: {},\n unwrapKey: {},\n verify: {},\n wrapKey: {}\n },\n EC: {\n decrypt: {},\n deriveKey: {},\n encrypt: {},\n sign: {},\n unwrapKey: {},\n verify: {},\n wrapKey: {}\n },\n RSA: {\n decrypt: {},\n deriveKey: {},\n encrypt: {},\n sign: {},\n unwrapKey: {},\n verify: {},\n wrapKey: {}\n },\n OKP: {\n decrypt: {},\n deriveKey: {},\n encrypt: {},\n sign: {},\n unwrapKey: {},\n verify: {},\n wrapKey: {}\n }\n}\n","module.exports = new Map([\n ['A128CBC-HS256', 256],\n ['A128GCM', 128],\n ['A192CBC-HS384', 384],\n ['A192GCM', 192],\n ['A256CBC-HS512', 512],\n ['A256GCM', 256]\n])\n","const curves = new Set(['Ed25519'])\n\nif (!('electron' in process.versions)) {\n curves.add('Ed448')\n curves.add('X25519')\n curves.add('X448')\n}\n\nmodule.exports = curves\n","/* eslint-disable max-classes-per-file */\n\nconst { inspect } = require('util');\nconst stdhttp = require('http');\nconst crypto = require('crypto');\nconst { strict: assert } = require('assert');\nconst querystring = require('querystring');\nconst url = require('url');\n\nconst { ParseError } = require('got');\nconst jose = require('jose');\nconst tokenHash = require('oidc-token-hash');\n\nconst base64url = require('./helpers/base64url');\nconst defaults = require('./helpers/defaults');\nconst { assertSigningAlgValuesSupport, assertIssuerConfiguration } = require('./helpers/assert');\nconst pick = require('./helpers/pick');\nconst isPlainObject = require('./helpers/is_plain_object');\nconst processResponse = require('./helpers/process_response');\nconst TokenSet = require('./token_set');\nconst { OPError, RPError } = require('./errors');\nconst now = require('./helpers/unix_timestamp');\nconst { random } = require('./helpers/generators');\nconst request = require('./helpers/request');\nconst {\n CALLBACK_PROPERTIES, CLIENT_DEFAULTS, JWT_CONTENT, CLOCK_TOLERANCE,\n} = require('./helpers/consts');\nconst issuerRegistry = require('./issuer_registry');\nconst instance = require('./helpers/weak_cache');\nconst { authenticatedPost, resolveResponseType, resolveRedirectUri } = require('./helpers/client');\nconst DeviceFlowHandle = require('./device_flow_handle');\n\nfunction pickCb(input) {\n return pick(input, ...CALLBACK_PROPERTIES);\n}\n\nfunction authorizationHeaderValue(token, tokenType = 'Bearer') {\n return `${tokenType} ${token}`;\n}\n\nfunction cleanUpClaims(claims) {\n if (Object.keys(claims._claim_names).length === 0) {\n delete claims._claim_names;\n }\n if (Object.keys(claims._claim_sources).length === 0) {\n delete claims._claim_sources;\n }\n}\n\nfunction assignClaim(target, source, sourceName, throwOnMissing = true) {\n return ([claim, inSource]) => {\n if (inSource === sourceName) {\n if (throwOnMissing && source[claim] === undefined) {\n throw new RPError(`expected claim \"${claim}\" in \"${sourceName}\"`);\n } else if (source[claim] !== undefined) {\n target[claim] = source[claim];\n }\n delete target._claim_names[claim];\n }\n };\n}\n\nfunction verifyPresence(payload, jwt, prop) {\n if (payload[prop] === undefined) {\n throw new RPError({\n message: `missing required JWT property ${prop}`,\n jwt,\n });\n }\n}\n\nfunction authorizationParams(params) {\n const authParams = {\n client_id: this.client_id,\n scope: 'openid',\n response_type: resolveResponseType.call(this),\n redirect_uri: resolveRedirectUri.call(this),\n ...params,\n };\n\n Object.entries(authParams).forEach(([key, value]) => {\n if (value === null || value === undefined) {\n delete authParams[key];\n } else if (key === 'claims' && typeof value === 'object') {\n authParams[key] = JSON.stringify(value);\n } else if (key === 'resource' && Array.isArray(value)) {\n authParams[key] = value;\n } else if (typeof value !== 'string') {\n authParams[key] = String(value);\n }\n });\n\n return authParams;\n}\n\nasync function claimJWT(label, jwt) {\n try {\n const { header, payload } = jose.JWT.decode(jwt, { complete: true });\n const { iss } = payload;\n\n if (header.alg === 'none') {\n return payload;\n }\n\n let key;\n if (!iss || iss === this.issuer.issuer) {\n key = await this.issuer.queryKeyStore(header);\n } else if (issuerRegistry.has(iss)) {\n key = await issuerRegistry.get(iss).queryKeyStore(header);\n } else {\n const discovered = await this.issuer.constructor.discover(iss);\n key = await discovered.queryKeyStore(header);\n }\n return jose.JWT.verify(jwt, key);\n } catch (err) {\n if (err instanceof RPError || err instanceof OPError || err.name === 'AggregateError') {\n throw err;\n } else {\n throw new RPError({\n printf: ['failed to validate the %s JWT (%s: %s)', label, err.name, err.message],\n jwt,\n });\n }\n }\n}\n\nfunction getKeystore(jwks) {\n if (!isPlainObject(jwks) || !Array.isArray(jwks.keys) || jwks.keys.some((k) => !isPlainObject(k) || !('kty' in k))) {\n throw new TypeError('jwks must be a JSON Web Key Set formatted object');\n }\n\n // eslint-disable-next-line no-restricted-syntax\n for (const jwk of jwks.keys) {\n if (jwk.kid === undefined) {\n jwk.kid = `DONOTUSE.${random()}`;\n }\n }\n\n const keystore = jose.JWKS.asKeyStore(jwks);\n if (keystore.all().some((key) => key.type !== 'private')) {\n throw new TypeError('jwks must only contain private keys');\n }\n return keystore;\n}\n\n// if an OP doesnt support client_secret_basic but supports client_secret_post, use it instead\n// this is in place to take care of most common pitfalls when first using discovered Issuers without\n// the support for default values defined by Discovery 1.0\nfunction checkBasicSupport(client, metadata, properties) {\n try {\n const supported = client.issuer.token_endpoint_auth_methods_supported;\n if (!supported.includes(properties.token_endpoint_auth_method)) {\n if (supported.includes('client_secret_post')) {\n properties.token_endpoint_auth_method = 'client_secret_post';\n }\n }\n } catch (err) {}\n}\n\nfunction handleCommonMistakes(client, metadata, properties) {\n if (!metadata.token_endpoint_auth_method) { // if no explicit value was provided\n checkBasicSupport(client, metadata, properties);\n }\n\n // :fp: c'mon people... RTFM\n if (metadata.redirect_uri) {\n if (metadata.redirect_uris) {\n throw new TypeError('provide a redirect_uri or redirect_uris, not both');\n }\n properties.redirect_uris = [metadata.redirect_uri];\n delete properties.redirect_uri;\n }\n\n if (metadata.response_type) {\n if (metadata.response_types) {\n throw new TypeError('provide a response_type or response_types, not both');\n }\n properties.response_types = [metadata.response_type];\n delete properties.response_type;\n }\n}\n\nfunction getDefaultsForEndpoint(endpoint, issuer, properties) {\n if (!issuer[`${endpoint}_endpoint`]) return;\n\n const tokenEndpointAuthMethod = properties.token_endpoint_auth_method;\n const tokenEndpointAuthSigningAlg = properties.token_endpoint_auth_signing_alg;\n\n const eam = `${endpoint}_endpoint_auth_method`;\n const easa = `${endpoint}_endpoint_auth_signing_alg`;\n\n if (properties[eam] === undefined && properties[easa] === undefined) {\n if (tokenEndpointAuthMethod !== undefined) {\n properties[eam] = tokenEndpointAuthMethod;\n }\n if (tokenEndpointAuthSigningAlg !== undefined) {\n properties[easa] = tokenEndpointAuthSigningAlg;\n }\n }\n}\n\nclass BaseClient {}\n\nmodule.exports = (issuer, aadIssValidation = false) => class Client extends BaseClient {\n /**\n * @name constructor\n * @api public\n */\n constructor(metadata = {}, jwks, options) {\n super();\n\n if (typeof metadata.client_id !== 'string' || !metadata.client_id) {\n throw new TypeError('client_id is required');\n }\n\n const properties = { ...CLIENT_DEFAULTS, ...metadata };\n\n handleCommonMistakes(this, metadata, properties);\n\n assertSigningAlgValuesSupport('token', this.issuer, properties);\n\n ['introspection', 'revocation'].forEach((endpoint) => {\n getDefaultsForEndpoint(endpoint, this.issuer, properties);\n assertSigningAlgValuesSupport(endpoint, this.issuer, properties);\n });\n\n Object.entries(properties).forEach(([key, value]) => {\n instance(this).get('metadata').set(key, value);\n if (!this[key]) {\n Object.defineProperty(this, key, {\n get() { return instance(this).get('metadata').get(key); },\n enumerable: true,\n });\n }\n });\n\n if (jwks !== undefined) {\n const keystore = getKeystore.call(this, jwks);\n instance(this).set('keystore', keystore);\n }\n\n if (options !== undefined) {\n instance(this).set('options', options);\n }\n\n this[CLOCK_TOLERANCE] = 0;\n }\n\n /**\n * @name authorizationUrl\n * @api public\n */\n authorizationUrl(params = {}) {\n if (!isPlainObject(params)) {\n throw new TypeError('params must be a plain object');\n }\n assertIssuerConfiguration(this.issuer, 'authorization_endpoint');\n const target = url.parse(this.issuer.authorization_endpoint, true);\n target.search = null;\n target.query = {\n ...target.query,\n ...authorizationParams.call(this, params),\n };\n return url.format(target);\n }\n\n /**\n * @name authorizationPost\n * @api public\n */\n authorizationPost(params = {}) {\n if (!isPlainObject(params)) {\n throw new TypeError('params must be a plain object');\n }\n const inputs = authorizationParams.call(this, params);\n const formInputs = Object.keys(inputs)\n .map((name) => ``).join('\\n');\n\n return `\n\n Requesting Authorization\n\n\n
\n ${formInputs}\n
\n\n`;\n }\n\n /**\n * @name endSessionUrl\n * @api public\n */\n endSessionUrl(params = {}) {\n assertIssuerConfiguration(this.issuer, 'end_session_endpoint');\n\n const {\n 0: postLogout,\n length,\n } = this.post_logout_redirect_uris || [];\n\n const {\n post_logout_redirect_uri = length === 1 ? postLogout : undefined,\n } = params;\n\n let hint = params.id_token_hint;\n\n if (hint instanceof TokenSet) {\n if (!hint.id_token) {\n throw new TypeError('id_token not present in TokenSet');\n }\n hint = hint.id_token;\n }\n\n const target = url.parse(this.issuer.end_session_endpoint, true);\n target.search = null;\n target.query = {\n ...params,\n ...target.query,\n ...{\n post_logout_redirect_uri,\n id_token_hint: hint,\n },\n };\n\n Object.entries(target.query).forEach(([key, value]) => {\n if (value === null || value === undefined) {\n delete target.query[key];\n }\n });\n\n return url.format(target);\n }\n\n /**\n * @name callbackParams\n * @api public\n */\n callbackParams(input) { // eslint-disable-line class-methods-use-this\n const isIncomingMessage = input instanceof stdhttp.IncomingMessage\n || (input && input.method && input.url);\n const isString = typeof input === 'string';\n\n if (!isString && !isIncomingMessage) {\n throw new TypeError('#callbackParams only accepts string urls, http.IncomingMessage or a lookalike');\n }\n\n if (isIncomingMessage) {\n switch (input.method) {\n case 'GET':\n return pickCb(url.parse(input.url, true).query);\n case 'POST':\n if (input.body === undefined) {\n throw new TypeError('incoming message body missing, include a body parser prior to this method call');\n }\n switch (typeof input.body) {\n case 'object':\n case 'string':\n if (Buffer.isBuffer(input.body)) {\n return pickCb(querystring.parse(input.body.toString('utf-8')));\n }\n if (typeof input.body === 'string') {\n return pickCb(querystring.parse(input.body));\n }\n\n return pickCb(input.body);\n default:\n throw new TypeError('invalid IncomingMessage body object');\n }\n default:\n throw new TypeError('invalid IncomingMessage method');\n }\n } else {\n return pickCb(url.parse(input, true).query);\n }\n }\n\n /**\n * @name callback\n * @api public\n */\n async callback(\n redirectUri,\n parameters,\n checks = {},\n { exchangeBody, clientAssertionPayload, DPoP } = {},\n ) {\n let params = pickCb(parameters);\n\n if (checks.jarm && !('response' in parameters)) {\n throw new RPError({\n message: 'expected a JARM response',\n checks,\n params,\n });\n } else if ('response' in parameters) {\n const decrypted = await this.decryptJARM(params.response);\n params = await this.validateJARM(decrypted);\n }\n\n if (this.default_max_age && !checks.max_age) {\n checks.max_age = this.default_max_age;\n }\n\n if (params.state && !checks.state) {\n throw new TypeError('checks.state argument is missing');\n }\n\n if (!params.state && checks.state) {\n throw new RPError({\n message: 'state missing from the response',\n checks,\n params,\n });\n }\n\n if (checks.state !== params.state) {\n throw new RPError({\n printf: ['state mismatch, expected %s, got: %s', checks.state, params.state],\n checks,\n params,\n });\n }\n\n if (params.error) {\n throw new OPError(params);\n }\n\n const RESPONSE_TYPE_REQUIRED_PARAMS = {\n code: ['code'],\n id_token: ['id_token'],\n token: ['access_token', 'token_type'],\n };\n\n if (checks.response_type) {\n for (const type of checks.response_type.split(' ')) { // eslint-disable-line no-restricted-syntax\n if (type === 'none') {\n if (params.code || params.id_token || params.access_token) {\n throw new RPError({\n message: 'unexpected params encountered for \"none\" response',\n checks,\n params,\n });\n }\n } else {\n for (const param of RESPONSE_TYPE_REQUIRED_PARAMS[type]) { // eslint-disable-line no-restricted-syntax, max-len\n if (!params[param]) {\n throw new RPError({\n message: `${param} missing from response`,\n checks,\n params,\n });\n }\n }\n }\n }\n }\n\n if (params.id_token) {\n const tokenset = new TokenSet(params);\n await this.decryptIdToken(tokenset);\n await this.validateIdToken(tokenset, checks.nonce, 'authorization', checks.max_age, checks.state);\n\n if (!params.code) {\n return tokenset;\n }\n }\n\n if (params.code) {\n const tokenset = await this.grant({\n ...exchangeBody,\n grant_type: 'authorization_code',\n code: params.code,\n redirect_uri: redirectUri,\n code_verifier: checks.code_verifier,\n }, { clientAssertionPayload, DPoP });\n\n await this.decryptIdToken(tokenset);\n await this.validateIdToken(tokenset, checks.nonce, 'token', checks.max_age);\n\n if (params.session_state) {\n tokenset.session_state = params.session_state;\n }\n\n return tokenset;\n }\n\n return new TokenSet(params);\n }\n\n /**\n * @name oauthCallback\n * @api public\n */\n async oauthCallback(\n redirectUri,\n parameters,\n checks = {},\n { exchangeBody, clientAssertionPayload, DPoP } = {},\n ) {\n let params = pickCb(parameters);\n\n if (checks.jarm && !('response' in parameters)) {\n throw new RPError({\n message: 'expected a JARM response',\n checks,\n params,\n });\n } else if ('response' in parameters) {\n const decrypted = await this.decryptJARM(params.response);\n params = await this.validateJARM(decrypted);\n }\n\n if (params.state && !checks.state) {\n throw new TypeError('checks.state argument is missing');\n }\n\n if (!params.state && checks.state) {\n throw new RPError({\n message: 'state missing from the response',\n checks,\n params,\n });\n }\n\n if (checks.state !== params.state) {\n throw new RPError({\n printf: ['state mismatch, expected %s, got: %s', checks.state, params.state],\n checks,\n params,\n });\n }\n\n if (params.error) {\n throw new OPError(params);\n }\n\n const RESPONSE_TYPE_REQUIRED_PARAMS = {\n code: ['code'],\n token: ['access_token', 'token_type'],\n };\n\n if (checks.response_type) {\n for (const type of checks.response_type.split(' ')) { // eslint-disable-line no-restricted-syntax\n if (type === 'none') {\n if (params.code || params.id_token || params.access_token) {\n throw new RPError({\n message: 'unexpected params encountered for \"none\" response',\n checks,\n params,\n });\n }\n }\n\n if (RESPONSE_TYPE_REQUIRED_PARAMS[type]) {\n for (const param of RESPONSE_TYPE_REQUIRED_PARAMS[type]) { // eslint-disable-line no-restricted-syntax, max-len\n if (!params[param]) {\n throw new RPError({\n message: `${param} missing from response`,\n checks,\n params,\n });\n }\n }\n }\n }\n }\n\n if (params.code) {\n return this.grant({\n ...exchangeBody,\n grant_type: 'authorization_code',\n code: params.code,\n redirect_uri: redirectUri,\n code_verifier: checks.code_verifier,\n }, { clientAssertionPayload, DPoP });\n }\n\n return new TokenSet(params);\n }\n\n /**\n * @name decryptIdToken\n * @api private\n */\n async decryptIdToken(token) {\n if (!this.id_token_encrypted_response_alg) {\n return token;\n }\n\n let idToken = token;\n\n if (idToken instanceof TokenSet) {\n if (!idToken.id_token) {\n throw new TypeError('id_token not present in TokenSet');\n }\n idToken = idToken.id_token;\n }\n\n const expectedAlg = this.id_token_encrypted_response_alg;\n const expectedEnc = this.id_token_encrypted_response_enc;\n\n const result = await this.decryptJWE(idToken, expectedAlg, expectedEnc);\n\n if (token instanceof TokenSet) {\n token.id_token = result;\n return token;\n }\n\n return result;\n }\n\n async validateJWTUserinfo(body) {\n const expectedAlg = this.userinfo_signed_response_alg;\n\n return this.validateJWT(body, expectedAlg, []);\n }\n\n /**\n * @name decryptJARM\n * @api private\n */\n async decryptJARM(response) {\n if (!this.authorization_encrypted_response_alg) {\n return response;\n }\n\n const expectedAlg = this.authorization_encrypted_response_alg;\n const expectedEnc = this.authorization_encrypted_response_enc;\n\n return this.decryptJWE(response, expectedAlg, expectedEnc);\n }\n\n /**\n * @name decryptJWTUserinfo\n * @api private\n */\n async decryptJWTUserinfo(body) {\n if (!this.userinfo_encrypted_response_alg) {\n return body;\n }\n\n const expectedAlg = this.userinfo_encrypted_response_alg;\n const expectedEnc = this.userinfo_encrypted_response_enc;\n\n return this.decryptJWE(body, expectedAlg, expectedEnc);\n }\n\n /**\n * @name decryptJWE\n * @api private\n */\n async decryptJWE(jwe, expectedAlg, expectedEnc = 'A128CBC-HS256') {\n const header = JSON.parse(base64url.decode(jwe.split('.')[0]));\n\n if (header.alg !== expectedAlg) {\n throw new RPError({\n printf: ['unexpected JWE alg received, expected %s, got: %s', expectedAlg, header.alg],\n jwt: jwe,\n });\n }\n\n if (header.enc !== expectedEnc) {\n throw new RPError({\n printf: ['unexpected JWE enc received, expected %s, got: %s', expectedEnc, header.enc],\n jwt: jwe,\n });\n }\n\n let keyOrStore;\n\n if (expectedAlg.match(/^(?:RSA|ECDH)/)) {\n keyOrStore = instance(this).get('keystore');\n } else {\n keyOrStore = await this.joseSecret(expectedAlg === 'dir' ? expectedEnc : expectedAlg);\n }\n\n const payload = jose.JWE.decrypt(jwe, keyOrStore);\n return payload.toString('utf8');\n }\n\n /**\n * @name validateIdToken\n * @api private\n */\n async validateIdToken(tokenSet, nonce, returnedBy, maxAge, state) {\n let idToken = tokenSet;\n\n const expectedAlg = this.id_token_signed_response_alg;\n\n const isTokenSet = idToken instanceof TokenSet;\n\n if (isTokenSet) {\n if (!idToken.id_token) {\n throw new TypeError('id_token not present in TokenSet');\n }\n idToken = idToken.id_token;\n }\n\n idToken = String(idToken);\n\n const timestamp = now();\n const { protected: header, payload, key } = await this.validateJWT(idToken, expectedAlg);\n\n if (maxAge || (maxAge !== null && this.require_auth_time)) {\n if (!payload.auth_time) {\n throw new RPError({\n message: 'missing required JWT property auth_time',\n jwt: idToken,\n });\n }\n if (typeof payload.auth_time !== 'number') {\n throw new RPError({\n message: 'JWT auth_time claim must be a JSON numeric value',\n jwt: idToken,\n });\n }\n }\n\n if (maxAge && (payload.auth_time + maxAge < timestamp - this[CLOCK_TOLERANCE])) {\n throw new RPError({\n printf: ['too much time has elapsed since the last End-User authentication, max_age %i, auth_time: %i, now %i', maxAge, payload.auth_time, timestamp - this[CLOCK_TOLERANCE]],\n now: timestamp,\n tolerance: this[CLOCK_TOLERANCE],\n auth_time: payload.auth_time,\n jwt: idToken,\n });\n }\n\n if (nonce !== null && (payload.nonce || nonce !== undefined) && payload.nonce !== nonce) {\n throw new RPError({\n printf: ['nonce mismatch, expected %s, got: %s', nonce, payload.nonce],\n jwt: idToken,\n });\n }\n\n const fapi = this.constructor.name === 'FAPIClient';\n\n if (returnedBy === 'authorization') {\n if (!payload.at_hash && tokenSet.access_token) {\n throw new RPError({\n message: 'missing required property at_hash',\n jwt: idToken,\n });\n }\n\n if (!payload.c_hash && tokenSet.code) {\n throw new RPError({\n message: 'missing required property c_hash',\n jwt: idToken,\n });\n }\n\n if (fapi) {\n if (!payload.s_hash && (tokenSet.state || state)) {\n throw new RPError({\n message: 'missing required property s_hash',\n jwt: idToken,\n });\n }\n }\n\n if (payload.s_hash) {\n if (!state) {\n throw new TypeError('cannot verify s_hash, \"checks.state\" property not provided');\n }\n\n try {\n tokenHash.validate({ claim: 's_hash', source: 'state' }, payload.s_hash, state, header.alg, key && key.crv);\n } catch (err) {\n throw new RPError({ message: err.message, jwt: idToken });\n }\n }\n }\n\n if (fapi && payload.iat < timestamp - 3600) {\n throw new RPError({\n printf: ['JWT issued too far in the past, now %i, iat %i', timestamp, payload.iat],\n now: timestamp,\n tolerance: this[CLOCK_TOLERANCE],\n iat: payload.iat,\n jwt: idToken,\n });\n }\n\n if (tokenSet.access_token && payload.at_hash !== undefined) {\n try {\n tokenHash.validate({ claim: 'at_hash', source: 'access_token' }, payload.at_hash, tokenSet.access_token, header.alg, key && key.crv);\n } catch (err) {\n throw new RPError({ message: err.message, jwt: idToken });\n }\n }\n\n if (tokenSet.code && payload.c_hash !== undefined) {\n try {\n tokenHash.validate({ claim: 'c_hash', source: 'code' }, payload.c_hash, tokenSet.code, header.alg, key && key.crv);\n } catch (err) {\n throw new RPError({ message: err.message, jwt: idToken });\n }\n }\n\n return tokenSet;\n }\n\n /**\n * @name validateJWT\n * @api private\n */\n async validateJWT(jwt, expectedAlg, required = ['iss', 'sub', 'aud', 'exp', 'iat']) {\n const isSelfIssued = this.issuer.issuer === 'https://self-issued.me';\n const timestamp = now();\n let header;\n let payload;\n try {\n ({ header, payload } = jose.JWT.decode(jwt, { complete: true }));\n } catch (err) {\n throw new RPError({\n printf: ['failed to decode JWT (%s: %s)', err.name, err.message],\n jwt,\n });\n }\n\n if (header.alg !== expectedAlg) {\n throw new RPError({\n printf: ['unexpected JWT alg received, expected %s, got: %s', expectedAlg, header.alg],\n jwt,\n });\n }\n\n if (isSelfIssued) {\n required = [...required, 'sub_jwk']; // eslint-disable-line no-param-reassign\n }\n\n required.forEach(verifyPresence.bind(undefined, payload, jwt));\n\n if (payload.iss !== undefined) {\n let expectedIss = this.issuer.issuer;\n\n if (aadIssValidation) {\n expectedIss = this.issuer.issuer.replace('{tenantid}', payload.tid);\n }\n\n if (payload.iss !== expectedIss) {\n throw new RPError({\n printf: ['unexpected iss value, expected %s, got: %s', expectedIss, payload.iss],\n jwt,\n });\n }\n }\n\n if (payload.iat !== undefined) {\n if (typeof payload.iat !== 'number') {\n throw new RPError({\n message: 'JWT iat claim must be a JSON numeric value',\n jwt,\n });\n }\n }\n\n if (payload.nbf !== undefined) {\n if (typeof payload.nbf !== 'number') {\n throw new RPError({\n message: 'JWT nbf claim must be a JSON numeric value',\n jwt,\n });\n }\n if (payload.nbf > timestamp + this[CLOCK_TOLERANCE]) {\n throw new RPError({\n printf: ['JWT not active yet, now %i, nbf %i', timestamp + this[CLOCK_TOLERANCE], payload.nbf],\n now: timestamp,\n tolerance: this[CLOCK_TOLERANCE],\n nbf: payload.nbf,\n jwt,\n });\n }\n }\n\n if (payload.exp !== undefined) {\n if (typeof payload.exp !== 'number') {\n throw new RPError({\n message: 'JWT exp claim must be a JSON numeric value',\n jwt,\n });\n }\n if (timestamp - this[CLOCK_TOLERANCE] >= payload.exp) {\n throw new RPError({\n printf: ['JWT expired, now %i, exp %i', timestamp - this[CLOCK_TOLERANCE], payload.exp],\n now: timestamp,\n tolerance: this[CLOCK_TOLERANCE],\n exp: payload.exp,\n jwt,\n });\n }\n }\n\n if (payload.aud !== undefined) {\n if (Array.isArray(payload.aud)) {\n if (payload.aud.length > 1 && !payload.azp) {\n throw new RPError({\n message: 'missing required JWT property azp',\n jwt,\n });\n }\n\n if (!payload.aud.includes(this.client_id)) {\n throw new RPError({\n printf: ['aud is missing the client_id, expected %s to be included in %j', this.client_id, payload.aud],\n jwt,\n });\n }\n } else if (payload.aud !== this.client_id) {\n throw new RPError({\n printf: ['aud mismatch, expected %s, got: %s', this.client_id, payload.aud],\n jwt,\n });\n }\n }\n\n if (payload.azp !== undefined) {\n let { additionalAuthorizedParties } = instance(this).get('options') || {};\n\n if (typeof additionalAuthorizedParties === 'string') {\n additionalAuthorizedParties = [this.client_id, additionalAuthorizedParties];\n } else if (Array.isArray(additionalAuthorizedParties)) {\n additionalAuthorizedParties = [this.client_id, ...additionalAuthorizedParties];\n } else {\n additionalAuthorizedParties = [this.client_id];\n }\n\n if (!additionalAuthorizedParties.includes(payload.azp)) {\n throw new RPError({\n printf: ['azp mismatch, got: %s', payload.azp],\n jwt,\n });\n }\n }\n\n let key;\n\n if (isSelfIssued) {\n try {\n assert(isPlainObject(payload.sub_jwk));\n key = jose.JWK.asKey(payload.sub_jwk);\n assert.equal(key.type, 'public');\n } catch (err) {\n throw new RPError({\n message: 'failed to use sub_jwk claim as an asymmetric JSON Web Key',\n jwt,\n });\n }\n if (key.thumbprint !== payload.sub) {\n throw new RPError({\n message: 'failed to match the subject with sub_jwk',\n jwt,\n });\n }\n } else if (header.alg.startsWith('HS')) {\n key = await this.joseSecret();\n } else if (header.alg !== 'none') {\n key = await this.issuer.queryKeyStore(header);\n }\n\n if (!key && header.alg === 'none') {\n return { protected: header, payload };\n }\n\n try {\n return {\n ...jose.JWS.verify(jwt, key, { complete: true }),\n payload,\n };\n } catch (err) {\n throw new RPError({\n message: 'failed to validate JWT signature',\n jwt,\n });\n }\n }\n\n /**\n * @name refresh\n * @api public\n */\n async refresh(refreshToken, { exchangeBody, clientAssertionPayload, DPoP } = {}) {\n let token = refreshToken;\n\n if (token instanceof TokenSet) {\n if (!token.refresh_token) {\n throw new TypeError('refresh_token not present in TokenSet');\n }\n token = token.refresh_token;\n }\n\n const tokenset = await this.grant({\n ...exchangeBody,\n grant_type: 'refresh_token',\n refresh_token: String(token),\n }, { clientAssertionPayload, DPoP });\n\n if (tokenset.id_token) {\n await this.decryptIdToken(tokenset);\n await this.validateIdToken(tokenset, null, 'token', null);\n\n if (refreshToken instanceof TokenSet && refreshToken.id_token) {\n const expectedSub = refreshToken.claims().sub;\n const actualSub = tokenset.claims().sub;\n if (actualSub !== expectedSub) {\n throw new RPError({\n printf: ['sub mismatch, expected %s, got: %s', expectedSub, actualSub],\n jwt: tokenset.id_token,\n });\n }\n }\n }\n\n return tokenset;\n }\n\n async requestResource(\n resourceUrl,\n accessToken,\n {\n method,\n headers,\n body,\n DPoP,\n // eslint-disable-next-line no-nested-ternary\n tokenType = DPoP ? 'DPoP' : accessToken instanceof TokenSet ? accessToken.token_type : 'Bearer',\n } = {},\n ) {\n if (accessToken instanceof TokenSet) {\n if (!accessToken.access_token) {\n throw new TypeError('access_token not present in TokenSet');\n }\n accessToken = accessToken.access_token; // eslint-disable-line no-param-reassign\n }\n\n const requestOpts = {\n headers: {\n Authorization: authorizationHeaderValue(accessToken, tokenType),\n ...headers,\n },\n body,\n };\n\n const mTLS = !!this.tls_client_certificate_bound_access_tokens;\n\n return request.call(this, {\n ...requestOpts,\n responseType: 'buffer',\n method,\n url: resourceUrl,\n }, { accessToken, mTLS, DPoP });\n }\n\n /**\n * @name userinfo\n * @api public\n */\n async userinfo(accessToken, {\n method = 'GET', via = 'header', tokenType, params, DPoP,\n } = {}) {\n assertIssuerConfiguration(this.issuer, 'userinfo_endpoint');\n const options = {\n tokenType,\n method: String(method).toUpperCase(),\n DPoP,\n };\n\n if (options.method !== 'GET' && options.method !== 'POST') {\n throw new TypeError('#userinfo() method can only be POST or a GET');\n }\n\n if (via === 'query' && options.method !== 'GET') {\n throw new TypeError('userinfo endpoints will only parse query strings for GET requests');\n } else if (via === 'body' && options.method !== 'POST') {\n throw new TypeError('can only send body on POST');\n }\n\n const jwt = !!(this.userinfo_signed_response_alg || this.userinfo_encrypted_response_alg);\n\n if (jwt) {\n options.headers = { Accept: 'application/jwt' };\n } else {\n options.headers = { Accept: 'application/json' };\n }\n\n const mTLS = !!this.tls_client_certificate_bound_access_tokens;\n\n let targetUrl;\n if (mTLS && this.issuer.mtls_endpoint_aliases) {\n targetUrl = this.issuer.mtls_endpoint_aliases.userinfo_endpoint;\n }\n\n targetUrl = new url.URL(targetUrl || this.issuer.userinfo_endpoint);\n\n // when via is not header we clear the Authorization header and add either\n // query string parameters or urlencoded body access_token parameter\n if (via === 'query') {\n options.headers.Authorization = undefined;\n targetUrl.searchParams.append('access_token', accessToken instanceof TokenSet ? accessToken.access_token : accessToken);\n } else if (via === 'body') {\n options.headers.Authorization = undefined;\n options.headers['Content-Type'] = 'application/x-www-form-urlencoded';\n options.body = new url.URLSearchParams();\n options.body.append('access_token', accessToken instanceof TokenSet ? accessToken.access_token : accessToken);\n }\n\n // handle additional parameters, GET via querystring, POST via urlencoded body\n if (params) {\n if (options.method === 'GET') {\n Object.entries(params).forEach(([key, value]) => {\n targetUrl.searchParams.append(key, value);\n });\n } else if (options.body) { // POST && via body\n Object.entries(params).forEach(([key, value]) => {\n options.body.append(key, value);\n });\n } else { // POST && via header\n options.body = new url.URLSearchParams();\n options.headers['Content-Type'] = 'application/x-www-form-urlencoded';\n Object.entries(params).forEach(([key, value]) => {\n options.body.append(key, value);\n });\n }\n }\n\n if (options.body) {\n options.body = options.body.toString();\n }\n\n const response = await this.requestResource(targetUrl, accessToken, options);\n\n let parsed = processResponse(response, { bearer: true });\n\n if (jwt) {\n if (!JWT_CONTENT.test(response.headers['content-type'])) {\n throw new RPError({\n message: 'expected application/jwt response from the userinfo_endpoint',\n response,\n });\n }\n\n const body = response.body.toString();\n const userinfo = await this.decryptJWTUserinfo(body);\n if (!this.userinfo_signed_response_alg) {\n try {\n parsed = JSON.parse(userinfo);\n assert(isPlainObject(parsed));\n } catch (err) {\n throw new RPError({\n message: 'failed to parse userinfo JWE payload as JSON',\n jwt: userinfo,\n });\n }\n } else {\n ({ payload: parsed } = await this.validateJWTUserinfo(userinfo));\n }\n } else {\n try {\n parsed = JSON.parse(response.body);\n } catch (error) {\n throw new ParseError(error, response);\n }\n }\n\n if (accessToken instanceof TokenSet && accessToken.id_token) {\n const expectedSub = accessToken.claims().sub;\n if (parsed.sub !== expectedSub) {\n throw new RPError({\n printf: ['userinfo sub mismatch, expected %s, got: %s', expectedSub, parsed.sub],\n body: parsed,\n jwt: accessToken.id_token,\n });\n }\n }\n\n return parsed;\n }\n\n /**\n * @name derivedKey\n * @api private\n */\n async derivedKey(len) {\n const cacheKey = `${len}_key`;\n if (instance(this).has(cacheKey)) {\n return instance(this).get(cacheKey);\n }\n\n const hash = len <= 256 ? 'sha256' : len <= 384 ? 'sha384' : len <= 512 ? 'sha512' : false; // eslint-disable-line no-nested-ternary\n if (!hash) {\n throw new Error('unsupported symmetric encryption key derivation');\n }\n\n const derivedBuffer = crypto.createHash(hash)\n .update(this.client_secret)\n .digest()\n .slice(0, len / 8);\n\n const key = jose.JWK.asKey({ k: base64url.encode(derivedBuffer), kty: 'oct' });\n instance(this).set(cacheKey, key);\n\n return key;\n }\n\n /**\n * @name joseSecret\n * @api private\n */\n async joseSecret(alg) {\n if (!this.client_secret) {\n throw new TypeError('client_secret is required');\n }\n if (/^A(\\d{3})(?:GCM)?KW$/.test(alg)) {\n return this.derivedKey(parseInt(RegExp.$1, 10));\n }\n\n if (/^A(\\d{3})(?:GCM|CBC-HS(\\d{3}))$/.test(alg)) {\n return this.derivedKey(parseInt(RegExp.$2 || RegExp.$1, 10));\n }\n\n if (instance(this).has('jose_secret')) {\n return instance(this).get('jose_secret');\n }\n\n const key = jose.JWK.asKey({ k: base64url.encode(this.client_secret), kty: 'oct' });\n instance(this).set('jose_secret', key);\n\n return key;\n }\n\n /**\n * @name grant\n * @api public\n */\n async grant(body, { clientAssertionPayload, DPoP } = {}) {\n assertIssuerConfiguration(this.issuer, 'token_endpoint');\n const response = await authenticatedPost.call(\n this,\n 'token',\n {\n form: body,\n responseType: 'json',\n },\n { clientAssertionPayload, DPoP },\n );\n const responseBody = processResponse(response);\n\n return new TokenSet(responseBody);\n }\n\n /**\n * @name deviceAuthorization\n * @api public\n */\n async deviceAuthorization(params = {}, { exchangeBody, clientAssertionPayload, DPoP } = {}) {\n assertIssuerConfiguration(this.issuer, 'device_authorization_endpoint');\n assertIssuerConfiguration(this.issuer, 'token_endpoint');\n\n const body = authorizationParams.call(this, {\n client_id: this.client_id,\n redirect_uri: null,\n response_type: null,\n ...params,\n });\n\n const response = await authenticatedPost.call(\n this,\n 'device_authorization',\n {\n responseType: 'json',\n form: body,\n },\n { clientAssertionPayload, endpointAuthMethod: 'token' },\n );\n const responseBody = processResponse(response);\n\n return new DeviceFlowHandle({\n client: this,\n exchangeBody,\n clientAssertionPayload,\n response: responseBody,\n maxAge: params.max_age,\n DPoP,\n });\n }\n\n /**\n * @name revoke\n * @api public\n */\n async revoke(token, hint, { revokeBody, clientAssertionPayload } = {}) {\n assertIssuerConfiguration(this.issuer, 'revocation_endpoint');\n if (hint !== undefined && typeof hint !== 'string') {\n throw new TypeError('hint must be a string');\n }\n\n const form = { ...revokeBody, token };\n\n if (hint) {\n form.token_type_hint = hint;\n }\n\n const response = await authenticatedPost.call(\n this,\n 'revocation', {\n form,\n }, { clientAssertionPayload },\n );\n processResponse(response, { body: false });\n }\n\n /**\n * @name introspect\n * @api public\n */\n async introspect(token, hint, { introspectBody, clientAssertionPayload } = {}) {\n assertIssuerConfiguration(this.issuer, 'introspection_endpoint');\n if (hint !== undefined && typeof hint !== 'string') {\n throw new TypeError('hint must be a string');\n }\n\n const form = { ...introspectBody, token };\n if (hint) {\n form.token_type_hint = hint;\n }\n\n const response = await authenticatedPost.call(\n this,\n 'introspection',\n { form, responseType: 'json' },\n { clientAssertionPayload },\n );\n\n const responseBody = processResponse(response);\n\n return responseBody;\n }\n\n /**\n * @name fetchDistributedClaims\n * @api public\n */\n async fetchDistributedClaims(claims, tokens = {}) {\n if (!isPlainObject(claims)) {\n throw new TypeError('claims argument must be a plain object');\n }\n\n if (!isPlainObject(claims._claim_sources)) {\n return claims;\n }\n\n if (!isPlainObject(claims._claim_names)) {\n return claims;\n }\n\n const distributedSources = Object.entries(claims._claim_sources)\n .filter(([, value]) => value && value.endpoint);\n\n await Promise.all(distributedSources.map(async ([sourceName, def]) => {\n try {\n const requestOpts = {\n headers: {\n Accept: 'application/jwt',\n Authorization: authorizationHeaderValue(def.access_token || tokens[sourceName]),\n },\n };\n\n const response = await request.call(this, {\n ...requestOpts,\n method: 'GET',\n url: def.endpoint,\n });\n const body = processResponse(response, { bearer: true });\n\n const decoded = await claimJWT.call(this, 'distributed', body);\n delete claims._claim_sources[sourceName];\n Object.entries(claims._claim_names).forEach(\n assignClaim(claims, decoded, sourceName, false),\n );\n } catch (err) {\n err.src = sourceName;\n throw err;\n }\n }));\n\n cleanUpClaims(claims);\n return claims;\n }\n\n /**\n * @name unpackAggregatedClaims\n * @api public\n */\n async unpackAggregatedClaims(claims) {\n if (!isPlainObject(claims)) {\n throw new TypeError('claims argument must be a plain object');\n }\n\n if (!isPlainObject(claims._claim_sources)) {\n return claims;\n }\n\n if (!isPlainObject(claims._claim_names)) {\n return claims;\n }\n\n const aggregatedSources = Object.entries(claims._claim_sources)\n .filter(([, value]) => value && value.JWT);\n\n await Promise.all(aggregatedSources.map(async ([sourceName, def]) => {\n try {\n const decoded = await claimJWT.call(this, 'aggregated', def.JWT);\n delete claims._claim_sources[sourceName];\n Object.entries(claims._claim_names).forEach(assignClaim(claims, decoded, sourceName));\n } catch (err) {\n err.src = sourceName;\n throw err;\n }\n }));\n\n cleanUpClaims(claims);\n return claims;\n }\n\n /**\n * @name register\n * @api public\n */\n static async register(metadata, options = {}) {\n const { initialAccessToken, jwks, ...clientOptions } = options;\n\n assertIssuerConfiguration(this.issuer, 'registration_endpoint');\n\n if (jwks !== undefined && !(metadata.jwks || metadata.jwks_uri)) {\n const keystore = getKeystore.call(this, jwks);\n metadata.jwks = keystore.toJWKS(false);\n // eslint-disable-next-line no-restricted-syntax\n for (const jwk of metadata.jwks.keys) {\n if (jwk.kid.startsWith('DONOTUSE.')) {\n delete jwk.kid;\n }\n }\n }\n\n const response = await request.call(this, {\n headers: initialAccessToken ? {\n Authorization: authorizationHeaderValue(initialAccessToken),\n } : undefined,\n responseType: 'json',\n json: metadata,\n url: this.issuer.registration_endpoint,\n method: 'POST',\n });\n const responseBody = processResponse(response, { statusCode: 201, bearer: true });\n\n return new this(responseBody, jwks, clientOptions);\n }\n\n /**\n * @name metadata\n * @api public\n */\n get metadata() {\n const copy = {};\n instance(this).get('metadata').forEach((value, key) => {\n copy[key] = value;\n });\n return copy;\n }\n\n /**\n * @name fromUri\n * @api public\n */\n static async fromUri(registrationClientUri, registrationAccessToken, jwks, clientOptions) {\n const response = await request.call(this, {\n method: 'GET',\n url: registrationClientUri,\n responseType: 'json',\n headers: { Authorization: authorizationHeaderValue(registrationAccessToken) },\n });\n const responseBody = processResponse(response, { bearer: true });\n\n return new this(responseBody, jwks, clientOptions);\n }\n\n /**\n * @name requestObject\n * @api public\n */\n async requestObject(requestObject = {}, {\n sign: signingAlgorithm = this.request_object_signing_alg || 'none',\n encrypt: {\n alg: eKeyManagement = this.request_object_encryption_alg,\n enc: eContentEncryption = this.request_object_encryption_enc || 'A128CBC-HS256',\n } = {},\n } = {}) {\n if (!isPlainObject(requestObject)) {\n throw new TypeError('requestObject must be a plain object');\n }\n\n let signed;\n let key;\n\n const fapi = this.constructor.name === 'FAPIClient';\n const unix = now();\n const header = { alg: signingAlgorithm, typ: 'oauth-authz-req+jwt' };\n const payload = JSON.stringify(defaults({}, requestObject, {\n iss: this.client_id,\n aud: this.issuer.issuer,\n client_id: this.client_id,\n jti: random(),\n iat: unix,\n exp: unix + 300,\n ...(fapi ? { nbf: unix } : undefined),\n }));\n\n if (signingAlgorithm === 'none') {\n signed = [\n base64url.encode(JSON.stringify(header)),\n base64url.encode(payload),\n '',\n ].join('.');\n } else {\n const symmetric = signingAlgorithm.startsWith('HS');\n if (symmetric) {\n key = await this.joseSecret();\n } else {\n const keystore = instance(this).get('keystore');\n\n if (!keystore) {\n throw new TypeError(`no keystore present for client, cannot sign using alg ${signingAlgorithm}`);\n }\n key = keystore.get({ alg: signingAlgorithm, use: 'sig' });\n if (!key) {\n throw new TypeError(`no key to sign with found for alg ${signingAlgorithm}`);\n }\n }\n\n signed = jose.JWS.sign(payload, key, {\n ...header,\n kid: symmetric || key.kid.startsWith('DONOTUSE.') ? undefined : key.kid,\n });\n }\n\n if (!eKeyManagement) {\n return signed;\n }\n\n const fields = { alg: eKeyManagement, enc: eContentEncryption, cty: 'oauth-authz-req+jwt' };\n\n if (fields.alg.match(/^(RSA|ECDH)/)) {\n [key] = await this.issuer.queryKeyStore({\n alg: fields.alg,\n enc: fields.enc,\n use: 'enc',\n }, { allowMulti: true });\n } else {\n key = await this.joseSecret(fields.alg === 'dir' ? fields.enc : fields.alg);\n }\n\n return jose.JWE.encrypt(signed, key, {\n ...fields,\n kid: key.kty === 'oct' ? undefined : key.kid,\n });\n }\n\n /**\n * @name pushedAuthorizationRequest\n * @api public\n */\n async pushedAuthorizationRequest(params = {}, { clientAssertionPayload } = {}) {\n assertIssuerConfiguration(this.issuer, 'pushed_authorization_request_endpoint');\n\n const body = {\n ...('request' in params ? params : authorizationParams.call(this, params)),\n client_id: this.client_id,\n };\n\n const response = await authenticatedPost.call(\n this,\n 'pushed_authorization_request',\n {\n responseType: 'json',\n form: body,\n },\n { clientAssertionPayload, endpointAuthMethod: 'token' },\n );\n const responseBody = processResponse(response, { statusCode: 201 });\n\n if (!('expires_in' in responseBody)) {\n throw new RPError({\n message: 'expected expires_in in Pushed Authorization Successful Response',\n response,\n });\n }\n if (typeof responseBody.expires_in !== 'number') {\n throw new RPError({\n message: 'invalid expires_in value in Pushed Authorization Successful Response',\n response,\n });\n }\n if (!('request_uri' in responseBody)) {\n throw new RPError({\n message: 'expected request_uri in Pushed Authorization Successful Response',\n response,\n });\n }\n if (typeof responseBody.request_uri !== 'string') {\n throw new RPError({\n message: 'invalid request_uri value in Pushed Authorization Successful Response',\n response,\n });\n }\n\n return responseBody;\n }\n\n /**\n * @name issuer\n * @api public\n */\n static get issuer() {\n return issuer;\n }\n\n /**\n * @name issuer\n * @api public\n */\n get issuer() { // eslint-disable-line class-methods-use-this\n return issuer;\n }\n\n /* istanbul ignore next */\n [inspect.custom]() {\n return `${this.constructor.name} ${inspect(this.metadata, {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true,\n })}`;\n }\n};\n\n/**\n * @name validateJARM\n * @api private\n */\nasync function validateJARM(response) {\n const expectedAlg = this.authorization_signed_response_alg;\n const { payload } = await this.validateJWT(response, expectedAlg, ['iss', 'exp', 'aud']);\n return pickCb(payload);\n}\n\nObject.defineProperty(BaseClient.prototype, 'validateJARM', {\n enumerable: true,\n configurable: true,\n value(...args) {\n process.emitWarning(\n \"The JARM API implements an OIDF implementer's draft. Breaking draft implementations are included as minor versions of the openid-client library, therefore, the ~ semver operator should be used and close attention be payed to library changelog as well as the drafts themselves.\",\n 'DraftWarning',\n );\n Object.defineProperty(BaseClient.prototype, 'validateJARM', {\n enumerable: true,\n configurable: true,\n value: validateJARM,\n });\n return this.validateJARM(...args);\n },\n});\n\n/**\n * @name dpopProof\n * @api private\n */\nfunction dpopProof(payload, jwk, accessToken) {\n if (!isPlainObject(payload)) {\n throw new TypeError('payload must be a plain object');\n }\n\n let key;\n try {\n key = jose.JWK.asKey(jwk);\n assert(key.type === 'private');\n } catch (err) {\n throw new TypeError('\"DPoP\" option must be an asymmetric private key to sign the DPoP Proof JWT with');\n }\n\n let { alg } = key;\n\n if (!alg && this.issuer.dpop_signing_alg_values_supported) {\n const algs = key.algorithms('sign');\n alg = this.issuer.dpop_signing_alg_values_supported.find((a) => algs.has(a));\n }\n\n if (!alg) {\n [alg] = key.algorithms('sign');\n }\n\n return jose.JWS.sign({\n iat: now(),\n jti: random(),\n ath: accessToken ? base64url.encode(crypto.createHash('sha256').update(accessToken).digest()) : undefined,\n ...payload,\n }, jwk, {\n alg,\n typ: 'dpop+jwt',\n jwk: pick(key, 'kty', 'crv', 'x', 'y', 'e', 'n'),\n });\n}\n\nObject.defineProperty(BaseClient.prototype, 'dpopProof', {\n enumerable: true,\n configurable: true,\n value(...args) {\n process.emitWarning(\n 'The DPoP APIs implements an IETF draft (https://www.ietf.org/archive/id/draft-ietf-oauth-dpop-03.html). Breaking draft implementations are included as minor versions of the openid-client library, therefore, the ~ semver operator should be used and close attention be payed to library changelog as well as the drafts themselves.',\n 'DraftWarning',\n );\n Object.defineProperty(BaseClient.prototype, 'dpopProof', {\n enumerable: true,\n configurable: true,\n value: dpopProof,\n });\n return this.dpopProof(...args);\n },\n});\n\nmodule.exports.BaseClient = BaseClient;\n","/* eslint-disable camelcase */\nconst { inspect } = require('util');\n\nconst { RPError, OPError } = require('./errors');\nconst instance = require('./helpers/weak_cache');\nconst now = require('./helpers/unix_timestamp');\nconst { authenticatedPost } = require('./helpers/client');\nconst processResponse = require('./helpers/process_response');\nconst TokenSet = require('./token_set');\n\nclass DeviceFlowHandle {\n constructor({\n client, exchangeBody, clientAssertionPayload, response, maxAge, DPoP,\n }) {\n ['verification_uri', 'user_code', 'device_code'].forEach((prop) => {\n if (typeof response[prop] !== 'string' || !response[prop]) {\n throw new RPError(`expected ${prop} string to be returned by Device Authorization Response, got %j`, response[prop]);\n }\n });\n\n if (!Number.isSafeInteger(response.expires_in)) {\n throw new RPError('expected expires_in number to be returned by Device Authorization Response, got %j', response.expires_in);\n }\n\n instance(this).expires_at = now() + response.expires_in;\n instance(this).client = client;\n instance(this).DPoP = DPoP;\n instance(this).maxAge = maxAge;\n instance(this).exchangeBody = exchangeBody;\n instance(this).clientAssertionPayload = clientAssertionPayload;\n instance(this).response = response;\n instance(this).interval = response.interval * 1000 || 5000;\n }\n\n abort() {\n instance(this).aborted = true;\n }\n\n async poll({ signal } = {}) {\n if ((signal && signal.aborted) || instance(this).aborted) {\n throw new RPError('polling aborted');\n }\n\n if (this.expired()) {\n throw new RPError('the device code %j has expired and the device authorization session has concluded', this.device_code);\n }\n\n await new Promise((resolve) => setTimeout(resolve, instance(this).interval));\n\n const response = await authenticatedPost.call(\n instance(this).client,\n 'token',\n {\n form: {\n ...instance(this).exchangeBody,\n grant_type: 'urn:ietf:params:oauth:grant-type:device_code',\n device_code: this.device_code,\n },\n responseType: 'json',\n },\n { clientAssertionPayload: instance(this).clientAssertionPayload, DPoP: instance(this).DPoP },\n );\n\n let responseBody;\n try {\n responseBody = processResponse(response);\n } catch (err) {\n switch (err instanceof OPError && err.error) {\n case 'slow_down':\n instance(this).interval += 5000;\n case 'authorization_pending': // eslint-disable-line no-fallthrough\n return this.poll({ signal });\n default:\n throw err;\n }\n }\n\n const tokenset = new TokenSet(responseBody);\n\n if ('id_token' in tokenset) {\n await instance(this).client.decryptIdToken(tokenset);\n await instance(this).client.validateIdToken(tokenset, undefined, 'token', instance(this).maxAge);\n }\n\n return tokenset;\n }\n\n get device_code() {\n return instance(this).response.device_code;\n }\n\n get user_code() {\n return instance(this).response.user_code;\n }\n\n get verification_uri() {\n return instance(this).response.verification_uri;\n }\n\n get verification_uri_complete() {\n return instance(this).response.verification_uri_complete;\n }\n\n get expires_in() {\n return Math.max.apply(null, [instance(this).expires_at - now(), 0]);\n }\n\n expired() {\n return this.expires_in === 0;\n }\n\n /* istanbul ignore next */\n [inspect.custom]() {\n return `${this.constructor.name} ${inspect(instance(this).response, {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true,\n })}`;\n }\n}\n\nmodule.exports = DeviceFlowHandle;\n","/* eslint-disable camelcase */\nconst { format } = require('util');\n\nconst makeError = require('make-error');\n\nfunction OPError({\n error_description,\n error,\n error_uri,\n session_state,\n state,\n scope,\n}, response) {\n OPError.super.call(this, !error_description ? error : `${error} (${error_description})`);\n\n Object.assign(\n this,\n { error },\n (error_description && { error_description }),\n (error_uri && { error_uri }),\n (state && { state }),\n (scope && { scope }),\n (session_state && { session_state }),\n );\n\n if (response) {\n Object.defineProperty(this, 'response', {\n value: response,\n });\n }\n}\n\nmakeError(OPError);\n\nfunction RPError(...args) {\n if (typeof args[0] === 'string') {\n RPError.super.call(this, format(...args));\n } else {\n const {\n message, printf, response, ...rest\n } = args[0];\n if (printf) {\n RPError.super.call(this, format(...printf));\n } else {\n RPError.super.call(this, message);\n }\n Object.assign(this, rest);\n if (response) {\n Object.defineProperty(this, 'response', {\n value: response,\n });\n }\n }\n}\n\nmakeError(RPError);\n\nmodule.exports = {\n OPError,\n RPError,\n};\n","function assertSigningAlgValuesSupport(endpoint, issuer, properties) {\n if (!issuer[`${endpoint}_endpoint`]) return;\n\n const eam = `${endpoint}_endpoint_auth_method`;\n const easa = `${endpoint}_endpoint_auth_signing_alg`;\n const easavs = `${endpoint}_endpoint_auth_signing_alg_values_supported`;\n\n if (properties[eam] && properties[eam].endsWith('_jwt') && !properties[easa] && !issuer[easavs]) {\n throw new TypeError(`${easavs} must be configured on the issuer if ${easa} is not defined on a client`);\n }\n}\n\nfunction assertIssuerConfiguration(issuer, endpoint) {\n if (!issuer[endpoint]) {\n throw new TypeError(`${endpoint} must be configured on the issuer`);\n }\n}\n\nmodule.exports = {\n assertSigningAlgValuesSupport,\n assertIssuerConfiguration,\n};\n","let encode;\nif (Buffer.isEncoding('base64url')) {\n encode = (input, encoding = 'utf8') => Buffer.from(input, encoding).toString('base64url');\n} else {\n const fromBase64 = (base64) => base64.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n encode = (input, encoding = 'utf8') => fromBase64(Buffer.from(input, encoding).toString('base64'));\n}\n\nconst decode = (input) => Buffer.from(input, 'base64');\n\nmodule.exports.decode = decode;\nmodule.exports.encode = encode;\n","const jose = require('jose');\n\nconst { assertIssuerConfiguration } = require('./assert');\nconst { random } = require('./generators');\nconst now = require('./unix_timestamp');\nconst request = require('./request');\nconst instance = require('./weak_cache');\nconst merge = require('./merge');\n\nconst formUrlEncode = (value) => encodeURIComponent(value).replace(/%20/g, '+');\n\nasync function clientAssertion(endpoint, payload) {\n let alg = this[`${endpoint}_endpoint_auth_signing_alg`];\n if (!alg) {\n assertIssuerConfiguration(this.issuer, `${endpoint}_endpoint_auth_signing_alg_values_supported`);\n }\n\n if (this[`${endpoint}_endpoint_auth_method`] === 'client_secret_jwt') {\n const key = await this.joseSecret();\n\n if (!alg) {\n const supported = this.issuer[`${endpoint}_endpoint_auth_signing_alg_values_supported`];\n alg = Array.isArray(supported) && supported.find((signAlg) => key.algorithms('sign').has(signAlg));\n }\n\n return jose.JWS.sign(payload, key, { alg, typ: 'JWT' });\n }\n\n const keystore = instance(this).get('keystore');\n\n if (!keystore) {\n throw new TypeError('no client jwks provided for signing a client assertion with');\n }\n\n if (!alg) {\n const algs = new Set();\n\n keystore.all().forEach((key) => {\n key.algorithms('sign').forEach(Set.prototype.add.bind(algs));\n });\n\n const supported = this.issuer[`${endpoint}_endpoint_auth_signing_alg_values_supported`];\n alg = Array.isArray(supported) && supported.find((signAlg) => algs.has(signAlg));\n }\n\n const key = keystore.get({ alg, use: 'sig' });\n if (!key) {\n throw new TypeError(`no key found in client jwks to sign a client assertion with using alg ${alg}`);\n }\n return jose.JWS.sign(payload, key, { alg, typ: 'JWT', kid: key.kid.startsWith('DONOTUSE.') ? undefined : key.kid });\n}\n\nasync function authFor(endpoint, { clientAssertionPayload } = {}) {\n const authMethod = this[`${endpoint}_endpoint_auth_method`];\n switch (authMethod) {\n case 'self_signed_tls_client_auth':\n case 'tls_client_auth':\n case 'none':\n return { form: { client_id: this.client_id } };\n case 'client_secret_post':\n if (!this.client_secret) {\n throw new TypeError('client_secret_post client authentication method requires a client_secret');\n }\n return { form: { client_id: this.client_id, client_secret: this.client_secret } };\n case 'private_key_jwt':\n case 'client_secret_jwt': {\n const timestamp = now();\n\n const mTLS = endpoint === 'token' && this.tls_client_certificate_bound_access_tokens;\n const audience = [...new Set([\n this.issuer.issuer,\n this.issuer.token_endpoint,\n this.issuer[`${endpoint}_endpoint`],\n mTLS && this.issuer.mtls_endpoint_aliases\n ? this.issuer.mtls_endpoint_aliases.token_endpoint : undefined,\n ].filter(Boolean))];\n\n const assertion = await clientAssertion.call(this, endpoint, {\n iat: timestamp,\n exp: timestamp + 60,\n jti: random(),\n iss: this.client_id,\n sub: this.client_id,\n aud: audience,\n ...clientAssertionPayload,\n });\n\n return {\n form: {\n client_id: this.client_id,\n client_assertion: assertion,\n client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer',\n },\n };\n }\n default: { // client_secret_basic\n // This is correct behaviour, see https://tools.ietf.org/html/rfc6749#section-2.3.1 and the\n // related appendix. (also https://github.com/panva/node-openid-client/pull/91)\n // > The client identifier is encoded using the\n // > \"application/x-www-form-urlencoded\" encoding algorithm per\n // > Appendix B, and the encoded value is used as the username; the client\n // > password is encoded using the same algorithm and used as the\n // > password.\n if (!this.client_secret) {\n throw new TypeError('client_secret_basic client authentication method requires a client_secret');\n }\n const encoded = `${formUrlEncode(this.client_id)}:${formUrlEncode(this.client_secret)}`;\n const value = Buffer.from(encoded).toString('base64');\n return { headers: { Authorization: `Basic ${value}` } };\n }\n }\n}\n\nfunction resolveResponseType() {\n const { length, 0: value } = this.response_types;\n\n if (length === 1) {\n return value;\n }\n\n return undefined;\n}\n\nfunction resolveRedirectUri() {\n const { length, 0: value } = this.redirect_uris || [];\n\n if (length === 1) {\n return value;\n }\n\n return undefined;\n}\n\nasync function authenticatedPost(endpoint, opts, {\n clientAssertionPayload, endpointAuthMethod = endpoint, DPoP,\n} = {}) {\n const auth = await authFor.call(this, endpointAuthMethod, { clientAssertionPayload });\n const requestOpts = merge(opts, auth);\n\n const mTLS = this[`${endpointAuthMethod}_endpoint_auth_method`].includes('tls_client_auth')\n || (endpoint === 'token' && this.tls_client_certificate_bound_access_tokens);\n\n let targetUrl;\n if (mTLS && this.issuer.mtls_endpoint_aliases) {\n targetUrl = this.issuer.mtls_endpoint_aliases[`${endpoint}_endpoint`];\n }\n\n targetUrl = targetUrl || this.issuer[`${endpoint}_endpoint`];\n\n if ('form' in requestOpts) {\n for (const [key, value] of Object.entries(requestOpts.form)) { // eslint-disable-line no-restricted-syntax, max-len\n if (typeof value === 'undefined') {\n delete requestOpts.form[key];\n }\n }\n }\n\n return request.call(this, {\n ...requestOpts,\n method: 'POST',\n url: targetUrl,\n }, { mTLS, DPoP });\n}\n\nmodule.exports = {\n resolveResponseType,\n resolveRedirectUri,\n authFor,\n authenticatedPost,\n};\n","const OIDC_DISCOVERY = '/.well-known/openid-configuration';\nconst OAUTH2_DISCOVERY = '/.well-known/oauth-authorization-server';\nconst WEBFINGER = '/.well-known/webfinger';\nconst REL = 'http://openid.net/specs/connect/1.0/issuer';\nconst AAD_MULTITENANT_DISCOVERY = [\n `https://login.microsoftonline.com/common${OIDC_DISCOVERY}`,\n `https://login.microsoftonline.com/common/v2.0${OIDC_DISCOVERY}`,\n `https://login.microsoftonline.com/organizations/v2.0${OIDC_DISCOVERY}`,\n `https://login.microsoftonline.com/consumers/v2.0${OIDC_DISCOVERY}`,\n];\n\nconst CLIENT_DEFAULTS = {\n grant_types: ['authorization_code'],\n id_token_signed_response_alg: 'RS256',\n authorization_signed_response_alg: 'RS256',\n response_types: ['code'],\n token_endpoint_auth_method: 'client_secret_basic',\n};\n\nconst ISSUER_DEFAULTS = {\n claim_types_supported: ['normal'],\n claims_parameter_supported: false,\n grant_types_supported: ['authorization_code', 'implicit'],\n request_parameter_supported: false,\n request_uri_parameter_supported: true,\n require_request_uri_registration: false,\n response_modes_supported: ['query', 'fragment'],\n token_endpoint_auth_methods_supported: ['client_secret_basic'],\n};\n\nconst CALLBACK_PROPERTIES = [\n 'access_token', // 6749\n 'code', // 6749\n 'error', // 6749\n 'error_description', // 6749\n 'error_uri', // 6749\n 'expires_in', // 6749\n 'id_token', // Core 1.0\n 'state', // 6749\n 'token_type', // 6749\n 'session_state', // Session Management\n 'response', // JARM\n];\n\nconst JWT_CONTENT = /^application\\/jwt/;\n\nconst HTTP_OPTIONS = Symbol('openid-client.custom.http-options');\nconst CLOCK_TOLERANCE = Symbol('openid-client.custom.clock-tolerance');\n\nmodule.exports = {\n AAD_MULTITENANT_DISCOVERY,\n CALLBACK_PROPERTIES,\n CLIENT_DEFAULTS,\n CLOCK_TOLERANCE,\n HTTP_OPTIONS,\n ISSUER_DEFAULTS,\n JWT_CONTENT,\n OAUTH2_DISCOVERY,\n OIDC_DISCOVERY,\n REL,\n WEBFINGER,\n};\n","module.exports = (obj) => JSON.parse(JSON.stringify(obj));\n","/* eslint-disable no-restricted-syntax, no-continue */\n\nconst isPlainObject = require('./is_plain_object');\n\nfunction defaults(deep, target, ...sources) {\n for (const source of sources) {\n if (!isPlainObject(source)) {\n continue;\n }\n for (const [key, value] of Object.entries(source)) {\n /* istanbul ignore if */\n if (key === '__proto__' || key === 'constructor') {\n continue;\n }\n if (typeof target[key] === 'undefined' && typeof value !== 'undefined') {\n target[key] = value;\n }\n\n if (deep && isPlainObject(target[key]) && isPlainObject(value)) {\n defaults(true, target[key], value);\n }\n }\n }\n\n return target;\n}\n\nmodule.exports = defaults.bind(undefined, false);\nmodule.exports.deep = defaults.bind(undefined, true);\n","const { createHash, randomBytes } = require('crypto');\n\nconst base64url = require('./base64url');\n\nconst random = (bytes = 32) => base64url.encode(randomBytes(bytes));\n\nmodule.exports = {\n random,\n state: random,\n nonce: random,\n codeVerifier: random,\n codeChallenge: (codeVerifier) => base64url.encode(createHash('sha256').update(codeVerifier).digest()),\n};\n","const url = require('url');\nconst { strict: assert } = require('assert');\n\nmodule.exports = (target) => {\n try {\n const { protocol } = new url.URL(target);\n assert(protocol.match(/^(https?:)$/));\n return true;\n } catch (err) {\n throw new TypeError('only valid absolute URLs can be requested');\n }\n};\n","module.exports = (a) => !!a && a.constructor === Object;\n","/* eslint-disable no-restricted-syntax, no-param-reassign, no-continue */\n\nconst isPlainObject = require('./is_plain_object');\n\nfunction merge(target, ...sources) {\n for (const source of sources) {\n if (!isPlainObject(source)) {\n continue;\n }\n for (const [key, value] of Object.entries(source)) {\n /* istanbul ignore if */\n if (key === '__proto__' || key === 'constructor') {\n continue;\n }\n if (isPlainObject(target[key]) && isPlainObject(value)) {\n target[key] = merge(target[key], value);\n } else if (typeof value !== 'undefined') {\n target[key] = value;\n }\n }\n }\n\n return target;\n}\n\nmodule.exports = merge;\n","module.exports = function pick(object, ...paths) {\n const obj = {};\n for (const path of paths) { // eslint-disable-line no-restricted-syntax\n if (object[path]) {\n obj[path] = object[path];\n }\n }\n return obj;\n};\n","const { STATUS_CODES } = require('http');\nconst { format } = require('util');\n\nconst { OPError } = require('../errors');\n\nconst REGEXP = /(\\w+)=(\"[^\"]*\")/g;\nconst throwAuthenticateErrors = (response) => {\n const params = {};\n try {\n while ((REGEXP.exec(response.headers['www-authenticate'])) !== null) {\n if (RegExp.$1 && RegExp.$2) {\n params[RegExp.$1] = RegExp.$2.slice(1, -1);\n }\n }\n } catch (err) {}\n\n if (params.error) {\n throw new OPError(params, response);\n }\n};\n\nconst isStandardBodyError = (response) => {\n let result = false;\n try {\n let jsonbody;\n if (typeof response.body !== 'object' || Buffer.isBuffer(response.body)) {\n jsonbody = JSON.parse(response.body);\n } else {\n jsonbody = response.body;\n }\n result = typeof jsonbody.error === 'string' && jsonbody.error.length;\n if (result) response.body = jsonbody;\n } catch (err) {}\n\n return result;\n};\n\nfunction processResponse(response, { statusCode = 200, body = true, bearer = false } = {}) {\n if (response.statusCode !== statusCode) {\n if (bearer) {\n throwAuthenticateErrors(response);\n }\n\n if (isStandardBodyError(response)) {\n throw new OPError(response.body, response);\n }\n\n throw new OPError({\n error: format('expected %i %s, got: %i %s', statusCode, STATUS_CODES[statusCode], response.statusCode, STATUS_CODES[response.statusCode]),\n }, response);\n }\n\n if (body && !response.body) {\n throw new OPError({\n error: format('expected %i %s with body but no body was returned', statusCode, STATUS_CODES[statusCode]),\n }, response);\n }\n\n return response.body;\n}\n\nmodule.exports = processResponse;\n","const Got = require('got');\n\nconst pkg = require('../../package.json');\n\nconst { deep: defaultsDeep } = require('./defaults');\nconst isAbsoluteUrl = require('./is_absolute_url');\nconst { HTTP_OPTIONS } = require('./consts');\n\nlet DEFAULT_HTTP_OPTIONS;\nlet got;\n\nconst setDefaults = (options) => {\n DEFAULT_HTTP_OPTIONS = defaultsDeep({}, options, DEFAULT_HTTP_OPTIONS);\n got = Got.extend(DEFAULT_HTTP_OPTIONS);\n};\n\nsetDefaults({\n followRedirect: false,\n headers: { 'User-Agent': `${pkg.name}/${pkg.version} (${pkg.homepage})` },\n retry: 0,\n timeout: 3500,\n throwHttpErrors: false,\n});\n\nmodule.exports = async function request(options, { accessToken, mTLS = false, DPoP } = {}) {\n const { url } = options;\n isAbsoluteUrl(url);\n const optsFn = this[HTTP_OPTIONS];\n let opts = options;\n\n if (DPoP && 'dpopProof' in this) {\n opts.headers = opts.headers || {};\n opts.headers.DPoP = this.dpopProof({\n htu: url,\n htm: options.method,\n }, DPoP, accessToken);\n }\n\n if (optsFn) {\n opts = optsFn.call(this, defaultsDeep({}, opts, DEFAULT_HTTP_OPTIONS));\n }\n\n if (\n mTLS\n && (\n (!opts.key || !opts.cert)\n && (!opts.https || !((opts.https.key && opts.https.certificate) || opts.https.pfx))\n )\n ) {\n throw new TypeError('mutual-TLS certificate and key not set');\n }\n\n return got(opts);\n};\n\nmodule.exports.setDefaults = setDefaults;\n","module.exports = () => Math.floor(Date.now() / 1000);\n","const privateProps = new WeakMap();\n\nmodule.exports = (ctx) => {\n if (!privateProps.has(ctx)) {\n privateProps.set(ctx, new Map([['metadata', new Map()]]));\n }\n return privateProps.get(ctx);\n};\n","// Credit: https://github.com/rohe/pyoidc/blob/master/src/oic/utils/webfinger.py\n\n// -- Normalization --\n// A string of any other type is interpreted as a URI either the form of scheme\n// \"://\" authority path-abempty [ \"?\" query ] [ \"#\" fragment ] or authority\n// path-abempty [ \"?\" query ] [ \"#\" fragment ] per RFC 3986 [RFC3986] and is\n// normalized according to the following rules:\n//\n// If the user input Identifier does not have an RFC 3986 [RFC3986] scheme\n// portion, the string is interpreted as [userinfo \"@\"] host [\":\" port]\n// path-abempty [ \"?\" query ] [ \"#\" fragment ] per RFC 3986 [RFC3986].\n// If the userinfo component is present and all of the path component, query\n// component, and port component are empty, the acct scheme is assumed. In this\n// case, the normalized URI is formed by prefixing acct: to the string as the\n// scheme. Per the 'acct' URI Scheme [I‑D.ietf‑appsawg‑acct‑uri], if there is an\n// at-sign character ('@') in the userinfo component, it needs to be\n// percent-encoded as described in RFC 3986 [RFC3986].\n// For all other inputs without a scheme portion, the https scheme is assumed,\n// and the normalized URI is formed by prefixing https:// to the string as the\n// scheme.\n// If the resulting URI contains a fragment portion, it MUST be stripped off\n// together with the fragment delimiter character \"#\".\n// The WebFinger [I‑D.ietf‑appsawg‑webfinger] Resource in this case is the\n// resulting URI, and the WebFinger Host is the authority component.\n//\n// Note: Since the definition of authority in RFC 3986 [RFC3986] is\n// [ userinfo \"@\" ] host [ \":\" port ], it is legal to have a user input\n// identifier like userinfo@host:port, e.g., alice@example.com:8080.\n\nconst PORT = /^\\d+$/;\n\nfunction hasScheme(input) {\n if (input.includes('://')) return true;\n\n const authority = input.replace(/(\\/|\\?)/g, '#').split('#')[0];\n if (authority.includes(':')) {\n const index = authority.indexOf(':');\n const hostOrPort = authority.slice(index + 1);\n if (!PORT.test(hostOrPort)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction acctSchemeAssumed(input) {\n if (!input.includes('@')) return false;\n const parts = input.split('@');\n const host = parts[parts.length - 1];\n return !(host.includes(':') || host.includes('/') || host.includes('?'));\n}\n\nfunction normalize(input) {\n if (typeof input !== 'string') {\n throw new TypeError('input must be a string');\n }\n\n let output;\n if (hasScheme(input)) {\n output = input;\n } else if (acctSchemeAssumed(input)) {\n output = `acct:${input}`;\n } else {\n output = `https://${input}`;\n }\n\n return output.split('#')[0];\n}\n\nmodule.exports = normalize;\n","const Issuer = require('./issuer');\nconst { OPError, RPError } = require('./errors');\nconst Registry = require('./issuer_registry');\nconst Strategy = require('./passport_strategy');\nconst TokenSet = require('./token_set');\nconst { CLOCK_TOLERANCE, HTTP_OPTIONS } = require('./helpers/consts');\nconst generators = require('./helpers/generators');\nconst { setDefaults } = require('./helpers/request');\n\nmodule.exports = {\n Issuer,\n Registry,\n Strategy,\n TokenSet,\n errors: {\n OPError,\n RPError,\n },\n custom: {\n setHttpOptionsDefaults: setDefaults,\n http_options: HTTP_OPTIONS,\n clock_tolerance: CLOCK_TOLERANCE,\n },\n generators,\n};\n","/* eslint-disable max-classes-per-file */\n\nconst { inspect } = require('util');\nconst url = require('url');\n\nconst AggregateError = require('aggregate-error');\nconst jose = require('jose');\nconst LRU = require('lru-cache');\nconst objectHash = require('object-hash');\n\nconst { RPError } = require('./errors');\nconst getClient = require('./client');\nconst registry = require('./issuer_registry');\nconst processResponse = require('./helpers/process_response');\nconst webfingerNormalize = require('./helpers/webfinger_normalize');\nconst instance = require('./helpers/weak_cache');\nconst request = require('./helpers/request');\nconst { assertIssuerConfiguration } = require('./helpers/assert');\nconst {\n ISSUER_DEFAULTS, OIDC_DISCOVERY, OAUTH2_DISCOVERY, WEBFINGER, REL, AAD_MULTITENANT_DISCOVERY,\n} = require('./helpers/consts');\n\nconst AAD_MULTITENANT = Symbol('AAD_MULTITENANT');\n\nclass Issuer {\n /**\n * @name constructor\n * @api public\n */\n constructor(meta = {}) {\n const aadIssValidation = meta[AAD_MULTITENANT];\n delete meta[AAD_MULTITENANT];\n\n ['introspection', 'revocation'].forEach((endpoint) => {\n // if intro/revocation endpoint auth specific meta is missing use the token ones if they\n // are defined\n if (\n meta[`${endpoint}_endpoint`]\n && meta[`${endpoint}_endpoint_auth_methods_supported`] === undefined\n && meta[`${endpoint}_endpoint_auth_signing_alg_values_supported`] === undefined\n ) {\n if (meta.token_endpoint_auth_methods_supported) {\n meta[`${endpoint}_endpoint_auth_methods_supported`] = meta.token_endpoint_auth_methods_supported;\n }\n if (meta.token_endpoint_auth_signing_alg_values_supported) {\n meta[`${endpoint}_endpoint_auth_signing_alg_values_supported`] = meta.token_endpoint_auth_signing_alg_values_supported;\n }\n }\n });\n\n Object.entries(meta).forEach(([key, value]) => {\n instance(this).get('metadata').set(key, value);\n if (!this[key]) {\n Object.defineProperty(this, key, {\n get() { return instance(this).get('metadata').get(key); },\n enumerable: true,\n });\n }\n });\n\n instance(this).set('cache', new LRU({ max: 100 }));\n\n registry.set(this.issuer, this);\n\n const Client = getClient(this, aadIssValidation);\n\n Object.defineProperties(this, {\n Client: { value: Client },\n FAPIClient: { value: class FAPIClient extends Client {} },\n });\n }\n\n /**\n * @name keystore\n * @api public\n */\n async keystore(reload = false) {\n assertIssuerConfiguration(this, 'jwks_uri');\n\n const keystore = instance(this).get('keystore');\n const cache = instance(this).get('cache');\n\n if (reload || !keystore) {\n cache.reset();\n const response = await request.call(this, {\n method: 'GET',\n responseType: 'json',\n url: this.jwks_uri,\n });\n const jwks = processResponse(response);\n\n const joseKeyStore = jose.JWKS.asKeyStore(jwks, { ignoreErrors: true });\n cache.set('throttle', true, 60 * 1000);\n instance(this).set('keystore', joseKeyStore);\n return joseKeyStore;\n }\n\n return keystore;\n }\n\n /**\n * @name queryKeyStore\n * @api private\n */\n async queryKeyStore({\n kid, kty, alg, use, key_ops: ops,\n }, { allowMulti = false } = {}) {\n const cache = instance(this).get('cache');\n\n const def = {\n kid, kty, alg, use, key_ops: ops,\n };\n\n const defHash = objectHash(def, {\n algorithm: 'sha256',\n ignoreUnknown: true,\n unorderedArrays: true,\n unorderedSets: true,\n });\n\n // refresh keystore on every unknown key but also only upto once every minute\n const freshJwksUri = cache.get(defHash) || cache.get('throttle');\n\n const keystore = await this.keystore(!freshJwksUri);\n const keys = keystore.all(def);\n\n if (keys.length === 0) {\n throw new RPError({\n printf: [\"no valid key found in issuer's jwks_uri for key parameters %j\", def],\n jwks: keystore,\n });\n }\n\n if (!allowMulti && keys.length > 1 && !kid) {\n throw new RPError({\n printf: [\"multiple matching keys found in issuer's jwks_uri for key parameters %j, kid must be provided in this case\", def],\n jwks: keystore,\n });\n }\n\n cache.set(defHash, true);\n\n return new jose.JWKS.KeyStore(keys);\n }\n\n /**\n * @name metadata\n * @api public\n */\n get metadata() {\n const copy = {};\n instance(this).get('metadata').forEach((value, key) => {\n copy[key] = value;\n });\n return copy;\n }\n\n /**\n * @name webfinger\n * @api public\n */\n static async webfinger(input) {\n const resource = webfingerNormalize(input);\n const { host } = url.parse(resource);\n const webfingerUrl = `https://${host}${WEBFINGER}`;\n\n const response = await request.call(this, {\n method: 'GET',\n url: webfingerUrl,\n responseType: 'json',\n searchParams: { resource, rel: REL },\n followRedirect: true,\n });\n const body = processResponse(response);\n\n const location = Array.isArray(body.links) && body.links.find((link) => typeof link === 'object' && link.rel === REL && link.href);\n\n if (!location) {\n throw new RPError({\n message: 'no issuer found in webfinger response',\n body,\n });\n }\n\n if (typeof location.href !== 'string' || !location.href.startsWith('https://')) {\n throw new RPError({\n printf: ['invalid issuer location %s', location.href],\n body,\n });\n }\n\n const expectedIssuer = location.href;\n if (registry.has(expectedIssuer)) {\n return registry.get(expectedIssuer);\n }\n\n const issuer = await this.discover(expectedIssuer);\n\n if (issuer.issuer !== expectedIssuer) {\n registry.delete(issuer.issuer);\n throw new RPError('discovered issuer mismatch, expected %s, got: %s', expectedIssuer, issuer.issuer);\n }\n return issuer;\n }\n\n /**\n * @name discover\n * @api public\n */\n static async discover(uri) {\n const parsed = url.parse(uri);\n\n if (parsed.pathname.includes('/.well-known/')) {\n const response = await request.call(this, {\n method: 'GET',\n responseType: 'json',\n url: uri,\n });\n const body = processResponse(response);\n return new Issuer({\n ...ISSUER_DEFAULTS,\n ...body,\n [AAD_MULTITENANT]: !!AAD_MULTITENANT_DISCOVERY.find(\n (discoveryURL) => uri.startsWith(discoveryURL),\n ),\n });\n }\n\n const pathnames = [];\n if (parsed.pathname.endsWith('/')) {\n pathnames.push(`${parsed.pathname}${OIDC_DISCOVERY.substring(1)}`);\n } else {\n pathnames.push(`${parsed.pathname}${OIDC_DISCOVERY}`);\n }\n if (parsed.pathname === '/') {\n pathnames.push(`${OAUTH2_DISCOVERY}`);\n } else {\n pathnames.push(`${OAUTH2_DISCOVERY}${parsed.pathname}`);\n }\n\n const errors = [];\n // eslint-disable-next-line no-restricted-syntax\n for (const pathname of pathnames) {\n try {\n const wellKnownUri = url.format({ ...parsed, pathname });\n // eslint-disable-next-line no-await-in-loop\n const response = await request.call(this, {\n method: 'GET',\n responseType: 'json',\n url: wellKnownUri,\n });\n const body = processResponse(response);\n return new Issuer({\n ...ISSUER_DEFAULTS,\n ...body,\n [AAD_MULTITENANT]: !!AAD_MULTITENANT_DISCOVERY.find(\n (discoveryURL) => wellKnownUri.startsWith(discoveryURL),\n ),\n });\n } catch (err) {\n errors.push(err);\n }\n }\n\n const err = new AggregateError(errors);\n err.message = `Issuer.discover() failed.${err.message.split('\\n')\n .filter((line) => !line.startsWith(' at')).join('\\n')}`;\n throw err;\n }\n\n /* istanbul ignore next */\n [inspect.custom]() {\n return `${this.constructor.name} ${inspect(this.metadata, {\n depth: Infinity,\n colors: process.stdout.isTTY,\n compact: false,\n sorted: true,\n })}`;\n }\n}\n\nmodule.exports = Issuer;\n","const REGISTRY = new Map();\n\nmodule.exports = REGISTRY;\n","/* eslint-disable no-underscore-dangle */\n\nconst url = require('url');\nconst { format } = require('util');\n\nconst cloneDeep = require('./helpers/deep_clone');\nconst { RPError, OPError } = require('./errors');\nconst { BaseClient } = require('./client');\nconst { random, codeChallenge } = require('./helpers/generators');\nconst pick = require('./helpers/pick');\nconst { resolveResponseType, resolveRedirectUri } = require('./helpers/client');\n\nfunction verified(err, user, info = {}) {\n if (err) {\n this.error(err);\n } else if (!user) {\n this.fail(info);\n } else {\n this.success(user, info);\n }\n}\n\n/**\n * @name constructor\n * @api public\n */\nfunction OpenIDConnectStrategy({\n client,\n params = {},\n passReqToCallback = false,\n sessionKey,\n usePKCE = true,\n extras = {},\n} = {}, verify) {\n if (!(client instanceof BaseClient)) {\n throw new TypeError('client must be an instance of openid-client Client');\n }\n\n if (typeof verify !== 'function') {\n throw new TypeError('verify callback must be a function');\n }\n\n if (!client.issuer || !client.issuer.issuer) {\n throw new TypeError('client must have an issuer with an identifier');\n }\n\n this._client = client;\n this._issuer = client.issuer;\n this._verify = verify;\n this._passReqToCallback = passReqToCallback;\n this._usePKCE = usePKCE;\n this._key = sessionKey || `oidc:${url.parse(this._issuer.issuer).hostname}`;\n this._params = cloneDeep(params);\n this._extras = cloneDeep(extras);\n\n if (!this._params.response_type) this._params.response_type = resolveResponseType.call(client);\n if (!this._params.redirect_uri) this._params.redirect_uri = resolveRedirectUri.call(client);\n if (!this._params.scope) this._params.scope = 'openid';\n\n if (this._usePKCE === true) {\n const supportedMethods = Array.isArray(this._issuer.code_challenge_methods_supported)\n ? this._issuer.code_challenge_methods_supported : false;\n\n if (supportedMethods && supportedMethods.includes('S256')) {\n this._usePKCE = 'S256';\n } else if (supportedMethods && supportedMethods.includes('plain')) {\n this._usePKCE = 'plain';\n } else if (supportedMethods) {\n throw new TypeError('neither code_challenge_method supported by the client is supported by the issuer');\n } else {\n this._usePKCE = 'S256';\n }\n } else if (typeof this._usePKCE === 'string' && !['plain', 'S256'].includes(this._usePKCE)) {\n throw new TypeError(`${this._usePKCE} is not valid/implemented PKCE code_challenge_method`);\n }\n\n this.name = url.parse(client.issuer.issuer).hostname;\n}\n\nOpenIDConnectStrategy.prototype.authenticate = function authenticate(req, options) {\n (async () => {\n const client = this._client;\n if (!req.session) {\n throw new TypeError('authentication requires session support');\n }\n const reqParams = client.callbackParams(req);\n const sessionKey = this._key;\n\n /* start authentication request */\n if (Object.keys(reqParams).length === 0) {\n // provide options object with extra authentication parameters\n const params = {\n state: random(),\n ...this._params,\n ...options,\n };\n\n if (!params.nonce && params.response_type.includes('id_token')) {\n params.nonce = random();\n }\n\n req.session[sessionKey] = pick(params, 'nonce', 'state', 'max_age', 'response_type');\n\n if (this._usePKCE && params.response_type.includes('code')) {\n const verifier = random();\n req.session[sessionKey].code_verifier = verifier;\n\n switch (this._usePKCE) { // eslint-disable-line default-case\n case 'S256':\n params.code_challenge = codeChallenge(verifier);\n params.code_challenge_method = 'S256';\n break;\n case 'plain':\n params.code_challenge = verifier;\n break;\n }\n }\n\n this.redirect(client.authorizationUrl(params));\n return;\n }\n /* end authentication request */\n\n /* start authentication response */\n\n const session = req.session[sessionKey];\n if (Object.keys(session || {}).length === 0) {\n throw new Error(format('did not find expected authorization request details in session, req.session[\"%s\"] is %j', sessionKey, session));\n }\n\n const {\n state, nonce, max_age: maxAge, code_verifier: codeVerifier, response_type: responseType,\n } = session;\n\n try {\n delete req.session[sessionKey];\n } catch (err) {}\n\n const opts = {\n redirect_uri: this._params.redirect_uri,\n ...options,\n };\n\n const checks = {\n state,\n nonce,\n max_age: maxAge,\n code_verifier: codeVerifier,\n response_type: responseType,\n };\n\n const tokenset = await client.callback(opts.redirect_uri, reqParams, checks, this._extras);\n\n const passReq = this._passReqToCallback;\n const loadUserinfo = this._verify.length > (passReq ? 3 : 2) && client.issuer.userinfo_endpoint;\n\n const args = [tokenset, verified.bind(this)];\n\n if (loadUserinfo) {\n if (!tokenset.access_token) {\n throw new RPError({\n message: 'expected access_token to be returned when asking for userinfo in verify callback',\n tokenset,\n });\n }\n const userinfo = await client.userinfo(tokenset);\n args.splice(1, 0, userinfo);\n }\n\n if (passReq) {\n args.unshift(req);\n }\n\n this._verify(...args);\n /* end authentication response */\n })().catch((error) => {\n if (\n (error instanceof OPError && error.error !== 'server_error' && !error.error.startsWith('invalid'))\n || error instanceof RPError\n ) {\n this.fail(error);\n } else {\n this.error(error);\n }\n });\n};\n\nmodule.exports = OpenIDConnectStrategy;\n","const base64url = require('./helpers/base64url');\nconst now = require('./helpers/unix_timestamp');\n\nclass TokenSet {\n /**\n * @name constructor\n * @api public\n */\n constructor(values) {\n Object.assign(this, values);\n }\n\n /**\n * @name expires_in=\n * @api public\n */\n set expires_in(value) { // eslint-disable-line camelcase\n this.expires_at = now() + Number(value);\n }\n\n /**\n * @name expires_in\n * @api public\n */\n get expires_in() { // eslint-disable-line camelcase\n return Math.max.apply(null, [this.expires_at - now(), 0]);\n }\n\n /**\n * @name expired\n * @api public\n */\n expired() {\n return this.expires_in === 0;\n }\n\n /**\n * @name claims\n * @api public\n */\n claims() {\n if (!this.id_token) {\n throw new TypeError('id_token not present in TokenSet');\n }\n\n return JSON.parse(base64url.decode(this.id_token.split('.')[1]));\n }\n}\n\nmodule.exports = TokenSet;\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\n/* global global, define, System, Reflect, Promise */\r\nvar __extends;\r\nvar __assign;\r\nvar __rest;\r\nvar __decorate;\r\nvar __param;\r\nvar __metadata;\r\nvar __awaiter;\r\nvar __generator;\r\nvar __exportStar;\r\nvar __values;\r\nvar __read;\r\nvar __spread;\r\nvar __spreadArrays;\r\nvar __await;\r\nvar __asyncGenerator;\r\nvar __asyncDelegator;\r\nvar __asyncValues;\r\nvar __makeTemplateObject;\r\nvar __importStar;\r\nvar __importDefault;\r\nvar __classPrivateFieldGet;\r\nvar __classPrivateFieldSet;\r\nvar __createBinding;\r\n(function (factory) {\r\n var root = typeof global === \"object\" ? global : typeof self === \"object\" ? self : typeof this === \"object\" ? this : {};\r\n if (typeof define === \"function\" && define.amd) {\r\n define(\"tslib\", [\"exports\"], function (exports) { factory(createExporter(root, createExporter(exports))); });\r\n }\r\n else if (typeof module === \"object\" && typeof module.exports === \"object\") {\r\n factory(createExporter(root, createExporter(module.exports)));\r\n }\r\n else {\r\n factory(createExporter(root));\r\n }\r\n function createExporter(exports, previous) {\r\n if (exports !== root) {\r\n if (typeof Object.create === \"function\") {\r\n Object.defineProperty(exports, \"__esModule\", { value: true });\r\n }\r\n else {\r\n exports.__esModule = true;\r\n }\r\n }\r\n return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };\r\n }\r\n})\r\n(function (exporter) {\r\n var extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n\r\n __extends = function (d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n };\r\n\r\n __assign = Object.assign || function (t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n\r\n __rest = function (s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n };\r\n\r\n __decorate = function (decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __createBinding = function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n };\r\n\r\n __exportStar = function (m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n };\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n 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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result[\"default\"] = mod;\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n});\r\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nconst REGEX_IS_INSTALLATION_LEGACY = /^v1\\./;\nconst REGEX_IS_INSTALLATION = /^ghs_/;\nconst REGEX_IS_USER_TO_SERVER = /^ghu_/;\nasync function auth(token) {\n const isApp = token.split(/\\./).length === 3;\n const isInstallation = REGEX_IS_INSTALLATION_LEGACY.test(token) || REGEX_IS_INSTALLATION.test(token);\n const isUserToServer = REGEX_IS_USER_TO_SERVER.test(token);\n const tokenType = isApp ? \"app\" : isInstallation ? \"installation\" : isUserToServer ? \"user-to-server\" : \"oauth\";\n return {\n type: \"token\",\n token: token,\n tokenType\n };\n}\n\n/**\n * Prefix token for usage in the Authorization header\n *\n * @param token OAuth token or JSON Web Token\n */\nfunction withAuthorizationPrefix(token) {\n if (token.split(/\\./).length === 3) {\n return `bearer ${token}`;\n }\n\n return `token ${token}`;\n}\n\nasync function hook(token, request, route, parameters) {\n const endpoint = request.endpoint.merge(route, parameters);\n endpoint.headers.authorization = withAuthorizationPrefix(token);\n return request(endpoint);\n}\n\nconst createTokenAuth = function createTokenAuth(token) {\n if (!token) {\n throw new Error(\"[@octokit/auth-token] No token passed to createTokenAuth\");\n }\n\n if (typeof token !== \"string\") {\n throw new Error(\"[@octokit/auth-token] Token passed to createTokenAuth is not a string\");\n }\n\n token = token.replace(/^(token|bearer) +/i, \"\");\n return Object.assign(auth.bind(null, token), {\n hook: hook.bind(null, token)\n });\n};\n\nexports.createTokenAuth = createTokenAuth;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar universalUserAgent = require('universal-user-agent');\nvar beforeAfterHook = require('before-after-hook');\nvar request = require('@octokit/request');\nvar graphql = require('@octokit/graphql');\nvar authToken = require('@octokit/auth-token');\n\nfunction _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}\n\nfunction _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n\n var target = _objectWithoutPropertiesLoose(source, excluded);\n\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\nconst VERSION = \"3.6.0\";\n\nconst _excluded = [\"authStrategy\"];\nclass Octokit {\n constructor(options = {}) {\n const hook = new beforeAfterHook.Collection();\n const requestDefaults = {\n baseUrl: request.request.endpoint.DEFAULTS.baseUrl,\n headers: {},\n request: Object.assign({}, options.request, {\n // @ts-ignore internal usage only, no need to type\n hook: hook.bind(null, \"request\")\n }),\n mediaType: {\n previews: [],\n format: \"\"\n }\n }; // prepend default user agent with `options.userAgent` if set\n\n requestDefaults.headers[\"user-agent\"] = [options.userAgent, `octokit-core.js/${VERSION} ${universalUserAgent.getUserAgent()}`].filter(Boolean).join(\" \");\n\n if (options.baseUrl) {\n requestDefaults.baseUrl = options.baseUrl;\n }\n\n if (options.previews) {\n requestDefaults.mediaType.previews = options.previews;\n }\n\n if (options.timeZone) {\n requestDefaults.headers[\"time-zone\"] = options.timeZone;\n }\n\n this.request = request.request.defaults(requestDefaults);\n this.graphql = graphql.withCustomRequest(this.request).defaults(requestDefaults);\n this.log = Object.assign({\n debug: () => {},\n info: () => {},\n warn: console.warn.bind(console),\n error: console.error.bind(console)\n }, options.log);\n this.hook = hook; // (1) If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance\n // is unauthenticated. The `this.auth()` method is a no-op and no request hook is registered.\n // (2) If only `options.auth` is set, use the default token authentication strategy.\n // (3) If `options.authStrategy` is set then use it and pass in `options.auth`. Always pass own request as many strategies accept a custom request instance.\n // TODO: type `options.auth` based on `options.authStrategy`.\n\n if (!options.authStrategy) {\n if (!options.auth) {\n // (1)\n this.auth = async () => ({\n type: \"unauthenticated\"\n });\n } else {\n // (2)\n const auth = authToken.createTokenAuth(options.auth); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n }\n } else {\n const {\n authStrategy\n } = options,\n otherOptions = _objectWithoutProperties(options, _excluded);\n\n const auth = authStrategy(Object.assign({\n request: this.request,\n log: this.log,\n // we pass the current octokit instance as well as its constructor options\n // to allow for authentication strategies that return a new octokit instance\n // that shares the same internal state as the current one. The original\n // requirement for this was the \"event-octokit\" authentication strategy\n // of https://github.com/probot/octokit-auth-probot.\n octokit: this,\n octokitOptions: otherOptions\n }, options.auth)); // @ts-ignore ¯\\_(ツ)_/¯\n\n hook.wrap(\"request\", auth.hook);\n this.auth = auth;\n } // apply plugins\n // https://stackoverflow.com/a/16345172\n\n\n const classConstructor = this.constructor;\n classConstructor.plugins.forEach(plugin => {\n Object.assign(this, plugin(this, options));\n });\n }\n\n static defaults(defaults) {\n const OctokitWithDefaults = class extends this {\n constructor(...args) {\n const options = args[0] || {};\n\n if (typeof defaults === \"function\") {\n super(defaults(options));\n return;\n }\n\n super(Object.assign({}, defaults, options, options.userAgent && defaults.userAgent ? {\n userAgent: `${options.userAgent} ${defaults.userAgent}`\n } : null));\n }\n\n };\n return OctokitWithDefaults;\n }\n /**\n * Attach a plugin (or many) to your Octokit instance.\n *\n * @example\n * const API = Octokit.plugin(plugin1, plugin2, plugin3, ...)\n */\n\n\n static plugin(...newPlugins) {\n var _a;\n\n const currentPlugins = this.plugins;\n const NewOctokit = (_a = class extends this {}, _a.plugins = currentPlugins.concat(newPlugins.filter(plugin => !currentPlugins.includes(plugin))), _a);\n return NewOctokit;\n }\n\n}\nOctokit.VERSION = VERSION;\nOctokit.plugins = [];\n\nexports.Octokit = Octokit;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar isPlainObject = require('is-plain-object');\nvar universalUserAgent = require('universal-user-agent');\n\nfunction lowercaseKeys(object) {\n if (!object) {\n return {};\n }\n\n return Object.keys(object).reduce((newObj, key) => {\n newObj[key.toLowerCase()] = object[key];\n return newObj;\n }, {});\n}\n\nfunction mergeDeep(defaults, options) {\n const result = Object.assign({}, defaults);\n Object.keys(options).forEach(key => {\n if (isPlainObject.isPlainObject(options[key])) {\n if (!(key in defaults)) Object.assign(result, {\n [key]: options[key]\n });else result[key] = mergeDeep(defaults[key], options[key]);\n } else {\n Object.assign(result, {\n [key]: options[key]\n });\n }\n });\n return result;\n}\n\nfunction removeUndefinedProperties(obj) {\n for (const key in obj) {\n if (obj[key] === undefined) {\n delete obj[key];\n }\n }\n\n return obj;\n}\n\nfunction merge(defaults, route, options) {\n if (typeof route === \"string\") {\n let [method, url] = route.split(\" \");\n options = Object.assign(url ? {\n method,\n url\n } : {\n url: method\n }, options);\n } else {\n options = Object.assign({}, route);\n } // lowercase header names before merging with defaults to avoid duplicates\n\n\n options.headers = lowercaseKeys(options.headers); // remove properties with undefined values before merging\n\n removeUndefinedProperties(options);\n removeUndefinedProperties(options.headers);\n const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten\n\n if (defaults && defaults.mediaType.previews.length) {\n mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);\n }\n\n mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, \"\"));\n return mergedOptions;\n}\n\nfunction addQueryParameters(url, parameters) {\n const separator = /\\?/.test(url) ? \"&\" : \"?\";\n const names = Object.keys(parameters);\n\n if (names.length === 0) {\n return url;\n }\n\n return url + separator + names.map(name => {\n if (name === \"q\") {\n return \"q=\" + parameters.q.split(\"+\").map(encodeURIComponent).join(\"+\");\n }\n\n return `${name}=${encodeURIComponent(parameters[name])}`;\n }).join(\"&\");\n}\n\nconst urlVariableRegex = /\\{[^}]+\\}/g;\n\nfunction removeNonChars(variableName) {\n return variableName.replace(/^\\W+|\\W+$/g, \"\").split(/,/);\n}\n\nfunction extractUrlVariableNames(url) {\n const matches = url.match(urlVariableRegex);\n\n if (!matches) {\n return [];\n }\n\n return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);\n}\n\nfunction omit(object, keysToOmit) {\n return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {\n obj[key] = object[key];\n return obj;\n }, {});\n}\n\n// Based on https://github.com/bramstein/url-template, licensed under BSD\n// TODO: create separate package.\n//\n// Copyright (c) 2012-2014, Bram Stein\n// All rights reserved.\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions\n// are met:\n// 1. Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// 2. Redistributions in binary form must reproduce the above copyright\n// notice, this list of conditions and the following disclaimer in the\n// documentation and/or other materials provided with the distribution.\n// 3. The name of the author may not be used to endorse or promote products\n// derived from this software without specific prior written permission.\n// THIS SOFTWARE IS PROVIDED BY THE AUTHOR \"AS IS\" AND ANY EXPRESS OR IMPLIED\n// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n// EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n// INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY\n// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n/* istanbul ignore file */\nfunction encodeReserved(str) {\n return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {\n if (!/%[0-9A-Fa-f]/.test(part)) {\n part = encodeURI(part).replace(/%5B/g, \"[\").replace(/%5D/g, \"]\");\n }\n\n return part;\n }).join(\"\");\n}\n\nfunction encodeUnreserved(str) {\n return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {\n return \"%\" + c.charCodeAt(0).toString(16).toUpperCase();\n });\n}\n\nfunction encodeValue(operator, value, key) {\n value = operator === \"+\" || operator === \"#\" ? encodeReserved(value) : encodeUnreserved(value);\n\n if (key) {\n return encodeUnreserved(key) + \"=\" + value;\n } else {\n return value;\n }\n}\n\nfunction isDefined(value) {\n return value !== undefined && value !== null;\n}\n\nfunction isKeyOperator(operator) {\n return operator === \";\" || operator === \"&\" || operator === \"?\";\n}\n\nfunction getValues(context, operator, key, modifier) {\n var value = context[key],\n result = [];\n\n if (isDefined(value) && value !== \"\") {\n if (typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\") {\n value = value.toString();\n\n if (modifier && modifier !== \"*\") {\n value = value.substring(0, parseInt(modifier, 10));\n }\n\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n } else {\n if (modifier === \"*\") {\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : \"\"));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n result.push(encodeValue(operator, value[k], k));\n }\n });\n }\n } else {\n const tmp = [];\n\n if (Array.isArray(value)) {\n value.filter(isDefined).forEach(function (value) {\n tmp.push(encodeValue(operator, value));\n });\n } else {\n Object.keys(value).forEach(function (k) {\n if (isDefined(value[k])) {\n tmp.push(encodeUnreserved(k));\n tmp.push(encodeValue(operator, value[k].toString()));\n }\n });\n }\n\n if (isKeyOperator(operator)) {\n result.push(encodeUnreserved(key) + \"=\" + tmp.join(\",\"));\n } else if (tmp.length !== 0) {\n result.push(tmp.join(\",\"));\n }\n }\n }\n } else {\n if (operator === \";\") {\n if (isDefined(value)) {\n result.push(encodeUnreserved(key));\n }\n } else if (value === \"\" && (operator === \"&\" || operator === \"?\")) {\n result.push(encodeUnreserved(key) + \"=\");\n } else if (value === \"\") {\n result.push(\"\");\n }\n }\n\n return result;\n}\n\nfunction parseUrl(template) {\n return {\n expand: expand.bind(null, template)\n };\n}\n\nfunction expand(template, context) {\n var operators = [\"+\", \"#\", \".\", \"/\", \";\", \"?\", \"&\"];\n return template.replace(/\\{([^\\{\\}]+)\\}|([^\\{\\}]+)/g, function (_, expression, literal) {\n if (expression) {\n let operator = \"\";\n const values = [];\n\n if (operators.indexOf(expression.charAt(0)) !== -1) {\n operator = expression.charAt(0);\n expression = expression.substr(1);\n }\n\n expression.split(/,/g).forEach(function (variable) {\n var tmp = /([^:\\*]*)(?::(\\d+)|(\\*))?/.exec(variable);\n values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));\n });\n\n if (operator && operator !== \"+\") {\n var separator = \",\";\n\n if (operator === \"?\") {\n separator = \"&\";\n } else if (operator !== \"#\") {\n separator = operator;\n }\n\n return (values.length !== 0 ? operator : \"\") + values.join(separator);\n } else {\n return values.join(\",\");\n }\n } else {\n return encodeReserved(literal);\n }\n });\n}\n\nfunction parse(options) {\n // https://fetch.spec.whatwg.org/#methods\n let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible\n\n let url = (options.url || \"/\").replace(/:([a-z]\\w+)/g, \"{$1}\");\n let headers = Object.assign({}, options.headers);\n let body;\n let parameters = omit(options, [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"mediaType\"]); // extract variable names from URL to calculate remaining variables later\n\n const urlVariableNames = extractUrlVariableNames(url);\n url = parseUrl(url).expand(parameters);\n\n if (!/^http/.test(url)) {\n url = options.baseUrl + url;\n }\n\n const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat(\"baseUrl\");\n const remainingParameters = omit(parameters, omittedParameters);\n const isBinaryRequest = /application\\/octet-stream/i.test(headers.accept);\n\n if (!isBinaryRequest) {\n if (options.mediaType.format) {\n // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw\n headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\\/vnd(\\.\\w+)(\\.v3)?(\\.\\w+)?(\\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(\",\");\n }\n\n if (options.mediaType.previews.length) {\n const previewsFromAcceptHeader = headers.accept.match(/[\\w-]+(?=-preview)/g) || [];\n headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {\n const format = options.mediaType.format ? `.${options.mediaType.format}` : \"+json\";\n return `application/vnd.github.${preview}-preview${format}`;\n }).join(\",\");\n }\n } // for GET/HEAD requests, set URL query parameters from remaining parameters\n // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters\n\n\n if ([\"GET\", \"HEAD\"].includes(method)) {\n url = addQueryParameters(url, remainingParameters);\n } else {\n if (\"data\" in remainingParameters) {\n body = remainingParameters.data;\n } else {\n if (Object.keys(remainingParameters).length) {\n body = remainingParameters;\n } else {\n headers[\"content-length\"] = 0;\n }\n }\n } // default content-type for JSON if body is set\n\n\n if (!headers[\"content-type\"] && typeof body !== \"undefined\") {\n headers[\"content-type\"] = \"application/json; charset=utf-8\";\n } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.\n // fetch does not allow to set `content-length` header, but we can set body to an empty string\n\n\n if ([\"PATCH\", \"PUT\"].includes(method) && typeof body === \"undefined\") {\n body = \"\";\n } // Only return body/request keys if present\n\n\n return Object.assign({\n method,\n url,\n headers\n }, typeof body !== \"undefined\" ? {\n body\n } : null, options.request ? {\n request: options.request\n } : null);\n}\n\nfunction endpointWithDefaults(defaults, route, options) {\n return parse(merge(defaults, route, options));\n}\n\nfunction withDefaults(oldDefaults, newDefaults) {\n const DEFAULTS = merge(oldDefaults, newDefaults);\n const endpoint = endpointWithDefaults.bind(null, DEFAULTS);\n return Object.assign(endpoint, {\n DEFAULTS,\n defaults: withDefaults.bind(null, DEFAULTS),\n merge: merge.bind(null, DEFAULTS),\n parse\n });\n}\n\nconst VERSION = \"6.0.12\";\n\nconst userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.\n// So we use RequestParameters and add method as additional required property.\n\nconst DEFAULTS = {\n method: \"GET\",\n baseUrl: \"https://api.github.com\",\n headers: {\n accept: \"application/vnd.github.v3+json\",\n \"user-agent\": userAgent\n },\n mediaType: {\n format: \"\",\n previews: []\n }\n};\n\nconst endpoint = withDefaults(null, DEFAULTS);\n\nexports.endpoint = endpoint;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar request = require('@octokit/request');\nvar universalUserAgent = require('universal-user-agent');\n\nconst VERSION = \"4.8.0\";\n\nfunction _buildMessageForResponseErrors(data) {\n return `Request failed due to following response errors:\\n` + data.errors.map(e => ` - ${e.message}`).join(\"\\n\");\n}\n\nclass GraphqlResponseError extends Error {\n constructor(request, headers, response) {\n super(_buildMessageForResponseErrors(response));\n this.request = request;\n this.headers = headers;\n this.response = response;\n this.name = \"GraphqlResponseError\"; // Expose the errors and response data in their shorthand properties.\n\n this.errors = response.errors;\n this.data = response.data; // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n }\n\n}\n\nconst NON_VARIABLE_OPTIONS = [\"method\", \"baseUrl\", \"url\", \"headers\", \"request\", \"query\", \"mediaType\"];\nconst FORBIDDEN_VARIABLE_OPTIONS = [\"query\", \"method\", \"url\"];\nconst GHES_V3_SUFFIX_REGEX = /\\/api\\/v3\\/?$/;\nfunction graphql(request, query, options) {\n if (options) {\n if (typeof query === \"string\" && \"query\" in options) {\n return Promise.reject(new Error(`[@octokit/graphql] \"query\" cannot be used as variable name`));\n }\n\n for (const key in options) {\n if (!FORBIDDEN_VARIABLE_OPTIONS.includes(key)) continue;\n return Promise.reject(new Error(`[@octokit/graphql] \"${key}\" cannot be used as variable name`));\n }\n }\n\n const parsedOptions = typeof query === \"string\" ? Object.assign({\n query\n }, options) : query;\n const requestOptions = Object.keys(parsedOptions).reduce((result, key) => {\n if (NON_VARIABLE_OPTIONS.includes(key)) {\n result[key] = parsedOptions[key];\n return result;\n }\n\n if (!result.variables) {\n result.variables = {};\n }\n\n result.variables[key] = parsedOptions[key];\n return result;\n }, {}); // workaround for GitHub Enterprise baseUrl set with /api/v3 suffix\n // https://github.com/octokit/auth-app.js/issues/111#issuecomment-657610451\n\n const baseUrl = parsedOptions.baseUrl || request.endpoint.DEFAULTS.baseUrl;\n\n if (GHES_V3_SUFFIX_REGEX.test(baseUrl)) {\n requestOptions.url = baseUrl.replace(GHES_V3_SUFFIX_REGEX, \"/api/graphql\");\n }\n\n return request(requestOptions).then(response => {\n if (response.data.errors) {\n const headers = {};\n\n for (const key of Object.keys(response.headers)) {\n headers[key] = response.headers[key];\n }\n\n throw new GraphqlResponseError(requestOptions, headers, response.data);\n }\n\n return response.data.data;\n });\n}\n\nfunction withDefaults(request$1, newDefaults) {\n const newRequest = request$1.defaults(newDefaults);\n\n const newApi = (query, options) => {\n return graphql(newRequest, query, options);\n };\n\n return Object.assign(newApi, {\n defaults: withDefaults.bind(null, newRequest),\n endpoint: request.request.endpoint\n });\n}\n\nconst graphql$1 = withDefaults(request.request, {\n headers: {\n \"user-agent\": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n },\n method: \"POST\",\n url: \"/graphql\"\n});\nfunction withCustomRequest(customRequest) {\n return withDefaults(customRequest, {\n method: \"POST\",\n url: \"/graphql\"\n });\n}\n\nexports.GraphqlResponseError = GraphqlResponseError;\nexports.graphql = graphql$1;\nexports.withCustomRequest = withCustomRequest;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar deprecation = require('deprecation');\nvar once = _interopDefault(require('once'));\n\nconst logOnceCode = once(deprecation => console.warn(deprecation));\nconst logOnceHeaders = once(deprecation => console.warn(deprecation));\n/**\n * Error with extra properties to help with debugging\n */\n\nclass RequestError extends Error {\n constructor(message, statusCode, options) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = \"HttpError\";\n this.status = statusCode;\n let headers;\n\n if (\"headers\" in options && typeof options.headers !== \"undefined\") {\n headers = options.headers;\n }\n\n if (\"response\" in options) {\n this.response = options.response;\n headers = options.response.headers;\n } // redact request credentials without mutating original request options\n\n\n const requestCopy = Object.assign({}, options.request);\n\n if (options.request.headers.authorization) {\n requestCopy.headers = Object.assign({}, options.request.headers, {\n authorization: options.request.headers.authorization.replace(/ .*$/, \" [REDACTED]\")\n });\n }\n\n requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit\n // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications\n .replace(/\\bclient_secret=\\w+/g, \"client_secret=[REDACTED]\") // OAuth tokens can be passed as URL query parameters, although it is not recommended\n // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header\n .replace(/\\baccess_token=\\w+/g, \"access_token=[REDACTED]\");\n this.request = requestCopy; // deprecations\n\n Object.defineProperty(this, \"code\", {\n get() {\n logOnceCode(new deprecation.Deprecation(\"[@octokit/request-error] `error.code` is deprecated, use `error.status`.\"));\n return statusCode;\n }\n\n });\n Object.defineProperty(this, \"headers\", {\n get() {\n logOnceHeaders(new deprecation.Deprecation(\"[@octokit/request-error] `error.headers` is deprecated, use `error.response.headers`.\"));\n return headers || {};\n }\n\n });\n }\n\n}\n\nexports.RequestError = RequestError;\n//# sourceMappingURL=index.js.map\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar endpoint = require('@octokit/endpoint');\nvar universalUserAgent = require('universal-user-agent');\nvar isPlainObject = require('is-plain-object');\nvar nodeFetch = _interopDefault(require('node-fetch'));\nvar requestError = require('@octokit/request-error');\n\nconst VERSION = \"5.6.3\";\n\nfunction getBufferResponse(response) {\n return response.arrayBuffer();\n}\n\nfunction fetchWrapper(requestOptions) {\n const log = requestOptions.request && requestOptions.request.log ? requestOptions.request.log : console;\n\n if (isPlainObject.isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {\n requestOptions.body = JSON.stringify(requestOptions.body);\n }\n\n let headers = {};\n let status;\n let url;\n const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;\n return fetch(requestOptions.url, Object.assign({\n method: requestOptions.method,\n body: requestOptions.body,\n headers: requestOptions.headers,\n redirect: requestOptions.redirect\n }, // `requestOptions.request.agent` type is incompatible\n // see https://github.com/octokit/types.ts/pull/264\n requestOptions.request)).then(async response => {\n url = response.url;\n status = response.status;\n\n for (const keyAndValue of response.headers) {\n headers[keyAndValue[0]] = keyAndValue[1];\n }\n\n if (\"deprecation\" in headers) {\n const matches = headers.link && headers.link.match(/<([^>]+)>; rel=\"deprecation\"/);\n const deprecationLink = matches && matches.pop();\n log.warn(`[@octokit/request] \"${requestOptions.method} ${requestOptions.url}\" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : \"\"}`);\n }\n\n if (status === 204 || status === 205) {\n return;\n } // GitHub API returns 200 for HEAD requests\n\n\n if (requestOptions.method === \"HEAD\") {\n if (status < 400) {\n return;\n }\n\n throw new requestError.RequestError(response.statusText, status, {\n response: {\n url,\n status,\n headers,\n data: undefined\n },\n request: requestOptions\n });\n }\n\n if (status === 304) {\n throw new requestError.RequestError(\"Not modified\", status, {\n response: {\n url,\n status,\n headers,\n data: await getResponseData(response)\n },\n request: requestOptions\n });\n }\n\n if (status >= 400) {\n const data = await getResponseData(response);\n const error = new requestError.RequestError(toErrorMessage(data), status, {\n response: {\n url,\n status,\n headers,\n data\n },\n request: requestOptions\n });\n throw error;\n }\n\n return getResponseData(response);\n }).then(data => {\n return {\n status,\n url,\n headers,\n data\n };\n }).catch(error => {\n if (error instanceof requestError.RequestError) throw error;\n throw new requestError.RequestError(error.message, 500, {\n request: requestOptions\n });\n });\n}\n\nasync function getResponseData(response) {\n const contentType = response.headers.get(\"content-type\");\n\n if (/application\\/json/.test(contentType)) {\n return response.json();\n }\n\n if (!contentType || /^text\\/|charset=utf-8$/.test(contentType)) {\n return response.text();\n }\n\n return getBufferResponse(response);\n}\n\nfunction toErrorMessage(data) {\n if (typeof data === \"string\") return data; // istanbul ignore else - just in case\n\n if (\"message\" in data) {\n if (Array.isArray(data.errors)) {\n return `${data.message}: ${data.errors.map(JSON.stringify).join(\", \")}`;\n }\n\n return data.message;\n } // istanbul ignore next - just in case\n\n\n return `Unknown error: ${JSON.stringify(data)}`;\n}\n\nfunction withDefaults(oldEndpoint, newDefaults) {\n const endpoint = oldEndpoint.defaults(newDefaults);\n\n const newApi = function (route, parameters) {\n const endpointOptions = endpoint.merge(route, parameters);\n\n if (!endpointOptions.request || !endpointOptions.request.hook) {\n return fetchWrapper(endpoint.parse(endpointOptions));\n }\n\n const request = (route, parameters) => {\n return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));\n };\n\n Object.assign(request, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n return endpointOptions.request.hook(request, endpointOptions);\n };\n\n return Object.assign(newApi, {\n endpoint,\n defaults: withDefaults.bind(null, endpoint)\n });\n}\n\nconst request = withDefaults(endpoint.endpoint, {\n headers: {\n \"user-agent\": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`\n }\n});\n\nexports.request = request;\n//# sourceMappingURL=index.js.map\n","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContextAPI = void 0;\nconst NoopContextManager_1 = require(\"../context/NoopContextManager\");\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst diag_1 = require(\"./diag\");\nconst API_NAME = 'context';\nconst NOOP_CONTEXT_MANAGER = new NoopContextManager_1.NoopContextManager();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Context API\n */\nclass ContextAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() { }\n /** Get the singleton instance of the Context API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new ContextAPI();\n }\n return this._instance;\n }\n /**\n * Set the current context manager.\n *\n * @returns true if the context manager was successfully registered, else false\n */\n setGlobalContextManager(contextManager) {\n return (0, global_utils_1.registerGlobal)(API_NAME, contextManager, diag_1.DiagAPI.instance());\n }\n /**\n * Get the currently active context\n */\n active() {\n return this._getContextManager().active();\n }\n /**\n * Execute a function with an active context\n *\n * @param context context to be active during function execution\n * @param fn function to execute in a context\n * @param thisArg optional receiver to be used for calling fn\n * @param args optional arguments forwarded to fn\n */\n with(context, fn, thisArg, ...args) {\n return this._getContextManager().with(context, fn, thisArg, ...args);\n }\n /**\n * Bind a context to a target function or event emitter\n *\n * @param context context to bind to the event emitter or function. Defaults to the currently active context\n * @param target function or event emitter to bind\n */\n bind(context, target) {\n return this._getContextManager().bind(context, target);\n }\n _getContextManager() {\n return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_CONTEXT_MANAGER;\n }\n /** Disable and remove the global context manager */\n disable() {\n this._getContextManager().disable();\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }\n}\nexports.ContextAPI = ContextAPI;\n//# sourceMappingURL=context.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagAPI = void 0;\nconst ComponentLogger_1 = require(\"../diag/ComponentLogger\");\nconst logLevelLogger_1 = require(\"../diag/internal/logLevelLogger\");\nconst types_1 = require(\"../diag/types\");\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst API_NAME = 'diag';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry internal\n * diagnostic API\n */\nclass DiagAPI {\n /**\n * Private internal constructor\n * @private\n */\n constructor() {\n function _logProxy(funcName) {\n return function (...args) {\n const logger = (0, global_utils_1.getGlobal)('diag');\n // shortcut if logger not set\n if (!logger)\n return;\n return logger[funcName](...args);\n };\n }\n // Using self local variable for minification purposes as 'this' cannot be minified\n const self = this;\n // DiagAPI specific functions\n const setLogger = (logger, optionsOrLogLevel = { logLevel: types_1.DiagLogLevel.INFO }) => {\n var _a, _b, _c;\n if (logger === self) {\n // There isn't much we can do here.\n // Logging to the console might break the user application.\n // Try to log to self. If a logger was previously registered it will receive the log.\n const err = new Error('Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation');\n self.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);\n return false;\n }\n if (typeof optionsOrLogLevel === 'number') {\n optionsOrLogLevel = {\n logLevel: optionsOrLogLevel,\n };\n }\n const oldLogger = (0, global_utils_1.getGlobal)('diag');\n const newLogger = (0, logLevelLogger_1.createLogLevelDiagLogger)((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : types_1.DiagLogLevel.INFO, logger);\n // There already is an logger registered. We'll let it know before overwriting it.\n if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {\n const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : '';\n oldLogger.warn(`Current logger will be overwritten from ${stack}`);\n newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);\n }\n return (0, global_utils_1.registerGlobal)('diag', newLogger, self, true);\n };\n self.setLogger = setLogger;\n self.disable = () => {\n (0, global_utils_1.unregisterGlobal)(API_NAME, self);\n };\n self.createComponentLogger = (options) => {\n return new ComponentLogger_1.DiagComponentLogger(options);\n };\n self.verbose = _logProxy('verbose');\n self.debug = _logProxy('debug');\n self.info = _logProxy('info');\n self.warn = _logProxy('warn');\n self.error = _logProxy('error');\n }\n /** Get the singleton instance of the DiagAPI API */\n static instance() {\n if (!this._instance) {\n this._instance = new DiagAPI();\n }\n return this._instance;\n }\n}\nexports.DiagAPI = DiagAPI;\n//# sourceMappingURL=diag.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MetricsAPI = void 0;\nconst NoopMeterProvider_1 = require(\"../metrics/NoopMeterProvider\");\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst diag_1 = require(\"./diag\");\nconst API_NAME = 'metrics';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Metrics API\n */\nclass MetricsAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() { }\n /** Get the singleton instance of the Metrics API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new MetricsAPI();\n }\n return this._instance;\n }\n /**\n * Set the current global meter provider.\n * Returns true if the meter provider was successfully registered, else false.\n */\n setGlobalMeterProvider(provider) {\n return (0, global_utils_1.registerGlobal)(API_NAME, provider, diag_1.DiagAPI.instance());\n }\n /**\n * Returns the global meter provider.\n */\n getMeterProvider() {\n return (0, global_utils_1.getGlobal)(API_NAME) || NoopMeterProvider_1.NOOP_METER_PROVIDER;\n }\n /**\n * Returns a meter from the global meter provider.\n */\n getMeter(name, version, options) {\n return this.getMeterProvider().getMeter(name, version, options);\n }\n /** Remove the global meter provider */\n disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }\n}\nexports.MetricsAPI = MetricsAPI;\n//# sourceMappingURL=metrics.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PropagationAPI = void 0;\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst NoopTextMapPropagator_1 = require(\"../propagation/NoopTextMapPropagator\");\nconst TextMapPropagator_1 = require(\"../propagation/TextMapPropagator\");\nconst context_helpers_1 = require(\"../baggage/context-helpers\");\nconst utils_1 = require(\"../baggage/utils\");\nconst diag_1 = require(\"./diag\");\nconst API_NAME = 'propagation';\nconst NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator_1.NoopTextMapPropagator();\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Propagation API\n */\nclass PropagationAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this.createBaggage = utils_1.createBaggage;\n this.getBaggage = context_helpers_1.getBaggage;\n this.getActiveBaggage = context_helpers_1.getActiveBaggage;\n this.setBaggage = context_helpers_1.setBaggage;\n this.deleteBaggage = context_helpers_1.deleteBaggage;\n }\n /** Get the singleton instance of the Propagator API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new PropagationAPI();\n }\n return this._instance;\n }\n /**\n * Set the current propagator.\n *\n * @returns true if the propagator was successfully registered, else false\n */\n setGlobalPropagator(propagator) {\n return (0, global_utils_1.registerGlobal)(API_NAME, propagator, diag_1.DiagAPI.instance());\n }\n /**\n * Inject context into a carrier to be propagated inter-process\n *\n * @param context Context carrying tracing data to inject\n * @param carrier carrier to inject context into\n * @param setter Function used to set values on the carrier\n */\n inject(context, carrier, setter = TextMapPropagator_1.defaultTextMapSetter) {\n return this._getGlobalPropagator().inject(context, carrier, setter);\n }\n /**\n * Extract context from a carrier\n *\n * @param context Context which the newly created context will inherit from\n * @param carrier Carrier to extract context from\n * @param getter Function used to extract keys from a carrier\n */\n extract(context, carrier, getter = TextMapPropagator_1.defaultTextMapGetter) {\n return this._getGlobalPropagator().extract(context, carrier, getter);\n }\n /**\n * Return a list of all fields which may be used by the propagator.\n */\n fields() {\n return this._getGlobalPropagator().fields();\n }\n /** Remove the global propagator */\n disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n }\n _getGlobalPropagator() {\n return (0, global_utils_1.getGlobal)(API_NAME) || NOOP_TEXT_MAP_PROPAGATOR;\n }\n}\nexports.PropagationAPI = PropagationAPI;\n//# sourceMappingURL=propagation.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceAPI = void 0;\nconst global_utils_1 = require(\"../internal/global-utils\");\nconst ProxyTracerProvider_1 = require(\"../trace/ProxyTracerProvider\");\nconst spancontext_utils_1 = require(\"../trace/spancontext-utils\");\nconst context_utils_1 = require(\"../trace/context-utils\");\nconst diag_1 = require(\"./diag\");\nconst API_NAME = 'trace';\n/**\n * Singleton object which represents the entry point to the OpenTelemetry Tracing API\n */\nclass TraceAPI {\n /** Empty private constructor prevents end users from constructing a new instance of the API */\n constructor() {\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n this.wrapSpanContext = spancontext_utils_1.wrapSpanContext;\n this.isSpanContextValid = spancontext_utils_1.isSpanContextValid;\n this.deleteSpan = context_utils_1.deleteSpan;\n this.getSpan = context_utils_1.getSpan;\n this.getActiveSpan = context_utils_1.getActiveSpan;\n this.getSpanContext = context_utils_1.getSpanContext;\n this.setSpan = context_utils_1.setSpan;\n this.setSpanContext = context_utils_1.setSpanContext;\n }\n /** Get the singleton instance of the Trace API */\n static getInstance() {\n if (!this._instance) {\n this._instance = new TraceAPI();\n }\n return this._instance;\n }\n /**\n * Set the current global tracer.\n *\n * @returns true if the tracer provider was successfully registered, else false\n */\n setGlobalTracerProvider(provider) {\n const success = (0, global_utils_1.registerGlobal)(API_NAME, this._proxyTracerProvider, diag_1.DiagAPI.instance());\n if (success) {\n this._proxyTracerProvider.setDelegate(provider);\n }\n return success;\n }\n /**\n * Returns the global tracer provider.\n */\n getTracerProvider() {\n return (0, global_utils_1.getGlobal)(API_NAME) || this._proxyTracerProvider;\n }\n /**\n * Returns a tracer from the global tracer provider.\n */\n getTracer(name, version) {\n return this.getTracerProvider().getTracer(name, version);\n }\n /** Remove the global tracer provider */\n disable() {\n (0, global_utils_1.unregisterGlobal)(API_NAME, diag_1.DiagAPI.instance());\n this._proxyTracerProvider = new ProxyTracerProvider_1.ProxyTracerProvider();\n }\n}\nexports.TraceAPI = TraceAPI;\n//# sourceMappingURL=trace.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.deleteBaggage = exports.setBaggage = exports.getActiveBaggage = exports.getBaggage = void 0;\nconst context_1 = require(\"../api/context\");\nconst context_2 = require(\"../context/context\");\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = (0, context_2.createContextKey)('OpenTelemetry Baggage Key');\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nfunction getBaggage(context) {\n return context.getValue(BAGGAGE_KEY) || undefined;\n}\nexports.getBaggage = getBaggage;\n/**\n * Retrieve the current baggage from the active/current context\n *\n * @returns {Baggage} Extracted baggage from the context\n */\nfunction getActiveBaggage() {\n return getBaggage(context_1.ContextAPI.getInstance().active());\n}\nexports.getActiveBaggage = getActiveBaggage;\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nfunction setBaggage(context, baggage) {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\nexports.setBaggage = setBaggage;\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nfunction deleteBaggage(context) {\n return context.deleteValue(BAGGAGE_KEY);\n}\nexports.deleteBaggage = deleteBaggage;\n//# sourceMappingURL=context-helpers.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BaggageImpl = void 0;\nclass BaggageImpl {\n constructor(entries) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n getEntry(key) {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n return Object.assign({}, entry);\n }\n getAllEntries() {\n return Array.from(this._entries.entries()).map(([k, v]) => [k, v]);\n }\n setEntry(key, entry) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n removeEntry(key) {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n removeEntries(...keys) {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n clear() {\n return new BaggageImpl();\n }\n}\nexports.BaggageImpl = BaggageImpl;\n//# sourceMappingURL=baggage-impl.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageEntryMetadataSymbol = void 0;\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexports.baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n//# sourceMappingURL=symbol.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.baggageEntryMetadataFromString = exports.createBaggage = void 0;\nconst diag_1 = require(\"../api/diag\");\nconst baggage_impl_1 = require(\"./internal/baggage-impl\");\nconst symbol_1 = require(\"./internal/symbol\");\nconst diag = diag_1.DiagAPI.instance();\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nfunction createBaggage(entries = {}) {\n return new baggage_impl_1.BaggageImpl(new Map(Object.entries(entries)));\n}\nexports.createBaggage = createBaggage;\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nfunction baggageEntryMetadataFromString(str) {\n if (typeof str !== 'string') {\n diag.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);\n str = '';\n }\n return {\n __TYPE__: symbol_1.baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\nexports.baggageEntryMetadataFromString = baggageEntryMetadataFromString;\n//# sourceMappingURL=utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.context = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst context_1 = require(\"./api/context\");\n/** Entrypoint for context API */\nexports.context = context_1.ContextAPI.getInstance();\n//# sourceMappingURL=context-api.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopContextManager = void 0;\nconst context_1 = require(\"./context\");\nclass NoopContextManager {\n active() {\n return context_1.ROOT_CONTEXT;\n }\n with(_context, fn, thisArg, ...args) {\n return fn.call(thisArg, ...args);\n }\n bind(_context, target) {\n return target;\n }\n enable() {\n return this;\n }\n disable() {\n return this;\n }\n}\nexports.NoopContextManager = NoopContextManager;\n//# sourceMappingURL=NoopContextManager.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ROOT_CONTEXT = exports.createContextKey = void 0;\n/** Get a key to uniquely identify a context value */\nfunction createContextKey(description) {\n // The specification states that for the same input, multiple calls should\n // return different keys. Due to the nature of the JS dependency management\n // system, this creates problems where multiple versions of some package\n // could hold different keys for the same property.\n //\n // Therefore, we use Symbol.for which returns the same key for the same input.\n return Symbol.for(description);\n}\nexports.createContextKey = createContextKey;\nclass BaseContext {\n /**\n * Construct a new context which inherits values from an optional parent context.\n *\n * @param parentContext a context from which to inherit values\n */\n constructor(parentContext) {\n // for minification\n const self = this;\n self._currentContext = parentContext ? new Map(parentContext) : new Map();\n self.getValue = (key) => self._currentContext.get(key);\n self.setValue = (key, value) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.set(key, value);\n return context;\n };\n self.deleteValue = (key) => {\n const context = new BaseContext(self._currentContext);\n context._currentContext.delete(key);\n return context;\n };\n }\n}\n/** The root context is used as the default parent context when there is no active context */\nexports.ROOT_CONTEXT = new BaseContext();\n//# sourceMappingURL=context.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.diag = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst diag_1 = require(\"./api/diag\");\n/**\n * Entrypoint for Diag API.\n * Defines Diagnostic handler used for internal diagnostic logging operations.\n * The default provides a Noop DiagLogger implementation which may be changed via the\n * diag.setLogger(logger: DiagLogger) function.\n */\nexports.diag = diag_1.DiagAPI.instance();\n//# sourceMappingURL=diag-api.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagComponentLogger = void 0;\nconst global_utils_1 = require(\"../internal/global-utils\");\n/**\n * Component Logger which is meant to be used as part of any component which\n * will add automatically additional namespace in front of the log message.\n * It will then forward all message to global diag logger\n * @example\n * const cLogger = diag.createComponentLogger({ namespace: '@opentelemetry/instrumentation-http' });\n * cLogger.debug('test');\n * // @opentelemetry/instrumentation-http test\n */\nclass DiagComponentLogger {\n constructor(props) {\n this._namespace = props.namespace || 'DiagComponentLogger';\n }\n debug(...args) {\n return logProxy('debug', this._namespace, args);\n }\n error(...args) {\n return logProxy('error', this._namespace, args);\n }\n info(...args) {\n return logProxy('info', this._namespace, args);\n }\n warn(...args) {\n return logProxy('warn', this._namespace, args);\n }\n verbose(...args) {\n return logProxy('verbose', this._namespace, args);\n }\n}\nexports.DiagComponentLogger = DiagComponentLogger;\nfunction logProxy(funcName, namespace, args) {\n const logger = (0, global_utils_1.getGlobal)('diag');\n // shortcut if logger not set\n if (!logger) {\n return;\n }\n args.unshift(namespace);\n return logger[funcName](...args);\n}\n//# sourceMappingURL=ComponentLogger.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagConsoleLogger = void 0;\nconst consoleMap = [\n { n: 'error', c: 'error' },\n { n: 'warn', c: 'warn' },\n { n: 'info', c: 'info' },\n { n: 'debug', c: 'debug' },\n { n: 'verbose', c: 'trace' },\n];\n/**\n * A simple Immutable Console based diagnostic logger which will output any messages to the Console.\n * If you want to limit the amount of logging to a specific level or lower use the\n * {@link createLogLevelDiagLogger}\n */\nclass DiagConsoleLogger {\n constructor() {\n function _consoleFunc(funcName) {\n return function (...args) {\n if (console) {\n // Some environments only expose the console when the F12 developer console is open\n // eslint-disable-next-line no-console\n let theFunc = console[funcName];\n if (typeof theFunc !== 'function') {\n // Not all environments support all functions\n // eslint-disable-next-line no-console\n theFunc = console.log;\n }\n // One last final check\n if (typeof theFunc === 'function') {\n return theFunc.apply(console, args);\n }\n }\n };\n }\n for (let i = 0; i < consoleMap.length; i++) {\n this[consoleMap[i].n] = _consoleFunc(consoleMap[i].c);\n }\n }\n}\nexports.DiagConsoleLogger = DiagConsoleLogger;\n//# sourceMappingURL=consoleLogger.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createLogLevelDiagLogger = void 0;\nconst types_1 = require(\"../types\");\nfunction createLogLevelDiagLogger(maxLevel, logger) {\n if (maxLevel < types_1.DiagLogLevel.NONE) {\n maxLevel = types_1.DiagLogLevel.NONE;\n }\n else if (maxLevel > types_1.DiagLogLevel.ALL) {\n maxLevel = types_1.DiagLogLevel.ALL;\n }\n // In case the logger is null or undefined\n logger = logger || {};\n function _filterFunc(funcName, theLevel) {\n const theFunc = logger[funcName];\n if (typeof theFunc === 'function' && maxLevel >= theLevel) {\n return theFunc.bind(logger);\n }\n return function () { };\n }\n return {\n error: _filterFunc('error', types_1.DiagLogLevel.ERROR),\n warn: _filterFunc('warn', types_1.DiagLogLevel.WARN),\n info: _filterFunc('info', types_1.DiagLogLevel.INFO),\n debug: _filterFunc('debug', types_1.DiagLogLevel.DEBUG),\n verbose: _filterFunc('verbose', types_1.DiagLogLevel.VERBOSE),\n };\n}\nexports.createLogLevelDiagLogger = createLogLevelDiagLogger;\n//# sourceMappingURL=logLevelLogger.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DiagLogLevel = void 0;\n/**\n * Defines the available internal logging levels for the diagnostic logger, the numeric values\n * of the levels are defined to match the original values from the initial LogLevel to avoid\n * compatibility/migration issues for any implementation that assume the numeric ordering.\n */\nvar DiagLogLevel;\n(function (DiagLogLevel) {\n /** Diagnostic Logging level setting to disable all logging (except and forced logs) */\n DiagLogLevel[DiagLogLevel[\"NONE\"] = 0] = \"NONE\";\n /** Identifies an error scenario */\n DiagLogLevel[DiagLogLevel[\"ERROR\"] = 30] = \"ERROR\";\n /** Identifies a warning scenario */\n DiagLogLevel[DiagLogLevel[\"WARN\"] = 50] = \"WARN\";\n /** General informational log message */\n DiagLogLevel[DiagLogLevel[\"INFO\"] = 60] = \"INFO\";\n /** General debug log message */\n DiagLogLevel[DiagLogLevel[\"DEBUG\"] = 70] = \"DEBUG\";\n /**\n * Detailed trace level logging should only be used for development, should only be set\n * in a development environment.\n */\n DiagLogLevel[DiagLogLevel[\"VERBOSE\"] = 80] = \"VERBOSE\";\n /** Used to set the logging level to include all logging */\n DiagLogLevel[DiagLogLevel[\"ALL\"] = 9999] = \"ALL\";\n})(DiagLogLevel = exports.DiagLogLevel || (exports.DiagLogLevel = {}));\n//# sourceMappingURL=types.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.trace = exports.propagation = exports.metrics = exports.diag = exports.context = exports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = exports.isValidSpanId = exports.isValidTraceId = exports.isSpanContextValid = exports.createTraceState = exports.TraceFlags = exports.SpanStatusCode = exports.SpanKind = exports.SamplingDecision = exports.ProxyTracerProvider = exports.ProxyTracer = exports.defaultTextMapSetter = exports.defaultTextMapGetter = exports.ValueType = exports.createNoopMeter = exports.DiagLogLevel = exports.DiagConsoleLogger = exports.ROOT_CONTEXT = exports.createContextKey = exports.baggageEntryMetadataFromString = void 0;\nvar utils_1 = require(\"./baggage/utils\");\nObject.defineProperty(exports, \"baggageEntryMetadataFromString\", { enumerable: true, get: function () { return utils_1.baggageEntryMetadataFromString; } });\n// Context APIs\nvar context_1 = require(\"./context/context\");\nObject.defineProperty(exports, \"createContextKey\", { enumerable: true, get: function () { return context_1.createContextKey; } });\nObject.defineProperty(exports, \"ROOT_CONTEXT\", { enumerable: true, get: function () { return context_1.ROOT_CONTEXT; } });\n// Diag APIs\nvar consoleLogger_1 = require(\"./diag/consoleLogger\");\nObject.defineProperty(exports, \"DiagConsoleLogger\", { enumerable: true, get: function () { return consoleLogger_1.DiagConsoleLogger; } });\nvar types_1 = require(\"./diag/types\");\nObject.defineProperty(exports, \"DiagLogLevel\", { enumerable: true, get: function () { return types_1.DiagLogLevel; } });\n// Metrics APIs\nvar NoopMeter_1 = require(\"./metrics/NoopMeter\");\nObject.defineProperty(exports, \"createNoopMeter\", { enumerable: true, get: function () { return NoopMeter_1.createNoopMeter; } });\nvar Metric_1 = require(\"./metrics/Metric\");\nObject.defineProperty(exports, \"ValueType\", { enumerable: true, get: function () { return Metric_1.ValueType; } });\n// Propagation APIs\nvar TextMapPropagator_1 = require(\"./propagation/TextMapPropagator\");\nObject.defineProperty(exports, \"defaultTextMapGetter\", { enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapGetter; } });\nObject.defineProperty(exports, \"defaultTextMapSetter\", { enumerable: true, get: function () { return TextMapPropagator_1.defaultTextMapSetter; } });\nvar ProxyTracer_1 = require(\"./trace/ProxyTracer\");\nObject.defineProperty(exports, \"ProxyTracer\", { enumerable: true, get: function () { return ProxyTracer_1.ProxyTracer; } });\nvar ProxyTracerProvider_1 = require(\"./trace/ProxyTracerProvider\");\nObject.defineProperty(exports, \"ProxyTracerProvider\", { enumerable: true, get: function () { return ProxyTracerProvider_1.ProxyTracerProvider; } });\nvar SamplingResult_1 = require(\"./trace/SamplingResult\");\nObject.defineProperty(exports, \"SamplingDecision\", { enumerable: true, get: function () { return SamplingResult_1.SamplingDecision; } });\nvar span_kind_1 = require(\"./trace/span_kind\");\nObject.defineProperty(exports, \"SpanKind\", { enumerable: true, get: function () { return span_kind_1.SpanKind; } });\nvar status_1 = require(\"./trace/status\");\nObject.defineProperty(exports, \"SpanStatusCode\", { enumerable: true, get: function () { return status_1.SpanStatusCode; } });\nvar trace_flags_1 = require(\"./trace/trace_flags\");\nObject.defineProperty(exports, \"TraceFlags\", { enumerable: true, get: function () { return trace_flags_1.TraceFlags; } });\nvar utils_2 = require(\"./trace/internal/utils\");\nObject.defineProperty(exports, \"createTraceState\", { enumerable: true, get: function () { return utils_2.createTraceState; } });\nvar spancontext_utils_1 = require(\"./trace/spancontext-utils\");\nObject.defineProperty(exports, \"isSpanContextValid\", { enumerable: true, get: function () { return spancontext_utils_1.isSpanContextValid; } });\nObject.defineProperty(exports, \"isValidTraceId\", { enumerable: true, get: function () { return spancontext_utils_1.isValidTraceId; } });\nObject.defineProperty(exports, \"isValidSpanId\", { enumerable: true, get: function () { return spancontext_utils_1.isValidSpanId; } });\nvar invalid_span_constants_1 = require(\"./trace/invalid-span-constants\");\nObject.defineProperty(exports, \"INVALID_SPANID\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPANID; } });\nObject.defineProperty(exports, \"INVALID_TRACEID\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_TRACEID; } });\nObject.defineProperty(exports, \"INVALID_SPAN_CONTEXT\", { enumerable: true, get: function () { return invalid_span_constants_1.INVALID_SPAN_CONTEXT; } });\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst context_api_1 = require(\"./context-api\");\nObject.defineProperty(exports, \"context\", { enumerable: true, get: function () { return context_api_1.context; } });\nconst diag_api_1 = require(\"./diag-api\");\nObject.defineProperty(exports, \"diag\", { enumerable: true, get: function () { return diag_api_1.diag; } });\nconst metrics_api_1 = require(\"./metrics-api\");\nObject.defineProperty(exports, \"metrics\", { enumerable: true, get: function () { return metrics_api_1.metrics; } });\nconst propagation_api_1 = require(\"./propagation-api\");\nObject.defineProperty(exports, \"propagation\", { enumerable: true, get: function () { return propagation_api_1.propagation; } });\nconst trace_api_1 = require(\"./trace-api\");\nObject.defineProperty(exports, \"trace\", { enumerable: true, get: function () { return trace_api_1.trace; } });\n// Default export.\nexports.default = {\n context: context_api_1.context,\n diag: diag_api_1.diag,\n metrics: metrics_api_1.metrics,\n propagation: propagation_api_1.propagation,\n trace: trace_api_1.trace,\n};\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unregisterGlobal = exports.getGlobal = exports.registerGlobal = void 0;\nconst platform_1 = require(\"../platform\");\nconst version_1 = require(\"../version\");\nconst semver_1 = require(\"./semver\");\nconst major = version_1.VERSION.split('.')[0];\nconst GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);\nconst _global = platform_1._globalThis;\nfunction registerGlobal(type, instance, diag, allowOverride = false) {\n var _a;\n const api = (_global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {\n version: version_1.VERSION,\n });\n if (!allowOverride && api[type]) {\n // already registered an API of this type\n const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);\n diag.error(err.stack || err.message);\n return false;\n }\n if (api.version !== version_1.VERSION) {\n // All registered APIs must be of the same version exactly\n const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${version_1.VERSION}`);\n diag.error(err.stack || err.message);\n return false;\n }\n api[type] = instance;\n diag.debug(`@opentelemetry/api: Registered a global for ${type} v${version_1.VERSION}.`);\n return true;\n}\nexports.registerGlobal = registerGlobal;\nfunction getGlobal(type) {\n var _a, _b;\n const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;\n if (!globalVersion || !(0, semver_1.isCompatible)(globalVersion)) {\n return;\n }\n return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];\n}\nexports.getGlobal = getGlobal;\nfunction unregisterGlobal(type, diag) {\n diag.debug(`@opentelemetry/api: Unregistering a global for ${type} v${version_1.VERSION}.`);\n const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];\n if (api) {\n delete api[type];\n }\n}\nexports.unregisterGlobal = unregisterGlobal;\n//# sourceMappingURL=global-utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isCompatible = exports._makeCompatibilityCheck = void 0;\nconst version_1 = require(\"../version\");\nconst re = /^(\\d+)\\.(\\d+)\\.(\\d+)(-(.+))?$/;\n/**\n * Create a function to test an API version to see if it is compatible with the provided ownVersion.\n *\n * The returned function has the following semantics:\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param ownVersion version which should be checked against\n */\nfunction _makeCompatibilityCheck(ownVersion) {\n const acceptedVersions = new Set([ownVersion]);\n const rejectedVersions = new Set();\n const myVersionMatch = ownVersion.match(re);\n if (!myVersionMatch) {\n // we cannot guarantee compatibility so we always return noop\n return () => false;\n }\n const ownVersionParsed = {\n major: +myVersionMatch[1],\n minor: +myVersionMatch[2],\n patch: +myVersionMatch[3],\n prerelease: myVersionMatch[4],\n };\n // if ownVersion has a prerelease tag, versions must match exactly\n if (ownVersionParsed.prerelease != null) {\n return function isExactmatch(globalVersion) {\n return globalVersion === ownVersion;\n };\n }\n function _reject(v) {\n rejectedVersions.add(v);\n return false;\n }\n function _accept(v) {\n acceptedVersions.add(v);\n return true;\n }\n return function isCompatible(globalVersion) {\n if (acceptedVersions.has(globalVersion)) {\n return true;\n }\n if (rejectedVersions.has(globalVersion)) {\n return false;\n }\n const globalVersionMatch = globalVersion.match(re);\n if (!globalVersionMatch) {\n // cannot parse other version\n // we cannot guarantee compatibility so we always noop\n return _reject(globalVersion);\n }\n const globalVersionParsed = {\n major: +globalVersionMatch[1],\n minor: +globalVersionMatch[2],\n patch: +globalVersionMatch[3],\n prerelease: globalVersionMatch[4],\n };\n // if globalVersion has a prerelease tag, versions must match exactly\n if (globalVersionParsed.prerelease != null) {\n return _reject(globalVersion);\n }\n // major versions must match\n if (ownVersionParsed.major !== globalVersionParsed.major) {\n return _reject(globalVersion);\n }\n if (ownVersionParsed.major === 0) {\n if (ownVersionParsed.minor === globalVersionParsed.minor &&\n ownVersionParsed.patch <= globalVersionParsed.patch) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n }\n if (ownVersionParsed.minor <= globalVersionParsed.minor) {\n return _accept(globalVersion);\n }\n return _reject(globalVersion);\n };\n}\nexports._makeCompatibilityCheck = _makeCompatibilityCheck;\n/**\n * Test an API version to see if it is compatible with this API.\n *\n * - Exact match is always compatible\n * - Major versions must match exactly\n * - 1.x package cannot use global 2.x package\n * - 2.x package cannot use global 1.x package\n * - The minor version of the API module requesting access to the global API must be less than or equal to the minor version of this API\n * - 1.3 package may use 1.4 global because the later global contains all functions 1.3 expects\n * - 1.4 package may NOT use 1.3 global because it may try to call functions which don't exist on 1.3\n * - If the major version is 0, the minor version is treated as the major and the patch is treated as the minor\n * - Patch and build tag differences are not considered at this time\n *\n * @param version version of the API requesting an instance of the global API\n */\nexports.isCompatible = _makeCompatibilityCheck(version_1.VERSION);\n//# sourceMappingURL=semver.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.metrics = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst metrics_1 = require(\"./api/metrics\");\n/** Entrypoint for metrics API */\nexports.metrics = metrics_1.MetricsAPI.getInstance();\n//# sourceMappingURL=metrics-api.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ValueType = void 0;\n/** The Type of value. It describes how the data is reported. */\nvar ValueType;\n(function (ValueType) {\n ValueType[ValueType[\"INT\"] = 0] = \"INT\";\n ValueType[ValueType[\"DOUBLE\"] = 1] = \"DOUBLE\";\n})(ValueType = exports.ValueType || (exports.ValueType = {}));\n//# sourceMappingURL=Metric.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createNoopMeter = exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = exports.NOOP_OBSERVABLE_GAUGE_METRIC = exports.NOOP_OBSERVABLE_COUNTER_METRIC = exports.NOOP_UP_DOWN_COUNTER_METRIC = exports.NOOP_HISTOGRAM_METRIC = exports.NOOP_COUNTER_METRIC = exports.NOOP_METER = exports.NoopObservableUpDownCounterMetric = exports.NoopObservableGaugeMetric = exports.NoopObservableCounterMetric = exports.NoopObservableMetric = exports.NoopHistogramMetric = exports.NoopUpDownCounterMetric = exports.NoopCounterMetric = exports.NoopMetric = exports.NoopMeter = void 0;\n/**\n * NoopMeter is a noop implementation of the {@link Meter} interface. It reuses\n * constant NoopMetrics for all of its methods.\n */\nclass NoopMeter {\n constructor() { }\n /**\n * @see {@link Meter.createHistogram}\n */\n createHistogram(_name, _options) {\n return exports.NOOP_HISTOGRAM_METRIC;\n }\n /**\n * @see {@link Meter.createCounter}\n */\n createCounter(_name, _options) {\n return exports.NOOP_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createUpDownCounter}\n */\n createUpDownCounter(_name, _options) {\n return exports.NOOP_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableGauge}\n */\n createObservableGauge(_name, _options) {\n return exports.NOOP_OBSERVABLE_GAUGE_METRIC;\n }\n /**\n * @see {@link Meter.createObservableCounter}\n */\n createObservableCounter(_name, _options) {\n return exports.NOOP_OBSERVABLE_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.createObservableUpDownCounter}\n */\n createObservableUpDownCounter(_name, _options) {\n return exports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;\n }\n /**\n * @see {@link Meter.addBatchObservableCallback}\n */\n addBatchObservableCallback(_callback, _observables) { }\n /**\n * @see {@link Meter.removeBatchObservableCallback}\n */\n removeBatchObservableCallback(_callback) { }\n}\nexports.NoopMeter = NoopMeter;\nclass NoopMetric {\n}\nexports.NoopMetric = NoopMetric;\nclass NoopCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexports.NoopCounterMetric = NoopCounterMetric;\nclass NoopUpDownCounterMetric extends NoopMetric {\n add(_value, _attributes) { }\n}\nexports.NoopUpDownCounterMetric = NoopUpDownCounterMetric;\nclass NoopHistogramMetric extends NoopMetric {\n record(_value, _attributes) { }\n}\nexports.NoopHistogramMetric = NoopHistogramMetric;\nclass NoopObservableMetric {\n addCallback(_callback) { }\n removeCallback(_callback) { }\n}\nexports.NoopObservableMetric = NoopObservableMetric;\nclass NoopObservableCounterMetric extends NoopObservableMetric {\n}\nexports.NoopObservableCounterMetric = NoopObservableCounterMetric;\nclass NoopObservableGaugeMetric extends NoopObservableMetric {\n}\nexports.NoopObservableGaugeMetric = NoopObservableGaugeMetric;\nclass NoopObservableUpDownCounterMetric extends NoopObservableMetric {\n}\nexports.NoopObservableUpDownCounterMetric = NoopObservableUpDownCounterMetric;\nexports.NOOP_METER = new NoopMeter();\n// Synchronous instruments\nexports.NOOP_COUNTER_METRIC = new NoopCounterMetric();\nexports.NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();\nexports.NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();\n// Asynchronous instruments\nexports.NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();\nexports.NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();\nexports.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();\n/**\n * Create a no-op Meter\n */\nfunction createNoopMeter() {\n return exports.NOOP_METER;\n}\nexports.createNoopMeter = createNoopMeter;\n//# sourceMappingURL=NoopMeter.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NOOP_METER_PROVIDER = exports.NoopMeterProvider = void 0;\nconst NoopMeter_1 = require(\"./NoopMeter\");\n/**\n * An implementation of the {@link MeterProvider} which returns an impotent Meter\n * for all calls to `getMeter`\n */\nclass NoopMeterProvider {\n getMeter(_name, _version, _options) {\n return NoopMeter_1.NOOP_METER;\n }\n}\nexports.NoopMeterProvider = NoopMeterProvider;\nexports.NOOP_METER_PROVIDER = new NoopMeterProvider();\n//# sourceMappingURL=NoopMeterProvider.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./node\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._globalThis = void 0;\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line node/no-unsupported-features/es-builtins\nexports._globalThis = typeof globalThis === 'object' ? globalThis : global;\n//# sourceMappingURL=globalThis.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./globalThis\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.propagation = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst propagation_1 = require(\"./api/propagation\");\n/** Entrypoint for propagation API */\nexports.propagation = propagation_1.PropagationAPI.getInstance();\n//# sourceMappingURL=propagation-api.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTextMapPropagator = void 0;\n/**\n * No-op implementations of {@link TextMapPropagator}.\n */\nclass NoopTextMapPropagator {\n /** Noop inject function does nothing */\n inject(_context, _carrier) { }\n /** Noop extract function does nothing and returns the input context */\n extract(context, _carrier) {\n return context;\n }\n fields() {\n return [];\n }\n}\nexports.NoopTextMapPropagator = NoopTextMapPropagator;\n//# sourceMappingURL=NoopTextMapPropagator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultTextMapSetter = exports.defaultTextMapGetter = void 0;\nexports.defaultTextMapGetter = {\n get(carrier, key) {\n if (carrier == null) {\n return undefined;\n }\n return carrier[key];\n },\n keys(carrier) {\n if (carrier == null) {\n return [];\n }\n return Object.keys(carrier);\n },\n};\nexports.defaultTextMapSetter = {\n set(carrier, key, value) {\n if (carrier == null) {\n return;\n }\n carrier[key] = value;\n },\n};\n//# sourceMappingURL=TextMapPropagator.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.trace = void 0;\n// Split module-level variable definition into separate files to allow\n// tree-shaking on each api instance.\nconst trace_1 = require(\"./api/trace\");\n/** Entrypoint for trace API */\nexports.trace = trace_1.TraceAPI.getInstance();\n//# sourceMappingURL=trace-api.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NonRecordingSpan = void 0;\nconst invalid_span_constants_1 = require(\"./invalid-span-constants\");\n/**\n * The NonRecordingSpan is the default {@link Span} that is used when no Span\n * implementation is available. All operations are no-op including context\n * propagation.\n */\nclass NonRecordingSpan {\n constructor(_spanContext = invalid_span_constants_1.INVALID_SPAN_CONTEXT) {\n this._spanContext = _spanContext;\n }\n // Returns a SpanContext.\n spanContext() {\n return this._spanContext;\n }\n // By default does nothing\n setAttribute(_key, _value) {\n return this;\n }\n // By default does nothing\n setAttributes(_attributes) {\n return this;\n }\n // By default does nothing\n addEvent(_name, _attributes) {\n return this;\n }\n // By default does nothing\n setStatus(_status) {\n return this;\n }\n // By default does nothing\n updateName(_name) {\n return this;\n }\n // By default does nothing\n end(_endTime) { }\n // isRecording always returns false for NonRecordingSpan.\n isRecording() {\n return false;\n }\n // By default does nothing\n recordException(_exception, _time) { }\n}\nexports.NonRecordingSpan = NonRecordingSpan;\n//# sourceMappingURL=NonRecordingSpan.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTracer = void 0;\nconst context_1 = require(\"../api/context\");\nconst context_utils_1 = require(\"../trace/context-utils\");\nconst NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\nconst spancontext_utils_1 = require(\"./spancontext-utils\");\nconst contextApi = context_1.ContextAPI.getInstance();\n/**\n * No-op implementations of {@link Tracer}.\n */\nclass NoopTracer {\n // startSpan starts a noop span.\n startSpan(name, options, context = contextApi.active()) {\n const root = Boolean(options === null || options === void 0 ? void 0 : options.root);\n if (root) {\n return new NonRecordingSpan_1.NonRecordingSpan();\n }\n const parentFromContext = context && (0, context_utils_1.getSpanContext)(context);\n if (isSpanContext(parentFromContext) &&\n (0, spancontext_utils_1.isSpanContextValid)(parentFromContext)) {\n return new NonRecordingSpan_1.NonRecordingSpan(parentFromContext);\n }\n else {\n return new NonRecordingSpan_1.NonRecordingSpan();\n }\n }\n startActiveSpan(name, arg2, arg3, arg4) {\n let opts;\n let ctx;\n let fn;\n if (arguments.length < 2) {\n return;\n }\n else if (arguments.length === 2) {\n fn = arg2;\n }\n else if (arguments.length === 3) {\n opts = arg2;\n fn = arg3;\n }\n else {\n opts = arg2;\n ctx = arg3;\n fn = arg4;\n }\n const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();\n const span = this.startSpan(name, opts, parentContext);\n const contextWithSpanSet = (0, context_utils_1.setSpan)(parentContext, span);\n return contextApi.with(contextWithSpanSet, fn, undefined, span);\n }\n}\nexports.NoopTracer = NoopTracer;\nfunction isSpanContext(spanContext) {\n return (typeof spanContext === 'object' &&\n typeof spanContext['spanId'] === 'string' &&\n typeof spanContext['traceId'] === 'string' &&\n typeof spanContext['traceFlags'] === 'number');\n}\n//# sourceMappingURL=NoopTracer.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NoopTracerProvider = void 0;\nconst NoopTracer_1 = require(\"./NoopTracer\");\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nclass NoopTracerProvider {\n getTracer(_name, _version, _options) {\n return new NoopTracer_1.NoopTracer();\n }\n}\nexports.NoopTracerProvider = NoopTracerProvider;\n//# sourceMappingURL=NoopTracerProvider.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProxyTracer = void 0;\nconst NoopTracer_1 = require(\"./NoopTracer\");\nconst NOOP_TRACER = new NoopTracer_1.NoopTracer();\n/**\n * Proxy tracer provided by the proxy tracer provider\n */\nclass ProxyTracer {\n constructor(_provider, name, version, options) {\n this._provider = _provider;\n this.name = name;\n this.version = version;\n this.options = options;\n }\n startSpan(name, options, context) {\n return this._getTracer().startSpan(name, options, context);\n }\n startActiveSpan(_name, _options, _context, _fn) {\n const tracer = this._getTracer();\n return Reflect.apply(tracer.startActiveSpan, tracer, arguments);\n }\n /**\n * Try to get a tracer from the proxy tracer provider.\n * If the proxy tracer provider has no delegate, return a noop tracer.\n */\n _getTracer() {\n if (this._delegate) {\n return this._delegate;\n }\n const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);\n if (!tracer) {\n return NOOP_TRACER;\n }\n this._delegate = tracer;\n return this._delegate;\n }\n}\nexports.ProxyTracer = ProxyTracer;\n//# sourceMappingURL=ProxyTracer.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ProxyTracerProvider = void 0;\nconst ProxyTracer_1 = require(\"./ProxyTracer\");\nconst NoopTracerProvider_1 = require(\"./NoopTracerProvider\");\nconst NOOP_TRACER_PROVIDER = new NoopTracerProvider_1.NoopTracerProvider();\n/**\n * Tracer provider which provides {@link ProxyTracer}s.\n *\n * Before a delegate is set, tracers provided are NoOp.\n * When a delegate is set, traces are provided from the delegate.\n * When a delegate is set after tracers have already been provided,\n * all tracers already provided will use the provided delegate implementation.\n */\nclass ProxyTracerProvider {\n /**\n * Get a {@link ProxyTracer}\n */\n getTracer(name, version, options) {\n var _a;\n return ((_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer_1.ProxyTracer(this, name, version, options));\n }\n getDelegate() {\n var _a;\n return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;\n }\n /**\n * Set the delegate tracer provider\n */\n setDelegate(delegate) {\n this._delegate = delegate;\n }\n getDelegateTracer(name, version, options) {\n var _a;\n return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);\n }\n}\nexports.ProxyTracerProvider = ProxyTracerProvider;\n//# sourceMappingURL=ProxyTracerProvider.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SamplingDecision = void 0;\n/**\n * @deprecated use the one declared in @opentelemetry/sdk-trace-base instead.\n * A sampling decision that determines how a {@link Span} will be recorded\n * and collected.\n */\nvar SamplingDecision;\n(function (SamplingDecision) {\n /**\n * `Span.isRecording() === false`, span will not be recorded and all events\n * and attributes will be dropped.\n */\n SamplingDecision[SamplingDecision[\"NOT_RECORD\"] = 0] = \"NOT_RECORD\";\n /**\n * `Span.isRecording() === true`, but `Sampled` flag in {@link TraceFlags}\n * MUST NOT be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD\"] = 1] = \"RECORD\";\n /**\n * `Span.isRecording() === true` AND `Sampled` flag in {@link TraceFlags}\n * MUST be set.\n */\n SamplingDecision[SamplingDecision[\"RECORD_AND_SAMPLED\"] = 2] = \"RECORD_AND_SAMPLED\";\n})(SamplingDecision = exports.SamplingDecision || (exports.SamplingDecision = {}));\n//# sourceMappingURL=SamplingResult.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getSpanContext = exports.setSpanContext = exports.deleteSpan = exports.setSpan = exports.getActiveSpan = exports.getSpan = void 0;\nconst context_1 = require(\"../context/context\");\nconst NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\nconst context_2 = require(\"../api/context\");\n/**\n * span key\n */\nconst SPAN_KEY = (0, context_1.createContextKey)('OpenTelemetry Context Key SPAN');\n/**\n * Return the span if one exists\n *\n * @param context context to get span from\n */\nfunction getSpan(context) {\n return context.getValue(SPAN_KEY) || undefined;\n}\nexports.getSpan = getSpan;\n/**\n * Gets the span from the current context, if one exists.\n */\nfunction getActiveSpan() {\n return getSpan(context_2.ContextAPI.getInstance().active());\n}\nexports.getActiveSpan = getActiveSpan;\n/**\n * Set the span on a context\n *\n * @param context context to use as parent\n * @param span span to set active\n */\nfunction setSpan(context, span) {\n return context.setValue(SPAN_KEY, span);\n}\nexports.setSpan = setSpan;\n/**\n * Remove current span stored in the context\n *\n * @param context context to delete span from\n */\nfunction deleteSpan(context) {\n return context.deleteValue(SPAN_KEY);\n}\nexports.deleteSpan = deleteSpan;\n/**\n * Wrap span context in a NoopSpan and set as span in a new\n * context\n *\n * @param context context to set active span on\n * @param spanContext span context to be wrapped\n */\nfunction setSpanContext(context, spanContext) {\n return setSpan(context, new NonRecordingSpan_1.NonRecordingSpan(spanContext));\n}\nexports.setSpanContext = setSpanContext;\n/**\n * Get the span context of the span if it exists.\n *\n * @param context context to get values from\n */\nfunction getSpanContext(context) {\n var _a;\n return (_a = getSpan(context)) === null || _a === void 0 ? void 0 : _a.spanContext();\n}\nexports.getSpanContext = getSpanContext;\n//# sourceMappingURL=context-utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceStateImpl = void 0;\nconst tracestate_validators_1 = require(\"./tracestate-validators\");\nconst MAX_TRACE_STATE_ITEMS = 32;\nconst MAX_TRACE_STATE_LEN = 512;\nconst LIST_MEMBERS_SEPARATOR = ',';\nconst LIST_MEMBER_KEY_VALUE_SPLITTER = '=';\n/**\n * TraceState must be a class and not a simple object type because of the spec\n * requirement (https://www.w3.org/TR/trace-context/#tracestate-field).\n *\n * Here is the list of allowed mutations:\n * - New key-value pair should be added into the beginning of the list\n * - The value of any key can be updated. Modified keys MUST be moved to the\n * beginning of the list.\n */\nclass TraceStateImpl {\n constructor(rawTraceState) {\n this._internalState = new Map();\n if (rawTraceState)\n this._parse(rawTraceState);\n }\n set(key, value) {\n // TODO: Benchmark the different approaches(map vs list) and\n // use the faster one.\n const traceState = this._clone();\n if (traceState._internalState.has(key)) {\n traceState._internalState.delete(key);\n }\n traceState._internalState.set(key, value);\n return traceState;\n }\n unset(key) {\n const traceState = this._clone();\n traceState._internalState.delete(key);\n return traceState;\n }\n get(key) {\n return this._internalState.get(key);\n }\n serialize() {\n return this._keys()\n .reduce((agg, key) => {\n agg.push(key + LIST_MEMBER_KEY_VALUE_SPLITTER + this.get(key));\n return agg;\n }, [])\n .join(LIST_MEMBERS_SEPARATOR);\n }\n _parse(rawTraceState) {\n if (rawTraceState.length > MAX_TRACE_STATE_LEN)\n return;\n this._internalState = rawTraceState\n .split(LIST_MEMBERS_SEPARATOR)\n .reverse() // Store in reverse so new keys (.set(...)) will be placed at the beginning\n .reduce((agg, part) => {\n const listMember = part.trim(); // Optional Whitespace (OWS) handling\n const i = listMember.indexOf(LIST_MEMBER_KEY_VALUE_SPLITTER);\n if (i !== -1) {\n const key = listMember.slice(0, i);\n const value = listMember.slice(i + 1, part.length);\n if ((0, tracestate_validators_1.validateKey)(key) && (0, tracestate_validators_1.validateValue)(value)) {\n agg.set(key, value);\n }\n else {\n // TODO: Consider to add warning log\n }\n }\n return agg;\n }, new Map());\n // Because of the reverse() requirement, trunc must be done after map is created\n if (this._internalState.size > MAX_TRACE_STATE_ITEMS) {\n this._internalState = new Map(Array.from(this._internalState.entries())\n .reverse() // Use reverse same as original tracestate parse chain\n .slice(0, MAX_TRACE_STATE_ITEMS));\n }\n }\n _keys() {\n return Array.from(this._internalState.keys()).reverse();\n }\n _clone() {\n const traceState = new TraceStateImpl();\n traceState._internalState = new Map(this._internalState);\n return traceState;\n }\n}\nexports.TraceStateImpl = TraceStateImpl;\n//# sourceMappingURL=tracestate-impl.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.validateValue = exports.validateKey = void 0;\nconst VALID_KEY_CHAR_RANGE = '[_0-9a-z-*/]';\nconst VALID_KEY = `[a-z]${VALID_KEY_CHAR_RANGE}{0,255}`;\nconst VALID_VENDOR_KEY = `[a-z0-9]${VALID_KEY_CHAR_RANGE}{0,240}@[a-z]${VALID_KEY_CHAR_RANGE}{0,13}`;\nconst VALID_KEY_REGEX = new RegExp(`^(?:${VALID_KEY}|${VALID_VENDOR_KEY})$`);\nconst VALID_VALUE_BASE_REGEX = /^[ -~]{0,255}[!-~]$/;\nconst INVALID_VALUE_COMMA_EQUAL_REGEX = /,|=/;\n/**\n * Key is opaque string up to 256 characters printable. It MUST begin with a\n * lowercase letter, and can only contain lowercase letters a-z, digits 0-9,\n * underscores _, dashes -, asterisks *, and forward slashes /.\n * For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the\n * vendor name. Vendors SHOULD set the tenant ID at the beginning of the key.\n * see https://www.w3.org/TR/trace-context/#key\n */\nfunction validateKey(key) {\n return VALID_KEY_REGEX.test(key);\n}\nexports.validateKey = validateKey;\n/**\n * Value is opaque string up to 256 characters printable ASCII RFC0020\n * characters (i.e., the range 0x20 to 0x7E) except comma , and =.\n */\nfunction validateValue(value) {\n return (VALID_VALUE_BASE_REGEX.test(value) &&\n !INVALID_VALUE_COMMA_EQUAL_REGEX.test(value));\n}\nexports.validateValue = validateValue;\n//# sourceMappingURL=tracestate-validators.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.createTraceState = void 0;\nconst tracestate_impl_1 = require(\"./tracestate-impl\");\nfunction createTraceState(rawTraceState) {\n return new tracestate_impl_1.TraceStateImpl(rawTraceState);\n}\nexports.createTraceState = createTraceState;\n//# sourceMappingURL=utils.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.INVALID_SPAN_CONTEXT = exports.INVALID_TRACEID = exports.INVALID_SPANID = void 0;\nconst trace_flags_1 = require(\"./trace_flags\");\nexports.INVALID_SPANID = '0000000000000000';\nexports.INVALID_TRACEID = '00000000000000000000000000000000';\nexports.INVALID_SPAN_CONTEXT = {\n traceId: exports.INVALID_TRACEID,\n spanId: exports.INVALID_SPANID,\n traceFlags: trace_flags_1.TraceFlags.NONE,\n};\n//# sourceMappingURL=invalid-span-constants.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SpanKind = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar SpanKind;\n(function (SpanKind) {\n /** Default value. Indicates that the span is used internally. */\n SpanKind[SpanKind[\"INTERNAL\"] = 0] = \"INTERNAL\";\n /**\n * Indicates that the span covers server-side handling of an RPC or other\n * remote request.\n */\n SpanKind[SpanKind[\"SERVER\"] = 1] = \"SERVER\";\n /**\n * Indicates that the span covers the client-side wrapper around an RPC or\n * other remote request.\n */\n SpanKind[SpanKind[\"CLIENT\"] = 2] = \"CLIENT\";\n /**\n * Indicates that the span describes producer sending a message to a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"PRODUCER\"] = 3] = \"PRODUCER\";\n /**\n * Indicates that the span describes consumer receiving a message from a\n * broker. Unlike client and server, there is no direct critical path latency\n * relationship between producer and consumer spans.\n */\n SpanKind[SpanKind[\"CONSUMER\"] = 4] = \"CONSUMER\";\n})(SpanKind = exports.SpanKind || (exports.SpanKind = {}));\n//# sourceMappingURL=span_kind.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.wrapSpanContext = exports.isSpanContextValid = exports.isValidSpanId = exports.isValidTraceId = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nconst invalid_span_constants_1 = require(\"./invalid-span-constants\");\nconst NonRecordingSpan_1 = require(\"./NonRecordingSpan\");\nconst VALID_TRACEID_REGEX = /^([0-9a-f]{32})$/i;\nconst VALID_SPANID_REGEX = /^[0-9a-f]{16}$/i;\nfunction isValidTraceId(traceId) {\n return VALID_TRACEID_REGEX.test(traceId) && traceId !== invalid_span_constants_1.INVALID_TRACEID;\n}\nexports.isValidTraceId = isValidTraceId;\nfunction isValidSpanId(spanId) {\n return VALID_SPANID_REGEX.test(spanId) && spanId !== invalid_span_constants_1.INVALID_SPANID;\n}\nexports.isValidSpanId = isValidSpanId;\n/**\n * Returns true if this {@link SpanContext} is valid.\n * @return true if this {@link SpanContext} is valid.\n */\nfunction isSpanContextValid(spanContext) {\n return (isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId));\n}\nexports.isSpanContextValid = isSpanContextValid;\n/**\n * Wrap the given {@link SpanContext} in a new non-recording {@link Span}\n *\n * @param spanContext span context to be wrapped\n * @returns a new non-recording {@link Span} with the provided context\n */\nfunction wrapSpanContext(spanContext) {\n return new NonRecordingSpan_1.NonRecordingSpan(spanContext);\n}\nexports.wrapSpanContext = wrapSpanContext;\n//# sourceMappingURL=spancontext-utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SpanStatusCode = void 0;\n/**\n * An enumeration of status codes.\n */\nvar SpanStatusCode;\n(function (SpanStatusCode) {\n /**\n * The default status.\n */\n SpanStatusCode[SpanStatusCode[\"UNSET\"] = 0] = \"UNSET\";\n /**\n * The operation has been validated by an Application developer or\n * Operator to have completed successfully.\n */\n SpanStatusCode[SpanStatusCode[\"OK\"] = 1] = \"OK\";\n /**\n * The operation contains an error.\n */\n SpanStatusCode[SpanStatusCode[\"ERROR\"] = 2] = \"ERROR\";\n})(SpanStatusCode = exports.SpanStatusCode || (exports.SpanStatusCode = {}));\n//# sourceMappingURL=status.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TraceFlags = void 0;\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar TraceFlags;\n(function (TraceFlags) {\n /** Represents no flag set. */\n TraceFlags[TraceFlags[\"NONE\"] = 0] = \"NONE\";\n /** Bit to represent whether trace is sampled in trace flags. */\n TraceFlags[TraceFlags[\"SAMPLED\"] = 1] = \"SAMPLED\";\n})(TraceFlags = exports.TraceFlags || (exports.TraceFlags = {}));\n//# sourceMappingURL=trace_flags.js.map","\"use strict\";\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VERSION = void 0;\n// this is autogenerated file, see scripts/version-update.js\nexports.VERSION = '1.4.1';\n//# sourceMappingURL=version.js.map","const { define } = require('./asn1/api')\nconst base = require('./asn1/base')\nconst constants = require('./asn1/constants')\nconst decoders = require('./asn1/decoders')\nconst encoders = require('./asn1/encoders')\n\nmodule.exports = {\n base,\n constants,\n decoders,\n define,\n encoders\n}\n","const { inherits } = require('util')\nconst encoders = require('./encoders')\nconst decoders = require('./decoders')\n\nmodule.exports.define = function define (name, body) {\n return new Entity(name, body)\n}\n\nfunction Entity (name, body) {\n this.name = name\n this.body = body\n\n this.decoders = {}\n this.encoders = {}\n}\n\nEntity.prototype._createNamed = function createNamed (Base) {\n const name = this.name\n\n function Generated (entity) {\n this._initNamed(entity, name)\n }\n inherits(Generated, Base)\n Generated.prototype._initNamed = function _initNamed (entity, name) {\n Base.call(this, entity, name)\n }\n\n return new Generated(this)\n}\n\nEntity.prototype._getDecoder = function _getDecoder (enc) {\n enc = enc || 'der'\n // Lazily create decoder\n if (!Object.prototype.hasOwnProperty.call(this.decoders, enc)) { this.decoders[enc] = this._createNamed(decoders[enc]) }\n return this.decoders[enc]\n}\n\nEntity.prototype.decode = function decode (data, enc, options) {\n return this._getDecoder(enc).decode(data, options)\n}\n\nEntity.prototype._getEncoder = function _getEncoder (enc) {\n enc = enc || 'der'\n // Lazily create encoder\n if (!Object.prototype.hasOwnProperty.call(this.encoders, enc)) { this.encoders[enc] = this._createNamed(encoders[enc]) }\n return this.encoders[enc]\n}\n\nEntity.prototype.encode = function encode (data, enc, /* internal */ reporter) {\n return this._getEncoder(enc).encode(data, reporter)\n}\n","const { inherits } = require('util')\n\nconst { Reporter } = require('../base/reporter')\n\nfunction DecoderBuffer (base, options) {\n Reporter.call(this, options)\n if (!Buffer.isBuffer(base)) {\n this.error('Input not Buffer')\n return\n }\n\n this.base = base\n this.offset = 0\n this.length = base.length\n}\ninherits(DecoderBuffer, Reporter)\n\nDecoderBuffer.isDecoderBuffer = function isDecoderBuffer (data) {\n if (data instanceof DecoderBuffer) {\n return true\n }\n\n // Or accept compatible API\n const isCompatible = typeof data === 'object' &&\n Buffer.isBuffer(data.base) &&\n data.constructor.name === 'DecoderBuffer' &&\n typeof data.offset === 'number' &&\n typeof data.length === 'number' &&\n typeof data.save === 'function' &&\n typeof data.restore === 'function' &&\n typeof data.isEmpty === 'function' &&\n typeof data.readUInt8 === 'function' &&\n typeof data.skip === 'function' &&\n typeof data.raw === 'function'\n\n return isCompatible\n}\n\nDecoderBuffer.prototype.save = function save () {\n return { offset: this.offset, reporter: Reporter.prototype.save.call(this) }\n}\n\nDecoderBuffer.prototype.restore = function restore (save) {\n // Return skipped data\n const res = new DecoderBuffer(this.base)\n res.offset = save.offset\n res.length = this.offset\n\n this.offset = save.offset\n Reporter.prototype.restore.call(this, save.reporter)\n\n return res\n}\n\nDecoderBuffer.prototype.isEmpty = function isEmpty () {\n return this.offset === this.length\n}\n\nDecoderBuffer.prototype.readUInt8 = function readUInt8 (fail) {\n if (this.offset + 1 <= this.length) { return this.base.readUInt8(this.offset++, true) } else { return this.error(fail || 'DecoderBuffer overrun') }\n}\n\nDecoderBuffer.prototype.skip = function skip (bytes, fail) {\n if (!(this.offset + bytes <= this.length)) { return this.error(fail || 'DecoderBuffer overrun') }\n\n const res = new DecoderBuffer(this.base)\n\n // Share reporter state\n res._reporterState = this._reporterState\n\n res.offset = this.offset\n res.length = this.offset + bytes\n this.offset += bytes\n return res\n}\n\nDecoderBuffer.prototype.raw = function raw (save) {\n return this.base.slice(save ? save.offset : this.offset, this.length)\n}\n\nfunction EncoderBuffer (value, reporter) {\n if (Array.isArray(value)) {\n this.length = 0\n this.value = value.map(function (item) {\n if (!EncoderBuffer.isEncoderBuffer(item)) { item = new EncoderBuffer(item, reporter) }\n this.length += item.length\n return item\n }, this)\n } else if (typeof value === 'number') {\n if (!(value >= 0 && value <= 0xff)) { return reporter.error('non-byte EncoderBuffer value') }\n this.value = value\n this.length = 1\n } else if (typeof value === 'string') {\n this.value = value\n this.length = Buffer.byteLength(value)\n } else if (Buffer.isBuffer(value)) {\n this.value = value\n this.length = value.length\n } else {\n return reporter.error(`Unsupported type: ${typeof value}`)\n }\n}\n\nEncoderBuffer.isEncoderBuffer = function isEncoderBuffer (data) {\n if (data instanceof EncoderBuffer) {\n return true\n }\n\n // Or accept compatible API\n const isCompatible = typeof data === 'object' &&\n data.constructor.name === 'EncoderBuffer' &&\n typeof data.length === 'number' &&\n typeof data.join === 'function'\n\n return isCompatible\n}\n\nEncoderBuffer.prototype.join = function join (out, offset) {\n if (!out) { out = Buffer.alloc(this.length) }\n if (!offset) { offset = 0 }\n\n if (this.length === 0) { return out }\n\n if (Array.isArray(this.value)) {\n this.value.forEach(function (item) {\n item.join(out, offset)\n offset += item.length\n })\n } else {\n if (typeof this.value === 'number') { out[offset] = this.value } else if (typeof this.value === 'string') { out.write(this.value, offset) } else if (Buffer.isBuffer(this.value)) { this.value.copy(out, offset) }\n offset += this.length\n }\n\n return out\n}\n\nmodule.exports = {\n DecoderBuffer,\n EncoderBuffer\n}\n","const { Reporter } = require('./reporter')\nconst { DecoderBuffer, EncoderBuffer } = require('./buffer')\nconst Node = require('./node')\n\nmodule.exports = {\n DecoderBuffer,\n EncoderBuffer,\n Node,\n Reporter\n}\n","const { strict: assert } = require('assert')\n\nconst { Reporter } = require('../base/reporter')\nconst { DecoderBuffer, EncoderBuffer } = require('../base/buffer')\n\n// Supported tags\nconst tags = [\n 'seq', 'seqof', 'set', 'setof', 'objid', 'bool',\n 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc',\n 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str',\n 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr'\n]\n\n// Public methods list\nconst methods = [\n 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice',\n 'any', 'contains'\n].concat(tags)\n\n// Overrided methods list\nconst overrided = [\n '_peekTag', '_decodeTag', '_use',\n '_decodeStr', '_decodeObjid', '_decodeTime',\n '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList',\n\n '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime',\n '_encodeNull', '_encodeInt', '_encodeBool'\n]\n\nfunction Node (enc, parent, name) {\n const state = {}\n this._baseState = state\n\n state.name = name\n state.enc = enc\n\n state.parent = parent || null\n state.children = null\n\n // State\n state.tag = null\n state.args = null\n state.reverseArgs = null\n state.choice = null\n state.optional = false\n state.any = false\n state.obj = false\n state.use = null\n state.useDecoder = null\n state.key = null\n state.default = null\n state.explicit = null\n state.implicit = null\n state.contains = null\n\n // Should create new instance on each method\n if (!state.parent) {\n state.children = []\n this._wrap()\n }\n}\n\nconst stateProps = [\n 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice',\n 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit',\n 'implicit', 'contains'\n]\n\nNode.prototype.clone = function clone () {\n const state = this._baseState\n const cstate = {}\n stateProps.forEach(function (prop) {\n cstate[prop] = state[prop]\n })\n const res = new this.constructor(cstate.parent)\n res._baseState = cstate\n return res\n}\n\nNode.prototype._wrap = function wrap () {\n const state = this._baseState\n methods.forEach(function (method) {\n this[method] = function _wrappedMethod () {\n const clone = new this.constructor(this)\n state.children.push(clone)\n return clone[method].apply(clone, arguments)\n }\n }, this)\n}\n\nNode.prototype._init = function init (body) {\n const state = this._baseState\n\n assert(state.parent === null)\n body.call(this)\n\n // Filter children\n state.children = state.children.filter(function (child) {\n return child._baseState.parent === this\n }, this)\n assert.equal(state.children.length, 1, 'Root node can have only one child')\n}\n\nNode.prototype._useArgs = function useArgs (args) {\n const state = this._baseState\n\n // Filter children and args\n const children = args.filter(function (arg) {\n return arg instanceof this.constructor\n }, this)\n args = args.filter(function (arg) {\n return !(arg instanceof this.constructor)\n }, this)\n\n if (children.length !== 0) {\n assert(state.children === null)\n state.children = children\n\n // Replace parent to maintain backward link\n children.forEach(function (child) {\n child._baseState.parent = this\n }, this)\n }\n if (args.length !== 0) {\n assert(state.args === null)\n state.args = args\n state.reverseArgs = args.map(function (arg) {\n if (typeof arg !== 'object' || arg.constructor !== Object) { return arg }\n\n const res = {}\n Object.keys(arg).forEach(function (key) {\n if (key == (key | 0)) { key |= 0 } // eslint-disable-line eqeqeq\n const value = arg[key]\n res[value] = key\n })\n return res\n })\n }\n}\n\n//\n// Overrided methods\n//\n\noverrided.forEach(function (method) {\n Node.prototype[method] = function _overrided () {\n const state = this._baseState\n throw new Error(`${method} not implemented for encoding: ${state.enc}`)\n }\n})\n\n//\n// Public methods\n//\n\ntags.forEach(function (tag) {\n Node.prototype[tag] = function _tagMethod () {\n const state = this._baseState\n const args = Array.prototype.slice.call(arguments)\n\n assert(state.tag === null)\n state.tag = tag\n\n this._useArgs(args)\n\n return this\n }\n})\n\nNode.prototype.use = function use (item) {\n assert(item)\n const state = this._baseState\n\n assert(state.use === null)\n state.use = item\n\n return this\n}\n\nNode.prototype.optional = function optional () {\n const state = this._baseState\n\n state.optional = true\n\n return this\n}\n\nNode.prototype.def = function def (val) {\n const state = this._baseState\n\n assert(state.default === null)\n state.default = val\n state.optional = true\n\n return this\n}\n\nNode.prototype.explicit = function explicit (num) {\n const state = this._baseState\n\n assert(state.explicit === null && state.implicit === null)\n state.explicit = num\n\n return this\n}\n\nNode.prototype.implicit = function implicit (num) {\n const state = this._baseState\n\n assert(state.explicit === null && state.implicit === null)\n state.implicit = num\n\n return this\n}\n\nNode.prototype.obj = function obj () {\n const state = this._baseState\n const args = Array.prototype.slice.call(arguments)\n\n state.obj = true\n\n if (args.length !== 0) { this._useArgs(args) }\n\n return this\n}\n\nNode.prototype.key = function key (newKey) {\n const state = this._baseState\n\n assert(state.key === null)\n state.key = newKey\n\n return this\n}\n\nNode.prototype.any = function any () {\n const state = this._baseState\n\n state.any = true\n\n return this\n}\n\nNode.prototype.choice = function choice (obj) {\n const state = this._baseState\n\n assert(state.choice === null)\n state.choice = obj\n this._useArgs(Object.keys(obj).map(function (key) {\n return obj[key]\n }))\n\n return this\n}\n\nNode.prototype.contains = function contains (item) {\n const state = this._baseState\n\n assert(state.use === null)\n state.contains = item\n\n return this\n}\n\n//\n// Decoding\n//\n\nNode.prototype._decode = function decode (input, options) {\n const state = this._baseState\n\n // Decode root node\n if (state.parent === null) { return input.wrapResult(state.children[0]._decode(input, options)) }\n\n let result = state.default\n let present = true\n\n let prevKey = null\n if (state.key !== null) { prevKey = input.enterKey(state.key) }\n\n // Check if tag is there\n if (state.optional) {\n let tag = null\n if (state.explicit !== null) { tag = state.explicit } else if (state.implicit !== null) { tag = state.implicit } else if (state.tag !== null) { tag = state.tag }\n\n if (tag === null && !state.any) {\n // Trial and Error\n const save = input.save()\n try {\n if (state.choice === null) { this._decodeGeneric(state.tag, input, options) } else { this._decodeChoice(input, options) }\n present = true\n } catch (e) {\n present = false\n }\n input.restore(save)\n } else {\n present = this._peekTag(input, tag, state.any)\n\n if (input.isError(present)) { return present }\n }\n }\n\n // Push object on stack\n let prevObj\n if (state.obj && present) { prevObj = input.enterObject() }\n\n if (present) {\n // Unwrap explicit values\n if (state.explicit !== null) {\n const explicit = this._decodeTag(input, state.explicit)\n if (input.isError(explicit)) { return explicit }\n input = explicit\n }\n\n const start = input.offset\n\n // Unwrap implicit and normal values\n if (state.use === null && state.choice === null) {\n let save\n if (state.any) { save = input.save() }\n const body = this._decodeTag(\n input,\n state.implicit !== null ? state.implicit : state.tag,\n state.any\n )\n if (input.isError(body)) { return body }\n\n if (state.any) { result = input.raw(save) } else { input = body }\n }\n\n if (options && options.track && state.tag !== null) { options.track(input.path(), start, input.length, 'tagged') }\n\n if (options && options.track && state.tag !== null) { options.track(input.path(), input.offset, input.length, 'content') }\n\n // Select proper method for tag\n if (state.any) {\n // no-op\n } else if (state.choice === null) {\n result = this._decodeGeneric(state.tag, input, options)\n } else {\n result = this._decodeChoice(input, options)\n }\n\n if (input.isError(result)) { return result }\n\n // Decode children\n if (!state.any && state.choice === null && state.children !== null) {\n state.children.forEach(function decodeChildren (child) {\n // NOTE: We are ignoring errors here, to let parser continue with other\n // parts of encoded data\n child._decode(input, options)\n })\n }\n\n // Decode contained/encoded by schema, only in bit or octet strings\n if (state.contains && (state.tag === 'octstr' || state.tag === 'bitstr')) {\n const data = new DecoderBuffer(result)\n result = this._getUse(state.contains, input._reporterState.obj)\n ._decode(data, options)\n }\n }\n\n // Pop object\n if (state.obj && present) { result = input.leaveObject(prevObj) }\n\n // Set key\n if (state.key !== null && (result !== null || present === true)) { input.leaveKey(prevKey, state.key, result) } else if (prevKey !== null) { input.exitKey(prevKey) }\n\n return result\n}\n\nNode.prototype._decodeGeneric = function decodeGeneric (tag, input, options) {\n const state = this._baseState\n\n if (tag === 'seq' || tag === 'set') { return null }\n if (tag === 'seqof' || tag === 'setof') { return this._decodeList(input, tag, state.args[0], options) } else if (/str$/.test(tag)) { return this._decodeStr(input, tag, options) } else if (tag === 'objid' && state.args) { return this._decodeObjid(input, state.args[0], state.args[1], options) } else if (tag === 'objid') { return this._decodeObjid(input, null, null, options) } else if (tag === 'gentime' || tag === 'utctime') { return this._decodeTime(input, tag, options) } else if (tag === 'null_') { return this._decodeNull(input, options) } else if (tag === 'bool') { return this._decodeBool(input, options) } else if (tag === 'objDesc') { return this._decodeStr(input, tag, options) } else if (tag === 'int' || tag === 'enum') { return this._decodeInt(input, state.args && state.args[0], options) }\n\n if (state.use !== null) {\n return this._getUse(state.use, input._reporterState.obj)\n ._decode(input, options)\n } else {\n return input.error(`unknown tag: ${tag}`)\n }\n}\n\nNode.prototype._getUse = function _getUse (entity, obj) {\n const state = this._baseState\n // Create altered use decoder if implicit is set\n state.useDecoder = this._use(entity, obj)\n assert(state.useDecoder._baseState.parent === null)\n state.useDecoder = state.useDecoder._baseState.children[0]\n if (state.implicit !== state.useDecoder._baseState.implicit) {\n state.useDecoder = state.useDecoder.clone()\n state.useDecoder._baseState.implicit = state.implicit\n }\n return state.useDecoder\n}\n\nNode.prototype._decodeChoice = function decodeChoice (input, options) {\n const state = this._baseState\n let result = null\n let match = false\n\n Object.keys(state.choice).some(function (key) {\n const save = input.save()\n const node = state.choice[key]\n try {\n const value = node._decode(input, options)\n if (input.isError(value)) { return false }\n\n result = { type: key, value: value }\n match = true\n } catch (e) {\n input.restore(save)\n return false\n }\n return true\n }, this)\n\n if (!match) { return input.error('Choice not matched') }\n\n return result\n}\n\n//\n// Encoding\n//\n\nNode.prototype._createEncoderBuffer = function createEncoderBuffer (data) {\n return new EncoderBuffer(data, this.reporter)\n}\n\nNode.prototype._encode = function encode (data, reporter, parent) {\n const state = this._baseState\n if (state.default !== null && state.default === data) { return }\n\n const result = this._encodeValue(data, reporter, parent)\n if (result === undefined) { return }\n\n if (this._skipDefault(result, reporter, parent)) { return }\n\n return result\n}\n\nNode.prototype._encodeValue = function encode (data, reporter, parent) {\n const state = this._baseState\n\n // Decode root node\n if (state.parent === null) { return state.children[0]._encode(data, reporter || new Reporter()) }\n\n let result = null\n\n // Set reporter to share it with a child class\n this.reporter = reporter\n\n // Check if data is there\n if (state.optional && data === undefined) {\n if (state.default !== null) { data = state.default } else { return }\n }\n\n // Encode children first\n let content = null\n let primitive = false\n if (state.any) {\n // Anything that was given is translated to buffer\n result = this._createEncoderBuffer(data)\n } else if (state.choice) {\n result = this._encodeChoice(data, reporter)\n } else if (state.contains) {\n content = this._getUse(state.contains, parent)._encode(data, reporter)\n primitive = true\n } else if (state.children) {\n content = state.children.map(function (child) {\n if (child._baseState.tag === 'null_') { return child._encode(null, reporter, data) }\n\n if (child._baseState.key === null) { return reporter.error('Child should have a key') }\n const prevKey = reporter.enterKey(child._baseState.key)\n\n if (typeof data !== 'object') { return reporter.error('Child expected, but input is not object') }\n\n const res = child._encode(data[child._baseState.key], reporter, data)\n reporter.leaveKey(prevKey)\n\n return res\n }, this).filter(function (child) {\n return child\n })\n content = this._createEncoderBuffer(content)\n } else {\n if (state.tag === 'seqof' || state.tag === 'setof') {\n if (!(state.args && state.args.length === 1)) { return reporter.error(`Too many args for: ${state.tag}`) }\n\n if (!Array.isArray(data)) { return reporter.error('seqof/setof, but data is not Array') }\n\n const child = this.clone()\n child._baseState.implicit = null\n content = this._createEncoderBuffer(data.map(function (item) {\n const state = this._baseState\n\n return this._getUse(state.args[0], data)._encode(item, reporter)\n }, child))\n } else if (state.use !== null) {\n result = this._getUse(state.use, parent)._encode(data, reporter)\n } else {\n content = this._encodePrimitive(state.tag, data)\n primitive = true\n }\n }\n\n // Encode data itself\n if (!state.any && state.choice === null) {\n const tag = state.implicit !== null ? state.implicit : state.tag\n const cls = state.implicit === null ? 'universal' : 'context'\n\n if (tag === null) {\n if (state.use === null) { reporter.error('Tag could be omitted only for .use()') }\n } else {\n if (state.use === null) { result = this._encodeComposite(tag, primitive, cls, content) }\n }\n }\n\n // Wrap in explicit\n if (state.explicit !== null) { result = this._encodeComposite(state.explicit, false, 'context', result) }\n\n return result\n}\n\nNode.prototype._encodeChoice = function encodeChoice (data, reporter) {\n const state = this._baseState\n\n const node = state.choice[data.type]\n if (!node) {\n assert(\n false,\n `${data.type} not found in ${JSON.stringify(Object.keys(state.choice))}`\n )\n }\n return node._encode(data.value, reporter)\n}\n\nNode.prototype._encodePrimitive = function encodePrimitive (tag, data) {\n const state = this._baseState\n\n if (/str$/.test(tag)) { return this._encodeStr(data, tag) } else if (tag === 'objid' && state.args) { return this._encodeObjid(data, state.reverseArgs[0], state.args[1]) } else if (tag === 'objid') { return this._encodeObjid(data, null, null) } else if (tag === 'gentime' || tag === 'utctime') { return this._encodeTime(data, tag) } else if (tag === 'null_') { return this._encodeNull() } else if (tag === 'int' || tag === 'enum') { return this._encodeInt(data, state.args && state.reverseArgs[0]) } else if (tag === 'bool') { return this._encodeBool(data) } else if (tag === 'objDesc') { return this._encodeStr(data, tag) } else { throw new Error(`Unsupported tag: ${tag}`) }\n}\n\nNode.prototype._isNumstr = function isNumstr (str) {\n return /^[0-9 ]*$/.test(str)\n}\n\nNode.prototype._isPrintstr = function isPrintstr (str) {\n return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str)\n}\n\nmodule.exports = Node\n","const { inherits } = require('util')\n\nfunction Reporter (options) {\n this._reporterState = {\n obj: null,\n path: [],\n options: options || {},\n errors: []\n }\n}\n\nReporter.prototype.isError = function isError (obj) {\n return obj instanceof ReporterError\n}\n\nReporter.prototype.save = function save () {\n const state = this._reporterState\n\n return { obj: state.obj, pathLen: state.path.length }\n}\n\nReporter.prototype.restore = function restore (data) {\n const state = this._reporterState\n\n state.obj = data.obj\n state.path = state.path.slice(0, data.pathLen)\n}\n\nReporter.prototype.enterKey = function enterKey (key) {\n return this._reporterState.path.push(key)\n}\n\nReporter.prototype.exitKey = function exitKey (index) {\n const state = this._reporterState\n\n state.path = state.path.slice(0, index - 1)\n}\n\nReporter.prototype.leaveKey = function leaveKey (index, key, value) {\n const state = this._reporterState\n\n this.exitKey(index)\n if (state.obj !== null) { state.obj[key] = value }\n}\n\nReporter.prototype.path = function path () {\n return this._reporterState.path.join('/')\n}\n\nReporter.prototype.enterObject = function enterObject () {\n const state = this._reporterState\n\n const prev = state.obj\n state.obj = {}\n return prev\n}\n\nReporter.prototype.leaveObject = function leaveObject (prev) {\n const state = this._reporterState\n\n const now = state.obj\n state.obj = prev\n return now\n}\n\nReporter.prototype.error = function error (msg) {\n let err\n const state = this._reporterState\n\n const inherited = msg instanceof ReporterError\n if (inherited) {\n err = msg\n } else {\n err = new ReporterError(state.path.map(function (elem) {\n return `[${JSON.stringify(elem)}]`\n }).join(''), msg.message || msg, msg.stack)\n }\n\n if (!state.options.partial) { throw err }\n\n if (!inherited) { state.errors.push(err) }\n\n return err\n}\n\nReporter.prototype.wrapResult = function wrapResult (result) {\n const state = this._reporterState\n if (!state.options.partial) { return result }\n\n return {\n result: this.isError(result) ? null : result,\n errors: state.errors\n }\n}\n\nfunction ReporterError (path, msg) {\n this.path = path\n this.rethrow(msg)\n}\ninherits(ReporterError, Error)\n\nReporterError.prototype.rethrow = function rethrow (msg) {\n this.message = `${msg} at: ${this.path || '(shallow)'}`\n if (Error.captureStackTrace) { Error.captureStackTrace(this, ReporterError) }\n\n if (!this.stack) {\n try {\n // IE only adds stack when thrown\n throw new Error(this.message)\n } catch (e) {\n this.stack = e.stack\n }\n }\n return this\n}\n\nexports.Reporter = Reporter\n","// Helper\nfunction reverse (map) {\n const res = {}\n\n Object.keys(map).forEach(function (key) {\n // Convert key to integer if it is stringified\n if ((key | 0) == key) { key = key | 0 } // eslint-disable-line eqeqeq\n\n const value = map[key]\n res[value] = key\n })\n\n return res\n}\n\nexports.tagClass = {\n 0: 'universal',\n 1: 'application',\n 2: 'context',\n 3: 'private'\n}\nexports.tagClassByName = reverse(exports.tagClass)\n\nexports.tag = {\n 0x00: 'end',\n 0x01: 'bool',\n 0x02: 'int',\n 0x03: 'bitstr',\n 0x04: 'octstr',\n 0x05: 'null_',\n 0x06: 'objid',\n 0x07: 'objDesc',\n 0x08: 'external',\n 0x09: 'real',\n 0x0a: 'enum',\n 0x0b: 'embed',\n 0x0c: 'utf8str',\n 0x0d: 'relativeOid',\n 0x10: 'seq',\n 0x11: 'set',\n 0x12: 'numstr',\n 0x13: 'printstr',\n 0x14: 't61str',\n 0x15: 'videostr',\n 0x16: 'ia5str',\n 0x17: 'utctime',\n 0x18: 'gentime',\n 0x19: 'graphstr',\n 0x1a: 'iso646str',\n 0x1b: 'genstr',\n 0x1c: 'unistr',\n 0x1d: 'charstr',\n 0x1e: 'bmpstr'\n}\nexports.tagByName = reverse(exports.tag)\n","module.exports = {\n der: require('./der')\n}\n","/* global BigInt */\nconst { inherits } = require('util')\n\nconst { DecoderBuffer } = require('../base/buffer')\nconst Node = require('../base/node')\n\n// Import DER constants\nconst der = require('../constants/der')\n\nfunction DERDecoder (entity) {\n this.enc = 'der'\n this.name = entity.name\n this.entity = entity\n\n // Construct base tree\n this.tree = new DERNode()\n this.tree._init(entity.body)\n}\n\nDERDecoder.prototype.decode = function decode (data, options) {\n if (!DecoderBuffer.isDecoderBuffer(data)) {\n data = new DecoderBuffer(data, options)\n }\n\n return this.tree._decode(data, options)\n}\n\n// Tree methods\n\nfunction DERNode (parent) {\n Node.call(this, 'der', parent)\n}\ninherits(DERNode, Node)\n\nDERNode.prototype._peekTag = function peekTag (buffer, tag, any) {\n if (buffer.isEmpty()) { return false }\n\n const state = buffer.save()\n const decodedTag = derDecodeTag(buffer, `Failed to peek tag: \"${tag}\"`)\n if (buffer.isError(decodedTag)) { return decodedTag }\n\n buffer.restore(state)\n\n return decodedTag.tag === tag || decodedTag.tagStr === tag || (decodedTag.tagStr + 'of') === tag || any\n}\n\nDERNode.prototype._decodeTag = function decodeTag (buffer, tag, any) {\n const decodedTag = derDecodeTag(buffer,\n `Failed to decode tag of \"${tag}\"`)\n if (buffer.isError(decodedTag)) { return decodedTag }\n\n let len = derDecodeLen(buffer,\n decodedTag.primitive,\n `Failed to get length of \"${tag}\"`)\n\n // Failure\n if (buffer.isError(len)) { return len }\n\n if (!any &&\n decodedTag.tag !== tag &&\n decodedTag.tagStr !== tag &&\n decodedTag.tagStr + 'of' !== tag) {\n return buffer.error(`Failed to match tag: \"${tag}\"`)\n }\n\n if (decodedTag.primitive || len !== null) { return buffer.skip(len, `Failed to match body of: \"${tag}\"`) }\n\n // Indefinite length... find END tag\n const state = buffer.save()\n const res = this._skipUntilEnd(\n buffer,\n `Failed to skip indefinite length body: \"${this.tag}\"`)\n if (buffer.isError(res)) { return res }\n\n len = buffer.offset - state.offset\n buffer.restore(state)\n return buffer.skip(len, `Failed to match body of: \"${tag}\"`)\n}\n\nDERNode.prototype._skipUntilEnd = function skipUntilEnd (buffer, fail) {\n for (;;) {\n const tag = derDecodeTag(buffer, fail)\n if (buffer.isError(tag)) { return tag }\n const len = derDecodeLen(buffer, tag.primitive, fail)\n if (buffer.isError(len)) { return len }\n\n let res\n if (tag.primitive || len !== null) { res = buffer.skip(len) } else { res = this._skipUntilEnd(buffer, fail) }\n\n // Failure\n if (buffer.isError(res)) { return res }\n\n if (tag.tagStr === 'end') { break }\n }\n}\n\nDERNode.prototype._decodeList = function decodeList (buffer, tag, decoder,\n options) {\n const result = []\n while (!buffer.isEmpty()) {\n const possibleEnd = this._peekTag(buffer, 'end')\n if (buffer.isError(possibleEnd)) { return possibleEnd }\n\n const res = decoder.decode(buffer, 'der', options)\n if (buffer.isError(res) && possibleEnd) { break }\n result.push(res)\n }\n return result\n}\n\nDERNode.prototype._decodeStr = function decodeStr (buffer, tag) {\n if (tag === 'bitstr') {\n const unused = buffer.readUInt8()\n if (buffer.isError(unused)) { return unused }\n return { unused: unused, data: buffer.raw() }\n } else if (tag === 'bmpstr') {\n const raw = buffer.raw()\n if (raw.length % 2 === 1) { return buffer.error('Decoding of string type: bmpstr length mismatch') }\n\n let str = ''\n for (let i = 0; i < raw.length / 2; i++) {\n str += String.fromCharCode(raw.readUInt16BE(i * 2))\n }\n return str\n } else if (tag === 'numstr') {\n const numstr = buffer.raw().toString('ascii')\n if (!this._isNumstr(numstr)) {\n return buffer.error('Decoding of string type: numstr unsupported characters')\n }\n return numstr\n } else if (tag === 'octstr') {\n return buffer.raw()\n } else if (tag === 'objDesc') {\n return buffer.raw()\n } else if (tag === 'printstr') {\n const printstr = buffer.raw().toString('ascii')\n if (!this._isPrintstr(printstr)) {\n return buffer.error('Decoding of string type: printstr unsupported characters')\n }\n return printstr\n } else if (/str$/.test(tag)) {\n return buffer.raw().toString()\n } else {\n return buffer.error(`Decoding of string type: ${tag} unsupported`)\n }\n}\n\nDERNode.prototype._decodeObjid = function decodeObjid (buffer, values, relative) {\n let result\n const identifiers = []\n let ident = 0\n let subident = 0\n while (!buffer.isEmpty()) {\n subident = buffer.readUInt8()\n ident <<= 7\n ident |= subident & 0x7f\n if ((subident & 0x80) === 0) {\n identifiers.push(ident)\n ident = 0\n }\n }\n if (subident & 0x80) { identifiers.push(ident) }\n\n const first = (identifiers[0] / 40) | 0\n const second = identifiers[0] % 40\n\n if (relative) { result = identifiers } else { result = [first, second].concat(identifiers.slice(1)) }\n\n if (values) {\n let tmp = values[result.join(' ')]\n if (tmp === undefined) { tmp = values[result.join('.')] }\n if (tmp !== undefined) { result = tmp }\n }\n\n return result\n}\n\nDERNode.prototype._decodeTime = function decodeTime (buffer, tag) {\n const str = buffer.raw().toString()\n\n let year\n let mon\n let day\n let hour\n let min\n let sec\n if (tag === 'gentime') {\n year = str.slice(0, 4) | 0\n mon = str.slice(4, 6) | 0\n day = str.slice(6, 8) | 0\n hour = str.slice(8, 10) | 0\n min = str.slice(10, 12) | 0\n sec = str.slice(12, 14) | 0\n } else if (tag === 'utctime') {\n year = str.slice(0, 2) | 0\n mon = str.slice(2, 4) | 0\n day = str.slice(4, 6) | 0\n hour = str.slice(6, 8) | 0\n min = str.slice(8, 10) | 0\n sec = str.slice(10, 12) | 0\n if (year < 70) { year = 2000 + year } else { year = 1900 + year }\n } else {\n return buffer.error(`Decoding ${tag} time is not supported yet`)\n }\n\n return Date.UTC(year, mon - 1, day, hour, min, sec, 0)\n}\n\nDERNode.prototype._decodeNull = function decodeNull () {\n return null\n}\n\nDERNode.prototype._decodeBool = function decodeBool (buffer) {\n const res = buffer.readUInt8()\n if (buffer.isError(res)) { return res } else { return res !== 0 }\n}\n\nDERNode.prototype._decodeInt = function decodeInt (buffer, values) {\n // Bigint, return as it is (assume big endian)\n const raw = buffer.raw()\n let res = BigInt(`0x${raw.toString('hex')}`)\n\n if (values) {\n res = values[res.toString(10)] || res\n }\n\n return res\n}\n\nDERNode.prototype._use = function use (entity, obj) {\n if (typeof entity === 'function') { entity = entity(obj) }\n return entity._getDecoder('der').tree\n}\n\n// Utility methods\n\nfunction derDecodeTag (buf, fail) {\n let tag = buf.readUInt8(fail)\n if (buf.isError(tag)) { return tag }\n\n const cls = der.tagClass[tag >> 6]\n const primitive = (tag & 0x20) === 0\n\n // Multi-octet tag - load\n if ((tag & 0x1f) === 0x1f) {\n let oct = tag\n tag = 0\n while ((oct & 0x80) === 0x80) {\n oct = buf.readUInt8(fail)\n if (buf.isError(oct)) { return oct }\n\n tag <<= 7\n tag |= oct & 0x7f\n }\n } else {\n tag &= 0x1f\n }\n const tagStr = der.tag[tag]\n\n return {\n cls: cls,\n primitive: primitive,\n tag: tag,\n tagStr: tagStr\n }\n}\n\nfunction derDecodeLen (buf, primitive, fail) {\n let len = buf.readUInt8(fail)\n if (buf.isError(len)) { return len }\n\n // Indefinite form\n if (!primitive && len === 0x80) { return null }\n\n // Definite form\n if ((len & 0x80) === 0) {\n // Short form\n return len\n }\n\n // Long form\n const num = len & 0x7f\n if (num > 4) { return buf.error('length octect is too long') }\n\n len = 0\n for (let i = 0; i < num; i++) {\n len <<= 8\n const j = buf.readUInt8(fail)\n if (buf.isError(j)) { return j }\n len |= j\n }\n\n return len\n}\n\nmodule.exports = DERDecoder\n","module.exports = {\n der: require('./der'),\n pem: require('./pem')\n}\n","const { inherits } = require('util')\n\nconst DERDecoder = require('./der')\n\nfunction PEMDecoder (entity) {\n DERDecoder.call(this, entity)\n this.enc = 'pem'\n}\ninherits(PEMDecoder, DERDecoder)\n\nPEMDecoder.prototype.decode = function decode (data, options) {\n const lines = data.toString().split(/[\\r\\n]+/g)\n\n const label = options.label.toUpperCase()\n\n const re = /^-----(BEGIN|END) ([^-]+)-----$/\n let start = -1\n let end = -1\n for (let i = 0; i < lines.length; i++) {\n const match = lines[i].match(re)\n if (match === null) { continue }\n\n if (match[2] !== label) { continue }\n\n if (start === -1) {\n if (match[1] !== 'BEGIN') { break }\n start = i\n } else {\n if (match[1] !== 'END') { break }\n end = i\n break\n }\n }\n if (start === -1 || end === -1) { throw new Error(`PEM section not found for: ${label}`) }\n\n const base64 = lines.slice(start + 1, end).join('')\n // Remove excessive symbols\n base64.replace(/[^a-z0-9+/=]+/gi, '')\n\n const input = Buffer.from(base64, 'base64')\n return DERDecoder.prototype.decode.call(this, input, options)\n}\n\nmodule.exports = PEMDecoder\n","/* global BigInt */\nconst { inherits } = require('util')\n\nconst Node = require('../base/node')\nconst der = require('../constants/der')\n\nfunction DEREncoder (entity) {\n this.enc = 'der'\n this.name = entity.name\n this.entity = entity\n\n // Construct base tree\n this.tree = new DERNode()\n this.tree._init(entity.body)\n}\n\nDEREncoder.prototype.encode = function encode (data, reporter) {\n return this.tree._encode(data, reporter).join()\n}\n\n// Tree methods\n\nfunction DERNode (parent) {\n Node.call(this, 'der', parent)\n}\ninherits(DERNode, Node)\n\nDERNode.prototype._encodeComposite = function encodeComposite (tag,\n primitive,\n cls,\n content) {\n const encodedTag = encodeTag(tag, primitive, cls, this.reporter)\n\n // Short form\n if (content.length < 0x80) {\n const header = Buffer.alloc(2)\n header[0] = encodedTag\n header[1] = content.length\n return this._createEncoderBuffer([header, content])\n }\n\n // Long form\n // Count octets required to store length\n let lenOctets = 1\n for (let i = content.length; i >= 0x100; i >>= 8) { lenOctets++ }\n\n const header = Buffer.alloc(1 + 1 + lenOctets)\n header[0] = encodedTag\n header[1] = 0x80 | lenOctets\n\n for (let i = 1 + lenOctets, j = content.length; j > 0; i--, j >>= 8) { header[i] = j & 0xff }\n\n return this._createEncoderBuffer([header, content])\n}\n\nDERNode.prototype._encodeStr = function encodeStr (str, tag) {\n if (tag === 'bitstr') {\n return this._createEncoderBuffer([str.unused | 0, str.data])\n } else if (tag === 'bmpstr') {\n const buf = Buffer.alloc(str.length * 2)\n for (let i = 0; i < str.length; i++) {\n buf.writeUInt16BE(str.charCodeAt(i), i * 2)\n }\n return this._createEncoderBuffer(buf)\n } else if (tag === 'numstr') {\n if (!this._isNumstr(str)) {\n return this.reporter.error('Encoding of string type: numstr supports only digits and space')\n }\n return this._createEncoderBuffer(str)\n } else if (tag === 'printstr') {\n if (!this._isPrintstr(str)) {\n return this.reporter.error('Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark')\n }\n return this._createEncoderBuffer(str)\n } else if (/str$/.test(tag)) {\n return this._createEncoderBuffer(str)\n } else if (tag === 'objDesc') {\n return this._createEncoderBuffer(str)\n } else {\n return this.reporter.error(`Encoding of string type: ${tag} unsupported`)\n }\n}\n\nDERNode.prototype._encodeObjid = function encodeObjid (id, values, relative) {\n if (typeof id === 'string') {\n if (!values) { return this.reporter.error('string objid given, but no values map found') }\n if (!Object.prototype.hasOwnProperty.call(values, id)) { return this.reporter.error('objid not found in values map') }\n id = values[id].split(/[\\s.]+/g)\n for (let i = 0; i < id.length; i++) { id[i] |= 0 }\n } else if (Array.isArray(id)) {\n id = id.slice()\n for (let i = 0; i < id.length; i++) { id[i] |= 0 }\n }\n\n if (!Array.isArray(id)) {\n return this.reporter.error(`objid() should be either array or string, got: ${JSON.stringify(id)}`)\n }\n\n if (!relative) {\n if (id[1] >= 40) { return this.reporter.error('Second objid identifier OOB') }\n id.splice(0, 2, id[0] * 40 + id[1])\n }\n\n // Count number of octets\n let size = 0\n for (let i = 0; i < id.length; i++) {\n let ident = id[i]\n for (size++; ident >= 0x80; ident >>= 7) { size++ }\n }\n\n const objid = Buffer.alloc(size)\n let offset = objid.length - 1\n for (let i = id.length - 1; i >= 0; i--) {\n let ident = id[i]\n objid[offset--] = ident & 0x7f\n while ((ident >>= 7) > 0) { objid[offset--] = 0x80 | (ident & 0x7f) }\n }\n\n return this._createEncoderBuffer(objid)\n}\n\nfunction two (num) {\n if (num < 10) { return `0${num}` } else { return num }\n}\n\nDERNode.prototype._encodeTime = function encodeTime (time, tag) {\n let str\n const date = new Date(time)\n\n if (tag === 'gentime') {\n str = [\n two(date.getUTCFullYear()),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('')\n } else if (tag === 'utctime') {\n str = [\n two(date.getUTCFullYear() % 100),\n two(date.getUTCMonth() + 1),\n two(date.getUTCDate()),\n two(date.getUTCHours()),\n two(date.getUTCMinutes()),\n two(date.getUTCSeconds()),\n 'Z'\n ].join('')\n } else {\n this.reporter.error(`Encoding ${tag} time is not supported yet`)\n }\n\n return this._encodeStr(str, 'octstr')\n}\n\nDERNode.prototype._encodeNull = function encodeNull () {\n return this._createEncoderBuffer('')\n}\n\nfunction bnToBuf (bn) {\n var hex = BigInt(bn).toString(16)\n if (hex.length % 2) { hex = '0' + hex }\n\n var len = hex.length / 2\n var u8 = new Uint8Array(len)\n\n var i = 0\n var j = 0\n while (i < len) {\n u8[i] = parseInt(hex.slice(j, j + 2), 16)\n i += 1\n j += 2\n }\n\n return u8\n}\n\nDERNode.prototype._encodeInt = function encodeInt (num, values) {\n if (typeof num === 'string') {\n if (!values) { return this.reporter.error('String int or enum given, but no values map') }\n if (!Object.prototype.hasOwnProperty.call(values, num)) {\n return this.reporter.error(`Values map doesn't contain: ${JSON.stringify(num)}`)\n }\n num = values[num]\n }\n\n if (typeof num === 'bigint') {\n const numArray = [...bnToBuf(num)]\n if (numArray[0] & 0x80) {\n numArray.unshift(0)\n }\n num = Buffer.from(numArray)\n }\n\n if (Buffer.isBuffer(num)) {\n let size = num.length\n if (num.length === 0) { size++ }\n\n const out = Buffer.alloc(size)\n num.copy(out)\n if (num.length === 0) { out[0] = 0 }\n return this._createEncoderBuffer(out)\n }\n\n if (num < 0x80) { return this._createEncoderBuffer(num) }\n\n if (num < 0x100) { return this._createEncoderBuffer([0, num]) }\n\n let size = 1\n for (let i = num; i >= 0x100; i >>= 8) { size++ }\n\n const out = new Array(size)\n for (let i = out.length - 1; i >= 0; i--) {\n out[i] = num & 0xff\n num >>= 8\n }\n if (out[0] & 0x80) {\n out.unshift(0)\n }\n\n return this._createEncoderBuffer(Buffer.from(out))\n}\n\nDERNode.prototype._encodeBool = function encodeBool (value) {\n return this._createEncoderBuffer(value ? 0xff : 0)\n}\n\nDERNode.prototype._use = function use (entity, obj) {\n if (typeof entity === 'function') { entity = entity(obj) }\n return entity._getEncoder('der').tree\n}\n\nDERNode.prototype._skipDefault = function skipDefault (dataBuffer, reporter, parent) {\n const state = this._baseState\n let i\n if (state.default === null) { return false }\n\n const data = dataBuffer.join()\n if (state.defaultBuffer === undefined) { state.defaultBuffer = this._encodeValue(state.default, reporter, parent).join() }\n\n if (data.length !== state.defaultBuffer.length) { return false }\n\n for (i = 0; i < data.length; i++) {\n if (data[i] !== state.defaultBuffer[i]) { return false }\n }\n\n return true\n}\n\n// Utility methods\n\nfunction encodeTag (tag, primitive, cls, reporter) {\n let res\n\n if (tag === 'seqof') { tag = 'seq' } else if (tag === 'setof') { tag = 'set' }\n\n if (Object.prototype.hasOwnProperty.call(der.tagByName, tag)) { res = der.tagByName[tag] } else if (typeof tag === 'number' && (tag | 0) === tag) { res = tag } else { return reporter.error(`Unknown tag: ${tag}`) }\n\n if (res >= 0x1f) { return reporter.error('Multi-octet tag encoding unsupported') }\n\n if (!primitive) { res |= 0x20 }\n\n res |= (der.tagClassByName[cls || 'universal'] << 6)\n\n return res\n}\n\nmodule.exports = DEREncoder\n","module.exports = {\n der: require('./der'),\n pem: require('./pem')\n}\n","const { inherits } = require('util')\n\nconst DEREncoder = require('./der')\n\nfunction PEMEncoder (entity) {\n DEREncoder.call(this, entity)\n this.enc = 'pem'\n}\ninherits(PEMEncoder, DEREncoder)\n\nPEMEncoder.prototype.encode = function encode (data, options) {\n const buf = DEREncoder.prototype.encode.call(this, data)\n\n const p = buf.toString('base64')\n const out = [`-----BEGIN ${options.label}-----`]\n for (let i = 0; i < p.length; i += 64) { out.push(p.slice(i, i + 64)) }\n out.push(`-----END ${options.label}-----`)\n return out.join('\\n')\n}\n\nmodule.exports = PEMEncoder\n","'use strict';\nconst indentString = require('indent-string');\nconst cleanStack = require('clean-stack');\n\nconst cleanInternalStack = stack => stack.replace(/\\s+at .*aggregate-error\\/index.js:\\d+:\\d+\\)?/g, '');\n\nclass AggregateError extends Error {\n\tconstructor(errors) {\n\t\tif (!Array.isArray(errors)) {\n\t\t\tthrow new TypeError(`Expected input to be an Array, got ${typeof errors}`);\n\t\t}\n\n\t\terrors = [...errors].map(error => {\n\t\t\tif (error instanceof Error) {\n\t\t\t\treturn error;\n\t\t\t}\n\n\t\t\tif (error !== null && typeof error === 'object') {\n\t\t\t\t// Handle plain error objects with message property and/or possibly other metadata\n\t\t\t\treturn Object.assign(new Error(error.message), error);\n\t\t\t}\n\n\t\t\treturn new Error(error);\n\t\t});\n\n\t\tlet message = errors\n\t\t\t.map(error => {\n\t\t\t\t// The `stack` property is not standardized, so we can't assume it exists\n\t\t\t\treturn typeof error.stack === 'string' ? cleanInternalStack(cleanStack(error.stack)) : String(error);\n\t\t\t})\n\t\t\t.join('\\n');\n\t\tmessage = '\\n' + indentString(message, 4);\n\t\tsuper(message);\n\n\t\tthis.name = 'AggregateError';\n\n\t\tObject.defineProperty(this, '_errors', {value: errors});\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tfor (const error of this._errors) {\n\t\t\tyield error;\n\t\t}\n\t}\n}\n\nmodule.exports = AggregateError;\n","'use strict';\n\nvar compileSchema = require('./compile')\n , resolve = require('./compile/resolve')\n , Cache = require('./cache')\n , SchemaObject = require('./compile/schema_obj')\n , stableStringify = require('fast-json-stable-stringify')\n , formats = require('./compile/formats')\n , rules = require('./compile/rules')\n , $dataMetaSchema = require('./data')\n , util = require('./compile/util');\n\nmodule.exports = Ajv;\n\nAjv.prototype.validate = validate;\nAjv.prototype.compile = compile;\nAjv.prototype.addSchema = addSchema;\nAjv.prototype.addMetaSchema = addMetaSchema;\nAjv.prototype.validateSchema = validateSchema;\nAjv.prototype.getSchema = getSchema;\nAjv.prototype.removeSchema = removeSchema;\nAjv.prototype.addFormat = addFormat;\nAjv.prototype.errorsText = errorsText;\n\nAjv.prototype._addSchema = _addSchema;\nAjv.prototype._compile = _compile;\n\nAjv.prototype.compileAsync = require('./compile/async');\nvar customKeyword = require('./keyword');\nAjv.prototype.addKeyword = customKeyword.add;\nAjv.prototype.getKeyword = customKeyword.get;\nAjv.prototype.removeKeyword = customKeyword.remove;\nAjv.prototype.validateKeyword = customKeyword.validate;\n\nvar errorClasses = require('./compile/error_classes');\nAjv.ValidationError = errorClasses.Validation;\nAjv.MissingRefError = errorClasses.MissingRef;\nAjv.$dataMetaSchema = $dataMetaSchema;\n\nvar META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';\n\nvar META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ];\nvar META_SUPPORT_DATA = ['/properties'];\n\n/**\n * Creates validator instance.\n * Usage: `Ajv(opts)`\n * @param {Object} opts optional options\n * @return {Object} ajv instance\n */\nfunction Ajv(opts) {\n if (!(this instanceof Ajv)) return new Ajv(opts);\n opts = this._opts = util.copy(opts) || {};\n setLogger(this);\n this._schemas = {};\n this._refs = {};\n this._fragments = {};\n this._formats = formats(opts.format);\n\n this._cache = opts.cache || new Cache;\n this._loadingSchemas = {};\n this._compilations = [];\n this.RULES = rules();\n this._getId = chooseGetId(opts);\n\n opts.loopRequired = opts.loopRequired || Infinity;\n if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;\n if (opts.serialize === undefined) opts.serialize = stableStringify;\n this._metaOpts = getMetaSchemaOptions(this);\n\n if (opts.formats) addInitialFormats(this);\n if (opts.keywords) addInitialKeywords(this);\n addDefaultMetaSchema(this);\n if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);\n if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});\n addInitialSchemas(this);\n}\n\n\n\n/**\n * Validate data using schema\n * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.\n * @this Ajv\n * @param {String|Object} schemaKeyRef key, ref or schema object\n * @param {Any} data to be validated\n * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).\n */\nfunction validate(schemaKeyRef, data) {\n var v;\n if (typeof schemaKeyRef == 'string') {\n v = this.getSchema(schemaKeyRef);\n if (!v) throw new Error('no schema with key or ref \"' + schemaKeyRef + '\"');\n } else {\n var schemaObj = this._addSchema(schemaKeyRef);\n v = schemaObj.validate || this._compile(schemaObj);\n }\n\n var valid = v(data);\n if (v.$async !== true) this.errors = v.errors;\n return valid;\n}\n\n\n/**\n * Create validating function for passed schema.\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.\n * @return {Function} validating function\n */\nfunction compile(schema, _meta) {\n var schemaObj = this._addSchema(schema, undefined, _meta);\n return schemaObj.validate || this._compile(schemaObj);\n}\n\n\n/**\n * Adds schema to the instance.\n * @this Ajv\n * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.\n * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.\n * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.\n * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.\n * @return {Ajv} this for method chaining\n */\nfunction addSchema(schema, key, _skipValidation, _meta) {\n if (Array.isArray(schema)){\n for (var i=0; i} errors optional array of validation errors, if not passed errors from the instance are used.\n * @param {Object} options optional options with properties `separator` and `dataVar`.\n * @return {String} human readable string with all errors descriptions\n */\nfunction errorsText(errors, options) {\n errors = errors || this.errors;\n if (!errors) return 'No errors';\n options = options || {};\n var separator = options.separator === undefined ? ', ' : options.separator;\n var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;\n\n var text = '';\n for (var i=0; i%\\\\^`{|}]|%[0-9a-f]{2})|\\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\\*)?)*\\})*$/i;\n// For the source: https://gist.github.com/dperini/729294\n// For test cases: https://mathiasbynens.be/demo/url-regex\n// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.\n// var URL = /^(?:(?:https?|ftp):\\/\\/)(?:\\S+(?::\\S*)?@)?(?:(?!10(?:\\.\\d{1,3}){3})(?!127(?:\\.\\d{1,3}){3})(?!169\\.254(?:\\.\\d{1,3}){2})(?!192\\.168(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-)*[a-z\\u{00a1}-\\u{ffff}0-9]+)(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}0-9]+-)*[a-z\\u{00a1}-\\u{ffff}0-9]+)*(?:\\.(?:[a-z\\u{00a1}-\\u{ffff}]{2,})))(?::\\d{2,5})?(?:\\/[^\\s]*)?$/iu;\nvar URL = /^(?:(?:http[s\\u017F]?|ftp):\\/\\/)(?:(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+(?::(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?@)?(?:(?!10(?:\\.[0-9]{1,3}){3})(?!127(?:\\.[0-9]{1,3}){3})(?!169\\.254(?:\\.[0-9]{1,3}){2})(?!192\\.168(?:\\.[0-9]{1,3}){2})(?!172\\.(?:1[6-9]|2[0-9]|3[01])(?:\\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-)*(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)(?:\\.(?:(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+-)*(?:[0-9a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])+)*(?:\\.(?:(?:[a-z\\xA1-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\\/(?:[\\0-\\x08\\x0E-\\x1F!-\\x9F\\xA1-\\u167F\\u1681-\\u1FFF\\u200B-\\u2027\\u202A-\\u202E\\u2030-\\u205E\\u2060-\\u2FFF\\u3001-\\uD7FF\\uE000-\\uFEFE\\uFF00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF])*)?$/i;\nvar UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;\nvar JSON_POINTER = /^(?:\\/(?:[^~/]|~0|~1)*)*$/;\nvar JSON_POINTER_URI_FRAGMENT = /^#(?:\\/(?:[a-z0-9_\\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;\nvar RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\\/(?:[^~/]|~0|~1)*)*)$/;\n\n\nmodule.exports = formats;\n\nfunction formats(mode) {\n mode = mode == 'full' ? 'full' : 'fast';\n return util.copy(formats[mode]);\n}\n\n\nformats.fast = {\n // date: http://tools.ietf.org/html/rfc3339#section-5.6\n date: /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d$/,\n // date-time: http://tools.ietf.org/html/rfc3339#section-5.6\n time: /^(?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)?$/i,\n 'date-time': /^\\d\\d\\d\\d-[0-1]\\d-[0-3]\\d[t\\s](?:[0-2]\\d:[0-5]\\d:[0-5]\\d|23:59:60)(?:\\.\\d+)?(?:z|[+-]\\d\\d(?::?\\d\\d)?)$/i,\n // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js\n uri: /^(?:[a-z][a-z0-9+\\-.]*:)(?:\\/?\\/)?[^\\s]*$/i,\n 'uri-reference': /^(?:(?:[a-z][a-z0-9+\\-.]*:)?\\/?\\/)?(?:[^\\\\\\s#][^\\s#]*)?(?:#[^\\\\\\s]*)?$/i,\n 'uri-template': URITEMPLATE,\n url: URL,\n // email (sources from jsen validator):\n // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363\n // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')\n email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,\n hostname: HOSTNAME,\n // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses\n ipv6: /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i,\n regex: regex,\n // uuid: http://tools.ietf.org/html/rfc4122\n uuid: UUID,\n // JSON-pointer: https://tools.ietf.org/html/rfc6901\n // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A\n 'json-pointer': JSON_POINTER,\n 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,\n // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00\n 'relative-json-pointer': RELATIVE_JSON_POINTER\n};\n\n\nformats.full = {\n date: date,\n time: time,\n 'date-time': date_time,\n uri: uri,\n 'uri-reference': URIREF,\n 'uri-template': URITEMPLATE,\n url: URL,\n email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,\n hostname: HOSTNAME,\n ipv4: /^(?:(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)\\.){3}(?:25[0-5]|2[0-4]\\d|[01]?\\d\\d?)$/,\n ipv6: /^\\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(?:%.+)?\\s*$/i,\n regex: regex,\n uuid: UUID,\n 'json-pointer': JSON_POINTER,\n 'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,\n 'relative-json-pointer': RELATIVE_JSON_POINTER\n};\n\n\nfunction isLeapYear(year) {\n // https://tools.ietf.org/html/rfc3339#appendix-C\n return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n\n\nfunction date(str) {\n // full-date from http://tools.ietf.org/html/rfc3339#section-5.6\n var matches = str.match(DATE);\n if (!matches) return false;\n\n var year = +matches[1];\n var month = +matches[2];\n var day = +matches[3];\n\n return month >= 1 && month <= 12 && day >= 1 &&\n day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);\n}\n\n\nfunction time(str, full) {\n var matches = str.match(TIME);\n if (!matches) return false;\n\n var hour = matches[1];\n var minute = matches[2];\n var second = matches[3];\n var timeZone = matches[5];\n return ((hour <= 23 && minute <= 59 && second <= 59) ||\n (hour == 23 && minute == 59 && second == 60)) &&\n (!full || timeZone);\n}\n\n\nvar DATE_TIME_SEPARATOR = /t|\\s/i;\nfunction date_time(str) {\n // http://tools.ietf.org/html/rfc3339#section-5.6\n var dateTime = str.split(DATE_TIME_SEPARATOR);\n return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);\n}\n\n\nvar NOT_URI_FRAGMENT = /\\/|:/;\nfunction uri(str) {\n // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required \".\"\n return NOT_URI_FRAGMENT.test(str) && URI.test(str);\n}\n\n\nvar Z_ANCHOR = /[^\\\\]\\\\Z/;\nfunction regex(str) {\n if (Z_ANCHOR.test(str)) return false;\n try {\n new RegExp(str);\n return true;\n } catch(e) {\n return false;\n }\n}\n","'use strict';\n\nvar resolve = require('./resolve')\n , util = require('./util')\n , errorClasses = require('./error_classes')\n , stableStringify = require('fast-json-stable-stringify');\n\nvar validateGenerator = require('../dotjs/validate');\n\n/**\n * Functions below are used inside compiled validations function\n */\n\nvar ucs2length = util.ucs2length;\nvar equal = require('fast-deep-equal');\n\n// this error is thrown by async schemas to return validation errors via exception\nvar ValidationError = errorClasses.Validation;\n\nmodule.exports = compile;\n\n\n/**\n * Compiles schema to validation function\n * @this Ajv\n * @param {Object} schema schema object\n * @param {Object} root object with information about the root schema for this schema\n * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution\n * @param {String} baseId base ID for IDs in the schema\n * @return {Function} validation function\n */\nfunction compile(schema, root, localRefs, baseId) {\n /* jshint validthis: true, evil: true */\n /* eslint no-shadow: 0 */\n var self = this\n , opts = this._opts\n , refVal = [ undefined ]\n , refs = {}\n , patterns = []\n , patternsHash = {}\n , defaults = []\n , defaultsHash = {}\n , customRules = [];\n\n root = root || { schema: schema, refVal: refVal, refs: refs };\n\n var c = checkCompiling.call(this, schema, root, baseId);\n var compilation = this._compilations[c.index];\n if (c.compiling) return (compilation.callValidate = callValidate);\n\n var formats = this._formats;\n var RULES = this.RULES;\n\n try {\n var v = localCompile(schema, root, localRefs, baseId);\n compilation.validate = v;\n var cv = compilation.callValidate;\n if (cv) {\n cv.schema = v.schema;\n cv.errors = null;\n cv.refs = v.refs;\n cv.refVal = v.refVal;\n cv.root = v.root;\n cv.$async = v.$async;\n if (opts.sourceCode) cv.source = v.source;\n }\n return v;\n } finally {\n endCompiling.call(this, schema, root, baseId);\n }\n\n /* @this {*} - custom context, see passContext option */\n function callValidate() {\n /* jshint validthis: true */\n var validate = compilation.validate;\n var result = validate.apply(this, arguments);\n callValidate.errors = validate.errors;\n return result;\n }\n\n function localCompile(_schema, _root, localRefs, baseId) {\n var isRoot = !_root || (_root && _root.schema == _schema);\n if (_root.schema != root.schema)\n return compile.call(self, _schema, _root, localRefs, baseId);\n\n var $async = _schema.$async === true;\n\n var sourceCode = validateGenerator({\n isTop: true,\n schema: _schema,\n isRoot: isRoot,\n baseId: baseId,\n root: _root,\n schemaPath: '',\n errSchemaPath: '#',\n errorPath: '\"\"',\n MissingRefError: errorClasses.MissingRef,\n RULES: RULES,\n validate: validateGenerator,\n util: util,\n resolve: resolve,\n resolveRef: resolveRef,\n usePattern: usePattern,\n useDefault: useDefault,\n useCustomRule: useCustomRule,\n opts: opts,\n formats: formats,\n logger: self.logger,\n self: self\n });\n\n sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)\n + vars(defaults, defaultCode) + vars(customRules, customRuleCode)\n + sourceCode;\n\n if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);\n // console.log('\\n\\n\\n *** \\n', JSON.stringify(sourceCode));\n var validate;\n try {\n var makeValidate = new Function(\n 'self',\n 'RULES',\n 'formats',\n 'root',\n 'refVal',\n 'defaults',\n 'customRules',\n 'equal',\n 'ucs2length',\n 'ValidationError',\n sourceCode\n );\n\n validate = makeValidate(\n self,\n RULES,\n formats,\n root,\n refVal,\n defaults,\n customRules,\n equal,\n ucs2length,\n ValidationError\n );\n\n refVal[0] = validate;\n } catch(e) {\n self.logger.error('Error compiling schema, function code:', sourceCode);\n throw e;\n }\n\n validate.schema = _schema;\n validate.errors = null;\n validate.refs = refs;\n validate.refVal = refVal;\n validate.root = isRoot ? validate : _root;\n if ($async) validate.$async = true;\n if (opts.sourceCode === true) {\n validate.source = {\n code: sourceCode,\n patterns: patterns,\n defaults: defaults\n };\n }\n\n return validate;\n }\n\n function resolveRef(baseId, ref, isRoot) {\n ref = resolve.url(baseId, ref);\n var refIndex = refs[ref];\n var _refVal, refCode;\n if (refIndex !== undefined) {\n _refVal = refVal[refIndex];\n refCode = 'refVal[' + refIndex + ']';\n return resolvedRef(_refVal, refCode);\n }\n if (!isRoot && root.refs) {\n var rootRefId = root.refs[ref];\n if (rootRefId !== undefined) {\n _refVal = root.refVal[rootRefId];\n refCode = addLocalRef(ref, _refVal);\n return resolvedRef(_refVal, refCode);\n }\n }\n\n refCode = addLocalRef(ref);\n var v = resolve.call(self, localCompile, root, ref);\n if (v === undefined) {\n var localSchema = localRefs && localRefs[ref];\n if (localSchema) {\n v = resolve.inlineRef(localSchema, opts.inlineRefs)\n ? localSchema\n : compile.call(self, localSchema, root, localRefs, baseId);\n }\n }\n\n if (v === undefined) {\n removeLocalRef(ref);\n } else {\n replaceLocalRef(ref, v);\n return resolvedRef(v, refCode);\n }\n }\n\n function addLocalRef(ref, v) {\n var refId = refVal.length;\n refVal[refId] = v;\n refs[ref] = refId;\n return 'refVal' + refId;\n }\n\n function removeLocalRef(ref) {\n delete refs[ref];\n }\n\n function replaceLocalRef(ref, v) {\n var refId = refs[ref];\n refVal[refId] = v;\n }\n\n function resolvedRef(refVal, code) {\n return typeof refVal == 'object' || typeof refVal == 'boolean'\n ? { code: code, schema: refVal, inline: true }\n : { code: code, $async: refVal && !!refVal.$async };\n }\n\n function usePattern(regexStr) {\n var index = patternsHash[regexStr];\n if (index === undefined) {\n index = patternsHash[regexStr] = patterns.length;\n patterns[index] = regexStr;\n }\n return 'pattern' + index;\n }\n\n function useDefault(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n return '' + value;\n case 'string':\n return util.toQuotedString(value);\n case 'object':\n if (value === null) return 'null';\n var valueStr = stableStringify(value);\n var index = defaultsHash[valueStr];\n if (index === undefined) {\n index = defaultsHash[valueStr] = defaults.length;\n defaults[index] = value;\n }\n return 'default' + index;\n }\n }\n\n function useCustomRule(rule, schema, parentSchema, it) {\n if (self._opts.validateSchema !== false) {\n var deps = rule.definition.dependencies;\n if (deps && !deps.every(function(keyword) {\n return Object.prototype.hasOwnProperty.call(parentSchema, keyword);\n }))\n throw new Error('parent schema must have all required keywords: ' + deps.join(','));\n\n var validateSchema = rule.definition.validateSchema;\n if (validateSchema) {\n var valid = validateSchema(schema);\n if (!valid) {\n var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);\n if (self._opts.validateSchema == 'log') self.logger.error(message);\n else throw new Error(message);\n }\n }\n }\n\n var compile = rule.definition.compile\n , inline = rule.definition.inline\n , macro = rule.definition.macro;\n\n var validate;\n if (compile) {\n validate = compile.call(self, schema, parentSchema, it);\n } else if (macro) {\n validate = macro.call(self, schema, parentSchema, it);\n if (opts.validateSchema !== false) self.validateSchema(validate, true);\n } else if (inline) {\n validate = inline.call(self, it, rule.keyword, schema, parentSchema);\n } else {\n validate = rule.definition.validate;\n if (!validate) return;\n }\n\n if (validate === undefined)\n throw new Error('custom keyword \"' + rule.keyword + '\"failed to compile');\n\n var index = customRules.length;\n customRules[index] = validate;\n\n return {\n code: 'customRule' + index,\n validate: validate\n };\n }\n}\n\n\n/**\n * Checks if the schema is currently compiled\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n * @return {Object} object with properties \"index\" (compilation index) and \"compiling\" (boolean)\n */\nfunction checkCompiling(schema, root, baseId) {\n /* jshint validthis: true */\n var index = compIndex.call(this, schema, root, baseId);\n if (index >= 0) return { index: index, compiling: true };\n index = this._compilations.length;\n this._compilations[index] = {\n schema: schema,\n root: root,\n baseId: baseId\n };\n return { index: index, compiling: false };\n}\n\n\n/**\n * Removes the schema from the currently compiled list\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n */\nfunction endCompiling(schema, root, baseId) {\n /* jshint validthis: true */\n var i = compIndex.call(this, schema, root, baseId);\n if (i >= 0) this._compilations.splice(i, 1);\n}\n\n\n/**\n * Index of schema compilation in the currently compiled list\n * @this Ajv\n * @param {Object} schema schema to compile\n * @param {Object} root root object\n * @param {String} baseId base schema ID\n * @return {Integer} compilation index\n */\nfunction compIndex(schema, root, baseId) {\n /* jshint validthis: true */\n for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) {\n // high surrogate, and there is a next character\n value = str.charCodeAt(pos);\n if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate\n }\n }\n return length;\n};\n","'use strict';\n\n\nmodule.exports = {\n copy: copy,\n checkDataType: checkDataType,\n checkDataTypes: checkDataTypes,\n coerceToTypes: coerceToTypes,\n toHash: toHash,\n getProperty: getProperty,\n escapeQuotes: escapeQuotes,\n equal: require('fast-deep-equal'),\n ucs2length: require('./ucs2length'),\n varOccurences: varOccurences,\n varReplace: varReplace,\n schemaHasRules: schemaHasRules,\n schemaHasRulesExcept: schemaHasRulesExcept,\n schemaUnknownRules: schemaUnknownRules,\n toQuotedString: toQuotedString,\n getPathExpr: getPathExpr,\n getPath: getPath,\n getData: getData,\n unescapeFragment: unescapeFragment,\n unescapeJsonPointer: unescapeJsonPointer,\n escapeFragment: escapeFragment,\n escapeJsonPointer: escapeJsonPointer\n};\n\n\nfunction copy(o, to) {\n to = to || {};\n for (var key in o) to[key] = o[key];\n return to;\n}\n\n\nfunction checkDataType(dataType, data, strictNumbers, negate) {\n var EQUAL = negate ? ' !== ' : ' === '\n , AND = negate ? ' || ' : ' && '\n , OK = negate ? '!' : ''\n , NOT = negate ? '' : '!';\n switch (dataType) {\n case 'null': return data + EQUAL + 'null';\n case 'array': return OK + 'Array.isArray(' + data + ')';\n case 'object': return '(' + OK + data + AND +\n 'typeof ' + data + EQUAL + '\"object\"' + AND +\n NOT + 'Array.isArray(' + data + '))';\n case 'integer': return '(typeof ' + data + EQUAL + '\"number\"' + AND +\n NOT + '(' + data + ' % 1)' +\n AND + data + EQUAL + data +\n (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';\n case 'number': return '(typeof ' + data + EQUAL + '\"' + dataType + '\"' +\n (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';\n default: return 'typeof ' + data + EQUAL + '\"' + dataType + '\"';\n }\n}\n\n\nfunction checkDataTypes(dataTypes, data, strictNumbers) {\n switch (dataTypes.length) {\n case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);\n default:\n var code = '';\n var types = toHash(dataTypes);\n if (types.array && types.object) {\n code = types.null ? '(': '(!' + data + ' || ';\n code += 'typeof ' + data + ' !== \"object\")';\n delete types.null;\n delete types.array;\n delete types.object;\n }\n if (types.number) delete types.integer;\n for (var t in types)\n code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true);\n\n return code;\n }\n}\n\n\nvar COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);\nfunction coerceToTypes(optionCoerceTypes, dataTypes) {\n if (Array.isArray(dataTypes)) {\n var types = [];\n for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);\n return paths[lvl - up];\n }\n\n if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);\n data = 'data' + ((lvl - up) || '');\n if (!jsonPointer) return data;\n }\n\n var expr = data;\n var segments = jsonPointer.split('/');\n for (var i=0; i',\n $notOp = $isMax ? '>' : '<',\n $errorKeyword = undefined;\n if (!($isData || typeof $schema == 'number' || $schema === undefined)) {\n throw new Error($keyword + ' must be number');\n }\n if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) {\n throw new Error($exclusiveKeyword + ' must be number or boolean');\n }\n if ($isDataExcl) {\n var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),\n $exclusive = 'exclusive' + $lvl,\n $exclType = 'exclType' + $lvl,\n $exclIsNumber = 'exclIsNumber' + $lvl,\n $opExpr = 'op' + $lvl,\n $opStr = '\\' + ' + $opExpr + ' + \\'';\n out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';\n $schemaValueExcl = 'schemaExcl' + $lvl;\n out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \\'boolean\\' && ' + ($exclType) + ' != \\'undefined\\' && ' + ($exclType) + ' != \\'number\\') { ';\n var $errorKeyword = $exclusiveKeyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_exclusiveLimit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'' + ($exclusiveKeyword) + ' should be boolean\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($exclType) + ' == \\'number\\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \\'' + ($op) + '\\' : \\'' + ($op) + '=\\'; ';\n if ($schema === undefined) {\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $schemaValue = $schemaValueExcl;\n $isData = $isDataExcl;\n }\n } else {\n var $exclIsNumber = typeof $schemaExcl == 'number',\n $opStr = $op;\n if ($exclIsNumber && $isData) {\n var $opExpr = '\\'' + $opStr + '\\'';\n out += ' if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';\n } else {\n if ($exclIsNumber && $schema === undefined) {\n $exclusive = true;\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $schemaValue = $schemaExcl;\n $notOp += '=';\n } else {\n if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);\n if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {\n $exclusive = true;\n $errorKeyword = $exclusiveKeyword;\n $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;\n $notOp += '=';\n } else {\n $exclusive = false;\n $opStr += '=';\n }\n }\n var $opExpr = '\\'' + $opStr + '\\'';\n out += ' if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';\n }\n }\n $errorKeyword = $errorKeyword || $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limit') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ' + ($opStr) + ' ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue);\n } else {\n out += '' + ($schemaValue) + '\\'';\n }\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxItems' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have ';\n if ($keyword == 'maxItems') {\n out += 'more';\n } else {\n out += 'fewer';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' items\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitLength(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxLength' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n if (it.opts.unicode === false) {\n out += ' ' + ($data) + '.length ';\n } else {\n out += ' ucs2length(' + ($data) + ') ';\n }\n out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitLength') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be ';\n if ($keyword == 'maxLength') {\n out += 'longer';\n } else {\n out += 'shorter';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' characters\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate__limitProperties(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n var $op = $keyword == 'maxProperties' ? '>' : '<';\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'number\\') || ';\n }\n out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';\n var $errorKeyword = $keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || '_limitProperties') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have ';\n if ($keyword == 'maxProperties') {\n out += 'more';\n } else {\n out += 'fewer';\n }\n out += ' than ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + ($schema);\n }\n out += ' properties\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_allOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $currentBaseId = $it.baseId,\n $allSchemasEmpty = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $allSchemasEmpty = false;\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if ($breakOnError) {\n if ($allSchemasEmpty) {\n out += ' if (true) { ';\n } else {\n out += ' ' + ($closingBraces.slice(0, -1)) + ' ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_anyOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $noEmptySchema = $schema.every(function($sch) {\n return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));\n });\n if ($noEmptySchema) {\n var $currentBaseId = $it.baseId;\n out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';\n $closingBraces += '}';\n }\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('anyOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match some schema in anyOf\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_comment(it, $keyword, $ruleType) {\n var out = ' ';\n var $schema = it.schema[$keyword];\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $comment = it.util.toQuotedString($schema);\n if (it.opts.$comment === true) {\n out += ' console.log(' + ($comment) + ');';\n } else if (typeof it.opts.$comment == 'function') {\n out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_const(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!$isData) {\n out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';\n }\n out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('const') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be equal to constant\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' }';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_contains(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $idx = 'i' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $currentBaseId = it.baseId,\n $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all));\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if ($nonEmptySchema) {\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' if (' + ($nextValid) + ') break; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';\n } else {\n out += ' if (' + ($data) + '.length == 0) {';\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('contains') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should contain a valid item\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n if ($nonEmptySchema) {\n out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n }\n if (it.opts.allErrors) {\n out += ' } ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_custom(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $rule = this,\n $definition = 'definition' + $lvl,\n $rDef = $rule.definition,\n $closingBraces = '';\n var $compile, $inline, $macro, $ruleValidate, $validateCode;\n if ($isData && $rDef.$data) {\n $validateCode = 'keywordValidate' + $lvl;\n var $validateSchema = $rDef.validateSchema;\n out += ' var ' + ($definition) + ' = RULES.custom[\\'' + ($keyword) + '\\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';\n } else {\n $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);\n if (!$ruleValidate) return;\n $schemaValue = 'validate.schema' + $schemaPath;\n $validateCode = $ruleValidate.code;\n $compile = $rDef.compile;\n $inline = $rDef.inline;\n $macro = $rDef.macro;\n }\n var $ruleErrs = $validateCode + '.errors',\n $i = 'i' + $lvl,\n $ruleErr = 'ruleErr' + $lvl,\n $asyncKeyword = $rDef.async;\n if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');\n if (!($inline || $macro)) {\n out += '' + ($ruleErrs) + ' = null;';\n }\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if ($isData && $rDef.$data) {\n $closingBraces += '}';\n out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';\n if ($validateSchema) {\n $closingBraces += '}';\n out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';\n }\n }\n if ($inline) {\n if ($rDef.statements) {\n out += ' ' + ($ruleValidate.validate) + ' ';\n } else {\n out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';\n }\n } else if ($macro) {\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n $it.schema = $ruleValidate.validate;\n $it.schemaPath = '';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var $code = it.validate($it).replace(/validate\\.schema/g, $validateCode);\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' ' + ($code);\n } else {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n out += ' ' + ($validateCode) + '.call( ';\n if (it.opts.passContext) {\n out += 'this';\n } else {\n out += 'self';\n }\n if ($compile || $rDef.schema === false) {\n out += ' , ' + ($data) + ' ';\n } else {\n out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';\n }\n out += ' , (dataPath || \\'\\')';\n if (it.errorPath != '\"\"') {\n out += ' + ' + (it.errorPath);\n }\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) ';\n var def_callRuleValidate = out;\n out = $$outStack.pop();\n if ($rDef.errors === false) {\n out += ' ' + ($valid) + ' = ';\n if ($asyncKeyword) {\n out += 'await ';\n }\n out += '' + (def_callRuleValidate) + '; ';\n } else {\n if ($asyncKeyword) {\n $ruleErrs = 'customErrors' + $lvl;\n out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';\n } else {\n out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';\n }\n }\n }\n if ($rDef.modifying) {\n out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';\n }\n out += '' + ($closingBraces);\n if ($rDef.valid) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n } else {\n out += ' if ( ';\n if ($rDef.valid === undefined) {\n out += ' !';\n if ($macro) {\n out += '' + ($nextValid);\n } else {\n out += '' + ($valid);\n }\n } else {\n out += ' ' + (!$rDef.valid) + ' ';\n }\n out += ') { ';\n $errorKeyword = $rule.keyword;\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = '';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'custom') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \\'' + ($rule.keyword) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should pass \"' + ($rule.keyword) + '\" keyword validation\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n var def_customError = out;\n out = $$outStack.pop();\n if ($inline) {\n if ($rDef.errors) {\n if ($rDef.errors != 'full') {\n out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + ' 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($property)) + '\\') ';\n }\n out += ') { ';\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + it.util.getProperty($property);\n $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_enum(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $i = 'i' + $lvl,\n $vSchema = 'schema' + $lvl;\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';\n }\n out += 'var ' + ($valid) + ';';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('enum') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be equal to one of the allowed values\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' }';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_format(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n if (it.opts.format === false) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n }\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $unknownFormats = it.opts.unknownFormats,\n $allowUnknown = Array.isArray($unknownFormats);\n if ($isData) {\n var $format = 'format' + $lvl,\n $isObject = 'isObject' + $lvl,\n $formatType = 'formatType' + $lvl;\n out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \\'object\\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \\'string\\'; if (' + ($isObject) + ') { ';\n if (it.async) {\n out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';\n }\n out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'string\\') || ';\n }\n out += ' (';\n if ($unknownFormats != 'ignore') {\n out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';\n if ($allowUnknown) {\n out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';\n }\n out += ') || ';\n }\n out += ' (' + ($format) + ' && ' + ($formatType) + ' == \\'' + ($ruleType) + '\\' && !(typeof ' + ($format) + ' == \\'function\\' ? ';\n if (it.async) {\n out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';\n } else {\n out += ' ' + ($format) + '(' + ($data) + ') ';\n }\n out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';\n } else {\n var $format = it.formats[$schema];\n if (!$format) {\n if ($unknownFormats == 'ignore') {\n it.logger.warn('unknown format \"' + $schema + '\" ignored in schema at path \"' + it.errSchemaPath + '\"');\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n } else {\n throw new Error('unknown format \"' + $schema + '\" is used in schema at path \"' + it.errSchemaPath + '\"');\n }\n }\n var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;\n var $formatType = $isObject && $format.type || 'string';\n if ($isObject) {\n var $async = $format.async === true;\n $format = $format.validate;\n }\n if ($formatType != $ruleType) {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n return out;\n }\n if ($async) {\n if (!it.async) throw new Error('async format in sync schema');\n var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';\n out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { ';\n } else {\n out += ' if (! ';\n var $formatRef = 'formats' + it.util.getProperty($schema);\n if ($isObject) $formatRef += '.validate';\n if (typeof $format == 'function') {\n out += ' ' + ($formatRef) + '(' + ($data) + ') ';\n } else {\n out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';\n }\n out += ') { ';\n }\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('format') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match format \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_if(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $thenSch = it.schema['then'],\n $elseSch = it.schema['else'],\n $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),\n $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),\n $currentBaseId = $it.baseId;\n if ($thenPresent || $elsePresent) {\n var $ifClause;\n $it.createErrors = false;\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n $it.createErrors = true;\n out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n if ($thenPresent) {\n out += ' if (' + ($nextValid) + ') { ';\n $it.schema = it.schema['then'];\n $it.schemaPath = it.schemaPath + '.then';\n $it.errSchemaPath = it.errSchemaPath + '/then';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';\n if ($thenPresent && $elsePresent) {\n $ifClause = 'ifClause' + $lvl;\n out += ' var ' + ($ifClause) + ' = \\'then\\'; ';\n } else {\n $ifClause = '\\'then\\'';\n }\n out += ' } ';\n if ($elsePresent) {\n out += ' else { ';\n }\n } else {\n out += ' if (!' + ($nextValid) + ') { ';\n }\n if ($elsePresent) {\n $it.schema = it.schema['else'];\n $it.schemaPath = it.schemaPath + '.else';\n $it.errSchemaPath = it.errSchemaPath + '/else';\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';\n if ($thenPresent && $elsePresent) {\n $ifClause = 'ifClause' + $lvl;\n out += ' var ' + ($ifClause) + ' = \\'else\\'; ';\n } else {\n $ifClause = '\\'else\\'';\n }\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('if') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match \"\\' + ' + ($ifClause) + ' + \\'\" schema\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\n\n//all requires must be explicit because browserify won't work with dynamic requires\nmodule.exports = {\n '$ref': require('./ref'),\n allOf: require('./allOf'),\n anyOf: require('./anyOf'),\n '$comment': require('./comment'),\n const: require('./const'),\n contains: require('./contains'),\n dependencies: require('./dependencies'),\n 'enum': require('./enum'),\n format: require('./format'),\n 'if': require('./if'),\n items: require('./items'),\n maximum: require('./_limit'),\n minimum: require('./_limit'),\n maxItems: require('./_limitItems'),\n minItems: require('./_limitItems'),\n maxLength: require('./_limitLength'),\n minLength: require('./_limitLength'),\n maxProperties: require('./_limitProperties'),\n minProperties: require('./_limitProperties'),\n multipleOf: require('./multipleOf'),\n not: require('./not'),\n oneOf: require('./oneOf'),\n pattern: require('./pattern'),\n properties: require('./properties'),\n propertyNames: require('./propertyNames'),\n required: require('./required'),\n uniqueItems: require('./uniqueItems'),\n validate: require('./validate')\n};\n","'use strict';\nmodule.exports = function generate_items(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $idx = 'i' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $currentBaseId = it.baseId;\n out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';\n if (Array.isArray($schema)) {\n var $additionalItems = it.schema.additionalItems;\n if ($additionalItems === false) {\n out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';\n var $currErrSchemaPath = $errSchemaPath;\n $errSchemaPath = it.errSchemaPath + '/additionalItems';\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('additionalItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have more than ' + ($schema.length) + ' items\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n $errSchemaPath = $currErrSchemaPath;\n if ($breakOnError) {\n $closingBraces += '}';\n out += ' else { ';\n }\n }\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';\n var $passData = $data + '[' + $i + ']';\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);\n $it.dataPathArr[$dataNxt] = $i;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {\n $it.schema = $additionalItems;\n $it.schemaPath = it.schemaPath + '.additionalItems';\n $it.errSchemaPath = it.errSchemaPath + '/additionalItems';\n out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' } } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);\n var $passData = $data + '[' + $idx + ']';\n $it.dataPathArr[$dataNxt] = $idx;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' }';\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_multipleOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (!($isData || typeof $schema == 'number')) {\n throw new Error($keyword + ' must be number');\n }\n out += 'var division' + ($lvl) + ';if (';\n if ($isData) {\n out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \\'number\\' || ';\n }\n out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';\n if (it.opts.multipleOfPrecision) {\n out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';\n } else {\n out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';\n }\n out += ' ) ';\n if ($isData) {\n out += ' ) ';\n }\n out += ' ) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('multipleOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be multiple of ';\n if ($isData) {\n out += '\\' + ' + ($schemaValue);\n } else {\n out += '' + ($schemaValue) + '\\'';\n }\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_not(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.createErrors = false;\n var $allErrorsOption;\n if ($it.opts.allErrors) {\n $allErrorsOption = $it.opts.allErrors;\n $it.opts.allErrors = false;\n }\n out += ' ' + (it.validate($it)) + ' ';\n $it.createErrors = true;\n if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' if (' + ($nextValid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('not') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be valid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n } else {\n out += ' var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('not') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT be valid\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if ($breakOnError) {\n out += ' if (false) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_oneOf(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $currentBaseId = $it.baseId,\n $prevValid = 'prevValid' + $lvl,\n $passingSchemas = 'passingSchemas' + $lvl;\n out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var arr1 = $schema;\n if (arr1) {\n var $sch, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $sch = arr1[$i += 1];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + '[' + $i + ']';\n $it.errSchemaPath = $errSchemaPath + '/' + $i;\n out += ' ' + (it.validate($it)) + ' ';\n $it.baseId = $currentBaseId;\n } else {\n out += ' var ' + ($nextValid) + ' = true; ';\n }\n if ($i) {\n out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { ';\n $closingBraces += '}';\n }\n out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }';\n }\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('oneOf') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match exactly one schema in oneOf\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; return false; ';\n }\n }\n out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';\n if (it.opts.allErrors) {\n out += ' } ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_pattern(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);\n out += 'if ( ';\n if ($isData) {\n out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \\'string\\') || ';\n }\n out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('pattern') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: ';\n if ($isData) {\n out += '' + ($schemaValue);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should match pattern \"';\n if ($isData) {\n out += '\\' + ' + ($schemaValue) + ' + \\'';\n } else {\n out += '' + (it.util.escapeQuotes($schema));\n }\n out += '\"\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + (it.util.toQuotedString($schema));\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += '} ';\n if ($breakOnError) {\n out += ' else { ';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_properties(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $dataProperties = 'dataProperties' + $lvl;\n var $schemaKeys = Object.keys($schema || {}).filter(notProto),\n $pProperties = it.schema.patternProperties || {},\n $pPropertyKeys = Object.keys($pProperties).filter(notProto),\n $aProperties = it.schema.additionalProperties,\n $someProperties = $schemaKeys.length || $pPropertyKeys.length,\n $noAdditional = $aProperties === false,\n $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,\n $removeAdditional = it.opts.removeAdditional,\n $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,\n $ownProperties = it.opts.ownProperties,\n $currentBaseId = it.baseId;\n var $required = it.schema.required;\n if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {\n var $requiredHash = it.util.toHash($required);\n }\n\n function notProto(p) {\n return p !== '__proto__';\n }\n out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined;';\n }\n if ($checkAdditional) {\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n if ($someProperties) {\n out += ' var isAdditional' + ($lvl) + ' = !(false ';\n if ($schemaKeys.length) {\n if ($schemaKeys.length > 8) {\n out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') ';\n } else {\n var arr1 = $schemaKeys;\n if (arr1) {\n var $propertyKey, i1 = -1,\n l1 = arr1.length - 1;\n while (i1 < l1) {\n $propertyKey = arr1[i1 += 1];\n out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';\n }\n }\n }\n }\n if ($pPropertyKeys.length) {\n var arr2 = $pPropertyKeys;\n if (arr2) {\n var $pProperty, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $pProperty = arr2[$i += 1];\n out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';\n }\n }\n }\n out += ' ); if (isAdditional' + ($lvl) + ') { ';\n }\n if ($removeAdditional == 'all') {\n out += ' delete ' + ($data) + '[' + ($key) + ']; ';\n } else {\n var $currentErrorPath = it.errorPath;\n var $additionalProperty = '\\' + ' + $key + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n }\n if ($noAdditional) {\n if ($removeAdditional) {\n out += ' delete ' + ($data) + '[' + ($key) + ']; ';\n } else {\n out += ' ' + ($nextValid) + ' = false; ';\n var $currErrSchemaPath = $errSchemaPath;\n $errSchemaPath = it.errSchemaPath + '/additionalProperties';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('additionalProperties') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \\'' + ($additionalProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is an invalid additional property';\n } else {\n out += 'should NOT have additional properties';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n $errSchemaPath = $currErrSchemaPath;\n if ($breakOnError) {\n out += ' break; ';\n }\n }\n } else if ($additionalIsSchema) {\n if ($removeAdditional == 'failing') {\n out += ' var ' + ($errs) + ' = errors; ';\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n $it.schema = $aProperties;\n $it.schemaPath = it.schemaPath + '.additionalProperties';\n $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';\n $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } ';\n it.compositeRule = $it.compositeRule = $wasComposite;\n } else {\n $it.schema = $aProperties;\n $it.schemaPath = it.schemaPath + '.additionalProperties';\n $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';\n $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n }\n }\n it.errorPath = $currentErrorPath;\n }\n if ($someProperties) {\n out += ' } ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n var $useDefaults = it.opts.useDefaults && !it.compositeRule;\n if ($schemaKeys.length) {\n var arr3 = $schemaKeys;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $sch = $schema[$propertyKey];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n var $prop = it.util.getProperty($propertyKey),\n $passData = $data + $prop,\n $hasDefault = $useDefaults && $sch.default !== undefined;\n $it.schema = $sch;\n $it.schemaPath = $schemaPath + $prop;\n $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);\n $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);\n $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n $code = it.util.varReplace($code, $nextData, $passData);\n var $useData = $passData;\n } else {\n var $useData = $nextData;\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';\n }\n if ($hasDefault) {\n out += ' ' + ($code) + ' ';\n } else {\n if ($requiredHash && $requiredHash[$propertyKey]) {\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { ' + ($nextValid) + ' = false; ';\n var $currentErrorPath = it.errorPath,\n $currErrSchemaPath = $errSchemaPath,\n $missingProperty = it.util.escapeQuotes($propertyKey);\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n $errSchemaPath = it.errSchemaPath + '/required';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n $errSchemaPath = $currErrSchemaPath;\n it.errorPath = $currentErrorPath;\n out += ' } else { ';\n } else {\n if ($breakOnError) {\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { ' + ($nextValid) + ' = true; } else { ';\n } else {\n out += ' if (' + ($useData) + ' !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ' ) { ';\n }\n }\n out += ' ' + ($code) + ' } ';\n }\n }\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n if ($pPropertyKeys.length) {\n var arr4 = $pPropertyKeys;\n if (arr4) {\n var $pProperty, i4 = -1,\n l4 = arr4.length - 1;\n while (i4 < l4) {\n $pProperty = arr4[i4 += 1];\n var $sch = $pProperties[$pProperty];\n if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {\n $it.schema = $sch;\n $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);\n $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';\n $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);\n var $passData = $data + '[' + $key + ']';\n $it.dataPathArr[$dataNxt] = $key;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n if ($breakOnError) {\n out += ' if (!' + ($nextValid) + ') break; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else ' + ($nextValid) + ' = true; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' if (' + ($nextValid) + ') { ';\n $closingBraces += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_propertyNames(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $errs = 'errs__' + $lvl;\n var $it = it.util.copy(it);\n var $closingBraces = '';\n $it.level++;\n var $nextValid = 'valid' + $it.level;\n out += 'var ' + ($errs) + ' = errors;';\n if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {\n $it.schema = $schema;\n $it.schemaPath = $schemaPath;\n $it.errSchemaPath = $errSchemaPath;\n var $key = 'key' + $lvl,\n $idx = 'idx' + $lvl,\n $i = 'i' + $lvl,\n $invalidName = '\\' + ' + $key + ' + \\'',\n $dataNxt = $it.dataLevel = it.dataLevel + 1,\n $nextData = 'data' + $dataNxt,\n $dataProperties = 'dataProperties' + $lvl,\n $ownProperties = it.opts.ownProperties,\n $currentBaseId = it.baseId;\n if ($ownProperties) {\n out += ' var ' + ($dataProperties) + ' = undefined; ';\n }\n if ($ownProperties) {\n out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';\n } else {\n out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';\n }\n out += ' var startErrs' + ($lvl) + ' = errors; ';\n var $passData = $key;\n var $wasComposite = it.compositeRule;\n it.compositeRule = $it.compositeRule = true;\n var $code = it.validate($it);\n $it.baseId = $currentBaseId;\n if (it.util.varOccurences($code, $nextData) < 2) {\n out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';\n } else {\n out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';\n }\n it.compositeRule = $it.compositeRule = $wasComposite;\n out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {\n $required[$required.length] = $property;\n }\n }\n }\n } else {\n var $required = $schema;\n }\n }\n if ($isData || $required.length) {\n var $currentErrorPath = it.errorPath,\n $loopRequired = $isData || $required.length >= it.opts.loopRequired,\n $ownProperties = it.opts.ownProperties;\n if ($breakOnError) {\n out += ' var missing' + ($lvl) + '; ';\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n out += ' var ' + ($valid) + ' = true; ';\n if ($isData) {\n out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';\n if ($ownProperties) {\n out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += '; if (!' + ($valid) + ') break; } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n } else {\n out += ' if ( ';\n var arr2 = $required;\n if (arr2) {\n var $propertyKey, $i = -1,\n l2 = arr2.length - 1;\n while ($i < l2) {\n $propertyKey = arr2[$i += 1];\n if ($i) {\n out += ' || ';\n }\n var $prop = it.util.getProperty($propertyKey),\n $useData = $data + $prop;\n out += ' ( ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';\n }\n }\n out += ') { ';\n var $propertyPath = 'missing' + $lvl,\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } else { ';\n }\n } else {\n if ($loopRequired) {\n if (!$isData) {\n out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';\n }\n var $i = 'i' + $lvl,\n $propertyPath = 'schema' + $lvl + '[' + $i + ']',\n $missingProperty = '\\' + ' + $propertyPath + ' + \\'';\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);\n }\n if ($isData) {\n out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';\n }\n out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';\n if ($isData) {\n out += ' } ';\n }\n } else {\n var arr3 = $required;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $prop = it.util.getProperty($propertyKey),\n $missingProperty = it.util.escapeQuotes($propertyKey),\n $useData = $data + $prop;\n if (it.opts._errorDataPathProperty) {\n it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);\n }\n out += ' if ( ' + ($useData) + ' === undefined ';\n if ($ownProperties) {\n out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \\'' + (it.util.escapeQuotes($propertyKey)) + '\\') ';\n }\n out += ') { var err = '; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('required') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \\'' + ($missingProperty) + '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'';\n if (it.opts._errorDataPathProperty) {\n out += 'is a required property';\n } else {\n out += 'should have required property \\\\\\'' + ($missingProperty) + '\\\\\\'';\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';\n }\n }\n }\n }\n it.errorPath = $currentErrorPath;\n } else if ($breakOnError) {\n out += ' if (true) {';\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_uniqueItems(it, $keyword, $ruleType) {\n var out = ' ';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n var $isData = it.opts.$data && $schema && $schema.$data,\n $schemaValue;\n if ($isData) {\n out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';\n $schemaValue = 'schema' + $lvl;\n } else {\n $schemaValue = $schema;\n }\n if (($schema || $isData) && it.opts.uniqueItems !== false) {\n if ($isData) {\n out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \\'boolean\\') ' + ($valid) + ' = false; else { ';\n }\n out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';\n var $itemType = it.schema.items && it.schema.items.type,\n $typeIsArray = Array.isArray($itemType);\n if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {\n out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';\n } else {\n out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';\n var $method = 'checkDataType' + ($typeIsArray ? 's' : '');\n out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';\n if ($typeIsArray) {\n out += ' if (typeof item == \\'string\\') item = \\'\"\\' + item; ';\n }\n out += ' if (typeof itemIndices[item] == \\'number\\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';\n }\n out += ' } ';\n if ($isData) {\n out += ' } ';\n }\n out += ' if (!' + ($valid) + ') { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ('uniqueItems') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should NOT have duplicate items (items ## \\' + j + \\' and \\' + i + \\' are identical)\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: ';\n if ($isData) {\n out += 'validate.schema' + ($schemaPath);\n } else {\n out += '' + ($schema);\n }\n out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n if ($breakOnError) {\n out += ' else { ';\n }\n } else {\n if ($breakOnError) {\n out += ' if (true) { ';\n }\n }\n return out;\n}\n","'use strict';\nmodule.exports = function generate_validate(it, $keyword, $ruleType) {\n var out = '';\n var $async = it.schema.$async === true,\n $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),\n $id = it.self._getId(it.schema);\n if (it.opts.strictKeywords) {\n var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);\n if ($unknownKwd) {\n var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;\n if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);\n else throw new Error($keywordsMsg);\n }\n }\n if (it.isTop) {\n out += ' var validate = ';\n if ($async) {\n it.async = true;\n out += 'async ';\n }\n out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \\'use strict\\'; ';\n if ($id && (it.opts.sourceCode || it.opts.processCode)) {\n out += ' ' + ('/\\*# sourceURL=' + $id + ' */') + ' ';\n }\n }\n if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {\n var $keyword = 'false schema';\n var $lvl = it.level;\n var $dataLvl = it.dataLevel;\n var $schema = it.schema[$keyword];\n var $schemaPath = it.schemaPath + it.util.getProperty($keyword);\n var $errSchemaPath = it.errSchemaPath + '/' + $keyword;\n var $breakOnError = !it.opts.allErrors;\n var $errorKeyword;\n var $data = 'data' + ($dataLvl || '');\n var $valid = 'valid' + $lvl;\n if (it.schema === false) {\n if (it.isTop) {\n $breakOnError = true;\n } else {\n out += ' var ' + ($valid) + ' = false; ';\n }\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'false schema') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'boolean schema is false\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n } else {\n if (it.isTop) {\n if ($async) {\n out += ' return data; ';\n } else {\n out += ' validate.errors = null; return true; ';\n }\n } else {\n out += ' var ' + ($valid) + ' = true; ';\n }\n }\n if (it.isTop) {\n out += ' }; return validate; ';\n }\n return out;\n }\n if (it.isTop) {\n var $top = it.isTop,\n $lvl = it.level = 0,\n $dataLvl = it.dataLevel = 0,\n $data = 'data';\n it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));\n it.baseId = it.baseId || it.rootId;\n delete it.isTop;\n it.dataPathArr = [\"\"];\n if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored in the schema root';\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n out += ' var vErrors = null; ';\n out += ' var errors = 0; ';\n out += ' if (rootData === undefined) rootData = data; ';\n } else {\n var $lvl = it.level,\n $dataLvl = it.dataLevel,\n $data = 'data' + ($dataLvl || '');\n if ($id) it.baseId = it.resolve.url(it.baseId, $id);\n if ($async && !it.async) throw new Error('async schema in sync schema');\n out += ' var errs_' + ($lvl) + ' = errors;';\n }\n var $valid = 'valid' + $lvl,\n $breakOnError = !it.opts.allErrors,\n $closingBraces1 = '',\n $closingBraces2 = '';\n var $errorKeyword;\n var $typeSchema = it.schema.type,\n $typeIsArray = Array.isArray($typeSchema);\n if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {\n if ($typeIsArray) {\n if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null');\n } else if ($typeSchema != 'null') {\n $typeSchema = [$typeSchema, 'null'];\n $typeIsArray = true;\n }\n }\n if ($typeIsArray && $typeSchema.length == 1) {\n $typeSchema = $typeSchema[0];\n $typeIsArray = false;\n }\n if (it.schema.$ref && $refKeywords) {\n if (it.opts.extendRefs == 'fail') {\n throw new Error('$ref: validation keywords used in schema at path \"' + it.errSchemaPath + '\" (see option extendRefs)');\n } else if (it.opts.extendRefs !== true) {\n $refKeywords = false;\n it.logger.warn('$ref: keywords ignored in schema at path \"' + it.errSchemaPath + '\"');\n }\n }\n if (it.schema.$comment && it.opts.$comment) {\n out += ' ' + (it.RULES.all.$comment.code(it, '$comment'));\n }\n if ($typeSchema) {\n if (it.opts.coerceTypes) {\n var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);\n }\n var $rulesGroup = it.RULES.types[$typeSchema];\n if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type';\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type',\n $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';\n out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { ';\n if ($coerceToTypes) {\n var $dataType = 'dataType' + $lvl,\n $coerced = 'coerced' + $lvl;\n out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; ';\n if (it.opts.coerceTypes == 'array') {\n out += ' if (' + ($dataType) + ' == \\'object\\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } ';\n }\n out += ' if (' + ($coerced) + ' !== undefined) ; ';\n var arr1 = $coerceToTypes;\n if (arr1) {\n var $type, $i = -1,\n l1 = arr1.length - 1;\n while ($i < l1) {\n $type = arr1[$i += 1];\n if ($type == 'string') {\n out += ' else if (' + ($dataType) + ' == \\'number\\' || ' + ($dataType) + ' == \\'boolean\\') ' + ($coerced) + ' = \\'\\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \\'\\'; ';\n } else if ($type == 'number' || $type == 'integer') {\n out += ' else if (' + ($dataType) + ' == \\'boolean\\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \\'string\\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';\n if ($type == 'integer') {\n out += ' && !(' + ($data) + ' % 1)';\n }\n out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';\n } else if ($type == 'boolean') {\n out += ' else if (' + ($data) + ' === \\'false\\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \\'true\\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';\n } else if ($type == 'null') {\n out += ' else if (' + ($data) + ' === \\'\\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';\n } else if (it.opts.coerceTypes == 'array' && $type == 'array') {\n out += ' else if (' + ($dataType) + ' == \\'string\\' || ' + ($dataType) + ' == \\'number\\' || ' + ($dataType) + ' == \\'boolean\\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';\n }\n }\n }\n out += ' else { ';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } if (' + ($coerced) + ' !== undefined) { ';\n var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',\n $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';\n out += ' ' + ($data) + ' = ' + ($coerced) + '; ';\n if (!$dataLvl) {\n out += 'if (' + ($parentData) + ' !== undefined)';\n }\n out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';\n } else {\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n }\n out += ' } ';\n }\n }\n if (it.schema.$ref && !$refKeywords) {\n out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';\n if ($breakOnError) {\n out += ' } if (errors === ';\n if ($top) {\n out += '0';\n } else {\n out += 'errs_' + ($lvl);\n }\n out += ') { ';\n $closingBraces2 += '}';\n }\n } else {\n var arr2 = it.RULES;\n if (arr2) {\n var $rulesGroup, i2 = -1,\n l2 = arr2.length - 1;\n while (i2 < l2) {\n $rulesGroup = arr2[i2 += 1];\n if ($shouldUseGroup($rulesGroup)) {\n if ($rulesGroup.type) {\n out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { ';\n }\n if (it.opts.useDefaults) {\n if ($rulesGroup.type == 'object' && it.schema.properties) {\n var $schema = it.schema.properties,\n $schemaKeys = Object.keys($schema);\n var arr3 = $schemaKeys;\n if (arr3) {\n var $propertyKey, i3 = -1,\n l3 = arr3.length - 1;\n while (i3 < l3) {\n $propertyKey = arr3[i3 += 1];\n var $sch = $schema[$propertyKey];\n if ($sch.default !== undefined) {\n var $passData = $data + it.util.getProperty($propertyKey);\n if (it.compositeRule) {\n if (it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored for: ' + $passData;\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n } else {\n out += ' if (' + ($passData) + ' === undefined ';\n if (it.opts.useDefaults == 'empty') {\n out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \\'\\' ';\n }\n out += ' ) ' + ($passData) + ' = ';\n if (it.opts.useDefaults == 'shared') {\n out += ' ' + (it.useDefault($sch.default)) + ' ';\n } else {\n out += ' ' + (JSON.stringify($sch.default)) + ' ';\n }\n out += '; ';\n }\n }\n }\n }\n } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {\n var arr4 = it.schema.items;\n if (arr4) {\n var $sch, $i = -1,\n l4 = arr4.length - 1;\n while ($i < l4) {\n $sch = arr4[$i += 1];\n if ($sch.default !== undefined) {\n var $passData = $data + '[' + $i + ']';\n if (it.compositeRule) {\n if (it.opts.strictDefaults) {\n var $defaultMsg = 'default is ignored for: ' + $passData;\n if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);\n else throw new Error($defaultMsg);\n }\n } else {\n out += ' if (' + ($passData) + ' === undefined ';\n if (it.opts.useDefaults == 'empty') {\n out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \\'\\' ';\n }\n out += ' ) ' + ($passData) + ' = ';\n if (it.opts.useDefaults == 'shared') {\n out += ' ' + (it.useDefault($sch.default)) + ' ';\n } else {\n out += ' ' + (JSON.stringify($sch.default)) + ' ';\n }\n out += '; ';\n }\n }\n }\n }\n }\n }\n var arr5 = $rulesGroup.rules;\n if (arr5) {\n var $rule, i5 = -1,\n l5 = arr5.length - 1;\n while (i5 < l5) {\n $rule = arr5[i5 += 1];\n if ($shouldUseRule($rule)) {\n var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);\n if ($code) {\n out += ' ' + ($code) + ' ';\n if ($breakOnError) {\n $closingBraces1 += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces1) + ' ';\n $closingBraces1 = '';\n }\n if ($rulesGroup.type) {\n out += ' } ';\n if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {\n out += ' else { ';\n var $schemaPath = it.schemaPath + '.type',\n $errSchemaPath = it.errSchemaPath + '/type';\n var $$outStack = $$outStack || [];\n $$outStack.push(out);\n out = ''; /* istanbul ignore else */\n if (it.createErrors !== false) {\n out += ' { keyword: \\'' + ($errorKeyword || 'type') + '\\' , dataPath: (dataPath || \\'\\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \\'';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' } ';\n if (it.opts.messages !== false) {\n out += ' , message: \\'should be ';\n if ($typeIsArray) {\n out += '' + ($typeSchema.join(\",\"));\n } else {\n out += '' + ($typeSchema);\n }\n out += '\\' ';\n }\n if (it.opts.verbose) {\n out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';\n }\n out += ' } ';\n } else {\n out += ' {} ';\n }\n var __err = out;\n out = $$outStack.pop();\n if (!it.compositeRule && $breakOnError) {\n /* istanbul ignore if */\n if (it.async) {\n out += ' throw new ValidationError([' + (__err) + ']); ';\n } else {\n out += ' validate.errors = [' + (__err) + ']; return false; ';\n }\n } else {\n out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';\n }\n out += ' } ';\n }\n }\n if ($breakOnError) {\n out += ' if (errors === ';\n if ($top) {\n out += '0';\n } else {\n out += 'errs_' + ($lvl);\n }\n out += ') { ';\n $closingBraces2 += '}';\n }\n }\n }\n }\n }\n if ($breakOnError) {\n out += ' ' + ($closingBraces2) + ' ';\n }\n if ($top) {\n if ($async) {\n out += ' if (errors === 0) return data; ';\n out += ' else throw new ValidationError(vErrors); ';\n } else {\n out += ' validate.errors = vErrors; ';\n out += ' return errors === 0; ';\n }\n out += ' }; return validate;';\n } else {\n out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';\n }\n\n function $shouldUseGroup($rulesGroup) {\n var rules = $rulesGroup.rules;\n for (var i = 0; i < rules.length; i++)\n if ($shouldUseRule(rules[i])) return true;\n }\n\n function $shouldUseRule($rule) {\n return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));\n }\n\n function $ruleImplementsSomeKeyword($rule) {\n var impl = $rule.implements;\n for (var i = 0; i < impl.length; i++)\n if (it.schema[impl[i]] !== undefined) return true;\n }\n return out;\n}\n","'use strict';\n\nvar IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;\nvar customRuleCode = require('./dotjs/custom');\nvar definitionSchema = require('./definition_schema');\n\nmodule.exports = {\n add: addKeyword,\n get: getKeyword,\n remove: removeKeyword,\n validate: validateKeyword\n};\n\n\n/**\n * Define custom keyword\n * @this Ajv\n * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).\n * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.\n * @return {Ajv} this for method chaining\n */\nfunction addKeyword(keyword, definition) {\n /* jshint validthis: true */\n /* eslint no-shadow: 0 */\n var RULES = this.RULES;\n if (RULES.keywords[keyword])\n throw new Error('Keyword ' + keyword + ' is already defined');\n\n if (!IDENTIFIER.test(keyword))\n throw new Error('Keyword ' + keyword + ' is not a valid identifier');\n\n if (definition) {\n this.validateKeyword(definition, true);\n\n var dataType = definition.type;\n if (Array.isArray(dataType)) {\n for (var i=0; i All rights reserved.\n\n\nmodule.exports = {\n\n newInvalidAsn1Error: function (msg) {\n var e = new Error();\n e.name = 'InvalidAsn1Error';\n e.message = msg || '';\n return e;\n }\n\n};\n","// Copyright 2011 Mark Cavage All rights reserved.\n\nvar errors = require('./errors');\nvar types = require('./types');\n\nvar Reader = require('./reader');\nvar Writer = require('./writer');\n\n\n// --- Exports\n\nmodule.exports = {\n\n Reader: Reader,\n\n Writer: Writer\n\n};\n\nfor (var t in types) {\n if (types.hasOwnProperty(t))\n module.exports[t] = types[t];\n}\nfor (var e in errors) {\n if (errors.hasOwnProperty(e))\n module.exports[e] = errors[e];\n}\n","// Copyright 2011 Mark Cavage All rights reserved.\n\nvar assert = require('assert');\nvar Buffer = require('safer-buffer').Buffer;\n\nvar ASN1 = require('./types');\nvar errors = require('./errors');\n\n\n// --- Globals\n\nvar newInvalidAsn1Error = errors.newInvalidAsn1Error;\n\n\n\n// --- API\n\nfunction Reader(data) {\n if (!data || !Buffer.isBuffer(data))\n throw new TypeError('data must be a node Buffer');\n\n this._buf = data;\n this._size = data.length;\n\n // These hold the \"current\" state\n this._len = 0;\n this._offset = 0;\n}\n\nObject.defineProperty(Reader.prototype, 'length', {\n enumerable: true,\n get: function () { return (this._len); }\n});\n\nObject.defineProperty(Reader.prototype, 'offset', {\n enumerable: true,\n get: function () { return (this._offset); }\n});\n\nObject.defineProperty(Reader.prototype, 'remain', {\n get: function () { return (this._size - this._offset); }\n});\n\nObject.defineProperty(Reader.prototype, 'buffer', {\n get: function () { return (this._buf.slice(this._offset)); }\n});\n\n\n/**\n * Reads a single byte and advances offset; you can pass in `true` to make this\n * a \"peek\" operation (i.e., get the byte, but don't advance the offset).\n *\n * @param {Boolean} peek true means don't move offset.\n * @return {Number} the next byte, null if not enough data.\n */\nReader.prototype.readByte = function (peek) {\n if (this._size - this._offset < 1)\n return null;\n\n var b = this._buf[this._offset] & 0xff;\n\n if (!peek)\n this._offset += 1;\n\n return b;\n};\n\n\nReader.prototype.peek = function () {\n return this.readByte(true);\n};\n\n\n/**\n * Reads a (potentially) variable length off the BER buffer. This call is\n * not really meant to be called directly, as callers have to manipulate\n * the internal buffer afterwards.\n *\n * As a result of this call, you can call `Reader.length`, until the\n * next thing called that does a readLength.\n *\n * @return {Number} the amount of offset to advance the buffer.\n * @throws {InvalidAsn1Error} on bad ASN.1\n */\nReader.prototype.readLength = function (offset) {\n if (offset === undefined)\n offset = this._offset;\n\n if (offset >= this._size)\n return null;\n\n var lenB = this._buf[offset++] & 0xff;\n if (lenB === null)\n return null;\n\n if ((lenB & 0x80) === 0x80) {\n lenB &= 0x7f;\n\n if (lenB === 0)\n throw newInvalidAsn1Error('Indefinite length not supported');\n\n if (lenB > 4)\n throw newInvalidAsn1Error('encoding too long');\n\n if (this._size - offset < lenB)\n return null;\n\n this._len = 0;\n for (var i = 0; i < lenB; i++)\n this._len = (this._len << 8) + (this._buf[offset++] & 0xff);\n\n } else {\n // Wasn't a variable length\n this._len = lenB;\n }\n\n return offset;\n};\n\n\n/**\n * Parses the next sequence in this BER buffer.\n *\n * To get the length of the sequence, call `Reader.length`.\n *\n * @return {Number} the sequence's tag.\n */\nReader.prototype.readSequence = function (tag) {\n var seq = this.peek();\n if (seq === null)\n return null;\n if (tag !== undefined && tag !== seq)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + seq.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n if (o === null)\n return null;\n\n this._offset = o;\n return seq;\n};\n\n\nReader.prototype.readInt = function () {\n return this._readTag(ASN1.Integer);\n};\n\n\nReader.prototype.readBoolean = function () {\n return (this._readTag(ASN1.Boolean) === 0 ? false : true);\n};\n\n\nReader.prototype.readEnumeration = function () {\n return this._readTag(ASN1.Enumeration);\n};\n\n\nReader.prototype.readString = function (tag, retbuf) {\n if (!tag)\n tag = ASN1.OctetString;\n\n var b = this.peek();\n if (b === null)\n return null;\n\n if (b !== tag)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + b.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n\n if (o === null)\n return null;\n\n if (this.length > this._size - o)\n return null;\n\n this._offset = o;\n\n if (this.length === 0)\n return retbuf ? Buffer.alloc(0) : '';\n\n var str = this._buf.slice(this._offset, this._offset + this.length);\n this._offset += this.length;\n\n return retbuf ? str : str.toString('utf8');\n};\n\nReader.prototype.readOID = function (tag) {\n if (!tag)\n tag = ASN1.OID;\n\n var b = this.readString(tag, true);\n if (b === null)\n return null;\n\n var values = [];\n var value = 0;\n\n for (var i = 0; i < b.length; i++) {\n var byte = b[i] & 0xff;\n\n value <<= 7;\n value += byte & 0x7f;\n if ((byte & 0x80) === 0) {\n values.push(value);\n value = 0;\n }\n }\n\n value = values.shift();\n values.unshift(value % 40);\n values.unshift((value / 40) >> 0);\n\n return values.join('.');\n};\n\n\nReader.prototype._readTag = function (tag) {\n assert.ok(tag !== undefined);\n\n var b = this.peek();\n\n if (b === null)\n return null;\n\n if (b !== tag)\n throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +\n ': got 0x' + b.toString(16));\n\n var o = this.readLength(this._offset + 1); // stored in `length`\n if (o === null)\n return null;\n\n if (this.length > 4)\n throw newInvalidAsn1Error('Integer too long: ' + this.length);\n\n if (this.length > this._size - o)\n return null;\n this._offset = o;\n\n var fb = this._buf[this._offset];\n var value = 0;\n\n for (var i = 0; i < this.length; i++) {\n value <<= 8;\n value |= (this._buf[this._offset++] & 0xff);\n }\n\n if ((fb & 0x80) === 0x80 && i !== 4)\n value -= (1 << (i * 8));\n\n return value >> 0;\n};\n\n\n\n// --- Exported API\n\nmodule.exports = Reader;\n","// Copyright 2011 Mark Cavage All rights reserved.\n\n\nmodule.exports = {\n EOC: 0,\n Boolean: 1,\n Integer: 2,\n BitString: 3,\n OctetString: 4,\n Null: 5,\n OID: 6,\n ObjectDescriptor: 7,\n External: 8,\n Real: 9, // float\n Enumeration: 10,\n PDV: 11,\n Utf8String: 12,\n RelativeOID: 13,\n Sequence: 16,\n Set: 17,\n NumericString: 18,\n PrintableString: 19,\n T61String: 20,\n VideotexString: 21,\n IA5String: 22,\n UTCTime: 23,\n GeneralizedTime: 24,\n GraphicString: 25,\n VisibleString: 26,\n GeneralString: 28,\n UniversalString: 29,\n CharacterString: 30,\n BMPString: 31,\n Constructor: 32,\n Context: 128\n};\n","// Copyright 2011 Mark Cavage All rights reserved.\n\nvar assert = require('assert');\nvar Buffer = require('safer-buffer').Buffer;\nvar ASN1 = require('./types');\nvar errors = require('./errors');\n\n\n// --- Globals\n\nvar newInvalidAsn1Error = errors.newInvalidAsn1Error;\n\nvar DEFAULT_OPTS = {\n size: 1024,\n growthFactor: 8\n};\n\n\n// --- Helpers\n\nfunction merge(from, to) {\n assert.ok(from);\n assert.equal(typeof (from), 'object');\n assert.ok(to);\n assert.equal(typeof (to), 'object');\n\n var keys = Object.getOwnPropertyNames(from);\n keys.forEach(function (key) {\n if (to[key])\n return;\n\n var value = Object.getOwnPropertyDescriptor(from, key);\n Object.defineProperty(to, key, value);\n });\n\n return to;\n}\n\n\n\n// --- API\n\nfunction Writer(options) {\n options = merge(DEFAULT_OPTS, options || {});\n\n this._buf = Buffer.alloc(options.size || 1024);\n this._size = this._buf.length;\n this._offset = 0;\n this._options = options;\n\n // A list of offsets in the buffer where we need to insert\n // sequence tag/len pairs.\n this._seq = [];\n}\n\nObject.defineProperty(Writer.prototype, 'buffer', {\n get: function () {\n if (this._seq.length)\n throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)');\n\n return (this._buf.slice(0, this._offset));\n }\n});\n\nWriter.prototype.writeByte = function (b) {\n if (typeof (b) !== 'number')\n throw new TypeError('argument must be a Number');\n\n this._ensure(1);\n this._buf[this._offset++] = b;\n};\n\n\nWriter.prototype.writeInt = function (i, tag) {\n if (typeof (i) !== 'number')\n throw new TypeError('argument must be a Number');\n if (typeof (tag) !== 'number')\n tag = ASN1.Integer;\n\n var sz = 4;\n\n while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) &&\n (sz > 1)) {\n sz--;\n i <<= 8;\n }\n\n if (sz > 4)\n throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff');\n\n this._ensure(2 + sz);\n this._buf[this._offset++] = tag;\n this._buf[this._offset++] = sz;\n\n while (sz-- > 0) {\n this._buf[this._offset++] = ((i & 0xff000000) >>> 24);\n i <<= 8;\n }\n\n};\n\n\nWriter.prototype.writeNull = function () {\n this.writeByte(ASN1.Null);\n this.writeByte(0x00);\n};\n\n\nWriter.prototype.writeEnumeration = function (i, tag) {\n if (typeof (i) !== 'number')\n throw new TypeError('argument must be a Number');\n if (typeof (tag) !== 'number')\n tag = ASN1.Enumeration;\n\n return this.writeInt(i, tag);\n};\n\n\nWriter.prototype.writeBoolean = function (b, tag) {\n if (typeof (b) !== 'boolean')\n throw new TypeError('argument must be a Boolean');\n if (typeof (tag) !== 'number')\n tag = ASN1.Boolean;\n\n this._ensure(3);\n this._buf[this._offset++] = tag;\n this._buf[this._offset++] = 0x01;\n this._buf[this._offset++] = b ? 0xff : 0x00;\n};\n\n\nWriter.prototype.writeString = function (s, tag) {\n if (typeof (s) !== 'string')\n throw new TypeError('argument must be a string (was: ' + typeof (s) + ')');\n if (typeof (tag) !== 'number')\n tag = ASN1.OctetString;\n\n var len = Buffer.byteLength(s);\n this.writeByte(tag);\n this.writeLength(len);\n if (len) {\n this._ensure(len);\n this._buf.write(s, this._offset);\n this._offset += len;\n }\n};\n\n\nWriter.prototype.writeBuffer = function (buf, tag) {\n if (typeof (tag) !== 'number')\n throw new TypeError('tag must be a number');\n if (!Buffer.isBuffer(buf))\n throw new TypeError('argument must be a buffer');\n\n this.writeByte(tag);\n this.writeLength(buf.length);\n this._ensure(buf.length);\n buf.copy(this._buf, this._offset, 0, buf.length);\n this._offset += buf.length;\n};\n\n\nWriter.prototype.writeStringArray = function (strings) {\n if ((!strings instanceof Array))\n throw new TypeError('argument must be an Array[String]');\n\n var self = this;\n strings.forEach(function (s) {\n self.writeString(s);\n });\n};\n\n// This is really to solve DER cases, but whatever for now\nWriter.prototype.writeOID = function (s, tag) {\n if (typeof (s) !== 'string')\n throw new TypeError('argument must be a string');\n if (typeof (tag) !== 'number')\n tag = ASN1.OID;\n\n if (!/^([0-9]+\\.){3,}[0-9]+$/.test(s))\n throw new Error('argument is not a valid OID string');\n\n function encodeOctet(bytes, octet) {\n if (octet < 128) {\n bytes.push(octet);\n } else if (octet < 16384) {\n bytes.push((octet >>> 7) | 0x80);\n bytes.push(octet & 0x7F);\n } else if (octet < 2097152) {\n bytes.push((octet >>> 14) | 0x80);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n } else if (octet < 268435456) {\n bytes.push((octet >>> 21) | 0x80);\n bytes.push(((octet >>> 14) | 0x80) & 0xFF);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n } else {\n bytes.push(((octet >>> 28) | 0x80) & 0xFF);\n bytes.push(((octet >>> 21) | 0x80) & 0xFF);\n bytes.push(((octet >>> 14) | 0x80) & 0xFF);\n bytes.push(((octet >>> 7) | 0x80) & 0xFF);\n bytes.push(octet & 0x7F);\n }\n }\n\n var tmp = s.split('.');\n var bytes = [];\n bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));\n tmp.slice(2).forEach(function (b) {\n encodeOctet(bytes, parseInt(b, 10));\n });\n\n var self = this;\n this._ensure(2 + bytes.length);\n this.writeByte(tag);\n this.writeLength(bytes.length);\n bytes.forEach(function (b) {\n self.writeByte(b);\n });\n};\n\n\nWriter.prototype.writeLength = function (len) {\n if (typeof (len) !== 'number')\n throw new TypeError('argument must be a Number');\n\n this._ensure(4);\n\n if (len <= 0x7f) {\n this._buf[this._offset++] = len;\n } else if (len <= 0xff) {\n this._buf[this._offset++] = 0x81;\n this._buf[this._offset++] = len;\n } else if (len <= 0xffff) {\n this._buf[this._offset++] = 0x82;\n this._buf[this._offset++] = len >> 8;\n this._buf[this._offset++] = len;\n } else if (len <= 0xffffff) {\n this._buf[this._offset++] = 0x83;\n this._buf[this._offset++] = len >> 16;\n this._buf[this._offset++] = len >> 8;\n this._buf[this._offset++] = len;\n } else {\n throw newInvalidAsn1Error('Length too long (> 4 bytes)');\n }\n};\n\nWriter.prototype.startSequence = function (tag) {\n if (typeof (tag) !== 'number')\n tag = ASN1.Sequence | ASN1.Constructor;\n\n this.writeByte(tag);\n this._seq.push(this._offset);\n this._ensure(3);\n this._offset += 3;\n};\n\n\nWriter.prototype.endSequence = function () {\n var seq = this._seq.pop();\n var start = seq + 3;\n var len = this._offset - start;\n\n if (len <= 0x7f) {\n this._shift(start, len, -2);\n this._buf[seq] = len;\n } else if (len <= 0xff) {\n this._shift(start, len, -1);\n this._buf[seq] = 0x81;\n this._buf[seq + 1] = len;\n } else if (len <= 0xffff) {\n this._buf[seq] = 0x82;\n this._buf[seq + 1] = len >> 8;\n this._buf[seq + 2] = len;\n } else if (len <= 0xffffff) {\n this._shift(start, len, 1);\n this._buf[seq] = 0x83;\n this._buf[seq + 1] = len >> 16;\n this._buf[seq + 2] = len >> 8;\n this._buf[seq + 3] = len;\n } else {\n throw newInvalidAsn1Error('Sequence too long');\n }\n};\n\n\nWriter.prototype._shift = function (start, len, shift) {\n assert.ok(start !== undefined);\n assert.ok(len !== undefined);\n assert.ok(shift);\n\n this._buf.copy(this._buf, start + shift, start, start + len);\n this._offset += shift;\n};\n\nWriter.prototype._ensure = function (len) {\n assert.ok(len);\n\n if (this._size - this._offset < len) {\n var sz = this._size * this._options.growthFactor;\n if (sz - this._offset < len)\n sz += len;\n\n var buf = Buffer.alloc(sz);\n\n this._buf.copy(buf, 0, 0, this._offset);\n this._buf = buf;\n this._size = sz;\n }\n};\n\n\n\n// --- Exported API\n\nmodule.exports = Writer;\n","// Copyright 2011 Mark Cavage All rights reserved.\n\n// If you have no idea what ASN.1 or BER is, see this:\n// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nvar Ber = require('./ber/index');\n\n\n\n// --- Exported API\n\nmodule.exports = {\n\n Ber: Ber,\n\n BerReader: Ber.Reader,\n\n BerWriter: Ber.Writer\n\n};\n","// Copyright (c) 2012, Mark Cavage. All rights reserved.\n// Copyright 2015 Joyent, Inc.\n\nvar assert = require('assert');\nvar Stream = require('stream').Stream;\nvar util = require('util');\n\n\n///--- Globals\n\n/* JSSTYLED */\nvar UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;\n\n\n///--- Internal\n\nfunction _capitalize(str) {\n return (str.charAt(0).toUpperCase() + str.slice(1));\n}\n\nfunction _toss(name, expected, oper, arg, actual) {\n throw new assert.AssertionError({\n message: util.format('%s (%s) is required', name, expected),\n actual: (actual === undefined) ? typeof (arg) : actual(arg),\n expected: expected,\n operator: oper || '===',\n stackStartFunction: _toss.caller\n });\n}\n\nfunction _getClass(arg) {\n return (Object.prototype.toString.call(arg).slice(8, -1));\n}\n\nfunction noop() {\n // Why even bother with asserts?\n}\n\n\n///--- Exports\n\nvar types = {\n bool: {\n check: function (arg) { return typeof (arg) === 'boolean'; }\n },\n func: {\n check: function (arg) { return typeof (arg) === 'function'; }\n },\n string: {\n check: function (arg) { return typeof (arg) === 'string'; }\n },\n object: {\n check: function (arg) {\n return typeof (arg) === 'object' && arg !== null;\n }\n },\n number: {\n check: function (arg) {\n return typeof (arg) === 'number' && !isNaN(arg);\n }\n },\n finite: {\n check: function (arg) {\n return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);\n }\n },\n buffer: {\n check: function (arg) { return Buffer.isBuffer(arg); },\n operator: 'Buffer.isBuffer'\n },\n array: {\n check: function (arg) { return Array.isArray(arg); },\n operator: 'Array.isArray'\n },\n stream: {\n check: function (arg) { return arg instanceof Stream; },\n operator: 'instanceof',\n actual: _getClass\n },\n date: {\n check: function (arg) { return arg instanceof Date; },\n operator: 'instanceof',\n actual: _getClass\n },\n regexp: {\n check: function (arg) { return arg instanceof RegExp; },\n operator: 'instanceof',\n actual: _getClass\n },\n uuid: {\n check: function (arg) {\n return typeof (arg) === 'string' && UUID_REGEXP.test(arg);\n },\n operator: 'isUUID'\n }\n};\n\nfunction _setExports(ndebug) {\n var keys = Object.keys(types);\n var out;\n\n /* re-export standard assert */\n if (process.env.NODE_NDEBUG) {\n out = noop;\n } else {\n out = function (arg, msg) {\n if (!arg) {\n _toss(msg, 'true', arg);\n }\n };\n }\n\n /* standard checks */\n keys.forEach(function (k) {\n if (ndebug) {\n out[k] = noop;\n return;\n }\n var type = types[k];\n out[k] = function (arg, msg) {\n if (!type.check(arg)) {\n _toss(msg, k, type.operator, arg, type.actual);\n }\n };\n });\n\n /* optional checks */\n keys.forEach(function (k) {\n var name = 'optional' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n out[name] = function (arg, msg) {\n if (arg === undefined || arg === null) {\n return;\n }\n if (!type.check(arg)) {\n _toss(msg, k, type.operator, arg, type.actual);\n }\n };\n });\n\n /* arrayOf checks */\n keys.forEach(function (k) {\n var name = 'arrayOf' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n var expected = '[' + k + ']';\n out[name] = function (arg, msg) {\n if (!Array.isArray(arg)) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n var i;\n for (i = 0; i < arg.length; i++) {\n if (!type.check(arg[i])) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n }\n };\n });\n\n /* optionalArrayOf checks */\n keys.forEach(function (k) {\n var name = 'optionalArrayOf' + _capitalize(k);\n if (ndebug) {\n out[name] = noop;\n return;\n }\n var type = types[k];\n var expected = '[' + k + ']';\n out[name] = function (arg, msg) {\n if (arg === undefined || arg === null) {\n return;\n }\n if (!Array.isArray(arg)) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n var i;\n for (i = 0; i < arg.length; i++) {\n if (!type.check(arg[i])) {\n _toss(msg, expected, type.operator, arg, type.actual);\n }\n }\n };\n });\n\n /* re-export built-in assertions */\n Object.keys(assert).forEach(function (k) {\n if (k === 'AssertionError') {\n out[k] = assert[k];\n return;\n }\n if (ndebug) {\n out[k] = noop;\n return;\n }\n out[k] = assert[k];\n });\n\n /* export ourselves (for unit tests _only_) */\n out._setExports = _setExports;\n\n return out;\n}\n\nmodule.exports = _setExports(process.env.NODE_NDEBUG);\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],t):t((e=\"undefined\"!=typeof globalThis?globalThis:e||self)[\"async-wait-until\"]={})}(this,(function(e){\"use strict\";class t extends Error{constructor(e){super(null!=e?`Timed out after waiting for ${e} ms`:\"Timed out\"),Object.setPrototypeOf(this,t.prototype)}}const o=(e,t)=>new Promise(((o,n)=>{try{e.schedule(o,t)}catch(e){n(e)}})),n={schedule:(e,t)=>{let o;const n=e=>{null!=e&&clearTimeout(e),o=void 0};return o=setTimeout((()=>{n(o),e()}),t),{cancel:()=>n(o)}}},i=Number.POSITIVE_INFINITY,r=(e,r,l)=>{var u,s;const c=null!==(u=\"number\"==typeof r?r:null==r?void 0:r.timeout)&&void 0!==u?u:5e3,d=null!==(s=\"number\"==typeof r?l:null==r?void 0:r.intervalBetweenAttempts)&&void 0!==s?s:50;let a=!1;const f=()=>new Promise(((t,i)=>{const r=()=>{a||new Promise(((t,o)=>{try{t(e())}catch(e){o(e)}})).then((e=>{e?t(e):o(n,d).then(r).catch(i)})).catch(i)};r()})),T=c!==i?()=>o(n,c).then((()=>{throw a=!0,new t(c)})):void 0;return null!=T?Promise.race([f(),T()]):f()};e.DEFAULT_INTERVAL_BETWEEN_ATTEMPTS_IN_MS=50,e.DEFAULT_TIMEOUT_IN_MS=5e3,e.TimeoutError=t,e.WAIT_FOREVER=i,e.default=r,e.waitUntil=r,Object.defineProperty(e,\"__esModule\",{value:!0})}));//# sourceMappingURL=index.js.map\n","module.exports =\n{\n parallel : require('./parallel.js'),\n serial : require('./serial.js'),\n serialOrdered : require('./serialOrdered.js')\n};\n","// API\nmodule.exports = abort;\n\n/**\n * Aborts leftover active jobs\n *\n * @param {object} state - current state object\n */\nfunction abort(state)\n{\n Object.keys(state.jobs).forEach(clean.bind(state));\n\n // reset leftover jobs\n state.jobs = {};\n}\n\n/**\n * Cleans up leftover job by invoking abort function for the provided job id\n *\n * @this state\n * @param {string|number} key - job id to abort\n */\nfunction clean(key)\n{\n if (typeof this.jobs[key] == 'function')\n {\n this.jobs[key]();\n }\n}\n","var defer = require('./defer.js');\n\n// API\nmodule.exports = async;\n\n/**\n * Runs provided callback asynchronously\n * even if callback itself is not\n *\n * @param {function} callback - callback to invoke\n * @returns {function} - augmented callback\n */\nfunction async(callback)\n{\n var isAsync = false;\n\n // check if async happened\n defer(function() { isAsync = true; });\n\n return function async_callback(err, result)\n {\n if (isAsync)\n {\n callback(err, result);\n }\n else\n {\n defer(function nextTick_callback()\n {\n callback(err, result);\n });\n }\n };\n}\n","module.exports = defer;\n\n/**\n * Runs provided function on next iteration of the event loop\n *\n * @param {function} fn - function to run\n */\nfunction defer(fn)\n{\n var nextTick = typeof setImmediate == 'function'\n ? setImmediate\n : (\n typeof process == 'object' && typeof process.nextTick == 'function'\n ? process.nextTick\n : null\n );\n\n if (nextTick)\n {\n nextTick(fn);\n }\n else\n {\n setTimeout(fn, 0);\n }\n}\n","var async = require('./async.js')\n , abort = require('./abort.js')\n ;\n\n// API\nmodule.exports = iterate;\n\n/**\n * Iterates over each job object\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {object} state - current job status\n * @param {function} callback - invoked when all elements processed\n */\nfunction iterate(list, iterator, state, callback)\n{\n // store current index\n var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;\n\n state.jobs[key] = runJob(iterator, key, list[key], function(error, output)\n {\n // don't repeat yourself\n // skip secondary callbacks\n if (!(key in state.jobs))\n {\n return;\n }\n\n // clean up jobs\n delete state.jobs[key];\n\n if (error)\n {\n // don't process rest of the results\n // stop still active jobs\n // and reset the list\n abort(state);\n }\n else\n {\n state.results[key] = output;\n }\n\n // return salvaged results\n callback(error, state.results);\n });\n}\n\n/**\n * Runs iterator over provided job element\n *\n * @param {function} iterator - iterator to invoke\n * @param {string|number} key - key/index of the element in the list of jobs\n * @param {mixed} item - job description\n * @param {function} callback - invoked after iterator is done with the job\n * @returns {function|mixed} - job abort function or something else\n */\nfunction runJob(iterator, key, item, callback)\n{\n var aborter;\n\n // allow shortcut if iterator expects only two arguments\n if (iterator.length == 2)\n {\n aborter = iterator(item, async(callback));\n }\n // otherwise go with full three arguments\n else\n {\n aborter = iterator(item, key, async(callback));\n }\n\n return aborter;\n}\n","// API\nmodule.exports = state;\n\n/**\n * Creates initial state object\n * for iteration over list\n *\n * @param {array|object} list - list to iterate over\n * @param {function|null} sortMethod - function to use for keys sort,\n * or `null` to keep them as is\n * @returns {object} - initial state object\n */\nfunction state(list, sortMethod)\n{\n var isNamedList = !Array.isArray(list)\n , initState =\n {\n index : 0,\n keyedList: isNamedList || sortMethod ? Object.keys(list) : null,\n jobs : {},\n results : isNamedList ? {} : [],\n size : isNamedList ? Object.keys(list).length : list.length\n }\n ;\n\n if (sortMethod)\n {\n // sort array keys based on it's values\n // sort object's keys just on own merit\n initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)\n {\n return sortMethod(list[a], list[b]);\n });\n }\n\n return initState;\n}\n","var abort = require('./abort.js')\n , async = require('./async.js')\n ;\n\n// API\nmodule.exports = terminator;\n\n/**\n * Terminates jobs in the attached state context\n *\n * @this AsyncKitState#\n * @param {function} callback - final callback to invoke after termination\n */\nfunction terminator(callback)\n{\n if (!Object.keys(this.jobs).length)\n {\n return;\n }\n\n // fast forward iteration index\n this.index = this.size;\n\n // abort jobs\n abort(this);\n\n // send back results we have so far\n async(callback)(null, this.results);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = parallel;\n\n/**\n * Runs iterator over provided array elements in parallel\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction parallel(list, iterator, callback)\n{\n var state = initState(list);\n\n while (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, function(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n // looks like it's the last one\n if (Object.keys(state.jobs).length === 0)\n {\n callback(null, state.results);\n return;\n }\n });\n\n state.index++;\n }\n\n return terminator.bind(state, callback);\n}\n","var serialOrdered = require('./serialOrdered.js');\n\n// Public API\nmodule.exports = serial;\n\n/**\n * Runs iterator over provided array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serial(list, iterator, callback)\n{\n return serialOrdered(list, iterator, null, callback);\n}\n","var iterate = require('./lib/iterate.js')\n , initState = require('./lib/state.js')\n , terminator = require('./lib/terminator.js')\n ;\n\n// Public API\nmodule.exports = serialOrdered;\n// sorting helpers\nmodule.exports.ascending = ascending;\nmodule.exports.descending = descending;\n\n/**\n * Runs iterator over provided sorted array elements in series\n *\n * @param {array|object} list - array or object (named list) to iterate over\n * @param {function} iterator - iterator to run\n * @param {function} sortMethod - custom sort function\n * @param {function} callback - invoked when all elements processed\n * @returns {function} - jobs terminator\n */\nfunction serialOrdered(list, iterator, sortMethod, callback)\n{\n var state = initState(list, sortMethod);\n\n iterate(list, iterator, state, function iteratorHandler(error, result)\n {\n if (error)\n {\n callback(error, result);\n return;\n }\n\n state.index++;\n\n // are we there yet?\n if (state.index < (state['keyedList'] || list).length)\n {\n iterate(list, iterator, state, iteratorHandler);\n return;\n }\n\n // done here\n callback(null, state.results);\n });\n\n return terminator.bind(state, callback);\n}\n\n/*\n * -- Sort methods\n */\n\n/**\n * sort helper to sort array elements in ascending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction ascending(a, b)\n{\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\n/**\n * sort helper to sort array elements in descending order\n *\n * @param {mixed} a - an item to compare\n * @param {mixed} b - an item to compare\n * @returns {number} - comparison result\n */\nfunction descending(a, b)\n{\n return -1 * ascending(a, b);\n}\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['accessanalyzer'] = {};\nAWS.AccessAnalyzer = Service.defineService('accessanalyzer', ['2019-11-01']);\nObject.defineProperty(apiLoader.services['accessanalyzer'], '2019-11-01', {\n get: function get() {\n var model = require('../apis/accessanalyzer-2019-11-01.min.json');\n model.paginators = require('../apis/accessanalyzer-2019-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AccessAnalyzer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['account'] = {};\nAWS.Account = Service.defineService('account', ['2021-02-01']);\nObject.defineProperty(apiLoader.services['account'], '2021-02-01', {\n get: function get() {\n var model = require('../apis/account-2021-02-01.min.json');\n model.paginators = require('../apis/account-2021-02-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Account;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['acm'] = {};\nAWS.ACM = Service.defineService('acm', ['2015-12-08']);\nObject.defineProperty(apiLoader.services['acm'], '2015-12-08', {\n get: function get() {\n var model = require('../apis/acm-2015-12-08.min.json');\n model.paginators = require('../apis/acm-2015-12-08.paginators.json').pagination;\n model.waiters = require('../apis/acm-2015-12-08.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ACM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['acmpca'] = {};\nAWS.ACMPCA = Service.defineService('acmpca', ['2017-08-22']);\nObject.defineProperty(apiLoader.services['acmpca'], '2017-08-22', {\n get: function get() {\n var model = require('../apis/acm-pca-2017-08-22.min.json');\n model.paginators = require('../apis/acm-pca-2017-08-22.paginators.json').pagination;\n model.waiters = require('../apis/acm-pca-2017-08-22.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ACMPCA;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['alexaforbusiness'] = {};\nAWS.AlexaForBusiness = Service.defineService('alexaforbusiness', ['2017-11-09']);\nObject.defineProperty(apiLoader.services['alexaforbusiness'], '2017-11-09', {\n get: function get() {\n var model = require('../apis/alexaforbusiness-2017-11-09.min.json');\n model.paginators = require('../apis/alexaforbusiness-2017-11-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AlexaForBusiness;\n","require('../lib/node_loader');\nmodule.exports = {\n ACM: require('./acm'),\n APIGateway: require('./apigateway'),\n ApplicationAutoScaling: require('./applicationautoscaling'),\n AppStream: require('./appstream'),\n AutoScaling: require('./autoscaling'),\n Batch: require('./batch'),\n Budgets: require('./budgets'),\n CloudDirectory: require('./clouddirectory'),\n CloudFormation: require('./cloudformation'),\n CloudFront: require('./cloudfront'),\n CloudHSM: require('./cloudhsm'),\n CloudSearch: require('./cloudsearch'),\n CloudSearchDomain: require('./cloudsearchdomain'),\n CloudTrail: require('./cloudtrail'),\n CloudWatch: require('./cloudwatch'),\n CloudWatchEvents: require('./cloudwatchevents'),\n CloudWatchLogs: require('./cloudwatchlogs'),\n CodeBuild: require('./codebuild'),\n CodeCommit: require('./codecommit'),\n CodeDeploy: require('./codedeploy'),\n CodePipeline: require('./codepipeline'),\n CognitoIdentity: require('./cognitoidentity'),\n CognitoIdentityServiceProvider: require('./cognitoidentityserviceprovider'),\n CognitoSync: require('./cognitosync'),\n ConfigService: require('./configservice'),\n CUR: require('./cur'),\n DataPipeline: require('./datapipeline'),\n DeviceFarm: require('./devicefarm'),\n DirectConnect: require('./directconnect'),\n DirectoryService: require('./directoryservice'),\n Discovery: require('./discovery'),\n DMS: require('./dms'),\n DynamoDB: require('./dynamodb'),\n DynamoDBStreams: require('./dynamodbstreams'),\n EC2: require('./ec2'),\n ECR: require('./ecr'),\n ECS: require('./ecs'),\n EFS: require('./efs'),\n ElastiCache: require('./elasticache'),\n ElasticBeanstalk: require('./elasticbeanstalk'),\n ELB: require('./elb'),\n ELBv2: require('./elbv2'),\n EMR: require('./emr'),\n ES: require('./es'),\n ElasticTranscoder: require('./elastictranscoder'),\n Firehose: require('./firehose'),\n GameLift: require('./gamelift'),\n Glacier: require('./glacier'),\n Health: require('./health'),\n IAM: require('./iam'),\n ImportExport: require('./importexport'),\n Inspector: require('./inspector'),\n Iot: require('./iot'),\n IotData: require('./iotdata'),\n Kinesis: require('./kinesis'),\n KinesisAnalytics: require('./kinesisanalytics'),\n KMS: require('./kms'),\n Lambda: require('./lambda'),\n LexRuntime: require('./lexruntime'),\n Lightsail: require('./lightsail'),\n MachineLearning: require('./machinelearning'),\n MarketplaceCommerceAnalytics: require('./marketplacecommerceanalytics'),\n MarketplaceMetering: require('./marketplacemetering'),\n MTurk: require('./mturk'),\n MobileAnalytics: require('./mobileanalytics'),\n OpsWorks: require('./opsworks'),\n OpsWorksCM: require('./opsworkscm'),\n Organizations: require('./organizations'),\n Pinpoint: require('./pinpoint'),\n Polly: require('./polly'),\n RDS: require('./rds'),\n Redshift: require('./redshift'),\n Rekognition: require('./rekognition'),\n ResourceGroupsTaggingAPI: require('./resourcegroupstaggingapi'),\n Route53: require('./route53'),\n Route53Domains: require('./route53domains'),\n S3: require('./s3'),\n S3Control: require('./s3control'),\n ServiceCatalog: require('./servicecatalog'),\n SES: require('./ses'),\n Shield: require('./shield'),\n SimpleDB: require('./simpledb'),\n SMS: require('./sms'),\n Snowball: require('./snowball'),\n SNS: require('./sns'),\n SQS: require('./sqs'),\n SSM: require('./ssm'),\n StorageGateway: require('./storagegateway'),\n StepFunctions: require('./stepfunctions'),\n STS: require('./sts'),\n Support: require('./support'),\n SWF: require('./swf'),\n XRay: require('./xray'),\n WAF: require('./waf'),\n WAFRegional: require('./wafregional'),\n WorkDocs: require('./workdocs'),\n WorkSpaces: require('./workspaces'),\n CodeStar: require('./codestar'),\n LexModelBuildingService: require('./lexmodelbuildingservice'),\n MarketplaceEntitlementService: require('./marketplaceentitlementservice'),\n Athena: require('./athena'),\n Greengrass: require('./greengrass'),\n DAX: require('./dax'),\n MigrationHub: require('./migrationhub'),\n CloudHSMV2: require('./cloudhsmv2'),\n Glue: require('./glue'),\n Mobile: require('./mobile'),\n Pricing: require('./pricing'),\n CostExplorer: require('./costexplorer'),\n MediaConvert: require('./mediaconvert'),\n MediaLive: require('./medialive'),\n MediaPackage: require('./mediapackage'),\n MediaStore: require('./mediastore'),\n MediaStoreData: require('./mediastoredata'),\n AppSync: require('./appsync'),\n GuardDuty: require('./guardduty'),\n MQ: require('./mq'),\n Comprehend: require('./comprehend'),\n IoTJobsDataPlane: require('./iotjobsdataplane'),\n KinesisVideoArchivedMedia: require('./kinesisvideoarchivedmedia'),\n KinesisVideoMedia: require('./kinesisvideomedia'),\n KinesisVideo: require('./kinesisvideo'),\n SageMakerRuntime: require('./sagemakerruntime'),\n SageMaker: require('./sagemaker'),\n Translate: require('./translate'),\n ResourceGroups: require('./resourcegroups'),\n AlexaForBusiness: require('./alexaforbusiness'),\n Cloud9: require('./cloud9'),\n ServerlessApplicationRepository: require('./serverlessapplicationrepository'),\n ServiceDiscovery: require('./servicediscovery'),\n WorkMail: require('./workmail'),\n AutoScalingPlans: require('./autoscalingplans'),\n TranscribeService: require('./transcribeservice'),\n Connect: require('./connect'),\n ACMPCA: require('./acmpca'),\n FMS: require('./fms'),\n SecretsManager: require('./secretsmanager'),\n IoTAnalytics: require('./iotanalytics'),\n IoT1ClickDevicesService: require('./iot1clickdevicesservice'),\n IoT1ClickProjects: require('./iot1clickprojects'),\n PI: require('./pi'),\n Neptune: require('./neptune'),\n MediaTailor: require('./mediatailor'),\n EKS: require('./eks'),\n Macie: require('./macie'),\n DLM: require('./dlm'),\n Signer: require('./signer'),\n Chime: require('./chime'),\n PinpointEmail: require('./pinpointemail'),\n RAM: require('./ram'),\n Route53Resolver: require('./route53resolver'),\n PinpointSMSVoice: require('./pinpointsmsvoice'),\n QuickSight: require('./quicksight'),\n RDSDataService: require('./rdsdataservice'),\n Amplify: require('./amplify'),\n DataSync: require('./datasync'),\n RoboMaker: require('./robomaker'),\n Transfer: require('./transfer'),\n GlobalAccelerator: require('./globalaccelerator'),\n ComprehendMedical: require('./comprehendmedical'),\n KinesisAnalyticsV2: require('./kinesisanalyticsv2'),\n MediaConnect: require('./mediaconnect'),\n FSx: require('./fsx'),\n SecurityHub: require('./securityhub'),\n AppMesh: require('./appmesh'),\n LicenseManager: require('./licensemanager'),\n Kafka: require('./kafka'),\n ApiGatewayManagementApi: require('./apigatewaymanagementapi'),\n ApiGatewayV2: require('./apigatewayv2'),\n DocDB: require('./docdb'),\n Backup: require('./backup'),\n WorkLink: require('./worklink'),\n Textract: require('./textract'),\n ManagedBlockchain: require('./managedblockchain'),\n MediaPackageVod: require('./mediapackagevod'),\n GroundStation: require('./groundstation'),\n IoTThingsGraph: require('./iotthingsgraph'),\n IoTEvents: require('./iotevents'),\n IoTEventsData: require('./ioteventsdata'),\n Personalize: require('./personalize'),\n PersonalizeEvents: require('./personalizeevents'),\n PersonalizeRuntime: require('./personalizeruntime'),\n ApplicationInsights: require('./applicationinsights'),\n ServiceQuotas: require('./servicequotas'),\n EC2InstanceConnect: require('./ec2instanceconnect'),\n EventBridge: require('./eventbridge'),\n LakeFormation: require('./lakeformation'),\n ForecastService: require('./forecastservice'),\n ForecastQueryService: require('./forecastqueryservice'),\n QLDB: require('./qldb'),\n QLDBSession: require('./qldbsession'),\n WorkMailMessageFlow: require('./workmailmessageflow'),\n CodeStarNotifications: require('./codestarnotifications'),\n SavingsPlans: require('./savingsplans'),\n SSO: require('./sso'),\n SSOOIDC: require('./ssooidc'),\n MarketplaceCatalog: require('./marketplacecatalog'),\n DataExchange: require('./dataexchange'),\n SESV2: require('./sesv2'),\n MigrationHubConfig: require('./migrationhubconfig'),\n ConnectParticipant: require('./connectparticipant'),\n AppConfig: require('./appconfig'),\n IoTSecureTunneling: require('./iotsecuretunneling'),\n WAFV2: require('./wafv2'),\n ElasticInference: require('./elasticinference'),\n Imagebuilder: require('./imagebuilder'),\n Schemas: require('./schemas'),\n AccessAnalyzer: require('./accessanalyzer'),\n CodeGuruReviewer: require('./codegurureviewer'),\n CodeGuruProfiler: require('./codeguruprofiler'),\n ComputeOptimizer: require('./computeoptimizer'),\n FraudDetector: require('./frauddetector'),\n Kendra: require('./kendra'),\n NetworkManager: require('./networkmanager'),\n Outposts: require('./outposts'),\n AugmentedAIRuntime: require('./augmentedairuntime'),\n EBS: require('./ebs'),\n KinesisVideoSignalingChannels: require('./kinesisvideosignalingchannels'),\n Detective: require('./detective'),\n CodeStarconnections: require('./codestarconnections'),\n Synthetics: require('./synthetics'),\n IoTSiteWise: require('./iotsitewise'),\n Macie2: require('./macie2'),\n CodeArtifact: require('./codeartifact'),\n Honeycode: require('./honeycode'),\n IVS: require('./ivs'),\n Braket: require('./braket'),\n IdentityStore: require('./identitystore'),\n Appflow: require('./appflow'),\n RedshiftData: require('./redshiftdata'),\n SSOAdmin: require('./ssoadmin'),\n TimestreamQuery: require('./timestreamquery'),\n TimestreamWrite: require('./timestreamwrite'),\n S3Outposts: require('./s3outposts'),\n DataBrew: require('./databrew'),\n ServiceCatalogAppRegistry: require('./servicecatalogappregistry'),\n NetworkFirewall: require('./networkfirewall'),\n MWAA: require('./mwaa'),\n AmplifyBackend: require('./amplifybackend'),\n AppIntegrations: require('./appintegrations'),\n ConnectContactLens: require('./connectcontactlens'),\n DevOpsGuru: require('./devopsguru'),\n ECRPUBLIC: require('./ecrpublic'),\n LookoutVision: require('./lookoutvision'),\n SageMakerFeatureStoreRuntime: require('./sagemakerfeaturestoreruntime'),\n CustomerProfiles: require('./customerprofiles'),\n AuditManager: require('./auditmanager'),\n EMRcontainers: require('./emrcontainers'),\n HealthLake: require('./healthlake'),\n SagemakerEdge: require('./sagemakeredge'),\n Amp: require('./amp'),\n GreengrassV2: require('./greengrassv2'),\n IotDeviceAdvisor: require('./iotdeviceadvisor'),\n IoTFleetHub: require('./iotfleethub'),\n IoTWireless: require('./iotwireless'),\n Location: require('./location'),\n WellArchitected: require('./wellarchitected'),\n LexModelsV2: require('./lexmodelsv2'),\n LexRuntimeV2: require('./lexruntimev2'),\n Fis: require('./fis'),\n LookoutMetrics: require('./lookoutmetrics'),\n Mgn: require('./mgn'),\n LookoutEquipment: require('./lookoutequipment'),\n Nimble: require('./nimble'),\n Finspace: require('./finspace'),\n Finspacedata: require('./finspacedata'),\n SSMContacts: require('./ssmcontacts'),\n SSMIncidents: require('./ssmincidents'),\n ApplicationCostProfiler: require('./applicationcostprofiler'),\n AppRunner: require('./apprunner'),\n Proton: require('./proton'),\n Route53RecoveryCluster: require('./route53recoverycluster'),\n Route53RecoveryControlConfig: require('./route53recoverycontrolconfig'),\n Route53RecoveryReadiness: require('./route53recoveryreadiness'),\n ChimeSDKIdentity: require('./chimesdkidentity'),\n ChimeSDKMessaging: require('./chimesdkmessaging'),\n SnowDeviceManagement: require('./snowdevicemanagement'),\n MemoryDB: require('./memorydb'),\n OpenSearch: require('./opensearch'),\n KafkaConnect: require('./kafkaconnect'),\n VoiceID: require('./voiceid'),\n Wisdom: require('./wisdom'),\n Account: require('./account'),\n CloudControl: require('./cloudcontrol'),\n Grafana: require('./grafana'),\n Panorama: require('./panorama'),\n ChimeSDKMeetings: require('./chimesdkmeetings'),\n Resiliencehub: require('./resiliencehub'),\n MigrationHubStrategy: require('./migrationhubstrategy'),\n AppConfigData: require('./appconfigdata'),\n Drs: require('./drs'),\n MigrationHubRefactorSpaces: require('./migrationhubrefactorspaces'),\n Evidently: require('./evidently'),\n Inspector2: require('./inspector2'),\n Rbin: require('./rbin'),\n RUM: require('./rum'),\n BackupGateway: require('./backupgateway'),\n IoTTwinMaker: require('./iottwinmaker'),\n WorkSpacesWeb: require('./workspacesweb'),\n AmplifyUIBuilder: require('./amplifyuibuilder'),\n Keyspaces: require('./keyspaces'),\n Billingconductor: require('./billingconductor'),\n GameSparks: require('./gamesparks'),\n PinpointSMSVoiceV2: require('./pinpointsmsvoicev2'),\n Ivschat: require('./ivschat'),\n ChimeSDKMediaPipelines: require('./chimesdkmediapipelines'),\n EMRServerless: require('./emrserverless'),\n M2: require('./m2'),\n ConnectCampaigns: require('./connectcampaigns'),\n RedshiftServerless: require('./redshiftserverless'),\n RolesAnywhere: require('./rolesanywhere'),\n LicenseManagerUserSubscriptions: require('./licensemanagerusersubscriptions'),\n BackupStorage: require('./backupstorage'),\n PrivateNetworks: require('./privatenetworks'),\n SupportApp: require('./supportapp'),\n ControlTower: require('./controltower'),\n IoTFleetWise: require('./iotfleetwise'),\n MigrationHubOrchestrator: require('./migrationhuborchestrator'),\n ConnectCases: require('./connectcases'),\n ResourceExplorer2: require('./resourceexplorer2'),\n Scheduler: require('./scheduler'),\n ChimeSDKVoice: require('./chimesdkvoice'),\n IoTRoboRunner: require('./iotroborunner'),\n SsmSap: require('./ssmsap'),\n OAM: require('./oam'),\n ARCZonalShift: require('./arczonalshift'),\n Omics: require('./omics'),\n OpenSearchServerless: require('./opensearchserverless'),\n SecurityLake: require('./securitylake'),\n SimSpaceWeaver: require('./simspaceweaver'),\n DocDBElastic: require('./docdbelastic'),\n SageMakerGeospatial: require('./sagemakergeospatial'),\n CodeCatalyst: require('./codecatalyst'),\n Pipes: require('./pipes'),\n SageMakerMetrics: require('./sagemakermetrics'),\n KinesisVideoWebRTCStorage: require('./kinesisvideowebrtcstorage'),\n LicenseManagerLinuxSubscriptions: require('./licensemanagerlinuxsubscriptions'),\n KendraRanking: require('./kendraranking'),\n CleanRooms: require('./cleanrooms'),\n CloudTrailData: require('./cloudtraildata'),\n Tnb: require('./tnb'),\n InternetMonitor: require('./internetmonitor'),\n IVSRealTime: require('./ivsrealtime'),\n VPCLattice: require('./vpclattice'),\n OSIS: require('./osis'),\n MediaPackageV2: require('./mediapackagev2'),\n PaymentCryptography: require('./paymentcryptography'),\n PaymentCryptographyData: require('./paymentcryptographydata'),\n CodeGuruSecurity: require('./codegurusecurity'),\n VerifiedPermissions: require('./verifiedpermissions'),\n AppFabric: require('./appfabric'),\n MedicalImaging: require('./medicalimaging'),\n EntityResolution: require('./entityresolution'),\n ManagedBlockchainQuery: require('./managedblockchainquery')\n};","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['amp'] = {};\nAWS.Amp = Service.defineService('amp', ['2020-08-01']);\nObject.defineProperty(apiLoader.services['amp'], '2020-08-01', {\n get: function get() {\n var model = require('../apis/amp-2020-08-01.min.json');\n model.paginators = require('../apis/amp-2020-08-01.paginators.json').pagination;\n model.waiters = require('../apis/amp-2020-08-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Amp;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['amplify'] = {};\nAWS.Amplify = Service.defineService('amplify', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['amplify'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/amplify-2017-07-25.min.json');\n model.paginators = require('../apis/amplify-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Amplify;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['amplifybackend'] = {};\nAWS.AmplifyBackend = Service.defineService('amplifybackend', ['2020-08-11']);\nObject.defineProperty(apiLoader.services['amplifybackend'], '2020-08-11', {\n get: function get() {\n var model = require('../apis/amplifybackend-2020-08-11.min.json');\n model.paginators = require('../apis/amplifybackend-2020-08-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AmplifyBackend;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['amplifyuibuilder'] = {};\nAWS.AmplifyUIBuilder = Service.defineService('amplifyuibuilder', ['2021-08-11']);\nObject.defineProperty(apiLoader.services['amplifyuibuilder'], '2021-08-11', {\n get: function get() {\n var model = require('../apis/amplifyuibuilder-2021-08-11.min.json');\n model.paginators = require('../apis/amplifyuibuilder-2021-08-11.paginators.json').pagination;\n model.waiters = require('../apis/amplifyuibuilder-2021-08-11.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AmplifyUIBuilder;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['apigateway'] = {};\nAWS.APIGateway = Service.defineService('apigateway', ['2015-07-09']);\nrequire('../lib/services/apigateway');\nObject.defineProperty(apiLoader.services['apigateway'], '2015-07-09', {\n get: function get() {\n var model = require('../apis/apigateway-2015-07-09.min.json');\n model.paginators = require('../apis/apigateway-2015-07-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.APIGateway;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['apigatewaymanagementapi'] = {};\nAWS.ApiGatewayManagementApi = Service.defineService('apigatewaymanagementapi', ['2018-11-29']);\nObject.defineProperty(apiLoader.services['apigatewaymanagementapi'], '2018-11-29', {\n get: function get() {\n var model = require('../apis/apigatewaymanagementapi-2018-11-29.min.json');\n model.paginators = require('../apis/apigatewaymanagementapi-2018-11-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApiGatewayManagementApi;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['apigatewayv2'] = {};\nAWS.ApiGatewayV2 = Service.defineService('apigatewayv2', ['2018-11-29']);\nObject.defineProperty(apiLoader.services['apigatewayv2'], '2018-11-29', {\n get: function get() {\n var model = require('../apis/apigatewayv2-2018-11-29.min.json');\n model.paginators = require('../apis/apigatewayv2-2018-11-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApiGatewayV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appconfig'] = {};\nAWS.AppConfig = Service.defineService('appconfig', ['2019-10-09']);\nObject.defineProperty(apiLoader.services['appconfig'], '2019-10-09', {\n get: function get() {\n var model = require('../apis/appconfig-2019-10-09.min.json');\n model.paginators = require('../apis/appconfig-2019-10-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppConfig;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appconfigdata'] = {};\nAWS.AppConfigData = Service.defineService('appconfigdata', ['2021-11-11']);\nObject.defineProperty(apiLoader.services['appconfigdata'], '2021-11-11', {\n get: function get() {\n var model = require('../apis/appconfigdata-2021-11-11.min.json');\n model.paginators = require('../apis/appconfigdata-2021-11-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppConfigData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appfabric'] = {};\nAWS.AppFabric = Service.defineService('appfabric', ['2023-05-19']);\nObject.defineProperty(apiLoader.services['appfabric'], '2023-05-19', {\n get: function get() {\n var model = require('../apis/appfabric-2023-05-19.min.json');\n model.paginators = require('../apis/appfabric-2023-05-19.paginators.json').pagination;\n model.waiters = require('../apis/appfabric-2023-05-19.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppFabric;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appflow'] = {};\nAWS.Appflow = Service.defineService('appflow', ['2020-08-23']);\nObject.defineProperty(apiLoader.services['appflow'], '2020-08-23', {\n get: function get() {\n var model = require('../apis/appflow-2020-08-23.min.json');\n model.paginators = require('../apis/appflow-2020-08-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Appflow;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appintegrations'] = {};\nAWS.AppIntegrations = Service.defineService('appintegrations', ['2020-07-29']);\nObject.defineProperty(apiLoader.services['appintegrations'], '2020-07-29', {\n get: function get() {\n var model = require('../apis/appintegrations-2020-07-29.min.json');\n model.paginators = require('../apis/appintegrations-2020-07-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppIntegrations;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['applicationautoscaling'] = {};\nAWS.ApplicationAutoScaling = Service.defineService('applicationautoscaling', ['2016-02-06']);\nObject.defineProperty(apiLoader.services['applicationautoscaling'], '2016-02-06', {\n get: function get() {\n var model = require('../apis/application-autoscaling-2016-02-06.min.json');\n model.paginators = require('../apis/application-autoscaling-2016-02-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApplicationAutoScaling;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['applicationcostprofiler'] = {};\nAWS.ApplicationCostProfiler = Service.defineService('applicationcostprofiler', ['2020-09-10']);\nObject.defineProperty(apiLoader.services['applicationcostprofiler'], '2020-09-10', {\n get: function get() {\n var model = require('../apis/applicationcostprofiler-2020-09-10.min.json');\n model.paginators = require('../apis/applicationcostprofiler-2020-09-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApplicationCostProfiler;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['applicationinsights'] = {};\nAWS.ApplicationInsights = Service.defineService('applicationinsights', ['2018-11-25']);\nObject.defineProperty(apiLoader.services['applicationinsights'], '2018-11-25', {\n get: function get() {\n var model = require('../apis/application-insights-2018-11-25.min.json');\n model.paginators = require('../apis/application-insights-2018-11-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ApplicationInsights;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appmesh'] = {};\nAWS.AppMesh = Service.defineService('appmesh', ['2018-10-01', '2018-10-01*', '2019-01-25']);\nObject.defineProperty(apiLoader.services['appmesh'], '2018-10-01', {\n get: function get() {\n var model = require('../apis/appmesh-2018-10-01.min.json');\n model.paginators = require('../apis/appmesh-2018-10-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['appmesh'], '2019-01-25', {\n get: function get() {\n var model = require('../apis/appmesh-2019-01-25.min.json');\n model.paginators = require('../apis/appmesh-2019-01-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppMesh;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['apprunner'] = {};\nAWS.AppRunner = Service.defineService('apprunner', ['2020-05-15']);\nObject.defineProperty(apiLoader.services['apprunner'], '2020-05-15', {\n get: function get() {\n var model = require('../apis/apprunner-2020-05-15.min.json');\n model.paginators = require('../apis/apprunner-2020-05-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppRunner;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appstream'] = {};\nAWS.AppStream = Service.defineService('appstream', ['2016-12-01']);\nObject.defineProperty(apiLoader.services['appstream'], '2016-12-01', {\n get: function get() {\n var model = require('../apis/appstream-2016-12-01.min.json');\n model.paginators = require('../apis/appstream-2016-12-01.paginators.json').pagination;\n model.waiters = require('../apis/appstream-2016-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppStream;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['appsync'] = {};\nAWS.AppSync = Service.defineService('appsync', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['appsync'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/appsync-2017-07-25.min.json');\n model.paginators = require('../apis/appsync-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AppSync;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['arczonalshift'] = {};\nAWS.ARCZonalShift = Service.defineService('arczonalshift', ['2022-10-30']);\nObject.defineProperty(apiLoader.services['arczonalshift'], '2022-10-30', {\n get: function get() {\n var model = require('../apis/arc-zonal-shift-2022-10-30.min.json');\n model.paginators = require('../apis/arc-zonal-shift-2022-10-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ARCZonalShift;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['athena'] = {};\nAWS.Athena = Service.defineService('athena', ['2017-05-18']);\nObject.defineProperty(apiLoader.services['athena'], '2017-05-18', {\n get: function get() {\n var model = require('../apis/athena-2017-05-18.min.json');\n model.paginators = require('../apis/athena-2017-05-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Athena;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['auditmanager'] = {};\nAWS.AuditManager = Service.defineService('auditmanager', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['auditmanager'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/auditmanager-2017-07-25.min.json');\n model.paginators = require('../apis/auditmanager-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AuditManager;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['augmentedairuntime'] = {};\nAWS.AugmentedAIRuntime = Service.defineService('augmentedairuntime', ['2019-11-07']);\nObject.defineProperty(apiLoader.services['augmentedairuntime'], '2019-11-07', {\n get: function get() {\n var model = require('../apis/sagemaker-a2i-runtime-2019-11-07.min.json');\n model.paginators = require('../apis/sagemaker-a2i-runtime-2019-11-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AugmentedAIRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['autoscaling'] = {};\nAWS.AutoScaling = Service.defineService('autoscaling', ['2011-01-01']);\nObject.defineProperty(apiLoader.services['autoscaling'], '2011-01-01', {\n get: function get() {\n var model = require('../apis/autoscaling-2011-01-01.min.json');\n model.paginators = require('../apis/autoscaling-2011-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AutoScaling;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['autoscalingplans'] = {};\nAWS.AutoScalingPlans = Service.defineService('autoscalingplans', ['2018-01-06']);\nObject.defineProperty(apiLoader.services['autoscalingplans'], '2018-01-06', {\n get: function get() {\n var model = require('../apis/autoscaling-plans-2018-01-06.min.json');\n model.paginators = require('../apis/autoscaling-plans-2018-01-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.AutoScalingPlans;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['backup'] = {};\nAWS.Backup = Service.defineService('backup', ['2018-11-15']);\nObject.defineProperty(apiLoader.services['backup'], '2018-11-15', {\n get: function get() {\n var model = require('../apis/backup-2018-11-15.min.json');\n model.paginators = require('../apis/backup-2018-11-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Backup;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['backupgateway'] = {};\nAWS.BackupGateway = Service.defineService('backupgateway', ['2021-01-01']);\nObject.defineProperty(apiLoader.services['backupgateway'], '2021-01-01', {\n get: function get() {\n var model = require('../apis/backup-gateway-2021-01-01.min.json');\n model.paginators = require('../apis/backup-gateway-2021-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.BackupGateway;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['backupstorage'] = {};\nAWS.BackupStorage = Service.defineService('backupstorage', ['2018-04-10']);\nObject.defineProperty(apiLoader.services['backupstorage'], '2018-04-10', {\n get: function get() {\n var model = require('../apis/backupstorage-2018-04-10.min.json');\n model.paginators = require('../apis/backupstorage-2018-04-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.BackupStorage;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['batch'] = {};\nAWS.Batch = Service.defineService('batch', ['2016-08-10']);\nObject.defineProperty(apiLoader.services['batch'], '2016-08-10', {\n get: function get() {\n var model = require('../apis/batch-2016-08-10.min.json');\n model.paginators = require('../apis/batch-2016-08-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Batch;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['billingconductor'] = {};\nAWS.Billingconductor = Service.defineService('billingconductor', ['2021-07-30']);\nObject.defineProperty(apiLoader.services['billingconductor'], '2021-07-30', {\n get: function get() {\n var model = require('../apis/billingconductor-2021-07-30.min.json');\n model.paginators = require('../apis/billingconductor-2021-07-30.paginators.json').pagination;\n model.waiters = require('../apis/billingconductor-2021-07-30.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Billingconductor;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['braket'] = {};\nAWS.Braket = Service.defineService('braket', ['2019-09-01']);\nObject.defineProperty(apiLoader.services['braket'], '2019-09-01', {\n get: function get() {\n var model = require('../apis/braket-2019-09-01.min.json');\n model.paginators = require('../apis/braket-2019-09-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Braket;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['budgets'] = {};\nAWS.Budgets = Service.defineService('budgets', ['2016-10-20']);\nObject.defineProperty(apiLoader.services['budgets'], '2016-10-20', {\n get: function get() {\n var model = require('../apis/budgets-2016-10-20.min.json');\n model.paginators = require('../apis/budgets-2016-10-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Budgets;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['chime'] = {};\nAWS.Chime = Service.defineService('chime', ['2018-05-01']);\nObject.defineProperty(apiLoader.services['chime'], '2018-05-01', {\n get: function get() {\n var model = require('../apis/chime-2018-05-01.min.json');\n model.paginators = require('../apis/chime-2018-05-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Chime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['chimesdkidentity'] = {};\nAWS.ChimeSDKIdentity = Service.defineService('chimesdkidentity', ['2021-04-20']);\nObject.defineProperty(apiLoader.services['chimesdkidentity'], '2021-04-20', {\n get: function get() {\n var model = require('../apis/chime-sdk-identity-2021-04-20.min.json');\n model.paginators = require('../apis/chime-sdk-identity-2021-04-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ChimeSDKIdentity;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['chimesdkmediapipelines'] = {};\nAWS.ChimeSDKMediaPipelines = Service.defineService('chimesdkmediapipelines', ['2021-07-15']);\nObject.defineProperty(apiLoader.services['chimesdkmediapipelines'], '2021-07-15', {\n get: function get() {\n var model = require('../apis/chime-sdk-media-pipelines-2021-07-15.min.json');\n model.paginators = require('../apis/chime-sdk-media-pipelines-2021-07-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ChimeSDKMediaPipelines;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['chimesdkmeetings'] = {};\nAWS.ChimeSDKMeetings = Service.defineService('chimesdkmeetings', ['2021-07-15']);\nObject.defineProperty(apiLoader.services['chimesdkmeetings'], '2021-07-15', {\n get: function get() {\n var model = require('../apis/chime-sdk-meetings-2021-07-15.min.json');\n model.paginators = require('../apis/chime-sdk-meetings-2021-07-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ChimeSDKMeetings;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['chimesdkmessaging'] = {};\nAWS.ChimeSDKMessaging = Service.defineService('chimesdkmessaging', ['2021-05-15']);\nObject.defineProperty(apiLoader.services['chimesdkmessaging'], '2021-05-15', {\n get: function get() {\n var model = require('../apis/chime-sdk-messaging-2021-05-15.min.json');\n model.paginators = require('../apis/chime-sdk-messaging-2021-05-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ChimeSDKMessaging;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['chimesdkvoice'] = {};\nAWS.ChimeSDKVoice = Service.defineService('chimesdkvoice', ['2022-08-03']);\nObject.defineProperty(apiLoader.services['chimesdkvoice'], '2022-08-03', {\n get: function get() {\n var model = require('../apis/chime-sdk-voice-2022-08-03.min.json');\n model.paginators = require('../apis/chime-sdk-voice-2022-08-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ChimeSDKVoice;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cleanrooms'] = {};\nAWS.CleanRooms = Service.defineService('cleanrooms', ['2022-02-17']);\nObject.defineProperty(apiLoader.services['cleanrooms'], '2022-02-17', {\n get: function get() {\n var model = require('../apis/cleanrooms-2022-02-17.min.json');\n model.paginators = require('../apis/cleanrooms-2022-02-17.paginators.json').pagination;\n model.waiters = require('../apis/cleanrooms-2022-02-17.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CleanRooms;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloud9'] = {};\nAWS.Cloud9 = Service.defineService('cloud9', ['2017-09-23']);\nObject.defineProperty(apiLoader.services['cloud9'], '2017-09-23', {\n get: function get() {\n var model = require('../apis/cloud9-2017-09-23.min.json');\n model.paginators = require('../apis/cloud9-2017-09-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Cloud9;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudcontrol'] = {};\nAWS.CloudControl = Service.defineService('cloudcontrol', ['2021-09-30']);\nObject.defineProperty(apiLoader.services['cloudcontrol'], '2021-09-30', {\n get: function get() {\n var model = require('../apis/cloudcontrol-2021-09-30.min.json');\n model.paginators = require('../apis/cloudcontrol-2021-09-30.paginators.json').pagination;\n model.waiters = require('../apis/cloudcontrol-2021-09-30.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudControl;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['clouddirectory'] = {};\nAWS.CloudDirectory = Service.defineService('clouddirectory', ['2016-05-10', '2016-05-10*', '2017-01-11']);\nObject.defineProperty(apiLoader.services['clouddirectory'], '2016-05-10', {\n get: function get() {\n var model = require('../apis/clouddirectory-2016-05-10.min.json');\n model.paginators = require('../apis/clouddirectory-2016-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['clouddirectory'], '2017-01-11', {\n get: function get() {\n var model = require('../apis/clouddirectory-2017-01-11.min.json');\n model.paginators = require('../apis/clouddirectory-2017-01-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudDirectory;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudformation'] = {};\nAWS.CloudFormation = Service.defineService('cloudformation', ['2010-05-15']);\nObject.defineProperty(apiLoader.services['cloudformation'], '2010-05-15', {\n get: function get() {\n var model = require('../apis/cloudformation-2010-05-15.min.json');\n model.paginators = require('../apis/cloudformation-2010-05-15.paginators.json').pagination;\n model.waiters = require('../apis/cloudformation-2010-05-15.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudFormation;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudfront'] = {};\nAWS.CloudFront = Service.defineService('cloudfront', ['2013-05-12*', '2013-11-11*', '2014-05-31*', '2014-10-21*', '2014-11-06*', '2015-04-17*', '2015-07-27*', '2015-09-17*', '2016-01-13*', '2016-01-28*', '2016-08-01*', '2016-08-20*', '2016-09-07*', '2016-09-29*', '2016-11-25', '2016-11-25*', '2017-03-25', '2017-03-25*', '2017-10-30', '2017-10-30*', '2018-06-18', '2018-06-18*', '2018-11-05', '2018-11-05*', '2019-03-26', '2019-03-26*', '2020-05-31']);\nrequire('../lib/services/cloudfront');\nObject.defineProperty(apiLoader.services['cloudfront'], '2016-11-25', {\n get: function get() {\n var model = require('../apis/cloudfront-2016-11-25.min.json');\n model.paginators = require('../apis/cloudfront-2016-11-25.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2016-11-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2017-03-25', {\n get: function get() {\n var model = require('../apis/cloudfront-2017-03-25.min.json');\n model.paginators = require('../apis/cloudfront-2017-03-25.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2017-03-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2017-10-30', {\n get: function get() {\n var model = require('../apis/cloudfront-2017-10-30.min.json');\n model.paginators = require('../apis/cloudfront-2017-10-30.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2017-10-30.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2018-06-18', {\n get: function get() {\n var model = require('../apis/cloudfront-2018-06-18.min.json');\n model.paginators = require('../apis/cloudfront-2018-06-18.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2018-06-18.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2018-11-05', {\n get: function get() {\n var model = require('../apis/cloudfront-2018-11-05.min.json');\n model.paginators = require('../apis/cloudfront-2018-11-05.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2018-11-05.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2019-03-26', {\n get: function get() {\n var model = require('../apis/cloudfront-2019-03-26.min.json');\n model.paginators = require('../apis/cloudfront-2019-03-26.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2019-03-26.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudfront'], '2020-05-31', {\n get: function get() {\n var model = require('../apis/cloudfront-2020-05-31.min.json');\n model.paginators = require('../apis/cloudfront-2020-05-31.paginators.json').pagination;\n model.waiters = require('../apis/cloudfront-2020-05-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudFront;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudhsm'] = {};\nAWS.CloudHSM = Service.defineService('cloudhsm', ['2014-05-30']);\nObject.defineProperty(apiLoader.services['cloudhsm'], '2014-05-30', {\n get: function get() {\n var model = require('../apis/cloudhsm-2014-05-30.min.json');\n model.paginators = require('../apis/cloudhsm-2014-05-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudHSM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudhsmv2'] = {};\nAWS.CloudHSMV2 = Service.defineService('cloudhsmv2', ['2017-04-28']);\nObject.defineProperty(apiLoader.services['cloudhsmv2'], '2017-04-28', {\n get: function get() {\n var model = require('../apis/cloudhsmv2-2017-04-28.min.json');\n model.paginators = require('../apis/cloudhsmv2-2017-04-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudHSMV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudsearch'] = {};\nAWS.CloudSearch = Service.defineService('cloudsearch', ['2011-02-01', '2013-01-01']);\nObject.defineProperty(apiLoader.services['cloudsearch'], '2011-02-01', {\n get: function get() {\n var model = require('../apis/cloudsearch-2011-02-01.min.json');\n model.paginators = require('../apis/cloudsearch-2011-02-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['cloudsearch'], '2013-01-01', {\n get: function get() {\n var model = require('../apis/cloudsearch-2013-01-01.min.json');\n model.paginators = require('../apis/cloudsearch-2013-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudSearch;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudsearchdomain'] = {};\nAWS.CloudSearchDomain = Service.defineService('cloudsearchdomain', ['2013-01-01']);\nrequire('../lib/services/cloudsearchdomain');\nObject.defineProperty(apiLoader.services['cloudsearchdomain'], '2013-01-01', {\n get: function get() {\n var model = require('../apis/cloudsearchdomain-2013-01-01.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudSearchDomain;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudtrail'] = {};\nAWS.CloudTrail = Service.defineService('cloudtrail', ['2013-11-01']);\nObject.defineProperty(apiLoader.services['cloudtrail'], '2013-11-01', {\n get: function get() {\n var model = require('../apis/cloudtrail-2013-11-01.min.json');\n model.paginators = require('../apis/cloudtrail-2013-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudTrail;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudtraildata'] = {};\nAWS.CloudTrailData = Service.defineService('cloudtraildata', ['2021-08-11']);\nObject.defineProperty(apiLoader.services['cloudtraildata'], '2021-08-11', {\n get: function get() {\n var model = require('../apis/cloudtrail-data-2021-08-11.min.json');\n model.paginators = require('../apis/cloudtrail-data-2021-08-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudTrailData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudwatch'] = {};\nAWS.CloudWatch = Service.defineService('cloudwatch', ['2010-08-01']);\nObject.defineProperty(apiLoader.services['cloudwatch'], '2010-08-01', {\n get: function get() {\n var model = require('../apis/monitoring-2010-08-01.min.json');\n model.paginators = require('../apis/monitoring-2010-08-01.paginators.json').pagination;\n model.waiters = require('../apis/monitoring-2010-08-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudWatch;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudwatchevents'] = {};\nAWS.CloudWatchEvents = Service.defineService('cloudwatchevents', ['2014-02-03*', '2015-10-07']);\nObject.defineProperty(apiLoader.services['cloudwatchevents'], '2015-10-07', {\n get: function get() {\n var model = require('../apis/events-2015-10-07.min.json');\n model.paginators = require('../apis/events-2015-10-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudWatchEvents;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cloudwatchlogs'] = {};\nAWS.CloudWatchLogs = Service.defineService('cloudwatchlogs', ['2014-03-28']);\nObject.defineProperty(apiLoader.services['cloudwatchlogs'], '2014-03-28', {\n get: function get() {\n var model = require('../apis/logs-2014-03-28.min.json');\n model.paginators = require('../apis/logs-2014-03-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CloudWatchLogs;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codeartifact'] = {};\nAWS.CodeArtifact = Service.defineService('codeartifact', ['2018-09-22']);\nObject.defineProperty(apiLoader.services['codeartifact'], '2018-09-22', {\n get: function get() {\n var model = require('../apis/codeartifact-2018-09-22.min.json');\n model.paginators = require('../apis/codeartifact-2018-09-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeArtifact;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codebuild'] = {};\nAWS.CodeBuild = Service.defineService('codebuild', ['2016-10-06']);\nObject.defineProperty(apiLoader.services['codebuild'], '2016-10-06', {\n get: function get() {\n var model = require('../apis/codebuild-2016-10-06.min.json');\n model.paginators = require('../apis/codebuild-2016-10-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeBuild;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codecatalyst'] = {};\nAWS.CodeCatalyst = Service.defineService('codecatalyst', ['2022-09-28']);\nObject.defineProperty(apiLoader.services['codecatalyst'], '2022-09-28', {\n get: function get() {\n var model = require('../apis/codecatalyst-2022-09-28.min.json');\n model.paginators = require('../apis/codecatalyst-2022-09-28.paginators.json').pagination;\n model.waiters = require('../apis/codecatalyst-2022-09-28.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeCatalyst;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codecommit'] = {};\nAWS.CodeCommit = Service.defineService('codecommit', ['2015-04-13']);\nObject.defineProperty(apiLoader.services['codecommit'], '2015-04-13', {\n get: function get() {\n var model = require('../apis/codecommit-2015-04-13.min.json');\n model.paginators = require('../apis/codecommit-2015-04-13.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeCommit;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codedeploy'] = {};\nAWS.CodeDeploy = Service.defineService('codedeploy', ['2014-10-06']);\nObject.defineProperty(apiLoader.services['codedeploy'], '2014-10-06', {\n get: function get() {\n var model = require('../apis/codedeploy-2014-10-06.min.json');\n model.paginators = require('../apis/codedeploy-2014-10-06.paginators.json').pagination;\n model.waiters = require('../apis/codedeploy-2014-10-06.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeDeploy;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codeguruprofiler'] = {};\nAWS.CodeGuruProfiler = Service.defineService('codeguruprofiler', ['2019-07-18']);\nObject.defineProperty(apiLoader.services['codeguruprofiler'], '2019-07-18', {\n get: function get() {\n var model = require('../apis/codeguruprofiler-2019-07-18.min.json');\n model.paginators = require('../apis/codeguruprofiler-2019-07-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeGuruProfiler;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codegurureviewer'] = {};\nAWS.CodeGuruReviewer = Service.defineService('codegurureviewer', ['2019-09-19']);\nObject.defineProperty(apiLoader.services['codegurureviewer'], '2019-09-19', {\n get: function get() {\n var model = require('../apis/codeguru-reviewer-2019-09-19.min.json');\n model.paginators = require('../apis/codeguru-reviewer-2019-09-19.paginators.json').pagination;\n model.waiters = require('../apis/codeguru-reviewer-2019-09-19.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeGuruReviewer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codegurusecurity'] = {};\nAWS.CodeGuruSecurity = Service.defineService('codegurusecurity', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['codegurusecurity'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/codeguru-security-2018-05-10.min.json');\n model.paginators = require('../apis/codeguru-security-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeGuruSecurity;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codepipeline'] = {};\nAWS.CodePipeline = Service.defineService('codepipeline', ['2015-07-09']);\nObject.defineProperty(apiLoader.services['codepipeline'], '2015-07-09', {\n get: function get() {\n var model = require('../apis/codepipeline-2015-07-09.min.json');\n model.paginators = require('../apis/codepipeline-2015-07-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodePipeline;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codestar'] = {};\nAWS.CodeStar = Service.defineService('codestar', ['2017-04-19']);\nObject.defineProperty(apiLoader.services['codestar'], '2017-04-19', {\n get: function get() {\n var model = require('../apis/codestar-2017-04-19.min.json');\n model.paginators = require('../apis/codestar-2017-04-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeStar;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codestarconnections'] = {};\nAWS.CodeStarconnections = Service.defineService('codestarconnections', ['2019-12-01']);\nObject.defineProperty(apiLoader.services['codestarconnections'], '2019-12-01', {\n get: function get() {\n var model = require('../apis/codestar-connections-2019-12-01.min.json');\n model.paginators = require('../apis/codestar-connections-2019-12-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeStarconnections;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['codestarnotifications'] = {};\nAWS.CodeStarNotifications = Service.defineService('codestarnotifications', ['2019-10-15']);\nObject.defineProperty(apiLoader.services['codestarnotifications'], '2019-10-15', {\n get: function get() {\n var model = require('../apis/codestar-notifications-2019-10-15.min.json');\n model.paginators = require('../apis/codestar-notifications-2019-10-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CodeStarNotifications;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cognitoidentity'] = {};\nAWS.CognitoIdentity = Service.defineService('cognitoidentity', ['2014-06-30']);\nObject.defineProperty(apiLoader.services['cognitoidentity'], '2014-06-30', {\n get: function get() {\n var model = require('../apis/cognito-identity-2014-06-30.min.json');\n model.paginators = require('../apis/cognito-identity-2014-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CognitoIdentity;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cognitoidentityserviceprovider'] = {};\nAWS.CognitoIdentityServiceProvider = Service.defineService('cognitoidentityserviceprovider', ['2016-04-18']);\nObject.defineProperty(apiLoader.services['cognitoidentityserviceprovider'], '2016-04-18', {\n get: function get() {\n var model = require('../apis/cognito-idp-2016-04-18.min.json');\n model.paginators = require('../apis/cognito-idp-2016-04-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CognitoIdentityServiceProvider;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cognitosync'] = {};\nAWS.CognitoSync = Service.defineService('cognitosync', ['2014-06-30']);\nObject.defineProperty(apiLoader.services['cognitosync'], '2014-06-30', {\n get: function get() {\n var model = require('../apis/cognito-sync-2014-06-30.min.json');\n model.paginators = require('../apis/cognito-sync-2014-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CognitoSync;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['comprehend'] = {};\nAWS.Comprehend = Service.defineService('comprehend', ['2017-11-27']);\nObject.defineProperty(apiLoader.services['comprehend'], '2017-11-27', {\n get: function get() {\n var model = require('../apis/comprehend-2017-11-27.min.json');\n model.paginators = require('../apis/comprehend-2017-11-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Comprehend;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['comprehendmedical'] = {};\nAWS.ComprehendMedical = Service.defineService('comprehendmedical', ['2018-10-30']);\nObject.defineProperty(apiLoader.services['comprehendmedical'], '2018-10-30', {\n get: function get() {\n var model = require('../apis/comprehendmedical-2018-10-30.min.json');\n model.paginators = require('../apis/comprehendmedical-2018-10-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ComprehendMedical;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['computeoptimizer'] = {};\nAWS.ComputeOptimizer = Service.defineService('computeoptimizer', ['2019-11-01']);\nObject.defineProperty(apiLoader.services['computeoptimizer'], '2019-11-01', {\n get: function get() {\n var model = require('../apis/compute-optimizer-2019-11-01.min.json');\n model.paginators = require('../apis/compute-optimizer-2019-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ComputeOptimizer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['configservice'] = {};\nAWS.ConfigService = Service.defineService('configservice', ['2014-11-12']);\nObject.defineProperty(apiLoader.services['configservice'], '2014-11-12', {\n get: function get() {\n var model = require('../apis/config-2014-11-12.min.json');\n model.paginators = require('../apis/config-2014-11-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ConfigService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['connect'] = {};\nAWS.Connect = Service.defineService('connect', ['2017-08-08']);\nObject.defineProperty(apiLoader.services['connect'], '2017-08-08', {\n get: function get() {\n var model = require('../apis/connect-2017-08-08.min.json');\n model.paginators = require('../apis/connect-2017-08-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Connect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['connectcampaigns'] = {};\nAWS.ConnectCampaigns = Service.defineService('connectcampaigns', ['2021-01-30']);\nObject.defineProperty(apiLoader.services['connectcampaigns'], '2021-01-30', {\n get: function get() {\n var model = require('../apis/connectcampaigns-2021-01-30.min.json');\n model.paginators = require('../apis/connectcampaigns-2021-01-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ConnectCampaigns;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['connectcases'] = {};\nAWS.ConnectCases = Service.defineService('connectcases', ['2022-10-03']);\nObject.defineProperty(apiLoader.services['connectcases'], '2022-10-03', {\n get: function get() {\n var model = require('../apis/connectcases-2022-10-03.min.json');\n model.paginators = require('../apis/connectcases-2022-10-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ConnectCases;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['connectcontactlens'] = {};\nAWS.ConnectContactLens = Service.defineService('connectcontactlens', ['2020-08-21']);\nObject.defineProperty(apiLoader.services['connectcontactlens'], '2020-08-21', {\n get: function get() {\n var model = require('../apis/connect-contact-lens-2020-08-21.min.json');\n model.paginators = require('../apis/connect-contact-lens-2020-08-21.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ConnectContactLens;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['connectparticipant'] = {};\nAWS.ConnectParticipant = Service.defineService('connectparticipant', ['2018-09-07']);\nObject.defineProperty(apiLoader.services['connectparticipant'], '2018-09-07', {\n get: function get() {\n var model = require('../apis/connectparticipant-2018-09-07.min.json');\n model.paginators = require('../apis/connectparticipant-2018-09-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ConnectParticipant;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['controltower'] = {};\nAWS.ControlTower = Service.defineService('controltower', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['controltower'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/controltower-2018-05-10.min.json');\n model.paginators = require('../apis/controltower-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ControlTower;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['costexplorer'] = {};\nAWS.CostExplorer = Service.defineService('costexplorer', ['2017-10-25']);\nObject.defineProperty(apiLoader.services['costexplorer'], '2017-10-25', {\n get: function get() {\n var model = require('../apis/ce-2017-10-25.min.json');\n model.paginators = require('../apis/ce-2017-10-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CostExplorer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['cur'] = {};\nAWS.CUR = Service.defineService('cur', ['2017-01-06']);\nObject.defineProperty(apiLoader.services['cur'], '2017-01-06', {\n get: function get() {\n var model = require('../apis/cur-2017-01-06.min.json');\n model.paginators = require('../apis/cur-2017-01-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CUR;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['customerprofiles'] = {};\nAWS.CustomerProfiles = Service.defineService('customerprofiles', ['2020-08-15']);\nObject.defineProperty(apiLoader.services['customerprofiles'], '2020-08-15', {\n get: function get() {\n var model = require('../apis/customer-profiles-2020-08-15.min.json');\n model.paginators = require('../apis/customer-profiles-2020-08-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.CustomerProfiles;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['databrew'] = {};\nAWS.DataBrew = Service.defineService('databrew', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['databrew'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/databrew-2017-07-25.min.json');\n model.paginators = require('../apis/databrew-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DataBrew;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dataexchange'] = {};\nAWS.DataExchange = Service.defineService('dataexchange', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['dataexchange'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/dataexchange-2017-07-25.min.json');\n model.paginators = require('../apis/dataexchange-2017-07-25.paginators.json').pagination;\n model.waiters = require('../apis/dataexchange-2017-07-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DataExchange;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['datapipeline'] = {};\nAWS.DataPipeline = Service.defineService('datapipeline', ['2012-10-29']);\nObject.defineProperty(apiLoader.services['datapipeline'], '2012-10-29', {\n get: function get() {\n var model = require('../apis/datapipeline-2012-10-29.min.json');\n model.paginators = require('../apis/datapipeline-2012-10-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DataPipeline;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['datasync'] = {};\nAWS.DataSync = Service.defineService('datasync', ['2018-11-09']);\nObject.defineProperty(apiLoader.services['datasync'], '2018-11-09', {\n get: function get() {\n var model = require('../apis/datasync-2018-11-09.min.json');\n model.paginators = require('../apis/datasync-2018-11-09.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DataSync;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dax'] = {};\nAWS.DAX = Service.defineService('dax', ['2017-04-19']);\nObject.defineProperty(apiLoader.services['dax'], '2017-04-19', {\n get: function get() {\n var model = require('../apis/dax-2017-04-19.min.json');\n model.paginators = require('../apis/dax-2017-04-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DAX;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['detective'] = {};\nAWS.Detective = Service.defineService('detective', ['2018-10-26']);\nObject.defineProperty(apiLoader.services['detective'], '2018-10-26', {\n get: function get() {\n var model = require('../apis/detective-2018-10-26.min.json');\n model.paginators = require('../apis/detective-2018-10-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Detective;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['devicefarm'] = {};\nAWS.DeviceFarm = Service.defineService('devicefarm', ['2015-06-23']);\nObject.defineProperty(apiLoader.services['devicefarm'], '2015-06-23', {\n get: function get() {\n var model = require('../apis/devicefarm-2015-06-23.min.json');\n model.paginators = require('../apis/devicefarm-2015-06-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DeviceFarm;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['devopsguru'] = {};\nAWS.DevOpsGuru = Service.defineService('devopsguru', ['2020-12-01']);\nObject.defineProperty(apiLoader.services['devopsguru'], '2020-12-01', {\n get: function get() {\n var model = require('../apis/devops-guru-2020-12-01.min.json');\n model.paginators = require('../apis/devops-guru-2020-12-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DevOpsGuru;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['directconnect'] = {};\nAWS.DirectConnect = Service.defineService('directconnect', ['2012-10-25']);\nObject.defineProperty(apiLoader.services['directconnect'], '2012-10-25', {\n get: function get() {\n var model = require('../apis/directconnect-2012-10-25.min.json');\n model.paginators = require('../apis/directconnect-2012-10-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DirectConnect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['directoryservice'] = {};\nAWS.DirectoryService = Service.defineService('directoryservice', ['2015-04-16']);\nObject.defineProperty(apiLoader.services['directoryservice'], '2015-04-16', {\n get: function get() {\n var model = require('../apis/ds-2015-04-16.min.json');\n model.paginators = require('../apis/ds-2015-04-16.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DirectoryService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['discovery'] = {};\nAWS.Discovery = Service.defineService('discovery', ['2015-11-01']);\nObject.defineProperty(apiLoader.services['discovery'], '2015-11-01', {\n get: function get() {\n var model = require('../apis/discovery-2015-11-01.min.json');\n model.paginators = require('../apis/discovery-2015-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Discovery;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dlm'] = {};\nAWS.DLM = Service.defineService('dlm', ['2018-01-12']);\nObject.defineProperty(apiLoader.services['dlm'], '2018-01-12', {\n get: function get() {\n var model = require('../apis/dlm-2018-01-12.min.json');\n model.paginators = require('../apis/dlm-2018-01-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DLM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dms'] = {};\nAWS.DMS = Service.defineService('dms', ['2016-01-01']);\nObject.defineProperty(apiLoader.services['dms'], '2016-01-01', {\n get: function get() {\n var model = require('../apis/dms-2016-01-01.min.json');\n model.paginators = require('../apis/dms-2016-01-01.paginators.json').pagination;\n model.waiters = require('../apis/dms-2016-01-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DMS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['docdb'] = {};\nAWS.DocDB = Service.defineService('docdb', ['2014-10-31']);\nrequire('../lib/services/docdb');\nObject.defineProperty(apiLoader.services['docdb'], '2014-10-31', {\n get: function get() {\n var model = require('../apis/docdb-2014-10-31.min.json');\n model.paginators = require('../apis/docdb-2014-10-31.paginators.json').pagination;\n model.waiters = require('../apis/docdb-2014-10-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DocDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['docdbelastic'] = {};\nAWS.DocDBElastic = Service.defineService('docdbelastic', ['2022-11-28']);\nObject.defineProperty(apiLoader.services['docdbelastic'], '2022-11-28', {\n get: function get() {\n var model = require('../apis/docdb-elastic-2022-11-28.min.json');\n model.paginators = require('../apis/docdb-elastic-2022-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DocDBElastic;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['drs'] = {};\nAWS.Drs = Service.defineService('drs', ['2020-02-26']);\nObject.defineProperty(apiLoader.services['drs'], '2020-02-26', {\n get: function get() {\n var model = require('../apis/drs-2020-02-26.min.json');\n model.paginators = require('../apis/drs-2020-02-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Drs;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dynamodb'] = {};\nAWS.DynamoDB = Service.defineService('dynamodb', ['2011-12-05', '2012-08-10']);\nrequire('../lib/services/dynamodb');\nObject.defineProperty(apiLoader.services['dynamodb'], '2011-12-05', {\n get: function get() {\n var model = require('../apis/dynamodb-2011-12-05.min.json');\n model.paginators = require('../apis/dynamodb-2011-12-05.paginators.json').pagination;\n model.waiters = require('../apis/dynamodb-2011-12-05.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['dynamodb'], '2012-08-10', {\n get: function get() {\n var model = require('../apis/dynamodb-2012-08-10.min.json');\n model.paginators = require('../apis/dynamodb-2012-08-10.paginators.json').pagination;\n model.waiters = require('../apis/dynamodb-2012-08-10.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DynamoDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['dynamodbstreams'] = {};\nAWS.DynamoDBStreams = Service.defineService('dynamodbstreams', ['2012-08-10']);\nObject.defineProperty(apiLoader.services['dynamodbstreams'], '2012-08-10', {\n get: function get() {\n var model = require('../apis/streams.dynamodb-2012-08-10.min.json');\n model.paginators = require('../apis/streams.dynamodb-2012-08-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.DynamoDBStreams;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ebs'] = {};\nAWS.EBS = Service.defineService('ebs', ['2019-11-02']);\nObject.defineProperty(apiLoader.services['ebs'], '2019-11-02', {\n get: function get() {\n var model = require('../apis/ebs-2019-11-02.min.json');\n model.paginators = require('../apis/ebs-2019-11-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EBS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ec2'] = {};\nAWS.EC2 = Service.defineService('ec2', ['2013-06-15*', '2013-10-15*', '2014-02-01*', '2014-05-01*', '2014-06-15*', '2014-09-01*', '2014-10-01*', '2015-03-01*', '2015-04-15*', '2015-10-01*', '2016-04-01*', '2016-09-15*', '2016-11-15']);\nrequire('../lib/services/ec2');\nObject.defineProperty(apiLoader.services['ec2'], '2016-11-15', {\n get: function get() {\n var model = require('../apis/ec2-2016-11-15.min.json');\n model.paginators = require('../apis/ec2-2016-11-15.paginators.json').pagination;\n model.waiters = require('../apis/ec2-2016-11-15.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EC2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ec2instanceconnect'] = {};\nAWS.EC2InstanceConnect = Service.defineService('ec2instanceconnect', ['2018-04-02']);\nObject.defineProperty(apiLoader.services['ec2instanceconnect'], '2018-04-02', {\n get: function get() {\n var model = require('../apis/ec2-instance-connect-2018-04-02.min.json');\n model.paginators = require('../apis/ec2-instance-connect-2018-04-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EC2InstanceConnect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ecr'] = {};\nAWS.ECR = Service.defineService('ecr', ['2015-09-21']);\nObject.defineProperty(apiLoader.services['ecr'], '2015-09-21', {\n get: function get() {\n var model = require('../apis/ecr-2015-09-21.min.json');\n model.paginators = require('../apis/ecr-2015-09-21.paginators.json').pagination;\n model.waiters = require('../apis/ecr-2015-09-21.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ECR;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ecrpublic'] = {};\nAWS.ECRPUBLIC = Service.defineService('ecrpublic', ['2020-10-30']);\nObject.defineProperty(apiLoader.services['ecrpublic'], '2020-10-30', {\n get: function get() {\n var model = require('../apis/ecr-public-2020-10-30.min.json');\n model.paginators = require('../apis/ecr-public-2020-10-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ECRPUBLIC;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ecs'] = {};\nAWS.ECS = Service.defineService('ecs', ['2014-11-13']);\nObject.defineProperty(apiLoader.services['ecs'], '2014-11-13', {\n get: function get() {\n var model = require('../apis/ecs-2014-11-13.min.json');\n model.paginators = require('../apis/ecs-2014-11-13.paginators.json').pagination;\n model.waiters = require('../apis/ecs-2014-11-13.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ECS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['efs'] = {};\nAWS.EFS = Service.defineService('efs', ['2015-02-01']);\nObject.defineProperty(apiLoader.services['efs'], '2015-02-01', {\n get: function get() {\n var model = require('../apis/elasticfilesystem-2015-02-01.min.json');\n model.paginators = require('../apis/elasticfilesystem-2015-02-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EFS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['eks'] = {};\nAWS.EKS = Service.defineService('eks', ['2017-11-01']);\nObject.defineProperty(apiLoader.services['eks'], '2017-11-01', {\n get: function get() {\n var model = require('../apis/eks-2017-11-01.min.json');\n model.paginators = require('../apis/eks-2017-11-01.paginators.json').pagination;\n model.waiters = require('../apis/eks-2017-11-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EKS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elasticache'] = {};\nAWS.ElastiCache = Service.defineService('elasticache', ['2012-11-15*', '2014-03-24*', '2014-07-15*', '2014-09-30*', '2015-02-02']);\nObject.defineProperty(apiLoader.services['elasticache'], '2015-02-02', {\n get: function get() {\n var model = require('../apis/elasticache-2015-02-02.min.json');\n model.paginators = require('../apis/elasticache-2015-02-02.paginators.json').pagination;\n model.waiters = require('../apis/elasticache-2015-02-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ElastiCache;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elasticbeanstalk'] = {};\nAWS.ElasticBeanstalk = Service.defineService('elasticbeanstalk', ['2010-12-01']);\nObject.defineProperty(apiLoader.services['elasticbeanstalk'], '2010-12-01', {\n get: function get() {\n var model = require('../apis/elasticbeanstalk-2010-12-01.min.json');\n model.paginators = require('../apis/elasticbeanstalk-2010-12-01.paginators.json').pagination;\n model.waiters = require('../apis/elasticbeanstalk-2010-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ElasticBeanstalk;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elasticinference'] = {};\nAWS.ElasticInference = Service.defineService('elasticinference', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['elasticinference'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/elastic-inference-2017-07-25.min.json');\n model.paginators = require('../apis/elastic-inference-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ElasticInference;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elastictranscoder'] = {};\nAWS.ElasticTranscoder = Service.defineService('elastictranscoder', ['2012-09-25']);\nObject.defineProperty(apiLoader.services['elastictranscoder'], '2012-09-25', {\n get: function get() {\n var model = require('../apis/elastictranscoder-2012-09-25.min.json');\n model.paginators = require('../apis/elastictranscoder-2012-09-25.paginators.json').pagination;\n model.waiters = require('../apis/elastictranscoder-2012-09-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ElasticTranscoder;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elb'] = {};\nAWS.ELB = Service.defineService('elb', ['2012-06-01']);\nObject.defineProperty(apiLoader.services['elb'], '2012-06-01', {\n get: function get() {\n var model = require('../apis/elasticloadbalancing-2012-06-01.min.json');\n model.paginators = require('../apis/elasticloadbalancing-2012-06-01.paginators.json').pagination;\n model.waiters = require('../apis/elasticloadbalancing-2012-06-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ELB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['elbv2'] = {};\nAWS.ELBv2 = Service.defineService('elbv2', ['2015-12-01']);\nObject.defineProperty(apiLoader.services['elbv2'], '2015-12-01', {\n get: function get() {\n var model = require('../apis/elasticloadbalancingv2-2015-12-01.min.json');\n model.paginators = require('../apis/elasticloadbalancingv2-2015-12-01.paginators.json').pagination;\n model.waiters = require('../apis/elasticloadbalancingv2-2015-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ELBv2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['emr'] = {};\nAWS.EMR = Service.defineService('emr', ['2009-03-31']);\nObject.defineProperty(apiLoader.services['emr'], '2009-03-31', {\n get: function get() {\n var model = require('../apis/elasticmapreduce-2009-03-31.min.json');\n model.paginators = require('../apis/elasticmapreduce-2009-03-31.paginators.json').pagination;\n model.waiters = require('../apis/elasticmapreduce-2009-03-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EMR;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['emrcontainers'] = {};\nAWS.EMRcontainers = Service.defineService('emrcontainers', ['2020-10-01']);\nObject.defineProperty(apiLoader.services['emrcontainers'], '2020-10-01', {\n get: function get() {\n var model = require('../apis/emr-containers-2020-10-01.min.json');\n model.paginators = require('../apis/emr-containers-2020-10-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EMRcontainers;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['emrserverless'] = {};\nAWS.EMRServerless = Service.defineService('emrserverless', ['2021-07-13']);\nObject.defineProperty(apiLoader.services['emrserverless'], '2021-07-13', {\n get: function get() {\n var model = require('../apis/emr-serverless-2021-07-13.min.json');\n model.paginators = require('../apis/emr-serverless-2021-07-13.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EMRServerless;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['entityresolution'] = {};\nAWS.EntityResolution = Service.defineService('entityresolution', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['entityresolution'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/entityresolution-2018-05-10.min.json');\n model.paginators = require('../apis/entityresolution-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EntityResolution;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['es'] = {};\nAWS.ES = Service.defineService('es', ['2015-01-01']);\nObject.defineProperty(apiLoader.services['es'], '2015-01-01', {\n get: function get() {\n var model = require('../apis/es-2015-01-01.min.json');\n model.paginators = require('../apis/es-2015-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ES;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['eventbridge'] = {};\nAWS.EventBridge = Service.defineService('eventbridge', ['2015-10-07']);\nrequire('../lib/services/eventbridge');\nObject.defineProperty(apiLoader.services['eventbridge'], '2015-10-07', {\n get: function get() {\n var model = require('../apis/eventbridge-2015-10-07.min.json');\n model.paginators = require('../apis/eventbridge-2015-10-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.EventBridge;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['evidently'] = {};\nAWS.Evidently = Service.defineService('evidently', ['2021-02-01']);\nObject.defineProperty(apiLoader.services['evidently'], '2021-02-01', {\n get: function get() {\n var model = require('../apis/evidently-2021-02-01.min.json');\n model.paginators = require('../apis/evidently-2021-02-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Evidently;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['finspace'] = {};\nAWS.Finspace = Service.defineService('finspace', ['2021-03-12']);\nObject.defineProperty(apiLoader.services['finspace'], '2021-03-12', {\n get: function get() {\n var model = require('../apis/finspace-2021-03-12.min.json');\n model.paginators = require('../apis/finspace-2021-03-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Finspace;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['finspacedata'] = {};\nAWS.Finspacedata = Service.defineService('finspacedata', ['2020-07-13']);\nObject.defineProperty(apiLoader.services['finspacedata'], '2020-07-13', {\n get: function get() {\n var model = require('../apis/finspace-data-2020-07-13.min.json');\n model.paginators = require('../apis/finspace-data-2020-07-13.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Finspacedata;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['firehose'] = {};\nAWS.Firehose = Service.defineService('firehose', ['2015-08-04']);\nObject.defineProperty(apiLoader.services['firehose'], '2015-08-04', {\n get: function get() {\n var model = require('../apis/firehose-2015-08-04.min.json');\n model.paginators = require('../apis/firehose-2015-08-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Firehose;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['fis'] = {};\nAWS.Fis = Service.defineService('fis', ['2020-12-01']);\nObject.defineProperty(apiLoader.services['fis'], '2020-12-01', {\n get: function get() {\n var model = require('../apis/fis-2020-12-01.min.json');\n model.paginators = require('../apis/fis-2020-12-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Fis;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['fms'] = {};\nAWS.FMS = Service.defineService('fms', ['2018-01-01']);\nObject.defineProperty(apiLoader.services['fms'], '2018-01-01', {\n get: function get() {\n var model = require('../apis/fms-2018-01-01.min.json');\n model.paginators = require('../apis/fms-2018-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.FMS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['forecastqueryservice'] = {};\nAWS.ForecastQueryService = Service.defineService('forecastqueryservice', ['2018-06-26']);\nObject.defineProperty(apiLoader.services['forecastqueryservice'], '2018-06-26', {\n get: function get() {\n var model = require('../apis/forecastquery-2018-06-26.min.json');\n model.paginators = require('../apis/forecastquery-2018-06-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ForecastQueryService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['forecastservice'] = {};\nAWS.ForecastService = Service.defineService('forecastservice', ['2018-06-26']);\nObject.defineProperty(apiLoader.services['forecastservice'], '2018-06-26', {\n get: function get() {\n var model = require('../apis/forecast-2018-06-26.min.json');\n model.paginators = require('../apis/forecast-2018-06-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ForecastService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['frauddetector'] = {};\nAWS.FraudDetector = Service.defineService('frauddetector', ['2019-11-15']);\nObject.defineProperty(apiLoader.services['frauddetector'], '2019-11-15', {\n get: function get() {\n var model = require('../apis/frauddetector-2019-11-15.min.json');\n model.paginators = require('../apis/frauddetector-2019-11-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.FraudDetector;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['fsx'] = {};\nAWS.FSx = Service.defineService('fsx', ['2018-03-01']);\nObject.defineProperty(apiLoader.services['fsx'], '2018-03-01', {\n get: function get() {\n var model = require('../apis/fsx-2018-03-01.min.json');\n model.paginators = require('../apis/fsx-2018-03-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.FSx;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['gamelift'] = {};\nAWS.GameLift = Service.defineService('gamelift', ['2015-10-01']);\nObject.defineProperty(apiLoader.services['gamelift'], '2015-10-01', {\n get: function get() {\n var model = require('../apis/gamelift-2015-10-01.min.json');\n model.paginators = require('../apis/gamelift-2015-10-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GameLift;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['gamesparks'] = {};\nAWS.GameSparks = Service.defineService('gamesparks', ['2021-08-17']);\nObject.defineProperty(apiLoader.services['gamesparks'], '2021-08-17', {\n get: function get() {\n var model = require('../apis/gamesparks-2021-08-17.min.json');\n model.paginators = require('../apis/gamesparks-2021-08-17.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GameSparks;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['glacier'] = {};\nAWS.Glacier = Service.defineService('glacier', ['2012-06-01']);\nrequire('../lib/services/glacier');\nObject.defineProperty(apiLoader.services['glacier'], '2012-06-01', {\n get: function get() {\n var model = require('../apis/glacier-2012-06-01.min.json');\n model.paginators = require('../apis/glacier-2012-06-01.paginators.json').pagination;\n model.waiters = require('../apis/glacier-2012-06-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Glacier;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['globalaccelerator'] = {};\nAWS.GlobalAccelerator = Service.defineService('globalaccelerator', ['2018-08-08']);\nObject.defineProperty(apiLoader.services['globalaccelerator'], '2018-08-08', {\n get: function get() {\n var model = require('../apis/globalaccelerator-2018-08-08.min.json');\n model.paginators = require('../apis/globalaccelerator-2018-08-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GlobalAccelerator;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['glue'] = {};\nAWS.Glue = Service.defineService('glue', ['2017-03-31']);\nObject.defineProperty(apiLoader.services['glue'], '2017-03-31', {\n get: function get() {\n var model = require('../apis/glue-2017-03-31.min.json');\n model.paginators = require('../apis/glue-2017-03-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Glue;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['grafana'] = {};\nAWS.Grafana = Service.defineService('grafana', ['2020-08-18']);\nObject.defineProperty(apiLoader.services['grafana'], '2020-08-18', {\n get: function get() {\n var model = require('../apis/grafana-2020-08-18.min.json');\n model.paginators = require('../apis/grafana-2020-08-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Grafana;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['greengrass'] = {};\nAWS.Greengrass = Service.defineService('greengrass', ['2017-06-07']);\nObject.defineProperty(apiLoader.services['greengrass'], '2017-06-07', {\n get: function get() {\n var model = require('../apis/greengrass-2017-06-07.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Greengrass;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['greengrassv2'] = {};\nAWS.GreengrassV2 = Service.defineService('greengrassv2', ['2020-11-30']);\nObject.defineProperty(apiLoader.services['greengrassv2'], '2020-11-30', {\n get: function get() {\n var model = require('../apis/greengrassv2-2020-11-30.min.json');\n model.paginators = require('../apis/greengrassv2-2020-11-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GreengrassV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['groundstation'] = {};\nAWS.GroundStation = Service.defineService('groundstation', ['2019-05-23']);\nObject.defineProperty(apiLoader.services['groundstation'], '2019-05-23', {\n get: function get() {\n var model = require('../apis/groundstation-2019-05-23.min.json');\n model.paginators = require('../apis/groundstation-2019-05-23.paginators.json').pagination;\n model.waiters = require('../apis/groundstation-2019-05-23.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GroundStation;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['guardduty'] = {};\nAWS.GuardDuty = Service.defineService('guardduty', ['2017-11-28']);\nObject.defineProperty(apiLoader.services['guardduty'], '2017-11-28', {\n get: function get() {\n var model = require('../apis/guardduty-2017-11-28.min.json');\n model.paginators = require('../apis/guardduty-2017-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.GuardDuty;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['health'] = {};\nAWS.Health = Service.defineService('health', ['2016-08-04']);\nObject.defineProperty(apiLoader.services['health'], '2016-08-04', {\n get: function get() {\n var model = require('../apis/health-2016-08-04.min.json');\n model.paginators = require('../apis/health-2016-08-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Health;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['healthlake'] = {};\nAWS.HealthLake = Service.defineService('healthlake', ['2017-07-01']);\nObject.defineProperty(apiLoader.services['healthlake'], '2017-07-01', {\n get: function get() {\n var model = require('../apis/healthlake-2017-07-01.min.json');\n model.paginators = require('../apis/healthlake-2017-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.HealthLake;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['honeycode'] = {};\nAWS.Honeycode = Service.defineService('honeycode', ['2020-03-01']);\nObject.defineProperty(apiLoader.services['honeycode'], '2020-03-01', {\n get: function get() {\n var model = require('../apis/honeycode-2020-03-01.min.json');\n model.paginators = require('../apis/honeycode-2020-03-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Honeycode;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iam'] = {};\nAWS.IAM = Service.defineService('iam', ['2010-05-08']);\nObject.defineProperty(apiLoader.services['iam'], '2010-05-08', {\n get: function get() {\n var model = require('../apis/iam-2010-05-08.min.json');\n model.paginators = require('../apis/iam-2010-05-08.paginators.json').pagination;\n model.waiters = require('../apis/iam-2010-05-08.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IAM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['identitystore'] = {};\nAWS.IdentityStore = Service.defineService('identitystore', ['2020-06-15']);\nObject.defineProperty(apiLoader.services['identitystore'], '2020-06-15', {\n get: function get() {\n var model = require('../apis/identitystore-2020-06-15.min.json');\n model.paginators = require('../apis/identitystore-2020-06-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IdentityStore;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['imagebuilder'] = {};\nAWS.Imagebuilder = Service.defineService('imagebuilder', ['2019-12-02']);\nObject.defineProperty(apiLoader.services['imagebuilder'], '2019-12-02', {\n get: function get() {\n var model = require('../apis/imagebuilder-2019-12-02.min.json');\n model.paginators = require('../apis/imagebuilder-2019-12-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Imagebuilder;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['importexport'] = {};\nAWS.ImportExport = Service.defineService('importexport', ['2010-06-01']);\nObject.defineProperty(apiLoader.services['importexport'], '2010-06-01', {\n get: function get() {\n var model = require('../apis/importexport-2010-06-01.min.json');\n model.paginators = require('../apis/importexport-2010-06-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ImportExport;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['inspector'] = {};\nAWS.Inspector = Service.defineService('inspector', ['2015-08-18*', '2016-02-16']);\nObject.defineProperty(apiLoader.services['inspector'], '2016-02-16', {\n get: function get() {\n var model = require('../apis/inspector-2016-02-16.min.json');\n model.paginators = require('../apis/inspector-2016-02-16.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Inspector;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['inspector2'] = {};\nAWS.Inspector2 = Service.defineService('inspector2', ['2020-06-08']);\nObject.defineProperty(apiLoader.services['inspector2'], '2020-06-08', {\n get: function get() {\n var model = require('../apis/inspector2-2020-06-08.min.json');\n model.paginators = require('../apis/inspector2-2020-06-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Inspector2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['internetmonitor'] = {};\nAWS.InternetMonitor = Service.defineService('internetmonitor', ['2021-06-03']);\nObject.defineProperty(apiLoader.services['internetmonitor'], '2021-06-03', {\n get: function get() {\n var model = require('../apis/internetmonitor-2021-06-03.min.json');\n model.paginators = require('../apis/internetmonitor-2021-06-03.paginators.json').pagination;\n model.waiters = require('../apis/internetmonitor-2021-06-03.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.InternetMonitor;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iot'] = {};\nAWS.Iot = Service.defineService('iot', ['2015-05-28']);\nObject.defineProperty(apiLoader.services['iot'], '2015-05-28', {\n get: function get() {\n var model = require('../apis/iot-2015-05-28.min.json');\n model.paginators = require('../apis/iot-2015-05-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Iot;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iot1clickdevicesservice'] = {};\nAWS.IoT1ClickDevicesService = Service.defineService('iot1clickdevicesservice', ['2018-05-14']);\nObject.defineProperty(apiLoader.services['iot1clickdevicesservice'], '2018-05-14', {\n get: function get() {\n var model = require('../apis/iot1click-devices-2018-05-14.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoT1ClickDevicesService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iot1clickprojects'] = {};\nAWS.IoT1ClickProjects = Service.defineService('iot1clickprojects', ['2018-05-14']);\nObject.defineProperty(apiLoader.services['iot1clickprojects'], '2018-05-14', {\n get: function get() {\n var model = require('../apis/iot1click-projects-2018-05-14.min.json');\n model.paginators = require('../apis/iot1click-projects-2018-05-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoT1ClickProjects;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotanalytics'] = {};\nAWS.IoTAnalytics = Service.defineService('iotanalytics', ['2017-11-27']);\nObject.defineProperty(apiLoader.services['iotanalytics'], '2017-11-27', {\n get: function get() {\n var model = require('../apis/iotanalytics-2017-11-27.min.json');\n model.paginators = require('../apis/iotanalytics-2017-11-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTAnalytics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotdata'] = {};\nAWS.IotData = Service.defineService('iotdata', ['2015-05-28']);\nrequire('../lib/services/iotdata');\nObject.defineProperty(apiLoader.services['iotdata'], '2015-05-28', {\n get: function get() {\n var model = require('../apis/iot-data-2015-05-28.min.json');\n model.paginators = require('../apis/iot-data-2015-05-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IotData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotdeviceadvisor'] = {};\nAWS.IotDeviceAdvisor = Service.defineService('iotdeviceadvisor', ['2020-09-18']);\nObject.defineProperty(apiLoader.services['iotdeviceadvisor'], '2020-09-18', {\n get: function get() {\n var model = require('../apis/iotdeviceadvisor-2020-09-18.min.json');\n model.paginators = require('../apis/iotdeviceadvisor-2020-09-18.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IotDeviceAdvisor;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotevents'] = {};\nAWS.IoTEvents = Service.defineService('iotevents', ['2018-07-27']);\nObject.defineProperty(apiLoader.services['iotevents'], '2018-07-27', {\n get: function get() {\n var model = require('../apis/iotevents-2018-07-27.min.json');\n model.paginators = require('../apis/iotevents-2018-07-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTEvents;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ioteventsdata'] = {};\nAWS.IoTEventsData = Service.defineService('ioteventsdata', ['2018-10-23']);\nObject.defineProperty(apiLoader.services['ioteventsdata'], '2018-10-23', {\n get: function get() {\n var model = require('../apis/iotevents-data-2018-10-23.min.json');\n model.paginators = require('../apis/iotevents-data-2018-10-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTEventsData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotfleethub'] = {};\nAWS.IoTFleetHub = Service.defineService('iotfleethub', ['2020-11-03']);\nObject.defineProperty(apiLoader.services['iotfleethub'], '2020-11-03', {\n get: function get() {\n var model = require('../apis/iotfleethub-2020-11-03.min.json');\n model.paginators = require('../apis/iotfleethub-2020-11-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTFleetHub;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotfleetwise'] = {};\nAWS.IoTFleetWise = Service.defineService('iotfleetwise', ['2021-06-17']);\nObject.defineProperty(apiLoader.services['iotfleetwise'], '2021-06-17', {\n get: function get() {\n var model = require('../apis/iotfleetwise-2021-06-17.min.json');\n model.paginators = require('../apis/iotfleetwise-2021-06-17.paginators.json').pagination;\n model.waiters = require('../apis/iotfleetwise-2021-06-17.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTFleetWise;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotjobsdataplane'] = {};\nAWS.IoTJobsDataPlane = Service.defineService('iotjobsdataplane', ['2017-09-29']);\nObject.defineProperty(apiLoader.services['iotjobsdataplane'], '2017-09-29', {\n get: function get() {\n var model = require('../apis/iot-jobs-data-2017-09-29.min.json');\n model.paginators = require('../apis/iot-jobs-data-2017-09-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTJobsDataPlane;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotroborunner'] = {};\nAWS.IoTRoboRunner = Service.defineService('iotroborunner', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['iotroborunner'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/iot-roborunner-2018-05-10.min.json');\n model.paginators = require('../apis/iot-roborunner-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTRoboRunner;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotsecuretunneling'] = {};\nAWS.IoTSecureTunneling = Service.defineService('iotsecuretunneling', ['2018-10-05']);\nObject.defineProperty(apiLoader.services['iotsecuretunneling'], '2018-10-05', {\n get: function get() {\n var model = require('../apis/iotsecuretunneling-2018-10-05.min.json');\n model.paginators = require('../apis/iotsecuretunneling-2018-10-05.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTSecureTunneling;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotsitewise'] = {};\nAWS.IoTSiteWise = Service.defineService('iotsitewise', ['2019-12-02']);\nObject.defineProperty(apiLoader.services['iotsitewise'], '2019-12-02', {\n get: function get() {\n var model = require('../apis/iotsitewise-2019-12-02.min.json');\n model.paginators = require('../apis/iotsitewise-2019-12-02.paginators.json').pagination;\n model.waiters = require('../apis/iotsitewise-2019-12-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTSiteWise;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotthingsgraph'] = {};\nAWS.IoTThingsGraph = Service.defineService('iotthingsgraph', ['2018-09-06']);\nObject.defineProperty(apiLoader.services['iotthingsgraph'], '2018-09-06', {\n get: function get() {\n var model = require('../apis/iotthingsgraph-2018-09-06.min.json');\n model.paginators = require('../apis/iotthingsgraph-2018-09-06.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTThingsGraph;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iottwinmaker'] = {};\nAWS.IoTTwinMaker = Service.defineService('iottwinmaker', ['2021-11-29']);\nObject.defineProperty(apiLoader.services['iottwinmaker'], '2021-11-29', {\n get: function get() {\n var model = require('../apis/iottwinmaker-2021-11-29.min.json');\n model.paginators = require('../apis/iottwinmaker-2021-11-29.paginators.json').pagination;\n model.waiters = require('../apis/iottwinmaker-2021-11-29.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTTwinMaker;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['iotwireless'] = {};\nAWS.IoTWireless = Service.defineService('iotwireless', ['2020-11-22']);\nObject.defineProperty(apiLoader.services['iotwireless'], '2020-11-22', {\n get: function get() {\n var model = require('../apis/iotwireless-2020-11-22.min.json');\n model.paginators = require('../apis/iotwireless-2020-11-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IoTWireless;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ivs'] = {};\nAWS.IVS = Service.defineService('ivs', ['2020-07-14']);\nObject.defineProperty(apiLoader.services['ivs'], '2020-07-14', {\n get: function get() {\n var model = require('../apis/ivs-2020-07-14.min.json');\n model.paginators = require('../apis/ivs-2020-07-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IVS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ivschat'] = {};\nAWS.Ivschat = Service.defineService('ivschat', ['2020-07-14']);\nObject.defineProperty(apiLoader.services['ivschat'], '2020-07-14', {\n get: function get() {\n var model = require('../apis/ivschat-2020-07-14.min.json');\n model.paginators = require('../apis/ivschat-2020-07-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Ivschat;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ivsrealtime'] = {};\nAWS.IVSRealTime = Service.defineService('ivsrealtime', ['2020-07-14']);\nObject.defineProperty(apiLoader.services['ivsrealtime'], '2020-07-14', {\n get: function get() {\n var model = require('../apis/ivs-realtime-2020-07-14.min.json');\n model.paginators = require('../apis/ivs-realtime-2020-07-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.IVSRealTime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kafka'] = {};\nAWS.Kafka = Service.defineService('kafka', ['2018-11-14']);\nObject.defineProperty(apiLoader.services['kafka'], '2018-11-14', {\n get: function get() {\n var model = require('../apis/kafka-2018-11-14.min.json');\n model.paginators = require('../apis/kafka-2018-11-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Kafka;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kafkaconnect'] = {};\nAWS.KafkaConnect = Service.defineService('kafkaconnect', ['2021-09-14']);\nObject.defineProperty(apiLoader.services['kafkaconnect'], '2021-09-14', {\n get: function get() {\n var model = require('../apis/kafkaconnect-2021-09-14.min.json');\n model.paginators = require('../apis/kafkaconnect-2021-09-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KafkaConnect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kendra'] = {};\nAWS.Kendra = Service.defineService('kendra', ['2019-02-03']);\nObject.defineProperty(apiLoader.services['kendra'], '2019-02-03', {\n get: function get() {\n var model = require('../apis/kendra-2019-02-03.min.json');\n model.paginators = require('../apis/kendra-2019-02-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Kendra;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kendraranking'] = {};\nAWS.KendraRanking = Service.defineService('kendraranking', ['2022-10-19']);\nObject.defineProperty(apiLoader.services['kendraranking'], '2022-10-19', {\n get: function get() {\n var model = require('../apis/kendra-ranking-2022-10-19.min.json');\n model.paginators = require('../apis/kendra-ranking-2022-10-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KendraRanking;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['keyspaces'] = {};\nAWS.Keyspaces = Service.defineService('keyspaces', ['2022-02-10']);\nObject.defineProperty(apiLoader.services['keyspaces'], '2022-02-10', {\n get: function get() {\n var model = require('../apis/keyspaces-2022-02-10.min.json');\n model.paginators = require('../apis/keyspaces-2022-02-10.paginators.json').pagination;\n model.waiters = require('../apis/keyspaces-2022-02-10.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Keyspaces;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesis'] = {};\nAWS.Kinesis = Service.defineService('kinesis', ['2013-12-02']);\nObject.defineProperty(apiLoader.services['kinesis'], '2013-12-02', {\n get: function get() {\n var model = require('../apis/kinesis-2013-12-02.min.json');\n model.paginators = require('../apis/kinesis-2013-12-02.paginators.json').pagination;\n model.waiters = require('../apis/kinesis-2013-12-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Kinesis;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisanalytics'] = {};\nAWS.KinesisAnalytics = Service.defineService('kinesisanalytics', ['2015-08-14']);\nObject.defineProperty(apiLoader.services['kinesisanalytics'], '2015-08-14', {\n get: function get() {\n var model = require('../apis/kinesisanalytics-2015-08-14.min.json');\n model.paginators = require('../apis/kinesisanalytics-2015-08-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisAnalytics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisanalyticsv2'] = {};\nAWS.KinesisAnalyticsV2 = Service.defineService('kinesisanalyticsv2', ['2018-05-23']);\nObject.defineProperty(apiLoader.services['kinesisanalyticsv2'], '2018-05-23', {\n get: function get() {\n var model = require('../apis/kinesisanalyticsv2-2018-05-23.min.json');\n model.paginators = require('../apis/kinesisanalyticsv2-2018-05-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisAnalyticsV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideo'] = {};\nAWS.KinesisVideo = Service.defineService('kinesisvideo', ['2017-09-30']);\nObject.defineProperty(apiLoader.services['kinesisvideo'], '2017-09-30', {\n get: function get() {\n var model = require('../apis/kinesisvideo-2017-09-30.min.json');\n model.paginators = require('../apis/kinesisvideo-2017-09-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideo;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideoarchivedmedia'] = {};\nAWS.KinesisVideoArchivedMedia = Service.defineService('kinesisvideoarchivedmedia', ['2017-09-30']);\nObject.defineProperty(apiLoader.services['kinesisvideoarchivedmedia'], '2017-09-30', {\n get: function get() {\n var model = require('../apis/kinesis-video-archived-media-2017-09-30.min.json');\n model.paginators = require('../apis/kinesis-video-archived-media-2017-09-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideoArchivedMedia;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideomedia'] = {};\nAWS.KinesisVideoMedia = Service.defineService('kinesisvideomedia', ['2017-09-30']);\nObject.defineProperty(apiLoader.services['kinesisvideomedia'], '2017-09-30', {\n get: function get() {\n var model = require('../apis/kinesis-video-media-2017-09-30.min.json');\n model.paginators = require('../apis/kinesis-video-media-2017-09-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideoMedia;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideosignalingchannels'] = {};\nAWS.KinesisVideoSignalingChannels = Service.defineService('kinesisvideosignalingchannels', ['2019-12-04']);\nObject.defineProperty(apiLoader.services['kinesisvideosignalingchannels'], '2019-12-04', {\n get: function get() {\n var model = require('../apis/kinesis-video-signaling-2019-12-04.min.json');\n model.paginators = require('../apis/kinesis-video-signaling-2019-12-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideoSignalingChannels;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kinesisvideowebrtcstorage'] = {};\nAWS.KinesisVideoWebRTCStorage = Service.defineService('kinesisvideowebrtcstorage', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['kinesisvideowebrtcstorage'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/kinesis-video-webrtc-storage-2018-05-10.min.json');\n model.paginators = require('../apis/kinesis-video-webrtc-storage-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KinesisVideoWebRTCStorage;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['kms'] = {};\nAWS.KMS = Service.defineService('kms', ['2014-11-01']);\nObject.defineProperty(apiLoader.services['kms'], '2014-11-01', {\n get: function get() {\n var model = require('../apis/kms-2014-11-01.min.json');\n model.paginators = require('../apis/kms-2014-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.KMS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lakeformation'] = {};\nAWS.LakeFormation = Service.defineService('lakeformation', ['2017-03-31']);\nObject.defineProperty(apiLoader.services['lakeformation'], '2017-03-31', {\n get: function get() {\n var model = require('../apis/lakeformation-2017-03-31.min.json');\n model.paginators = require('../apis/lakeformation-2017-03-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LakeFormation;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lambda'] = {};\nAWS.Lambda = Service.defineService('lambda', ['2014-11-11', '2015-03-31']);\nrequire('../lib/services/lambda');\nObject.defineProperty(apiLoader.services['lambda'], '2014-11-11', {\n get: function get() {\n var model = require('../apis/lambda-2014-11-11.min.json');\n model.paginators = require('../apis/lambda-2014-11-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['lambda'], '2015-03-31', {\n get: function get() {\n var model = require('../apis/lambda-2015-03-31.min.json');\n model.paginators = require('../apis/lambda-2015-03-31.paginators.json').pagination;\n model.waiters = require('../apis/lambda-2015-03-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Lambda;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lexmodelbuildingservice'] = {};\nAWS.LexModelBuildingService = Service.defineService('lexmodelbuildingservice', ['2017-04-19']);\nObject.defineProperty(apiLoader.services['lexmodelbuildingservice'], '2017-04-19', {\n get: function get() {\n var model = require('../apis/lex-models-2017-04-19.min.json');\n model.paginators = require('../apis/lex-models-2017-04-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LexModelBuildingService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lexmodelsv2'] = {};\nAWS.LexModelsV2 = Service.defineService('lexmodelsv2', ['2020-08-07']);\nObject.defineProperty(apiLoader.services['lexmodelsv2'], '2020-08-07', {\n get: function get() {\n var model = require('../apis/models.lex.v2-2020-08-07.min.json');\n model.paginators = require('../apis/models.lex.v2-2020-08-07.paginators.json').pagination;\n model.waiters = require('../apis/models.lex.v2-2020-08-07.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LexModelsV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lexruntime'] = {};\nAWS.LexRuntime = Service.defineService('lexruntime', ['2016-11-28']);\nObject.defineProperty(apiLoader.services['lexruntime'], '2016-11-28', {\n get: function get() {\n var model = require('../apis/runtime.lex-2016-11-28.min.json');\n model.paginators = require('../apis/runtime.lex-2016-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LexRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lexruntimev2'] = {};\nAWS.LexRuntimeV2 = Service.defineService('lexruntimev2', ['2020-08-07']);\nObject.defineProperty(apiLoader.services['lexruntimev2'], '2020-08-07', {\n get: function get() {\n var model = require('../apis/runtime.lex.v2-2020-08-07.min.json');\n model.paginators = require('../apis/runtime.lex.v2-2020-08-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LexRuntimeV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['licensemanager'] = {};\nAWS.LicenseManager = Service.defineService('licensemanager', ['2018-08-01']);\nObject.defineProperty(apiLoader.services['licensemanager'], '2018-08-01', {\n get: function get() {\n var model = require('../apis/license-manager-2018-08-01.min.json');\n model.paginators = require('../apis/license-manager-2018-08-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LicenseManager;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['licensemanagerlinuxsubscriptions'] = {};\nAWS.LicenseManagerLinuxSubscriptions = Service.defineService('licensemanagerlinuxsubscriptions', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['licensemanagerlinuxsubscriptions'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/license-manager-linux-subscriptions-2018-05-10.min.json');\n model.paginators = require('../apis/license-manager-linux-subscriptions-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LicenseManagerLinuxSubscriptions;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['licensemanagerusersubscriptions'] = {};\nAWS.LicenseManagerUserSubscriptions = Service.defineService('licensemanagerusersubscriptions', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['licensemanagerusersubscriptions'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/license-manager-user-subscriptions-2018-05-10.min.json');\n model.paginators = require('../apis/license-manager-user-subscriptions-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LicenseManagerUserSubscriptions;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lightsail'] = {};\nAWS.Lightsail = Service.defineService('lightsail', ['2016-11-28']);\nObject.defineProperty(apiLoader.services['lightsail'], '2016-11-28', {\n get: function get() {\n var model = require('../apis/lightsail-2016-11-28.min.json');\n model.paginators = require('../apis/lightsail-2016-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Lightsail;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['location'] = {};\nAWS.Location = Service.defineService('location', ['2020-11-19']);\nObject.defineProperty(apiLoader.services['location'], '2020-11-19', {\n get: function get() {\n var model = require('../apis/location-2020-11-19.min.json');\n model.paginators = require('../apis/location-2020-11-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Location;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lookoutequipment'] = {};\nAWS.LookoutEquipment = Service.defineService('lookoutequipment', ['2020-12-15']);\nObject.defineProperty(apiLoader.services['lookoutequipment'], '2020-12-15', {\n get: function get() {\n var model = require('../apis/lookoutequipment-2020-12-15.min.json');\n model.paginators = require('../apis/lookoutequipment-2020-12-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LookoutEquipment;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lookoutmetrics'] = {};\nAWS.LookoutMetrics = Service.defineService('lookoutmetrics', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['lookoutmetrics'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/lookoutmetrics-2017-07-25.min.json');\n model.paginators = require('../apis/lookoutmetrics-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LookoutMetrics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['lookoutvision'] = {};\nAWS.LookoutVision = Service.defineService('lookoutvision', ['2020-11-20']);\nObject.defineProperty(apiLoader.services['lookoutvision'], '2020-11-20', {\n get: function get() {\n var model = require('../apis/lookoutvision-2020-11-20.min.json');\n model.paginators = require('../apis/lookoutvision-2020-11-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.LookoutVision;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['m2'] = {};\nAWS.M2 = Service.defineService('m2', ['2021-04-28']);\nObject.defineProperty(apiLoader.services['m2'], '2021-04-28', {\n get: function get() {\n var model = require('../apis/m2-2021-04-28.min.json');\n model.paginators = require('../apis/m2-2021-04-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.M2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['machinelearning'] = {};\nAWS.MachineLearning = Service.defineService('machinelearning', ['2014-12-12']);\nrequire('../lib/services/machinelearning');\nObject.defineProperty(apiLoader.services['machinelearning'], '2014-12-12', {\n get: function get() {\n var model = require('../apis/machinelearning-2014-12-12.min.json');\n model.paginators = require('../apis/machinelearning-2014-12-12.paginators.json').pagination;\n model.waiters = require('../apis/machinelearning-2014-12-12.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MachineLearning;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['macie'] = {};\nAWS.Macie = Service.defineService('macie', ['2017-12-19']);\nObject.defineProperty(apiLoader.services['macie'], '2017-12-19', {\n get: function get() {\n var model = require('../apis/macie-2017-12-19.min.json');\n model.paginators = require('../apis/macie-2017-12-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Macie;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['macie2'] = {};\nAWS.Macie2 = Service.defineService('macie2', ['2020-01-01']);\nObject.defineProperty(apiLoader.services['macie2'], '2020-01-01', {\n get: function get() {\n var model = require('../apis/macie2-2020-01-01.min.json');\n model.paginators = require('../apis/macie2-2020-01-01.paginators.json').pagination;\n model.waiters = require('../apis/macie2-2020-01-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Macie2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['managedblockchain'] = {};\nAWS.ManagedBlockchain = Service.defineService('managedblockchain', ['2018-09-24']);\nObject.defineProperty(apiLoader.services['managedblockchain'], '2018-09-24', {\n get: function get() {\n var model = require('../apis/managedblockchain-2018-09-24.min.json');\n model.paginators = require('../apis/managedblockchain-2018-09-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ManagedBlockchain;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['managedblockchainquery'] = {};\nAWS.ManagedBlockchainQuery = Service.defineService('managedblockchainquery', ['2023-05-04']);\nObject.defineProperty(apiLoader.services['managedblockchainquery'], '2023-05-04', {\n get: function get() {\n var model = require('../apis/managedblockchain-query-2023-05-04.min.json');\n model.paginators = require('../apis/managedblockchain-query-2023-05-04.paginators.json').pagination;\n model.waiters = require('../apis/managedblockchain-query-2023-05-04.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ManagedBlockchainQuery;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['marketplacecatalog'] = {};\nAWS.MarketplaceCatalog = Service.defineService('marketplacecatalog', ['2018-09-17']);\nObject.defineProperty(apiLoader.services['marketplacecatalog'], '2018-09-17', {\n get: function get() {\n var model = require('../apis/marketplace-catalog-2018-09-17.min.json');\n model.paginators = require('../apis/marketplace-catalog-2018-09-17.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MarketplaceCatalog;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['marketplacecommerceanalytics'] = {};\nAWS.MarketplaceCommerceAnalytics = Service.defineService('marketplacecommerceanalytics', ['2015-07-01']);\nObject.defineProperty(apiLoader.services['marketplacecommerceanalytics'], '2015-07-01', {\n get: function get() {\n var model = require('../apis/marketplacecommerceanalytics-2015-07-01.min.json');\n model.paginators = require('../apis/marketplacecommerceanalytics-2015-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MarketplaceCommerceAnalytics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['marketplaceentitlementservice'] = {};\nAWS.MarketplaceEntitlementService = Service.defineService('marketplaceentitlementservice', ['2017-01-11']);\nObject.defineProperty(apiLoader.services['marketplaceentitlementservice'], '2017-01-11', {\n get: function get() {\n var model = require('../apis/entitlement.marketplace-2017-01-11.min.json');\n model.paginators = require('../apis/entitlement.marketplace-2017-01-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MarketplaceEntitlementService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['marketplacemetering'] = {};\nAWS.MarketplaceMetering = Service.defineService('marketplacemetering', ['2016-01-14']);\nObject.defineProperty(apiLoader.services['marketplacemetering'], '2016-01-14', {\n get: function get() {\n var model = require('../apis/meteringmarketplace-2016-01-14.min.json');\n model.paginators = require('../apis/meteringmarketplace-2016-01-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MarketplaceMetering;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediaconnect'] = {};\nAWS.MediaConnect = Service.defineService('mediaconnect', ['2018-11-14']);\nObject.defineProperty(apiLoader.services['mediaconnect'], '2018-11-14', {\n get: function get() {\n var model = require('../apis/mediaconnect-2018-11-14.min.json');\n model.paginators = require('../apis/mediaconnect-2018-11-14.paginators.json').pagination;\n model.waiters = require('../apis/mediaconnect-2018-11-14.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaConnect;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediaconvert'] = {};\nAWS.MediaConvert = Service.defineService('mediaconvert', ['2017-08-29']);\nObject.defineProperty(apiLoader.services['mediaconvert'], '2017-08-29', {\n get: function get() {\n var model = require('../apis/mediaconvert-2017-08-29.min.json');\n model.paginators = require('../apis/mediaconvert-2017-08-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaConvert;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['medialive'] = {};\nAWS.MediaLive = Service.defineService('medialive', ['2017-10-14']);\nObject.defineProperty(apiLoader.services['medialive'], '2017-10-14', {\n get: function get() {\n var model = require('../apis/medialive-2017-10-14.min.json');\n model.paginators = require('../apis/medialive-2017-10-14.paginators.json').pagination;\n model.waiters = require('../apis/medialive-2017-10-14.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaLive;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediapackage'] = {};\nAWS.MediaPackage = Service.defineService('mediapackage', ['2017-10-12']);\nObject.defineProperty(apiLoader.services['mediapackage'], '2017-10-12', {\n get: function get() {\n var model = require('../apis/mediapackage-2017-10-12.min.json');\n model.paginators = require('../apis/mediapackage-2017-10-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaPackage;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediapackagev2'] = {};\nAWS.MediaPackageV2 = Service.defineService('mediapackagev2', ['2022-12-25']);\nObject.defineProperty(apiLoader.services['mediapackagev2'], '2022-12-25', {\n get: function get() {\n var model = require('../apis/mediapackagev2-2022-12-25.min.json');\n model.paginators = require('../apis/mediapackagev2-2022-12-25.paginators.json').pagination;\n model.waiters = require('../apis/mediapackagev2-2022-12-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaPackageV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediapackagevod'] = {};\nAWS.MediaPackageVod = Service.defineService('mediapackagevod', ['2018-11-07']);\nObject.defineProperty(apiLoader.services['mediapackagevod'], '2018-11-07', {\n get: function get() {\n var model = require('../apis/mediapackage-vod-2018-11-07.min.json');\n model.paginators = require('../apis/mediapackage-vod-2018-11-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaPackageVod;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediastore'] = {};\nAWS.MediaStore = Service.defineService('mediastore', ['2017-09-01']);\nObject.defineProperty(apiLoader.services['mediastore'], '2017-09-01', {\n get: function get() {\n var model = require('../apis/mediastore-2017-09-01.min.json');\n model.paginators = require('../apis/mediastore-2017-09-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaStore;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediastoredata'] = {};\nAWS.MediaStoreData = Service.defineService('mediastoredata', ['2017-09-01']);\nObject.defineProperty(apiLoader.services['mediastoredata'], '2017-09-01', {\n get: function get() {\n var model = require('../apis/mediastore-data-2017-09-01.min.json');\n model.paginators = require('../apis/mediastore-data-2017-09-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaStoreData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mediatailor'] = {};\nAWS.MediaTailor = Service.defineService('mediatailor', ['2018-04-23']);\nObject.defineProperty(apiLoader.services['mediatailor'], '2018-04-23', {\n get: function get() {\n var model = require('../apis/mediatailor-2018-04-23.min.json');\n model.paginators = require('../apis/mediatailor-2018-04-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MediaTailor;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['medicalimaging'] = {};\nAWS.MedicalImaging = Service.defineService('medicalimaging', ['2023-07-19']);\nObject.defineProperty(apiLoader.services['medicalimaging'], '2023-07-19', {\n get: function get() {\n var model = require('../apis/medical-imaging-2023-07-19.min.json');\n model.paginators = require('../apis/medical-imaging-2023-07-19.paginators.json').pagination;\n model.waiters = require('../apis/medical-imaging-2023-07-19.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MedicalImaging;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['memorydb'] = {};\nAWS.MemoryDB = Service.defineService('memorydb', ['2021-01-01']);\nObject.defineProperty(apiLoader.services['memorydb'], '2021-01-01', {\n get: function get() {\n var model = require('../apis/memorydb-2021-01-01.min.json');\n model.paginators = require('../apis/memorydb-2021-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MemoryDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mgn'] = {};\nAWS.Mgn = Service.defineService('mgn', ['2020-02-26']);\nObject.defineProperty(apiLoader.services['mgn'], '2020-02-26', {\n get: function get() {\n var model = require('../apis/mgn-2020-02-26.min.json');\n model.paginators = require('../apis/mgn-2020-02-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Mgn;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['migrationhub'] = {};\nAWS.MigrationHub = Service.defineService('migrationhub', ['2017-05-31']);\nObject.defineProperty(apiLoader.services['migrationhub'], '2017-05-31', {\n get: function get() {\n var model = require('../apis/AWSMigrationHub-2017-05-31.min.json');\n model.paginators = require('../apis/AWSMigrationHub-2017-05-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MigrationHub;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['migrationhubconfig'] = {};\nAWS.MigrationHubConfig = Service.defineService('migrationhubconfig', ['2019-06-30']);\nObject.defineProperty(apiLoader.services['migrationhubconfig'], '2019-06-30', {\n get: function get() {\n var model = require('../apis/migrationhub-config-2019-06-30.min.json');\n model.paginators = require('../apis/migrationhub-config-2019-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MigrationHubConfig;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['migrationhuborchestrator'] = {};\nAWS.MigrationHubOrchestrator = Service.defineService('migrationhuborchestrator', ['2021-08-28']);\nObject.defineProperty(apiLoader.services['migrationhuborchestrator'], '2021-08-28', {\n get: function get() {\n var model = require('../apis/migrationhuborchestrator-2021-08-28.min.json');\n model.paginators = require('../apis/migrationhuborchestrator-2021-08-28.paginators.json').pagination;\n model.waiters = require('../apis/migrationhuborchestrator-2021-08-28.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MigrationHubOrchestrator;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['migrationhubrefactorspaces'] = {};\nAWS.MigrationHubRefactorSpaces = Service.defineService('migrationhubrefactorspaces', ['2021-10-26']);\nObject.defineProperty(apiLoader.services['migrationhubrefactorspaces'], '2021-10-26', {\n get: function get() {\n var model = require('../apis/migration-hub-refactor-spaces-2021-10-26.min.json');\n model.paginators = require('../apis/migration-hub-refactor-spaces-2021-10-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MigrationHubRefactorSpaces;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['migrationhubstrategy'] = {};\nAWS.MigrationHubStrategy = Service.defineService('migrationhubstrategy', ['2020-02-19']);\nObject.defineProperty(apiLoader.services['migrationhubstrategy'], '2020-02-19', {\n get: function get() {\n var model = require('../apis/migrationhubstrategy-2020-02-19.min.json');\n model.paginators = require('../apis/migrationhubstrategy-2020-02-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MigrationHubStrategy;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mobile'] = {};\nAWS.Mobile = Service.defineService('mobile', ['2017-07-01']);\nObject.defineProperty(apiLoader.services['mobile'], '2017-07-01', {\n get: function get() {\n var model = require('../apis/mobile-2017-07-01.min.json');\n model.paginators = require('../apis/mobile-2017-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Mobile;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mobileanalytics'] = {};\nAWS.MobileAnalytics = Service.defineService('mobileanalytics', ['2014-06-05']);\nObject.defineProperty(apiLoader.services['mobileanalytics'], '2014-06-05', {\n get: function get() {\n var model = require('../apis/mobileanalytics-2014-06-05.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MobileAnalytics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mq'] = {};\nAWS.MQ = Service.defineService('mq', ['2017-11-27']);\nObject.defineProperty(apiLoader.services['mq'], '2017-11-27', {\n get: function get() {\n var model = require('../apis/mq-2017-11-27.min.json');\n model.paginators = require('../apis/mq-2017-11-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MQ;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mturk'] = {};\nAWS.MTurk = Service.defineService('mturk', ['2017-01-17']);\nObject.defineProperty(apiLoader.services['mturk'], '2017-01-17', {\n get: function get() {\n var model = require('../apis/mturk-requester-2017-01-17.min.json');\n model.paginators = require('../apis/mturk-requester-2017-01-17.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MTurk;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['mwaa'] = {};\nAWS.MWAA = Service.defineService('mwaa', ['2020-07-01']);\nObject.defineProperty(apiLoader.services['mwaa'], '2020-07-01', {\n get: function get() {\n var model = require('../apis/mwaa-2020-07-01.min.json');\n model.paginators = require('../apis/mwaa-2020-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.MWAA;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['neptune'] = {};\nAWS.Neptune = Service.defineService('neptune', ['2014-10-31']);\nrequire('../lib/services/neptune');\nObject.defineProperty(apiLoader.services['neptune'], '2014-10-31', {\n get: function get() {\n var model = require('../apis/neptune-2014-10-31.min.json');\n model.paginators = require('../apis/neptune-2014-10-31.paginators.json').pagination;\n model.waiters = require('../apis/neptune-2014-10-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Neptune;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['networkfirewall'] = {};\nAWS.NetworkFirewall = Service.defineService('networkfirewall', ['2020-11-12']);\nObject.defineProperty(apiLoader.services['networkfirewall'], '2020-11-12', {\n get: function get() {\n var model = require('../apis/network-firewall-2020-11-12.min.json');\n model.paginators = require('../apis/network-firewall-2020-11-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.NetworkFirewall;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['networkmanager'] = {};\nAWS.NetworkManager = Service.defineService('networkmanager', ['2019-07-05']);\nObject.defineProperty(apiLoader.services['networkmanager'], '2019-07-05', {\n get: function get() {\n var model = require('../apis/networkmanager-2019-07-05.min.json');\n model.paginators = require('../apis/networkmanager-2019-07-05.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.NetworkManager;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['nimble'] = {};\nAWS.Nimble = Service.defineService('nimble', ['2020-08-01']);\nObject.defineProperty(apiLoader.services['nimble'], '2020-08-01', {\n get: function get() {\n var model = require('../apis/nimble-2020-08-01.min.json');\n model.paginators = require('../apis/nimble-2020-08-01.paginators.json').pagination;\n model.waiters = require('../apis/nimble-2020-08-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Nimble;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['oam'] = {};\nAWS.OAM = Service.defineService('oam', ['2022-06-10']);\nObject.defineProperty(apiLoader.services['oam'], '2022-06-10', {\n get: function get() {\n var model = require('../apis/oam-2022-06-10.min.json');\n model.paginators = require('../apis/oam-2022-06-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.OAM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['omics'] = {};\nAWS.Omics = Service.defineService('omics', ['2022-11-28']);\nObject.defineProperty(apiLoader.services['omics'], '2022-11-28', {\n get: function get() {\n var model = require('../apis/omics-2022-11-28.min.json');\n model.paginators = require('../apis/omics-2022-11-28.paginators.json').pagination;\n model.waiters = require('../apis/omics-2022-11-28.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Omics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['opensearch'] = {};\nAWS.OpenSearch = Service.defineService('opensearch', ['2021-01-01']);\nObject.defineProperty(apiLoader.services['opensearch'], '2021-01-01', {\n get: function get() {\n var model = require('../apis/opensearch-2021-01-01.min.json');\n model.paginators = require('../apis/opensearch-2021-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.OpenSearch;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['opensearchserverless'] = {};\nAWS.OpenSearchServerless = Service.defineService('opensearchserverless', ['2021-11-01']);\nObject.defineProperty(apiLoader.services['opensearchserverless'], '2021-11-01', {\n get: function get() {\n var model = require('../apis/opensearchserverless-2021-11-01.min.json');\n model.paginators = require('../apis/opensearchserverless-2021-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.OpenSearchServerless;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['opsworks'] = {};\nAWS.OpsWorks = Service.defineService('opsworks', ['2013-02-18']);\nObject.defineProperty(apiLoader.services['opsworks'], '2013-02-18', {\n get: function get() {\n var model = require('../apis/opsworks-2013-02-18.min.json');\n model.paginators = require('../apis/opsworks-2013-02-18.paginators.json').pagination;\n model.waiters = require('../apis/opsworks-2013-02-18.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.OpsWorks;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['opsworkscm'] = {};\nAWS.OpsWorksCM = Service.defineService('opsworkscm', ['2016-11-01']);\nObject.defineProperty(apiLoader.services['opsworkscm'], '2016-11-01', {\n get: function get() {\n var model = require('../apis/opsworkscm-2016-11-01.min.json');\n model.paginators = require('../apis/opsworkscm-2016-11-01.paginators.json').pagination;\n model.waiters = require('../apis/opsworkscm-2016-11-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.OpsWorksCM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['organizations'] = {};\nAWS.Organizations = Service.defineService('organizations', ['2016-11-28']);\nObject.defineProperty(apiLoader.services['organizations'], '2016-11-28', {\n get: function get() {\n var model = require('../apis/organizations-2016-11-28.min.json');\n model.paginators = require('../apis/organizations-2016-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Organizations;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['osis'] = {};\nAWS.OSIS = Service.defineService('osis', ['2022-01-01']);\nObject.defineProperty(apiLoader.services['osis'], '2022-01-01', {\n get: function get() {\n var model = require('../apis/osis-2022-01-01.min.json');\n model.paginators = require('../apis/osis-2022-01-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.OSIS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['outposts'] = {};\nAWS.Outposts = Service.defineService('outposts', ['2019-12-03']);\nObject.defineProperty(apiLoader.services['outposts'], '2019-12-03', {\n get: function get() {\n var model = require('../apis/outposts-2019-12-03.min.json');\n model.paginators = require('../apis/outposts-2019-12-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Outposts;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['panorama'] = {};\nAWS.Panorama = Service.defineService('panorama', ['2019-07-24']);\nObject.defineProperty(apiLoader.services['panorama'], '2019-07-24', {\n get: function get() {\n var model = require('../apis/panorama-2019-07-24.min.json');\n model.paginators = require('../apis/panorama-2019-07-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Panorama;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['paymentcryptography'] = {};\nAWS.PaymentCryptography = Service.defineService('paymentcryptography', ['2021-09-14']);\nObject.defineProperty(apiLoader.services['paymentcryptography'], '2021-09-14', {\n get: function get() {\n var model = require('../apis/payment-cryptography-2021-09-14.min.json');\n model.paginators = require('../apis/payment-cryptography-2021-09-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PaymentCryptography;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['paymentcryptographydata'] = {};\nAWS.PaymentCryptographyData = Service.defineService('paymentcryptographydata', ['2022-02-03']);\nObject.defineProperty(apiLoader.services['paymentcryptographydata'], '2022-02-03', {\n get: function get() {\n var model = require('../apis/payment-cryptography-data-2022-02-03.min.json');\n model.paginators = require('../apis/payment-cryptography-data-2022-02-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PaymentCryptographyData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['personalize'] = {};\nAWS.Personalize = Service.defineService('personalize', ['2018-05-22']);\nObject.defineProperty(apiLoader.services['personalize'], '2018-05-22', {\n get: function get() {\n var model = require('../apis/personalize-2018-05-22.min.json');\n model.paginators = require('../apis/personalize-2018-05-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Personalize;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['personalizeevents'] = {};\nAWS.PersonalizeEvents = Service.defineService('personalizeevents', ['2018-03-22']);\nObject.defineProperty(apiLoader.services['personalizeevents'], '2018-03-22', {\n get: function get() {\n var model = require('../apis/personalize-events-2018-03-22.min.json');\n model.paginators = require('../apis/personalize-events-2018-03-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PersonalizeEvents;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['personalizeruntime'] = {};\nAWS.PersonalizeRuntime = Service.defineService('personalizeruntime', ['2018-05-22']);\nObject.defineProperty(apiLoader.services['personalizeruntime'], '2018-05-22', {\n get: function get() {\n var model = require('../apis/personalize-runtime-2018-05-22.min.json');\n model.paginators = require('../apis/personalize-runtime-2018-05-22.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PersonalizeRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pi'] = {};\nAWS.PI = Service.defineService('pi', ['2018-02-27']);\nObject.defineProperty(apiLoader.services['pi'], '2018-02-27', {\n get: function get() {\n var model = require('../apis/pi-2018-02-27.min.json');\n model.paginators = require('../apis/pi-2018-02-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PI;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pinpoint'] = {};\nAWS.Pinpoint = Service.defineService('pinpoint', ['2016-12-01']);\nObject.defineProperty(apiLoader.services['pinpoint'], '2016-12-01', {\n get: function get() {\n var model = require('../apis/pinpoint-2016-12-01.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Pinpoint;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pinpointemail'] = {};\nAWS.PinpointEmail = Service.defineService('pinpointemail', ['2018-07-26']);\nObject.defineProperty(apiLoader.services['pinpointemail'], '2018-07-26', {\n get: function get() {\n var model = require('../apis/pinpoint-email-2018-07-26.min.json');\n model.paginators = require('../apis/pinpoint-email-2018-07-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PinpointEmail;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pinpointsmsvoice'] = {};\nAWS.PinpointSMSVoice = Service.defineService('pinpointsmsvoice', ['2018-09-05']);\nObject.defineProperty(apiLoader.services['pinpointsmsvoice'], '2018-09-05', {\n get: function get() {\n var model = require('../apis/sms-voice-2018-09-05.min.json');\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PinpointSMSVoice;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pinpointsmsvoicev2'] = {};\nAWS.PinpointSMSVoiceV2 = Service.defineService('pinpointsmsvoicev2', ['2022-03-31']);\nObject.defineProperty(apiLoader.services['pinpointsmsvoicev2'], '2022-03-31', {\n get: function get() {\n var model = require('../apis/pinpoint-sms-voice-v2-2022-03-31.min.json');\n model.paginators = require('../apis/pinpoint-sms-voice-v2-2022-03-31.paginators.json').pagination;\n model.waiters = require('../apis/pinpoint-sms-voice-v2-2022-03-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PinpointSMSVoiceV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pipes'] = {};\nAWS.Pipes = Service.defineService('pipes', ['2015-10-07']);\nObject.defineProperty(apiLoader.services['pipes'], '2015-10-07', {\n get: function get() {\n var model = require('../apis/pipes-2015-10-07.min.json');\n model.paginators = require('../apis/pipes-2015-10-07.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Pipes;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['polly'] = {};\nAWS.Polly = Service.defineService('polly', ['2016-06-10']);\nrequire('../lib/services/polly');\nObject.defineProperty(apiLoader.services['polly'], '2016-06-10', {\n get: function get() {\n var model = require('../apis/polly-2016-06-10.min.json');\n model.paginators = require('../apis/polly-2016-06-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Polly;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['pricing'] = {};\nAWS.Pricing = Service.defineService('pricing', ['2017-10-15']);\nObject.defineProperty(apiLoader.services['pricing'], '2017-10-15', {\n get: function get() {\n var model = require('../apis/pricing-2017-10-15.min.json');\n model.paginators = require('../apis/pricing-2017-10-15.paginators.json').pagination;\n model.waiters = require('../apis/pricing-2017-10-15.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Pricing;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['privatenetworks'] = {};\nAWS.PrivateNetworks = Service.defineService('privatenetworks', ['2021-12-03']);\nObject.defineProperty(apiLoader.services['privatenetworks'], '2021-12-03', {\n get: function get() {\n var model = require('../apis/privatenetworks-2021-12-03.min.json');\n model.paginators = require('../apis/privatenetworks-2021-12-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.PrivateNetworks;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['proton'] = {};\nAWS.Proton = Service.defineService('proton', ['2020-07-20']);\nObject.defineProperty(apiLoader.services['proton'], '2020-07-20', {\n get: function get() {\n var model = require('../apis/proton-2020-07-20.min.json');\n model.paginators = require('../apis/proton-2020-07-20.paginators.json').pagination;\n model.waiters = require('../apis/proton-2020-07-20.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Proton;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['qldb'] = {};\nAWS.QLDB = Service.defineService('qldb', ['2019-01-02']);\nObject.defineProperty(apiLoader.services['qldb'], '2019-01-02', {\n get: function get() {\n var model = require('../apis/qldb-2019-01-02.min.json');\n model.paginators = require('../apis/qldb-2019-01-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.QLDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['qldbsession'] = {};\nAWS.QLDBSession = Service.defineService('qldbsession', ['2019-07-11']);\nObject.defineProperty(apiLoader.services['qldbsession'], '2019-07-11', {\n get: function get() {\n var model = require('../apis/qldb-session-2019-07-11.min.json');\n model.paginators = require('../apis/qldb-session-2019-07-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.QLDBSession;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['quicksight'] = {};\nAWS.QuickSight = Service.defineService('quicksight', ['2018-04-01']);\nObject.defineProperty(apiLoader.services['quicksight'], '2018-04-01', {\n get: function get() {\n var model = require('../apis/quicksight-2018-04-01.min.json');\n model.paginators = require('../apis/quicksight-2018-04-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.QuickSight;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ram'] = {};\nAWS.RAM = Service.defineService('ram', ['2018-01-04']);\nObject.defineProperty(apiLoader.services['ram'], '2018-01-04', {\n get: function get() {\n var model = require('../apis/ram-2018-01-04.min.json');\n model.paginators = require('../apis/ram-2018-01-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RAM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rbin'] = {};\nAWS.Rbin = Service.defineService('rbin', ['2021-06-15']);\nObject.defineProperty(apiLoader.services['rbin'], '2021-06-15', {\n get: function get() {\n var model = require('../apis/rbin-2021-06-15.min.json');\n model.paginators = require('../apis/rbin-2021-06-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Rbin;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rds'] = {};\nAWS.RDS = Service.defineService('rds', ['2013-01-10', '2013-02-12', '2013-09-09', '2014-09-01', '2014-09-01*', '2014-10-31']);\nrequire('../lib/services/rds');\nObject.defineProperty(apiLoader.services['rds'], '2013-01-10', {\n get: function get() {\n var model = require('../apis/rds-2013-01-10.min.json');\n model.paginators = require('../apis/rds-2013-01-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['rds'], '2013-02-12', {\n get: function get() {\n var model = require('../apis/rds-2013-02-12.min.json');\n model.paginators = require('../apis/rds-2013-02-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['rds'], '2013-09-09', {\n get: function get() {\n var model = require('../apis/rds-2013-09-09.min.json');\n model.paginators = require('../apis/rds-2013-09-09.paginators.json').pagination;\n model.waiters = require('../apis/rds-2013-09-09.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['rds'], '2014-09-01', {\n get: function get() {\n var model = require('../apis/rds-2014-09-01.min.json');\n model.paginators = require('../apis/rds-2014-09-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\nObject.defineProperty(apiLoader.services['rds'], '2014-10-31', {\n get: function get() {\n var model = require('../apis/rds-2014-10-31.min.json');\n model.paginators = require('../apis/rds-2014-10-31.paginators.json').pagination;\n model.waiters = require('../apis/rds-2014-10-31.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RDS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rdsdataservice'] = {};\nAWS.RDSDataService = Service.defineService('rdsdataservice', ['2018-08-01']);\nrequire('../lib/services/rdsdataservice');\nObject.defineProperty(apiLoader.services['rdsdataservice'], '2018-08-01', {\n get: function get() {\n var model = require('../apis/rds-data-2018-08-01.min.json');\n model.paginators = require('../apis/rds-data-2018-08-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RDSDataService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['redshift'] = {};\nAWS.Redshift = Service.defineService('redshift', ['2012-12-01']);\nObject.defineProperty(apiLoader.services['redshift'], '2012-12-01', {\n get: function get() {\n var model = require('../apis/redshift-2012-12-01.min.json');\n model.paginators = require('../apis/redshift-2012-12-01.paginators.json').pagination;\n model.waiters = require('../apis/redshift-2012-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Redshift;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['redshiftdata'] = {};\nAWS.RedshiftData = Service.defineService('redshiftdata', ['2019-12-20']);\nObject.defineProperty(apiLoader.services['redshiftdata'], '2019-12-20', {\n get: function get() {\n var model = require('../apis/redshift-data-2019-12-20.min.json');\n model.paginators = require('../apis/redshift-data-2019-12-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RedshiftData;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['redshiftserverless'] = {};\nAWS.RedshiftServerless = Service.defineService('redshiftserverless', ['2021-04-21']);\nObject.defineProperty(apiLoader.services['redshiftserverless'], '2021-04-21', {\n get: function get() {\n var model = require('../apis/redshift-serverless-2021-04-21.min.json');\n model.paginators = require('../apis/redshift-serverless-2021-04-21.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RedshiftServerless;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rekognition'] = {};\nAWS.Rekognition = Service.defineService('rekognition', ['2016-06-27']);\nObject.defineProperty(apiLoader.services['rekognition'], '2016-06-27', {\n get: function get() {\n var model = require('../apis/rekognition-2016-06-27.min.json');\n model.paginators = require('../apis/rekognition-2016-06-27.paginators.json').pagination;\n model.waiters = require('../apis/rekognition-2016-06-27.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Rekognition;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['resiliencehub'] = {};\nAWS.Resiliencehub = Service.defineService('resiliencehub', ['2020-04-30']);\nObject.defineProperty(apiLoader.services['resiliencehub'], '2020-04-30', {\n get: function get() {\n var model = require('../apis/resiliencehub-2020-04-30.min.json');\n model.paginators = require('../apis/resiliencehub-2020-04-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Resiliencehub;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['resourceexplorer2'] = {};\nAWS.ResourceExplorer2 = Service.defineService('resourceexplorer2', ['2022-07-28']);\nObject.defineProperty(apiLoader.services['resourceexplorer2'], '2022-07-28', {\n get: function get() {\n var model = require('../apis/resource-explorer-2-2022-07-28.min.json');\n model.paginators = require('../apis/resource-explorer-2-2022-07-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ResourceExplorer2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['resourcegroups'] = {};\nAWS.ResourceGroups = Service.defineService('resourcegroups', ['2017-11-27']);\nObject.defineProperty(apiLoader.services['resourcegroups'], '2017-11-27', {\n get: function get() {\n var model = require('../apis/resource-groups-2017-11-27.min.json');\n model.paginators = require('../apis/resource-groups-2017-11-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ResourceGroups;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['resourcegroupstaggingapi'] = {};\nAWS.ResourceGroupsTaggingAPI = Service.defineService('resourcegroupstaggingapi', ['2017-01-26']);\nObject.defineProperty(apiLoader.services['resourcegroupstaggingapi'], '2017-01-26', {\n get: function get() {\n var model = require('../apis/resourcegroupstaggingapi-2017-01-26.min.json');\n model.paginators = require('../apis/resourcegroupstaggingapi-2017-01-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ResourceGroupsTaggingAPI;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['robomaker'] = {};\nAWS.RoboMaker = Service.defineService('robomaker', ['2018-06-29']);\nObject.defineProperty(apiLoader.services['robomaker'], '2018-06-29', {\n get: function get() {\n var model = require('../apis/robomaker-2018-06-29.min.json');\n model.paginators = require('../apis/robomaker-2018-06-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RoboMaker;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rolesanywhere'] = {};\nAWS.RolesAnywhere = Service.defineService('rolesanywhere', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['rolesanywhere'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/rolesanywhere-2018-05-10.min.json');\n model.paginators = require('../apis/rolesanywhere-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RolesAnywhere;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53'] = {};\nAWS.Route53 = Service.defineService('route53', ['2013-04-01']);\nrequire('../lib/services/route53');\nObject.defineProperty(apiLoader.services['route53'], '2013-04-01', {\n get: function get() {\n var model = require('../apis/route53-2013-04-01.min.json');\n model.paginators = require('../apis/route53-2013-04-01.paginators.json').pagination;\n model.waiters = require('../apis/route53-2013-04-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53domains'] = {};\nAWS.Route53Domains = Service.defineService('route53domains', ['2014-05-15']);\nObject.defineProperty(apiLoader.services['route53domains'], '2014-05-15', {\n get: function get() {\n var model = require('../apis/route53domains-2014-05-15.min.json');\n model.paginators = require('../apis/route53domains-2014-05-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53Domains;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53recoverycluster'] = {};\nAWS.Route53RecoveryCluster = Service.defineService('route53recoverycluster', ['2019-12-02']);\nObject.defineProperty(apiLoader.services['route53recoverycluster'], '2019-12-02', {\n get: function get() {\n var model = require('../apis/route53-recovery-cluster-2019-12-02.min.json');\n model.paginators = require('../apis/route53-recovery-cluster-2019-12-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53RecoveryCluster;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53recoverycontrolconfig'] = {};\nAWS.Route53RecoveryControlConfig = Service.defineService('route53recoverycontrolconfig', ['2020-11-02']);\nObject.defineProperty(apiLoader.services['route53recoverycontrolconfig'], '2020-11-02', {\n get: function get() {\n var model = require('../apis/route53-recovery-control-config-2020-11-02.min.json');\n model.paginators = require('../apis/route53-recovery-control-config-2020-11-02.paginators.json').pagination;\n model.waiters = require('../apis/route53-recovery-control-config-2020-11-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53RecoveryControlConfig;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53recoveryreadiness'] = {};\nAWS.Route53RecoveryReadiness = Service.defineService('route53recoveryreadiness', ['2019-12-02']);\nObject.defineProperty(apiLoader.services['route53recoveryreadiness'], '2019-12-02', {\n get: function get() {\n var model = require('../apis/route53-recovery-readiness-2019-12-02.min.json');\n model.paginators = require('../apis/route53-recovery-readiness-2019-12-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53RecoveryReadiness;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['route53resolver'] = {};\nAWS.Route53Resolver = Service.defineService('route53resolver', ['2018-04-01']);\nObject.defineProperty(apiLoader.services['route53resolver'], '2018-04-01', {\n get: function get() {\n var model = require('../apis/route53resolver-2018-04-01.min.json');\n model.paginators = require('../apis/route53resolver-2018-04-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Route53Resolver;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['rum'] = {};\nAWS.RUM = Service.defineService('rum', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['rum'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/rum-2018-05-10.min.json');\n model.paginators = require('../apis/rum-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.RUM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['s3'] = {};\nAWS.S3 = Service.defineService('s3', ['2006-03-01']);\nrequire('../lib/services/s3');\nObject.defineProperty(apiLoader.services['s3'], '2006-03-01', {\n get: function get() {\n var model = require('../apis/s3-2006-03-01.min.json');\n model.paginators = require('../apis/s3-2006-03-01.paginators.json').pagination;\n model.waiters = require('../apis/s3-2006-03-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.S3;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['s3control'] = {};\nAWS.S3Control = Service.defineService('s3control', ['2018-08-20']);\nrequire('../lib/services/s3control');\nObject.defineProperty(apiLoader.services['s3control'], '2018-08-20', {\n get: function get() {\n var model = require('../apis/s3control-2018-08-20.min.json');\n model.paginators = require('../apis/s3control-2018-08-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.S3Control;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['s3outposts'] = {};\nAWS.S3Outposts = Service.defineService('s3outposts', ['2017-07-25']);\nObject.defineProperty(apiLoader.services['s3outposts'], '2017-07-25', {\n get: function get() {\n var model = require('../apis/s3outposts-2017-07-25.min.json');\n model.paginators = require('../apis/s3outposts-2017-07-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.S3Outposts;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemaker'] = {};\nAWS.SageMaker = Service.defineService('sagemaker', ['2017-07-24']);\nObject.defineProperty(apiLoader.services['sagemaker'], '2017-07-24', {\n get: function get() {\n var model = require('../apis/sagemaker-2017-07-24.min.json');\n model.paginators = require('../apis/sagemaker-2017-07-24.paginators.json').pagination;\n model.waiters = require('../apis/sagemaker-2017-07-24.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SageMaker;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemakeredge'] = {};\nAWS.SagemakerEdge = Service.defineService('sagemakeredge', ['2020-09-23']);\nObject.defineProperty(apiLoader.services['sagemakeredge'], '2020-09-23', {\n get: function get() {\n var model = require('../apis/sagemaker-edge-2020-09-23.min.json');\n model.paginators = require('../apis/sagemaker-edge-2020-09-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SagemakerEdge;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemakerfeaturestoreruntime'] = {};\nAWS.SageMakerFeatureStoreRuntime = Service.defineService('sagemakerfeaturestoreruntime', ['2020-07-01']);\nObject.defineProperty(apiLoader.services['sagemakerfeaturestoreruntime'], '2020-07-01', {\n get: function get() {\n var model = require('../apis/sagemaker-featurestore-runtime-2020-07-01.min.json');\n model.paginators = require('../apis/sagemaker-featurestore-runtime-2020-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SageMakerFeatureStoreRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemakergeospatial'] = {};\nAWS.SageMakerGeospatial = Service.defineService('sagemakergeospatial', ['2020-05-27']);\nObject.defineProperty(apiLoader.services['sagemakergeospatial'], '2020-05-27', {\n get: function get() {\n var model = require('../apis/sagemaker-geospatial-2020-05-27.min.json');\n model.paginators = require('../apis/sagemaker-geospatial-2020-05-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SageMakerGeospatial;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemakermetrics'] = {};\nAWS.SageMakerMetrics = Service.defineService('sagemakermetrics', ['2022-09-30']);\nObject.defineProperty(apiLoader.services['sagemakermetrics'], '2022-09-30', {\n get: function get() {\n var model = require('../apis/sagemaker-metrics-2022-09-30.min.json');\n model.paginators = require('../apis/sagemaker-metrics-2022-09-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SageMakerMetrics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sagemakerruntime'] = {};\nAWS.SageMakerRuntime = Service.defineService('sagemakerruntime', ['2017-05-13']);\nObject.defineProperty(apiLoader.services['sagemakerruntime'], '2017-05-13', {\n get: function get() {\n var model = require('../apis/runtime.sagemaker-2017-05-13.min.json');\n model.paginators = require('../apis/runtime.sagemaker-2017-05-13.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SageMakerRuntime;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['savingsplans'] = {};\nAWS.SavingsPlans = Service.defineService('savingsplans', ['2019-06-28']);\nObject.defineProperty(apiLoader.services['savingsplans'], '2019-06-28', {\n get: function get() {\n var model = require('../apis/savingsplans-2019-06-28.min.json');\n model.paginators = require('../apis/savingsplans-2019-06-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SavingsPlans;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['scheduler'] = {};\nAWS.Scheduler = Service.defineService('scheduler', ['2021-06-30']);\nObject.defineProperty(apiLoader.services['scheduler'], '2021-06-30', {\n get: function get() {\n var model = require('../apis/scheduler-2021-06-30.min.json');\n model.paginators = require('../apis/scheduler-2021-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Scheduler;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['schemas'] = {};\nAWS.Schemas = Service.defineService('schemas', ['2019-12-02']);\nObject.defineProperty(apiLoader.services['schemas'], '2019-12-02', {\n get: function get() {\n var model = require('../apis/schemas-2019-12-02.min.json');\n model.paginators = require('../apis/schemas-2019-12-02.paginators.json').pagination;\n model.waiters = require('../apis/schemas-2019-12-02.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Schemas;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['secretsmanager'] = {};\nAWS.SecretsManager = Service.defineService('secretsmanager', ['2017-10-17']);\nObject.defineProperty(apiLoader.services['secretsmanager'], '2017-10-17', {\n get: function get() {\n var model = require('../apis/secretsmanager-2017-10-17.min.json');\n model.paginators = require('../apis/secretsmanager-2017-10-17.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SecretsManager;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['securityhub'] = {};\nAWS.SecurityHub = Service.defineService('securityhub', ['2018-10-26']);\nObject.defineProperty(apiLoader.services['securityhub'], '2018-10-26', {\n get: function get() {\n var model = require('../apis/securityhub-2018-10-26.min.json');\n model.paginators = require('../apis/securityhub-2018-10-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SecurityHub;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['securitylake'] = {};\nAWS.SecurityLake = Service.defineService('securitylake', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['securitylake'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/securitylake-2018-05-10.min.json');\n model.paginators = require('../apis/securitylake-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SecurityLake;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['serverlessapplicationrepository'] = {};\nAWS.ServerlessApplicationRepository = Service.defineService('serverlessapplicationrepository', ['2017-09-08']);\nObject.defineProperty(apiLoader.services['serverlessapplicationrepository'], '2017-09-08', {\n get: function get() {\n var model = require('../apis/serverlessrepo-2017-09-08.min.json');\n model.paginators = require('../apis/serverlessrepo-2017-09-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServerlessApplicationRepository;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['servicecatalog'] = {};\nAWS.ServiceCatalog = Service.defineService('servicecatalog', ['2015-12-10']);\nObject.defineProperty(apiLoader.services['servicecatalog'], '2015-12-10', {\n get: function get() {\n var model = require('../apis/servicecatalog-2015-12-10.min.json');\n model.paginators = require('../apis/servicecatalog-2015-12-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServiceCatalog;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['servicecatalogappregistry'] = {};\nAWS.ServiceCatalogAppRegistry = Service.defineService('servicecatalogappregistry', ['2020-06-24']);\nObject.defineProperty(apiLoader.services['servicecatalogappregistry'], '2020-06-24', {\n get: function get() {\n var model = require('../apis/servicecatalog-appregistry-2020-06-24.min.json');\n model.paginators = require('../apis/servicecatalog-appregistry-2020-06-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServiceCatalogAppRegistry;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['servicediscovery'] = {};\nAWS.ServiceDiscovery = Service.defineService('servicediscovery', ['2017-03-14']);\nObject.defineProperty(apiLoader.services['servicediscovery'], '2017-03-14', {\n get: function get() {\n var model = require('../apis/servicediscovery-2017-03-14.min.json');\n model.paginators = require('../apis/servicediscovery-2017-03-14.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServiceDiscovery;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['servicequotas'] = {};\nAWS.ServiceQuotas = Service.defineService('servicequotas', ['2019-06-24']);\nObject.defineProperty(apiLoader.services['servicequotas'], '2019-06-24', {\n get: function get() {\n var model = require('../apis/service-quotas-2019-06-24.min.json');\n model.paginators = require('../apis/service-quotas-2019-06-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.ServiceQuotas;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ses'] = {};\nAWS.SES = Service.defineService('ses', ['2010-12-01']);\nObject.defineProperty(apiLoader.services['ses'], '2010-12-01', {\n get: function get() {\n var model = require('../apis/email-2010-12-01.min.json');\n model.paginators = require('../apis/email-2010-12-01.paginators.json').pagination;\n model.waiters = require('../apis/email-2010-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SES;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sesv2'] = {};\nAWS.SESV2 = Service.defineService('sesv2', ['2019-09-27']);\nObject.defineProperty(apiLoader.services['sesv2'], '2019-09-27', {\n get: function get() {\n var model = require('../apis/sesv2-2019-09-27.min.json');\n model.paginators = require('../apis/sesv2-2019-09-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SESV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['shield'] = {};\nAWS.Shield = Service.defineService('shield', ['2016-06-02']);\nObject.defineProperty(apiLoader.services['shield'], '2016-06-02', {\n get: function get() {\n var model = require('../apis/shield-2016-06-02.min.json');\n model.paginators = require('../apis/shield-2016-06-02.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Shield;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['signer'] = {};\nAWS.Signer = Service.defineService('signer', ['2017-08-25']);\nObject.defineProperty(apiLoader.services['signer'], '2017-08-25', {\n get: function get() {\n var model = require('../apis/signer-2017-08-25.min.json');\n model.paginators = require('../apis/signer-2017-08-25.paginators.json').pagination;\n model.waiters = require('../apis/signer-2017-08-25.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Signer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['simpledb'] = {};\nAWS.SimpleDB = Service.defineService('simpledb', ['2009-04-15']);\nObject.defineProperty(apiLoader.services['simpledb'], '2009-04-15', {\n get: function get() {\n var model = require('../apis/sdb-2009-04-15.min.json');\n model.paginators = require('../apis/sdb-2009-04-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SimpleDB;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['simspaceweaver'] = {};\nAWS.SimSpaceWeaver = Service.defineService('simspaceweaver', ['2022-10-28']);\nObject.defineProperty(apiLoader.services['simspaceweaver'], '2022-10-28', {\n get: function get() {\n var model = require('../apis/simspaceweaver-2022-10-28.min.json');\n model.paginators = require('../apis/simspaceweaver-2022-10-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SimSpaceWeaver;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sms'] = {};\nAWS.SMS = Service.defineService('sms', ['2016-10-24']);\nObject.defineProperty(apiLoader.services['sms'], '2016-10-24', {\n get: function get() {\n var model = require('../apis/sms-2016-10-24.min.json');\n model.paginators = require('../apis/sms-2016-10-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SMS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['snowball'] = {};\nAWS.Snowball = Service.defineService('snowball', ['2016-06-30']);\nObject.defineProperty(apiLoader.services['snowball'], '2016-06-30', {\n get: function get() {\n var model = require('../apis/snowball-2016-06-30.min.json');\n model.paginators = require('../apis/snowball-2016-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Snowball;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['snowdevicemanagement'] = {};\nAWS.SnowDeviceManagement = Service.defineService('snowdevicemanagement', ['2021-08-04']);\nObject.defineProperty(apiLoader.services['snowdevicemanagement'], '2021-08-04', {\n get: function get() {\n var model = require('../apis/snow-device-management-2021-08-04.min.json');\n model.paginators = require('../apis/snow-device-management-2021-08-04.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SnowDeviceManagement;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sns'] = {};\nAWS.SNS = Service.defineService('sns', ['2010-03-31']);\nObject.defineProperty(apiLoader.services['sns'], '2010-03-31', {\n get: function get() {\n var model = require('../apis/sns-2010-03-31.min.json');\n model.paginators = require('../apis/sns-2010-03-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SNS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sqs'] = {};\nAWS.SQS = Service.defineService('sqs', ['2012-11-05']);\nrequire('../lib/services/sqs');\nObject.defineProperty(apiLoader.services['sqs'], '2012-11-05', {\n get: function get() {\n var model = require('../apis/sqs-2012-11-05.min.json');\n model.paginators = require('../apis/sqs-2012-11-05.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SQS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssm'] = {};\nAWS.SSM = Service.defineService('ssm', ['2014-11-06']);\nObject.defineProperty(apiLoader.services['ssm'], '2014-11-06', {\n get: function get() {\n var model = require('../apis/ssm-2014-11-06.min.json');\n model.paginators = require('../apis/ssm-2014-11-06.paginators.json').pagination;\n model.waiters = require('../apis/ssm-2014-11-06.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSM;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssmcontacts'] = {};\nAWS.SSMContacts = Service.defineService('ssmcontacts', ['2021-05-03']);\nObject.defineProperty(apiLoader.services['ssmcontacts'], '2021-05-03', {\n get: function get() {\n var model = require('../apis/ssm-contacts-2021-05-03.min.json');\n model.paginators = require('../apis/ssm-contacts-2021-05-03.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSMContacts;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssmincidents'] = {};\nAWS.SSMIncidents = Service.defineService('ssmincidents', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['ssmincidents'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/ssm-incidents-2018-05-10.min.json');\n model.paginators = require('../apis/ssm-incidents-2018-05-10.paginators.json').pagination;\n model.waiters = require('../apis/ssm-incidents-2018-05-10.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSMIncidents;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssmsap'] = {};\nAWS.SsmSap = Service.defineService('ssmsap', ['2018-05-10']);\nObject.defineProperty(apiLoader.services['ssmsap'], '2018-05-10', {\n get: function get() {\n var model = require('../apis/ssm-sap-2018-05-10.min.json');\n model.paginators = require('../apis/ssm-sap-2018-05-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SsmSap;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sso'] = {};\nAWS.SSO = Service.defineService('sso', ['2019-06-10']);\nObject.defineProperty(apiLoader.services['sso'], '2019-06-10', {\n get: function get() {\n var model = require('../apis/sso-2019-06-10.min.json');\n model.paginators = require('../apis/sso-2019-06-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSO;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssoadmin'] = {};\nAWS.SSOAdmin = Service.defineService('ssoadmin', ['2020-07-20']);\nObject.defineProperty(apiLoader.services['ssoadmin'], '2020-07-20', {\n get: function get() {\n var model = require('../apis/sso-admin-2020-07-20.min.json');\n model.paginators = require('../apis/sso-admin-2020-07-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSOAdmin;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['ssooidc'] = {};\nAWS.SSOOIDC = Service.defineService('ssooidc', ['2019-06-10']);\nObject.defineProperty(apiLoader.services['ssooidc'], '2019-06-10', {\n get: function get() {\n var model = require('../apis/sso-oidc-2019-06-10.min.json');\n model.paginators = require('../apis/sso-oidc-2019-06-10.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SSOOIDC;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['stepfunctions'] = {};\nAWS.StepFunctions = Service.defineService('stepfunctions', ['2016-11-23']);\nObject.defineProperty(apiLoader.services['stepfunctions'], '2016-11-23', {\n get: function get() {\n var model = require('../apis/states-2016-11-23.min.json');\n model.paginators = require('../apis/states-2016-11-23.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.StepFunctions;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['storagegateway'] = {};\nAWS.StorageGateway = Service.defineService('storagegateway', ['2013-06-30']);\nObject.defineProperty(apiLoader.services['storagegateway'], '2013-06-30', {\n get: function get() {\n var model = require('../apis/storagegateway-2013-06-30.min.json');\n model.paginators = require('../apis/storagegateway-2013-06-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.StorageGateway;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['sts'] = {};\nAWS.STS = Service.defineService('sts', ['2011-06-15']);\nrequire('../lib/services/sts');\nObject.defineProperty(apiLoader.services['sts'], '2011-06-15', {\n get: function get() {\n var model = require('../apis/sts-2011-06-15.min.json');\n model.paginators = require('../apis/sts-2011-06-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.STS;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['support'] = {};\nAWS.Support = Service.defineService('support', ['2013-04-15']);\nObject.defineProperty(apiLoader.services['support'], '2013-04-15', {\n get: function get() {\n var model = require('../apis/support-2013-04-15.min.json');\n model.paginators = require('../apis/support-2013-04-15.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Support;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['supportapp'] = {};\nAWS.SupportApp = Service.defineService('supportapp', ['2021-08-20']);\nObject.defineProperty(apiLoader.services['supportapp'], '2021-08-20', {\n get: function get() {\n var model = require('../apis/support-app-2021-08-20.min.json');\n model.paginators = require('../apis/support-app-2021-08-20.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SupportApp;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['swf'] = {};\nAWS.SWF = Service.defineService('swf', ['2012-01-25']);\nrequire('../lib/services/swf');\nObject.defineProperty(apiLoader.services['swf'], '2012-01-25', {\n get: function get() {\n var model = require('../apis/swf-2012-01-25.min.json');\n model.paginators = require('../apis/swf-2012-01-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.SWF;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['synthetics'] = {};\nAWS.Synthetics = Service.defineService('synthetics', ['2017-10-11']);\nObject.defineProperty(apiLoader.services['synthetics'], '2017-10-11', {\n get: function get() {\n var model = require('../apis/synthetics-2017-10-11.min.json');\n model.paginators = require('../apis/synthetics-2017-10-11.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Synthetics;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['textract'] = {};\nAWS.Textract = Service.defineService('textract', ['2018-06-27']);\nObject.defineProperty(apiLoader.services['textract'], '2018-06-27', {\n get: function get() {\n var model = require('../apis/textract-2018-06-27.min.json');\n model.paginators = require('../apis/textract-2018-06-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Textract;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['timestreamquery'] = {};\nAWS.TimestreamQuery = Service.defineService('timestreamquery', ['2018-11-01']);\nObject.defineProperty(apiLoader.services['timestreamquery'], '2018-11-01', {\n get: function get() {\n var model = require('../apis/timestream-query-2018-11-01.min.json');\n model.paginators = require('../apis/timestream-query-2018-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.TimestreamQuery;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['timestreamwrite'] = {};\nAWS.TimestreamWrite = Service.defineService('timestreamwrite', ['2018-11-01']);\nObject.defineProperty(apiLoader.services['timestreamwrite'], '2018-11-01', {\n get: function get() {\n var model = require('../apis/timestream-write-2018-11-01.min.json');\n model.paginators = require('../apis/timestream-write-2018-11-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.TimestreamWrite;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['tnb'] = {};\nAWS.Tnb = Service.defineService('tnb', ['2008-10-21']);\nObject.defineProperty(apiLoader.services['tnb'], '2008-10-21', {\n get: function get() {\n var model = require('../apis/tnb-2008-10-21.min.json');\n model.paginators = require('../apis/tnb-2008-10-21.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Tnb;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['transcribeservice'] = {};\nAWS.TranscribeService = Service.defineService('transcribeservice', ['2017-10-26']);\nObject.defineProperty(apiLoader.services['transcribeservice'], '2017-10-26', {\n get: function get() {\n var model = require('../apis/transcribe-2017-10-26.min.json');\n model.paginators = require('../apis/transcribe-2017-10-26.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.TranscribeService;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['transfer'] = {};\nAWS.Transfer = Service.defineService('transfer', ['2018-11-05']);\nObject.defineProperty(apiLoader.services['transfer'], '2018-11-05', {\n get: function get() {\n var model = require('../apis/transfer-2018-11-05.min.json');\n model.paginators = require('../apis/transfer-2018-11-05.paginators.json').pagination;\n model.waiters = require('../apis/transfer-2018-11-05.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Transfer;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['translate'] = {};\nAWS.Translate = Service.defineService('translate', ['2017-07-01']);\nObject.defineProperty(apiLoader.services['translate'], '2017-07-01', {\n get: function get() {\n var model = require('../apis/translate-2017-07-01.min.json');\n model.paginators = require('../apis/translate-2017-07-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Translate;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['verifiedpermissions'] = {};\nAWS.VerifiedPermissions = Service.defineService('verifiedpermissions', ['2021-12-01']);\nObject.defineProperty(apiLoader.services['verifiedpermissions'], '2021-12-01', {\n get: function get() {\n var model = require('../apis/verifiedpermissions-2021-12-01.min.json');\n model.paginators = require('../apis/verifiedpermissions-2021-12-01.paginators.json').pagination;\n model.waiters = require('../apis/verifiedpermissions-2021-12-01.waiters2.json').waiters;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.VerifiedPermissions;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['voiceid'] = {};\nAWS.VoiceID = Service.defineService('voiceid', ['2021-09-27']);\nObject.defineProperty(apiLoader.services['voiceid'], '2021-09-27', {\n get: function get() {\n var model = require('../apis/voice-id-2021-09-27.min.json');\n model.paginators = require('../apis/voice-id-2021-09-27.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.VoiceID;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['vpclattice'] = {};\nAWS.VPCLattice = Service.defineService('vpclattice', ['2022-11-30']);\nObject.defineProperty(apiLoader.services['vpclattice'], '2022-11-30', {\n get: function get() {\n var model = require('../apis/vpc-lattice-2022-11-30.min.json');\n model.paginators = require('../apis/vpc-lattice-2022-11-30.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.VPCLattice;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['waf'] = {};\nAWS.WAF = Service.defineService('waf', ['2015-08-24']);\nObject.defineProperty(apiLoader.services['waf'], '2015-08-24', {\n get: function get() {\n var model = require('../apis/waf-2015-08-24.min.json');\n model.paginators = require('../apis/waf-2015-08-24.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WAF;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['wafregional'] = {};\nAWS.WAFRegional = Service.defineService('wafregional', ['2016-11-28']);\nObject.defineProperty(apiLoader.services['wafregional'], '2016-11-28', {\n get: function get() {\n var model = require('../apis/waf-regional-2016-11-28.min.json');\n model.paginators = require('../apis/waf-regional-2016-11-28.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WAFRegional;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['wafv2'] = {};\nAWS.WAFV2 = Service.defineService('wafv2', ['2019-07-29']);\nObject.defineProperty(apiLoader.services['wafv2'], '2019-07-29', {\n get: function get() {\n var model = require('../apis/wafv2-2019-07-29.min.json');\n model.paginators = require('../apis/wafv2-2019-07-29.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WAFV2;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['wellarchitected'] = {};\nAWS.WellArchitected = Service.defineService('wellarchitected', ['2020-03-31']);\nObject.defineProperty(apiLoader.services['wellarchitected'], '2020-03-31', {\n get: function get() {\n var model = require('../apis/wellarchitected-2020-03-31.min.json');\n model.paginators = require('../apis/wellarchitected-2020-03-31.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WellArchitected;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['wisdom'] = {};\nAWS.Wisdom = Service.defineService('wisdom', ['2020-10-19']);\nObject.defineProperty(apiLoader.services['wisdom'], '2020-10-19', {\n get: function get() {\n var model = require('../apis/wisdom-2020-10-19.min.json');\n model.paginators = require('../apis/wisdom-2020-10-19.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.Wisdom;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workdocs'] = {};\nAWS.WorkDocs = Service.defineService('workdocs', ['2016-05-01']);\nObject.defineProperty(apiLoader.services['workdocs'], '2016-05-01', {\n get: function get() {\n var model = require('../apis/workdocs-2016-05-01.min.json');\n model.paginators = require('../apis/workdocs-2016-05-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkDocs;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['worklink'] = {};\nAWS.WorkLink = Service.defineService('worklink', ['2018-09-25']);\nObject.defineProperty(apiLoader.services['worklink'], '2018-09-25', {\n get: function get() {\n var model = require('../apis/worklink-2018-09-25.min.json');\n model.paginators = require('../apis/worklink-2018-09-25.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkLink;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workmail'] = {};\nAWS.WorkMail = Service.defineService('workmail', ['2017-10-01']);\nObject.defineProperty(apiLoader.services['workmail'], '2017-10-01', {\n get: function get() {\n var model = require('../apis/workmail-2017-10-01.min.json');\n model.paginators = require('../apis/workmail-2017-10-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkMail;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workmailmessageflow'] = {};\nAWS.WorkMailMessageFlow = Service.defineService('workmailmessageflow', ['2019-05-01']);\nObject.defineProperty(apiLoader.services['workmailmessageflow'], '2019-05-01', {\n get: function get() {\n var model = require('../apis/workmailmessageflow-2019-05-01.min.json');\n model.paginators = require('../apis/workmailmessageflow-2019-05-01.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkMailMessageFlow;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workspaces'] = {};\nAWS.WorkSpaces = Service.defineService('workspaces', ['2015-04-08']);\nObject.defineProperty(apiLoader.services['workspaces'], '2015-04-08', {\n get: function get() {\n var model = require('../apis/workspaces-2015-04-08.min.json');\n model.paginators = require('../apis/workspaces-2015-04-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkSpaces;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['workspacesweb'] = {};\nAWS.WorkSpacesWeb = Service.defineService('workspacesweb', ['2020-07-08']);\nObject.defineProperty(apiLoader.services['workspacesweb'], '2020-07-08', {\n get: function get() {\n var model = require('../apis/workspaces-web-2020-07-08.min.json');\n model.paginators = require('../apis/workspaces-web-2020-07-08.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.WorkSpacesWeb;\n","require('../lib/node_loader');\nvar AWS = require('../lib/core');\nvar Service = AWS.Service;\nvar apiLoader = AWS.apiLoader;\n\napiLoader.services['xray'] = {};\nAWS.XRay = Service.defineService('xray', ['2016-04-12']);\nObject.defineProperty(apiLoader.services['xray'], '2016-04-12', {\n get: function get() {\n var model = require('../apis/xray-2016-04-12.min.json');\n model.paginators = require('../apis/xray-2016-04-12.paginators.json').pagination;\n return model;\n },\n enumerable: true,\n configurable: true\n});\n\nmodule.exports = AWS.XRay;\n","function apiLoader(svc, version) {\n if (!apiLoader.services.hasOwnProperty(svc)) {\n throw new Error('InvalidService: Failed to load api for ' + svc);\n }\n return apiLoader.services[svc][version];\n}\n\n/**\n * @api private\n *\n * This member of AWS.apiLoader is private, but changing it will necessitate a\n * change to ../scripts/services-table-generator.ts\n */\napiLoader.services = {};\n\n/**\n * @api private\n */\nmodule.exports = apiLoader;\n","require('./node_loader');\n\nvar AWS = require('./core');\n\n// Load all service classes\nrequire('../clients/all');\n\n/**\n * @api private\n */\nmodule.exports = AWS;\n","var AWS = require('../core'),\n url = AWS.util.url,\n crypto = AWS.util.crypto.lib,\n base64Encode = AWS.util.base64.encode,\n inherit = AWS.util.inherit;\n\nvar queryEncode = function (string) {\n var replacements = {\n '+': '-',\n '=': '_',\n '/': '~'\n };\n return string.replace(/[\\+=\\/]/g, function (match) {\n return replacements[match];\n });\n};\n\nvar signPolicy = function (policy, privateKey) {\n var sign = crypto.createSign('RSA-SHA1');\n sign.write(policy);\n return queryEncode(sign.sign(privateKey, 'base64'));\n};\n\nvar signWithCannedPolicy = function (url, expires, keyPairId, privateKey) {\n var policy = JSON.stringify({\n Statement: [\n {\n Resource: url,\n Condition: { DateLessThan: { 'AWS:EpochTime': expires } }\n }\n ]\n });\n\n return {\n Expires: expires,\n 'Key-Pair-Id': keyPairId,\n Signature: signPolicy(policy.toString(), privateKey)\n };\n};\n\nvar signWithCustomPolicy = function (policy, keyPairId, privateKey) {\n policy = policy.replace(/\\s/mg, '');\n\n return {\n Policy: queryEncode(base64Encode(policy)),\n 'Key-Pair-Id': keyPairId,\n Signature: signPolicy(policy, privateKey)\n };\n};\n\nvar determineScheme = function (url) {\n var parts = url.split('://');\n if (parts.length < 2) {\n throw new Error('Invalid URL.');\n }\n\n return parts[0].replace('*', '');\n};\n\nvar getRtmpUrl = function (rtmpUrl) {\n var parsed = url.parse(rtmpUrl);\n return parsed.path.replace(/^\\//, '') + (parsed.hash || '');\n};\n\nvar getResource = function (url) {\n switch (determineScheme(url)) {\n case 'http':\n case 'https':\n return url;\n case 'rtmp':\n return getRtmpUrl(url);\n default:\n throw new Error('Invalid URI scheme. Scheme must be one of'\n + ' http, https, or rtmp');\n }\n};\n\nvar handleError = function (err, callback) {\n if (!callback || typeof callback !== 'function') {\n throw err;\n }\n\n callback(err);\n};\n\nvar handleSuccess = function (result, callback) {\n if (!callback || typeof callback !== 'function') {\n return result;\n }\n\n callback(null, result);\n};\n\nAWS.CloudFront.Signer = inherit({\n /**\n * A signer object can be used to generate signed URLs and cookies for granting\n * access to content on restricted CloudFront distributions.\n *\n * @see http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html\n *\n * @param keyPairId [String] (Required) The ID of the CloudFront key pair\n * being used.\n * @param privateKey [String] (Required) A private key in RSA format.\n */\n constructor: function Signer(keyPairId, privateKey) {\n if (keyPairId === void 0 || privateKey === void 0) {\n throw new Error('A key pair ID and private key are required');\n }\n\n this.keyPairId = keyPairId;\n this.privateKey = privateKey;\n },\n\n /**\n * Create a signed Amazon CloudFront Cookie.\n *\n * @param options [Object] The options to create a signed cookie.\n * @option options url [String] The URL to which the signature will grant\n * access. Required unless you pass in a full\n * policy.\n * @option options expires [Number] A Unix UTC timestamp indicating when the\n * signature should expire. Required unless you\n * pass in a full policy.\n * @option options policy [String] A CloudFront JSON policy. Required unless\n * you pass in a url and an expiry time.\n *\n * @param cb [Function] if a callback is provided, this function will\n * pass the hash as the second parameter (after the error parameter) to\n * the callback function.\n *\n * @return [Object] if called synchronously (with no callback), returns the\n * signed cookie parameters.\n * @return [null] nothing is returned if a callback is provided.\n */\n getSignedCookie: function (options, cb) {\n var signatureHash = 'policy' in options\n ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey)\n : signWithCannedPolicy(options.url, options.expires, this.keyPairId, this.privateKey);\n\n var cookieHash = {};\n for (var key in signatureHash) {\n if (Object.prototype.hasOwnProperty.call(signatureHash, key)) {\n cookieHash['CloudFront-' + key] = signatureHash[key];\n }\n }\n\n return handleSuccess(cookieHash, cb);\n },\n\n /**\n * Create a signed Amazon CloudFront URL.\n *\n * Keep in mind that URLs meant for use in media/flash players may have\n * different requirements for URL formats (e.g. some require that the\n * extension be removed, some require the file name to be prefixed\n * - mp4:, some require you to add \"/cfx/st\" into your URL).\n *\n * @param options [Object] The options to create a signed URL.\n * @option options url [String] The URL to which the signature will grant\n * access. Any query params included with\n * the URL should be encoded. Required.\n * @option options expires [Number] A Unix UTC timestamp indicating when the\n * signature should expire. Required unless you\n * pass in a full policy.\n * @option options policy [String] A CloudFront JSON policy. Required unless\n * you pass in a url and an expiry time.\n *\n * @param cb [Function] if a callback is provided, this function will\n * pass the URL as the second parameter (after the error parameter) to\n * the callback function.\n *\n * @return [String] if called synchronously (with no callback), returns the\n * signed URL.\n * @return [null] nothing is returned if a callback is provided.\n */\n getSignedUrl: function (options, cb) {\n try {\n var resource = getResource(options.url);\n } catch (err) {\n return handleError(err, cb);\n }\n\n var parsedUrl = url.parse(options.url, true),\n signatureHash = Object.prototype.hasOwnProperty.call(options, 'policy')\n ? signWithCustomPolicy(options.policy, this.keyPairId, this.privateKey)\n : signWithCannedPolicy(resource, options.expires, this.keyPairId, this.privateKey);\n\n parsedUrl.search = null;\n for (var key in signatureHash) {\n if (Object.prototype.hasOwnProperty.call(signatureHash, key)) {\n parsedUrl.query[key] = signatureHash[key];\n }\n }\n\n try {\n var signedUrl = determineScheme(options.url) === 'rtmp'\n ? getRtmpUrl(url.format(parsedUrl))\n : url.format(parsedUrl);\n } catch (err) {\n return handleError(err, cb);\n }\n\n return handleSuccess(signedUrl, cb);\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.CloudFront.Signer;\n","var AWS = require('./core');\nrequire('./credentials');\nrequire('./credentials/credential_provider_chain');\nvar PromisesDependency;\n\n/**\n * The main configuration class used by all service objects to set\n * the region, credentials, and other options for requests.\n *\n * By default, credentials and region settings are left unconfigured.\n * This should be configured by the application before using any\n * AWS service APIs.\n *\n * In order to set global configuration options, properties should\n * be assigned to the global {AWS.config} object.\n *\n * @see AWS.config\n *\n * @!group General Configuration Options\n *\n * @!attribute credentials\n * @return [AWS.Credentials] the AWS credentials to sign requests with.\n *\n * @!attribute region\n * @example Set the global region setting to us-west-2\n * AWS.config.update({region: 'us-west-2'});\n * @return [AWS.Credentials] The region to send service requests to.\n * @see http://docs.amazonwebservices.com/general/latest/gr/rande.html\n * A list of available endpoints for each AWS service\n *\n * @!attribute maxRetries\n * @return [Integer] the maximum amount of retries to perform for a\n * service request. By default this value is calculated by the specific\n * service object that the request is being made to.\n *\n * @!attribute maxRedirects\n * @return [Integer] the maximum amount of redirects to follow for a\n * service request. Defaults to 10.\n *\n * @!attribute paramValidation\n * @return [Boolean|map] whether input parameters should be validated against\n * the operation description before sending the request. Defaults to true.\n * Pass a map to enable any of the following specific validation features:\n *\n * * **min** [Boolean] — Validates that a value meets the min\n * constraint. This is enabled by default when paramValidation is set\n * to `true`.\n * * **max** [Boolean] — Validates that a value meets the max\n * constraint.\n * * **pattern** [Boolean] — Validates that a string value matches a\n * regular expression.\n * * **enum** [Boolean] — Validates that a string value matches one\n * of the allowable enum values.\n *\n * @!attribute computeChecksums\n * @return [Boolean] whether to compute checksums for payload bodies when\n * the service accepts it (currently supported in S3 and SQS only).\n *\n * @!attribute convertResponseTypes\n * @return [Boolean] whether types are converted when parsing response data.\n * Currently only supported for JSON based services. Turning this off may\n * improve performance on large response payloads. Defaults to `true`.\n *\n * @!attribute correctClockSkew\n * @return [Boolean] whether to apply a clock skew correction and retry\n * requests that fail because of an skewed client clock. Defaults to\n * `false`.\n *\n * @!attribute sslEnabled\n * @return [Boolean] whether SSL is enabled for requests\n *\n * @!attribute s3ForcePathStyle\n * @return [Boolean] whether to force path style URLs for S3 objects\n *\n * @!attribute s3BucketEndpoint\n * @note Setting this configuration option requires an `endpoint` to be\n * provided explicitly to the service constructor.\n * @return [Boolean] whether the provided endpoint addresses an individual\n * bucket (false if it addresses the root API endpoint).\n *\n * @!attribute s3DisableBodySigning\n * @return [Boolean] whether to disable S3 body signing when using signature version `v4`.\n * Body signing can only be disabled when using https. Defaults to `true`.\n *\n * @!attribute s3UsEast1RegionalEndpoint\n * @return ['legacy'|'regional'] when region is set to 'us-east-1', whether to send s3\n * request to global endpoints or 'us-east-1' regional endpoints. This config is only\n * applicable to S3 client;\n * Defaults to 'legacy'\n * @!attribute s3UseArnRegion\n * @return [Boolean] whether to override the request region with the region inferred\n * from requested resource's ARN. Only available for S3 buckets\n * Defaults to `true`\n *\n * @!attribute useAccelerateEndpoint\n * @note This configuration option is only compatible with S3 while accessing\n * dns-compatible buckets.\n * @return [Boolean] Whether to use the Accelerate endpoint with the S3 service.\n * Defaults to `false`.\n *\n * @!attribute retryDelayOptions\n * @example Set the base retry delay for all services to 300 ms\n * AWS.config.update({retryDelayOptions: {base: 300}});\n * // Delays with maxRetries = 3: 300, 600, 1200\n * @example Set a custom backoff function to provide delay values on retries\n * AWS.config.update({retryDelayOptions: {customBackoff: function(retryCount, err) {\n * // returns delay in ms\n * }}});\n * @return [map] A set of options to configure the retry delay on retryable errors.\n * Currently supported options are:\n *\n * * **base** [Integer] — The base number of milliseconds to use in the\n * exponential backoff for operation retries. Defaults to 100 ms for all services except\n * DynamoDB, where it defaults to 50ms.\n *\n * * **customBackoff ** [function] — A custom function that accepts a\n * retry count and error and returns the amount of time to delay in\n * milliseconds. If the result is a non-zero negative value, no further\n * retry attempts will be made. The `base` option will be ignored if this\n * option is supplied. The function is only called for retryable errors.\n *\n * @!attribute httpOptions\n * @return [map] A set of options to pass to the low-level HTTP request.\n * Currently supported options are:\n *\n * * **proxy** [String] — the URL to proxy requests through\n * * **agent** [http.Agent, https.Agent] — the Agent object to perform\n * HTTP requests with. Used for connection pooling. Note that for\n * SSL connections, a special Agent object is used in order to enable\n * peer certificate verification. This feature is only supported in the\n * Node.js environment.\n * * **connectTimeout** [Integer] — Sets the socket to timeout after\n * failing to establish a connection with the server after\n * `connectTimeout` milliseconds. This timeout has no effect once a socket\n * connection has been established.\n * * **timeout** [Integer] — The number of milliseconds a request can\n * take before automatically being terminated.\n * Defaults to two minutes (120000).\n * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous\n * HTTP requests. Used in the browser environment only. Set to false to\n * send requests synchronously. Defaults to true (async on).\n * * **xhrWithCredentials** [Boolean] — Sets the \"withCredentials\"\n * property of an XMLHttpRequest object. Used in the browser environment\n * only. Defaults to false.\n * @!attribute logger\n * @return [#write,#log] an object that responds to .write() (like a stream)\n * or .log() (like the console object) in order to log information about\n * requests\n *\n * @!attribute systemClockOffset\n * @return [Number] an offset value in milliseconds to apply to all signing\n * times. Use this to compensate for clock skew when your system may be\n * out of sync with the service time. Note that this configuration option\n * can only be applied to the global `AWS.config` object and cannot be\n * overridden in service-specific configuration. Defaults to 0 milliseconds.\n *\n * @!attribute signatureVersion\n * @return [String] the signature version to sign requests with (overriding\n * the API configuration). Possible values are: 'v2', 'v3', 'v4'.\n *\n * @!attribute signatureCache\n * @return [Boolean] whether the signature to sign requests with (overriding\n * the API configuration) is cached. Only applies to the signature version 'v4'.\n * Defaults to `true`.\n *\n * @!attribute endpointDiscoveryEnabled\n * @return [Boolean|undefined] whether to call operations with endpoints\n * given by service dynamically. Setting this config to `true` will enable\n * endpoint discovery for all applicable operations. Setting it to `false`\n * will explicitly disable endpoint discovery even though operations that\n * require endpoint discovery will presumably fail. Leaving it to\n * `undefined` means SDK only do endpoint discovery when it's required.\n * Defaults to `undefined`\n *\n * @!attribute endpointCacheSize\n * @return [Number] the size of the global cache storing endpoints from endpoint\n * discovery operations. Once endpoint cache is created, updating this setting\n * cannot change existing cache size.\n * Defaults to 1000\n *\n * @!attribute hostPrefixEnabled\n * @return [Boolean] whether to marshal request parameters to the prefix of\n * hostname. Defaults to `true`.\n *\n * @!attribute stsRegionalEndpoints\n * @return ['legacy'|'regional'] whether to send sts request to global endpoints or\n * regional endpoints.\n * Defaults to 'legacy'.\n *\n * @!attribute useFipsEndpoint\n * @return [Boolean] Enables FIPS compatible endpoints. Defaults to `false`.\n *\n * @!attribute useDualstackEndpoint\n * @return [Boolean] Enables IPv6 dualstack endpoint. Defaults to `false`.\n */\nAWS.Config = AWS.util.inherit({\n /**\n * @!endgroup\n */\n\n /**\n * Creates a new configuration object. This is the object that passes\n * option data along to service requests, including credentials, security,\n * region information, and some service specific settings.\n *\n * @example Creating a new configuration object with credentials and region\n * var config = new AWS.Config({\n * accessKeyId: 'AKID', secretAccessKey: 'SECRET', region: 'us-west-2'\n * });\n * @option options accessKeyId [String] your AWS access key ID.\n * @option options secretAccessKey [String] your AWS secret access key.\n * @option options sessionToken [AWS.Credentials] the optional AWS\n * session token to sign requests with.\n * @option options credentials [AWS.Credentials] the AWS credentials\n * to sign requests with. You can either specify this object, or\n * specify the accessKeyId and secretAccessKey options directly.\n * @option options credentialProvider [AWS.CredentialProviderChain] the\n * provider chain used to resolve credentials if no static `credentials`\n * property is set.\n * @option options region [String] the region to send service requests to.\n * See {region} for more information.\n * @option options maxRetries [Integer] the maximum amount of retries to\n * attempt with a request. See {maxRetries} for more information.\n * @option options maxRedirects [Integer] the maximum amount of redirects to\n * follow with a request. See {maxRedirects} for more information.\n * @option options sslEnabled [Boolean] whether to enable SSL for\n * requests.\n * @option options paramValidation [Boolean|map] whether input parameters\n * should be validated against the operation description before sending\n * the request. Defaults to true. Pass a map to enable any of the\n * following specific validation features:\n *\n * * **min** [Boolean] — Validates that a value meets the min\n * constraint. This is enabled by default when paramValidation is set\n * to `true`.\n * * **max** [Boolean] — Validates that a value meets the max\n * constraint.\n * * **pattern** [Boolean] — Validates that a string value matches a\n * regular expression.\n * * **enum** [Boolean] — Validates that a string value matches one\n * of the allowable enum values.\n * @option options computeChecksums [Boolean] whether to compute checksums\n * for payload bodies when the service accepts it (currently supported\n * in S3 only)\n * @option options convertResponseTypes [Boolean] whether types are converted\n * when parsing response data. Currently only supported for JSON based\n * services. Turning this off may improve performance on large response\n * payloads. Defaults to `true`.\n * @option options correctClockSkew [Boolean] whether to apply a clock skew\n * correction and retry requests that fail because of an skewed client\n * clock. Defaults to `false`.\n * @option options s3ForcePathStyle [Boolean] whether to force path\n * style URLs for S3 objects.\n * @option options s3BucketEndpoint [Boolean] whether the provided endpoint\n * addresses an individual bucket (false if it addresses the root API\n * endpoint). Note that setting this configuration option requires an\n * `endpoint` to be provided explicitly to the service constructor.\n * @option options s3DisableBodySigning [Boolean] whether S3 body signing\n * should be disabled when using signature version `v4`. Body signing\n * can only be disabled when using https. Defaults to `true`.\n * @option options s3UsEast1RegionalEndpoint ['legacy'|'regional'] when region\n * is set to 'us-east-1', whether to send s3 request to global endpoints or\n * 'us-east-1' regional endpoints. This config is only applicable to S3 client.\n * Defaults to `legacy`\n * @option options s3UseArnRegion [Boolean] whether to override the request region\n * with the region inferred from requested resource's ARN. Only available for S3 buckets\n * Defaults to `true`\n *\n * @option options retryDelayOptions [map] A set of options to configure\n * the retry delay on retryable errors. Currently supported options are:\n *\n * * **base** [Integer] — The base number of milliseconds to use in the\n * exponential backoff for operation retries. Defaults to 100 ms for all\n * services except DynamoDB, where it defaults to 50ms.\n * * **customBackoff ** [function] — A custom function that accepts a\n * retry count and error and returns the amount of time to delay in\n * milliseconds. If the result is a non-zero negative value, no further\n * retry attempts will be made. The `base` option will be ignored if this\n * option is supplied. The function is only called for retryable errors.\n * @option options httpOptions [map] A set of options to pass to the low-level\n * HTTP request. Currently supported options are:\n *\n * * **proxy** [String] — the URL to proxy requests through\n * * **agent** [http.Agent, https.Agent] — the Agent object to perform\n * HTTP requests with. Used for connection pooling. Defaults to the global\n * agent (`http.globalAgent`) for non-SSL connections. Note that for\n * SSL connections, a special Agent object is used in order to enable\n * peer certificate verification. This feature is only available in the\n * Node.js environment.\n * * **connectTimeout** [Integer] — Sets the socket to timeout after\n * failing to establish a connection with the server after\n * `connectTimeout` milliseconds. This timeout has no effect once a socket\n * connection has been established.\n * * **timeout** [Integer] — Sets the socket to timeout after timeout\n * milliseconds of inactivity on the socket. Defaults to two minutes\n * (120000).\n * * **xhrAsync** [Boolean] — Whether the SDK will send asynchronous\n * HTTP requests. Used in the browser environment only. Set to false to\n * send requests synchronously. Defaults to true (async on).\n * * **xhrWithCredentials** [Boolean] — Sets the \"withCredentials\"\n * property of an XMLHttpRequest object. Used in the browser environment\n * only. Defaults to false.\n * @option options apiVersion [String, Date] a String in YYYY-MM-DD format\n * (or a date) that represents the latest possible API version that can be\n * used in all services (unless overridden by `apiVersions`). Specify\n * 'latest' to use the latest possible version.\n * @option options apiVersions [map] a map of service\n * identifiers (the lowercase service class name) with the API version to\n * use when instantiating a service. Specify 'latest' for each individual\n * that can use the latest available version.\n * @option options logger [#write,#log] an object that responds to .write()\n * (like a stream) or .log() (like the console object) in order to log\n * information about requests\n * @option options systemClockOffset [Number] an offset value in milliseconds\n * to apply to all signing times. Use this to compensate for clock skew\n * when your system may be out of sync with the service time. Note that\n * this configuration option can only be applied to the global `AWS.config`\n * object and cannot be overridden in service-specific configuration.\n * Defaults to 0 milliseconds.\n * @option options signatureVersion [String] the signature version to sign\n * requests with (overriding the API configuration). Possible values are:\n * 'v2', 'v3', 'v4'.\n * @option options signatureCache [Boolean] whether the signature to sign\n * requests with (overriding the API configuration) is cached. Only applies\n * to the signature version 'v4'. Defaults to `true`.\n * @option options dynamoDbCrc32 [Boolean] whether to validate the CRC32\n * checksum of HTTP response bodies returned by DynamoDB. Default: `true`.\n * @option options useAccelerateEndpoint [Boolean] Whether to use the\n * S3 Transfer Acceleration endpoint with the S3 service. Default: `false`.\n * @option options clientSideMonitoring [Boolean] whether to collect and\n * publish this client's performance metrics of all its API requests.\n * @option options endpointDiscoveryEnabled [Boolean|undefined] whether to\n * call operations with endpoints given by service dynamically. Setting this\n * config to `true` will enable endpoint discovery for all applicable operations.\n * Setting it to `false` will explicitly disable endpoint discovery even though\n * operations that require endpoint discovery will presumably fail. Leaving it\n * to `undefined` means SDK will only do endpoint discovery when it's required.\n * Defaults to `undefined`\n * @option options endpointCacheSize [Number] the size of the global cache storing\n * endpoints from endpoint discovery operations. Once endpoint cache is created,\n * updating this setting cannot change existing cache size.\n * Defaults to 1000\n * @option options hostPrefixEnabled [Boolean] whether to marshal request\n * parameters to the prefix of hostname.\n * Defaults to `true`.\n * @option options stsRegionalEndpoints ['legacy'|'regional'] whether to send sts request\n * to global endpoints or regional endpoints.\n * Defaults to 'legacy'.\n * @option options useFipsEndpoint [Boolean] Enables FIPS compatible endpoints.\n * Defaults to `false`.\n * @option options useDualstackEndpoint [Boolean] Enables IPv6 dualstack endpoint.\n * Defaults to `false`.\n */\n constructor: function Config(options) {\n if (options === undefined) options = {};\n options = this.extractCredentials(options);\n\n AWS.util.each.call(this, this.keys, function (key, value) {\n this.set(key, options[key], value);\n });\n },\n\n /**\n * @!group Managing Credentials\n */\n\n /**\n * Loads credentials from the configuration object. This is used internally\n * by the SDK to ensure that refreshable {Credentials} objects are properly\n * refreshed and loaded when sending a request. If you want to ensure that\n * your credentials are loaded prior to a request, you can use this method\n * directly to provide accurate credential data stored in the object.\n *\n * @note If you configure the SDK with static or environment credentials,\n * the credential data should already be present in {credentials} attribute.\n * This method is primarily necessary to load credentials from asynchronous\n * sources, or sources that can refresh credentials periodically.\n * @example Getting your access key\n * AWS.config.getCredentials(function(err) {\n * if (err) console.log(err.stack); // credentials not loaded\n * else console.log(\"Access Key:\", AWS.config.credentials.accessKeyId);\n * })\n * @callback callback function(err)\n * Called when the {credentials} have been properly set on the configuration\n * object.\n *\n * @param err [Error] if this is set, credentials were not successfully\n * loaded and this error provides information why.\n * @see credentials\n * @see Credentials\n */\n getCredentials: function getCredentials(callback) {\n var self = this;\n\n function finish(err) {\n callback(err, err ? null : self.credentials);\n }\n\n function credError(msg, err) {\n return new AWS.util.error(err || new Error(), {\n code: 'CredentialsError',\n message: msg,\n name: 'CredentialsError'\n });\n }\n\n function getAsyncCredentials() {\n self.credentials.get(function(err) {\n if (err) {\n var msg = 'Could not load credentials from ' +\n self.credentials.constructor.name;\n err = credError(msg, err);\n }\n finish(err);\n });\n }\n\n function getStaticCredentials() {\n var err = null;\n if (!self.credentials.accessKeyId || !self.credentials.secretAccessKey) {\n err = credError('Missing credentials');\n }\n finish(err);\n }\n\n if (self.credentials) {\n if (typeof self.credentials.get === 'function') {\n getAsyncCredentials();\n } else { // static credentials\n getStaticCredentials();\n }\n } else if (self.credentialProvider) {\n self.credentialProvider.resolve(function(err, creds) {\n if (err) {\n err = credError('Could not load credentials from any providers', err);\n }\n self.credentials = creds;\n finish(err);\n });\n } else {\n finish(credError('No credentials to load'));\n }\n },\n\n /**\n * Loads token from the configuration object. This is used internally\n * by the SDK to ensure that refreshable {Token} objects are properly\n * refreshed and loaded when sending a request. If you want to ensure that\n * your token is loaded prior to a request, you can use this method\n * directly to provide accurate token data stored in the object.\n *\n * @note If you configure the SDK with static token, the token data should\n * already be present in {token} attribute. This method is primarily necessary\n * to load token from asynchronous sources, or sources that can refresh\n * token periodically.\n * @example Getting your access token\n * AWS.config.getToken(function(err) {\n * if (err) console.log(err.stack); // token not loaded\n * else console.log(\"Token:\", AWS.config.token.token);\n * })\n * @callback callback function(err)\n * Called when the {token} have been properly set on the configuration object.\n *\n * @param err [Error] if this is set, token was not successfully loaded and\n * this error provides information why.\n * @see token\n */\n getToken: function getToken(callback) {\n var self = this;\n\n function finish(err) {\n callback(err, err ? null : self.token);\n }\n\n function tokenError(msg, err) {\n return new AWS.util.error(err || new Error(), {\n code: 'TokenError',\n message: msg,\n name: 'TokenError'\n });\n }\n\n function getAsyncToken() {\n self.token.get(function(err) {\n if (err) {\n var msg = 'Could not load token from ' +\n self.token.constructor.name;\n err = tokenError(msg, err);\n }\n finish(err);\n });\n }\n\n function getStaticToken() {\n var err = null;\n if (!self.token.token) {\n err = tokenError('Missing token');\n }\n finish(err);\n }\n\n if (self.token) {\n if (typeof self.token.get === 'function') {\n getAsyncToken();\n } else { // static token\n getStaticToken();\n }\n } else if (self.tokenProvider) {\n self.tokenProvider.resolve(function(err, token) {\n if (err) {\n err = tokenError('Could not load token from any providers', err);\n }\n self.token = token;\n finish(err);\n });\n } else {\n finish(tokenError('No token to load'));\n }\n },\n\n /**\n * @!group Loading and Setting Configuration Options\n */\n\n /**\n * @overload update(options, allowUnknownKeys = false)\n * Updates the current configuration object with new options.\n *\n * @example Update maxRetries property of a configuration object\n * config.update({maxRetries: 10});\n * @param [Object] options a map of option keys and values.\n * @param [Boolean] allowUnknownKeys whether unknown keys can be set on\n * the configuration object. Defaults to `false`.\n * @see constructor\n */\n update: function update(options, allowUnknownKeys) {\n allowUnknownKeys = allowUnknownKeys || false;\n options = this.extractCredentials(options);\n AWS.util.each.call(this, options, function (key, value) {\n if (allowUnknownKeys || Object.prototype.hasOwnProperty.call(this.keys, key) ||\n AWS.Service.hasService(key)) {\n this.set(key, value);\n }\n });\n },\n\n /**\n * Loads configuration data from a JSON file into this config object.\n * @note Loading configuration will reset all existing configuration\n * on the object.\n * @!macro nobrowser\n * @param path [String] the path relative to your process's current\n * working directory to load configuration from.\n * @return [AWS.Config] the same configuration object\n */\n loadFromPath: function loadFromPath(path) {\n this.clear();\n\n var options = JSON.parse(AWS.util.readFileSync(path));\n var fileSystemCreds = new AWS.FileSystemCredentials(path);\n var chain = new AWS.CredentialProviderChain();\n chain.providers.unshift(fileSystemCreds);\n chain.resolve(function (err, creds) {\n if (err) throw err;\n else options.credentials = creds;\n });\n\n this.constructor(options);\n\n return this;\n },\n\n /**\n * Clears configuration data on this object\n *\n * @api private\n */\n clear: function clear() {\n /*jshint forin:false */\n AWS.util.each.call(this, this.keys, function (key) {\n delete this[key];\n });\n\n // reset credential provider\n this.set('credentials', undefined);\n this.set('credentialProvider', undefined);\n },\n\n /**\n * Sets a property on the configuration object, allowing for a\n * default value\n * @api private\n */\n set: function set(property, value, defaultValue) {\n if (value === undefined) {\n if (defaultValue === undefined) {\n defaultValue = this.keys[property];\n }\n if (typeof defaultValue === 'function') {\n this[property] = defaultValue.call(this);\n } else {\n this[property] = defaultValue;\n }\n } else if (property === 'httpOptions' && this[property]) {\n // deep merge httpOptions\n this[property] = AWS.util.merge(this[property], value);\n } else {\n this[property] = value;\n }\n },\n\n /**\n * All of the keys with their default values.\n *\n * @constant\n * @api private\n */\n keys: {\n credentials: null,\n credentialProvider: null,\n region: null,\n logger: null,\n apiVersions: {},\n apiVersion: null,\n endpoint: undefined,\n httpOptions: {\n timeout: 120000\n },\n maxRetries: undefined,\n maxRedirects: 10,\n paramValidation: true,\n sslEnabled: true,\n s3ForcePathStyle: false,\n s3BucketEndpoint: false,\n s3DisableBodySigning: true,\n s3UsEast1RegionalEndpoint: 'legacy',\n s3UseArnRegion: undefined,\n computeChecksums: true,\n convertResponseTypes: true,\n correctClockSkew: false,\n customUserAgent: null,\n dynamoDbCrc32: true,\n systemClockOffset: 0,\n signatureVersion: null,\n signatureCache: true,\n retryDelayOptions: {},\n useAccelerateEndpoint: false,\n clientSideMonitoring: false,\n endpointDiscoveryEnabled: undefined,\n endpointCacheSize: 1000,\n hostPrefixEnabled: true,\n stsRegionalEndpoints: 'legacy',\n useFipsEndpoint: false,\n useDualstackEndpoint: false,\n token: null\n },\n\n /**\n * Extracts accessKeyId, secretAccessKey and sessionToken\n * from a configuration hash.\n *\n * @api private\n */\n extractCredentials: function extractCredentials(options) {\n if (options.accessKeyId && options.secretAccessKey) {\n options = AWS.util.copy(options);\n options.credentials = new AWS.Credentials(options);\n }\n return options;\n },\n\n /**\n * Sets the promise dependency the SDK will use wherever Promises are returned.\n * Passing `null` will force the SDK to use native Promises if they are available.\n * If native Promises are not available, passing `null` will have no effect.\n * @param [Constructor] dep A reference to a Promise constructor\n */\n setPromisesDependency: function setPromisesDependency(dep) {\n PromisesDependency = dep;\n // if null was passed in, we should try to use native promises\n if (dep === null && typeof Promise === 'function') {\n PromisesDependency = Promise;\n }\n var constructors = [AWS.Request, AWS.Credentials, AWS.CredentialProviderChain];\n if (AWS.S3) {\n constructors.push(AWS.S3);\n if (AWS.S3.ManagedUpload) {\n constructors.push(AWS.S3.ManagedUpload);\n }\n }\n AWS.util.addPromises(constructors, PromisesDependency);\n },\n\n /**\n * Gets the promise dependency set by `AWS.config.setPromisesDependency`.\n */\n getPromisesDependency: function getPromisesDependency() {\n return PromisesDependency;\n }\n});\n\n/**\n * @return [AWS.Config] The global configuration object singleton instance\n * @readonly\n * @see AWS.Config\n */\nAWS.config = new AWS.Config();\n","var AWS = require('./core');\n/**\n * @api private\n */\nfunction validateRegionalEndpointsFlagValue(configValue, errorOptions) {\n if (typeof configValue !== 'string') return undefined;\n else if (['legacy', 'regional'].indexOf(configValue.toLowerCase()) >= 0) {\n return configValue.toLowerCase();\n } else {\n throw AWS.util.error(new Error(), errorOptions);\n }\n}\n\n/**\n * Resolve the configuration value for regional endpoint from difference sources: client\n * config, environmental variable, shared config file. Value can be case-insensitive\n * 'legacy' or 'reginal'.\n * @param originalConfig user-supplied config object to resolve\n * @param options a map of config property names from individual configuration source\n * - env: name of environmental variable that refers to the config\n * - sharedConfig: name of shared configuration file property that refers to the config\n * - clientConfig: name of client configuration property that refers to the config\n *\n * @api private\n */\nfunction resolveRegionalEndpointsFlag(originalConfig, options) {\n originalConfig = originalConfig || {};\n //validate config value\n var resolved;\n if (originalConfig[options.clientConfig]) {\n resolved = validateRegionalEndpointsFlagValue(originalConfig[options.clientConfig], {\n code: 'InvalidConfiguration',\n message: 'invalid \"' + options.clientConfig + '\" configuration. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + originalConfig[options.clientConfig] + '\".'\n });\n if (resolved) return resolved;\n }\n if (!AWS.util.isNode()) return resolved;\n //validate environmental variable\n if (Object.prototype.hasOwnProperty.call(process.env, options.env)) {\n var envFlag = process.env[options.env];\n resolved = validateRegionalEndpointsFlagValue(envFlag, {\n code: 'InvalidEnvironmentalVariable',\n message: 'invalid ' + options.env + ' environmental variable. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + process.env[options.env] + '\".'\n });\n if (resolved) return resolved;\n }\n //validate shared config file\n var profile = {};\n try {\n var profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader);\n profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile];\n } catch (e) {};\n if (profile && Object.prototype.hasOwnProperty.call(profile, options.sharedConfig)) {\n var fileFlag = profile[options.sharedConfig];\n resolved = validateRegionalEndpointsFlagValue(fileFlag, {\n code: 'InvalidConfiguration',\n message: 'invalid ' + options.sharedConfig + ' profile config. Expect \"legacy\" ' +\n ' or \"regional\". Got \"' + profile[options.sharedConfig] + '\".'\n });\n if (resolved) return resolved;\n }\n return resolved;\n}\n\nmodule.exports = resolveRegionalEndpointsFlag;\n","/**\n * The main AWS namespace\n */\nvar AWS = { util: require('./util') };\n\n/**\n * @api private\n * @!macro [new] nobrowser\n * @note This feature is not supported in the browser environment of the SDK.\n */\nvar _hidden = {}; _hidden.toString(); // hack to parse macro\n\n/**\n * @api private\n */\nmodule.exports = AWS;\n\nAWS.util.update(AWS, {\n\n /**\n * @constant\n */\n VERSION: '2.1437.0',\n\n /**\n * @api private\n */\n Signers: {},\n\n /**\n * @api private\n */\n Protocol: {\n Json: require('./protocol/json'),\n Query: require('./protocol/query'),\n Rest: require('./protocol/rest'),\n RestJson: require('./protocol/rest_json'),\n RestXml: require('./protocol/rest_xml')\n },\n\n /**\n * @api private\n */\n XML: {\n Builder: require('./xml/builder'),\n Parser: null // conditionally set based on environment\n },\n\n /**\n * @api private\n */\n JSON: {\n Builder: require('./json/builder'),\n Parser: require('./json/parser')\n },\n\n /**\n * @api private\n */\n Model: {\n Api: require('./model/api'),\n Operation: require('./model/operation'),\n Shape: require('./model/shape'),\n Paginator: require('./model/paginator'),\n ResourceWaiter: require('./model/resource_waiter')\n },\n\n /**\n * @api private\n */\n apiLoader: require('./api_loader'),\n\n /**\n * @api private\n */\n EndpointCache: require('../vendor/endpoint-cache').EndpointCache\n});\nrequire('./sequential_executor');\nrequire('./service');\nrequire('./config');\nrequire('./http');\nrequire('./event_listeners');\nrequire('./request');\nrequire('./response');\nrequire('./resource_waiter');\nrequire('./signers/request_signer');\nrequire('./param_validator');\nrequire('./maintenance_mode_message');\n\n/**\n * @readonly\n * @return [AWS.SequentialExecutor] a collection of global event listeners that\n * are attached to every sent request.\n * @see AWS.Request AWS.Request for a list of events to listen for\n * @example Logging the time taken to send a request\n * AWS.events.on('send', function startSend(resp) {\n * resp.startTime = new Date().getTime();\n * }).on('complete', function calculateTime(resp) {\n * var time = (new Date().getTime() - resp.startTime) / 1000;\n * console.log('Request took ' + time + ' seconds');\n * });\n *\n * new AWS.S3().listBuckets(); // prints 'Request took 0.285 seconds'\n */\nAWS.events = new AWS.SequentialExecutor();\n\n//create endpoint cache lazily\nAWS.util.memoizedProperty(AWS, 'endpointCache', function() {\n return new AWS.EndpointCache(AWS.config.endpointCacheSize);\n}, true);\n","var AWS = require('./core');\n\n/**\n * Represents your AWS security credentials, specifically the\n * {accessKeyId}, {secretAccessKey}, and optional {sessionToken}.\n * Creating a `Credentials` object allows you to pass around your\n * security information to configuration and service objects.\n *\n * Note that this class typically does not need to be constructed manually,\n * as the {AWS.Config} and {AWS.Service} classes both accept simple\n * options hashes with the three keys. These structures will be converted\n * into Credentials objects automatically.\n *\n * ## Expiring and Refreshing Credentials\n *\n * Occasionally credentials can expire in the middle of a long-running\n * application. In this case, the SDK will automatically attempt to\n * refresh the credentials from the storage location if the Credentials\n * class implements the {refresh} method.\n *\n * If you are implementing a credential storage location, you\n * will want to create a subclass of the `Credentials` class and\n * override the {refresh} method. This method allows credentials to be\n * retrieved from the backing store, be it a file system, database, or\n * some network storage. The method should reset the credential attributes\n * on the object.\n *\n * @!attribute expired\n * @return [Boolean] whether the credentials have been expired and\n * require a refresh. Used in conjunction with {expireTime}.\n * @!attribute expireTime\n * @return [Date] a time when credentials should be considered expired. Used\n * in conjunction with {expired}.\n * @!attribute accessKeyId\n * @return [String] the AWS access key ID\n * @!attribute secretAccessKey\n * @return [String] the AWS secret access key\n * @!attribute sessionToken\n * @return [String] an optional AWS session token\n */\nAWS.Credentials = AWS.util.inherit({\n /**\n * A credentials object can be created using positional arguments or an options\n * hash.\n *\n * @overload AWS.Credentials(accessKeyId, secretAccessKey, sessionToken=null)\n * Creates a Credentials object with a given set of credential information\n * as positional arguments.\n * @param accessKeyId [String] the AWS access key ID\n * @param secretAccessKey [String] the AWS secret access key\n * @param sessionToken [String] the optional AWS session token\n * @example Create a credentials object with AWS credentials\n * var creds = new AWS.Credentials('akid', 'secret', 'session');\n * @overload AWS.Credentials(options)\n * Creates a Credentials object with a given set of credential information\n * as an options hash.\n * @option options accessKeyId [String] the AWS access key ID\n * @option options secretAccessKey [String] the AWS secret access key\n * @option options sessionToken [String] the optional AWS session token\n * @example Create a credentials object with AWS credentials\n * var creds = new AWS.Credentials({\n * accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'session'\n * });\n */\n constructor: function Credentials() {\n // hide secretAccessKey from being displayed with util.inspect\n AWS.util.hideProperties(this, ['secretAccessKey']);\n\n this.expired = false;\n this.expireTime = null;\n this.refreshCallbacks = [];\n if (arguments.length === 1 && typeof arguments[0] === 'object') {\n var creds = arguments[0].credentials || arguments[0];\n this.accessKeyId = creds.accessKeyId;\n this.secretAccessKey = creds.secretAccessKey;\n this.sessionToken = creds.sessionToken;\n } else {\n this.accessKeyId = arguments[0];\n this.secretAccessKey = arguments[1];\n this.sessionToken = arguments[2];\n }\n },\n\n /**\n * @return [Integer] the number of seconds before {expireTime} during which\n * the credentials will be considered expired.\n */\n expiryWindow: 15,\n\n /**\n * @return [Boolean] whether the credentials object should call {refresh}\n * @note Subclasses should override this method to provide custom refresh\n * logic.\n */\n needsRefresh: function needsRefresh() {\n var currentTime = AWS.util.date.getDate().getTime();\n var adjustedTime = new Date(currentTime + this.expiryWindow * 1000);\n\n if (this.expireTime && adjustedTime > this.expireTime) {\n return true;\n } else {\n return this.expired || !this.accessKeyId || !this.secretAccessKey;\n }\n },\n\n /**\n * Gets the existing credentials, refreshing them if they are not yet loaded\n * or have expired. Users should call this method before using {refresh},\n * as this will not attempt to reload credentials when they are already\n * loaded into the object.\n *\n * @callback callback function(err)\n * When this callback is called with no error, it means either credentials\n * do not need to be refreshed or refreshed credentials information has\n * been loaded into the object (as the `accessKeyId`, `secretAccessKey`,\n * and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n */\n get: function get(callback) {\n var self = this;\n if (this.needsRefresh()) {\n this.refresh(function(err) {\n if (!err) self.expired = false; // reset expired flag\n if (callback) callback(err);\n });\n } else if (callback) {\n callback();\n }\n },\n\n /**\n * @!method getPromise()\n * Returns a 'thenable' promise.\n * Gets the existing credentials, refreshing them if they are not yet loaded\n * or have expired. Users should call this method before using {refresh},\n * as this will not attempt to reload credentials when they are already\n * loaded into the object.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function()\n * Called if the promise is fulfilled. When this callback is called, it\n * means either credentials do not need to be refreshed or refreshed\n * credentials information has been loaded into the object (as the\n * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] if an error occurred, this value will be filled\n * @return [Promise] A promise that represents the state of the `get` call.\n * @example Calling the `getPromise` method.\n * var promise = credProvider.getPromise();\n * promise.then(function() { ... }, function(err) { ... });\n */\n\n /**\n * @!method refreshPromise()\n * Returns a 'thenable' promise.\n * Refreshes the credentials. Users should call {get} before attempting\n * to forcibly refresh credentials.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function()\n * Called if the promise is fulfilled. When this callback is called, it\n * means refreshed credentials information has been loaded into the object\n * (as the `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] if an error occurred, this value will be filled\n * @return [Promise] A promise that represents the state of the `refresh` call.\n * @example Calling the `refreshPromise` method.\n * var promise = credProvider.refreshPromise();\n * promise.then(function() { ... }, function(err) { ... });\n */\n\n /**\n * Refreshes the credentials. Users should call {get} before attempting\n * to forcibly refresh credentials.\n *\n * @callback callback function(err)\n * When this callback is called with no error, it means refreshed\n * credentials information has been loaded into the object (as the\n * `accessKeyId`, `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @note Subclasses should override this class to reset the\n * {accessKeyId}, {secretAccessKey} and optional {sessionToken}\n * on the credentials object and then call the callback with\n * any error information.\n * @see get\n */\n refresh: function refresh(callback) {\n this.expired = false;\n callback();\n },\n\n /**\n * @api private\n * @param callback\n */\n coalesceRefresh: function coalesceRefresh(callback, sync) {\n var self = this;\n if (self.refreshCallbacks.push(callback) === 1) {\n self.load(function onLoad(err) {\n AWS.util.arrayEach(self.refreshCallbacks, function(callback) {\n if (sync) {\n callback(err);\n } else {\n // callback could throw, so defer to ensure all callbacks are notified\n AWS.util.defer(function () {\n callback(err);\n });\n }\n });\n self.refreshCallbacks.length = 0;\n });\n }\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n callback();\n }\n});\n\n/**\n * @api private\n */\nAWS.Credentials.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency);\n this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.Credentials.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.getPromise;\n delete this.prototype.refreshPromise;\n};\n\nAWS.util.addPromises(AWS.Credentials);\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents temporary credentials retrieved from {AWS.STS}. Without any\n * extra parameters, credentials will be fetched from the\n * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the\n * {AWS.STS.assumeRole} operation will be used to fetch credentials for the\n * role instead.\n *\n * AWS.ChainableTemporaryCredentials differs from AWS.TemporaryCredentials in\n * the way masterCredentials and refreshes are handled.\n * AWS.ChainableTemporaryCredentials refreshes expired credentials using the\n * masterCredentials passed by the user to support chaining of STS credentials.\n * However, AWS.TemporaryCredentials recursively collapses the masterCredentials\n * during instantiation, precluding the ability to refresh credentials which\n * require intermediate, temporary credentials.\n *\n * For example, if the application should use RoleA, which must be assumed from\n * RoleB, and the environment provides credentials which can assume RoleB, then\n * AWS.ChainableTemporaryCredentials must be used to support refreshing the\n * temporary credentials for RoleA:\n *\n * ```javascript\n * var roleACreds = new AWS.ChainableTemporaryCredentials({\n * params: {RoleArn: 'RoleA'},\n * masterCredentials: new AWS.ChainableTemporaryCredentials({\n * params: {RoleArn: 'RoleB'},\n * masterCredentials: new AWS.EnvironmentCredentials('AWS')\n * })\n * });\n * ```\n *\n * If AWS.TemporaryCredentials had been used in the previous example,\n * `roleACreds` would fail to refresh because `roleACreds` would\n * use the environment credentials for the AssumeRole request.\n *\n * Another difference is that AWS.ChainableTemporaryCredentials creates the STS\n * service instance during instantiation while AWS.TemporaryCredentials creates\n * the STS service instance during the first refresh. Creating the service\n * instance during instantiation effectively captures the master credentials\n * from the global config, so that subsequent changes to the global config do\n * not affect the master credentials used to refresh the temporary credentials.\n *\n * This allows an instance of AWS.ChainableTemporaryCredentials to be assigned\n * to AWS.config.credentials:\n *\n * ```javascript\n * var envCreds = new AWS.EnvironmentCredentials('AWS');\n * AWS.config.credentials = envCreds;\n * // masterCredentials will be envCreds\n * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({\n * params: {RoleArn: '...'}\n * });\n * ```\n *\n * Similarly, to use the CredentialProviderChain's default providers as the\n * master credentials, simply create a new instance of\n * AWS.ChainableTemporaryCredentials:\n *\n * ```javascript\n * AWS.config.credentials = new ChainableTemporaryCredentials({\n * params: {RoleArn: '...'}\n * });\n * ```\n *\n * @!attribute service\n * @return [AWS.STS] the STS service instance used to\n * get and refresh temporary credentials from AWS STS.\n * @note (see constructor)\n */\nAWS.ChainableTemporaryCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new temporary credentials object.\n *\n * @param options [map] a set of options\n * @option options params [map] ({}) a map of options that are passed to the\n * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations.\n * If a `RoleArn` parameter is passed in, credentials will be based on the\n * IAM role. If a `SerialNumber` parameter is passed in, {tokenCodeFn} must\n * also be passed in or an error will be thrown.\n * @option options masterCredentials [AWS.Credentials] the master credentials\n * used to get and refresh temporary credentials from AWS STS. By default,\n * AWS.config.credentials or AWS.config.credentialProvider will be used.\n * @option options tokenCodeFn [Function] (null) Function to provide\n * `TokenCode`, if `SerialNumber` is provided for profile in {params}. Function\n * is called with value of `SerialNumber` and `callback`, and should provide\n * the `TokenCode` or an error to the callback in the format\n * `callback(err, token)`.\n * @example Creating a new credentials object for generic temporary credentials\n * AWS.config.credentials = new AWS.ChainableTemporaryCredentials();\n * @example Creating a new credentials object for an IAM role\n * AWS.config.credentials = new AWS.ChainableTemporaryCredentials({\n * params: {\n * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials'\n * }\n * });\n * @see AWS.STS.assumeRole\n * @see AWS.STS.getSessionToken\n */\n constructor: function ChainableTemporaryCredentials(options) {\n AWS.Credentials.call(this);\n options = options || {};\n this.errorCode = 'ChainableTemporaryCredentialsProviderFailure';\n this.expired = true;\n this.tokenCodeFn = null;\n\n var params = AWS.util.copy(options.params) || {};\n if (params.RoleArn) {\n params.RoleSessionName = params.RoleSessionName || 'temporary-credentials';\n }\n if (params.SerialNumber) {\n if (!options.tokenCodeFn || (typeof options.tokenCodeFn !== 'function')) {\n throw new AWS.util.error(\n new Error('tokenCodeFn must be a function when params.SerialNumber is given'),\n {code: this.errorCode}\n );\n } else {\n this.tokenCodeFn = options.tokenCodeFn;\n }\n }\n var config = AWS.util.merge(\n {\n params: params,\n credentials: options.masterCredentials || AWS.config.credentials\n },\n options.stsConfig || {}\n );\n this.service = new STS(config);\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRole} or\n * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed\n * to the credentials {constructor}.\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see AWS.Credentials.get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n var self = this;\n var operation = self.service.config.params.RoleArn ? 'assumeRole' : 'getSessionToken';\n this.getTokenCode(function (err, tokenCode) {\n var params = {};\n if (err) {\n callback(err);\n return;\n }\n if (tokenCode) {\n params.TokenCode = tokenCode;\n }\n self.service[operation](params, function (err, data) {\n if (!err) {\n self.service.credentialsFrom(data, self);\n }\n callback(err);\n });\n });\n },\n\n /**\n * @api private\n */\n getTokenCode: function getTokenCode(callback) {\n var self = this;\n if (this.tokenCodeFn) {\n this.tokenCodeFn(this.service.config.params.SerialNumber, function (err, token) {\n if (err) {\n var message = err;\n if (err instanceof Error) {\n message = err.message;\n }\n callback(\n AWS.util.error(\n new Error('Error fetching MFA token: ' + message),\n { code: self.errorCode}\n )\n );\n return;\n }\n callback(null, token);\n });\n } else {\n callback(null);\n }\n }\n});\n","var AWS = require('../core');\nvar CognitoIdentity = require('../../clients/cognitoidentity');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents credentials retrieved from STS Web Identity Federation using\n * the Amazon Cognito Identity service.\n *\n * By default this provider gets credentials using the\n * {AWS.CognitoIdentity.getCredentialsForIdentity} service operation, which\n * requires either an `IdentityId` or an `IdentityPoolId` (Amazon Cognito\n * Identity Pool ID), which is used to call {AWS.CognitoIdentity.getId} to\n * obtain an `IdentityId`. If the identity or identity pool is not configured in\n * the Amazon Cognito Console to use IAM roles with the appropriate permissions,\n * then additionally a `RoleArn` is required containing the ARN of the IAM trust\n * policy for the Amazon Cognito role that the user will log into. If a `RoleArn`\n * is provided, then this provider gets credentials using the\n * {AWS.STS.assumeRoleWithWebIdentity} service operation, after first getting an\n * Open ID token from {AWS.CognitoIdentity.getOpenIdToken}.\n *\n * In addition, if this credential provider is used to provide authenticated\n * login, the `Logins` map may be set to the tokens provided by the respective\n * identity providers. See {constructor} for an example on creating a credentials\n * object with proper property values.\n *\n * ## Refreshing Credentials from Identity Service\n *\n * In addition to AWS credentials expiring after a given amount of time, the\n * login token from the identity provider will also expire. Once this token\n * expires, it will not be usable to refresh AWS credentials, and another\n * token will be needed. The SDK does not manage refreshing of the token value,\n * but this can be done through a \"refresh token\" supported by most identity\n * providers. Consult the documentation for the identity provider for refreshing\n * tokens. Once the refreshed token is acquired, you should make sure to update\n * this new token in the credentials object's {params} property. The following\n * code will update the WebIdentityToken, assuming you have retrieved an updated\n * token from the identity provider:\n *\n * ```javascript\n * AWS.config.credentials.params.Logins['graph.facebook.com'] = updatedToken;\n * ```\n *\n * Future calls to `credentials.refresh()` will now use the new token.\n *\n * @!attribute params\n * @return [map] the map of params passed to\n * {AWS.CognitoIdentity.getId},\n * {AWS.CognitoIdentity.getOpenIdToken}, and\n * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the\n * `params.WebIdentityToken` property.\n * @!attribute data\n * @return [map] the raw data response from the call to\n * {AWS.CognitoIdentity.getCredentialsForIdentity}, or\n * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get\n * access to other properties from the response.\n * @!attribute identityId\n * @return [String] the Cognito ID returned by the last call to\n * {AWS.CognitoIdentity.getOpenIdToken}. This ID represents the actual\n * final resolved identity ID from Amazon Cognito.\n */\nAWS.CognitoIdentityCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * @api private\n */\n localStorageKey: {\n id: 'aws.cognito.identity-id.',\n providers: 'aws.cognito.identity-providers.'\n },\n\n /**\n * Creates a new credentials object.\n * @example Creating a new credentials object\n * AWS.config.credentials = new AWS.CognitoIdentityCredentials({\n *\n * // either IdentityPoolId or IdentityId is required\n * // See the IdentityPoolId param for AWS.CognitoIdentity.getID (linked below)\n * // See the IdentityId param for AWS.CognitoIdentity.getCredentialsForIdentity\n * // or AWS.CognitoIdentity.getOpenIdToken (linked below)\n * IdentityPoolId: 'us-east-1:1699ebc0-7900-4099-b910-2df94f52a030',\n * IdentityId: 'us-east-1:128d0a74-c82f-4553-916d-90053e4a8b0f'\n *\n * // optional, only necessary when the identity pool is not configured\n * // to use IAM roles in the Amazon Cognito Console\n * // See the RoleArn param for AWS.STS.assumeRoleWithWebIdentity (linked below)\n * RoleArn: 'arn:aws:iam::1234567890:role/MYAPP-CognitoIdentity',\n *\n * // optional tokens, used for authenticated login\n * // See the Logins param for AWS.CognitoIdentity.getID (linked below)\n * Logins: {\n * 'graph.facebook.com': 'FBTOKEN',\n * 'www.amazon.com': 'AMAZONTOKEN',\n * 'accounts.google.com': 'GOOGLETOKEN',\n * 'api.twitter.com': 'TWITTERTOKEN',\n * 'www.digits.com': 'DIGITSTOKEN'\n * },\n *\n * // optional name, defaults to web-identity\n * // See the RoleSessionName param for AWS.STS.assumeRoleWithWebIdentity (linked below)\n * RoleSessionName: 'web',\n *\n * // optional, only necessary when application runs in a browser\n * // and multiple users are signed in at once, used for caching\n * LoginId: 'example@gmail.com'\n *\n * }, {\n * // optionally provide configuration to apply to the underlying service clients\n * // if configuration is not provided, then configuration will be pulled from AWS.config\n *\n * // region should match the region your identity pool is located in\n * region: 'us-east-1',\n *\n * // specify timeout options\n * httpOptions: {\n * timeout: 100\n * }\n * });\n * @see AWS.CognitoIdentity.getId\n * @see AWS.CognitoIdentity.getCredentialsForIdentity\n * @see AWS.STS.assumeRoleWithWebIdentity\n * @see AWS.CognitoIdentity.getOpenIdToken\n * @see AWS.Config\n * @note If a region is not provided in the global AWS.config, or\n * specified in the `clientConfig` to the CognitoIdentityCredentials\n * constructor, you may encounter a 'Missing credentials in config' error\n * when calling making a service call.\n */\n constructor: function CognitoIdentityCredentials(params, clientConfig) {\n AWS.Credentials.call(this);\n this.expired = true;\n this.params = params;\n this.data = null;\n this._identityId = null;\n this._clientConfig = AWS.util.copy(clientConfig || {});\n this.loadCachedId();\n var self = this;\n Object.defineProperty(this, 'identityId', {\n get: function() {\n self.loadCachedId();\n return self._identityId || self.params.IdentityId;\n },\n set: function(identityId) {\n self._identityId = identityId;\n }\n });\n },\n\n /**\n * Refreshes credentials using {AWS.CognitoIdentity.getCredentialsForIdentity},\n * or {AWS.STS.assumeRoleWithWebIdentity}.\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see AWS.Credentials.get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n var self = this;\n self.createClients();\n self.data = null;\n self._identityId = null;\n self.getId(function(err) {\n if (!err) {\n if (!self.params.RoleArn) {\n self.getCredentialsForIdentity(callback);\n } else {\n self.getCredentialsFromSTS(callback);\n }\n } else {\n self.clearIdOnNotAuthorized(err);\n callback(err);\n }\n });\n },\n\n /**\n * Clears the cached Cognito ID associated with the currently configured\n * identity pool ID. Use this to manually invalidate your cache if\n * the identity pool ID was deleted.\n */\n clearCachedId: function clearCache() {\n this._identityId = null;\n delete this.params.IdentityId;\n\n var poolId = this.params.IdentityPoolId;\n var loginId = this.params.LoginId || '';\n delete this.storage[this.localStorageKey.id + poolId + loginId];\n delete this.storage[this.localStorageKey.providers + poolId + loginId];\n },\n\n /**\n * @api private\n */\n clearIdOnNotAuthorized: function clearIdOnNotAuthorized(err) {\n var self = this;\n if (err.code == 'NotAuthorizedException') {\n self.clearCachedId();\n }\n },\n\n /**\n * Retrieves a Cognito ID, loading from cache if it was already retrieved\n * on this device.\n *\n * @callback callback function(err, identityId)\n * @param err [Error, null] an error object if the call failed or null if\n * it succeeded.\n * @param identityId [String, null] if successful, the callback will return\n * the Cognito ID.\n * @note If not loaded explicitly, the Cognito ID is loaded and stored in\n * localStorage in the browser environment of a device.\n * @api private\n */\n getId: function getId(callback) {\n var self = this;\n if (typeof self.params.IdentityId === 'string') {\n return callback(null, self.params.IdentityId);\n }\n\n self.cognito.getId(function(err, data) {\n if (!err && data.IdentityId) {\n self.params.IdentityId = data.IdentityId;\n callback(null, data.IdentityId);\n } else {\n callback(err);\n }\n });\n },\n\n\n /**\n * @api private\n */\n loadCredentials: function loadCredentials(data, credentials) {\n if (!data || !credentials) return;\n credentials.expired = false;\n credentials.accessKeyId = data.Credentials.AccessKeyId;\n credentials.secretAccessKey = data.Credentials.SecretKey;\n credentials.sessionToken = data.Credentials.SessionToken;\n credentials.expireTime = data.Credentials.Expiration;\n },\n\n /**\n * @api private\n */\n getCredentialsForIdentity: function getCredentialsForIdentity(callback) {\n var self = this;\n self.cognito.getCredentialsForIdentity(function(err, data) {\n if (!err) {\n self.cacheId(data);\n self.data = data;\n self.loadCredentials(self.data, self);\n } else {\n self.clearIdOnNotAuthorized(err);\n }\n callback(err);\n });\n },\n\n /**\n * @api private\n */\n getCredentialsFromSTS: function getCredentialsFromSTS(callback) {\n var self = this;\n self.cognito.getOpenIdToken(function(err, data) {\n if (!err) {\n self.cacheId(data);\n self.params.WebIdentityToken = data.Token;\n self.webIdentityCredentials.refresh(function(webErr) {\n if (!webErr) {\n self.data = self.webIdentityCredentials.data;\n self.sts.credentialsFrom(self.data, self);\n }\n callback(webErr);\n });\n } else {\n self.clearIdOnNotAuthorized(err);\n callback(err);\n }\n });\n },\n\n /**\n * @api private\n */\n loadCachedId: function loadCachedId() {\n var self = this;\n\n // in the browser we source default IdentityId from localStorage\n if (AWS.util.isBrowser() && !self.params.IdentityId) {\n var id = self.getStorage('id');\n if (id && self.params.Logins) {\n var actualProviders = Object.keys(self.params.Logins);\n var cachedProviders =\n (self.getStorage('providers') || '').split(',');\n\n // only load ID if at least one provider used this ID before\n var intersect = cachedProviders.filter(function(n) {\n return actualProviders.indexOf(n) !== -1;\n });\n if (intersect.length !== 0) {\n self.params.IdentityId = id;\n }\n } else if (id) {\n self.params.IdentityId = id;\n }\n }\n },\n\n /**\n * @api private\n */\n createClients: function() {\n var clientConfig = this._clientConfig;\n this.webIdentityCredentials = this.webIdentityCredentials ||\n new AWS.WebIdentityCredentials(this.params, clientConfig);\n if (!this.cognito) {\n var cognitoConfig = AWS.util.merge({}, clientConfig);\n cognitoConfig.params = this.params;\n this.cognito = new CognitoIdentity(cognitoConfig);\n }\n this.sts = this.sts || new STS(clientConfig);\n },\n\n /**\n * @api private\n */\n cacheId: function cacheId(data) {\n this._identityId = data.IdentityId;\n this.params.IdentityId = this._identityId;\n\n // cache this IdentityId in browser localStorage if possible\n if (AWS.util.isBrowser()) {\n this.setStorage('id', data.IdentityId);\n\n if (this.params.Logins) {\n this.setStorage('providers', Object.keys(this.params.Logins).join(','));\n }\n }\n },\n\n /**\n * @api private\n */\n getStorage: function getStorage(key) {\n return this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')];\n },\n\n /**\n * @api private\n */\n setStorage: function setStorage(key, val) {\n try {\n this.storage[this.localStorageKey[key] + this.params.IdentityPoolId + (this.params.LoginId || '')] = val;\n } catch (_) {}\n },\n\n /**\n * @api private\n */\n storage: (function() {\n try {\n var storage = AWS.util.isBrowser() && window.localStorage !== null && typeof window.localStorage === 'object' ?\n window.localStorage : {};\n\n // Test set/remove which would throw an error in Safari's private browsing\n storage['aws.test-storage'] = 'foobar';\n delete storage['aws.test-storage'];\n\n return storage;\n } catch (_) {\n return {};\n }\n })()\n});\n","var AWS = require('../core');\n\n/**\n * Creates a credential provider chain that searches for AWS credentials\n * in a list of credential providers specified by the {providers} property.\n *\n * By default, the chain will use the {defaultProviders} to resolve credentials.\n * These providers will look in the environment using the\n * {AWS.EnvironmentCredentials} class with the 'AWS' and 'AMAZON' prefixes.\n *\n * ## Setting Providers\n *\n * Each provider in the {providers} list should be a function that returns\n * a {AWS.Credentials} object, or a hardcoded credentials object. The function\n * form allows for delayed execution of the credential construction.\n *\n * ## Resolving Credentials from a Chain\n *\n * Call {resolve} to return the first valid credential object that can be\n * loaded by the provider chain.\n *\n * For example, to resolve a chain with a custom provider that checks a file\n * on disk after the set of {defaultProviders}:\n *\n * ```javascript\n * var diskProvider = new AWS.FileSystemCredentials('./creds.json');\n * var chain = new AWS.CredentialProviderChain();\n * chain.providers.push(diskProvider);\n * chain.resolve();\n * ```\n *\n * The above code will return the `diskProvider` object if the\n * file contains credentials and the `defaultProviders` do not contain\n * any credential settings.\n *\n * @!attribute providers\n * @return [Array]\n * a list of credentials objects or functions that return credentials\n * objects. If the provider is a function, the function will be\n * executed lazily when the provider needs to be checked for valid\n * credentials. By default, this object will be set to the\n * {defaultProviders}.\n * @see defaultProviders\n */\nAWS.CredentialProviderChain = AWS.util.inherit(AWS.Credentials, {\n\n /**\n * Creates a new CredentialProviderChain with a default set of providers\n * specified by {defaultProviders}.\n */\n constructor: function CredentialProviderChain(providers) {\n if (providers) {\n this.providers = providers;\n } else {\n this.providers = AWS.CredentialProviderChain.defaultProviders.slice(0);\n }\n this.resolveCallbacks = [];\n },\n\n /**\n * @!method resolvePromise()\n * Returns a 'thenable' promise.\n * Resolves the provider chain by searching for the first set of\n * credentials in {providers}.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function(credentials)\n * Called if the promise is fulfilled and the provider resolves the chain\n * to a credentials object\n * @param credentials [AWS.Credentials] the credentials object resolved\n * by the provider chain.\n * @callback rejectedCallback function(error)\n * Called if the promise is rejected.\n * @param err [Error] the error object returned if no credentials are found.\n * @return [Promise] A promise that represents the state of the `resolve` method call.\n * @example Calling the `resolvePromise` method.\n * var promise = chain.resolvePromise();\n * promise.then(function(credentials) { ... }, function(err) { ... });\n */\n\n /**\n * Resolves the provider chain by searching for the first set of\n * credentials in {providers}.\n *\n * @callback callback function(err, credentials)\n * Called when the provider resolves the chain to a credentials object\n * or null if no credentials can be found.\n *\n * @param err [Error] the error object returned if no credentials are\n * found.\n * @param credentials [AWS.Credentials] the credentials object resolved\n * by the provider chain.\n * @return [AWS.CredentialProviderChain] the provider, for chaining.\n */\n resolve: function resolve(callback) {\n var self = this;\n if (self.providers.length === 0) {\n callback(new Error('No providers'));\n return self;\n }\n\n if (self.resolveCallbacks.push(callback) === 1) {\n var index = 0;\n var providers = self.providers.slice(0);\n\n function resolveNext(err, creds) {\n if ((!err && creds) || index === providers.length) {\n AWS.util.arrayEach(self.resolveCallbacks, function (callback) {\n callback(err, creds);\n });\n self.resolveCallbacks.length = 0;\n return;\n }\n\n var provider = providers[index++];\n if (typeof provider === 'function') {\n creds = provider.call();\n } else {\n creds = provider;\n }\n\n if (creds.get) {\n creds.get(function (getErr) {\n resolveNext(getErr, getErr ? null : creds);\n });\n } else {\n resolveNext(null, creds);\n }\n }\n\n resolveNext();\n }\n\n return self;\n }\n});\n\n/**\n * The default set of providers used by a vanilla CredentialProviderChain.\n *\n * In the browser:\n *\n * ```javascript\n * AWS.CredentialProviderChain.defaultProviders = []\n * ```\n *\n * In Node.js:\n *\n * ```javascript\n * AWS.CredentialProviderChain.defaultProviders = [\n * function () { return new AWS.EnvironmentCredentials('AWS'); },\n * function () { return new AWS.EnvironmentCredentials('AMAZON'); },\n * function () { return new AWS.SsoCredentials(); },\n * function () { return new AWS.SharedIniFileCredentials(); },\n * function () { return new AWS.ECSCredentials(); },\n * function () { return new AWS.ProcessCredentials(); },\n * function () { return new AWS.TokenFileWebIdentityCredentials(); },\n * function () { return new AWS.EC2MetadataCredentials() }\n * ]\n * ```\n */\nAWS.CredentialProviderChain.defaultProviders = [];\n\n/**\n * @api private\n */\nAWS.CredentialProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.CredentialProviderChain.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.resolvePromise;\n};\n\nAWS.util.addPromises(AWS.CredentialProviderChain);\n","var AWS = require('../core');\nrequire('../metadata_service');\n\n/**\n * Represents credentials received from the metadata service on an EC2 instance.\n *\n * By default, this class will connect to the metadata service using\n * {AWS.MetadataService} and attempt to load any available credentials. If it\n * can connect, and credentials are available, these will be used with zero\n * configuration.\n *\n * This credentials class will by default timeout after 1 second of inactivity\n * and retry 3 times.\n * If your requests to the EC2 metadata service are timing out, you can increase\n * these values by configuring them directly:\n *\n * ```javascript\n * AWS.config.credentials = new AWS.EC2MetadataCredentials({\n * httpOptions: { timeout: 5000 }, // 5 second timeout\n * maxRetries: 10, // retry 10 times\n * retryDelayOptions: { base: 200 }, // see AWS.Config for information\n * logger: console // see AWS.Config for information\n * });\n * ```\n *\n * If your requests are timing out in connecting to the metadata service, such\n * as when testing on a development machine, you can use the connectTimeout\n * option, specified in milliseconds, which also defaults to 1 second.\n *\n * If the requests failed or returns expired credentials, it will\n * extend the expiration of current credential, with a warning message. For more\n * information, please go to:\n * https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html\n *\n * @!attribute originalExpiration\n * @return [Date] The optional original expiration of the current credential.\n * In case of AWS outage, the EC2 metadata will extend expiration of the\n * existing credential.\n *\n * @see AWS.Config.retryDelayOptions\n * @see AWS.Config.logger\n *\n * @!macro nobrowser\n */\nAWS.EC2MetadataCredentials = AWS.util.inherit(AWS.Credentials, {\n constructor: function EC2MetadataCredentials(options) {\n AWS.Credentials.call(this);\n\n options = options ? AWS.util.copy(options) : {};\n options = AWS.util.merge(\n {maxRetries: this.defaultMaxRetries}, options);\n if (!options.httpOptions) options.httpOptions = {};\n options.httpOptions = AWS.util.merge(\n {timeout: this.defaultTimeout,\n connectTimeout: this.defaultConnectTimeout},\n options.httpOptions);\n\n this.metadataService = new AWS.MetadataService(options);\n this.logger = options.logger || AWS.config && AWS.config.logger;\n },\n\n /**\n * @api private\n */\n defaultTimeout: 1000,\n\n /**\n * @api private\n */\n defaultConnectTimeout: 1000,\n\n /**\n * @api private\n */\n defaultMaxRetries: 3,\n\n /**\n * The original expiration of the current credential. In case of AWS\n * outage, the EC2 metadata will extend expiration of the existing\n * credential.\n */\n originalExpiration: undefined,\n\n /**\n * Loads the credentials from the instance metadata service\n *\n * @callback callback function(err)\n * Called when the instance metadata service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n var self = this;\n self.metadataService.loadCredentials(function(err, creds) {\n if (err) {\n if (self.hasLoadedCredentials()) {\n self.extendExpirationIfExpired();\n callback();\n } else {\n callback(err);\n }\n } else {\n self.setCredentials(creds);\n self.extendExpirationIfExpired();\n callback();\n }\n });\n },\n\n /**\n * Whether this credential has been loaded.\n * @api private\n */\n hasLoadedCredentials: function hasLoadedCredentials() {\n return this.AccessKeyId && this.secretAccessKey;\n },\n\n /**\n * if expired, extend the expiration by 15 minutes base plus a jitter of 5\n * minutes range.\n * @api private\n */\n extendExpirationIfExpired: function extendExpirationIfExpired() {\n if (this.needsRefresh()) {\n this.originalExpiration = this.originalExpiration || this.expireTime;\n this.expired = false;\n var nextTimeout = 15 * 60 + Math.floor(Math.random() * 5 * 60);\n var currentTime = AWS.util.date.getDate().getTime();\n this.expireTime = new Date(currentTime + nextTimeout * 1000);\n // TODO: add doc link;\n this.logger.warn('Attempting credential expiration extension due to a '\n + 'credential service availability issue. A refresh of these '\n + 'credentials will be attempted again at ' + this.expireTime\n + '\\nFor more information, please visit: https://docs.aws.amazon.com/sdkref/latest/guide/feature-static-credentials.html');\n }\n },\n\n /**\n * Update the credential with new credential responded from EC2 metadata\n * service.\n * @api private\n */\n setCredentials: function setCredentials(creds) {\n var currentTime = AWS.util.date.getDate().getTime();\n var expireTime = new Date(creds.Expiration);\n this.expired = currentTime >= expireTime ? true : false;\n this.metadata = creds;\n this.accessKeyId = creds.AccessKeyId;\n this.secretAccessKey = creds.SecretAccessKey;\n this.sessionToken = creds.Token;\n this.expireTime = expireTime;\n }\n});\n","var AWS = require('../core');\n\n/**\n * Represents credentials received from relative URI specified in the ECS container.\n *\n * This class will request refreshable credentials from the relative URI\n * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the\n * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials\n * are returned in the response, these will be used with zero configuration.\n *\n * This credentials class will by default timeout after 1 second of inactivity\n * and retry 3 times.\n * If your requests to the relative URI are timing out, you can increase\n * the value by configuring them directly:\n *\n * ```javascript\n * AWS.config.credentials = new AWS.ECSCredentials({\n * httpOptions: { timeout: 5000 }, // 5 second timeout\n * maxRetries: 10, // retry 10 times\n * retryDelayOptions: { base: 200 } // see AWS.Config for information\n * });\n * ```\n *\n * @see AWS.Config.retryDelayOptions\n *\n * @!macro nobrowser\n */\nAWS.ECSCredentials = AWS.RemoteCredentials;\n","var AWS = require('../core');\n\n/**\n * Represents credentials from the environment.\n *\n * By default, this class will look for the matching environment variables\n * prefixed by a given {envPrefix}. The un-prefixed environment variable names\n * for each credential value is listed below:\n *\n * ```javascript\n * accessKeyId: ACCESS_KEY_ID\n * secretAccessKey: SECRET_ACCESS_KEY\n * sessionToken: SESSION_TOKEN\n * ```\n *\n * With the default prefix of 'AWS', the environment variables would be:\n *\n * AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN\n *\n * @!attribute envPrefix\n * @readonly\n * @return [String] the prefix for the environment variable names excluding\n * the separating underscore ('_').\n */\nAWS.EnvironmentCredentials = AWS.util.inherit(AWS.Credentials, {\n\n /**\n * Creates a new EnvironmentCredentials class with a given variable\n * prefix {envPrefix}. For example, to load credentials using the 'AWS'\n * prefix:\n *\n * ```javascript\n * var creds = new AWS.EnvironmentCredentials('AWS');\n * creds.accessKeyId == 'AKID' // from AWS_ACCESS_KEY_ID env var\n * ```\n *\n * @param envPrefix [String] the prefix to use (e.g., 'AWS') for environment\n * variables. Do not include the separating underscore.\n */\n constructor: function EnvironmentCredentials(envPrefix) {\n AWS.Credentials.call(this);\n this.envPrefix = envPrefix;\n this.get(function() {});\n },\n\n /**\n * Loads credentials from the environment using the prefixed\n * environment variables.\n *\n * @callback callback function(err)\n * Called after the (prefixed) ACCESS_KEY_ID, SECRET_ACCESS_KEY, and\n * SESSION_TOKEN environment variables are read. When this callback is\n * called with no error, it means that the credentials information has\n * been loaded into the object (as the `accessKeyId`, `secretAccessKey`,\n * and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n if (!callback) callback = AWS.util.fn.callback;\n\n if (!process || !process.env) {\n callback(AWS.util.error(\n new Error('No process info or environment variables available'),\n { code: 'EnvironmentCredentialsProviderFailure' }\n ));\n return;\n }\n\n var keys = ['ACCESS_KEY_ID', 'SECRET_ACCESS_KEY', 'SESSION_TOKEN'];\n var values = [];\n\n for (var i = 0; i < keys.length; i++) {\n var prefix = '';\n if (this.envPrefix) prefix = this.envPrefix + '_';\n values[i] = process.env[prefix + keys[i]];\n if (!values[i] && keys[i] !== 'SESSION_TOKEN') {\n callback(AWS.util.error(\n new Error('Variable ' + prefix + keys[i] + ' not set.'),\n { code: 'EnvironmentCredentialsProviderFailure' }\n ));\n return;\n }\n }\n\n this.expired = false;\n AWS.Credentials.apply(this, values);\n callback();\n }\n\n});\n","var AWS = require('../core');\n\n/**\n * Represents credentials from a JSON file on disk.\n * If the credentials expire, the SDK can {refresh} the credentials\n * from the file.\n *\n * The format of the file should be similar to the options passed to\n * {AWS.Config}:\n *\n * ```javascript\n * {accessKeyId: 'akid', secretAccessKey: 'secret', sessionToken: 'optional'}\n * ```\n *\n * @example Loading credentials from disk\n * var creds = new AWS.FileSystemCredentials('./configuration.json');\n * creds.accessKeyId == 'AKID'\n *\n * @!attribute filename\n * @readonly\n * @return [String] the path to the JSON file on disk containing the\n * credentials.\n * @!macro nobrowser\n */\nAWS.FileSystemCredentials = AWS.util.inherit(AWS.Credentials, {\n\n /**\n * @overload AWS.FileSystemCredentials(filename)\n * Creates a new FileSystemCredentials object from a filename\n *\n * @param filename [String] the path on disk to the JSON file to load.\n */\n constructor: function FileSystemCredentials(filename) {\n AWS.Credentials.call(this);\n this.filename = filename;\n this.get(function() {});\n },\n\n /**\n * Loads the credentials from the {filename} on disk.\n *\n * @callback callback function(err)\n * Called after the JSON file on disk is read and parsed. When this callback\n * is called with no error, it means that the credentials information\n * has been loaded into the object (as the `accessKeyId`, `secretAccessKey`,\n * and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n if (!callback) callback = AWS.util.fn.callback;\n try {\n var creds = JSON.parse(AWS.util.readFileSync(this.filename));\n AWS.Credentials.call(this, creds);\n if (!this.accessKeyId || !this.secretAccessKey) {\n throw AWS.util.error(\n new Error('Credentials not set in ' + this.filename),\n { code: 'FileSystemCredentialsProviderFailure' }\n );\n }\n this.expired = false;\n callback();\n } catch (err) {\n callback(err);\n }\n }\n\n});\n","var AWS = require('../core');\nvar proc = require('child_process');\nvar iniLoader = AWS.util.iniLoader;\n\n/**\n * Represents credentials loaded from shared credentials file\n * (defaulting to ~/.aws/credentials or defined by the\n * `AWS_SHARED_CREDENTIALS_FILE` environment variable).\n *\n * ## Using process credentials\n *\n * The credentials file can specify a credential provider that executes\n * a given process and attempts to read its stdout to recieve a JSON payload\n * containing the credentials:\n *\n * [default]\n * credential_process = /usr/bin/credential_proc\n *\n * Automatically handles refreshing credentials if an Expiration time is\n * provided in the credentials payload. Credentials supplied in the same profile\n * will take precedence over the credential_process.\n *\n * Sourcing credentials from an external process can potentially be dangerous,\n * so proceed with caution. Other credential providers should be preferred if\n * at all possible. If using this option, you should make sure that the shared\n * credentials file is as locked down as possible using security best practices\n * for your operating system.\n *\n * ## Using custom profiles\n *\n * The SDK supports loading credentials for separate profiles. This can be done\n * in two ways:\n *\n * 1. Set the `AWS_PROFILE` environment variable in your process prior to\n * loading the SDK.\n * 2. Directly load the AWS.ProcessCredentials provider:\n *\n * ```javascript\n * var creds = new AWS.ProcessCredentials({profile: 'myprofile'});\n * AWS.config.credentials = creds;\n * ```\n *\n * @!macro nobrowser\n */\nAWS.ProcessCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new ProcessCredentials object.\n *\n * @param options [map] a set of options\n * @option options profile [String] (AWS_PROFILE env var or 'default')\n * the name of the profile to load.\n * @option options filename [String] ('~/.aws/credentials' or defined by\n * AWS_SHARED_CREDENTIALS_FILE process env var)\n * the filename to use when loading credentials.\n * @option options callback [Function] (err) Credentials are eagerly loaded\n * by the constructor. When the callback is called with no error, the\n * credentials have been loaded successfully.\n */\n constructor: function ProcessCredentials(options) {\n AWS.Credentials.call(this);\n\n options = options || {};\n\n this.filename = options.filename;\n this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;\n this.get(options.callback || AWS.util.fn.noop);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n try {\n var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename);\n var profile = profiles[this.profile] || {};\n\n if (Object.keys(profile).length === 0) {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' not found'),\n { code: 'ProcessCredentialsProviderFailure' }\n );\n }\n\n if (profile['credential_process']) {\n this.loadViaCredentialProcess(profile, function(err, data) {\n if (err) {\n callback(err, null);\n } else {\n self.expired = false;\n self.accessKeyId = data.AccessKeyId;\n self.secretAccessKey = data.SecretAccessKey;\n self.sessionToken = data.SessionToken;\n if (data.Expiration) {\n self.expireTime = new Date(data.Expiration);\n }\n callback(null);\n }\n });\n } else {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' did not include credential process'),\n { code: 'ProcessCredentialsProviderFailure' }\n );\n }\n } catch (err) {\n callback(err);\n }\n },\n\n /**\n * Executes the credential_process and retrieves\n * credentials from the output\n * @api private\n * @param profile [map] credentials profile\n * @throws ProcessCredentialsProviderFailure\n */\n loadViaCredentialProcess: function loadViaCredentialProcess(profile, callback) {\n proc.exec(profile['credential_process'], { env: process.env }, function(err, stdOut, stdErr) {\n if (err) {\n callback(AWS.util.error(\n new Error('credential_process returned error'),\n { code: 'ProcessCredentialsProviderFailure'}\n ), null);\n } else {\n try {\n var credData = JSON.parse(stdOut);\n if (credData.Expiration) {\n var currentTime = AWS.util.date.getDate();\n var expireTime = new Date(credData.Expiration);\n if (expireTime < currentTime) {\n throw Error('credential_process returned expired credentials');\n }\n }\n\n if (credData.Version !== 1) {\n throw Error('credential_process does not return Version == 1');\n }\n callback(null, credData);\n } catch (err) {\n callback(AWS.util.error(\n new Error(err.message),\n { code: 'ProcessCredentialsProviderFailure'}\n ), null);\n }\n }\n });\n },\n\n /**\n * Loads the credentials from the credential process\n *\n * @callback callback function(err)\n * Called after the credential process has been executed. When this\n * callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n iniLoader.clearCachedFiles();\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n }\n});\n","var AWS = require('../core'),\n ENV_RELATIVE_URI = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI',\n ENV_FULL_URI = 'AWS_CONTAINER_CREDENTIALS_FULL_URI',\n ENV_AUTH_TOKEN = 'AWS_CONTAINER_AUTHORIZATION_TOKEN',\n FULL_URI_UNRESTRICTED_PROTOCOLS = ['https:'],\n FULL_URI_ALLOWED_PROTOCOLS = ['http:', 'https:'],\n FULL_URI_ALLOWED_HOSTNAMES = ['localhost', '127.0.0.1'],\n RELATIVE_URI_HOST = '169.254.170.2';\n\n/**\n * Represents credentials received from specified URI.\n *\n * This class will request refreshable credentials from the relative URI\n * specified by the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI or the\n * AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable. If valid credentials\n * are returned in the response, these will be used with zero configuration.\n *\n * This credentials class will by default timeout after 1 second of inactivity\n * and retry 3 times.\n * If your requests to the relative URI are timing out, you can increase\n * the value by configuring them directly:\n *\n * ```javascript\n * AWS.config.credentials = new AWS.RemoteCredentials({\n * httpOptions: { timeout: 5000 }, // 5 second timeout\n * maxRetries: 10, // retry 10 times\n * retryDelayOptions: { base: 200 } // see AWS.Config for information\n * });\n * ```\n *\n * @see AWS.Config.retryDelayOptions\n *\n * @!macro nobrowser\n */\nAWS.RemoteCredentials = AWS.util.inherit(AWS.Credentials, {\n constructor: function RemoteCredentials(options) {\n AWS.Credentials.call(this);\n options = options ? AWS.util.copy(options) : {};\n if (!options.httpOptions) options.httpOptions = {};\n options.httpOptions = AWS.util.merge(\n this.httpOptions, options.httpOptions);\n AWS.util.update(this, options);\n },\n\n /**\n * @api private\n */\n httpOptions: { timeout: 1000 },\n\n /**\n * @api private\n */\n maxRetries: 3,\n\n /**\n * @api private\n */\n isConfiguredForEcsCredentials: function isConfiguredForEcsCredentials() {\n return Boolean(\n process &&\n process.env &&\n (process.env[ENV_RELATIVE_URI] || process.env[ENV_FULL_URI])\n );\n },\n\n /**\n * @api private\n */\n getECSFullUri: function getECSFullUri() {\n if (process && process.env) {\n var relative = process.env[ENV_RELATIVE_URI],\n full = process.env[ENV_FULL_URI];\n if (relative) {\n return 'http://' + RELATIVE_URI_HOST + relative;\n } else if (full) {\n var parsed = AWS.util.urlParse(full);\n if (FULL_URI_ALLOWED_PROTOCOLS.indexOf(parsed.protocol) < 0) {\n throw AWS.util.error(\n new Error('Unsupported protocol: AWS.RemoteCredentials supports '\n + FULL_URI_ALLOWED_PROTOCOLS.join(',') + ' only; '\n + parsed.protocol + ' requested.'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n\n if (FULL_URI_UNRESTRICTED_PROTOCOLS.indexOf(parsed.protocol) < 0 &&\n FULL_URI_ALLOWED_HOSTNAMES.indexOf(parsed.hostname) < 0) {\n throw AWS.util.error(\n new Error('Unsupported hostname: AWS.RemoteCredentials only supports '\n + FULL_URI_ALLOWED_HOSTNAMES.join(',') + ' for ' + parsed.protocol + '; '\n + parsed.protocol + '//' + parsed.hostname + ' requested.'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n\n return full;\n } else {\n throw AWS.util.error(\n new Error('Variable ' + ENV_RELATIVE_URI + ' or ' + ENV_FULL_URI +\n ' must be set to use AWS.RemoteCredentials.'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n } else {\n throw AWS.util.error(\n new Error('No process info available'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n },\n\n /**\n * @api private\n */\n getECSAuthToken: function getECSAuthToken() {\n if (process && process.env && process.env[ENV_FULL_URI]) {\n return process.env[ENV_AUTH_TOKEN];\n }\n },\n\n /**\n * @api private\n */\n credsFormatIsValid: function credsFormatIsValid(credData) {\n return (!!credData.accessKeyId && !!credData.secretAccessKey &&\n !!credData.sessionToken && !!credData.expireTime);\n },\n\n /**\n * @api private\n */\n formatCreds: function formatCreds(credData) {\n if (!!credData.credentials) {\n credData = credData.credentials;\n }\n\n return {\n expired: false,\n accessKeyId: credData.accessKeyId || credData.AccessKeyId,\n secretAccessKey: credData.secretAccessKey || credData.SecretAccessKey,\n sessionToken: credData.sessionToken || credData.Token,\n expireTime: new Date(credData.expiration || credData.Expiration)\n };\n },\n\n /**\n * @api private\n */\n request: function request(url, callback) {\n var httpRequest = new AWS.HttpRequest(url);\n httpRequest.method = 'GET';\n httpRequest.headers.Accept = 'application/json';\n var token = this.getECSAuthToken();\n if (token) {\n httpRequest.headers.Authorization = token;\n }\n AWS.util.handleRequestWithRetries(httpRequest, this, callback);\n },\n\n /**\n * Loads the credentials from the relative URI specified by container\n *\n * @callback callback function(err)\n * Called when the request to the relative URI responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, `sessionToken`, and `expireTime` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n var fullUri;\n\n try {\n fullUri = this.getECSFullUri();\n } catch (err) {\n callback(err);\n return;\n }\n\n this.request(fullUri, function(err, data) {\n if (!err) {\n try {\n data = JSON.parse(data);\n var creds = self.formatCreds(data);\n if (!self.credsFormatIsValid(creds)) {\n throw AWS.util.error(\n new Error('Response data is not in valid format'),\n { code: 'ECSCredentialsProviderFailure' }\n );\n }\n AWS.util.update(self, creds);\n } catch (dataError) {\n err = dataError;\n }\n }\n callback(err, creds);\n });\n }\n});\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents credentials retrieved from STS SAML support.\n *\n * By default this provider gets credentials using the\n * {AWS.STS.assumeRoleWithSAML} service operation. This operation\n * requires a `RoleArn` containing the ARN of the IAM trust policy for the\n * application for which credentials will be given, as well as a `PrincipalArn`\n * representing the ARN for the SAML identity provider. In addition, the\n * `SAMLAssertion` must be set to the token provided by the identity\n * provider. See {constructor} for an example on creating a credentials\n * object with proper `RoleArn`, `PrincipalArn`, and `SAMLAssertion` values.\n *\n * ## Refreshing Credentials from Identity Service\n *\n * In addition to AWS credentials expiring after a given amount of time, the\n * login token from the identity provider will also expire. Once this token\n * expires, it will not be usable to refresh AWS credentials, and another\n * token will be needed. The SDK does not manage refreshing of the token value,\n * but this can be done through a \"refresh token\" supported by most identity\n * providers. Consult the documentation for the identity provider for refreshing\n * tokens. Once the refreshed token is acquired, you should make sure to update\n * this new token in the credentials object's {params} property. The following\n * code will update the SAMLAssertion, assuming you have retrieved an updated\n * token from the identity provider:\n *\n * ```javascript\n * AWS.config.credentials.params.SAMLAssertion = updatedToken;\n * ```\n *\n * Future calls to `credentials.refresh()` will now use the new token.\n *\n * @!attribute params\n * @return [map] the map of params passed to\n * {AWS.STS.assumeRoleWithSAML}. To update the token, set the\n * `params.SAMLAssertion` property.\n */\nAWS.SAMLCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new credentials object.\n * @param (see AWS.STS.assumeRoleWithSAML)\n * @example Creating a new credentials object\n * AWS.config.credentials = new AWS.SAMLCredentials({\n * RoleArn: 'arn:aws:iam::1234567890:role/SAMLRole',\n * PrincipalArn: 'arn:aws:iam::1234567890:role/SAMLPrincipal',\n * SAMLAssertion: 'base64-token', // base64-encoded token from IdP\n * });\n * @see AWS.STS.assumeRoleWithSAML\n */\n constructor: function SAMLCredentials(params) {\n AWS.Credentials.call(this);\n this.expired = true;\n this.params = params;\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRoleWithSAML}\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n self.createClients();\n self.service.assumeRoleWithSAML(function (err, data) {\n if (!err) {\n self.service.credentialsFrom(data, self);\n }\n callback(err);\n });\n },\n\n /**\n * @api private\n */\n createClients: function() {\n this.service = this.service || new STS({params: this.params});\n }\n\n});\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\nvar iniLoader = AWS.util.iniLoader;\n\nvar ASSUME_ROLE_DEFAULT_REGION = 'us-east-1';\n\n/**\n * Represents credentials loaded from shared credentials file\n * (defaulting to ~/.aws/credentials or defined by the\n * `AWS_SHARED_CREDENTIALS_FILE` environment variable).\n *\n * ## Using the shared credentials file\n *\n * This provider is checked by default in the Node.js environment. To use the\n * credentials file provider, simply add your access and secret keys to the\n * ~/.aws/credentials file in the following format:\n *\n * [default]\n * aws_access_key_id = AKID...\n * aws_secret_access_key = YOUR_SECRET_KEY\n *\n * ## Using custom profiles\n *\n * The SDK supports loading credentials for separate profiles. This can be done\n * in two ways:\n *\n * 1. Set the `AWS_PROFILE` environment variable in your process prior to\n * loading the SDK.\n * 2. Directly load the AWS.SharedIniFileCredentials provider:\n *\n * ```javascript\n * var creds = new AWS.SharedIniFileCredentials({profile: 'myprofile'});\n * AWS.config.credentials = creds;\n * ```\n *\n * @!macro nobrowser\n */\nAWS.SharedIniFileCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new SharedIniFileCredentials object.\n *\n * @param options [map] a set of options\n * @option options profile [String] (AWS_PROFILE env var or 'default')\n * the name of the profile to load.\n * @option options filename [String] ('~/.aws/credentials' or defined by\n * AWS_SHARED_CREDENTIALS_FILE process env var)\n * the filename to use when loading credentials.\n * @option options disableAssumeRole [Boolean] (false) True to disable\n * support for profiles that assume an IAM role. If true, and an assume\n * role profile is selected, an error is raised.\n * @option options preferStaticCredentials [Boolean] (false) True to\n * prefer static credentials to role_arn if both are present.\n * @option options tokenCodeFn [Function] (null) Function to provide\n * STS Assume Role TokenCode, if mfa_serial is provided for profile in ini\n * file. Function is called with value of mfa_serial and callback, and\n * should provide the TokenCode or an error to the callback in the format\n * callback(err, token)\n * @option options callback [Function] (err) Credentials are eagerly loaded\n * by the constructor. When the callback is called with no error, the\n * credentials have been loaded successfully.\n * @option options httpOptions [map] A set of options to pass to the low-level\n * HTTP request. Currently supported options are:\n * * **proxy** [String] — the URL to proxy requests through\n * * **agent** [http.Agent, https.Agent] — the Agent object to perform\n * HTTP requests with. Used for connection pooling. Defaults to the global\n * agent (`http.globalAgent`) for non-SSL connections. Note that for\n * SSL connections, a special Agent object is used in order to enable\n * peer certificate verification. This feature is only available in the\n * Node.js environment.\n * * **connectTimeout** [Integer] — Sets the socket to timeout after\n * failing to establish a connection with the server after\n * `connectTimeout` milliseconds. This timeout has no effect once a socket\n * connection has been established.\n * * **timeout** [Integer] — The number of milliseconds a request can\n * take before automatically being terminated.\n * Defaults to two minutes (120000).\n */\n constructor: function SharedIniFileCredentials(options) {\n AWS.Credentials.call(this);\n\n options = options || {};\n\n this.filename = options.filename;\n this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;\n this.disableAssumeRole = Boolean(options.disableAssumeRole);\n this.preferStaticCredentials = Boolean(options.preferStaticCredentials);\n this.tokenCodeFn = options.tokenCodeFn || null;\n this.httpOptions = options.httpOptions || null;\n this.get(options.callback || AWS.util.fn.noop);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n try {\n var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename);\n var profile = profiles[this.profile] || {};\n\n if (Object.keys(profile).length === 0) {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' not found'),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n\n /*\n In the CLI, the presence of both a role_arn and static credentials have\n different meanings depending on how many profiles have been visited. For\n the first profile processed, role_arn takes precedence over any static\n credentials, but for all subsequent profiles, static credentials are\n used if present, and only in their absence will the profile's\n source_profile and role_arn keys be used to load another set of\n credentials. This var is intended to yield compatible behaviour in this\n sdk.\n */\n var preferStaticCredentialsToRoleArn = Boolean(\n this.preferStaticCredentials\n && profile['aws_access_key_id']\n && profile['aws_secret_access_key']\n );\n\n if (profile['role_arn'] && !preferStaticCredentialsToRoleArn) {\n this.loadRoleProfile(profiles, profile, function(err, data) {\n if (err) {\n callback(err);\n } else {\n self.expired = false;\n self.accessKeyId = data.Credentials.AccessKeyId;\n self.secretAccessKey = data.Credentials.SecretAccessKey;\n self.sessionToken = data.Credentials.SessionToken;\n self.expireTime = data.Credentials.Expiration;\n callback(null);\n }\n });\n return;\n }\n\n this.accessKeyId = profile['aws_access_key_id'];\n this.secretAccessKey = profile['aws_secret_access_key'];\n this.sessionToken = profile['aws_session_token'];\n\n if (!this.accessKeyId || !this.secretAccessKey) {\n throw AWS.util.error(\n new Error('Credentials not set for profile ' + this.profile),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n this.expired = false;\n callback(null);\n } catch (err) {\n callback(err);\n }\n },\n\n /**\n * Loads the credentials from the shared credentials file\n *\n * @callback callback function(err)\n * Called after the shared INI file on disk is read and parsed. When this\n * callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n iniLoader.clearCachedFiles();\n this.coalesceRefresh(\n callback || AWS.util.fn.callback,\n this.disableAssumeRole\n );\n },\n\n /**\n * @api private\n */\n loadRoleProfile: function loadRoleProfile(creds, roleProfile, callback) {\n if (this.disableAssumeRole) {\n throw AWS.util.error(\n new Error('Role assumption profiles are disabled. ' +\n 'Failed to load profile ' + this.profile +\n ' from ' + creds.filename),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n\n var self = this;\n var roleArn = roleProfile['role_arn'];\n var roleSessionName = roleProfile['role_session_name'];\n var externalId = roleProfile['external_id'];\n var mfaSerial = roleProfile['mfa_serial'];\n var sourceProfileName = roleProfile['source_profile'];\n var durationSeconds = parseInt(roleProfile['duration_seconds'], 10) || undefined;\n\n // From experimentation, the following behavior mimics the AWS CLI:\n //\n // 1. Use region from the profile if present.\n // 2. Otherwise fall back to N. Virginia (global endpoint).\n //\n // It is necessary to do the fallback explicitly, because if\n // 'AWS_STS_REGIONAL_ENDPOINTS=regional', the underlying STS client will\n // otherwise throw an error if region is left 'undefined'.\n //\n // Experimentation shows that the AWS CLI (tested at version 1.18.136)\n // ignores the following potential sources of a region for the purposes of\n // this AssumeRole call:\n //\n // - The [default] profile\n // - The AWS_REGION environment variable\n //\n // Ignoring the [default] profile for the purposes of AssumeRole is arguably\n // a bug in the CLI since it does use the [default] region for service\n // calls... but right now we're matching behavior of the other tool.\n var profileRegion = roleProfile['region'] || ASSUME_ROLE_DEFAULT_REGION;\n\n if (!sourceProfileName) {\n throw AWS.util.error(\n new Error('source_profile is not set using profile ' + this.profile),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n\n var sourceProfileExistanceTest = creds[sourceProfileName];\n\n if (typeof sourceProfileExistanceTest !== 'object') {\n throw AWS.util.error(\n new Error('source_profile ' + sourceProfileName + ' using profile '\n + this.profile + ' does not exist'),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n );\n }\n\n var sourceCredentials = new AWS.SharedIniFileCredentials(\n AWS.util.merge(this.options || {}, {\n profile: sourceProfileName,\n preferStaticCredentials: true\n })\n );\n\n this.roleArn = roleArn;\n var sts = new STS({\n credentials: sourceCredentials,\n region: profileRegion,\n httpOptions: this.httpOptions\n });\n\n var roleParams = {\n DurationSeconds: durationSeconds,\n RoleArn: roleArn,\n RoleSessionName: roleSessionName || 'aws-sdk-js-' + Date.now()\n };\n\n if (externalId) {\n roleParams.ExternalId = externalId;\n }\n\n if (mfaSerial && self.tokenCodeFn) {\n roleParams.SerialNumber = mfaSerial;\n self.tokenCodeFn(mfaSerial, function(err, token) {\n if (err) {\n var message;\n if (err instanceof Error) {\n message = err.message;\n } else {\n message = err;\n }\n callback(\n AWS.util.error(\n new Error('Error fetching MFA token: ' + message),\n { code: 'SharedIniFileCredentialsProviderFailure' }\n ));\n return;\n }\n\n roleParams.TokenCode = token;\n sts.assumeRole(roleParams, callback);\n });\n return;\n }\n sts.assumeRole(roleParams, callback);\n }\n});\n","var AWS = require('../core');\nvar path = require('path');\nvar crypto = require('crypto');\nvar iniLoader = AWS.util.iniLoader;\n\n/**\n * Represents credentials from sso.getRoleCredentials API for\n * `sso_*` values defined in shared credentials file.\n *\n * ## Using SSO credentials\n *\n * The credentials file must specify the information below to use sso:\n *\n * [profile sso-profile]\n * sso_account_id = 012345678901\n * sso_region = **-****-*\n * sso_role_name = SampleRole\n * sso_start_url = https://d-******.awsapps.com/start\n *\n * or using the session format:\n *\n * [profile sso-token]\n * sso_session = prod\n * sso_account_id = 012345678901\n * sso_role_name = SampleRole\n *\n * [sso-session prod]\n * sso_region = **-****-*\n * sso_start_url = https://d-******.awsapps.com/start\n *\n * This information will be automatically added to your shared credentials file by running\n * `aws configure sso`.\n *\n * ## Using custom profiles\n *\n * The SDK supports loading credentials for separate profiles. This can be done\n * in two ways:\n *\n * 1. Set the `AWS_PROFILE` environment variable in your process prior to\n * loading the SDK.\n * 2. Directly load the AWS.SsoCredentials provider:\n *\n * ```javascript\n * var creds = new AWS.SsoCredentials({profile: 'myprofile'});\n * AWS.config.credentials = creds;\n * ```\n *\n * @!macro nobrowser\n */\nAWS.SsoCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new SsoCredentials object.\n *\n * @param options [map] a set of options\n * @option options profile [String] (AWS_PROFILE env var or 'default')\n * the name of the profile to load.\n * @option options filename [String] ('~/.aws/credentials' or defined by\n * AWS_SHARED_CREDENTIALS_FILE process env var)\n * the filename to use when loading credentials.\n * @option options callback [Function] (err) Credentials are eagerly loaded\n * by the constructor. When the callback is called with no error, the\n * credentials have been loaded successfully.\n */\n constructor: function SsoCredentials(options) {\n AWS.Credentials.call(this);\n\n options = options || {};\n this.errorCode = 'SsoCredentialsProviderFailure';\n this.expired = true;\n\n this.filename = options.filename;\n this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;\n this.service = options.ssoClient;\n this.httpOptions = options.httpOptions || null;\n this.get(options.callback || AWS.util.fn.noop);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n\n try {\n var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader, this.filename);\n var profile = profiles[this.profile] || {};\n\n if (Object.keys(profile).length === 0) {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' not found'),\n { code: self.errorCode }\n );\n }\n\n if (profile.sso_session) {\n if (!profile.sso_account_id || !profile.sso_role_name) {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' with session ' + profile.sso_session +\n ' does not have valid SSO credentials. Required parameters \"sso_account_id\", \"sso_session\", ' +\n '\"sso_role_name\". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),\n { code: self.errorCode }\n );\n }\n } else {\n if (!profile.sso_start_url || !profile.sso_account_id || !profile.sso_region || !profile.sso_role_name) {\n throw AWS.util.error(\n new Error('Profile ' + this.profile + ' does not have valid SSO credentials. Required parameters \"sso_account_id\", \"sso_region\", ' +\n '\"sso_role_name\", \"sso_start_url\". Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html'),\n { code: self.errorCode }\n );\n }\n }\n\n this.getToken(this.profile, profile, function (err, token) {\n if (err) {\n return callback(err);\n }\n var request = {\n accessToken: token,\n accountId: profile.sso_account_id,\n roleName: profile.sso_role_name,\n };\n\n if (!self.service || self.service.config.region !== profile.sso_region) {\n self.service = new AWS.SSO({\n region: profile.sso_region,\n httpOptions: self.httpOptions,\n });\n }\n\n self.service.getRoleCredentials(request, function(err, data) {\n if (err || !data || !data.roleCredentials) {\n callback(AWS.util.error(\n err || new Error('Please log in using \"aws sso login\"'),\n { code: self.errorCode }\n ), null);\n } else if (!data.roleCredentials.accessKeyId || !data.roleCredentials.secretAccessKey || !data.roleCredentials.sessionToken || !data.roleCredentials.expiration) {\n throw AWS.util.error(new Error(\n 'SSO returns an invalid temporary credential.'\n ));\n } else {\n self.expired = false;\n self.accessKeyId = data.roleCredentials.accessKeyId;\n self.secretAccessKey = data.roleCredentials.secretAccessKey;\n self.sessionToken = data.roleCredentials.sessionToken;\n self.expireTime = new Date(data.roleCredentials.expiration);\n callback(null);\n }\n });\n });\n } catch (err) {\n callback(err);\n }\n },\n\n /**\n * @private\n * Uses legacy file system retrieval or if sso-session is set,\n * use the SSOTokenProvider.\n *\n * @param {string} profileName - name of the profile.\n * @param {object} profile - profile data containing sso_session or sso_start_url etc.\n * @param {function} callback - called with (err, (string) token).\n *\n * @returns {void}\n */\n getToken: function getToken(profileName, profile, callback) {\n var self = this;\n\n if (profile.sso_session) {\n var _iniLoader = AWS.util.iniLoader;\n var ssoSessions = _iniLoader.loadSsoSessionsFrom();\n var ssoSession = ssoSessions[profile.sso_session];\n Object.assign(profile, ssoSession);\n\n var ssoTokenProvider = new AWS.SSOTokenProvider({\n profile: profileName,\n });\n ssoTokenProvider.load(function (err) {\n if (err) {\n return callback(err);\n }\n return callback(null, ssoTokenProvider.token);\n });\n return;\n }\n\n try {\n /**\n * The time window (15 mins) that SDK will treat the SSO token expires in before the defined expiration date in token.\n * This is needed because server side may have invalidated the token before the defined expiration date.\n */\n var EXPIRE_WINDOW_MS = 15 * 60 * 1000;\n var hasher = crypto.createHash('sha1');\n var fileName = hasher.update(profile.sso_start_url).digest('hex') + '.json';\n var cachePath = path.join(\n iniLoader.getHomeDir(),\n '.aws',\n 'sso',\n 'cache',\n fileName\n );\n var cacheFile = AWS.util.readFileSync(cachePath);\n var cacheContent = null;\n if (cacheFile) {\n cacheContent = JSON.parse(cacheFile);\n }\n if (!cacheContent) {\n throw AWS.util.error(\n new Error('Cached credentials not found under ' + this.profile + ' profile. Please make sure you log in with aws sso login first'),\n { code: self.errorCode }\n );\n }\n\n if (!cacheContent.startUrl || !cacheContent.region || !cacheContent.accessToken || !cacheContent.expiresAt) {\n throw AWS.util.error(\n new Error('Cached credentials are missing required properties. Try running aws sso login.')\n );\n }\n\n if (new Date(cacheContent.expiresAt).getTime() - Date.now() <= EXPIRE_WINDOW_MS) {\n throw AWS.util.error(new Error(\n 'The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.'\n ));\n }\n\n return callback(null, cacheContent.accessToken);\n } catch (err) {\n return callback(err, null);\n }\n },\n\n /**\n * Loads the credentials from the AWS SSO process\n *\n * @callback callback function(err)\n * Called after the AWS SSO process has been executed. When this\n * callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n iniLoader.clearCachedFiles();\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n});\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents temporary credentials retrieved from {AWS.STS}. Without any\n * extra parameters, credentials will be fetched from the\n * {AWS.STS.getSessionToken} operation. If an IAM role is provided, the\n * {AWS.STS.assumeRole} operation will be used to fetch credentials for the\n * role instead.\n *\n * @note AWS.TemporaryCredentials is deprecated, but remains available for\n * backwards compatibility. {AWS.ChainableTemporaryCredentials} is the\n * preferred class for temporary credentials.\n *\n * To setup temporary credentials, configure a set of master credentials\n * using the standard credentials providers (environment, EC2 instance metadata,\n * or from the filesystem), then set the global credentials to a new\n * temporary credentials object:\n *\n * ```javascript\n * // Note that environment credentials are loaded by default,\n * // the following line is shown for clarity:\n * AWS.config.credentials = new AWS.EnvironmentCredentials('AWS');\n *\n * // Now set temporary credentials seeded from the master credentials\n * AWS.config.credentials = new AWS.TemporaryCredentials();\n *\n * // subsequent requests will now use temporary credentials from AWS STS.\n * new AWS.S3().listBucket(function(err, data) { ... });\n * ```\n *\n * @!attribute masterCredentials\n * @return [AWS.Credentials] the master (non-temporary) credentials used to\n * get and refresh temporary credentials from AWS STS.\n * @note (see constructor)\n */\nAWS.TemporaryCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new temporary credentials object.\n *\n * @note In order to create temporary credentials, you first need to have\n * \"master\" credentials configured in {AWS.Config.credentials}. These\n * master credentials are necessary to retrieve the temporary credentials,\n * as well as refresh the credentials when they expire.\n * @param params [map] a map of options that are passed to the\n * {AWS.STS.assumeRole} or {AWS.STS.getSessionToken} operations.\n * If a `RoleArn` parameter is passed in, credentials will be based on the\n * IAM role.\n * @param masterCredentials [AWS.Credentials] the master (non-temporary) credentials\n * used to get and refresh temporary credentials from AWS STS.\n * @example Creating a new credentials object for generic temporary credentials\n * AWS.config.credentials = new AWS.TemporaryCredentials();\n * @example Creating a new credentials object for an IAM role\n * AWS.config.credentials = new AWS.TemporaryCredentials({\n * RoleArn: 'arn:aws:iam::1234567890:role/TemporaryCredentials',\n * });\n * @see AWS.STS.assumeRole\n * @see AWS.STS.getSessionToken\n */\n constructor: function TemporaryCredentials(params, masterCredentials) {\n AWS.Credentials.call(this);\n this.loadMasterCredentials(masterCredentials);\n this.expired = true;\n\n this.params = params || {};\n if (this.params.RoleArn) {\n this.params.RoleSessionName =\n this.params.RoleSessionName || 'temporary-credentials';\n }\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRole} or\n * {AWS.STS.getSessionToken}, depending on whether an IAM role ARN was passed\n * to the credentials {constructor}.\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh (callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n load: function load (callback) {\n var self = this;\n self.createClients();\n self.masterCredentials.get(function () {\n self.service.config.credentials = self.masterCredentials;\n var operation = self.params.RoleArn ?\n self.service.assumeRole : self.service.getSessionToken;\n operation.call(self.service, function (err, data) {\n if (!err) {\n self.service.credentialsFrom(data, self);\n }\n callback(err);\n });\n });\n },\n\n /**\n * @api private\n */\n loadMasterCredentials: function loadMasterCredentials (masterCredentials) {\n this.masterCredentials = masterCredentials || AWS.config.credentials;\n while (this.masterCredentials.masterCredentials) {\n this.masterCredentials = this.masterCredentials.masterCredentials;\n }\n\n if (typeof this.masterCredentials.get !== 'function') {\n this.masterCredentials = new AWS.Credentials(this.masterCredentials);\n }\n },\n\n /**\n * @api private\n */\n createClients: function () {\n this.service = this.service || new STS({params: this.params});\n }\n\n});\n","var AWS = require('../core');\nvar fs = require('fs');\nvar STS = require('../../clients/sts');\nvar iniLoader = AWS.util.iniLoader;\n\n/**\n * Represents OIDC credentials from a file on disk\n * If the credentials expire, the SDK can {refresh} the credentials\n * from the file.\n *\n * ## Using the web identity token file\n *\n * This provider is checked by default in the Node.js environment. To use\n * the provider simply add your OIDC token to a file (ASCII encoding) and\n * share the filename in either AWS_WEB_IDENTITY_TOKEN_FILE environment\n * variable or web_identity_token_file shared config variable\n *\n * The file contains encoded OIDC token and the characters are\n * ASCII encoded. OIDC tokens are JSON Web Tokens (JWT).\n * JWT's are 3 base64 encoded strings joined by the '.' character.\n *\n * This class will read filename from AWS_WEB_IDENTITY_TOKEN_FILE\n * environment variable or web_identity_token_file shared config variable,\n * and get the OIDC token from filename.\n * It will also read IAM role to be assumed from AWS_ROLE_ARN\n * environment variable or role_arn shared config variable.\n * This provider gets credetials using the {AWS.STS.assumeRoleWithWebIdentity}\n * service operation\n *\n * @!macro nobrowser\n */\nAWS.TokenFileWebIdentityCredentials = AWS.util.inherit(AWS.Credentials, {\n\n /**\n * @example Creating a new credentials object\n * AWS.config.credentials = new AWS.TokenFileWebIdentityCredentials(\n * // optionally provide configuration to apply to the underlying AWS.STS service client\n * // if configuration is not provided, then configuration will be pulled from AWS.config\n * {\n * // specify timeout options\n * httpOptions: {\n * timeout: 100\n * }\n * });\n * @see AWS.Config\n */\n constructor: function TokenFileWebIdentityCredentials(clientConfig) {\n AWS.Credentials.call(this);\n this.data = null;\n this.clientConfig = AWS.util.copy(clientConfig || {});\n },\n\n /**\n * Returns params from environment variables\n *\n * @api private\n */\n getParamsFromEnv: function getParamsFromEnv() {\n var ENV_TOKEN_FILE = 'AWS_WEB_IDENTITY_TOKEN_FILE',\n ENV_ROLE_ARN = 'AWS_ROLE_ARN';\n if (process.env[ENV_TOKEN_FILE] && process.env[ENV_ROLE_ARN]) {\n return [{\n envTokenFile: process.env[ENV_TOKEN_FILE],\n roleArn: process.env[ENV_ROLE_ARN],\n roleSessionName: process.env['AWS_ROLE_SESSION_NAME']\n }];\n }\n },\n\n /**\n * Returns params from shared config variables\n *\n * @api private\n */\n getParamsFromSharedConfig: function getParamsFromSharedConfig() {\n var profiles = AWS.util.getProfilesFromSharedConfig(iniLoader);\n var profileName = process.env.AWS_PROFILE || AWS.util.defaultProfile;\n var profile = profiles[profileName] || {};\n\n if (Object.keys(profile).length === 0) {\n throw AWS.util.error(\n new Error('Profile ' + profileName + ' not found'),\n { code: 'TokenFileWebIdentityCredentialsProviderFailure' }\n );\n }\n\n var paramsArray = [];\n\n while (!profile['web_identity_token_file'] && profile['source_profile']) {\n paramsArray.unshift({\n roleArn: profile['role_arn'],\n roleSessionName: profile['role_session_name']\n });\n var sourceProfile = profile['source_profile'];\n profile = profiles[sourceProfile];\n }\n\n paramsArray.unshift({\n envTokenFile: profile['web_identity_token_file'],\n roleArn: profile['role_arn'],\n roleSessionName: profile['role_session_name']\n });\n\n return paramsArray;\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity}\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see AWS.Credentials.get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n assumeRoleChaining: function assumeRoleChaining(paramsArray, callback) {\n var self = this;\n if (paramsArray.length === 0) {\n self.service.credentialsFrom(self.data, self);\n callback();\n } else {\n var params = paramsArray.shift();\n self.service.config.credentials = self.service.credentialsFrom(self.data, self);\n self.service.assumeRole(\n {\n RoleArn: params.roleArn,\n RoleSessionName: params.roleSessionName || 'token-file-web-identity'\n },\n function (err, data) {\n self.data = null;\n if (err) {\n callback(err);\n } else {\n self.data = data;\n self.assumeRoleChaining(paramsArray, callback);\n }\n }\n );\n }\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n try {\n var paramsArray = self.getParamsFromEnv();\n if (!paramsArray) {\n paramsArray = self.getParamsFromSharedConfig();\n }\n if (paramsArray) {\n var params = paramsArray.shift();\n var oidcToken = fs.readFileSync(params.envTokenFile, {encoding: 'ascii'});\n if (!self.service) {\n self.createClients();\n }\n self.service.assumeRoleWithWebIdentity(\n {\n WebIdentityToken: oidcToken,\n RoleArn: params.roleArn,\n RoleSessionName: params.roleSessionName || 'token-file-web-identity'\n },\n function (err, data) {\n self.data = null;\n if (err) {\n callback(err);\n } else {\n self.data = data;\n self.assumeRoleChaining(paramsArray, callback);\n }\n }\n );\n }\n } catch (err) {\n callback(err);\n }\n },\n\n /**\n * @api private\n */\n createClients: function() {\n if (!this.service) {\n var stsConfig = AWS.util.merge({}, this.clientConfig);\n this.service = new STS(stsConfig);\n\n // Retry in case of IDPCommunicationErrorException or InvalidIdentityToken\n this.service.retryableError = function(error) {\n if (error.code === 'IDPCommunicationErrorException' || error.code === 'InvalidIdentityToken') {\n return true;\n } else {\n return AWS.Service.prototype.retryableError.call(this, error);\n }\n };\n }\n }\n});\n","var AWS = require('../core');\nvar STS = require('../../clients/sts');\n\n/**\n * Represents credentials retrieved from STS Web Identity Federation support.\n *\n * By default this provider gets credentials using the\n * {AWS.STS.assumeRoleWithWebIdentity} service operation. This operation\n * requires a `RoleArn` containing the ARN of the IAM trust policy for the\n * application for which credentials will be given. In addition, the\n * `WebIdentityToken` must be set to the token provided by the identity\n * provider. See {constructor} for an example on creating a credentials\n * object with proper `RoleArn` and `WebIdentityToken` values.\n *\n * ## Refreshing Credentials from Identity Service\n *\n * In addition to AWS credentials expiring after a given amount of time, the\n * login token from the identity provider will also expire. Once this token\n * expires, it will not be usable to refresh AWS credentials, and another\n * token will be needed. The SDK does not manage refreshing of the token value,\n * but this can be done through a \"refresh token\" supported by most identity\n * providers. Consult the documentation for the identity provider for refreshing\n * tokens. Once the refreshed token is acquired, you should make sure to update\n * this new token in the credentials object's {params} property. The following\n * code will update the WebIdentityToken, assuming you have retrieved an updated\n * token from the identity provider:\n *\n * ```javascript\n * AWS.config.credentials.params.WebIdentityToken = updatedToken;\n * ```\n *\n * Future calls to `credentials.refresh()` will now use the new token.\n *\n * @!attribute params\n * @return [map] the map of params passed to\n * {AWS.STS.assumeRoleWithWebIdentity}. To update the token, set the\n * `params.WebIdentityToken` property.\n * @!attribute data\n * @return [map] the raw data response from the call to\n * {AWS.STS.assumeRoleWithWebIdentity}. Use this if you want to get\n * access to other properties from the response.\n */\nAWS.WebIdentityCredentials = AWS.util.inherit(AWS.Credentials, {\n /**\n * Creates a new credentials object.\n * @param (see AWS.STS.assumeRoleWithWebIdentity)\n * @example Creating a new credentials object\n * AWS.config.credentials = new AWS.WebIdentityCredentials({\n * RoleArn: 'arn:aws:iam::1234567890:role/WebIdentity',\n * WebIdentityToken: 'ABCDEFGHIJKLMNOP', // token from identity service\n * RoleSessionName: 'web' // optional name, defaults to web-identity\n * }, {\n * // optionally provide configuration to apply to the underlying AWS.STS service client\n * // if configuration is not provided, then configuration will be pulled from AWS.config\n *\n * // specify timeout options\n * httpOptions: {\n * timeout: 100\n * }\n * });\n * @see AWS.STS.assumeRoleWithWebIdentity\n * @see AWS.Config\n */\n constructor: function WebIdentityCredentials(params, clientConfig) {\n AWS.Credentials.call(this);\n this.expired = true;\n this.params = params;\n this.params.RoleSessionName = this.params.RoleSessionName || 'web-identity';\n this.data = null;\n this._clientConfig = AWS.util.copy(clientConfig || {});\n },\n\n /**\n * Refreshes credentials using {AWS.STS.assumeRoleWithWebIdentity}\n *\n * @callback callback function(err)\n * Called when the STS service responds (or fails). When\n * this callback is called with no error, it means that the credentials\n * information has been loaded into the object (as the `accessKeyId`,\n * `secretAccessKey`, and `sessionToken` properties).\n * @param err [Error] if an error occurred, this value will be filled\n * @see get\n */\n refresh: function refresh(callback) {\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n\n /**\n * @api private\n */\n load: function load(callback) {\n var self = this;\n self.createClients();\n self.service.assumeRoleWithWebIdentity(function (err, data) {\n self.data = null;\n if (!err) {\n self.data = data;\n self.service.credentialsFrom(data, self);\n }\n callback(err);\n });\n },\n\n /**\n * @api private\n */\n createClients: function() {\n if (!this.service) {\n var stsConfig = AWS.util.merge({}, this._clientConfig);\n stsConfig.params = this.params;\n this.service = new STS(stsConfig);\n }\n }\n\n});\n","var AWS = require('./core');\nvar util = require('./util');\nvar endpointDiscoveryEnabledEnvs = ['AWS_ENABLE_ENDPOINT_DISCOVERY', 'AWS_ENDPOINT_DISCOVERY_ENABLED'];\n\n/**\n * Generate key (except resources and operation part) to index the endpoints in the cache\n * If input shape has endpointdiscoveryid trait then use\n * accessKey + operation + resources + region + service as cache key\n * If input shape doesn't have endpointdiscoveryid trait then use\n * accessKey + region + service as cache key\n * @return [map] object with keys to index endpoints.\n * @api private\n */\nfunction getCacheKey(request) {\n var service = request.service;\n var api = service.api || {};\n var operations = api.operations;\n var identifiers = {};\n if (service.config.region) {\n identifiers.region = service.config.region;\n }\n if (api.serviceId) {\n identifiers.serviceId = api.serviceId;\n }\n if (service.config.credentials.accessKeyId) {\n identifiers.accessKeyId = service.config.credentials.accessKeyId;\n }\n return identifiers;\n}\n\n/**\n * Recursive helper for marshallCustomIdentifiers().\n * Looks for required string input members that have 'endpointdiscoveryid' trait.\n * @api private\n */\nfunction marshallCustomIdentifiersHelper(result, params, shape) {\n if (!shape || params === undefined || params === null) return;\n if (shape.type === 'structure' && shape.required && shape.required.length > 0) {\n util.arrayEach(shape.required, function(name) {\n var memberShape = shape.members[name];\n if (memberShape.endpointDiscoveryId === true) {\n var locationName = memberShape.isLocationName ? memberShape.name : name;\n result[locationName] = String(params[name]);\n } else {\n marshallCustomIdentifiersHelper(result, params[name], memberShape);\n }\n });\n }\n}\n\n/**\n * Get custom identifiers for cache key.\n * Identifies custom identifiers by checking each shape's `endpointDiscoveryId` trait.\n * @param [object] request object\n * @param [object] input shape of the given operation's api\n * @api private\n */\nfunction marshallCustomIdentifiers(request, shape) {\n var identifiers = {};\n marshallCustomIdentifiersHelper(identifiers, request.params, shape);\n return identifiers;\n}\n\n/**\n * Call endpoint discovery operation when it's optional.\n * When endpoint is available in cache then use the cached endpoints. If endpoints\n * are unavailable then use regional endpoints and call endpoint discovery operation\n * asynchronously. This is turned off by default.\n * @param [object] request object\n * @api private\n */\nfunction optionalDiscoverEndpoint(request) {\n var service = request.service;\n var api = service.api;\n var operationModel = api.operations ? api.operations[request.operation] : undefined;\n var inputShape = operationModel ? operationModel.input : undefined;\n\n var identifiers = marshallCustomIdentifiers(request, inputShape);\n var cacheKey = getCacheKey(request);\n if (Object.keys(identifiers).length > 0) {\n cacheKey = util.update(cacheKey, identifiers);\n if (operationModel) cacheKey.operation = operationModel.name;\n }\n var endpoints = AWS.endpointCache.get(cacheKey);\n if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') {\n //endpoint operation is being made but response not yet received\n //or endpoint operation just failed in 1 minute\n return;\n } else if (endpoints && endpoints.length > 0) {\n //found endpoint record from cache\n request.httpRequest.updateEndpoint(endpoints[0].Address);\n } else {\n //endpoint record not in cache or outdated. make discovery operation\n var endpointRequest = service.makeRequest(api.endpointOperation, {\n Operation: operationModel.name,\n Identifiers: identifiers,\n });\n addApiVersionHeader(endpointRequest);\n endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n endpointRequest.removeListener('retry', AWS.EventListeners.Core.RETRY_CHECK);\n //put in a placeholder for endpoints already requested, prevent\n //too much in-flight calls\n AWS.endpointCache.put(cacheKey, [{\n Address: '',\n CachePeriodInMinutes: 1\n }]);\n endpointRequest.send(function(err, data) {\n if (data && data.Endpoints) {\n AWS.endpointCache.put(cacheKey, data.Endpoints);\n } else if (err) {\n AWS.endpointCache.put(cacheKey, [{\n Address: '',\n CachePeriodInMinutes: 1 //not to make more endpoint operation in next 1 minute\n }]);\n }\n });\n }\n}\n\nvar requestQueue = {};\n\n/**\n * Call endpoint discovery operation when it's required.\n * When endpoint is available in cache then use cached ones. If endpoints are\n * unavailable then SDK should call endpoint operation then use returned new\n * endpoint for the api call. SDK will automatically attempt to do endpoint\n * discovery. This is turned off by default\n * @param [object] request object\n * @api private\n */\nfunction requiredDiscoverEndpoint(request, done) {\n var service = request.service;\n var api = service.api;\n var operationModel = api.operations ? api.operations[request.operation] : undefined;\n var inputShape = operationModel ? operationModel.input : undefined;\n\n var identifiers = marshallCustomIdentifiers(request, inputShape);\n var cacheKey = getCacheKey(request);\n if (Object.keys(identifiers).length > 0) {\n cacheKey = util.update(cacheKey, identifiers);\n if (operationModel) cacheKey.operation = operationModel.name;\n }\n var cacheKeyStr = AWS.EndpointCache.getKeyString(cacheKey);\n var endpoints = AWS.endpointCache.get(cacheKeyStr); //endpoint cache also accepts string keys\n if (endpoints && endpoints.length === 1 && endpoints[0].Address === '') {\n //endpoint operation is being made but response not yet received\n //push request object to a pending queue\n if (!requestQueue[cacheKeyStr]) requestQueue[cacheKeyStr] = [];\n requestQueue[cacheKeyStr].push({request: request, callback: done});\n return;\n } else if (endpoints && endpoints.length > 0) {\n request.httpRequest.updateEndpoint(endpoints[0].Address);\n done();\n } else {\n var endpointRequest = service.makeRequest(api.endpointOperation, {\n Operation: operationModel.name,\n Identifiers: identifiers,\n });\n endpointRequest.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n addApiVersionHeader(endpointRequest);\n\n //put in a placeholder for endpoints already requested, prevent\n //too much in-flight calls\n AWS.endpointCache.put(cacheKeyStr, [{\n Address: '',\n CachePeriodInMinutes: 60 //long-live cache\n }]);\n endpointRequest.send(function(err, data) {\n if (err) {\n request.response.error = util.error(err, { retryable: false });\n AWS.endpointCache.remove(cacheKey);\n\n //fail all the pending requests in batch\n if (requestQueue[cacheKeyStr]) {\n var pendingRequests = requestQueue[cacheKeyStr];\n util.arrayEach(pendingRequests, function(requestContext) {\n requestContext.request.response.error = util.error(err, { retryable: false });\n requestContext.callback();\n });\n delete requestQueue[cacheKeyStr];\n }\n } else if (data) {\n AWS.endpointCache.put(cacheKeyStr, data.Endpoints);\n request.httpRequest.updateEndpoint(data.Endpoints[0].Address);\n\n //update the endpoint for all the pending requests in batch\n if (requestQueue[cacheKeyStr]) {\n var pendingRequests = requestQueue[cacheKeyStr];\n util.arrayEach(pendingRequests, function(requestContext) {\n requestContext.request.httpRequest.updateEndpoint(data.Endpoints[0].Address);\n requestContext.callback();\n });\n delete requestQueue[cacheKeyStr];\n }\n }\n done();\n });\n }\n}\n\n/**\n * add api version header to endpoint operation\n * @api private\n */\nfunction addApiVersionHeader(endpointRequest) {\n var api = endpointRequest.service.api;\n var apiVersion = api.apiVersion;\n if (apiVersion && !endpointRequest.httpRequest.headers['x-amz-api-version']) {\n endpointRequest.httpRequest.headers['x-amz-api-version'] = apiVersion;\n }\n}\n\n/**\n * If api call gets invalid endpoint exception, SDK should attempt to remove the invalid\n * endpoint from cache.\n * @api private\n */\nfunction invalidateCachedEndpoints(response) {\n var error = response.error;\n var httpResponse = response.httpResponse;\n if (error &&\n (error.code === 'InvalidEndpointException' || httpResponse.statusCode === 421)\n ) {\n var request = response.request;\n var operations = request.service.api.operations || {};\n var inputShape = operations[request.operation] ? operations[request.operation].input : undefined;\n var identifiers = marshallCustomIdentifiers(request, inputShape);\n var cacheKey = getCacheKey(request);\n if (Object.keys(identifiers).length > 0) {\n cacheKey = util.update(cacheKey, identifiers);\n if (operations[request.operation]) cacheKey.operation = operations[request.operation].name;\n }\n AWS.endpointCache.remove(cacheKey);\n }\n}\n\n/**\n * If endpoint is explicitly configured, SDK should not do endpoint discovery in anytime.\n * @param [object] client Service client object.\n * @api private\n */\nfunction hasCustomEndpoint(client) {\n //if set endpoint is set for specific client, enable endpoint discovery will raise an error.\n if (client._originalConfig && client._originalConfig.endpoint && client._originalConfig.endpointDiscoveryEnabled === true) {\n throw util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'Custom endpoint is supplied; endpointDiscoveryEnabled must not be true.'\n });\n };\n var svcConfig = AWS.config[client.serviceIdentifier] || {};\n return Boolean(AWS.config.endpoint || svcConfig.endpoint || (client._originalConfig && client._originalConfig.endpoint));\n}\n\n/**\n * @api private\n */\nfunction isFalsy(value) {\n return ['false', '0'].indexOf(value) >= 0;\n}\n\n/**\n * If endpoint discovery should perform for this request when no operation requires endpoint\n * discovery for the given service.\n * SDK performs config resolution in order like below:\n * 1. If set in client configuration.\n * 2. If set in env AWS_ENABLE_ENDPOINT_DISCOVERY.\n * 3. If set in shared ini config file with key 'endpoint_discovery_enabled'.\n * @param [object] request request object.\n * @returns [boolean|undefined] if endpoint discovery config is not set in any source, this\n * function returns undefined\n * @api private\n */\nfunction resolveEndpointDiscoveryConfig(request) {\n var service = request.service || {};\n if (service.config.endpointDiscoveryEnabled !== undefined) {\n return service.config.endpointDiscoveryEnabled;\n }\n\n //shared ini file is only available in Node\n //not to check env in browser\n if (util.isBrowser()) return undefined;\n\n // If any of recognized endpoint discovery config env is set\n for (var i = 0; i < endpointDiscoveryEnabledEnvs.length; i++) {\n var env = endpointDiscoveryEnabledEnvs[i];\n if (Object.prototype.hasOwnProperty.call(process.env, env)) {\n if (process.env[env] === '' || process.env[env] === undefined) {\n throw util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'environmental variable ' + env + ' cannot be set to nothing'\n });\n }\n return !isFalsy(process.env[env]);\n }\n }\n\n var configFile = {};\n try {\n configFile = AWS.util.iniLoader ? AWS.util.iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[AWS.util.sharedConfigFileEnv]\n }) : {};\n } catch (e) {}\n var sharedFileConfig = configFile[\n process.env.AWS_PROFILE || AWS.util.defaultProfile\n ] || {};\n if (Object.prototype.hasOwnProperty.call(sharedFileConfig, 'endpoint_discovery_enabled')) {\n if (sharedFileConfig.endpoint_discovery_enabled === undefined) {\n throw util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'config file entry \\'endpoint_discovery_enabled\\' cannot be set to nothing'\n });\n }\n return !isFalsy(sharedFileConfig.endpoint_discovery_enabled);\n }\n return undefined;\n}\n\n/**\n * attach endpoint discovery logic to request object\n * @param [object] request\n * @api private\n */\nfunction discoverEndpoint(request, done) {\n var service = request.service || {};\n if (hasCustomEndpoint(service) || request.isPresigned()) return done();\n\n var operations = service.api.operations || {};\n var operationModel = operations[request.operation];\n var isEndpointDiscoveryRequired = operationModel ? operationModel.endpointDiscoveryRequired : 'NULL';\n var isEnabled = resolveEndpointDiscoveryConfig(request);\n var hasRequiredEndpointDiscovery = service.api.hasRequiredEndpointDiscovery;\n if (isEnabled || hasRequiredEndpointDiscovery) {\n // Once a customer enables endpoint discovery, the SDK should start appending\n // the string endpoint-discovery to the user-agent on all requests.\n request.httpRequest.appendToUserAgent('endpoint-discovery');\n }\n switch (isEndpointDiscoveryRequired) {\n case 'OPTIONAL':\n if (isEnabled || hasRequiredEndpointDiscovery) {\n // For a given service; if at least one operation requires endpoint discovery then the SDK must enable endpoint discovery\n // by default for all operations of that service, including operations where endpoint discovery is optional.\n optionalDiscoverEndpoint(request);\n request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints);\n }\n done();\n break;\n case 'REQUIRED':\n if (isEnabled === false) {\n // For a given operation; if endpoint discovery is required and it has been disabled on the SDK client,\n // then the SDK must return a clear and actionable exception.\n request.response.error = util.error(new Error(), {\n code: 'ConfigurationException',\n message: 'Endpoint Discovery is disabled but ' + service.api.className + '.' + request.operation +\n '() requires it. Please check your configurations.'\n });\n done();\n break;\n }\n request.addNamedListener('INVALIDATE_CACHED_ENDPOINTS', 'extractError', invalidateCachedEndpoints);\n requiredDiscoverEndpoint(request, done);\n break;\n case 'NULL':\n default:\n done();\n break;\n }\n}\n\nmodule.exports = {\n discoverEndpoint: discoverEndpoint,\n requiredDiscoverEndpoint: requiredDiscoverEndpoint,\n optionalDiscoverEndpoint: optionalDiscoverEndpoint,\n marshallCustomIdentifiers: marshallCustomIdentifiers,\n getCacheKey: getCacheKey,\n invalidateCachedEndpoint: invalidateCachedEndpoints,\n};\n","var AWS = require('../core');\nvar util = AWS.util;\nvar typeOf = require('./types').typeOf;\nvar DynamoDBSet = require('./set');\nvar NumberValue = require('./numberValue');\n\nAWS.DynamoDB.Converter = {\n /**\n * Convert a JavaScript value to its equivalent DynamoDB AttributeValue type\n *\n * @param data [any] The data to convert to a DynamoDB AttributeValue\n * @param options [map]\n * @option options convertEmptyValues [Boolean] Whether to automatically\n * convert empty strings, blobs,\n * and sets to `null`\n * @option options wrapNumbers [Boolean] Whether to return numbers as a\n * NumberValue object instead of\n * converting them to native JavaScript\n * numbers. This allows for the safe\n * round-trip transport of numbers of\n * arbitrary size.\n * @return [map] An object in the Amazon DynamoDB AttributeValue format\n *\n * @see AWS.DynamoDB.Converter.marshall AWS.DynamoDB.Converter.marshall to\n * convert entire records (rather than individual attributes)\n */\n input: function convertInput(data, options) {\n options = options || {};\n var type = typeOf(data);\n if (type === 'Object') {\n return formatMap(data, options);\n } else if (type === 'Array') {\n return formatList(data, options);\n } else if (type === 'Set') {\n return formatSet(data, options);\n } else if (type === 'String') {\n if (data.length === 0 && options.convertEmptyValues) {\n return convertInput(null);\n }\n return { S: data };\n } else if (type === 'Number' || type === 'NumberValue') {\n return { N: data.toString() };\n } else if (type === 'Binary') {\n if (data.length === 0 && options.convertEmptyValues) {\n return convertInput(null);\n }\n return { B: data };\n } else if (type === 'Boolean') {\n return { BOOL: data };\n } else if (type === 'null') {\n return { NULL: true };\n } else if (type !== 'undefined' && type !== 'Function') {\n // this value has a custom constructor\n return formatMap(data, options);\n }\n },\n\n /**\n * Convert a JavaScript object into a DynamoDB record.\n *\n * @param data [any] The data to convert to a DynamoDB record\n * @param options [map]\n * @option options convertEmptyValues [Boolean] Whether to automatically\n * convert empty strings, blobs,\n * and sets to `null`\n * @option options wrapNumbers [Boolean] Whether to return numbers as a\n * NumberValue object instead of\n * converting them to native JavaScript\n * numbers. This allows for the safe\n * round-trip transport of numbers of\n * arbitrary size.\n *\n * @return [map] An object in the DynamoDB record format.\n *\n * @example Convert a JavaScript object into a DynamoDB record\n * var marshalled = AWS.DynamoDB.Converter.marshall({\n * string: 'foo',\n * list: ['fizz', 'buzz', 'pop'],\n * map: {\n * nestedMap: {\n * key: 'value',\n * }\n * },\n * number: 123,\n * nullValue: null,\n * boolValue: true,\n * stringSet: new DynamoDBSet(['foo', 'bar', 'baz'])\n * });\n */\n marshall: function marshallItem(data, options) {\n return AWS.DynamoDB.Converter.input(data, options).M;\n },\n\n /**\n * Convert a DynamoDB AttributeValue object to its equivalent JavaScript type.\n *\n * @param data [map] An object in the Amazon DynamoDB AttributeValue format\n * @param options [map]\n * @option options convertEmptyValues [Boolean] Whether to automatically\n * convert empty strings, blobs,\n * and sets to `null`\n * @option options wrapNumbers [Boolean] Whether to return numbers as a\n * NumberValue object instead of\n * converting them to native JavaScript\n * numbers. This allows for the safe\n * round-trip transport of numbers of\n * arbitrary size.\n *\n * @return [Object|Array|String|Number|Boolean|null]\n *\n * @see AWS.DynamoDB.Converter.unmarshall AWS.DynamoDB.Converter.unmarshall to\n * convert entire records (rather than individual attributes)\n */\n output: function convertOutput(data, options) {\n options = options || {};\n var list, map, i;\n for (var type in data) {\n var values = data[type];\n if (type === 'M') {\n map = {};\n for (var key in values) {\n map[key] = convertOutput(values[key], options);\n }\n return map;\n } else if (type === 'L') {\n list = [];\n for (i = 0; i < values.length; i++) {\n list.push(convertOutput(values[i], options));\n }\n return list;\n } else if (type === 'SS') {\n list = [];\n for (i = 0; i < values.length; i++) {\n list.push(values[i] + '');\n }\n return new DynamoDBSet(list);\n } else if (type === 'NS') {\n list = [];\n for (i = 0; i < values.length; i++) {\n list.push(convertNumber(values[i], options.wrapNumbers));\n }\n return new DynamoDBSet(list);\n } else if (type === 'BS') {\n list = [];\n for (i = 0; i < values.length; i++) {\n list.push(AWS.util.buffer.toBuffer(values[i]));\n }\n return new DynamoDBSet(list);\n } else if (type === 'S') {\n return values + '';\n } else if (type === 'N') {\n return convertNumber(values, options.wrapNumbers);\n } else if (type === 'B') {\n return util.buffer.toBuffer(values);\n } else if (type === 'BOOL') {\n return (values === 'true' || values === 'TRUE' || values === true);\n } else if (type === 'NULL') {\n return null;\n }\n }\n },\n\n /**\n * Convert a DynamoDB record into a JavaScript object.\n *\n * @param data [any] The DynamoDB record\n * @param options [map]\n * @option options convertEmptyValues [Boolean] Whether to automatically\n * convert empty strings, blobs,\n * and sets to `null`\n * @option options wrapNumbers [Boolean] Whether to return numbers as a\n * NumberValue object instead of\n * converting them to native JavaScript\n * numbers. This allows for the safe\n * round-trip transport of numbers of\n * arbitrary size.\n *\n * @return [map] An object whose properties have been converted from\n * DynamoDB's AttributeValue format into their corresponding native\n * JavaScript types.\n *\n * @example Convert a record received from a DynamoDB stream\n * var unmarshalled = AWS.DynamoDB.Converter.unmarshall({\n * string: {S: 'foo'},\n * list: {L: [{S: 'fizz'}, {S: 'buzz'}, {S: 'pop'}]},\n * map: {\n * M: {\n * nestedMap: {\n * M: {\n * key: {S: 'value'}\n * }\n * }\n * }\n * },\n * number: {N: '123'},\n * nullValue: {NULL: true},\n * boolValue: {BOOL: true}\n * });\n */\n unmarshall: function unmarshall(data, options) {\n return AWS.DynamoDB.Converter.output({M: data}, options);\n }\n};\n\n/**\n * @api private\n * @param data [Array]\n * @param options [map]\n */\nfunction formatList(data, options) {\n var list = {L: []};\n for (var i = 0; i < data.length; i++) {\n list['L'].push(AWS.DynamoDB.Converter.input(data[i], options));\n }\n return list;\n}\n\n/**\n * @api private\n * @param value [String]\n * @param wrapNumbers [Boolean]\n */\nfunction convertNumber(value, wrapNumbers) {\n return wrapNumbers ? new NumberValue(value) : Number(value);\n}\n\n/**\n * @api private\n * @param data [map]\n * @param options [map]\n */\nfunction formatMap(data, options) {\n var map = {M: {}};\n for (var key in data) {\n var formatted = AWS.DynamoDB.Converter.input(data[key], options);\n if (formatted !== void 0) {\n map['M'][key] = formatted;\n }\n }\n return map;\n}\n\n/**\n * @api private\n */\nfunction formatSet(data, options) {\n options = options || {};\n var values = data.values;\n if (options.convertEmptyValues) {\n values = filterEmptySetValues(data);\n if (values.length === 0) {\n return AWS.DynamoDB.Converter.input(null);\n }\n }\n\n var map = {};\n switch (data.type) {\n case 'String': map['SS'] = values; break;\n case 'Binary': map['BS'] = values; break;\n case 'Number': map['NS'] = values.map(function (value) {\n return value.toString();\n });\n }\n return map;\n}\n\n/**\n * @api private\n */\nfunction filterEmptySetValues(set) {\n var nonEmptyValues = [];\n var potentiallyEmptyTypes = {\n String: true,\n Binary: true,\n Number: false\n };\n if (potentiallyEmptyTypes[set.type]) {\n for (var i = 0; i < set.values.length; i++) {\n if (set.values[i].length === 0) {\n continue;\n }\n nonEmptyValues.push(set.values[i]);\n }\n\n return nonEmptyValues;\n }\n\n return set.values;\n}\n\n/**\n * @api private\n */\nmodule.exports = AWS.DynamoDB.Converter;\n","var AWS = require('../core');\nvar Translator = require('./translator');\nvar DynamoDBSet = require('./set');\n\n/**\n * The document client simplifies working with items in Amazon DynamoDB\n * by abstracting away the notion of attribute values. This abstraction\n * annotates native JavaScript types supplied as input parameters, as well\n * as converts annotated response data to native JavaScript types.\n *\n * ## Marshalling Input and Unmarshalling Response Data\n *\n * The document client affords developers the use of native JavaScript types\n * instead of `AttributeValue`s to simplify the JavaScript development\n * experience with Amazon DynamoDB. JavaScript objects passed in as parameters\n * are marshalled into `AttributeValue` shapes required by Amazon DynamoDB.\n * Responses from DynamoDB are unmarshalled into plain JavaScript objects\n * by the `DocumentClient`. The `DocumentClient`, does not accept\n * `AttributeValue`s in favor of native JavaScript types.\n *\n * | JavaScript Type | DynamoDB AttributeValue |\n * |:----------------------------------------------------------------------:|-------------------------|\n * | String | S |\n * | Number | N |\n * | Boolean | BOOL |\n * | null | NULL |\n * | Array | L |\n * | Object | M |\n * | Buffer, File, Blob, ArrayBuffer, DataView, and JavaScript typed arrays | B |\n *\n * ## Support for Sets\n *\n * The `DocumentClient` offers a convenient way to create sets from\n * JavaScript Arrays. The type of set is inferred from the first element\n * in the array. DynamoDB supports string, number, and binary sets. To\n * learn more about supported types see the\n * [Amazon DynamoDB Data Model Documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html)\n * For more information see {AWS.DynamoDB.DocumentClient.createSet}\n *\n */\nAWS.DynamoDB.DocumentClient = AWS.util.inherit({\n\n /**\n * Creates a DynamoDB document client with a set of configuration options.\n *\n * @option options params [map] An optional map of parameters to bind to every\n * request sent by this service object.\n * @option options service [AWS.DynamoDB] An optional pre-configured instance\n * of the AWS.DynamoDB service object. This instance's config will be\n * copied to a new instance used by this client. You should not need to\n * retain a reference to the input object, and may destroy it or allow it\n * to be garbage collected.\n * @option options convertEmptyValues [Boolean] set to true if you would like\n * the document client to convert empty values (0-length strings, binary\n * buffers, and sets) to be converted to NULL types when persisting to\n * DynamoDB.\n * @option options wrapNumbers [Boolean] Set to true to return numbers as a\n * NumberValue object instead of converting them to native JavaScript numbers.\n * This allows for the safe round-trip transport of numbers of arbitrary size.\n * @see AWS.DynamoDB.constructor\n *\n */\n constructor: function DocumentClient(options) {\n var self = this;\n self.options = options || {};\n self.configure(self.options);\n },\n\n /**\n * @api private\n */\n configure: function configure(options) {\n var self = this;\n self.service = options.service;\n self.bindServiceObject(options);\n self.attrValue = options.attrValue =\n self.service.api.operations.putItem.input.members.Item.value.shape;\n },\n\n /**\n * @api private\n */\n bindServiceObject: function bindServiceObject(options) {\n var self = this;\n options = options || {};\n\n if (!self.service) {\n self.service = new AWS.DynamoDB(options);\n } else {\n var config = AWS.util.copy(self.service.config);\n self.service = new self.service.constructor.__super__(config);\n self.service.config.params =\n AWS.util.merge(self.service.config.params || {}, options.params);\n }\n },\n\n /**\n * @api private\n */\n makeServiceRequest: function(operation, params, callback) {\n var self = this;\n var request = self.service[operation](params);\n self.setupRequest(request);\n self.setupResponse(request);\n if (typeof callback === 'function') {\n request.send(callback);\n }\n return request;\n },\n\n /**\n * @api private\n */\n serviceClientOperationsMap: {\n batchGet: 'batchGetItem',\n batchWrite: 'batchWriteItem',\n delete: 'deleteItem',\n get: 'getItem',\n put: 'putItem',\n query: 'query',\n scan: 'scan',\n update: 'updateItem',\n transactGet: 'transactGetItems',\n transactWrite: 'transactWriteItems'\n },\n\n /**\n * Returns the attributes of one or more items from one or more tables\n * by delegating to `AWS.DynamoDB.batchGetItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.batchGetItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.batchGetItem\n * @example Get items from multiple tables\n * var params = {\n * RequestItems: {\n * 'Table-1': {\n * Keys: [\n * {\n * HashKey: 'haskey',\n * NumberRangeKey: 1\n * }\n * ]\n * },\n * 'Table-2': {\n * Keys: [\n * { foo: 'bar' },\n * ]\n * }\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.batchGet(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n batchGet: function(params, callback) {\n var operation = this.serviceClientOperationsMap['batchGet'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Puts or deletes multiple items in one or more tables by delegating\n * to `AWS.DynamoDB.batchWriteItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.batchWriteItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.batchWriteItem\n * @example Write to and delete from a table\n * var params = {\n * RequestItems: {\n * 'Table-1': [\n * {\n * DeleteRequest: {\n * Key: { HashKey: 'someKey' }\n * }\n * },\n * {\n * PutRequest: {\n * Item: {\n * HashKey: 'anotherKey',\n * NumAttribute: 1,\n * BoolAttribute: true,\n * ListAttribute: [1, 'two', false],\n * MapAttribute: { foo: 'bar' }\n * }\n * }\n * }\n * ]\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.batchWrite(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n batchWrite: function(params, callback) {\n var operation = this.serviceClientOperationsMap['batchWrite'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Deletes a single item in a table by primary key by delegating to\n * `AWS.DynamoDB.deleteItem()`\n *\n * Supply the same parameters as {AWS.DynamoDB.deleteItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.deleteItem\n * @example Delete an item from a table\n * var params = {\n * TableName : 'Table',\n * Key: {\n * HashKey: 'hashkey',\n * NumberRangeKey: 1\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.delete(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n delete: function(params, callback) {\n var operation = this.serviceClientOperationsMap['delete'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Returns a set of attributes for the item with the given primary key\n * by delegating to `AWS.DynamoDB.getItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.getItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.getItem\n * @example Get an item from a table\n * var params = {\n * TableName : 'Table',\n * Key: {\n * HashKey: 'hashkey'\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.get(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n get: function(params, callback) {\n var operation = this.serviceClientOperationsMap['get'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Creates a new item, or replaces an old item with a new item by\n * delegating to `AWS.DynamoDB.putItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.putItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.putItem\n * @example Create a new item in a table\n * var params = {\n * TableName : 'Table',\n * Item: {\n * HashKey: 'haskey',\n * NumAttribute: 1,\n * BoolAttribute: true,\n * ListAttribute: [1, 'two', false],\n * MapAttribute: { foo: 'bar'},\n * NullAttribute: null\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.put(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n put: function(params, callback) {\n var operation = this.serviceClientOperationsMap['put'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Edits an existing item's attributes, or adds a new item to the table if\n * it does not already exist by delegating to `AWS.DynamoDB.updateItem()`.\n *\n * Supply the same parameters as {AWS.DynamoDB.updateItem} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.updateItem\n * @example Update an item with expressions\n * var params = {\n * TableName: 'Table',\n * Key: { HashKey : 'hashkey' },\n * UpdateExpression: 'set #a = :x + :y',\n * ConditionExpression: '#a < :MAX',\n * ExpressionAttributeNames: {'#a' : 'Sum'},\n * ExpressionAttributeValues: {\n * ':x' : 20,\n * ':y' : 45,\n * ':MAX' : 100,\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.update(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n update: function(params, callback) {\n var operation = this.serviceClientOperationsMap['update'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Returns one or more items and item attributes by accessing every item\n * in a table or a secondary index.\n *\n * Supply the same parameters as {AWS.DynamoDB.scan} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.scan\n * @example Scan the table with a filter expression\n * var params = {\n * TableName : 'Table',\n * FilterExpression : 'Year = :this_year',\n * ExpressionAttributeValues : {':this_year' : 2015}\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.scan(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n scan: function(params, callback) {\n var operation = this.serviceClientOperationsMap['scan'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Directly access items from a table by primary key or a secondary index.\n *\n * Supply the same parameters as {AWS.DynamoDB.query} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.query\n * @example Query an index\n * var params = {\n * TableName: 'Table',\n * IndexName: 'Index',\n * KeyConditionExpression: 'HashKey = :hkey and RangeKey > :rkey',\n * ExpressionAttributeValues: {\n * ':hkey': 'key',\n * ':rkey': 2015\n * }\n * };\n *\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * documentClient.query(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n query: function(params, callback) {\n var operation = this.serviceClientOperationsMap['query'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Synchronous write operation that groups up to 25 action requests.\n *\n * Supply the same parameters as {AWS.DynamoDB.transactWriteItems} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.transactWriteItems\n * @example Get items from multiple tables\n * var params = {\n * TransactItems: [{\n * Put: {\n * TableName : 'Table0',\n * Item: {\n * HashKey: 'haskey',\n * NumAttribute: 1,\n * BoolAttribute: true,\n * ListAttribute: [1, 'two', false],\n * MapAttribute: { foo: 'bar'},\n * NullAttribute: null\n * }\n * }\n * }, {\n * Update: {\n * TableName: 'Table1',\n * Key: { HashKey : 'hashkey' },\n * UpdateExpression: 'set #a = :x + :y',\n * ConditionExpression: '#a < :MAX',\n * ExpressionAttributeNames: {'#a' : 'Sum'},\n * ExpressionAttributeValues: {\n * ':x' : 20,\n * ':y' : 45,\n * ':MAX' : 100,\n * }\n * }\n * }]\n * };\n *\n * documentClient.transactWrite(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n */\n transactWrite: function(params, callback) {\n var operation = this.serviceClientOperationsMap['transactWrite'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Atomically retrieves multiple items from one or more tables (but not from indexes)\n * in a single account and region.\n *\n * Supply the same parameters as {AWS.DynamoDB.transactGetItems} with\n * `AttributeValue`s substituted by native JavaScript types.\n *\n * @see AWS.DynamoDB.transactGetItems\n * @example Get items from multiple tables\n * var params = {\n * TransactItems: [{\n * Get: {\n * TableName : 'Table0',\n * Key: {\n * HashKey: 'hashkey0'\n * }\n * }\n * }, {\n * Get: {\n * TableName : 'Table1',\n * Key: {\n * HashKey: 'hashkey1'\n * }\n * }\n * }]\n * };\n *\n * documentClient.transactGet(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n */\n transactGet: function(params, callback) {\n var operation = this.serviceClientOperationsMap['transactGet'];\n return this.makeServiceRequest(operation, params, callback);\n },\n\n /**\n * Creates a set of elements inferring the type of set from\n * the type of the first element. Amazon DynamoDB currently supports\n * the number sets, string sets, and binary sets. For more information\n * about DynamoDB data types see the documentation on the\n * [Amazon DynamoDB Data Model](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DataModel.html#DataModel.DataTypes).\n *\n * @param list [Array] Collection to represent your DynamoDB Set\n * @param options [map]\n * * **validate** [Boolean] set to true if you want to validate the type\n * of each element in the set. Defaults to `false`.\n * @example Creating a number set\n * var documentClient = new AWS.DynamoDB.DocumentClient();\n *\n * var params = {\n * Item: {\n * hashkey: 'hashkey'\n * numbers: documentClient.createSet([1, 2, 3]);\n * }\n * };\n *\n * documentClient.put(params, function(err, data) {\n * if (err) console.log(err);\n * else console.log(data);\n * });\n *\n */\n createSet: function(list, options) {\n options = options || {};\n return new DynamoDBSet(list, options);\n },\n\n /**\n * @api private\n */\n getTranslator: function() {\n return new Translator(this.options);\n },\n\n /**\n * @api private\n */\n setupRequest: function setupRequest(request) {\n var self = this;\n var translator = self.getTranslator();\n var operation = request.operation;\n var inputShape = request.service.api.operations[operation].input;\n request._events.validate.unshift(function(req) {\n req.rawParams = AWS.util.copy(req.params);\n req.params = translator.translateInput(req.rawParams, inputShape);\n });\n },\n\n /**\n * @api private\n */\n setupResponse: function setupResponse(request) {\n var self = this;\n var translator = self.getTranslator();\n var outputShape = self.service.api.operations[request.operation].output;\n request.on('extractData', function(response) {\n response.data = translator.translateOutput(response.data, outputShape);\n });\n\n var response = request.response;\n response.nextPage = function(cb) {\n var resp = this;\n var req = resp.request;\n var config;\n var service = req.service;\n var operation = req.operation;\n try {\n config = service.paginationConfig(operation, true);\n } catch (e) { resp.error = e; }\n\n if (!resp.hasNextPage()) {\n if (cb) cb(resp.error, null);\n else if (resp.error) throw resp.error;\n return null;\n }\n\n var params = AWS.util.copy(req.rawParams);\n if (!resp.nextPageTokens) {\n return cb ? cb(null, null) : null;\n } else {\n var inputTokens = config.inputToken;\n if (typeof inputTokens === 'string') inputTokens = [inputTokens];\n for (var i = 0; i < inputTokens.length; i++) {\n params[inputTokens[i]] = resp.nextPageTokens[i];\n }\n return self[operation](params, cb);\n }\n };\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.DynamoDB.DocumentClient;\n","var util = require('../core').util;\n\n/**\n * An object recognizable as a numeric value that stores the underlying number\n * as a string.\n *\n * Intended to be a deserialization target for the DynamoDB Document Client when\n * the `wrapNumbers` flag is set. This allows for numeric values that lose\n * precision when converted to JavaScript's `number` type.\n */\nvar DynamoDBNumberValue = util.inherit({\n constructor: function NumberValue(value) {\n this.wrapperName = 'NumberValue';\n this.value = value.toString();\n },\n\n /**\n * Render the underlying value as a number when converting to JSON.\n */\n toJSON: function () {\n return this.toNumber();\n },\n\n /**\n * Convert the underlying value to a JavaScript number.\n */\n toNumber: function () {\n return Number(this.value);\n },\n\n /**\n * Return a string representing the unaltered value provided to the\n * constructor.\n */\n toString: function () {\n return this.value;\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = DynamoDBNumberValue;\n","var util = require('../core').util;\nvar typeOf = require('./types').typeOf;\n\n/**\n * @api private\n */\nvar memberTypeToSetType = {\n 'String': 'String',\n 'Number': 'Number',\n 'NumberValue': 'Number',\n 'Binary': 'Binary'\n};\n\n/**\n * @api private\n */\nvar DynamoDBSet = util.inherit({\n\n constructor: function Set(list, options) {\n options = options || {};\n this.wrapperName = 'Set';\n this.initialize(list, options.validate);\n },\n\n initialize: function(list, validate) {\n var self = this;\n self.values = [].concat(list);\n self.detectType();\n if (validate) {\n self.validate();\n }\n },\n\n detectType: function() {\n this.type = memberTypeToSetType[typeOf(this.values[0])];\n if (!this.type) {\n throw util.error(new Error(), {\n code: 'InvalidSetType',\n message: 'Sets can contain string, number, or binary values'\n });\n }\n },\n\n validate: function() {\n var self = this;\n var length = self.values.length;\n var values = self.values;\n for (var i = 0; i < length; i++) {\n if (memberTypeToSetType[typeOf(values[i])] !== self.type) {\n throw util.error(new Error(), {\n code: 'InvalidType',\n message: self.type + ' Set contains ' + typeOf(values[i]) + ' value'\n });\n }\n }\n },\n\n /**\n * Render the underlying values only when converting to JSON.\n */\n toJSON: function() {\n var self = this;\n return self.values;\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = DynamoDBSet;\n","var util = require('../core').util;\nvar convert = require('./converter');\n\nvar Translator = function(options) {\n options = options || {};\n this.attrValue = options.attrValue;\n this.convertEmptyValues = Boolean(options.convertEmptyValues);\n this.wrapNumbers = Boolean(options.wrapNumbers);\n};\n\nTranslator.prototype.translateInput = function(value, shape) {\n this.mode = 'input';\n return this.translate(value, shape);\n};\n\nTranslator.prototype.translateOutput = function(value, shape) {\n this.mode = 'output';\n return this.translate(value, shape);\n};\n\nTranslator.prototype.translate = function(value, shape) {\n var self = this;\n if (!shape || value === undefined) return undefined;\n\n if (shape.shape === self.attrValue) {\n return convert[self.mode](value, {\n convertEmptyValues: self.convertEmptyValues,\n wrapNumbers: self.wrapNumbers,\n });\n }\n switch (shape.type) {\n case 'structure': return self.translateStructure(value, shape);\n case 'map': return self.translateMap(value, shape);\n case 'list': return self.translateList(value, shape);\n default: return self.translateScalar(value, shape);\n }\n};\n\nTranslator.prototype.translateStructure = function(structure, shape) {\n var self = this;\n if (structure == null) return undefined;\n\n var struct = {};\n util.each(structure, function(name, value) {\n var memberShape = shape.members[name];\n if (memberShape) {\n var result = self.translate(value, memberShape);\n if (result !== undefined) struct[name] = result;\n }\n });\n return struct;\n};\n\nTranslator.prototype.translateList = function(list, shape) {\n var self = this;\n if (list == null) return undefined;\n\n var out = [];\n util.arrayEach(list, function(value) {\n var result = self.translate(value, shape.member);\n if (result === undefined) out.push(null);\n else out.push(result);\n });\n return out;\n};\n\nTranslator.prototype.translateMap = function(map, shape) {\n var self = this;\n if (map == null) return undefined;\n\n var out = {};\n util.each(map, function(key, value) {\n var result = self.translate(value, shape.value);\n if (result === undefined) out[key] = null;\n else out[key] = result;\n });\n return out;\n};\n\nTranslator.prototype.translateScalar = function(value, shape) {\n return shape.toType(value);\n};\n\n/**\n * @api private\n */\nmodule.exports = Translator;\n","var util = require('../core').util;\n\nfunction typeOf(data) {\n if (data === null && typeof data === 'object') {\n return 'null';\n } else if (data !== undefined && isBinary(data)) {\n return 'Binary';\n } else if (data !== undefined && data.constructor) {\n return data.wrapperName || util.typeName(data.constructor);\n } else if (data !== undefined && typeof data === 'object') {\n // this object is the result of Object.create(null), hence the absence of a\n // defined constructor\n return 'Object';\n } else {\n return 'undefined';\n }\n}\n\nfunction isBinary(data) {\n var types = [\n 'Buffer', 'File', 'Blob', 'ArrayBuffer', 'DataView',\n 'Int8Array', 'Uint8Array', 'Uint8ClampedArray',\n 'Int16Array', 'Uint16Array', 'Int32Array', 'Uint32Array',\n 'Float32Array', 'Float64Array'\n ];\n if (util.isNode()) {\n var Stream = util.stream.Stream;\n if (util.Buffer.isBuffer(data) || data instanceof Stream) {\n return true;\n }\n }\n\n for (var i = 0; i < types.length; i++) {\n if (data !== undefined && data.constructor) {\n if (util.isType(data, types[i])) return true;\n if (util.typeName(data.constructor) === types[i]) return true;\n }\n }\n\n return false;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n typeOf: typeOf,\n isBinary: isBinary\n};\n","var eventMessageChunker = require('../event-stream/event-message-chunker').eventMessageChunker;\nvar parseEvent = require('./parse-event').parseEvent;\n\nfunction createEventStream(body, parser, model) {\n var eventMessages = eventMessageChunker(body);\n\n var events = [];\n\n for (var i = 0; i < eventMessages.length; i++) {\n events.push(parseEvent(parser, eventMessages[i], model));\n }\n\n return events;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n createEventStream: createEventStream\n};\n","var util = require('../core').util;\nvar Transform = require('stream').Transform;\nvar allocBuffer = util.buffer.alloc;\n\n/** @type {Transform} */\nfunction EventMessageChunkerStream(options) {\n Transform.call(this, options);\n\n this.currentMessageTotalLength = 0;\n this.currentMessagePendingLength = 0;\n /** @type {Buffer} */\n this.currentMessage = null;\n\n /** @type {Buffer} */\n this.messageLengthBuffer = null;\n}\n\nEventMessageChunkerStream.prototype = Object.create(Transform.prototype);\n\n/**\n *\n * @param {Buffer} chunk\n * @param {string} encoding\n * @param {*} callback\n */\nEventMessageChunkerStream.prototype._transform = function(chunk, encoding, callback) {\n var chunkLength = chunk.length;\n var currentOffset = 0;\n\n while (currentOffset < chunkLength) {\n // create new message if necessary\n if (!this.currentMessage) {\n // working on a new message, determine total length\n var bytesRemaining = chunkLength - currentOffset;\n // prevent edge case where total length spans 2 chunks\n if (!this.messageLengthBuffer) {\n this.messageLengthBuffer = allocBuffer(4);\n }\n var numBytesForTotal = Math.min(\n 4 - this.currentMessagePendingLength, // remaining bytes to fill the messageLengthBuffer\n bytesRemaining // bytes left in chunk\n );\n\n chunk.copy(\n this.messageLengthBuffer,\n this.currentMessagePendingLength,\n currentOffset,\n currentOffset + numBytesForTotal\n );\n\n this.currentMessagePendingLength += numBytesForTotal;\n currentOffset += numBytesForTotal;\n\n if (this.currentMessagePendingLength < 4) {\n // not enough information to create the current message\n break;\n }\n this.allocateMessage(this.messageLengthBuffer.readUInt32BE(0));\n this.messageLengthBuffer = null;\n }\n\n // write data into current message\n var numBytesToWrite = Math.min(\n this.currentMessageTotalLength - this.currentMessagePendingLength, // number of bytes left to complete message\n chunkLength - currentOffset // number of bytes left in the original chunk\n );\n chunk.copy(\n this.currentMessage, // target buffer\n this.currentMessagePendingLength, // target offset\n currentOffset, // chunk offset\n currentOffset + numBytesToWrite // chunk end to write\n );\n this.currentMessagePendingLength += numBytesToWrite;\n currentOffset += numBytesToWrite;\n\n // check if a message is ready to be pushed\n if (this.currentMessageTotalLength && this.currentMessageTotalLength === this.currentMessagePendingLength) {\n // push out the message\n this.push(this.currentMessage);\n // cleanup\n this.currentMessage = null;\n this.currentMessageTotalLength = 0;\n this.currentMessagePendingLength = 0;\n }\n }\n\n callback();\n};\n\nEventMessageChunkerStream.prototype._flush = function(callback) {\n if (this.currentMessageTotalLength) {\n if (this.currentMessageTotalLength === this.currentMessagePendingLength) {\n callback(null, this.currentMessage);\n } else {\n callback(new Error('Truncated event message received.'));\n }\n } else {\n callback();\n }\n};\n\n/**\n * @param {number} size Size of the message to be allocated.\n * @api private\n */\nEventMessageChunkerStream.prototype.allocateMessage = function(size) {\n if (typeof size !== 'number') {\n throw new Error('Attempted to allocate an event message where size was not a number: ' + size);\n }\n this.currentMessageTotalLength = size;\n this.currentMessagePendingLength = 4;\n this.currentMessage = allocBuffer(size);\n this.currentMessage.writeUInt32BE(size, 0);\n};\n\n/**\n * @api private\n */\nmodule.exports = {\n EventMessageChunkerStream: EventMessageChunkerStream\n};\n","/**\n * Takes in a buffer of event messages and splits them into individual messages.\n * @param {Buffer} buffer\n * @api private\n */\nfunction eventMessageChunker(buffer) {\n /** @type Buffer[] */\n var messages = [];\n var offset = 0;\n\n while (offset < buffer.length) {\n var totalLength = buffer.readInt32BE(offset);\n\n // create new buffer for individual message (shares memory with original)\n var message = buffer.slice(offset, totalLength + offset);\n // increment offset to it starts at the next message\n offset += totalLength;\n\n messages.push(message);\n }\n\n return messages;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n eventMessageChunker: eventMessageChunker\n};\n","var Transform = require('stream').Transform;\nvar parseEvent = require('./parse-event').parseEvent;\n\n/** @type {Transform} */\nfunction EventUnmarshallerStream(options) {\n options = options || {};\n // set output to object mode\n options.readableObjectMode = true;\n Transform.call(this, options);\n this._readableState.objectMode = true;\n\n this.parser = options.parser;\n this.eventStreamModel = options.eventStreamModel;\n}\n\nEventUnmarshallerStream.prototype = Object.create(Transform.prototype);\n\n/**\n *\n * @param {Buffer} chunk\n * @param {string} encoding\n * @param {*} callback\n */\nEventUnmarshallerStream.prototype._transform = function(chunk, encoding, callback) {\n try {\n var event = parseEvent(this.parser, chunk, this.eventStreamModel);\n this.push(event);\n return callback();\n } catch (err) {\n callback(err);\n }\n};\n\n/**\n * @api private\n */\nmodule.exports = {\n EventUnmarshallerStream: EventUnmarshallerStream\n};\n","var util = require('../core').util;\nvar toBuffer = util.buffer.toBuffer;\n\n/**\n * A lossless representation of a signed, 64-bit integer. Instances of this\n * class may be used in arithmetic expressions as if they were numeric\n * primitives, but the binary representation will be preserved unchanged as the\n * `bytes` property of the object. The bytes should be encoded as big-endian,\n * two's complement integers.\n * @param {Buffer} bytes\n *\n * @api private\n */\nfunction Int64(bytes) {\n if (bytes.length !== 8) {\n throw new Error('Int64 buffers must be exactly 8 bytes');\n }\n if (!util.Buffer.isBuffer(bytes)) bytes = toBuffer(bytes);\n\n this.bytes = bytes;\n}\n\n/**\n * @param {number} number\n * @returns {Int64}\n *\n * @api private\n */\nInt64.fromNumber = function(number) {\n if (number > 9223372036854775807 || number < -9223372036854775808) {\n throw new Error(\n number + ' is too large (or, if negative, too small) to represent as an Int64'\n );\n }\n\n var bytes = new Uint8Array(8);\n for (\n var i = 7, remaining = Math.abs(Math.round(number));\n i > -1 && remaining > 0;\n i--, remaining /= 256\n ) {\n bytes[i] = remaining;\n }\n\n if (number < 0) {\n negate(bytes);\n }\n\n return new Int64(bytes);\n};\n\n/**\n * @returns {number}\n *\n * @api private\n */\nInt64.prototype.valueOf = function() {\n var bytes = this.bytes.slice(0);\n var negative = bytes[0] & 128;\n if (negative) {\n negate(bytes);\n }\n\n return parseInt(bytes.toString('hex'), 16) * (negative ? -1 : 1);\n};\n\nInt64.prototype.toString = function() {\n return String(this.valueOf());\n};\n\n/**\n * @param {Buffer} bytes\n *\n * @api private\n */\nfunction negate(bytes) {\n for (var i = 0; i < 8; i++) {\n bytes[i] ^= 0xFF;\n }\n for (var i = 7; i > -1; i--) {\n bytes[i]++;\n if (bytes[i] !== 0) {\n break;\n }\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n Int64: Int64\n};\n","var parseMessage = require('./parse-message').parseMessage;\n\n/**\n *\n * @param {*} parser\n * @param {Buffer} message\n * @param {*} shape\n * @api private\n */\nfunction parseEvent(parser, message, shape) {\n var parsedMessage = parseMessage(message);\n\n // check if message is an event or error\n var messageType = parsedMessage.headers[':message-type'];\n if (messageType) {\n if (messageType.value === 'error') {\n throw parseError(parsedMessage);\n } else if (messageType.value !== 'event') {\n // not sure how to parse non-events/non-errors, ignore for now\n return;\n }\n }\n\n // determine event type\n var eventType = parsedMessage.headers[':event-type'];\n // check that the event type is modeled\n var eventModel = shape.members[eventType.value];\n if (!eventModel) {\n return;\n }\n\n var result = {};\n // check if an event payload exists\n var eventPayloadMemberName = eventModel.eventPayloadMemberName;\n if (eventPayloadMemberName) {\n var payloadShape = eventModel.members[eventPayloadMemberName];\n // if the shape is binary, return the byte array\n if (payloadShape.type === 'binary') {\n result[eventPayloadMemberName] = parsedMessage.body;\n } else {\n result[eventPayloadMemberName] = parser.parse(parsedMessage.body.toString(), payloadShape);\n }\n }\n\n // read event headers\n var eventHeaderNames = eventModel.eventHeaderMemberNames;\n for (var i = 0; i < eventHeaderNames.length; i++) {\n var name = eventHeaderNames[i];\n if (parsedMessage.headers[name]) {\n // parse the header!\n result[name] = eventModel.members[name].toType(parsedMessage.headers[name].value);\n }\n }\n\n var output = {};\n output[eventType.value] = result;\n return output;\n}\n\nfunction parseError(message) {\n var errorCode = message.headers[':error-code'];\n var errorMessage = message.headers[':error-message'];\n var error = new Error(errorMessage.value || errorMessage);\n error.code = error.name = errorCode.value || errorCode;\n return error;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n parseEvent: parseEvent\n};\n","var Int64 = require('./int64').Int64;\n\nvar splitMessage = require('./split-message').splitMessage;\n\nvar BOOLEAN_TAG = 'boolean';\nvar BYTE_TAG = 'byte';\nvar SHORT_TAG = 'short';\nvar INT_TAG = 'integer';\nvar LONG_TAG = 'long';\nvar BINARY_TAG = 'binary';\nvar STRING_TAG = 'string';\nvar TIMESTAMP_TAG = 'timestamp';\nvar UUID_TAG = 'uuid';\n\n/**\n * @api private\n *\n * @param {Buffer} headers\n */\nfunction parseHeaders(headers) {\n var out = {};\n var position = 0;\n while (position < headers.length) {\n var nameLength = headers.readUInt8(position++);\n var name = headers.slice(position, position + nameLength).toString();\n position += nameLength;\n switch (headers.readUInt8(position++)) {\n case 0 /* boolTrue */:\n out[name] = {\n type: BOOLEAN_TAG,\n value: true\n };\n break;\n case 1 /* boolFalse */:\n out[name] = {\n type: BOOLEAN_TAG,\n value: false\n };\n break;\n case 2 /* byte */:\n out[name] = {\n type: BYTE_TAG,\n value: headers.readInt8(position++)\n };\n break;\n case 3 /* short */:\n out[name] = {\n type: SHORT_TAG,\n value: headers.readInt16BE(position)\n };\n position += 2;\n break;\n case 4 /* integer */:\n out[name] = {\n type: INT_TAG,\n value: headers.readInt32BE(position)\n };\n position += 4;\n break;\n case 5 /* long */:\n out[name] = {\n type: LONG_TAG,\n value: new Int64(headers.slice(position, position + 8))\n };\n position += 8;\n break;\n case 6 /* byteArray */:\n var binaryLength = headers.readUInt16BE(position);\n position += 2;\n out[name] = {\n type: BINARY_TAG,\n value: headers.slice(position, position + binaryLength)\n };\n position += binaryLength;\n break;\n case 7 /* string */:\n var stringLength = headers.readUInt16BE(position);\n position += 2;\n out[name] = {\n type: STRING_TAG,\n value: headers.slice(\n position,\n position + stringLength\n ).toString()\n };\n position += stringLength;\n break;\n case 8 /* timestamp */:\n out[name] = {\n type: TIMESTAMP_TAG,\n value: new Date(\n new Int64(headers.slice(position, position + 8))\n .valueOf()\n )\n };\n position += 8;\n break;\n case 9 /* uuid */:\n var uuidChars = headers.slice(position, position + 16)\n .toString('hex');\n position += 16;\n out[name] = {\n type: UUID_TAG,\n value: uuidChars.substr(0, 8) + '-' +\n uuidChars.substr(8, 4) + '-' +\n uuidChars.substr(12, 4) + '-' +\n uuidChars.substr(16, 4) + '-' +\n uuidChars.substr(20)\n };\n break;\n default:\n throw new Error('Unrecognized header type tag');\n }\n }\n return out;\n}\n\nfunction parseMessage(message) {\n var parsed = splitMessage(message);\n return { headers: parseHeaders(parsed.headers), body: parsed.body };\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n parseMessage: parseMessage\n};\n","var util = require('../core').util;\nvar toBuffer = util.buffer.toBuffer;\n\n// All prelude components are unsigned, 32-bit integers\nvar PRELUDE_MEMBER_LENGTH = 4;\n// The prelude consists of two components\nvar PRELUDE_LENGTH = PRELUDE_MEMBER_LENGTH * 2;\n// Checksums are always CRC32 hashes.\nvar CHECKSUM_LENGTH = 4;\n// Messages must include a full prelude, a prelude checksum, and a message checksum\nvar MINIMUM_MESSAGE_LENGTH = PRELUDE_LENGTH + CHECKSUM_LENGTH * 2;\n\n/**\n * @api private\n *\n * @param {Buffer} message\n */\nfunction splitMessage(message) {\n if (!util.Buffer.isBuffer(message)) message = toBuffer(message);\n\n if (message.length < MINIMUM_MESSAGE_LENGTH) {\n throw new Error('Provided message too short to accommodate event stream message overhead');\n }\n\n if (message.length !== message.readUInt32BE(0)) {\n throw new Error('Reported message length does not match received message length');\n }\n\n var expectedPreludeChecksum = message.readUInt32BE(PRELUDE_LENGTH);\n\n if (\n expectedPreludeChecksum !== util.crypto.crc32(\n message.slice(0, PRELUDE_LENGTH)\n )\n ) {\n throw new Error(\n 'The prelude checksum specified in the message (' +\n expectedPreludeChecksum +\n ') does not match the calculated CRC32 checksum.'\n );\n }\n\n var expectedMessageChecksum = message.readUInt32BE(message.length - CHECKSUM_LENGTH);\n\n if (\n expectedMessageChecksum !== util.crypto.crc32(\n message.slice(0, message.length - CHECKSUM_LENGTH)\n )\n ) {\n throw new Error(\n 'The message checksum did not match the expected value of ' +\n expectedMessageChecksum\n );\n }\n\n var headersStart = PRELUDE_LENGTH + CHECKSUM_LENGTH;\n var headersEnd = headersStart + message.readUInt32BE(PRELUDE_MEMBER_LENGTH);\n\n return {\n headers: message.slice(headersStart, headersEnd),\n body: message.slice(headersEnd, message.length - CHECKSUM_LENGTH),\n };\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n splitMessage: splitMessage\n};\n","/**\n * What is necessary to create an event stream in node?\n * - http response stream\n * - parser\n * - event stream model\n */\n\nvar EventMessageChunkerStream = require('../event-stream/event-message-chunker-stream').EventMessageChunkerStream;\nvar EventUnmarshallerStream = require('../event-stream/event-message-unmarshaller-stream').EventUnmarshallerStream;\n\nfunction createEventStream(stream, parser, model) {\n var eventStream = new EventUnmarshallerStream({\n parser: parser,\n eventStreamModel: model\n });\n\n var eventMessageChunker = new EventMessageChunkerStream();\n\n stream.pipe(\n eventMessageChunker\n ).pipe(eventStream);\n\n stream.on('error', function(err) {\n eventMessageChunker.emit('error', err);\n });\n\n eventMessageChunker.on('error', function(err) {\n eventStream.emit('error', err);\n });\n\n return eventStream;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n createEventStream: createEventStream\n};\n","var AWS = require('./core');\nvar SequentialExecutor = require('./sequential_executor');\nvar DISCOVER_ENDPOINT = require('./discover_endpoint').discoverEndpoint;\n/**\n * The namespace used to register global event listeners for request building\n * and sending.\n */\nAWS.EventListeners = {\n /**\n * @!attribute VALIDATE_CREDENTIALS\n * A request listener that validates whether the request is being\n * sent with credentials.\n * Handles the {AWS.Request~validate 'validate' Request event}\n * @example Sending a request without validating credentials\n * var listener = AWS.EventListeners.Core.VALIDATE_CREDENTIALS;\n * request.removeListener('validate', listener);\n * @readonly\n * @return [Function]\n * @!attribute VALIDATE_REGION\n * A request listener that validates whether the region is set\n * for a request.\n * Handles the {AWS.Request~validate 'validate' Request event}\n * @example Sending a request without validating region configuration\n * var listener = AWS.EventListeners.Core.VALIDATE_REGION;\n * request.removeListener('validate', listener);\n * @readonly\n * @return [Function]\n * @!attribute VALIDATE_PARAMETERS\n * A request listener that validates input parameters in a request.\n * Handles the {AWS.Request~validate 'validate' Request event}\n * @example Sending a request without validating parameters\n * var listener = AWS.EventListeners.Core.VALIDATE_PARAMETERS;\n * request.removeListener('validate', listener);\n * @example Disable parameter validation globally\n * AWS.EventListeners.Core.removeListener('validate',\n * AWS.EventListeners.Core.VALIDATE_REGION);\n * @readonly\n * @return [Function]\n * @!attribute SEND\n * A request listener that initiates the HTTP connection for a\n * request being sent. Handles the {AWS.Request~send 'send' Request event}\n * @example Replacing the HTTP handler\n * var listener = AWS.EventListeners.Core.SEND;\n * request.removeListener('send', listener);\n * request.on('send', function(response) {\n * customHandler.send(response);\n * });\n * @return [Function]\n * @readonly\n * @!attribute HTTP_DATA\n * A request listener that reads data from the HTTP connection in order\n * to build the response data.\n * Handles the {AWS.Request~httpData 'httpData' Request event}.\n * Remove this handler if you are overriding the 'httpData' event and\n * do not want extra data processing and buffering overhead.\n * @example Disabling default data processing\n * var listener = AWS.EventListeners.Core.HTTP_DATA;\n * request.removeListener('httpData', listener);\n * @return [Function]\n * @readonly\n */\n Core: {} /* doc hack */\n};\n\n/**\n * @api private\n */\nfunction getOperationAuthtype(req) {\n if (!req.service.api.operations) {\n return '';\n }\n var operation = req.service.api.operations[req.operation];\n return operation ? operation.authtype : '';\n}\n\n/**\n * @api private\n */\nfunction getIdentityType(req) {\n var service = req.service;\n\n if (service.config.signatureVersion) {\n return service.config.signatureVersion;\n }\n\n if (service.api.signatureVersion) {\n return service.api.signatureVersion;\n }\n\n return getOperationAuthtype(req);\n}\n\nAWS.EventListeners = {\n Core: new SequentialExecutor().addNamedListeners(function(add, addAsync) {\n addAsync(\n 'VALIDATE_CREDENTIALS', 'validate',\n function VALIDATE_CREDENTIALS(req, done) {\n if (!req.service.api.signatureVersion && !req.service.config.signatureVersion) return done(); // none\n\n var identityType = getIdentityType(req);\n if (identityType === 'bearer') {\n req.service.config.getToken(function(err) {\n if (err) {\n req.response.error = AWS.util.error(err, {code: 'TokenError'});\n }\n done();\n });\n return;\n }\n\n req.service.config.getCredentials(function(err) {\n if (err) {\n req.response.error = AWS.util.error(err,\n {\n code: 'CredentialsError',\n message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1'\n }\n );\n }\n done();\n });\n });\n\n add('VALIDATE_REGION', 'validate', function VALIDATE_REGION(req) {\n if (!req.service.isGlobalEndpoint) {\n var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);\n if (!req.service.config.region) {\n req.response.error = AWS.util.error(new Error(),\n {code: 'ConfigError', message: 'Missing region in config'});\n } else if (!dnsHostRegex.test(req.service.config.region)) {\n req.response.error = AWS.util.error(new Error(),\n {code: 'ConfigError', message: 'Invalid region in config'});\n }\n }\n });\n\n add('BUILD_IDEMPOTENCY_TOKENS', 'validate', function BUILD_IDEMPOTENCY_TOKENS(req) {\n if (!req.service.api.operations) {\n return;\n }\n var operation = req.service.api.operations[req.operation];\n if (!operation) {\n return;\n }\n var idempotentMembers = operation.idempotentMembers;\n if (!idempotentMembers.length) {\n return;\n }\n // creates a copy of params so user's param object isn't mutated\n var params = AWS.util.copy(req.params);\n for (var i = 0, iLen = idempotentMembers.length; i < iLen; i++) {\n if (!params[idempotentMembers[i]]) {\n // add the member\n params[idempotentMembers[i]] = AWS.util.uuid.v4();\n }\n }\n req.params = params;\n });\n\n add('VALIDATE_PARAMETERS', 'validate', function VALIDATE_PARAMETERS(req) {\n if (!req.service.api.operations) {\n return;\n }\n var rules = req.service.api.operations[req.operation].input;\n var validation = req.service.config.paramValidation;\n new AWS.ParamValidator(validation).validate(rules, req.params);\n });\n\n add('COMPUTE_CHECKSUM', 'afterBuild', function COMPUTE_CHECKSUM(req) {\n if (!req.service.api.operations) {\n return;\n }\n var operation = req.service.api.operations[req.operation];\n if (!operation) {\n return;\n }\n var body = req.httpRequest.body;\n var isNonStreamingPayload = body && (AWS.util.Buffer.isBuffer(body) || typeof body === 'string');\n var headers = req.httpRequest.headers;\n if (\n operation.httpChecksumRequired &&\n req.service.config.computeChecksums &&\n isNonStreamingPayload &&\n !headers['Content-MD5']\n ) {\n var md5 = AWS.util.crypto.md5(body, 'base64');\n headers['Content-MD5'] = md5;\n }\n });\n\n addAsync('COMPUTE_SHA256', 'afterBuild', function COMPUTE_SHA256(req, done) {\n req.haltHandlersOnError();\n if (!req.service.api.operations) {\n return;\n }\n var operation = req.service.api.operations[req.operation];\n var authtype = operation ? operation.authtype : '';\n if (!req.service.api.signatureVersion && !authtype && !req.service.config.signatureVersion) return done(); // none\n if (req.service.getSignerClass(req) === AWS.Signers.V4) {\n var body = req.httpRequest.body || '';\n if (authtype.indexOf('unsigned-body') >= 0) {\n req.httpRequest.headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD';\n return done();\n }\n AWS.util.computeSha256(body, function(err, sha) {\n if (err) {\n done(err);\n }\n else {\n req.httpRequest.headers['X-Amz-Content-Sha256'] = sha;\n done();\n }\n });\n } else {\n done();\n }\n });\n\n add('SET_CONTENT_LENGTH', 'afterBuild', function SET_CONTENT_LENGTH(req) {\n var authtype = getOperationAuthtype(req);\n var payloadMember = AWS.util.getRequestPayloadShape(req);\n if (req.httpRequest.headers['Content-Length'] === undefined) {\n try {\n var length = AWS.util.string.byteLength(req.httpRequest.body);\n req.httpRequest.headers['Content-Length'] = length;\n } catch (err) {\n if (payloadMember && payloadMember.isStreaming) {\n if (payloadMember.requiresLength) {\n //streaming payload requires length(s3, glacier)\n throw err;\n } else if (authtype.indexOf('unsigned-body') >= 0) {\n //unbounded streaming payload(lex, mediastore)\n req.httpRequest.headers['Transfer-Encoding'] = 'chunked';\n return;\n } else {\n throw err;\n }\n }\n throw err;\n }\n }\n });\n\n add('SET_HTTP_HOST', 'afterBuild', function SET_HTTP_HOST(req) {\n req.httpRequest.headers['Host'] = req.httpRequest.endpoint.host;\n });\n\n add('SET_TRACE_ID', 'afterBuild', function SET_TRACE_ID(req) {\n var traceIdHeaderName = 'X-Amzn-Trace-Id';\n if (AWS.util.isNode() && !Object.hasOwnProperty.call(req.httpRequest.headers, traceIdHeaderName)) {\n var ENV_LAMBDA_FUNCTION_NAME = 'AWS_LAMBDA_FUNCTION_NAME';\n var ENV_TRACE_ID = '_X_AMZN_TRACE_ID';\n var functionName = process.env[ENV_LAMBDA_FUNCTION_NAME];\n var traceId = process.env[ENV_TRACE_ID];\n if (\n typeof functionName === 'string' &&\n functionName.length > 0 &&\n typeof traceId === 'string' &&\n traceId.length > 0\n ) {\n req.httpRequest.headers[traceIdHeaderName] = traceId;\n }\n }\n });\n\n add('RESTART', 'restart', function RESTART() {\n var err = this.response.error;\n if (!err || !err.retryable) return;\n\n this.httpRequest = new AWS.HttpRequest(\n this.service.endpoint,\n this.service.region\n );\n\n if (this.response.retryCount < this.service.config.maxRetries) {\n this.response.retryCount++;\n } else {\n this.response.error = null;\n }\n });\n\n var addToHead = true;\n addAsync('DISCOVER_ENDPOINT', 'sign', DISCOVER_ENDPOINT, addToHead);\n\n addAsync('SIGN', 'sign', function SIGN(req, done) {\n var service = req.service;\n var identityType = getIdentityType(req);\n if (!identityType || identityType.length === 0) return done(); // none\n\n if (identityType === 'bearer') {\n service.config.getToken(function (err, token) {\n if (err) {\n req.response.error = err;\n return done();\n }\n\n try {\n var SignerClass = service.getSignerClass(req);\n var signer = new SignerClass(req.httpRequest);\n signer.addAuthorization(token);\n } catch (e) {\n req.response.error = e;\n }\n done();\n });\n } else {\n service.config.getCredentials(function (err, credentials) {\n if (err) {\n req.response.error = err;\n return done();\n }\n\n try {\n var date = service.getSkewCorrectedDate();\n var SignerClass = service.getSignerClass(req);\n var operations = req.service.api.operations || {};\n var operation = operations[req.operation];\n var signer = new SignerClass(req.httpRequest,\n service.getSigningName(req),\n {\n signatureCache: service.config.signatureCache,\n operation: operation,\n signatureVersion: service.api.signatureVersion\n });\n signer.setServiceClientId(service._clientId);\n\n // clear old authorization headers\n delete req.httpRequest.headers['Authorization'];\n delete req.httpRequest.headers['Date'];\n delete req.httpRequest.headers['X-Amz-Date'];\n\n // add new authorization\n signer.addAuthorization(credentials, date);\n req.signedAt = date;\n } catch (e) {\n req.response.error = e;\n }\n done();\n });\n\n }\n });\n\n add('VALIDATE_RESPONSE', 'validateResponse', function VALIDATE_RESPONSE(resp) {\n if (this.service.successfulResponse(resp, this)) {\n resp.data = {};\n resp.error = null;\n } else {\n resp.data = null;\n resp.error = AWS.util.error(new Error(),\n {code: 'UnknownError', message: 'An unknown error occurred.'});\n }\n });\n\n add('ERROR', 'error', function ERROR(err, resp) {\n var awsQueryCompatible = resp.request.service.api.awsQueryCompatible;\n if (awsQueryCompatible) {\n var headers = resp.httpResponse.headers;\n var queryErrorCode = headers ? headers['x-amzn-query-error'] : undefined;\n if (queryErrorCode && queryErrorCode.includes(';')) {\n resp.error.code = queryErrorCode.split(';')[0];\n }\n }\n }, true);\n\n addAsync('SEND', 'send', function SEND(resp, done) {\n resp.httpResponse._abortCallback = done;\n resp.error = null;\n resp.data = null;\n\n function callback(httpResp) {\n resp.httpResponse.stream = httpResp;\n var stream = resp.request.httpRequest.stream;\n var service = resp.request.service;\n var api = service.api;\n var operationName = resp.request.operation;\n var operation = api.operations[operationName] || {};\n\n httpResp.on('headers', function onHeaders(statusCode, headers, statusMessage) {\n resp.request.emit(\n 'httpHeaders',\n [statusCode, headers, resp, statusMessage]\n );\n\n if (!resp.httpResponse.streaming) {\n if (AWS.HttpClient.streamsApiVersion === 2) { // streams2 API check\n // if we detect event streams, we're going to have to\n // return the stream immediately\n if (operation.hasEventOutput && service.successfulResponse(resp)) {\n // skip reading the IncomingStream\n resp.request.emit('httpDone');\n done();\n return;\n }\n\n httpResp.on('readable', function onReadable() {\n var data = httpResp.read();\n if (data !== null) {\n resp.request.emit('httpData', [data, resp]);\n }\n });\n } else { // legacy streams API\n httpResp.on('data', function onData(data) {\n resp.request.emit('httpData', [data, resp]);\n });\n }\n }\n });\n\n httpResp.on('end', function onEnd() {\n if (!stream || !stream.didCallback) {\n if (AWS.HttpClient.streamsApiVersion === 2 && (operation.hasEventOutput && service.successfulResponse(resp))) {\n // don't concatenate response chunks when streaming event stream data when response is successful\n return;\n }\n resp.request.emit('httpDone');\n done();\n }\n });\n }\n\n function progress(httpResp) {\n httpResp.on('sendProgress', function onSendProgress(value) {\n resp.request.emit('httpUploadProgress', [value, resp]);\n });\n\n httpResp.on('receiveProgress', function onReceiveProgress(value) {\n resp.request.emit('httpDownloadProgress', [value, resp]);\n });\n }\n\n function error(err) {\n if (err.code !== 'RequestAbortedError') {\n var errCode = err.code === 'TimeoutError' ? err.code : 'NetworkingError';\n err = AWS.util.error(err, {\n code: errCode,\n region: resp.request.httpRequest.region,\n hostname: resp.request.httpRequest.endpoint.hostname,\n retryable: true\n });\n }\n resp.error = err;\n resp.request.emit('httpError', [resp.error, resp], function() {\n done();\n });\n }\n\n function executeSend() {\n var http = AWS.HttpClient.getInstance();\n var httpOptions = resp.request.service.config.httpOptions || {};\n try {\n var stream = http.handleRequest(resp.request.httpRequest, httpOptions,\n callback, error);\n progress(stream);\n } catch (err) {\n error(err);\n }\n }\n var timeDiff = (resp.request.service.getSkewCorrectedDate() - this.signedAt) / 1000;\n if (timeDiff >= 60 * 10) { // if we signed 10min ago, re-sign\n this.emit('sign', [this], function(err) {\n if (err) done(err);\n else executeSend();\n });\n } else {\n executeSend();\n }\n });\n\n add('HTTP_HEADERS', 'httpHeaders',\n function HTTP_HEADERS(statusCode, headers, resp, statusMessage) {\n resp.httpResponse.statusCode = statusCode;\n resp.httpResponse.statusMessage = statusMessage;\n resp.httpResponse.headers = headers;\n resp.httpResponse.body = AWS.util.buffer.toBuffer('');\n resp.httpResponse.buffers = [];\n resp.httpResponse.numBytes = 0;\n var dateHeader = headers.date || headers.Date;\n var service = resp.request.service;\n if (dateHeader) {\n var serverTime = Date.parse(dateHeader);\n if (service.config.correctClockSkew\n && service.isClockSkewed(serverTime)) {\n service.applyClockOffset(serverTime);\n }\n }\n });\n\n add('HTTP_DATA', 'httpData', function HTTP_DATA(chunk, resp) {\n if (chunk) {\n if (AWS.util.isNode()) {\n resp.httpResponse.numBytes += chunk.length;\n\n var total = resp.httpResponse.headers['content-length'];\n var progress = { loaded: resp.httpResponse.numBytes, total: total };\n resp.request.emit('httpDownloadProgress', [progress, resp]);\n }\n\n resp.httpResponse.buffers.push(AWS.util.buffer.toBuffer(chunk));\n }\n });\n\n add('HTTP_DONE', 'httpDone', function HTTP_DONE(resp) {\n // convert buffers array into single buffer\n if (resp.httpResponse.buffers && resp.httpResponse.buffers.length > 0) {\n var body = AWS.util.buffer.concat(resp.httpResponse.buffers);\n resp.httpResponse.body = body;\n }\n delete resp.httpResponse.numBytes;\n delete resp.httpResponse.buffers;\n });\n\n add('FINALIZE_ERROR', 'retry', function FINALIZE_ERROR(resp) {\n if (resp.httpResponse.statusCode) {\n resp.error.statusCode = resp.httpResponse.statusCode;\n if (resp.error.retryable === undefined) {\n resp.error.retryable = this.service.retryableError(resp.error, this);\n }\n }\n });\n\n add('INVALIDATE_CREDENTIALS', 'retry', function INVALIDATE_CREDENTIALS(resp) {\n if (!resp.error) return;\n switch (resp.error.code) {\n case 'RequestExpired': // EC2 only\n case 'ExpiredTokenException':\n case 'ExpiredToken':\n resp.error.retryable = true;\n resp.request.service.config.credentials.expired = true;\n }\n });\n\n add('EXPIRED_SIGNATURE', 'retry', function EXPIRED_SIGNATURE(resp) {\n var err = resp.error;\n if (!err) return;\n if (typeof err.code === 'string' && typeof err.message === 'string') {\n if (err.code.match(/Signature/) && err.message.match(/expired/)) {\n resp.error.retryable = true;\n }\n }\n });\n\n add('CLOCK_SKEWED', 'retry', function CLOCK_SKEWED(resp) {\n if (!resp.error) return;\n if (this.service.clockSkewError(resp.error)\n && this.service.config.correctClockSkew) {\n resp.error.retryable = true;\n }\n });\n\n add('REDIRECT', 'retry', function REDIRECT(resp) {\n if (resp.error && resp.error.statusCode >= 300 &&\n resp.error.statusCode < 400 && resp.httpResponse.headers['location']) {\n this.httpRequest.endpoint =\n new AWS.Endpoint(resp.httpResponse.headers['location']);\n this.httpRequest.headers['Host'] = this.httpRequest.endpoint.host;\n resp.error.redirect = true;\n resp.error.retryable = true;\n }\n });\n\n add('RETRY_CHECK', 'retry', function RETRY_CHECK(resp) {\n if (resp.error) {\n if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) {\n resp.error.retryDelay = 0;\n } else if (resp.retryCount < resp.maxRetries) {\n resp.error.retryDelay = this.service.retryDelays(resp.retryCount, resp.error) || 0;\n }\n }\n });\n\n addAsync('RESET_RETRY_STATE', 'afterRetry', function RESET_RETRY_STATE(resp, done) {\n var delay, willRetry = false;\n\n if (resp.error) {\n delay = resp.error.retryDelay || 0;\n if (resp.error.retryable && resp.retryCount < resp.maxRetries) {\n resp.retryCount++;\n willRetry = true;\n } else if (resp.error.redirect && resp.redirectCount < resp.maxRedirects) {\n resp.redirectCount++;\n willRetry = true;\n }\n }\n\n // delay < 0 is a signal from customBackoff to skip retries\n if (willRetry && delay >= 0) {\n resp.error = null;\n setTimeout(done, delay);\n } else {\n done();\n }\n });\n }),\n\n CorePost: new SequentialExecutor().addNamedListeners(function(add) {\n add('EXTRACT_REQUEST_ID', 'extractData', AWS.util.extractRequestId);\n add('EXTRACT_REQUEST_ID', 'extractError', AWS.util.extractRequestId);\n\n add('ENOTFOUND_ERROR', 'httpError', function ENOTFOUND_ERROR(err) {\n function isDNSError(err) {\n return err.errno === 'ENOTFOUND' ||\n typeof err.errno === 'number' &&\n typeof AWS.util.getSystemErrorName === 'function' &&\n ['EAI_NONAME', 'EAI_NODATA'].indexOf(AWS.util.getSystemErrorName(err.errno) >= 0);\n }\n if (err.code === 'NetworkingError' && isDNSError(err)) {\n var message = 'Inaccessible host: `' + err.hostname + '\\' at port `' + err.port +\n '\\'. This service may not be available in the `' + err.region +\n '\\' region.';\n this.response.error = AWS.util.error(new Error(message), {\n code: 'UnknownEndpoint',\n region: err.region,\n hostname: err.hostname,\n retryable: true,\n originalError: err\n });\n }\n });\n }),\n\n Logger: new SequentialExecutor().addNamedListeners(function(add) {\n add('LOG_REQUEST', 'complete', function LOG_REQUEST(resp) {\n var req = resp.request;\n var logger = req.service.config.logger;\n if (!logger) return;\n function filterSensitiveLog(inputShape, shape) {\n if (!shape) {\n return shape;\n }\n if (inputShape.isSensitive) {\n return '***SensitiveInformation***';\n }\n switch (inputShape.type) {\n case 'structure':\n var struct = {};\n AWS.util.each(shape, function(subShapeName, subShape) {\n if (Object.prototype.hasOwnProperty.call(inputShape.members, subShapeName)) {\n struct[subShapeName] = filterSensitiveLog(inputShape.members[subShapeName], subShape);\n } else {\n struct[subShapeName] = subShape;\n }\n });\n return struct;\n case 'list':\n var list = [];\n AWS.util.arrayEach(shape, function(subShape, index) {\n list.push(filterSensitiveLog(inputShape.member, subShape));\n });\n return list;\n case 'map':\n var map = {};\n AWS.util.each(shape, function(key, value) {\n map[key] = filterSensitiveLog(inputShape.value, value);\n });\n return map;\n default:\n return shape;\n }\n }\n\n function buildMessage() {\n var time = resp.request.service.getSkewCorrectedDate().getTime();\n var delta = (time - req.startTime.getTime()) / 1000;\n var ansi = logger.isTTY ? true : false;\n var status = resp.httpResponse.statusCode;\n var censoredParams = req.params;\n if (\n req.service.api.operations &&\n req.service.api.operations[req.operation] &&\n req.service.api.operations[req.operation].input\n ) {\n var inputShape = req.service.api.operations[req.operation].input;\n censoredParams = filterSensitiveLog(inputShape, req.params);\n }\n var params = require('util').inspect(censoredParams, true, null);\n var message = '';\n if (ansi) message += '\\x1B[33m';\n message += '[AWS ' + req.service.serviceIdentifier + ' ' + status;\n message += ' ' + delta.toString() + 's ' + resp.retryCount + ' retries]';\n if (ansi) message += '\\x1B[0;1m';\n message += ' ' + AWS.util.string.lowerFirst(req.operation);\n message += '(' + params + ')';\n if (ansi) message += '\\x1B[0m';\n return message;\n }\n\n var line = buildMessage();\n if (typeof logger.log === 'function') {\n logger.log(line);\n } else if (typeof logger.write === 'function') {\n logger.write(line + '\\n');\n }\n });\n }),\n\n Json: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/json');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n }),\n\n Rest: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/rest');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n }),\n\n RestJson: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/rest_json');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n add('UNSET_CONTENT_LENGTH', 'afterBuild', svc.unsetContentLength);\n }),\n\n RestXml: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/rest_xml');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n }),\n\n Query: new SequentialExecutor().addNamedListeners(function(add) {\n var svc = require('./protocol/query');\n add('BUILD', 'build', svc.buildRequest);\n add('EXTRACT_DATA', 'extractData', svc.extractData);\n add('EXTRACT_ERROR', 'extractError', svc.extractError);\n })\n};\n","var AWS = require('./core');\nvar inherit = AWS.util.inherit;\n\n/**\n * The endpoint that a service will talk to, for example,\n * `'https://ec2.ap-southeast-1.amazonaws.com'`. If\n * you need to override an endpoint for a service, you can\n * set the endpoint on a service by passing the endpoint\n * object with the `endpoint` option key:\n *\n * ```javascript\n * var ep = new AWS.Endpoint('awsproxy.example.com');\n * var s3 = new AWS.S3({endpoint: ep});\n * s3.service.endpoint.hostname == 'awsproxy.example.com'\n * ```\n *\n * Note that if you do not specify a protocol, the protocol will\n * be selected based on your current {AWS.config} configuration.\n *\n * @!attribute protocol\n * @return [String] the protocol (http or https) of the endpoint\n * URL\n * @!attribute hostname\n * @return [String] the host portion of the endpoint, e.g.,\n * example.com\n * @!attribute host\n * @return [String] the host portion of the endpoint including\n * the port, e.g., example.com:80\n * @!attribute port\n * @return [Integer] the port of the endpoint\n * @!attribute href\n * @return [String] the full URL of the endpoint\n */\nAWS.Endpoint = inherit({\n\n /**\n * @overload Endpoint(endpoint)\n * Constructs a new endpoint given an endpoint URL. If the\n * URL omits a protocol (http or https), the default protocol\n * set in the global {AWS.config} will be used.\n * @param endpoint [String] the URL to construct an endpoint from\n */\n constructor: function Endpoint(endpoint, config) {\n AWS.util.hideProperties(this, ['slashes', 'auth', 'hash', 'search', 'query']);\n\n if (typeof endpoint === 'undefined' || endpoint === null) {\n throw new Error('Invalid endpoint: ' + endpoint);\n } else if (typeof endpoint !== 'string') {\n return AWS.util.copy(endpoint);\n }\n\n if (!endpoint.match(/^http/)) {\n var useSSL = config && config.sslEnabled !== undefined ?\n config.sslEnabled : AWS.config.sslEnabled;\n endpoint = (useSSL ? 'https' : 'http') + '://' + endpoint;\n }\n\n AWS.util.update(this, AWS.util.urlParse(endpoint));\n\n // Ensure the port property is set as an integer\n if (this.port) {\n this.port = parseInt(this.port, 10);\n } else {\n this.port = this.protocol === 'https:' ? 443 : 80;\n }\n }\n\n});\n\n/**\n * The low level HTTP request object, encapsulating all HTTP header\n * and body data sent by a service request.\n *\n * @!attribute method\n * @return [String] the HTTP method of the request\n * @!attribute path\n * @return [String] the path portion of the URI, e.g.,\n * \"/list/?start=5&num=10\"\n * @!attribute headers\n * @return [map]\n * a map of header keys and their respective values\n * @!attribute body\n * @return [String] the request body payload\n * @!attribute endpoint\n * @return [AWS.Endpoint] the endpoint for the request\n * @!attribute region\n * @api private\n * @return [String] the region, for signing purposes only.\n */\nAWS.HttpRequest = inherit({\n\n /**\n * @api private\n */\n constructor: function HttpRequest(endpoint, region) {\n endpoint = new AWS.Endpoint(endpoint);\n this.method = 'POST';\n this.path = endpoint.path || '/';\n this.headers = {};\n this.body = '';\n this.endpoint = endpoint;\n this.region = region;\n this._userAgent = '';\n this.setUserAgent();\n },\n\n /**\n * @api private\n */\n setUserAgent: function setUserAgent() {\n this._userAgent = this.headers[this.getUserAgentHeaderName()] = AWS.util.userAgent();\n },\n\n getUserAgentHeaderName: function getUserAgentHeaderName() {\n var prefix = AWS.util.isBrowser() ? 'X-Amz-' : '';\n return prefix + 'User-Agent';\n },\n\n /**\n * @api private\n */\n appendToUserAgent: function appendToUserAgent(agentPartial) {\n if (typeof agentPartial === 'string' && agentPartial) {\n this._userAgent += ' ' + agentPartial;\n }\n this.headers[this.getUserAgentHeaderName()] = this._userAgent;\n },\n\n /**\n * @api private\n */\n getUserAgent: function getUserAgent() {\n return this._userAgent;\n },\n\n /**\n * @return [String] the part of the {path} excluding the\n * query string\n */\n pathname: function pathname() {\n return this.path.split('?', 1)[0];\n },\n\n /**\n * @return [String] the query string portion of the {path}\n */\n search: function search() {\n var query = this.path.split('?', 2)[1];\n if (query) {\n query = AWS.util.queryStringParse(query);\n return AWS.util.queryParamsToString(query);\n }\n return '';\n },\n\n /**\n * @api private\n * update httpRequest endpoint with endpoint string\n */\n updateEndpoint: function updateEndpoint(endpointStr) {\n var newEndpoint = new AWS.Endpoint(endpointStr);\n this.endpoint = newEndpoint;\n this.path = newEndpoint.path || '/';\n if (this.headers['Host']) {\n this.headers['Host'] = newEndpoint.host;\n }\n }\n});\n\n/**\n * The low level HTTP response object, encapsulating all HTTP header\n * and body data returned from the request.\n *\n * @!attribute statusCode\n * @return [Integer] the HTTP status code of the response (e.g., 200, 404)\n * @!attribute headers\n * @return [map]\n * a map of response header keys and their respective values\n * @!attribute body\n * @return [String] the response body payload\n * @!attribute [r] streaming\n * @return [Boolean] whether this response is being streamed at a low-level.\n * Defaults to `false` (buffered reads). Do not modify this manually, use\n * {createUnbufferedStream} to convert the stream to unbuffered mode\n * instead.\n */\nAWS.HttpResponse = inherit({\n\n /**\n * @api private\n */\n constructor: function HttpResponse() {\n this.statusCode = undefined;\n this.headers = {};\n this.body = undefined;\n this.streaming = false;\n this.stream = null;\n },\n\n /**\n * Disables buffering on the HTTP response and returns the stream for reading.\n * @return [Stream, XMLHttpRequest, null] the underlying stream object.\n * Use this object to directly read data off of the stream.\n * @note This object is only available after the {AWS.Request~httpHeaders}\n * event has fired. This method must be called prior to\n * {AWS.Request~httpData}.\n * @example Taking control of a stream\n * request.on('httpHeaders', function(statusCode, headers) {\n * if (statusCode < 300) {\n * if (headers.etag === 'xyz') {\n * // pipe the stream, disabling buffering\n * var stream = this.response.httpResponse.createUnbufferedStream();\n * stream.pipe(process.stdout);\n * } else { // abort this request and set a better error message\n * this.abort();\n * this.response.error = new Error('Invalid ETag');\n * }\n * }\n * }).send(console.log);\n */\n createUnbufferedStream: function createUnbufferedStream() {\n this.streaming = true;\n return this.stream;\n }\n});\n\n\nAWS.HttpClient = inherit({});\n\n/**\n * @api private\n */\nAWS.HttpClient.getInstance = function getInstance() {\n if (this.singleton === undefined) {\n this.singleton = new this();\n }\n return this.singleton;\n};\n","var AWS = require('../core');\nvar Stream = AWS.util.stream.Stream;\nvar TransformStream = AWS.util.stream.Transform;\nvar ReadableStream = AWS.util.stream.Readable;\nrequire('../http');\nvar CONNECTION_REUSE_ENV_NAME = 'AWS_NODEJS_CONNECTION_REUSE_ENABLED';\n\n/**\n * @api private\n */\nAWS.NodeHttpClient = AWS.util.inherit({\n handleRequest: function handleRequest(httpRequest, httpOptions, callback, errCallback) {\n var self = this;\n var endpoint = httpRequest.endpoint;\n var pathPrefix = '';\n if (!httpOptions) httpOptions = {};\n if (httpOptions.proxy) {\n pathPrefix = endpoint.protocol + '//' + endpoint.hostname;\n if (endpoint.port !== 80 && endpoint.port !== 443) {\n pathPrefix += ':' + endpoint.port;\n }\n endpoint = new AWS.Endpoint(httpOptions.proxy);\n }\n\n var useSSL = endpoint.protocol === 'https:';\n var http = useSSL ? require('https') : require('http');\n var options = {\n host: endpoint.hostname,\n port: endpoint.port,\n method: httpRequest.method,\n headers: httpRequest.headers,\n path: pathPrefix + httpRequest.path\n };\n\n AWS.util.update(options, httpOptions);\n\n if (!httpOptions.agent) {\n options.agent = this.getAgent(useSSL, {\n keepAlive: process.env[CONNECTION_REUSE_ENV_NAME] === '1' ? true : false\n });\n }\n\n delete options.proxy; // proxy isn't an HTTP option\n delete options.timeout; // timeout isn't an HTTP option\n\n var stream = http.request(options, function (httpResp) {\n if (stream.didCallback) return;\n\n callback(httpResp);\n httpResp.emit(\n 'headers',\n httpResp.statusCode,\n httpResp.headers,\n httpResp.statusMessage\n );\n });\n httpRequest.stream = stream; // attach stream to httpRequest\n stream.didCallback = false;\n\n // connection timeout support\n if (httpOptions.connectTimeout) {\n var connectTimeoutId;\n stream.on('socket', function(socket) {\n if (socket.connecting) {\n connectTimeoutId = setTimeout(function connectTimeout() {\n if (stream.didCallback) return; stream.didCallback = true;\n\n stream.abort();\n errCallback(AWS.util.error(\n new Error('Socket timed out without establishing a connection'),\n {code: 'TimeoutError'}\n ));\n }, httpOptions.connectTimeout);\n socket.on('connect', function() {\n clearTimeout(connectTimeoutId);\n connectTimeoutId = null;\n });\n }\n });\n }\n\n // timeout support\n stream.setTimeout(httpOptions.timeout || 0, function() {\n if (stream.didCallback) return; stream.didCallback = true;\n\n var msg = 'Connection timed out after ' + httpOptions.timeout + 'ms';\n errCallback(AWS.util.error(new Error(msg), {code: 'TimeoutError'}));\n stream.abort();\n });\n\n stream.on('error', function(err) {\n if (connectTimeoutId) {\n clearTimeout(connectTimeoutId);\n connectTimeoutId = null;\n }\n if (stream.didCallback) return; stream.didCallback = true;\n if ('ECONNRESET' === err.code || 'EPIPE' === err.code || 'ETIMEDOUT' === err.code) {\n errCallback(AWS.util.error(err, {code: 'TimeoutError'}));\n } else {\n errCallback(err);\n }\n });\n\n var expect = httpRequest.headers.Expect || httpRequest.headers.expect;\n if (expect === '100-continue') {\n stream.once('continue', function() {\n self.writeBody(stream, httpRequest);\n });\n } else {\n this.writeBody(stream, httpRequest);\n }\n\n return stream;\n },\n\n writeBody: function writeBody(stream, httpRequest) {\n var body = httpRequest.body;\n var totalBytes = parseInt(httpRequest.headers['Content-Length'], 10);\n\n if (body instanceof Stream) {\n // For progress support of streaming content -\n // pipe the data through a transform stream to emit 'sendProgress' events\n var progressStream = this.progressStream(stream, totalBytes);\n if (progressStream) {\n body.pipe(progressStream).pipe(stream);\n } else {\n body.pipe(stream);\n }\n } else if (body) {\n // The provided body is a buffer/string and is already fully available in memory -\n // For performance it's best to send it as a whole by calling stream.end(body),\n // Callers expect a 'sendProgress' event which is best emitted once\n // the http request stream has been fully written and all data flushed.\n // The use of totalBytes is important over body.length for strings where\n // length is char length and not byte length.\n stream.once('finish', function() {\n stream.emit('sendProgress', {\n loaded: totalBytes,\n total: totalBytes\n });\n });\n stream.end(body);\n } else {\n // no request body\n stream.end();\n }\n },\n\n /**\n * Create the https.Agent or http.Agent according to the request schema.\n */\n getAgent: function getAgent(useSSL, agentOptions) {\n var http = useSSL ? require('https') : require('http');\n if (useSSL) {\n if (!AWS.NodeHttpClient.sslAgent) {\n AWS.NodeHttpClient.sslAgent = new http.Agent(AWS.util.merge({\n rejectUnauthorized: process.env.NODE_TLS_REJECT_UNAUTHORIZED === '0' ? false : true\n }, agentOptions || {}));\n AWS.NodeHttpClient.sslAgent.setMaxListeners(0);\n\n // delegate maxSockets to globalAgent, set a default limit of 50 if current value is Infinity.\n // Users can bypass this default by supplying their own Agent as part of SDK configuration.\n Object.defineProperty(AWS.NodeHttpClient.sslAgent, 'maxSockets', {\n enumerable: true,\n get: function() {\n var defaultMaxSockets = 50;\n var globalAgent = http.globalAgent;\n if (globalAgent && globalAgent.maxSockets !== Infinity && typeof globalAgent.maxSockets === 'number') {\n return globalAgent.maxSockets;\n }\n return defaultMaxSockets;\n }\n });\n }\n return AWS.NodeHttpClient.sslAgent;\n } else {\n if (!AWS.NodeHttpClient.agent) {\n AWS.NodeHttpClient.agent = new http.Agent(agentOptions);\n }\n return AWS.NodeHttpClient.agent;\n }\n },\n\n progressStream: function progressStream(stream, totalBytes) {\n if (typeof TransformStream === 'undefined') {\n // for node 0.8 there is no streaming progress\n return;\n }\n var loadedBytes = 0;\n var reporter = new TransformStream();\n reporter._transform = function(chunk, encoding, callback) {\n if (chunk) {\n loadedBytes += chunk.length;\n stream.emit('sendProgress', {\n loaded: loadedBytes,\n total: totalBytes\n });\n }\n callback(null, chunk);\n };\n return reporter;\n },\n\n emitter: null\n});\n\n/**\n * @!ignore\n */\n\n/**\n * @api private\n */\nAWS.HttpClient.prototype = AWS.NodeHttpClient.prototype;\n\n/**\n * @api private\n */\nAWS.HttpClient.streamsApiVersion = ReadableStream ? 2 : 1;\n","var util = require('../util');\n\nfunction JsonBuilder() { }\n\nJsonBuilder.prototype.build = function(value, shape) {\n return JSON.stringify(translate(value, shape));\n};\n\nfunction translate(value, shape) {\n if (!shape || value === undefined || value === null) return undefined;\n\n switch (shape.type) {\n case 'structure': return translateStructure(value, shape);\n case 'map': return translateMap(value, shape);\n case 'list': return translateList(value, shape);\n default: return translateScalar(value, shape);\n }\n}\n\nfunction translateStructure(structure, shape) {\n if (shape.isDocument) {\n return structure;\n }\n var struct = {};\n util.each(structure, function(name, value) {\n var memberShape = shape.members[name];\n if (memberShape) {\n if (memberShape.location !== 'body') return;\n var locationName = memberShape.isLocationName ? memberShape.name : name;\n var result = translate(value, memberShape);\n if (result !== undefined) struct[locationName] = result;\n }\n });\n return struct;\n}\n\nfunction translateList(list, shape) {\n var out = [];\n util.arrayEach(list, function(value) {\n var result = translate(value, shape.member);\n if (result !== undefined) out.push(result);\n });\n return out;\n}\n\nfunction translateMap(map, shape) {\n var out = {};\n util.each(map, function(key, value) {\n var result = translate(value, shape.value);\n if (result !== undefined) out[key] = result;\n });\n return out;\n}\n\nfunction translateScalar(value, shape) {\n return shape.toWireFormat(value);\n}\n\n/**\n * @api private\n */\nmodule.exports = JsonBuilder;\n","var util = require('../util');\n\nfunction JsonParser() { }\n\nJsonParser.prototype.parse = function(value, shape) {\n return translate(JSON.parse(value), shape);\n};\n\nfunction translate(value, shape) {\n if (!shape || value === undefined) return undefined;\n\n switch (shape.type) {\n case 'structure': return translateStructure(value, shape);\n case 'map': return translateMap(value, shape);\n case 'list': return translateList(value, shape);\n default: return translateScalar(value, shape);\n }\n}\n\nfunction translateStructure(structure, shape) {\n if (structure == null) return undefined;\n if (shape.isDocument) return structure;\n\n var struct = {};\n var shapeMembers = shape.members;\n util.each(shapeMembers, function(name, memberShape) {\n var locationName = memberShape.isLocationName ? memberShape.name : name;\n if (Object.prototype.hasOwnProperty.call(structure, locationName)) {\n var value = structure[locationName];\n var result = translate(value, memberShape);\n if (result !== undefined) struct[name] = result;\n }\n });\n return struct;\n}\n\nfunction translateList(list, shape) {\n if (list == null) return undefined;\n\n var out = [];\n util.arrayEach(list, function(value) {\n var result = translate(value, shape.member);\n if (result === undefined) out.push(null);\n else out.push(result);\n });\n return out;\n}\n\nfunction translateMap(map, shape) {\n if (map == null) return undefined;\n\n var out = {};\n util.each(map, function(key, value) {\n var result = translate(value, shape.value);\n if (result === undefined) out[key] = null;\n else out[key] = result;\n });\n return out;\n}\n\nfunction translateScalar(value, shape) {\n return shape.toType(value);\n}\n\n/**\n * @api private\n */\nmodule.exports = JsonParser;\n","var warning = [\n 'We are formalizing our plans to enter AWS SDK for JavaScript (v2) into maintenance mode in 2023.\\n',\n 'Please migrate your code to use AWS SDK for JavaScript (v3).',\n 'For more information, check the migration guide at https://a.co/7PzMCcy'\n].join('\\n');\n\nmodule.exports = {\n suppress: false\n};\n\n/**\n * To suppress this message:\n * @example\n * require('aws-sdk/lib/maintenance_mode_message').suppress = true;\n */\nfunction emitWarning() {\n if (typeof process === 'undefined')\n return;\n\n // Skip maintenance mode message in Lambda environments\n if (\n typeof process.env === 'object' &&\n typeof process.env.AWS_EXECUTION_ENV !== 'undefined' &&\n process.env.AWS_EXECUTION_ENV.indexOf('AWS_Lambda_') === 0\n ) {\n return;\n }\n\n if (\n typeof process.env === 'object' &&\n typeof process.env.AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE !== 'undefined'\n ) {\n return;\n }\n\n if (typeof process.emitWarning === 'function') {\n process.emitWarning(warning, {\n type: 'NOTE'\n });\n }\n}\n\nsetTimeout(function () {\n if (!module.exports.suppress) {\n emitWarning();\n }\n}, 0);\n","var AWS = require('./core');\nrequire('./http');\nvar inherit = AWS.util.inherit;\nvar getMetadataServiceEndpoint = require('./metadata_service/get_metadata_service_endpoint');\nvar URL = require('url').URL;\n\n/**\n * Represents a metadata service available on EC2 instances. Using the\n * {request} method, you can receieve metadata about any available resource\n * on the metadata service.\n *\n * You can disable the use of the IMDS by setting the AWS_EC2_METADATA_DISABLED\n * environment variable to a truthy value.\n *\n * @!attribute [r] httpOptions\n * @return [map] a map of options to pass to the underlying HTTP request:\n *\n * * **timeout** (Number) — a timeout value in milliseconds to wait\n * before aborting the connection. Set to 0 for no timeout.\n *\n * @!macro nobrowser\n */\nAWS.MetadataService = inherit({\n /**\n * @return [String] the endpoint of the instance metadata service\n */\n endpoint: getMetadataServiceEndpoint(),\n\n /**\n * @!ignore\n */\n\n /**\n * Default HTTP options. By default, the metadata service is set to not\n * timeout on long requests. This means that on non-EC2 machines, this\n * request will never return. If you are calling this operation from an\n * environment that may not always run on EC2, set a `timeout` value so\n * the SDK will abort the request after a given number of milliseconds.\n */\n httpOptions: { timeout: 0 },\n\n /**\n * when enabled, metadata service will not fetch token\n */\n disableFetchToken: false,\n\n /**\n * Creates a new MetadataService object with a given set of options.\n *\n * @option options host [String] the hostname of the instance metadata\n * service\n * @option options httpOptions [map] a map of options to pass to the\n * underlying HTTP request:\n *\n * * **timeout** (Number) — a timeout value in milliseconds to wait\n * before aborting the connection. Set to 0 for no timeout.\n * @option options maxRetries [Integer] the maximum number of retries to\n * perform for timeout errors\n * @option options retryDelayOptions [map] A set of options to configure the\n * retry delay on retryable errors. See AWS.Config for details.\n */\n constructor: function MetadataService(options) {\n if (options && options.host) {\n options.endpoint = 'http://' + options.host;\n delete options.host;\n }\n AWS.util.update(this, options);\n },\n\n /**\n * Sends a request to the instance metadata service for a given resource.\n *\n * @param path [String] the path of the resource to get\n *\n * @param options [map] an optional map used to make request\n *\n * * **method** (String) — HTTP request method\n *\n * * **headers** (map) — a map of response header keys and their respective values\n *\n * @callback callback function(err, data)\n * Called when a response is available from the service.\n * @param err [Error, null] if an error occurred, this value will be set\n * @param data [String, null] if the request was successful, the body of\n * the response\n */\n request: function request(path, options, callback) {\n if (arguments.length === 2) {\n callback = options;\n options = {};\n }\n\n if (process.env[AWS.util.imdsDisabledEnv]) {\n callback(new Error('EC2 Instance Metadata Service access disabled'));\n return;\n }\n\n path = path || '/';\n\n // Verify that host is a valid URL\n if (URL) { new URL(this.endpoint); }\n\n var httpRequest = new AWS.HttpRequest(this.endpoint + path);\n httpRequest.method = options.method || 'GET';\n if (options.headers) {\n httpRequest.headers = options.headers;\n }\n AWS.util.handleRequestWithRetries(httpRequest, this, callback);\n },\n\n /**\n * @api private\n */\n loadCredentialsCallbacks: [],\n\n /**\n * Fetches metadata token used for getting credentials\n *\n * @api private\n * @callback callback function(err, token)\n * Called when token is loaded from the resource\n */\n fetchMetadataToken: function fetchMetadataToken(callback) {\n var self = this;\n var tokenFetchPath = '/latest/api/token';\n self.request(\n tokenFetchPath,\n {\n 'method': 'PUT',\n 'headers': {\n 'x-aws-ec2-metadata-token-ttl-seconds': '21600'\n }\n },\n callback\n );\n },\n\n /**\n * Fetches credentials\n *\n * @api private\n * @callback cb function(err, creds)\n * Called when credentials are loaded from the resource\n */\n fetchCredentials: function fetchCredentials(options, cb) {\n var self = this;\n var basePath = '/latest/meta-data/iam/security-credentials/';\n\n self.request(basePath, options, function (err, roleName) {\n if (err) {\n self.disableFetchToken = !(err.statusCode === 401);\n cb(AWS.util.error(\n err,\n {\n message: 'EC2 Metadata roleName request returned error'\n }\n ));\n return;\n }\n roleName = roleName.split('\\n')[0]; // grab first (and only) role\n self.request(basePath + roleName, options, function (credErr, credData) {\n if (credErr) {\n self.disableFetchToken = !(credErr.statusCode === 401);\n cb(AWS.util.error(\n credErr,\n {\n message: 'EC2 Metadata creds request returned error'\n }\n ));\n return;\n }\n try {\n var credentials = JSON.parse(credData);\n cb(null, credentials);\n } catch (parseError) {\n cb(parseError);\n }\n });\n });\n },\n\n /**\n * Loads a set of credentials stored in the instance metadata service\n *\n * @api private\n * @callback callback function(err, credentials)\n * Called when credentials are loaded from the resource\n * @param err [Error] if an error occurred, this value will be set\n * @param credentials [Object] the raw JSON object containing all\n * metadata from the credentials resource\n */\n loadCredentials: function loadCredentials(callback) {\n var self = this;\n self.loadCredentialsCallbacks.push(callback);\n if (self.loadCredentialsCallbacks.length > 1) { return; }\n\n function callbacks(err, creds) {\n var cb;\n while ((cb = self.loadCredentialsCallbacks.shift()) !== undefined) {\n cb(err, creds);\n }\n }\n\n if (self.disableFetchToken) {\n self.fetchCredentials({}, callbacks);\n } else {\n self.fetchMetadataToken(function(tokenError, token) {\n if (tokenError) {\n if (tokenError.code === 'TimeoutError') {\n self.disableFetchToken = true;\n } else if (tokenError.retryable === true) {\n callbacks(AWS.util.error(\n tokenError,\n {\n message: 'EC2 Metadata token request returned error'\n }\n ));\n return;\n } else if (tokenError.statusCode === 400) {\n callbacks(AWS.util.error(\n tokenError,\n {\n message: 'EC2 Metadata token request returned 400'\n }\n ));\n return;\n }\n }\n var options = {};\n if (token) {\n options.headers = {\n 'x-aws-ec2-metadata-token': token\n };\n }\n self.fetchCredentials(options, callbacks);\n });\n\n }\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.MetadataService;\n","var getEndpoint = function() {\n return {\n IPv4: 'http://169.254.169.254',\n IPv6: 'http://[fd00:ec2::254]',\n };\n};\n\nmodule.exports = getEndpoint;\n","var ENV_ENDPOINT_NAME = 'AWS_EC2_METADATA_SERVICE_ENDPOINT';\nvar CONFIG_ENDPOINT_NAME = 'ec2_metadata_service_endpoint';\n\nvar getEndpointConfigOptions = function() {\n return {\n environmentVariableSelector: function(env) { return env[ENV_ENDPOINT_NAME]; },\n configFileSelector: function(profile) { return profile[CONFIG_ENDPOINT_NAME]; },\n default: undefined,\n };\n};\n\nmodule.exports = getEndpointConfigOptions;\n","var getEndpointMode = function() {\n return {\n IPv4: 'IPv4',\n IPv6: 'IPv6',\n };\n};\n\nmodule.exports = getEndpointMode;\n","var EndpointMode = require('./get_endpoint_mode')();\n\nvar ENV_ENDPOINT_MODE_NAME = 'AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE';\nvar CONFIG_ENDPOINT_MODE_NAME = 'ec2_metadata_service_endpoint_mode';\n\nvar getEndpointModeConfigOptions = function() {\n return {\n environmentVariableSelector: function(env) { return env[ENV_ENDPOINT_MODE_NAME]; },\n configFileSelector: function(profile) { return profile[CONFIG_ENDPOINT_MODE_NAME]; },\n default: EndpointMode.IPv4,\n };\n};\n\nmodule.exports = getEndpointModeConfigOptions;\n","var AWS = require('../core');\n\nvar Endpoint = require('./get_endpoint')();\nvar EndpointMode = require('./get_endpoint_mode')();\n\nvar ENDPOINT_CONFIG_OPTIONS = require('./get_endpoint_config_options')();\nvar ENDPOINT_MODE_CONFIG_OPTIONS = require('./get_endpoint_mode_config_options')();\n\nvar getMetadataServiceEndpoint = function() {\n var endpoint = AWS.util.loadConfig(ENDPOINT_CONFIG_OPTIONS);\n if (endpoint !== undefined) return endpoint;\n\n var endpointMode = AWS.util.loadConfig(ENDPOINT_MODE_CONFIG_OPTIONS);\n switch (endpointMode) {\n case EndpointMode.IPv4:\n return Endpoint.IPv4;\n case EndpointMode.IPv6:\n return Endpoint.IPv6;\n default:\n throw new Error('Unsupported endpoint mode: ' + endpointMode);\n }\n};\n\nmodule.exports = getMetadataServiceEndpoint;\n","var Collection = require('./collection');\nvar Operation = require('./operation');\nvar Shape = require('./shape');\nvar Paginator = require('./paginator');\nvar ResourceWaiter = require('./resource_waiter');\nvar metadata = require('../../apis/metadata.json');\n\nvar util = require('../util');\nvar property = util.property;\nvar memoizedProperty = util.memoizedProperty;\n\nfunction Api(api, options) {\n var self = this;\n api = api || {};\n options = options || {};\n options.api = this;\n\n api.metadata = api.metadata || {};\n\n var serviceIdentifier = options.serviceIdentifier;\n delete options.serviceIdentifier;\n\n property(this, 'isApi', true, false);\n property(this, 'apiVersion', api.metadata.apiVersion);\n property(this, 'endpointPrefix', api.metadata.endpointPrefix);\n property(this, 'signingName', api.metadata.signingName);\n property(this, 'globalEndpoint', api.metadata.globalEndpoint);\n property(this, 'signatureVersion', api.metadata.signatureVersion);\n property(this, 'jsonVersion', api.metadata.jsonVersion);\n property(this, 'targetPrefix', api.metadata.targetPrefix);\n property(this, 'protocol', api.metadata.protocol);\n property(this, 'timestampFormat', api.metadata.timestampFormat);\n property(this, 'xmlNamespaceUri', api.metadata.xmlNamespace);\n property(this, 'abbreviation', api.metadata.serviceAbbreviation);\n property(this, 'fullName', api.metadata.serviceFullName);\n property(this, 'serviceId', api.metadata.serviceId);\n if (serviceIdentifier && metadata[serviceIdentifier]) {\n property(this, 'xmlNoDefaultLists', metadata[serviceIdentifier].xmlNoDefaultLists, false);\n }\n\n memoizedProperty(this, 'className', function() {\n var name = api.metadata.serviceAbbreviation || api.metadata.serviceFullName;\n if (!name) return null;\n\n name = name.replace(/^Amazon|AWS\\s*|\\(.*|\\s+|\\W+/g, '');\n if (name === 'ElasticLoadBalancing') name = 'ELB';\n return name;\n });\n\n function addEndpointOperation(name, operation) {\n if (operation.endpointoperation === true) {\n property(self, 'endpointOperation', util.string.lowerFirst(name));\n }\n if (operation.endpointdiscovery && !self.hasRequiredEndpointDiscovery) {\n property(\n self,\n 'hasRequiredEndpointDiscovery',\n operation.endpointdiscovery.required === true\n );\n }\n }\n\n property(this, 'operations', new Collection(api.operations, options, function(name, operation) {\n return new Operation(name, operation, options);\n }, util.string.lowerFirst, addEndpointOperation));\n\n property(this, 'shapes', new Collection(api.shapes, options, function(name, shape) {\n return Shape.create(shape, options);\n }));\n\n property(this, 'paginators', new Collection(api.paginators, options, function(name, paginator) {\n return new Paginator(name, paginator, options);\n }));\n\n property(this, 'waiters', new Collection(api.waiters, options, function(name, waiter) {\n return new ResourceWaiter(name, waiter, options);\n }, util.string.lowerFirst));\n\n if (options.documentation) {\n property(this, 'documentation', api.documentation);\n property(this, 'documentationUrl', api.documentationUrl);\n }\n property(this, 'awsQueryCompatible', api.metadata.awsQueryCompatible);\n}\n\n/**\n * @api private\n */\nmodule.exports = Api;\n","var memoizedProperty = require('../util').memoizedProperty;\n\nfunction memoize(name, value, factory, nameTr) {\n memoizedProperty(this, nameTr(name), function() {\n return factory(name, value);\n });\n}\n\nfunction Collection(iterable, options, factory, nameTr, callback) {\n nameTr = nameTr || String;\n var self = this;\n\n for (var id in iterable) {\n if (Object.prototype.hasOwnProperty.call(iterable, id)) {\n memoize.call(self, id, iterable[id], factory, nameTr);\n if (callback) callback(id, iterable[id]);\n }\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = Collection;\n","var Shape = require('./shape');\n\nvar util = require('../util');\nvar property = util.property;\nvar memoizedProperty = util.memoizedProperty;\n\nfunction Operation(name, operation, options) {\n var self = this;\n options = options || {};\n\n property(this, 'name', operation.name || name);\n property(this, 'api', options.api, false);\n\n operation.http = operation.http || {};\n property(this, 'endpoint', operation.endpoint);\n property(this, 'httpMethod', operation.http.method || 'POST');\n property(this, 'httpPath', operation.http.requestUri || '/');\n property(this, 'authtype', operation.authtype || '');\n property(\n this,\n 'endpointDiscoveryRequired',\n operation.endpointdiscovery ?\n (operation.endpointdiscovery.required ? 'REQUIRED' : 'OPTIONAL') :\n 'NULL'\n );\n\n // httpChecksum replaces usage of httpChecksumRequired, but some APIs\n // (s3control) still uses old trait.\n var httpChecksumRequired = operation.httpChecksumRequired\n || (operation.httpChecksum && operation.httpChecksum.requestChecksumRequired);\n property(this, 'httpChecksumRequired', httpChecksumRequired, false);\n\n memoizedProperty(this, 'input', function() {\n if (!operation.input) {\n return new Shape.create({type: 'structure'}, options);\n }\n return Shape.create(operation.input, options);\n });\n\n memoizedProperty(this, 'output', function() {\n if (!operation.output) {\n return new Shape.create({type: 'structure'}, options);\n }\n return Shape.create(operation.output, options);\n });\n\n memoizedProperty(this, 'errors', function() {\n var list = [];\n if (!operation.errors) return null;\n\n for (var i = 0; i < operation.errors.length; i++) {\n list.push(Shape.create(operation.errors[i], options));\n }\n\n return list;\n });\n\n memoizedProperty(this, 'paginator', function() {\n return options.api.paginators[name];\n });\n\n if (options.documentation) {\n property(this, 'documentation', operation.documentation);\n property(this, 'documentationUrl', operation.documentationUrl);\n }\n\n // idempotentMembers only tracks top-level input shapes\n memoizedProperty(this, 'idempotentMembers', function() {\n var idempotentMembers = [];\n var input = self.input;\n var members = input.members;\n if (!input.members) {\n return idempotentMembers;\n }\n for (var name in members) {\n if (!members.hasOwnProperty(name)) {\n continue;\n }\n if (members[name].isIdempotent === true) {\n idempotentMembers.push(name);\n }\n }\n return idempotentMembers;\n });\n\n memoizedProperty(this, 'hasEventOutput', function() {\n var output = self.output;\n return hasEventStream(output);\n });\n}\n\nfunction hasEventStream(topLevelShape) {\n var members = topLevelShape.members;\n var payload = topLevelShape.payload;\n\n if (!topLevelShape.members) {\n return false;\n }\n\n if (payload) {\n var payloadMember = members[payload];\n return payloadMember.isEventStream;\n }\n\n // check if any member is an event stream\n for (var name in members) {\n if (!members.hasOwnProperty(name)) {\n if (members[name].isEventStream === true) {\n return true;\n }\n }\n }\n return false;\n}\n\n/**\n * @api private\n */\nmodule.exports = Operation;\n","var property = require('../util').property;\n\nfunction Paginator(name, paginator) {\n property(this, 'inputToken', paginator.input_token);\n property(this, 'limitKey', paginator.limit_key);\n property(this, 'moreResults', paginator.more_results);\n property(this, 'outputToken', paginator.output_token);\n property(this, 'resultKey', paginator.result_key);\n}\n\n/**\n * @api private\n */\nmodule.exports = Paginator;\n","var util = require('../util');\nvar property = util.property;\n\nfunction ResourceWaiter(name, waiter, options) {\n options = options || {};\n property(this, 'name', name);\n property(this, 'api', options.api, false);\n\n if (waiter.operation) {\n property(this, 'operation', util.string.lowerFirst(waiter.operation));\n }\n\n var self = this;\n var keys = [\n 'type',\n 'description',\n 'delay',\n 'maxAttempts',\n 'acceptors'\n ];\n\n keys.forEach(function(key) {\n var value = waiter[key];\n if (value) {\n property(self, key, value);\n }\n });\n}\n\n/**\n * @api private\n */\nmodule.exports = ResourceWaiter;\n","var Collection = require('./collection');\n\nvar util = require('../util');\n\nfunction property(obj, name, value) {\n if (value !== null && value !== undefined) {\n util.property.apply(this, arguments);\n }\n}\n\nfunction memoizedProperty(obj, name) {\n if (!obj.constructor.prototype[name]) {\n util.memoizedProperty.apply(this, arguments);\n }\n}\n\nfunction Shape(shape, options, memberName) {\n options = options || {};\n\n property(this, 'shape', shape.shape);\n property(this, 'api', options.api, false);\n property(this, 'type', shape.type);\n property(this, 'enum', shape.enum);\n property(this, 'min', shape.min);\n property(this, 'max', shape.max);\n property(this, 'pattern', shape.pattern);\n property(this, 'location', shape.location || this.location || 'body');\n property(this, 'name', this.name || shape.xmlName || shape.queryName ||\n shape.locationName || memberName);\n property(this, 'isStreaming', shape.streaming || this.isStreaming || false);\n property(this, 'requiresLength', shape.requiresLength, false);\n property(this, 'isComposite', shape.isComposite || false);\n property(this, 'isShape', true, false);\n property(this, 'isQueryName', Boolean(shape.queryName), false);\n property(this, 'isLocationName', Boolean(shape.locationName), false);\n property(this, 'isIdempotent', shape.idempotencyToken === true);\n property(this, 'isJsonValue', shape.jsonvalue === true);\n property(this, 'isSensitive', shape.sensitive === true || shape.prototype && shape.prototype.sensitive === true);\n property(this, 'isEventStream', Boolean(shape.eventstream), false);\n property(this, 'isEvent', Boolean(shape.event), false);\n property(this, 'isEventPayload', Boolean(shape.eventpayload), false);\n property(this, 'isEventHeader', Boolean(shape.eventheader), false);\n property(this, 'isTimestampFormatSet', Boolean(shape.timestampFormat) || shape.prototype && shape.prototype.isTimestampFormatSet === true, false);\n property(this, 'endpointDiscoveryId', Boolean(shape.endpointdiscoveryid), false);\n property(this, 'hostLabel', Boolean(shape.hostLabel), false);\n\n if (options.documentation) {\n property(this, 'documentation', shape.documentation);\n property(this, 'documentationUrl', shape.documentationUrl);\n }\n\n if (shape.xmlAttribute) {\n property(this, 'isXmlAttribute', shape.xmlAttribute || false);\n }\n\n // type conversion and parsing\n property(this, 'defaultValue', null);\n this.toWireFormat = function(value) {\n if (value === null || value === undefined) return '';\n return value;\n };\n this.toType = function(value) { return value; };\n}\n\n/**\n * @api private\n */\nShape.normalizedTypes = {\n character: 'string',\n double: 'float',\n long: 'integer',\n short: 'integer',\n biginteger: 'integer',\n bigdecimal: 'float',\n blob: 'binary'\n};\n\n/**\n * @api private\n */\nShape.types = {\n 'structure': StructureShape,\n 'list': ListShape,\n 'map': MapShape,\n 'boolean': BooleanShape,\n 'timestamp': TimestampShape,\n 'float': FloatShape,\n 'integer': IntegerShape,\n 'string': StringShape,\n 'base64': Base64Shape,\n 'binary': BinaryShape\n};\n\nShape.resolve = function resolve(shape, options) {\n if (shape.shape) {\n var refShape = options.api.shapes[shape.shape];\n if (!refShape) {\n throw new Error('Cannot find shape reference: ' + shape.shape);\n }\n\n return refShape;\n } else {\n return null;\n }\n};\n\nShape.create = function create(shape, options, memberName) {\n if (shape.isShape) return shape;\n\n var refShape = Shape.resolve(shape, options);\n if (refShape) {\n var filteredKeys = Object.keys(shape);\n if (!options.documentation) {\n filteredKeys = filteredKeys.filter(function(name) {\n return !name.match(/documentation/);\n });\n }\n\n // create an inline shape with extra members\n var InlineShape = function() {\n refShape.constructor.call(this, shape, options, memberName);\n };\n InlineShape.prototype = refShape;\n return new InlineShape();\n } else {\n // set type if not set\n if (!shape.type) {\n if (shape.members) shape.type = 'structure';\n else if (shape.member) shape.type = 'list';\n else if (shape.key) shape.type = 'map';\n else shape.type = 'string';\n }\n\n // normalize types\n var origType = shape.type;\n if (Shape.normalizedTypes[shape.type]) {\n shape.type = Shape.normalizedTypes[shape.type];\n }\n\n if (Shape.types[shape.type]) {\n return new Shape.types[shape.type](shape, options, memberName);\n } else {\n throw new Error('Unrecognized shape type: ' + origType);\n }\n }\n};\n\nfunction CompositeShape(shape) {\n Shape.apply(this, arguments);\n property(this, 'isComposite', true);\n\n if (shape.flattened) {\n property(this, 'flattened', shape.flattened || false);\n }\n}\n\nfunction StructureShape(shape, options) {\n var self = this;\n var requiredMap = null, firstInit = !this.isShape;\n\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function() { return {}; });\n property(this, 'members', {});\n property(this, 'memberNames', []);\n property(this, 'required', []);\n property(this, 'isRequired', function() { return false; });\n property(this, 'isDocument', Boolean(shape.document));\n }\n\n if (shape.members) {\n property(this, 'members', new Collection(shape.members, options, function(name, member) {\n return Shape.create(member, options, name);\n }));\n memoizedProperty(this, 'memberNames', function() {\n return shape.xmlOrder || Object.keys(shape.members);\n });\n\n if (shape.event) {\n memoizedProperty(this, 'eventPayloadMemberName', function() {\n var members = self.members;\n var memberNames = self.memberNames;\n // iterate over members to find ones that are event payloads\n for (var i = 0, iLen = memberNames.length; i < iLen; i++) {\n if (members[memberNames[i]].isEventPayload) {\n return memberNames[i];\n }\n }\n });\n\n memoizedProperty(this, 'eventHeaderMemberNames', function() {\n var members = self.members;\n var memberNames = self.memberNames;\n var eventHeaderMemberNames = [];\n // iterate over members to find ones that are event headers\n for (var i = 0, iLen = memberNames.length; i < iLen; i++) {\n if (members[memberNames[i]].isEventHeader) {\n eventHeaderMemberNames.push(memberNames[i]);\n }\n }\n return eventHeaderMemberNames;\n });\n }\n }\n\n if (shape.required) {\n property(this, 'required', shape.required);\n property(this, 'isRequired', function(name) {\n if (!requiredMap) {\n requiredMap = {};\n for (var i = 0; i < shape.required.length; i++) {\n requiredMap[shape.required[i]] = true;\n }\n }\n\n return requiredMap[name];\n }, false, true);\n }\n\n property(this, 'resultWrapper', shape.resultWrapper || null);\n\n if (shape.payload) {\n property(this, 'payload', shape.payload);\n }\n\n if (typeof shape.xmlNamespace === 'string') {\n property(this, 'xmlNamespaceUri', shape.xmlNamespace);\n } else if (typeof shape.xmlNamespace === 'object') {\n property(this, 'xmlNamespacePrefix', shape.xmlNamespace.prefix);\n property(this, 'xmlNamespaceUri', shape.xmlNamespace.uri);\n }\n}\n\nfunction ListShape(shape, options) {\n var self = this, firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function() { return []; });\n }\n\n if (shape.member) {\n memoizedProperty(this, 'member', function() {\n return Shape.create(shape.member, options);\n });\n }\n\n if (this.flattened) {\n var oldName = this.name;\n memoizedProperty(this, 'name', function() {\n return self.member.name || oldName;\n });\n }\n}\n\nfunction MapShape(shape, options) {\n var firstInit = !this.isShape;\n CompositeShape.apply(this, arguments);\n\n if (firstInit) {\n property(this, 'defaultValue', function() { return {}; });\n property(this, 'key', Shape.create({type: 'string'}, options));\n property(this, 'value', Shape.create({type: 'string'}, options));\n }\n\n if (shape.key) {\n memoizedProperty(this, 'key', function() {\n return Shape.create(shape.key, options);\n });\n }\n if (shape.value) {\n memoizedProperty(this, 'value', function() {\n return Shape.create(shape.value, options);\n });\n }\n}\n\nfunction TimestampShape(shape) {\n var self = this;\n Shape.apply(this, arguments);\n\n if (shape.timestampFormat) {\n property(this, 'timestampFormat', shape.timestampFormat);\n } else if (self.isTimestampFormatSet && this.timestampFormat) {\n property(this, 'timestampFormat', this.timestampFormat);\n } else if (this.location === 'header') {\n property(this, 'timestampFormat', 'rfc822');\n } else if (this.location === 'querystring') {\n property(this, 'timestampFormat', 'iso8601');\n } else if (this.api) {\n switch (this.api.protocol) {\n case 'json':\n case 'rest-json':\n property(this, 'timestampFormat', 'unixTimestamp');\n break;\n case 'rest-xml':\n case 'query':\n case 'ec2':\n property(this, 'timestampFormat', 'iso8601');\n break;\n }\n }\n\n this.toType = function(value) {\n if (value === null || value === undefined) return null;\n if (typeof value.toUTCString === 'function') return value;\n return typeof value === 'string' || typeof value === 'number' ?\n util.date.parseTimestamp(value) : null;\n };\n\n this.toWireFormat = function(value) {\n return util.date.format(value, self.timestampFormat);\n };\n}\n\nfunction StringShape() {\n Shape.apply(this, arguments);\n\n var nullLessProtocols = ['rest-xml', 'query', 'ec2'];\n this.toType = function(value) {\n value = this.api && nullLessProtocols.indexOf(this.api.protocol) > -1 ?\n value || '' : value;\n if (this.isJsonValue) {\n return JSON.parse(value);\n }\n\n return value && typeof value.toString === 'function' ?\n value.toString() : value;\n };\n\n this.toWireFormat = function(value) {\n return this.isJsonValue ? JSON.stringify(value) : value;\n };\n}\n\nfunction FloatShape() {\n Shape.apply(this, arguments);\n\n this.toType = function(value) {\n if (value === null || value === undefined) return null;\n return parseFloat(value);\n };\n this.toWireFormat = this.toType;\n}\n\nfunction IntegerShape() {\n Shape.apply(this, arguments);\n\n this.toType = function(value) {\n if (value === null || value === undefined) return null;\n return parseInt(value, 10);\n };\n this.toWireFormat = this.toType;\n}\n\nfunction BinaryShape() {\n Shape.apply(this, arguments);\n this.toType = function(value) {\n var buf = util.base64.decode(value);\n if (this.isSensitive && util.isNode() && typeof util.Buffer.alloc === 'function') {\n /* Node.js can create a Buffer that is not isolated.\n * i.e. buf.byteLength !== buf.buffer.byteLength\n * This means that the sensitive data is accessible to anyone with access to buf.buffer.\n * If this is the node shared Buffer, then other code within this process _could_ find this secret.\n * Copy sensitive data to an isolated Buffer and zero the sensitive data.\n * While this is safe to do here, copying this code somewhere else may produce unexpected results.\n */\n var secureBuf = util.Buffer.alloc(buf.length, buf);\n buf.fill(0);\n buf = secureBuf;\n }\n return buf;\n };\n this.toWireFormat = util.base64.encode;\n}\n\nfunction Base64Shape() {\n BinaryShape.apply(this, arguments);\n}\n\nfunction BooleanShape() {\n Shape.apply(this, arguments);\n\n this.toType = function(value) {\n if (typeof value === 'boolean') return value;\n if (value === null || value === undefined) return null;\n return value === 'true';\n };\n}\n\n/**\n * @api private\n */\nShape.shapes = {\n StructureShape: StructureShape,\n ListShape: ListShape,\n MapShape: MapShape,\n StringShape: StringShape,\n BooleanShape: BooleanShape,\n Base64Shape: Base64Shape\n};\n\n/**\n * @api private\n */\nmodule.exports = Shape;\n","var util = require('./util');\n\nvar region_utils = require('./region/utils');\nvar isFipsRegion = region_utils.isFipsRegion;\nvar getRealRegion = region_utils.getRealRegion;\n\nutil.isBrowser = function() { return false; };\nutil.isNode = function() { return true; };\n\n// node.js specific modules\nutil.crypto.lib = require('crypto');\nutil.Buffer = require('buffer').Buffer;\nutil.domain = require('domain');\nutil.stream = require('stream');\nutil.url = require('url');\nutil.querystring = require('querystring');\nutil.environment = 'nodejs';\nutil.createEventStream = util.stream.Readable ?\n require('./event-stream/streaming-create-event-stream').createEventStream : require('./event-stream/buffered-create-event-stream').createEventStream;\nutil.realClock = require('./realclock/nodeClock');\nutil.clientSideMonitoring = {\n Publisher: require('./publisher').Publisher,\n configProvider: require('./publisher/configuration'),\n};\nutil.iniLoader = require('./shared-ini').iniLoader;\nutil.getSystemErrorName = require('util').getSystemErrorName;\n\nutil.loadConfig = function(options) {\n var envValue = options.environmentVariableSelector(process.env);\n if (envValue !== undefined) {\n return envValue;\n }\n\n var configFile = {};\n try {\n configFile = util.iniLoader ? util.iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[util.sharedConfigFileEnv]\n }) : {};\n } catch (e) {}\n var sharedFileConfig = configFile[\n process.env.AWS_PROFILE || util.defaultProfile\n ] || {};\n var configValue = options.configFileSelector(sharedFileConfig);\n if (configValue !== undefined) {\n return configValue;\n }\n\n if (typeof options.default === 'function') {\n return options.default();\n }\n return options.default;\n};\n\nvar AWS;\n\n/**\n * @api private\n */\nmodule.exports = AWS = require('./core');\n\nrequire('./credentials');\nrequire('./credentials/credential_provider_chain');\nrequire('./credentials/temporary_credentials');\nrequire('./credentials/chainable_temporary_credentials');\nrequire('./credentials/web_identity_credentials');\nrequire('./credentials/cognito_identity_credentials');\nrequire('./credentials/saml_credentials');\nrequire('./credentials/process_credentials');\n\n// Load the xml2js XML parser\nAWS.XML.Parser = require('./xml/node_parser');\n\n// Load Node HTTP client\nrequire('./http/node');\n\nrequire('./shared-ini/ini-loader');\n\n// Load custom credential providers\nrequire('./credentials/token_file_web_identity_credentials');\nrequire('./credentials/ec2_metadata_credentials');\nrequire('./credentials/remote_credentials');\nrequire('./credentials/ecs_credentials');\nrequire('./credentials/environment_credentials');\nrequire('./credentials/file_system_credentials');\nrequire('./credentials/shared_ini_file_credentials');\nrequire('./credentials/process_credentials');\nrequire('./credentials/sso_credentials');\n\n// Setup default providers for credentials chain\n// If this changes, please update documentation for\n// AWS.CredentialProviderChain.defaultProviders in\n// credentials/credential_provider_chain.js\nAWS.CredentialProviderChain.defaultProviders = [\n function () { return new AWS.EnvironmentCredentials('AWS'); },\n function () { return new AWS.EnvironmentCredentials('AMAZON'); },\n function () { return new AWS.SsoCredentials(); },\n function () { return new AWS.SharedIniFileCredentials(); },\n function () { return new AWS.ECSCredentials(); },\n function () { return new AWS.ProcessCredentials(); },\n function () { return new AWS.TokenFileWebIdentityCredentials(); },\n function () { return new AWS.EC2MetadataCredentials(); }\n];\n\n// Load custom token providers\nrequire('./token');\nrequire('./token/token_provider_chain');\nrequire('./token/sso_token_provider');\n\n// Setup default providers for token chain\n// If this changes, please update documentation for\n// AWS.TokenProviderChain.defaultProviders in\n// token/token_provider_chain.js\nAWS.TokenProviderChain.defaultProviders = [\n function () { return new AWS.SSOTokenProvider(); },\n];\n\nvar getRegion = function() {\n var env = process.env;\n var region = env.AWS_REGION || env.AMAZON_REGION;\n if (env[AWS.util.configOptInEnv]) {\n var toCheck = [\n {filename: env[AWS.util.sharedCredentialsFileEnv]},\n {isConfig: true, filename: env[AWS.util.sharedConfigFileEnv]}\n ];\n var iniLoader = AWS.util.iniLoader;\n while (!region && toCheck.length) {\n var configFile = {};\n var fileInfo = toCheck.shift();\n try {\n configFile = iniLoader.loadFrom(fileInfo);\n } catch (err) {\n if (fileInfo.isConfig) throw err;\n }\n var profile = configFile[env.AWS_PROFILE || AWS.util.defaultProfile];\n region = profile && profile.region;\n }\n }\n return region;\n};\n\nvar getBooleanValue = function(value) {\n return value === 'true' ? true: value === 'false' ? false: undefined;\n};\n\nvar USE_FIPS_ENDPOINT_CONFIG_OPTIONS = {\n environmentVariableSelector: function(env) {\n return getBooleanValue(env['AWS_USE_FIPS_ENDPOINT']);\n },\n configFileSelector: function(profile) {\n return getBooleanValue(profile['use_fips_endpoint']);\n },\n default: false,\n};\n\nvar USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS = {\n environmentVariableSelector: function(env) {\n return getBooleanValue(env['AWS_USE_DUALSTACK_ENDPOINT']);\n },\n configFileSelector: function(profile) {\n return getBooleanValue(profile['use_dualstack_endpoint']);\n },\n default: false,\n};\n\n// Update configuration keys\nAWS.util.update(AWS.Config.prototype.keys, {\n credentials: function () {\n var credentials = null;\n new AWS.CredentialProviderChain([\n function () { return new AWS.EnvironmentCredentials('AWS'); },\n function () { return new AWS.EnvironmentCredentials('AMAZON'); },\n function () { return new AWS.SharedIniFileCredentials({ disableAssumeRole: true }); }\n ]).resolve(function(err, creds) {\n if (!err) credentials = creds;\n });\n return credentials;\n },\n credentialProvider: function() {\n return new AWS.CredentialProviderChain();\n },\n logger: function () {\n return process.env.AWSJS_DEBUG ? console : null;\n },\n region: function() {\n var region = getRegion();\n return region ? getRealRegion(region): undefined;\n },\n tokenProvider: function() {\n return new AWS.TokenProviderChain();\n },\n useFipsEndpoint: function() {\n var region = getRegion();\n return isFipsRegion(region)\n ? true\n : util.loadConfig(USE_FIPS_ENDPOINT_CONFIG_OPTIONS);\n },\n useDualstackEndpoint: function() {\n return util.loadConfig(USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS);\n }\n});\n\n// Reset configuration\nAWS.config = new AWS.Config();\n","var AWS = require('./core');\n\n/**\n * @api private\n */\nAWS.ParamValidator = AWS.util.inherit({\n /**\n * Create a new validator object.\n *\n * @param validation [Boolean|map] whether input parameters should be\n * validated against the operation description before sending the\n * request. Pass a map to enable any of the following specific\n * validation features:\n *\n * * **min** [Boolean] — Validates that a value meets the min\n * constraint. This is enabled by default when paramValidation is set\n * to `true`.\n * * **max** [Boolean] — Validates that a value meets the max\n * constraint.\n * * **pattern** [Boolean] — Validates that a string value matches a\n * regular expression.\n * * **enum** [Boolean] — Validates that a string value matches one\n * of the allowable enum values.\n */\n constructor: function ParamValidator(validation) {\n if (validation === true || validation === undefined) {\n validation = {'min': true};\n }\n this.validation = validation;\n },\n\n validate: function validate(shape, params, context) {\n this.errors = [];\n this.validateMember(shape, params || {}, context || 'params');\n\n if (this.errors.length > 1) {\n var msg = this.errors.join('\\n* ');\n msg = 'There were ' + this.errors.length +\n ' validation errors:\\n* ' + msg;\n throw AWS.util.error(new Error(msg),\n {code: 'MultipleValidationErrors', errors: this.errors});\n } else if (this.errors.length === 1) {\n throw this.errors[0];\n } else {\n return true;\n }\n },\n\n fail: function fail(code, message) {\n this.errors.push(AWS.util.error(new Error(message), {code: code}));\n },\n\n validateStructure: function validateStructure(shape, params, context) {\n if (shape.isDocument) return true;\n\n this.validateType(params, context, ['object'], 'structure');\n var paramName;\n for (var i = 0; shape.required && i < shape.required.length; i++) {\n paramName = shape.required[i];\n var value = params[paramName];\n if (value === undefined || value === null) {\n this.fail('MissingRequiredParameter',\n 'Missing required key \\'' + paramName + '\\' in ' + context);\n }\n }\n\n // validate hash members\n for (paramName in params) {\n if (!Object.prototype.hasOwnProperty.call(params, paramName)) continue;\n\n var paramValue = params[paramName],\n memberShape = shape.members[paramName];\n\n if (memberShape !== undefined) {\n var memberContext = [context, paramName].join('.');\n this.validateMember(memberShape, paramValue, memberContext);\n } else if (paramValue !== undefined && paramValue !== null) {\n this.fail('UnexpectedParameter',\n 'Unexpected key \\'' + paramName + '\\' found in ' + context);\n }\n }\n\n return true;\n },\n\n validateMember: function validateMember(shape, param, context) {\n switch (shape.type) {\n case 'structure':\n return this.validateStructure(shape, param, context);\n case 'list':\n return this.validateList(shape, param, context);\n case 'map':\n return this.validateMap(shape, param, context);\n default:\n return this.validateScalar(shape, param, context);\n }\n },\n\n validateList: function validateList(shape, params, context) {\n if (this.validateType(params, context, [Array])) {\n this.validateRange(shape, params.length, context, 'list member count');\n // validate array members\n for (var i = 0; i < params.length; i++) {\n this.validateMember(shape.member, params[i], context + '[' + i + ']');\n }\n }\n },\n\n validateMap: function validateMap(shape, params, context) {\n if (this.validateType(params, context, ['object'], 'map')) {\n // Build up a count of map members to validate range traits.\n var mapCount = 0;\n for (var param in params) {\n if (!Object.prototype.hasOwnProperty.call(params, param)) continue;\n // Validate any map key trait constraints\n this.validateMember(shape.key, param,\n context + '[key=\\'' + param + '\\']');\n this.validateMember(shape.value, params[param],\n context + '[\\'' + param + '\\']');\n mapCount++;\n }\n this.validateRange(shape, mapCount, context, 'map member count');\n }\n },\n\n validateScalar: function validateScalar(shape, value, context) {\n switch (shape.type) {\n case null:\n case undefined:\n case 'string':\n return this.validateString(shape, value, context);\n case 'base64':\n case 'binary':\n return this.validatePayload(value, context);\n case 'integer':\n case 'float':\n return this.validateNumber(shape, value, context);\n case 'boolean':\n return this.validateType(value, context, ['boolean']);\n case 'timestamp':\n return this.validateType(value, context, [Date,\n /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$/, 'number'],\n 'Date object, ISO-8601 string, or a UNIX timestamp');\n default:\n return this.fail('UnkownType', 'Unhandled type ' +\n shape.type + ' for ' + context);\n }\n },\n\n validateString: function validateString(shape, value, context) {\n var validTypes = ['string'];\n if (shape.isJsonValue) {\n validTypes = validTypes.concat(['number', 'object', 'boolean']);\n }\n if (value !== null && this.validateType(value, context, validTypes)) {\n this.validateEnum(shape, value, context);\n this.validateRange(shape, value.length, context, 'string length');\n this.validatePattern(shape, value, context);\n this.validateUri(shape, value, context);\n }\n },\n\n validateUri: function validateUri(shape, value, context) {\n if (shape['location'] === 'uri') {\n if (value.length === 0) {\n this.fail('UriParameterError', 'Expected uri parameter to have length >= 1,'\n + ' but found \"' + value +'\" for ' + context);\n }\n }\n },\n\n validatePattern: function validatePattern(shape, value, context) {\n if (this.validation['pattern'] && shape['pattern'] !== undefined) {\n if (!(new RegExp(shape['pattern'])).test(value)) {\n this.fail('PatternMatchError', 'Provided value \"' + value + '\" '\n + 'does not match regex pattern /' + shape['pattern'] + '/ for '\n + context);\n }\n }\n },\n\n validateRange: function validateRange(shape, value, context, descriptor) {\n if (this.validation['min']) {\n if (shape['min'] !== undefined && value < shape['min']) {\n this.fail('MinRangeError', 'Expected ' + descriptor + ' >= '\n + shape['min'] + ', but found ' + value + ' for ' + context);\n }\n }\n if (this.validation['max']) {\n if (shape['max'] !== undefined && value > shape['max']) {\n this.fail('MaxRangeError', 'Expected ' + descriptor + ' <= '\n + shape['max'] + ', but found ' + value + ' for ' + context);\n }\n }\n },\n\n validateEnum: function validateRange(shape, value, context) {\n if (this.validation['enum'] && shape['enum'] !== undefined) {\n // Fail if the string value is not present in the enum list\n if (shape['enum'].indexOf(value) === -1) {\n this.fail('EnumError', 'Found string value of ' + value + ', but '\n + 'expected ' + shape['enum'].join('|') + ' for ' + context);\n }\n }\n },\n\n validateType: function validateType(value, context, acceptedTypes, type) {\n // We will not log an error for null or undefined, but we will return\n // false so that callers know that the expected type was not strictly met.\n if (value === null || value === undefined) return false;\n\n var foundInvalidType = false;\n for (var i = 0; i < acceptedTypes.length; i++) {\n if (typeof acceptedTypes[i] === 'string') {\n if (typeof value === acceptedTypes[i]) return true;\n } else if (acceptedTypes[i] instanceof RegExp) {\n if ((value || '').toString().match(acceptedTypes[i])) return true;\n } else {\n if (value instanceof acceptedTypes[i]) return true;\n if (AWS.util.isType(value, acceptedTypes[i])) return true;\n if (!type && !foundInvalidType) acceptedTypes = acceptedTypes.slice();\n acceptedTypes[i] = AWS.util.typeName(acceptedTypes[i]);\n }\n foundInvalidType = true;\n }\n\n var acceptedType = type;\n if (!acceptedType) {\n acceptedType = acceptedTypes.join(', ').replace(/,([^,]+)$/, ', or$1');\n }\n\n var vowel = acceptedType.match(/^[aeiou]/i) ? 'n' : '';\n this.fail('InvalidParameterType', 'Expected ' + context + ' to be a' +\n vowel + ' ' + acceptedType);\n return false;\n },\n\n validateNumber: function validateNumber(shape, value, context) {\n if (value === null || value === undefined) return;\n if (typeof value === 'string') {\n var castedValue = parseFloat(value);\n if (castedValue.toString() === value) value = castedValue;\n }\n if (this.validateType(value, context, ['number'])) {\n this.validateRange(shape, value, context, 'numeric value');\n }\n },\n\n validatePayload: function validatePayload(value, context) {\n if (value === null || value === undefined) return;\n if (typeof value === 'string') return;\n if (value && typeof value.byteLength === 'number') return; // typed arrays\n if (AWS.util.isNode()) { // special check for buffer/stream in Node.js\n var Stream = AWS.util.stream.Stream;\n if (AWS.util.Buffer.isBuffer(value) || value instanceof Stream) return;\n } else {\n if (typeof Blob !== void 0 && value instanceof Blob) return;\n }\n\n var types = ['Buffer', 'Stream', 'File', 'Blob', 'ArrayBuffer', 'DataView'];\n if (value) {\n for (var i = 0; i < types.length; i++) {\n if (AWS.util.isType(value, types[i])) return;\n if (AWS.util.typeName(value.constructor) === types[i]) return;\n }\n }\n\n this.fail('InvalidParameterType', 'Expected ' + context + ' to be a ' +\n 'string, Buffer, Stream, Blob, or typed array object');\n }\n});\n","var AWS = require('../core');\nvar rest = AWS.Protocol.Rest;\n\n/**\n * A presigner object can be used to generate presigned urls for the Polly service.\n */\nAWS.Polly.Presigner = AWS.util.inherit({\n /**\n * Creates a presigner object with a set of configuration options.\n *\n * @option options params [map] An optional map of parameters to bind to every\n * request sent by this service object.\n * @option options service [AWS.Polly] An optional pre-configured instance\n * of the AWS.Polly service object to use for requests. The object may\n * bound parameters used by the presigner.\n * @see AWS.Polly.constructor\n */\n constructor: function Signer(options) {\n options = options || {};\n this.options = options;\n this.service = options.service;\n this.bindServiceObject(options);\n this._operations = {};\n },\n\n /**\n * @api private\n */\n bindServiceObject: function bindServiceObject(options) {\n options = options || {};\n if (!this.service) {\n this.service = new AWS.Polly(options);\n } else {\n var config = AWS.util.copy(this.service.config);\n this.service = new this.service.constructor.__super__(config);\n this.service.config.params = AWS.util.merge(this.service.config.params || {}, options.params);\n }\n },\n\n /**\n * @api private\n */\n modifyInputMembers: function modifyInputMembers(input) {\n // make copies of the input so we don't overwrite the api\n // need to be careful to copy anything we access/modify\n var modifiedInput = AWS.util.copy(input);\n modifiedInput.members = AWS.util.copy(input.members);\n AWS.util.each(input.members, function(name, member) {\n modifiedInput.members[name] = AWS.util.copy(member);\n // update location and locationName\n if (!member.location || member.location === 'body') {\n modifiedInput.members[name].location = 'querystring';\n modifiedInput.members[name].locationName = name;\n }\n });\n return modifiedInput;\n },\n\n /**\n * @api private\n */\n convertPostToGet: function convertPostToGet(req) {\n // convert method\n req.httpRequest.method = 'GET';\n\n var operation = req.service.api.operations[req.operation];\n // get cached operation input first\n var input = this._operations[req.operation];\n if (!input) {\n // modify the original input\n this._operations[req.operation] = input = this.modifyInputMembers(operation.input);\n }\n\n var uri = rest.generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params);\n\n req.httpRequest.path = uri;\n req.httpRequest.body = '';\n\n // don't need these headers on a GET request\n delete req.httpRequest.headers['Content-Length'];\n delete req.httpRequest.headers['Content-Type'];\n },\n\n /**\n * @overload getSynthesizeSpeechUrl(params = {}, [expires = 3600], [callback])\n * Generate a presigned url for {AWS.Polly.synthesizeSpeech}.\n * @note You must ensure that you have static or previously resolved\n * credentials if you call this method synchronously (with no callback),\n * otherwise it may not properly sign the request. If you cannot guarantee\n * this (you are using an asynchronous credential provider, i.e., EC2\n * IAM roles), you should always call this method with an asynchronous\n * callback.\n * @param params [map] parameters to pass to the operation. See the {AWS.Polly.synthesizeSpeech}\n * operation for the expected operation parameters.\n * @param expires [Integer] (3600) the number of seconds to expire the pre-signed URL operation in.\n * Defaults to 1 hour.\n * @return [string] if called synchronously (with no callback), returns the signed URL.\n * @return [null] nothing is returned if a callback is provided.\n * @callback callback function (err, url)\n * If a callback is supplied, it is called when a signed URL has been generated.\n * @param err [Error] the error object returned from the presigner.\n * @param url [String] the signed URL.\n * @see AWS.Polly.synthesizeSpeech\n */\n getSynthesizeSpeechUrl: function getSynthesizeSpeechUrl(params, expires, callback) {\n var self = this;\n var request = this.service.makeRequest('synthesizeSpeech', params);\n // remove existing build listeners\n request.removeAllListeners('build');\n request.on('build', function(req) {\n self.convertPostToGet(req);\n });\n return request.presign(expires, callback);\n }\n});\n","var util = require('../util');\nvar AWS = require('../core');\n\n/**\n * Prepend prefix defined by API model to endpoint that's already\n * constructed. This feature does not apply to operations using\n * endpoint discovery and can be disabled.\n * @api private\n */\nfunction populateHostPrefix(request) {\n var enabled = request.service.config.hostPrefixEnabled;\n if (!enabled) return request;\n var operationModel = request.service.api.operations[request.operation];\n //don't marshal host prefix when operation has endpoint discovery traits\n if (hasEndpointDiscover(request)) return request;\n if (operationModel.endpoint && operationModel.endpoint.hostPrefix) {\n var hostPrefixNotation = operationModel.endpoint.hostPrefix;\n var hostPrefix = expandHostPrefix(hostPrefixNotation, request.params, operationModel.input);\n prependEndpointPrefix(request.httpRequest.endpoint, hostPrefix);\n validateHostname(request.httpRequest.endpoint.hostname);\n }\n return request;\n}\n\n/**\n * @api private\n */\nfunction hasEndpointDiscover(request) {\n var api = request.service.api;\n var operationModel = api.operations[request.operation];\n var isEndpointOperation = api.endpointOperation && (api.endpointOperation === util.string.lowerFirst(operationModel.name));\n return (operationModel.endpointDiscoveryRequired !== 'NULL' || isEndpointOperation === true);\n}\n\n/**\n * @api private\n */\nfunction expandHostPrefix(hostPrefixNotation, params, shape) {\n util.each(shape.members, function(name, member) {\n if (member.hostLabel === true) {\n if (typeof params[name] !== 'string' || params[name] === '') {\n throw util.error(new Error(), {\n message: 'Parameter ' + name + ' should be a non-empty string.',\n code: 'InvalidParameter'\n });\n }\n var regex = new RegExp('\\\\{' + name + '\\\\}', 'g');\n hostPrefixNotation = hostPrefixNotation.replace(regex, params[name]);\n }\n });\n return hostPrefixNotation;\n}\n\n/**\n * @api private\n */\nfunction prependEndpointPrefix(endpoint, prefix) {\n if (endpoint.host) {\n endpoint.host = prefix + endpoint.host;\n }\n if (endpoint.hostname) {\n endpoint.hostname = prefix + endpoint.hostname;\n }\n}\n\n/**\n * @api private\n */\nfunction validateHostname(hostname) {\n var labels = hostname.split('.');\n //Reference: https://tools.ietf.org/html/rfc1123#section-2\n var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9]$/;\n util.arrayEach(labels, function(label) {\n if (!label.length || label.length < 1 || label.length > 63) {\n throw util.error(new Error(), {\n code: 'ValidationError',\n message: 'Hostname label length should be between 1 to 63 characters, inclusive.'\n });\n }\n if (!hostPattern.test(label)) {\n throw AWS.util.error(new Error(),\n {code: 'ValidationError', message: label + ' is not hostname compatible.'});\n }\n });\n}\n\nmodule.exports = {\n populateHostPrefix: populateHostPrefix\n};\n","var util = require('../util');\nvar JsonBuilder = require('../json/builder');\nvar JsonParser = require('../json/parser');\nvar populateHostPrefix = require('./helpers').populateHostPrefix;\n\nfunction buildRequest(req) {\n var httpRequest = req.httpRequest;\n var api = req.service.api;\n var target = api.targetPrefix + '.' + api.operations[req.operation].name;\n var version = api.jsonVersion || '1.0';\n var input = api.operations[req.operation].input;\n var builder = new JsonBuilder();\n\n if (version === 1) version = '1.0';\n\n if (api.awsQueryCompatible) {\n if (!httpRequest.params) {\n httpRequest.params = {};\n }\n // because Query protocol does this.\n Object.assign(httpRequest.params, req.params);\n }\n\n httpRequest.body = builder.build(req.params || {}, input);\n httpRequest.headers['Content-Type'] = 'application/x-amz-json-' + version;\n httpRequest.headers['X-Amz-Target'] = target;\n\n populateHostPrefix(req);\n}\n\nfunction extractError(resp) {\n var error = {};\n var httpResponse = resp.httpResponse;\n\n error.code = httpResponse.headers['x-amzn-errortype'] || 'UnknownError';\n if (typeof error.code === 'string') {\n error.code = error.code.split(':')[0];\n }\n\n if (httpResponse.body.length > 0) {\n try {\n var e = JSON.parse(httpResponse.body.toString());\n\n var code = e.__type || e.code || e.Code;\n if (code) {\n error.code = code.split('#').pop();\n }\n if (error.code === 'RequestEntityTooLarge') {\n error.message = 'Request body must be less than 1 MB';\n } else {\n error.message = (e.message || e.Message || null);\n }\n\n // The minimized models do not have error shapes, so\n // without expanding the model size, it's not possible\n // to validate the response shape (members) or\n // check if any are sensitive to logging.\n\n // Assign the fields as non-enumerable, allowing specific access only.\n for (var key in e || {}) {\n if (key === 'code' || key === 'message') {\n continue;\n }\n error['[' + key + ']'] = 'See error.' + key + ' for details.';\n Object.defineProperty(error, key, {\n value: e[key],\n enumerable: false,\n writable: true\n });\n }\n } catch (e) {\n error.statusCode = httpResponse.statusCode;\n error.message = httpResponse.statusMessage;\n }\n } else {\n error.statusCode = httpResponse.statusCode;\n error.message = httpResponse.statusCode.toString();\n }\n\n resp.error = util.error(new Error(), error);\n}\n\nfunction extractData(resp) {\n var body = resp.httpResponse.body.toString() || '{}';\n if (resp.request.service.config.convertResponseTypes === false) {\n resp.data = JSON.parse(body);\n } else {\n var operation = resp.request.service.api.operations[resp.request.operation];\n var shape = operation.output || {};\n var parser = new JsonParser();\n resp.data = parser.parse(body, shape);\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n buildRequest: buildRequest,\n extractError: extractError,\n extractData: extractData\n};\n","var AWS = require('../core');\nvar util = require('../util');\nvar QueryParamSerializer = require('../query/query_param_serializer');\nvar Shape = require('../model/shape');\nvar populateHostPrefix = require('./helpers').populateHostPrefix;\n\nfunction buildRequest(req) {\n var operation = req.service.api.operations[req.operation];\n var httpRequest = req.httpRequest;\n httpRequest.headers['Content-Type'] =\n 'application/x-www-form-urlencoded; charset=utf-8';\n httpRequest.params = {\n Version: req.service.api.apiVersion,\n Action: operation.name\n };\n\n // convert the request parameters into a list of query params,\n // e.g. Deeply.NestedParam.0.Name=value\n var builder = new QueryParamSerializer();\n builder.serialize(req.params, operation.input, function(name, value) {\n httpRequest.params[name] = value;\n });\n httpRequest.body = util.queryParamsToString(httpRequest.params);\n\n populateHostPrefix(req);\n}\n\nfunction extractError(resp) {\n var data, body = resp.httpResponse.body.toString();\n if (body.match('= 0 ? '&' : '?');\n var parts = [];\n util.arrayEach(Object.keys(queryString).sort(), function(key) {\n if (!Array.isArray(queryString[key])) {\n queryString[key] = [queryString[key]];\n }\n for (var i = 0; i < queryString[key].length; i++) {\n parts.push(util.uriEscape(String(key)) + '=' + queryString[key][i]);\n }\n });\n uri += parts.join('&');\n }\n\n return uri;\n}\n\nfunction populateURI(req) {\n var operation = req.service.api.operations[req.operation];\n var input = operation.input;\n\n var uri = generateURI(req.httpRequest.endpoint.path, operation.httpPath, input, req.params);\n req.httpRequest.path = uri;\n}\n\nfunction populateHeaders(req) {\n var operation = req.service.api.operations[req.operation];\n util.each(operation.input.members, function (name, member) {\n var value = req.params[name];\n if (value === null || value === undefined) return;\n\n if (member.location === 'headers' && member.type === 'map') {\n util.each(value, function(key, memberValue) {\n req.httpRequest.headers[member.name + key] = memberValue;\n });\n } else if (member.location === 'header') {\n value = member.toWireFormat(value).toString();\n if (member.isJsonValue) {\n value = util.base64.encode(value);\n }\n req.httpRequest.headers[member.name] = value;\n }\n });\n}\n\nfunction buildRequest(req) {\n populateMethod(req);\n populateURI(req);\n populateHeaders(req);\n populateHostPrefix(req);\n}\n\nfunction extractError() {\n}\n\nfunction extractData(resp) {\n var req = resp.request;\n var data = {};\n var r = resp.httpResponse;\n var operation = req.service.api.operations[req.operation];\n var output = operation.output;\n\n // normalize headers names to lower-cased keys for matching\n var headers = {};\n util.each(r.headers, function (k, v) {\n headers[k.toLowerCase()] = v;\n });\n\n util.each(output.members, function(name, member) {\n var header = (member.name || name).toLowerCase();\n if (member.location === 'headers' && member.type === 'map') {\n data[name] = {};\n var location = member.isLocationName ? member.name : '';\n var pattern = new RegExp('^' + location + '(.+)', 'i');\n util.each(r.headers, function (k, v) {\n var result = k.match(pattern);\n if (result !== null) {\n data[name][result[1]] = v;\n }\n });\n } else if (member.location === 'header') {\n if (headers[header] !== undefined) {\n var value = member.isJsonValue ?\n util.base64.decode(headers[header]) :\n headers[header];\n data[name] = member.toType(value);\n }\n } else if (member.location === 'statusCode') {\n data[name] = parseInt(r.statusCode, 10);\n }\n });\n\n resp.data = data;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n buildRequest: buildRequest,\n extractError: extractError,\n extractData: extractData,\n generateURI: generateURI\n};\n","var util = require('../util');\nvar Rest = require('./rest');\nvar Json = require('./json');\nvar JsonBuilder = require('../json/builder');\nvar JsonParser = require('../json/parser');\n\nvar METHODS_WITHOUT_BODY = ['GET', 'HEAD', 'DELETE'];\n\nfunction unsetContentLength(req) {\n var payloadMember = util.getRequestPayloadShape(req);\n if (\n payloadMember === undefined &&\n METHODS_WITHOUT_BODY.indexOf(req.httpRequest.method) >= 0\n ) {\n delete req.httpRequest.headers['Content-Length'];\n }\n}\n\nfunction populateBody(req) {\n var builder = new JsonBuilder();\n var input = req.service.api.operations[req.operation].input;\n\n if (input.payload) {\n var params = {};\n var payloadShape = input.members[input.payload];\n params = req.params[input.payload];\n\n if (payloadShape.type === 'structure') {\n req.httpRequest.body = builder.build(params || {}, payloadShape);\n applyContentTypeHeader(req);\n } else if (params !== undefined) {\n // non-JSON payload\n req.httpRequest.body = params;\n if (payloadShape.type === 'binary' || payloadShape.isStreaming) {\n applyContentTypeHeader(req, true);\n }\n }\n } else {\n req.httpRequest.body = builder.build(req.params, input);\n applyContentTypeHeader(req);\n }\n}\n\nfunction applyContentTypeHeader(req, isBinary) {\n if (!req.httpRequest.headers['Content-Type']) {\n var type = isBinary ? 'binary/octet-stream' : 'application/json';\n req.httpRequest.headers['Content-Type'] = type;\n }\n}\n\nfunction buildRequest(req) {\n Rest.buildRequest(req);\n\n // never send body payload on GET/HEAD/DELETE\n if (METHODS_WITHOUT_BODY.indexOf(req.httpRequest.method) < 0) {\n populateBody(req);\n }\n}\n\nfunction extractError(resp) {\n Json.extractError(resp);\n}\n\nfunction extractData(resp) {\n Rest.extractData(resp);\n\n var req = resp.request;\n var operation = req.service.api.operations[req.operation];\n var rules = req.service.api.operations[req.operation].output || {};\n var parser;\n var hasEventOutput = operation.hasEventOutput;\n\n if (rules.payload) {\n var payloadMember = rules.members[rules.payload];\n var body = resp.httpResponse.body;\n if (payloadMember.isEventStream) {\n parser = new JsonParser();\n resp.data[payload] = util.createEventStream(\n AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : body,\n parser,\n payloadMember\n );\n } else if (payloadMember.type === 'structure' || payloadMember.type === 'list') {\n var parser = new JsonParser();\n resp.data[rules.payload] = parser.parse(body, payloadMember);\n } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) {\n resp.data[rules.payload] = body;\n } else {\n resp.data[rules.payload] = payloadMember.toType(body);\n }\n } else {\n var data = resp.data;\n Json.extractData(resp);\n resp.data = util.merge(data, resp.data);\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n buildRequest: buildRequest,\n extractError: extractError,\n extractData: extractData,\n unsetContentLength: unsetContentLength\n};\n","var AWS = require('../core');\nvar util = require('../util');\nvar Rest = require('./rest');\n\nfunction populateBody(req) {\n var input = req.service.api.operations[req.operation].input;\n var builder = new AWS.XML.Builder();\n var params = req.params;\n\n var payload = input.payload;\n if (payload) {\n var payloadMember = input.members[payload];\n params = params[payload];\n if (params === undefined) return;\n\n if (payloadMember.type === 'structure') {\n var rootElement = payloadMember.name;\n req.httpRequest.body = builder.toXML(params, payloadMember, rootElement, true);\n } else { // non-xml payload\n req.httpRequest.body = params;\n }\n } else {\n req.httpRequest.body = builder.toXML(params, input, input.name ||\n input.shape || util.string.upperFirst(req.operation) + 'Request');\n }\n}\n\nfunction buildRequest(req) {\n Rest.buildRequest(req);\n\n // never send body payload on GET/HEAD\n if (['GET', 'HEAD'].indexOf(req.httpRequest.method) < 0) {\n populateBody(req);\n }\n}\n\nfunction extractError(resp) {\n Rest.extractError(resp);\n\n var data;\n try {\n data = new AWS.XML.Parser().parse(resp.httpResponse.body.toString());\n } catch (e) {\n data = {\n Code: resp.httpResponse.statusCode,\n Message: resp.httpResponse.statusMessage\n };\n }\n\n if (data.Errors) data = data.Errors;\n if (data.Error) data = data.Error;\n if (data.Code) {\n resp.error = util.error(new Error(), {\n code: data.Code,\n message: data.Message\n });\n } else {\n resp.error = util.error(new Error(), {\n code: resp.httpResponse.statusCode,\n message: null\n });\n }\n}\n\nfunction extractData(resp) {\n Rest.extractData(resp);\n\n var parser;\n var req = resp.request;\n var body = resp.httpResponse.body;\n var operation = req.service.api.operations[req.operation];\n var output = operation.output;\n\n var hasEventOutput = operation.hasEventOutput;\n\n var payload = output.payload;\n if (payload) {\n var payloadMember = output.members[payload];\n if (payloadMember.isEventStream) {\n parser = new AWS.XML.Parser();\n resp.data[payload] = util.createEventStream(\n AWS.HttpClient.streamsApiVersion === 2 ? resp.httpResponse.stream : resp.httpResponse.body,\n parser,\n payloadMember\n );\n } else if (payloadMember.type === 'structure') {\n parser = new AWS.XML.Parser();\n resp.data[payload] = parser.parse(body.toString(), payloadMember);\n } else if (payloadMember.type === 'binary' || payloadMember.isStreaming) {\n resp.data[payload] = body;\n } else {\n resp.data[payload] = payloadMember.toType(body);\n }\n } else if (body.length > 0) {\n parser = new AWS.XML.Parser();\n var data = parser.parse(body.toString(), output);\n util.update(resp.data, data);\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n buildRequest: buildRequest,\n extractError: extractError,\n extractData: extractData\n};\n","var AWS = require('../core');\n\n/**\n * Resolve client-side monitoring configuration from either environmental variables\n * or shared config file. Configurations from environmental variables have higher priority\n * than those from shared config file. The resolver will try to read the shared config file\n * no matter whether the AWS_SDK_LOAD_CONFIG variable is set.\n * @api private\n */\nfunction resolveMonitoringConfig() {\n var config = {\n port: undefined,\n clientId: undefined,\n enabled: undefined,\n host: undefined\n };\n if (fromEnvironment(config) || fromConfigFile(config)) return toJSType(config);\n return toJSType(config);\n}\n\n/**\n * Resolve configurations from environmental variables.\n * @param {object} client side monitoring config object needs to be resolved\n * @returns {boolean} whether resolving configurations is done\n * @api private\n */\nfunction fromEnvironment(config) {\n config.port = config.port || process.env.AWS_CSM_PORT;\n config.enabled = config.enabled || process.env.AWS_CSM_ENABLED;\n config.clientId = config.clientId || process.env.AWS_CSM_CLIENT_ID;\n config.host = config.host || process.env.AWS_CSM_HOST;\n return config.port && config.enabled && config.clientId && config.host ||\n ['false', '0'].indexOf(config.enabled) >= 0; //no need to read shared config file if explicitely disabled\n}\n\n/**\n * Resolve cofigurations from shared config file with specified role name\n * @param {object} client side monitoring config object needs to be resolved\n * @returns {boolean} whether resolving configurations is done\n * @api private\n */\nfunction fromConfigFile(config) {\n var sharedFileConfig;\n try {\n var configFile = AWS.util.iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[AWS.util.sharedConfigFileEnv]\n });\n var sharedFileConfig = configFile[\n process.env.AWS_PROFILE || AWS.util.defaultProfile\n ];\n } catch (err) {\n return false;\n }\n if (!sharedFileConfig) return config;\n config.port = config.port || sharedFileConfig.csm_port;\n config.enabled = config.enabled || sharedFileConfig.csm_enabled;\n config.clientId = config.clientId || sharedFileConfig.csm_client_id;\n config.host = config.host || sharedFileConfig.csm_host;\n return config.port && config.enabled && config.clientId && config.host;\n}\n\n/**\n * Transfer the resolved configuration value to proper types: port as number, enabled\n * as boolean and clientId as string. The 'enabled' flag is valued to false when set\n * to 'false' or '0'.\n * @param {object} resolved client side monitoring config\n * @api private\n */\nfunction toJSType(config) {\n //config.XXX is either undefined or string\n var falsyNotations = ['false', '0', undefined];\n if (!config.enabled || falsyNotations.indexOf(config.enabled.toLowerCase()) >= 0) {\n config.enabled = false;\n } else {\n config.enabled = true;\n }\n config.port = config.port ? parseInt(config.port, 10) : undefined;\n return config;\n}\n\nmodule.exports = resolveMonitoringConfig;\n","var util = require('../core').util;\nvar dgram = require('dgram');\nvar stringToBuffer = util.buffer.toBuffer;\n\nvar MAX_MESSAGE_SIZE = 1024 * 8; // 8 KB\n\n/**\n * Publishes metrics via udp.\n * @param {object} options Paramters for Publisher constructor\n * @param {number} [options.port = 31000] Port number\n * @param {string} [options.clientId = ''] Client Identifier\n * @param {boolean} [options.enabled = false] enable sending metrics datagram\n * @api private\n */\nfunction Publisher(options) {\n // handle configuration\n options = options || {};\n this.enabled = options.enabled || false;\n this.port = options.port || 31000;\n this.clientId = options.clientId || '';\n this.address = options.host || '127.0.0.1';\n if (this.clientId.length > 255) {\n // ClientId has a max length of 255\n this.clientId = this.clientId.substr(0, 255);\n }\n this.messagesInFlight = 0;\n}\n\nPublisher.prototype.fieldsToTrim = {\n UserAgent: 256,\n SdkException: 128,\n SdkExceptionMessage: 512,\n AwsException: 128,\n AwsExceptionMessage: 512,\n FinalSdkException: 128,\n FinalSdkExceptionMessage: 512,\n FinalAwsException: 128,\n FinalAwsExceptionMessage: 512\n\n};\n\n/**\n * Trims fields that have a specified max length.\n * @param {object} event ApiCall or ApiCallAttempt event.\n * @returns {object}\n * @api private\n */\nPublisher.prototype.trimFields = function(event) {\n var trimmableFields = Object.keys(this.fieldsToTrim);\n for (var i = 0, iLen = trimmableFields.length; i < iLen; i++) {\n var field = trimmableFields[i];\n if (event.hasOwnProperty(field)) {\n var maxLength = this.fieldsToTrim[field];\n var value = event[field];\n if (value && value.length > maxLength) {\n event[field] = value.substr(0, maxLength);\n }\n }\n }\n return event;\n};\n\n/**\n * Handles ApiCall and ApiCallAttempt events.\n * @param {Object} event apiCall or apiCallAttempt event.\n * @api private\n */\nPublisher.prototype.eventHandler = function(event) {\n // set the clientId\n event.ClientId = this.clientId;\n\n this.trimFields(event);\n\n var message = stringToBuffer(JSON.stringify(event));\n if (!this.enabled || message.length > MAX_MESSAGE_SIZE) {\n // drop the message if publisher not enabled or it is too large\n return;\n }\n\n this.publishDatagram(message);\n};\n\n/**\n * Publishes message to an agent.\n * @param {Buffer} message JSON message to send to agent.\n * @api private\n */\nPublisher.prototype.publishDatagram = function(message) {\n var self = this;\n var client = this.getClient();\n\n this.messagesInFlight++;\n this.client.send(message, 0, message.length, this.port, this.address, function(err, bytes) {\n if (--self.messagesInFlight <= 0) {\n // destroy existing client so the event loop isn't kept open\n self.destroyClient();\n }\n });\n};\n\n/**\n * Returns an existing udp socket, or creates one if it doesn't already exist.\n * @api private\n */\nPublisher.prototype.getClient = function() {\n if (!this.client) {\n this.client = dgram.createSocket('udp4');\n }\n return this.client;\n};\n\n/**\n * Destroys the udp socket.\n * @api private\n */\nPublisher.prototype.destroyClient = function() {\n if (this.client) {\n this.client.close();\n this.client = void 0;\n }\n};\n\nmodule.exports = {\n Publisher: Publisher\n};\n","var util = require('../util');\n\nfunction QueryParamSerializer() {\n}\n\nQueryParamSerializer.prototype.serialize = function(params, shape, fn) {\n serializeStructure('', params, shape, fn);\n};\n\nfunction ucfirst(shape) {\n if (shape.isQueryName || shape.api.protocol !== 'ec2') {\n return shape.name;\n } else {\n return shape.name[0].toUpperCase() + shape.name.substr(1);\n }\n}\n\nfunction serializeStructure(prefix, struct, rules, fn) {\n util.each(rules.members, function(name, member) {\n var value = struct[name];\n if (value === null || value === undefined) return;\n\n var memberName = ucfirst(member);\n memberName = prefix ? prefix + '.' + memberName : memberName;\n serializeMember(memberName, value, member, fn);\n });\n}\n\nfunction serializeMap(name, map, rules, fn) {\n var i = 1;\n util.each(map, function (key, value) {\n var prefix = rules.flattened ? '.' : '.entry.';\n var position = prefix + (i++) + '.';\n var keyName = position + (rules.key.name || 'key');\n var valueName = position + (rules.value.name || 'value');\n serializeMember(name + keyName, key, rules.key, fn);\n serializeMember(name + valueName, value, rules.value, fn);\n });\n}\n\nfunction serializeList(name, list, rules, fn) {\n var memberRules = rules.member || {};\n\n if (list.length === 0) {\n fn.call(this, name, null);\n return;\n }\n\n util.arrayEach(list, function (v, n) {\n var suffix = '.' + (n + 1);\n if (rules.api.protocol === 'ec2') {\n // Do nothing for EC2\n suffix = suffix + ''; // make linter happy\n } else if (rules.flattened) {\n if (memberRules.name) {\n var parts = name.split('.');\n parts.pop();\n parts.push(ucfirst(memberRules));\n name = parts.join('.');\n }\n } else {\n suffix = '.' + (memberRules.name ? memberRules.name : 'member') + suffix;\n }\n serializeMember(name + suffix, v, memberRules, fn);\n });\n}\n\nfunction serializeMember(name, value, rules, fn) {\n if (value === null || value === undefined) return;\n if (rules.type === 'structure') {\n serializeStructure(name, value, rules, fn);\n } else if (rules.type === 'list') {\n serializeList(name, value, rules, fn);\n } else if (rules.type === 'map') {\n serializeMap(name, value, rules, fn);\n } else {\n fn(name, rules.toWireFormat(value).toString());\n }\n}\n\n/**\n * @api private\n */\nmodule.exports = QueryParamSerializer;\n","var AWS = require('../core');\n\n/**\n * @api private\n */\nvar service = null;\n\n/**\n * @api private\n */\nvar api = {\n signatureVersion: 'v4',\n signingName: 'rds-db',\n operations: {}\n};\n\n/**\n * @api private\n */\nvar requiredAuthTokenOptions = {\n region: 'string',\n hostname: 'string',\n port: 'number',\n username: 'string'\n};\n\n/**\n * A signer object can be used to generate an auth token to a database.\n */\nAWS.RDS.Signer = AWS.util.inherit({\n /**\n * Creates a signer object can be used to generate an auth token.\n *\n * @option options credentials [AWS.Credentials] the AWS credentials\n * to sign requests with. Uses the default credential provider chain\n * if not specified.\n * @option options hostname [String] the hostname of the database to connect to.\n * @option options port [Number] the port number the database is listening on.\n * @option options region [String] the region the database is located in.\n * @option options username [String] the username to login as.\n * @example Passing in options to constructor\n * var signer = new AWS.RDS.Signer({\n * credentials: new AWS.SharedIniFileCredentials({profile: 'default'}),\n * region: 'us-east-1',\n * hostname: 'db.us-east-1.rds.amazonaws.com',\n * port: 8000,\n * username: 'name'\n * });\n */\n constructor: function Signer(options) {\n this.options = options || {};\n },\n\n /**\n * @api private\n * Strips the protocol from a url.\n */\n convertUrlToAuthToken: function convertUrlToAuthToken(url) {\n // we are always using https as the protocol\n var protocol = 'https://';\n if (url.indexOf(protocol) === 0) {\n return url.substring(protocol.length);\n }\n },\n\n /**\n * @overload getAuthToken(options = {}, [callback])\n * Generate an auth token to a database.\n * @note You must ensure that you have static or previously resolved\n * credentials if you call this method synchronously (with no callback),\n * otherwise it may not properly sign the request. If you cannot guarantee\n * this (you are using an asynchronous credential provider, i.e., EC2\n * IAM roles), you should always call this method with an asynchronous\n * callback.\n *\n * @param options [map] The fields to use when generating an auth token.\n * Any options specified here will be merged on top of any options passed\n * to AWS.RDS.Signer:\n *\n * * **credentials** (AWS.Credentials) — the AWS credentials\n * to sign requests with. Uses the default credential provider chain\n * if not specified.\n * * **hostname** (String) — the hostname of the database to connect to.\n * * **port** (Number) — the port number the database is listening on.\n * * **region** (String) — the region the database is located in.\n * * **username** (String) — the username to login as.\n * @return [String] if called synchronously (with no callback), returns the\n * auth token.\n * @return [null] nothing is returned if a callback is provided.\n * @callback callback function (err, token)\n * If a callback is supplied, it is called when an auth token has been generated.\n * @param err [Error] the error object returned from the signer.\n * @param token [String] the auth token.\n *\n * @example Generating an auth token synchronously\n * var signer = new AWS.RDS.Signer({\n * // configure options\n * region: 'us-east-1',\n * username: 'default',\n * hostname: 'db.us-east-1.amazonaws.com',\n * port: 8000\n * });\n * var token = signer.getAuthToken({\n * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option\n * // credentials are not specified here or when creating the signer, so default credential provider will be used\n * username: 'test' // overriding username\n * });\n * @example Generating an auth token asynchronously\n * var signer = new AWS.RDS.Signer({\n * // configure options\n * region: 'us-east-1',\n * username: 'default',\n * hostname: 'db.us-east-1.amazonaws.com',\n * port: 8000\n * });\n * signer.getAuthToken({\n * // these options are merged with those defined when creating the signer, overriding in the case of a duplicate option\n * // credentials are not specified here or when creating the signer, so default credential provider will be used\n * username: 'test' // overriding username\n * }, function(err, token) {\n * if (err) {\n * // handle error\n * } else {\n * // use token\n * }\n * });\n *\n */\n getAuthToken: function getAuthToken(options, callback) {\n if (typeof options === 'function' && callback === undefined) {\n callback = options;\n options = {};\n }\n var self = this;\n var hasCallback = typeof callback === 'function';\n // merge options with existing options\n options = AWS.util.merge(this.options, options);\n // validate options\n var optionsValidation = this.validateAuthTokenOptions(options);\n if (optionsValidation !== true) {\n if (hasCallback) {\n return callback(optionsValidation, null);\n }\n throw optionsValidation;\n }\n\n // 15 minutes\n var expires = 900;\n // create service to generate a request from\n var serviceOptions = {\n region: options.region,\n endpoint: new AWS.Endpoint(options.hostname + ':' + options.port),\n paramValidation: false,\n signatureVersion: 'v4'\n };\n if (options.credentials) {\n serviceOptions.credentials = options.credentials;\n }\n service = new AWS.Service(serviceOptions);\n // ensure the SDK is using sigv4 signing (config is not enough)\n service.api = api;\n\n var request = service.makeRequest();\n // add listeners to request to properly build auth token\n this.modifyRequestForAuthToken(request, options);\n\n if (hasCallback) {\n request.presign(expires, function(err, url) {\n if (url) {\n url = self.convertUrlToAuthToken(url);\n }\n callback(err, url);\n });\n } else {\n var url = request.presign(expires);\n return this.convertUrlToAuthToken(url);\n }\n },\n\n /**\n * @api private\n * Modifies a request to allow the presigner to generate an auth token.\n */\n modifyRequestForAuthToken: function modifyRequestForAuthToken(request, options) {\n request.on('build', request.buildAsGet);\n var httpRequest = request.httpRequest;\n httpRequest.body = AWS.util.queryParamsToString({\n Action: 'connect',\n DBUser: options.username\n });\n },\n\n /**\n * @api private\n * Validates that the options passed in contain all the keys with values of the correct type that\n * are needed to generate an auth token.\n */\n validateAuthTokenOptions: function validateAuthTokenOptions(options) {\n // iterate over all keys in options\n var message = '';\n options = options || {};\n for (var key in requiredAuthTokenOptions) {\n if (!Object.prototype.hasOwnProperty.call(requiredAuthTokenOptions, key)) {\n continue;\n }\n if (typeof options[key] !== requiredAuthTokenOptions[key]) {\n message += 'option \\'' + key + '\\' should have been type \\'' + requiredAuthTokenOptions[key] + '\\', was \\'' + typeof options[key] + '\\'.\\n';\n }\n }\n if (message.length) {\n return AWS.util.error(new Error(), {\n code: 'InvalidParameter',\n message: message\n });\n }\n return true;\n }\n});\n","module.exports = {\n //provide realtime clock for performance measurement\n now: function now() {\n var second = process.hrtime();\n return second[0] * 1000 + (second[1] / 1000000);\n }\n};\n","function isFipsRegion(region) {\n return typeof region === 'string' && (region.startsWith('fips-') || region.endsWith('-fips'));\n}\n\nfunction isGlobalRegion(region) {\n return typeof region === 'string' && ['aws-global', 'aws-us-gov-global'].includes(region);\n}\n\nfunction getRealRegion(region) {\n return ['fips-aws-global', 'aws-fips', 'aws-global'].includes(region)\n ? 'us-east-1'\n : ['fips-aws-us-gov-global', 'aws-us-gov-global'].includes(region)\n ? 'us-gov-west-1'\n : region.replace(/fips-(dkr-|prod-)?|-fips/, '');\n}\n\nmodule.exports = {\n isFipsRegion: isFipsRegion,\n isGlobalRegion: isGlobalRegion,\n getRealRegion: getRealRegion\n};\n","var util = require('./util');\nvar regionConfig = require('./region_config_data.json');\n\nfunction generateRegionPrefix(region) {\n if (!region) return null;\n var parts = region.split('-');\n if (parts.length < 3) return null;\n return parts.slice(0, parts.length - 2).join('-') + '-*';\n}\n\nfunction derivedKeys(service) {\n var region = service.config.region;\n var regionPrefix = generateRegionPrefix(region);\n var endpointPrefix = service.api.endpointPrefix;\n\n return [\n [region, endpointPrefix],\n [regionPrefix, endpointPrefix],\n [region, '*'],\n [regionPrefix, '*'],\n ['*', endpointPrefix],\n [region, 'internal-*'],\n ['*', '*']\n ].map(function(item) {\n return item[0] && item[1] ? item.join('/') : null;\n });\n}\n\nfunction applyConfig(service, config) {\n util.each(config, function(key, value) {\n if (key === 'globalEndpoint') return;\n if (service.config[key] === undefined || service.config[key] === null) {\n service.config[key] = value;\n }\n });\n}\n\nfunction configureEndpoint(service) {\n var keys = derivedKeys(service);\n var useFipsEndpoint = service.config.useFipsEndpoint;\n var useDualstackEndpoint = service.config.useDualstackEndpoint;\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (!key) continue;\n\n var rules = useFipsEndpoint\n ? useDualstackEndpoint\n ? regionConfig.dualstackFipsRules\n : regionConfig.fipsRules\n : useDualstackEndpoint\n ? regionConfig.dualstackRules\n : regionConfig.rules;\n\n if (Object.prototype.hasOwnProperty.call(rules, key)) {\n var config = rules[key];\n if (typeof config === 'string') {\n config = regionConfig.patterns[config];\n }\n\n // set global endpoint\n service.isGlobalEndpoint = !!config.globalEndpoint;\n if (config.signingRegion) {\n service.signingRegion = config.signingRegion;\n }\n\n // signature version\n if (!config.signatureVersion) {\n // Note: config is a global object and should not be mutated here.\n // However, we are retaining this line for backwards compatibility.\n // The non-v4 signatureVersion will be set in a copied object below.\n config.signatureVersion = 'v4';\n }\n\n var useBearer = (service.api && service.api.signatureVersion) === 'bearer';\n\n // merge config\n applyConfig(service, Object.assign(\n {},\n config,\n { signatureVersion: useBearer ? 'bearer' : config.signatureVersion }\n ));\n return;\n }\n }\n}\n\nfunction getEndpointSuffix(region) {\n var regionRegexes = {\n '^(us|eu|ap|sa|ca|me)\\\\-\\\\w+\\\\-\\\\d+$': 'amazonaws.com',\n '^cn\\\\-\\\\w+\\\\-\\\\d+$': 'amazonaws.com.cn',\n '^us\\\\-gov\\\\-\\\\w+\\\\-\\\\d+$': 'amazonaws.com',\n '^us\\\\-iso\\\\-\\\\w+\\\\-\\\\d+$': 'c2s.ic.gov',\n '^us\\\\-isob\\\\-\\\\w+\\\\-\\\\d+$': 'sc2s.sgov.gov'\n };\n var defaultSuffix = 'amazonaws.com';\n var regexes = Object.keys(regionRegexes);\n for (var i = 0; i < regexes.length; i++) {\n var regionPattern = RegExp(regexes[i]);\n var dnsSuffix = regionRegexes[regexes[i]];\n if (regionPattern.test(region)) return dnsSuffix;\n }\n return defaultSuffix;\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n configureEndpoint: configureEndpoint,\n getEndpointSuffix: getEndpointSuffix,\n};\n","var AWS = require('./core');\nvar AcceptorStateMachine = require('./state_machine');\nvar inherit = AWS.util.inherit;\nvar domain = AWS.util.domain;\nvar jmespath = require('jmespath');\n\n/**\n * @api private\n */\nvar hardErrorStates = {success: 1, error: 1, complete: 1};\n\nfunction isTerminalState(machine) {\n return Object.prototype.hasOwnProperty.call(hardErrorStates, machine._asm.currentState);\n}\n\nvar fsm = new AcceptorStateMachine();\nfsm.setupStates = function() {\n var transition = function(_, done) {\n var self = this;\n self._haltHandlersOnError = false;\n\n self.emit(self._asm.currentState, function(err) {\n if (err) {\n if (isTerminalState(self)) {\n if (domain && self.domain instanceof domain.Domain) {\n err.domainEmitter = self;\n err.domain = self.domain;\n err.domainThrown = false;\n self.domain.emit('error', err);\n } else {\n throw err;\n }\n } else {\n self.response.error = err;\n done(err);\n }\n } else {\n done(self.response.error);\n }\n });\n\n };\n\n this.addState('validate', 'build', 'error', transition);\n this.addState('build', 'afterBuild', 'restart', transition);\n this.addState('afterBuild', 'sign', 'restart', transition);\n this.addState('sign', 'send', 'retry', transition);\n this.addState('retry', 'afterRetry', 'afterRetry', transition);\n this.addState('afterRetry', 'sign', 'error', transition);\n this.addState('send', 'validateResponse', 'retry', transition);\n this.addState('validateResponse', 'extractData', 'extractError', transition);\n this.addState('extractError', 'extractData', 'retry', transition);\n this.addState('extractData', 'success', 'retry', transition);\n this.addState('restart', 'build', 'error', transition);\n this.addState('success', 'complete', 'complete', transition);\n this.addState('error', 'complete', 'complete', transition);\n this.addState('complete', null, null, transition);\n};\nfsm.setupStates();\n\n/**\n * ## Asynchronous Requests\n *\n * All requests made through the SDK are asynchronous and use a\n * callback interface. Each service method that kicks off a request\n * returns an `AWS.Request` object that you can use to register\n * callbacks.\n *\n * For example, the following service method returns the request\n * object as \"request\", which can be used to register callbacks:\n *\n * ```javascript\n * // request is an AWS.Request object\n * var request = ec2.describeInstances();\n *\n * // register callbacks on request to retrieve response data\n * request.on('success', function(response) {\n * console.log(response.data);\n * });\n * ```\n *\n * When a request is ready to be sent, the {send} method should\n * be called:\n *\n * ```javascript\n * request.send();\n * ```\n *\n * Since registered callbacks may or may not be idempotent, requests should only\n * be sent once. To perform the same operation multiple times, you will need to\n * create multiple request objects, each with its own registered callbacks.\n *\n * ## Removing Default Listeners for Events\n *\n * Request objects are built with default listeners for the various events,\n * depending on the service type. In some cases, you may want to remove\n * some built-in listeners to customize behaviour. Doing this requires\n * access to the built-in listener functions, which are exposed through\n * the {AWS.EventListeners.Core} namespace. For instance, you may\n * want to customize the HTTP handler used when sending a request. In this\n * case, you can remove the built-in listener associated with the 'send'\n * event, the {AWS.EventListeners.Core.SEND} listener and add your own.\n *\n * ## Multiple Callbacks and Chaining\n *\n * You can register multiple callbacks on any request object. The\n * callbacks can be registered for different events, or all for the\n * same event. In addition, you can chain callback registration, for\n * example:\n *\n * ```javascript\n * request.\n * on('success', function(response) {\n * console.log(\"Success!\");\n * }).\n * on('error', function(error, response) {\n * console.log(\"Error!\");\n * }).\n * on('complete', function(response) {\n * console.log(\"Always!\");\n * }).\n * send();\n * ```\n *\n * The above example will print either \"Success! Always!\", or \"Error! Always!\",\n * depending on whether the request succeeded or not.\n *\n * @!attribute httpRequest\n * @readonly\n * @!group HTTP Properties\n * @return [AWS.HttpRequest] the raw HTTP request object\n * containing request headers and body information\n * sent by the service.\n *\n * @!attribute startTime\n * @readonly\n * @!group Operation Properties\n * @return [Date] the time that the request started\n *\n * @!group Request Building Events\n *\n * @!event validate(request)\n * Triggered when a request is being validated. Listeners\n * should throw an error if the request should not be sent.\n * @param request [Request] the request object being sent\n * @see AWS.EventListeners.Core.VALIDATE_CREDENTIALS\n * @see AWS.EventListeners.Core.VALIDATE_REGION\n * @example Ensuring that a certain parameter is set before sending a request\n * var req = s3.putObject(params);\n * req.on('validate', function() {\n * if (!req.params.Body.match(/^Hello\\s/)) {\n * throw new Error('Body must start with \"Hello \"');\n * }\n * });\n * req.send(function(err, data) { ... });\n *\n * @!event build(request)\n * Triggered when the request payload is being built. Listeners\n * should fill the necessary information to send the request\n * over HTTP.\n * @param (see AWS.Request~validate)\n * @example Add a custom HTTP header to a request\n * var req = s3.putObject(params);\n * req.on('build', function() {\n * req.httpRequest.headers['Custom-Header'] = 'value';\n * });\n * req.send(function(err, data) { ... });\n *\n * @!event sign(request)\n * Triggered when the request is being signed. Listeners should\n * add the correct authentication headers and/or adjust the body,\n * depending on the authentication mechanism being used.\n * @param (see AWS.Request~validate)\n *\n * @!group Request Sending Events\n *\n * @!event send(response)\n * Triggered when the request is ready to be sent. Listeners\n * should call the underlying transport layer to initiate\n * the sending of the request.\n * @param response [Response] the response object\n * @context [Request] the request object that was sent\n * @see AWS.EventListeners.Core.SEND\n *\n * @!event retry(response)\n * Triggered when a request failed and might need to be retried or redirected.\n * If the response is retryable, the listener should set the\n * `response.error.retryable` property to `true`, and optionally set\n * `response.error.retryDelay` to the millisecond delay for the next attempt.\n * In the case of a redirect, `response.error.redirect` should be set to\n * `true` with `retryDelay` set to an optional delay on the next request.\n *\n * If a listener decides that a request should not be retried,\n * it should set both `retryable` and `redirect` to false.\n *\n * Note that a retryable error will be retried at most\n * {AWS.Config.maxRetries} times (based on the service object's config).\n * Similarly, a request that is redirected will only redirect at most\n * {AWS.Config.maxRedirects} times.\n *\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n * @example Adding a custom retry for a 404 response\n * request.on('retry', function(response) {\n * // this resource is not yet available, wait 10 seconds to get it again\n * if (response.httpResponse.statusCode === 404 && response.error) {\n * response.error.retryable = true; // retry this error\n * response.error.retryDelay = 10000; // wait 10 seconds\n * }\n * });\n *\n * @!group Data Parsing Events\n *\n * @!event extractError(response)\n * Triggered on all non-2xx requests so that listeners can extract\n * error details from the response body. Listeners to this event\n * should set the `response.error` property.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!event extractData(response)\n * Triggered in successful requests to allow listeners to\n * de-serialize the response body into `response.data`.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!group Completion Events\n *\n * @!event success(response)\n * Triggered when the request completed successfully.\n * `response.data` will contain the response data and\n * `response.error` will be null.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!event error(error, response)\n * Triggered when an error occurs at any point during the\n * request. `response.error` will contain details about the error\n * that occurred. `response.data` will be null.\n * @param error [Error] the error object containing details about\n * the error that occurred.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!event complete(response)\n * Triggered whenever a request cycle completes. `response.error`\n * should be checked, since the request may have failed.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!group HTTP Events\n *\n * @!event httpHeaders(statusCode, headers, response, statusMessage)\n * Triggered when headers are sent by the remote server\n * @param statusCode [Integer] the HTTP response code\n * @param headers [map] the response headers\n * @param (see AWS.Request~send)\n * @param statusMessage [String] A status message corresponding to the HTTP\n * response code\n * @context (see AWS.Request~send)\n *\n * @!event httpData(chunk, response)\n * Triggered when data is sent by the remote server\n * @param chunk [Buffer] the buffer data containing the next data chunk\n * from the server\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n * @see AWS.EventListeners.Core.HTTP_DATA\n *\n * @!event httpUploadProgress(progress, response)\n * Triggered when the HTTP request has uploaded more data\n * @param progress [map] An object containing the `loaded` and `total` bytes\n * of the request.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n * @note This event will not be emitted in Node.js 0.8.x.\n *\n * @!event httpDownloadProgress(progress, response)\n * Triggered when the HTTP request has downloaded more data\n * @param progress [map] An object containing the `loaded` and `total` bytes\n * of the request.\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n * @note This event will not be emitted in Node.js 0.8.x.\n *\n * @!event httpError(error, response)\n * Triggered when the HTTP request failed\n * @param error [Error] the error object that was thrown\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @!event httpDone(response)\n * Triggered when the server is finished sending data\n * @param (see AWS.Request~send)\n * @context (see AWS.Request~send)\n *\n * @see AWS.Response\n */\nAWS.Request = inherit({\n\n /**\n * Creates a request for an operation on a given service with\n * a set of input parameters.\n *\n * @param service [AWS.Service] the service to perform the operation on\n * @param operation [String] the operation to perform on the service\n * @param params [Object] parameters to send to the operation.\n * See the operation's documentation for the format of the\n * parameters.\n */\n constructor: function Request(service, operation, params) {\n var endpoint = service.endpoint;\n var region = service.config.region;\n var customUserAgent = service.config.customUserAgent;\n\n if (service.signingRegion) {\n region = service.signingRegion;\n } else if (service.isGlobalEndpoint) {\n region = 'us-east-1';\n }\n\n this.domain = domain && domain.active;\n this.service = service;\n this.operation = operation;\n this.params = params || {};\n this.httpRequest = new AWS.HttpRequest(endpoint, region);\n this.httpRequest.appendToUserAgent(customUserAgent);\n this.startTime = service.getSkewCorrectedDate();\n\n this.response = new AWS.Response(this);\n this._asm = new AcceptorStateMachine(fsm.states, 'validate');\n this._haltHandlersOnError = false;\n\n AWS.SequentialExecutor.call(this);\n this.emit = this.emitEvent;\n },\n\n /**\n * @!group Sending a Request\n */\n\n /**\n * @overload send(callback = null)\n * Sends the request object.\n *\n * @callback callback function(err, data)\n * If a callback is supplied, it is called when a response is returned\n * from the service.\n * @context [AWS.Request] the request object being sent.\n * @param err [Error] the error object returned from the request.\n * Set to `null` if the request is successful.\n * @param data [Object] the de-serialized data returned from\n * the request. Set to `null` if a request error occurs.\n * @example Sending a request with a callback\n * request = s3.putObject({Bucket: 'bucket', Key: 'key'});\n * request.send(function(err, data) { console.log(err, data); });\n * @example Sending a request with no callback (using event handlers)\n * request = s3.putObject({Bucket: 'bucket', Key: 'key'});\n * request.on('complete', function(response) { ... }); // register a callback\n * request.send();\n */\n send: function send(callback) {\n if (callback) {\n // append to user agent\n this.httpRequest.appendToUserAgent('callback');\n this.on('complete', function (resp) {\n callback.call(resp, resp.error, resp.data);\n });\n }\n this.runTo();\n\n return this.response;\n },\n\n /**\n * @!method promise()\n * Sends the request and returns a 'thenable' promise.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function(data)\n * Called if the promise is fulfilled.\n * @param data [Object] the de-serialized data returned from the request.\n * @callback rejectedCallback function(error)\n * Called if the promise is rejected.\n * @param error [Error] the error object returned from the request.\n * @return [Promise] A promise that represents the state of the request.\n * @example Sending a request using promises.\n * var request = s3.putObject({Bucket: 'bucket', Key: 'key'});\n * var result = request.promise();\n * result.then(function(data) { ... }, function(error) { ... });\n */\n\n /**\n * @api private\n */\n build: function build(callback) {\n return this.runTo('send', callback);\n },\n\n /**\n * @api private\n */\n runTo: function runTo(state, done) {\n this._asm.runTo(state, done, this);\n return this;\n },\n\n /**\n * Aborts a request, emitting the error and complete events.\n *\n * @!macro nobrowser\n * @example Aborting a request after sending\n * var params = {\n * Bucket: 'bucket', Key: 'key',\n * Body: Buffer.alloc(1024 * 1024 * 5) // 5MB payload\n * };\n * var request = s3.putObject(params);\n * request.send(function (err, data) {\n * if (err) console.log(\"Error:\", err.code, err.message);\n * else console.log(data);\n * });\n *\n * // abort request in 1 second\n * setTimeout(request.abort.bind(request), 1000);\n *\n * // prints \"Error: RequestAbortedError Request aborted by user\"\n * @return [AWS.Request] the same request object, for chaining.\n * @since v1.4.0\n */\n abort: function abort() {\n this.removeAllListeners('validateResponse');\n this.removeAllListeners('extractError');\n this.on('validateResponse', function addAbortedError(resp) {\n resp.error = AWS.util.error(new Error('Request aborted by user'), {\n code: 'RequestAbortedError', retryable: false\n });\n });\n\n if (this.httpRequest.stream && !this.httpRequest.stream.didCallback) { // abort HTTP stream\n this.httpRequest.stream.abort();\n if (this.httpRequest._abortCallback) {\n this.httpRequest._abortCallback();\n } else {\n this.removeAllListeners('send'); // haven't sent yet, so let's not\n }\n }\n\n return this;\n },\n\n /**\n * Iterates over each page of results given a pageable request, calling\n * the provided callback with each page of data. After all pages have been\n * retrieved, the callback is called with `null` data.\n *\n * @note This operation can generate multiple requests to a service.\n * @example Iterating over multiple pages of objects in an S3 bucket\n * var pages = 1;\n * s3.listObjects().eachPage(function(err, data) {\n * if (err) return;\n * console.log(\"Page\", pages++);\n * console.log(data);\n * });\n * @example Iterating over multiple pages with an asynchronous callback\n * s3.listObjects(params).eachPage(function(err, data, done) {\n * doSomethingAsyncAndOrExpensive(function() {\n * // The next page of results isn't fetched until done is called\n * done();\n * });\n * });\n * @callback callback function(err, data, [doneCallback])\n * Called with each page of resulting data from the request. If the\n * optional `doneCallback` is provided in the function, it must be called\n * when the callback is complete.\n *\n * @param err [Error] an error object, if an error occurred.\n * @param data [Object] a single page of response data. If there is no\n * more data, this object will be `null`.\n * @param doneCallback [Function] an optional done callback. If this\n * argument is defined in the function declaration, it should be called\n * when the next page is ready to be retrieved. This is useful for\n * controlling serial pagination across asynchronous operations.\n * @return [Boolean] if the callback returns `false`, pagination will\n * stop.\n *\n * @see AWS.Request.eachItem\n * @see AWS.Response.nextPage\n * @since v1.4.0\n */\n eachPage: function eachPage(callback) {\n // Make all callbacks async-ish\n callback = AWS.util.fn.makeAsync(callback, 3);\n\n function wrappedCallback(response) {\n callback.call(response, response.error, response.data, function (result) {\n if (result === false) return;\n\n if (response.hasNextPage()) {\n response.nextPage().on('complete', wrappedCallback).send();\n } else {\n callback.call(response, null, null, AWS.util.fn.noop);\n }\n });\n }\n\n this.on('complete', wrappedCallback).send();\n },\n\n /**\n * Enumerates over individual items of a request, paging the responses if\n * necessary.\n *\n * @api experimental\n * @since v1.4.0\n */\n eachItem: function eachItem(callback) {\n var self = this;\n function wrappedCallback(err, data) {\n if (err) return callback(err, null);\n if (data === null) return callback(null, null);\n\n var config = self.service.paginationConfig(self.operation);\n var resultKey = config.resultKey;\n if (Array.isArray(resultKey)) resultKey = resultKey[0];\n var items = jmespath.search(data, resultKey);\n var continueIteration = true;\n AWS.util.arrayEach(items, function(item) {\n continueIteration = callback(null, item);\n if (continueIteration === false) {\n return AWS.util.abort;\n }\n });\n return continueIteration;\n }\n\n this.eachPage(wrappedCallback);\n },\n\n /**\n * @return [Boolean] whether the operation can return multiple pages of\n * response data.\n * @see AWS.Response.eachPage\n * @since v1.4.0\n */\n isPageable: function isPageable() {\n return this.service.paginationConfig(this.operation) ? true : false;\n },\n\n /**\n * Sends the request and converts the request object into a readable stream\n * that can be read from or piped into a writable stream.\n *\n * @note The data read from a readable stream contains only\n * the raw HTTP body contents.\n * @example Manually reading from a stream\n * request.createReadStream().on('data', function(data) {\n * console.log(\"Got data:\", data.toString());\n * });\n * @example Piping a request body into a file\n * var out = fs.createWriteStream('/path/to/outfile.jpg');\n * s3.service.getObject(params).createReadStream().pipe(out);\n * @return [Stream] the readable stream object that can be piped\n * or read from (by registering 'data' event listeners).\n * @!macro nobrowser\n */\n createReadStream: function createReadStream() {\n var streams = AWS.util.stream;\n var req = this;\n var stream = null;\n\n if (AWS.HttpClient.streamsApiVersion === 2) {\n stream = new streams.PassThrough();\n process.nextTick(function() { req.send(); });\n } else {\n stream = new streams.Stream();\n stream.readable = true;\n\n stream.sent = false;\n stream.on('newListener', function(event) {\n if (!stream.sent && event === 'data') {\n stream.sent = true;\n process.nextTick(function() { req.send(); });\n }\n });\n }\n\n this.on('error', function(err) {\n stream.emit('error', err);\n });\n\n this.on('httpHeaders', function streamHeaders(statusCode, headers, resp) {\n if (statusCode < 300) {\n req.removeListener('httpData', AWS.EventListeners.Core.HTTP_DATA);\n req.removeListener('httpError', AWS.EventListeners.Core.HTTP_ERROR);\n req.on('httpError', function streamHttpError(error) {\n resp.error = error;\n resp.error.retryable = false;\n });\n\n var shouldCheckContentLength = false;\n var expectedLen;\n if (req.httpRequest.method !== 'HEAD') {\n expectedLen = parseInt(headers['content-length'], 10);\n }\n if (expectedLen !== undefined && !isNaN(expectedLen) && expectedLen >= 0) {\n shouldCheckContentLength = true;\n var receivedLen = 0;\n }\n\n var checkContentLengthAndEmit = function checkContentLengthAndEmit() {\n if (shouldCheckContentLength && receivedLen !== expectedLen) {\n stream.emit('error', AWS.util.error(\n new Error('Stream content length mismatch. Received ' +\n receivedLen + ' of ' + expectedLen + ' bytes.'),\n { code: 'StreamContentLengthMismatch' }\n ));\n } else if (AWS.HttpClient.streamsApiVersion === 2) {\n stream.end();\n } else {\n stream.emit('end');\n }\n };\n\n var httpStream = resp.httpResponse.createUnbufferedStream();\n\n if (AWS.HttpClient.streamsApiVersion === 2) {\n if (shouldCheckContentLength) {\n var lengthAccumulator = new streams.PassThrough();\n lengthAccumulator._write = function(chunk) {\n if (chunk && chunk.length) {\n receivedLen += chunk.length;\n }\n return streams.PassThrough.prototype._write.apply(this, arguments);\n };\n\n lengthAccumulator.on('end', checkContentLengthAndEmit);\n stream.on('error', function(err) {\n shouldCheckContentLength = false;\n httpStream.unpipe(lengthAccumulator);\n lengthAccumulator.emit('end');\n lengthAccumulator.end();\n });\n httpStream.pipe(lengthAccumulator).pipe(stream, { end: false });\n } else {\n httpStream.pipe(stream);\n }\n } else {\n\n if (shouldCheckContentLength) {\n httpStream.on('data', function(arg) {\n if (arg && arg.length) {\n receivedLen += arg.length;\n }\n });\n }\n\n httpStream.on('data', function(arg) {\n stream.emit('data', arg);\n });\n httpStream.on('end', checkContentLengthAndEmit);\n }\n\n httpStream.on('error', function(err) {\n shouldCheckContentLength = false;\n stream.emit('error', err);\n });\n }\n });\n\n return stream;\n },\n\n /**\n * @param [Array,Response] args This should be the response object,\n * or an array of args to send to the event.\n * @api private\n */\n emitEvent: function emit(eventName, args, done) {\n if (typeof args === 'function') { done = args; args = null; }\n if (!done) done = function() { };\n if (!args) args = this.eventParameters(eventName, this.response);\n\n var origEmit = AWS.SequentialExecutor.prototype.emit;\n origEmit.call(this, eventName, args, function (err) {\n if (err) this.response.error = err;\n done.call(this, err);\n });\n },\n\n /**\n * @api private\n */\n eventParameters: function eventParameters(eventName) {\n switch (eventName) {\n case 'restart':\n case 'validate':\n case 'sign':\n case 'build':\n case 'afterValidate':\n case 'afterBuild':\n return [this];\n case 'error':\n return [this.response.error, this.response];\n default:\n return [this.response];\n }\n },\n\n /**\n * @api private\n */\n presign: function presign(expires, callback) {\n if (!callback && typeof expires === 'function') {\n callback = expires;\n expires = null;\n }\n return new AWS.Signers.Presign().sign(this.toGet(), expires, callback);\n },\n\n /**\n * @api private\n */\n isPresigned: function isPresigned() {\n return Object.prototype.hasOwnProperty.call(this.httpRequest.headers, 'presigned-expires');\n },\n\n /**\n * @api private\n */\n toUnauthenticated: function toUnauthenticated() {\n this._unAuthenticated = true;\n this.removeListener('validate', AWS.EventListeners.Core.VALIDATE_CREDENTIALS);\n this.removeListener('sign', AWS.EventListeners.Core.SIGN);\n return this;\n },\n\n /**\n * @api private\n */\n toGet: function toGet() {\n if (this.service.api.protocol === 'query' ||\n this.service.api.protocol === 'ec2') {\n this.removeListener('build', this.buildAsGet);\n this.addListener('build', this.buildAsGet);\n }\n return this;\n },\n\n /**\n * @api private\n */\n buildAsGet: function buildAsGet(request) {\n request.httpRequest.method = 'GET';\n request.httpRequest.path = request.service.endpoint.path +\n '?' + request.httpRequest.body;\n request.httpRequest.body = '';\n\n // don't need these headers on a GET request\n delete request.httpRequest.headers['Content-Length'];\n delete request.httpRequest.headers['Content-Type'];\n },\n\n /**\n * @api private\n */\n haltHandlersOnError: function haltHandlersOnError() {\n this._haltHandlersOnError = true;\n }\n});\n\n/**\n * @api private\n */\nAWS.Request.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.promise = function promise() {\n var self = this;\n // append to user agent\n this.httpRequest.appendToUserAgent('promise');\n return new PromiseDependency(function(resolve, reject) {\n self.on('complete', function(resp) {\n if (resp.error) {\n reject(resp.error);\n } else {\n // define $response property so that it is not enumerable\n // this prevents circular reference errors when stringifying the JSON object\n resolve(Object.defineProperty(\n resp.data || {},\n '$response',\n {value: resp}\n ));\n }\n });\n self.runTo();\n });\n };\n};\n\n/**\n * @api private\n */\nAWS.Request.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.promise;\n};\n\nAWS.util.addPromises(AWS.Request);\n\nAWS.util.mixin(AWS.Request, AWS.SequentialExecutor);\n","/**\n * Copyright 2012-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You\n * may not use this file except in compliance with the License. A copy of\n * the License is located at\n *\n * http://aws.amazon.com/apache2.0/\n *\n * or in the \"license\" file accompanying this file. This file is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF\n * ANY KIND, either express or implied. See the License for the specific\n * language governing permissions and limitations under the License.\n */\n\nvar AWS = require('./core');\nvar inherit = AWS.util.inherit;\nvar jmespath = require('jmespath');\n\n/**\n * @api private\n */\nfunction CHECK_ACCEPTORS(resp) {\n var waiter = resp.request._waiter;\n var acceptors = waiter.config.acceptors;\n var acceptorMatched = false;\n var state = 'retry';\n\n acceptors.forEach(function(acceptor) {\n if (!acceptorMatched) {\n var matcher = waiter.matchers[acceptor.matcher];\n if (matcher && matcher(resp, acceptor.expected, acceptor.argument)) {\n acceptorMatched = true;\n state = acceptor.state;\n }\n }\n });\n\n if (!acceptorMatched && resp.error) state = 'failure';\n\n if (state === 'success') {\n waiter.setSuccess(resp);\n } else {\n waiter.setError(resp, state === 'retry');\n }\n}\n\n/**\n * @api private\n */\nAWS.ResourceWaiter = inherit({\n /**\n * Waits for a given state on a service object\n * @param service [Service] the service object to wait on\n * @param state [String] the state (defined in waiter configuration) to wait\n * for.\n * @example Create a waiter for running EC2 instances\n * var ec2 = new AWS.EC2;\n * var waiter = new AWS.ResourceWaiter(ec2, 'instanceRunning');\n */\n constructor: function constructor(service, state) {\n this.service = service;\n this.state = state;\n this.loadWaiterConfig(this.state);\n },\n\n service: null,\n\n state: null,\n\n config: null,\n\n matchers: {\n path: function(resp, expected, argument) {\n try {\n var result = jmespath.search(resp.data, argument);\n } catch (err) {\n return false;\n }\n\n return jmespath.strictDeepEqual(result,expected);\n },\n\n pathAll: function(resp, expected, argument) {\n try {\n var results = jmespath.search(resp.data, argument);\n } catch (err) {\n return false;\n }\n\n if (!Array.isArray(results)) results = [results];\n var numResults = results.length;\n if (!numResults) return false;\n for (var ind = 0 ; ind < numResults; ind++) {\n if (!jmespath.strictDeepEqual(results[ind], expected)) {\n return false;\n }\n }\n return true;\n },\n\n pathAny: function(resp, expected, argument) {\n try {\n var results = jmespath.search(resp.data, argument);\n } catch (err) {\n return false;\n }\n\n if (!Array.isArray(results)) results = [results];\n var numResults = results.length;\n for (var ind = 0 ; ind < numResults; ind++) {\n if (jmespath.strictDeepEqual(results[ind], expected)) {\n return true;\n }\n }\n return false;\n },\n\n status: function(resp, expected) {\n var statusCode = resp.httpResponse.statusCode;\n return (typeof statusCode === 'number') && (statusCode === expected);\n },\n\n error: function(resp, expected) {\n if (typeof expected === 'string' && resp.error) {\n return expected === resp.error.code;\n }\n // if expected is not string, can be boolean indicating presence of error\n return expected === !!resp.error;\n }\n },\n\n listeners: new AWS.SequentialExecutor().addNamedListeners(function(add) {\n add('RETRY_CHECK', 'retry', function(resp) {\n var waiter = resp.request._waiter;\n if (resp.error && resp.error.code === 'ResourceNotReady') {\n resp.error.retryDelay = (waiter.config.delay || 0) * 1000;\n }\n });\n\n add('CHECK_OUTPUT', 'extractData', CHECK_ACCEPTORS);\n\n add('CHECK_ERROR', 'extractError', CHECK_ACCEPTORS);\n }),\n\n /**\n * @return [AWS.Request]\n */\n wait: function wait(params, callback) {\n if (typeof params === 'function') {\n callback = params; params = undefined;\n }\n\n if (params && params.$waiter) {\n params = AWS.util.copy(params);\n if (typeof params.$waiter.delay === 'number') {\n this.config.delay = params.$waiter.delay;\n }\n if (typeof params.$waiter.maxAttempts === 'number') {\n this.config.maxAttempts = params.$waiter.maxAttempts;\n }\n delete params.$waiter;\n }\n\n var request = this.service.makeRequest(this.config.operation, params);\n request._waiter = this;\n request.response.maxRetries = this.config.maxAttempts;\n request.addListeners(this.listeners);\n\n if (callback) request.send(callback);\n return request;\n },\n\n setSuccess: function setSuccess(resp) {\n resp.error = null;\n resp.data = resp.data || {};\n resp.request.removeAllListeners('extractData');\n },\n\n setError: function setError(resp, retryable) {\n resp.data = null;\n resp.error = AWS.util.error(resp.error || new Error(), {\n code: 'ResourceNotReady',\n message: 'Resource is not in the state ' + this.state,\n retryable: retryable\n });\n },\n\n /**\n * Loads waiter configuration from API configuration\n *\n * @api private\n */\n loadWaiterConfig: function loadWaiterConfig(state) {\n if (!this.service.api.waiters[state]) {\n throw new AWS.util.error(new Error(), {\n code: 'StateNotFoundError',\n message: 'State ' + state + ' not found.'\n });\n }\n\n this.config = AWS.util.copy(this.service.api.waiters[state]);\n }\n});\n","var AWS = require('./core');\nvar inherit = AWS.util.inherit;\nvar jmespath = require('jmespath');\n\n/**\n * This class encapsulates the response information\n * from a service request operation sent through {AWS.Request}.\n * The response object has two main properties for getting information\n * back from a request:\n *\n * ## The `data` property\n *\n * The `response.data` property contains the serialized object data\n * retrieved from the service request. For instance, for an\n * Amazon DynamoDB `listTables` method call, the response data might\n * look like:\n *\n * ```\n * > resp.data\n * { TableNames:\n * [ 'table1', 'table2', ... ] }\n * ```\n *\n * The `data` property can be null if an error occurs (see below).\n *\n * ## The `error` property\n *\n * In the event of a service error (or transfer error), the\n * `response.error` property will be filled with the given\n * error data in the form:\n *\n * ```\n * { code: 'SHORT_UNIQUE_ERROR_CODE',\n * message: 'Some human readable error message' }\n * ```\n *\n * In the case of an error, the `data` property will be `null`.\n * Note that if you handle events that can be in a failure state,\n * you should always check whether `response.error` is set\n * before attempting to access the `response.data` property.\n *\n * @!attribute data\n * @readonly\n * @!group Data Properties\n * @note Inside of a {AWS.Request~httpData} event, this\n * property contains a single raw packet instead of the\n * full de-serialized service response.\n * @return [Object] the de-serialized response data\n * from the service.\n *\n * @!attribute error\n * An structure containing information about a service\n * or networking error.\n * @readonly\n * @!group Data Properties\n * @note This attribute is only filled if a service or\n * networking error occurs.\n * @return [Error]\n * * code [String] a unique short code representing the\n * error that was emitted.\n * * message [String] a longer human readable error message\n * * retryable [Boolean] whether the error message is\n * retryable.\n * * statusCode [Numeric] in the case of a request that reached the service,\n * this value contains the response status code.\n * * time [Date] the date time object when the error occurred.\n * * hostname [String] set when a networking error occurs to easily\n * identify the endpoint of the request.\n * * region [String] set when a networking error occurs to easily\n * identify the region of the request.\n *\n * @!attribute requestId\n * @readonly\n * @!group Data Properties\n * @return [String] the unique request ID associated with the response.\n * Log this value when debugging requests for AWS support.\n *\n * @!attribute retryCount\n * @readonly\n * @!group Operation Properties\n * @return [Integer] the number of retries that were\n * attempted before the request was completed.\n *\n * @!attribute redirectCount\n * @readonly\n * @!group Operation Properties\n * @return [Integer] the number of redirects that were\n * followed before the request was completed.\n *\n * @!attribute httpResponse\n * @readonly\n * @!group HTTP Properties\n * @return [AWS.HttpResponse] the raw HTTP response object\n * containing the response headers and body information\n * from the server.\n *\n * @see AWS.Request\n */\nAWS.Response = inherit({\n\n /**\n * @api private\n */\n constructor: function Response(request) {\n this.request = request;\n this.data = null;\n this.error = null;\n this.retryCount = 0;\n this.redirectCount = 0;\n this.httpResponse = new AWS.HttpResponse();\n if (request) {\n this.maxRetries = request.service.numRetries();\n this.maxRedirects = request.service.config.maxRedirects;\n }\n },\n\n /**\n * Creates a new request for the next page of response data, calling the\n * callback with the page data if a callback is provided.\n *\n * @callback callback function(err, data)\n * Called when a page of data is returned from the next request.\n *\n * @param err [Error] an error object, if an error occurred in the request\n * @param data [Object] the next page of data, or null, if there are no\n * more pages left.\n * @return [AWS.Request] the request object for the next page of data\n * @return [null] if no callback is provided and there are no pages left\n * to retrieve.\n * @since v1.4.0\n */\n nextPage: function nextPage(callback) {\n var config;\n var service = this.request.service;\n var operation = this.request.operation;\n try {\n config = service.paginationConfig(operation, true);\n } catch (e) { this.error = e; }\n\n if (!this.hasNextPage()) {\n if (callback) callback(this.error, null);\n else if (this.error) throw this.error;\n return null;\n }\n\n var params = AWS.util.copy(this.request.params);\n if (!this.nextPageTokens) {\n return callback ? callback(null, null) : null;\n } else {\n var inputTokens = config.inputToken;\n if (typeof inputTokens === 'string') inputTokens = [inputTokens];\n for (var i = 0; i < inputTokens.length; i++) {\n params[inputTokens[i]] = this.nextPageTokens[i];\n }\n return service.makeRequest(this.request.operation, params, callback);\n }\n },\n\n /**\n * @return [Boolean] whether more pages of data can be returned by further\n * requests\n * @since v1.4.0\n */\n hasNextPage: function hasNextPage() {\n this.cacheNextPageTokens();\n if (this.nextPageTokens) return true;\n if (this.nextPageTokens === undefined) return undefined;\n else return false;\n },\n\n /**\n * @api private\n */\n cacheNextPageTokens: function cacheNextPageTokens() {\n if (Object.prototype.hasOwnProperty.call(this, 'nextPageTokens')) return this.nextPageTokens;\n this.nextPageTokens = undefined;\n\n var config = this.request.service.paginationConfig(this.request.operation);\n if (!config) return this.nextPageTokens;\n\n this.nextPageTokens = null;\n if (config.moreResults) {\n if (!jmespath.search(this.data, config.moreResults)) {\n return this.nextPageTokens;\n }\n }\n\n var exprs = config.outputToken;\n if (typeof exprs === 'string') exprs = [exprs];\n AWS.util.arrayEach.call(this, exprs, function (expr) {\n var output = jmespath.search(this.data, expr);\n if (output) {\n this.nextPageTokens = this.nextPageTokens || [];\n this.nextPageTokens.push(output);\n }\n });\n\n return this.nextPageTokens;\n }\n\n});\n","var AWS = require('../core');\nvar byteLength = AWS.util.string.byteLength;\nvar Buffer = AWS.util.Buffer;\n\n/**\n * The managed uploader allows for easy and efficient uploading of buffers,\n * blobs, or streams, using a configurable amount of concurrency to perform\n * multipart uploads where possible. This abstraction also enables uploading\n * streams of unknown size due to the use of multipart uploads.\n *\n * To construct a managed upload object, see the {constructor} function.\n *\n * ## Tracking upload progress\n *\n * The managed upload object can also track progress by attaching an\n * 'httpUploadProgress' listener to the upload manager. This event is similar\n * to {AWS.Request~httpUploadProgress} but groups all concurrent upload progress\n * into a single event. See {AWS.S3.ManagedUpload~httpUploadProgress} for more\n * information.\n *\n * ## Handling Multipart Cleanup\n *\n * By default, this class will automatically clean up any multipart uploads\n * when an individual part upload fails. This behavior can be disabled in order\n * to manually handle failures by setting the `leavePartsOnError` configuration\n * option to `true` when initializing the upload object.\n *\n * @!event httpUploadProgress(progress)\n * Triggered when the uploader has uploaded more data.\n * @note The `total` property may not be set if the stream being uploaded has\n * not yet finished chunking. In this case the `total` will be undefined\n * until the total stream size is known.\n * @note This event will not be emitted in Node.js 0.8.x.\n * @param progress [map] An object containing the `loaded` and `total` bytes\n * of the request and the `key` of the S3 object. Note that `total` may be undefined until the payload\n * size is known.\n * @context (see AWS.Request~send)\n */\nAWS.S3.ManagedUpload = AWS.util.inherit({\n /**\n * Creates a managed upload object with a set of configuration options.\n *\n * @note A \"Body\" parameter is required to be set prior to calling {send}.\n * @note In Node.js, sending \"Body\" as {https://nodejs.org/dist/latest/docs/api/stream.html#stream_object_mode object-mode stream}\n * may result in upload hangs. Using buffer stream is preferable.\n * @option options params [map] a map of parameters to pass to the upload\n * requests. The \"Body\" parameter is required to be specified either on\n * the service or in the params option.\n * @note ContentMD5 should not be provided when using the managed upload object.\n * Instead, setting \"computeChecksums\" to true will enable automatic ContentMD5 generation\n * by the managed upload object.\n * @option options queueSize [Number] (4) the size of the concurrent queue\n * manager to upload parts in parallel. Set to 1 for synchronous uploading\n * of parts. Note that the uploader will buffer at most queueSize * partSize\n * bytes into memory at any given time.\n * @option options partSize [Number] (5mb) the size in bytes for each\n * individual part to be uploaded. Adjust the part size to ensure the number\n * of parts does not exceed {maxTotalParts}. See {minPartSize} for the\n * minimum allowed part size.\n * @option options leavePartsOnError [Boolean] (false) whether to abort the\n * multipart upload if an error occurs. Set to true if you want to handle\n * failures manually.\n * @option options service [AWS.S3] an optional S3 service object to use for\n * requests. This object might have bound parameters used by the uploader.\n * @option options tags [Array] The tags to apply to the uploaded object.\n * Each tag should have a `Key` and `Value` keys.\n * @example Creating a default uploader for a stream object\n * var upload = new AWS.S3.ManagedUpload({\n * params: {Bucket: 'bucket', Key: 'key', Body: stream}\n * });\n * @example Creating an uploader with concurrency of 1 and partSize of 10mb\n * var upload = new AWS.S3.ManagedUpload({\n * partSize: 10 * 1024 * 1024, queueSize: 1,\n * params: {Bucket: 'bucket', Key: 'key', Body: stream}\n * });\n * @example Creating an uploader with tags\n * var upload = new AWS.S3.ManagedUpload({\n * params: {Bucket: 'bucket', Key: 'key', Body: stream},\n * tags: [{Key: 'tag1', Value: 'value1'}, {Key: 'tag2', Value: 'value2'}]\n * });\n * @see send\n */\n constructor: function ManagedUpload(options) {\n var self = this;\n AWS.SequentialExecutor.call(self);\n self.body = null;\n self.sliceFn = null;\n self.callback = null;\n self.parts = {};\n self.completeInfo = [];\n self.fillQueue = function() {\n self.callback(new Error('Unsupported body payload ' + typeof self.body));\n };\n\n self.configure(options);\n },\n\n /**\n * @api private\n */\n configure: function configure(options) {\n options = options || {};\n this.partSize = this.minPartSize;\n\n if (options.queueSize) this.queueSize = options.queueSize;\n if (options.partSize) this.partSize = options.partSize;\n if (options.leavePartsOnError) this.leavePartsOnError = true;\n if (options.tags) {\n if (!Array.isArray(options.tags)) {\n throw new Error('Tags must be specified as an array; ' +\n typeof options.tags + ' provided.');\n }\n this.tags = options.tags;\n }\n\n if (this.partSize < this.minPartSize) {\n throw new Error('partSize must be greater than ' +\n this.minPartSize);\n }\n\n this.service = options.service;\n this.bindServiceObject(options.params);\n this.validateBody();\n this.adjustTotalBytes();\n },\n\n /**\n * @api private\n */\n leavePartsOnError: false,\n\n /**\n * @api private\n */\n queueSize: 4,\n\n /**\n * @api private\n */\n partSize: null,\n\n /**\n * @readonly\n * @return [Number] the minimum number of bytes for an individual part\n * upload.\n */\n minPartSize: 1024 * 1024 * 5,\n\n /**\n * @readonly\n * @return [Number] the maximum allowed number of parts in a multipart upload.\n */\n maxTotalParts: 10000,\n\n /**\n * Initiates the managed upload for the payload.\n *\n * @callback callback function(err, data)\n * @param err [Error] an error or null if no error occurred.\n * @param data [map] The response data from the successful upload:\n * * `Location` (String) the URL of the uploaded object\n * * `ETag` (String) the ETag of the uploaded object\n * * `Bucket` (String) the bucket to which the object was uploaded\n * * `Key` (String) the key to which the object was uploaded\n * @example Sending a managed upload object\n * var params = {Bucket: 'bucket', Key: 'key', Body: stream};\n * var upload = new AWS.S3.ManagedUpload({params: params});\n * upload.send(function(err, data) {\n * console.log(err, data);\n * });\n */\n send: function(callback) {\n var self = this;\n self.failed = false;\n self.callback = callback || function(err) { if (err) throw err; };\n\n var runFill = true;\n if (self.sliceFn) {\n self.fillQueue = self.fillBuffer;\n } else if (AWS.util.isNode()) {\n var Stream = AWS.util.stream.Stream;\n if (self.body instanceof Stream) {\n runFill = false;\n self.fillQueue = self.fillStream;\n self.partBuffers = [];\n self.body.\n on('error', function(err) { self.cleanup(err); }).\n on('readable', function() { self.fillQueue(); }).\n on('end', function() {\n self.isDoneChunking = true;\n self.numParts = self.totalPartNumbers;\n self.fillQueue.call(self);\n\n if (self.isDoneChunking && self.totalPartNumbers >= 1 && self.doneParts === self.numParts) {\n self.finishMultiPart();\n }\n });\n }\n }\n\n if (runFill) self.fillQueue.call(self);\n },\n\n /**\n * @!method promise()\n * Returns a 'thenable' promise.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function(data)\n * Called if the promise is fulfilled.\n * @param data [map] The response data from the successful upload:\n * `Location` (String) the URL of the uploaded object\n * `ETag` (String) the ETag of the uploaded object\n * `Bucket` (String) the bucket to which the object was uploaded\n * `Key` (String) the key to which the object was uploaded\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] an error or null if no error occurred.\n * @return [Promise] A promise that represents the state of the upload request.\n * @example Sending an upload request using promises.\n * var upload = s3.upload({Bucket: 'bucket', Key: 'key', Body: stream});\n * var promise = upload.promise();\n * promise.then(function(data) { ... }, function(err) { ... });\n */\n\n /**\n * Aborts a managed upload, including all concurrent upload requests.\n * @note By default, calling this function will cleanup a multipart upload\n * if one was created. To leave the multipart upload around after aborting\n * a request, configure `leavePartsOnError` to `true` in the {constructor}.\n * @note Calling {abort} in the browser environment will not abort any requests\n * that are already in flight. If a multipart upload was created, any parts\n * not yet uploaded will not be sent, and the multipart upload will be cleaned up.\n * @example Aborting an upload\n * var params = {\n * Bucket: 'bucket', Key: 'key',\n * Body: Buffer.alloc(1024 * 1024 * 25) // 25MB payload\n * };\n * var upload = s3.upload(params);\n * upload.send(function (err, data) {\n * if (err) console.log(\"Error:\", err.code, err.message);\n * else console.log(data);\n * });\n *\n * // abort request in 1 second\n * setTimeout(upload.abort.bind(upload), 1000);\n */\n abort: function() {\n var self = this;\n //abort putObject request\n if (self.isDoneChunking === true && self.totalPartNumbers === 1 && self.singlePart) {\n self.singlePart.abort();\n } else {\n self.cleanup(AWS.util.error(new Error('Request aborted by user'), {\n code: 'RequestAbortedError', retryable: false\n }));\n }\n },\n\n /**\n * @api private\n */\n validateBody: function validateBody() {\n var self = this;\n self.body = self.service.config.params.Body;\n if (typeof self.body === 'string') {\n self.body = AWS.util.buffer.toBuffer(self.body);\n } else if (!self.body) {\n throw new Error('params.Body is required');\n }\n self.sliceFn = AWS.util.arraySliceFn(self.body);\n },\n\n /**\n * @api private\n */\n bindServiceObject: function bindServiceObject(params) {\n params = params || {};\n var self = this;\n // bind parameters to new service object\n if (!self.service) {\n self.service = new AWS.S3({params: params});\n } else {\n // Create a new S3 client from the supplied client's constructor.\n var service = self.service;\n var config = AWS.util.copy(service.config);\n config.signatureVersion = service.getSignatureVersion();\n self.service = new service.constructor.__super__(config);\n self.service.config.params =\n AWS.util.merge(self.service.config.params || {}, params);\n Object.defineProperty(self.service, '_originalConfig', {\n get: function() { return service._originalConfig; },\n enumerable: false,\n configurable: true\n });\n }\n },\n\n /**\n * @api private\n */\n adjustTotalBytes: function adjustTotalBytes() {\n var self = this;\n try { // try to get totalBytes\n self.totalBytes = byteLength(self.body);\n } catch (e) { }\n\n // try to adjust partSize if we know payload length\n if (self.totalBytes) {\n var newPartSize = Math.ceil(self.totalBytes / self.maxTotalParts);\n if (newPartSize > self.partSize) self.partSize = newPartSize;\n } else {\n self.totalBytes = undefined;\n }\n },\n\n /**\n * @api private\n */\n isDoneChunking: false,\n\n /**\n * @api private\n */\n partPos: 0,\n\n /**\n * @api private\n */\n totalChunkedBytes: 0,\n\n /**\n * @api private\n */\n totalUploadedBytes: 0,\n\n /**\n * @api private\n */\n totalBytes: undefined,\n\n /**\n * @api private\n */\n numParts: 0,\n\n /**\n * @api private\n */\n totalPartNumbers: 0,\n\n /**\n * @api private\n */\n activeParts: 0,\n\n /**\n * @api private\n */\n doneParts: 0,\n\n /**\n * @api private\n */\n parts: null,\n\n /**\n * @api private\n */\n completeInfo: null,\n\n /**\n * @api private\n */\n failed: false,\n\n /**\n * @api private\n */\n multipartReq: null,\n\n /**\n * @api private\n */\n partBuffers: null,\n\n /**\n * @api private\n */\n partBufferLength: 0,\n\n /**\n * @api private\n */\n fillBuffer: function fillBuffer() {\n var self = this;\n var bodyLen = byteLength(self.body);\n\n if (bodyLen === 0) {\n self.isDoneChunking = true;\n self.numParts = 1;\n self.nextChunk(self.body);\n return;\n }\n\n while (self.activeParts < self.queueSize && self.partPos < bodyLen) {\n var endPos = Math.min(self.partPos + self.partSize, bodyLen);\n var buf = self.sliceFn.call(self.body, self.partPos, endPos);\n self.partPos += self.partSize;\n\n if (byteLength(buf) < self.partSize || self.partPos === bodyLen) {\n self.isDoneChunking = true;\n self.numParts = self.totalPartNumbers + 1;\n }\n self.nextChunk(buf);\n }\n },\n\n /**\n * @api private\n */\n fillStream: function fillStream() {\n var self = this;\n if (self.activeParts >= self.queueSize) return;\n\n var buf = self.body.read(self.partSize - self.partBufferLength) ||\n self.body.read();\n if (buf) {\n self.partBuffers.push(buf);\n self.partBufferLength += buf.length;\n self.totalChunkedBytes += buf.length;\n }\n\n if (self.partBufferLength >= self.partSize) {\n // if we have single buffer we avoid copyfull concat\n var pbuf = self.partBuffers.length === 1 ?\n self.partBuffers[0] : Buffer.concat(self.partBuffers);\n self.partBuffers = [];\n self.partBufferLength = 0;\n\n // if we have more than partSize, push the rest back on the queue\n if (pbuf.length > self.partSize) {\n var rest = pbuf.slice(self.partSize);\n self.partBuffers.push(rest);\n self.partBufferLength += rest.length;\n pbuf = pbuf.slice(0, self.partSize);\n }\n\n self.nextChunk(pbuf);\n }\n\n if (self.isDoneChunking && !self.isDoneSending) {\n // if we have single buffer we avoid copyfull concat\n pbuf = self.partBuffers.length === 1 ?\n self.partBuffers[0] : Buffer.concat(self.partBuffers);\n self.partBuffers = [];\n self.partBufferLength = 0;\n self.totalBytes = self.totalChunkedBytes;\n self.isDoneSending = true;\n\n if (self.numParts === 0 || pbuf.length > 0) {\n self.numParts++;\n self.nextChunk(pbuf);\n }\n }\n\n self.body.read(0);\n },\n\n /**\n * @api private\n */\n nextChunk: function nextChunk(chunk) {\n var self = this;\n if (self.failed) return null;\n\n var partNumber = ++self.totalPartNumbers;\n if (self.isDoneChunking && partNumber === 1) {\n var params = {Body: chunk};\n if (this.tags) {\n params.Tagging = this.getTaggingHeader();\n }\n var req = self.service.putObject(params);\n req._managedUpload = self;\n req.on('httpUploadProgress', self.progress).send(self.finishSinglePart);\n self.singlePart = req; //save the single part request\n return null;\n } else if (self.service.config.params.ContentMD5) {\n var err = AWS.util.error(new Error('The Content-MD5 you specified is invalid for multi-part uploads.'), {\n code: 'InvalidDigest', retryable: false\n });\n\n self.cleanup(err);\n return null;\n }\n\n if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) {\n return null; // Already uploaded this part.\n }\n\n self.activeParts++;\n if (!self.service.config.params.UploadId) {\n\n if (!self.multipartReq) { // create multipart\n self.multipartReq = self.service.createMultipartUpload();\n self.multipartReq.on('success', function(resp) {\n self.service.config.params.UploadId = resp.data.UploadId;\n self.multipartReq = null;\n });\n self.queueChunks(chunk, partNumber);\n self.multipartReq.on('error', function(err) {\n self.cleanup(err);\n });\n self.multipartReq.send();\n } else {\n self.queueChunks(chunk, partNumber);\n }\n } else { // multipart is created, just send\n self.uploadPart(chunk, partNumber);\n }\n },\n\n /**\n * @api private\n */\n getTaggingHeader: function getTaggingHeader() {\n var kvPairStrings = [];\n for (var i = 0; i < this.tags.length; i++) {\n kvPairStrings.push(AWS.util.uriEscape(this.tags[i].Key) + '=' +\n AWS.util.uriEscape(this.tags[i].Value));\n }\n\n return kvPairStrings.join('&');\n },\n\n /**\n * @api private\n */\n uploadPart: function uploadPart(chunk, partNumber) {\n var self = this;\n\n var partParams = {\n Body: chunk,\n ContentLength: AWS.util.string.byteLength(chunk),\n PartNumber: partNumber\n };\n\n var partInfo = {ETag: null, PartNumber: partNumber};\n self.completeInfo[partNumber] = partInfo;\n\n var req = self.service.uploadPart(partParams);\n self.parts[partNumber] = req;\n req._lastUploadedBytes = 0;\n req._managedUpload = self;\n req.on('httpUploadProgress', self.progress);\n req.send(function(err, data) {\n delete self.parts[partParams.PartNumber];\n self.activeParts--;\n\n if (!err && (!data || !data.ETag)) {\n var message = 'No access to ETag property on response.';\n if (AWS.util.isBrowser()) {\n message += ' Check CORS configuration to expose ETag header.';\n }\n\n err = AWS.util.error(new Error(message), {\n code: 'ETagMissing', retryable: false\n });\n }\n if (err) return self.cleanup(err);\n //prevent sending part being returned twice (https://github.com/aws/aws-sdk-js/issues/2304)\n if (self.completeInfo[partNumber] && self.completeInfo[partNumber].ETag !== null) return null;\n partInfo.ETag = data.ETag;\n self.doneParts++;\n if (self.isDoneChunking && self.doneParts === self.totalPartNumbers) {\n self.finishMultiPart();\n } else {\n self.fillQueue.call(self);\n }\n });\n },\n\n /**\n * @api private\n */\n queueChunks: function queueChunks(chunk, partNumber) {\n var self = this;\n self.multipartReq.on('success', function() {\n self.uploadPart(chunk, partNumber);\n });\n },\n\n /**\n * @api private\n */\n cleanup: function cleanup(err) {\n var self = this;\n if (self.failed) return;\n\n // clean up stream\n if (typeof self.body.removeAllListeners === 'function' &&\n typeof self.body.resume === 'function') {\n self.body.removeAllListeners('readable');\n self.body.removeAllListeners('end');\n self.body.resume();\n }\n\n // cleanup multipartReq listeners\n if (self.multipartReq) {\n self.multipartReq.removeAllListeners('success');\n self.multipartReq.removeAllListeners('error');\n self.multipartReq.removeAllListeners('complete');\n delete self.multipartReq;\n }\n\n if (self.service.config.params.UploadId && !self.leavePartsOnError) {\n self.service.abortMultipartUpload().send();\n } else if (self.leavePartsOnError) {\n self.isDoneChunking = false;\n }\n\n AWS.util.each(self.parts, function(partNumber, part) {\n part.removeAllListeners('complete');\n part.abort();\n });\n\n self.activeParts = 0;\n self.partPos = 0;\n self.numParts = 0;\n self.totalPartNumbers = 0;\n self.parts = {};\n self.failed = true;\n self.callback(err);\n },\n\n /**\n * @api private\n */\n finishMultiPart: function finishMultiPart() {\n var self = this;\n var completeParams = { MultipartUpload: { Parts: self.completeInfo.slice(1) } };\n self.service.completeMultipartUpload(completeParams, function(err, data) {\n if (err) {\n return self.cleanup(err);\n }\n\n if (data && typeof data.Location === 'string') {\n data.Location = data.Location.replace(/%2F/g, '/');\n }\n\n if (Array.isArray(self.tags)) {\n for (var i = 0; i < self.tags.length; i++) {\n self.tags[i].Value = String(self.tags[i].Value);\n }\n self.service.putObjectTagging(\n {Tagging: {TagSet: self.tags}},\n function(e, d) {\n if (e) {\n self.callback(e);\n } else {\n self.callback(e, data);\n }\n }\n );\n } else {\n self.callback(err, data);\n }\n });\n },\n\n /**\n * @api private\n */\n finishSinglePart: function finishSinglePart(err, data) {\n var upload = this.request._managedUpload;\n var httpReq = this.request.httpRequest;\n var endpoint = httpReq.endpoint;\n if (err) return upload.callback(err);\n data.Location =\n [endpoint.protocol, '//', endpoint.host, httpReq.path].join('');\n data.key = this.request.params.Key; // will stay undocumented\n data.Key = this.request.params.Key;\n data.Bucket = this.request.params.Bucket;\n upload.callback(err, data);\n },\n\n /**\n * @api private\n */\n progress: function progress(info) {\n var upload = this._managedUpload;\n if (this.operation === 'putObject') {\n info.part = 1;\n info.key = this.params.Key;\n } else {\n upload.totalUploadedBytes += info.loaded - this._lastUploadedBytes;\n this._lastUploadedBytes = info.loaded;\n info = {\n loaded: upload.totalUploadedBytes,\n total: upload.totalBytes,\n part: this.params.PartNumber,\n key: this.params.Key\n };\n }\n upload.emit('httpUploadProgress', [info]);\n }\n});\n\nAWS.util.mixin(AWS.S3.ManagedUpload, AWS.SequentialExecutor);\n\n/**\n * @api private\n */\nAWS.S3.ManagedUpload.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.promise = AWS.util.promisifyMethod('send', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.S3.ManagedUpload.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.promise;\n};\n\nAWS.util.addPromises(AWS.S3.ManagedUpload);\n\n/**\n * @api private\n */\nmodule.exports = AWS.S3.ManagedUpload;\n","var AWS = require('./core');\n\n/**\n * @api private\n * @!method on(eventName, callback)\n * Registers an event listener callback for the event given by `eventName`.\n * Parameters passed to the callback function depend on the individual event\n * being triggered. See the event documentation for those parameters.\n *\n * @param eventName [String] the event name to register the listener for\n * @param callback [Function] the listener callback function\n * @param toHead [Boolean] attach the listener callback to the head of callback array if set to true.\n * Default to be false.\n * @return [AWS.SequentialExecutor] the same object for chaining\n */\nAWS.SequentialExecutor = AWS.util.inherit({\n\n constructor: function SequentialExecutor() {\n this._events = {};\n },\n\n /**\n * @api private\n */\n listeners: function listeners(eventName) {\n return this._events[eventName] ? this._events[eventName].slice(0) : [];\n },\n\n on: function on(eventName, listener, toHead) {\n if (this._events[eventName]) {\n toHead ?\n this._events[eventName].unshift(listener) :\n this._events[eventName].push(listener);\n } else {\n this._events[eventName] = [listener];\n }\n return this;\n },\n\n onAsync: function onAsync(eventName, listener, toHead) {\n listener._isAsync = true;\n return this.on(eventName, listener, toHead);\n },\n\n removeListener: function removeListener(eventName, listener) {\n var listeners = this._events[eventName];\n if (listeners) {\n var length = listeners.length;\n var position = -1;\n for (var i = 0; i < length; ++i) {\n if (listeners[i] === listener) {\n position = i;\n }\n }\n if (position > -1) {\n listeners.splice(position, 1);\n }\n }\n return this;\n },\n\n removeAllListeners: function removeAllListeners(eventName) {\n if (eventName) {\n delete this._events[eventName];\n } else {\n this._events = {};\n }\n return this;\n },\n\n /**\n * @api private\n */\n emit: function emit(eventName, eventArgs, doneCallback) {\n if (!doneCallback) doneCallback = function() { };\n var listeners = this.listeners(eventName);\n var count = listeners.length;\n this.callListeners(listeners, eventArgs, doneCallback);\n return count > 0;\n },\n\n /**\n * @api private\n */\n callListeners: function callListeners(listeners, args, doneCallback, prevError) {\n var self = this;\n var error = prevError || null;\n\n function callNextListener(err) {\n if (err) {\n error = AWS.util.error(error || new Error(), err);\n if (self._haltHandlersOnError) {\n return doneCallback.call(self, error);\n }\n }\n self.callListeners(listeners, args, doneCallback, error);\n }\n\n while (listeners.length > 0) {\n var listener = listeners.shift();\n if (listener._isAsync) { // asynchronous listener\n listener.apply(self, args.concat([callNextListener]));\n return; // stop here, callNextListener will continue\n } else { // synchronous listener\n try {\n listener.apply(self, args);\n } catch (err) {\n error = AWS.util.error(error || new Error(), err);\n }\n if (error && self._haltHandlersOnError) {\n doneCallback.call(self, error);\n return;\n }\n }\n }\n doneCallback.call(self, error);\n },\n\n /**\n * Adds or copies a set of listeners from another list of\n * listeners or SequentialExecutor object.\n *\n * @param listeners [map>, AWS.SequentialExecutor]\n * a list of events and callbacks, or an event emitter object\n * containing listeners to add to this emitter object.\n * @return [AWS.SequentialExecutor] the emitter object, for chaining.\n * @example Adding listeners from a map of listeners\n * emitter.addListeners({\n * event1: [function() { ... }, function() { ... }],\n * event2: [function() { ... }]\n * });\n * emitter.emit('event1'); // emitter has event1\n * emitter.emit('event2'); // emitter has event2\n * @example Adding listeners from another emitter object\n * var emitter1 = new AWS.SequentialExecutor();\n * emitter1.on('event1', function() { ... });\n * emitter1.on('event2', function() { ... });\n * var emitter2 = new AWS.SequentialExecutor();\n * emitter2.addListeners(emitter1);\n * emitter2.emit('event1'); // emitter2 has event1\n * emitter2.emit('event2'); // emitter2 has event2\n */\n addListeners: function addListeners(listeners) {\n var self = this;\n\n // extract listeners if parameter is an SequentialExecutor object\n if (listeners._events) listeners = listeners._events;\n\n AWS.util.each(listeners, function(event, callbacks) {\n if (typeof callbacks === 'function') callbacks = [callbacks];\n AWS.util.arrayEach(callbacks, function(callback) {\n self.on(event, callback);\n });\n });\n\n return self;\n },\n\n /**\n * Registers an event with {on} and saves the callback handle function\n * as a property on the emitter object using a given `name`.\n *\n * @param name [String] the property name to set on this object containing\n * the callback function handle so that the listener can be removed in\n * the future.\n * @param (see on)\n * @return (see on)\n * @example Adding a named listener DATA_CALLBACK\n * var listener = function() { doSomething(); };\n * emitter.addNamedListener('DATA_CALLBACK', 'data', listener);\n *\n * // the following prints: true\n * console.log(emitter.DATA_CALLBACK == listener);\n */\n addNamedListener: function addNamedListener(name, eventName, callback, toHead) {\n this[name] = callback;\n this.addListener(eventName, callback, toHead);\n return this;\n },\n\n /**\n * @api private\n */\n addNamedAsyncListener: function addNamedAsyncListener(name, eventName, callback, toHead) {\n callback._isAsync = true;\n return this.addNamedListener(name, eventName, callback, toHead);\n },\n\n /**\n * Helper method to add a set of named listeners using\n * {addNamedListener}. The callback contains a parameter\n * with a handle to the `addNamedListener` method.\n *\n * @callback callback function(add)\n * The callback function is called immediately in order to provide\n * the `add` function to the block. This simplifies the addition of\n * a large group of named listeners.\n * @param add [Function] the {addNamedListener} function to call\n * when registering listeners.\n * @example Adding a set of named listeners\n * emitter.addNamedListeners(function(add) {\n * add('DATA_CALLBACK', 'data', function() { ... });\n * add('OTHER', 'otherEvent', function() { ... });\n * add('LAST', 'lastEvent', function() { ... });\n * });\n *\n * // these properties are now set:\n * emitter.DATA_CALLBACK;\n * emitter.OTHER;\n * emitter.LAST;\n */\n addNamedListeners: function addNamedListeners(callback) {\n var self = this;\n callback(\n function() {\n self.addNamedListener.apply(self, arguments);\n },\n function() {\n self.addNamedAsyncListener.apply(self, arguments);\n }\n );\n return this;\n }\n});\n\n/**\n * {on} is the prefered method.\n * @api private\n */\nAWS.SequentialExecutor.prototype.addListener = AWS.SequentialExecutor.prototype.on;\n\n/**\n * @api private\n */\nmodule.exports = AWS.SequentialExecutor;\n","var AWS = require('./core');\nvar Api = require('./model/api');\nvar regionConfig = require('./region_config');\n\nvar inherit = AWS.util.inherit;\nvar clientCount = 0;\nvar region_utils = require('./region/utils');\n\n/**\n * The service class representing an AWS service.\n *\n * @class_abstract This class is an abstract class.\n *\n * @!attribute apiVersions\n * @return [Array] the list of API versions supported by this service.\n * @readonly\n */\nAWS.Service = inherit({\n /**\n * Create a new service object with a configuration object\n *\n * @param config [map] a map of configuration options\n */\n constructor: function Service(config) {\n if (!this.loadServiceClass) {\n throw AWS.util.error(new Error(),\n 'Service must be constructed with `new\\' operator');\n }\n\n if (config) {\n if (config.region) {\n var region = config.region;\n if (region_utils.isFipsRegion(region)) {\n config.region = region_utils.getRealRegion(region);\n config.useFipsEndpoint = true;\n }\n if (region_utils.isGlobalRegion(region)) {\n config.region = region_utils.getRealRegion(region);\n }\n }\n if (typeof config.useDualstack === 'boolean'\n && typeof config.useDualstackEndpoint !== 'boolean') {\n config.useDualstackEndpoint = config.useDualstack;\n }\n }\n\n var ServiceClass = this.loadServiceClass(config || {});\n if (ServiceClass) {\n var originalConfig = AWS.util.copy(config);\n var svc = new ServiceClass(config);\n Object.defineProperty(svc, '_originalConfig', {\n get: function() { return originalConfig; },\n enumerable: false,\n configurable: true\n });\n svc._clientId = ++clientCount;\n return svc;\n }\n this.initialize(config);\n },\n\n /**\n * @api private\n */\n initialize: function initialize(config) {\n var svcConfig = AWS.config[this.serviceIdentifier];\n this.config = new AWS.Config(AWS.config);\n if (svcConfig) this.config.update(svcConfig, true);\n if (config) this.config.update(config, true);\n\n this.validateService();\n if (!this.config.endpoint) regionConfig.configureEndpoint(this);\n\n this.config.endpoint = this.endpointFromTemplate(this.config.endpoint);\n this.setEndpoint(this.config.endpoint);\n //enable attaching listeners to service client\n AWS.SequentialExecutor.call(this);\n AWS.Service.addDefaultMonitoringListeners(this);\n if ((this.config.clientSideMonitoring || AWS.Service._clientSideMonitoring) && this.publisher) {\n var publisher = this.publisher;\n this.addNamedListener('PUBLISH_API_CALL', 'apiCall', function PUBLISH_API_CALL(event) {\n process.nextTick(function() {publisher.eventHandler(event);});\n });\n this.addNamedListener('PUBLISH_API_ATTEMPT', 'apiCallAttempt', function PUBLISH_API_ATTEMPT(event) {\n process.nextTick(function() {publisher.eventHandler(event);});\n });\n }\n },\n\n /**\n * @api private\n */\n validateService: function validateService() {\n },\n\n /**\n * @api private\n */\n loadServiceClass: function loadServiceClass(serviceConfig) {\n var config = serviceConfig;\n if (!AWS.util.isEmpty(this.api)) {\n return null;\n } else if (config.apiConfig) {\n return AWS.Service.defineServiceApi(this.constructor, config.apiConfig);\n } else if (!this.constructor.services) {\n return null;\n } else {\n config = new AWS.Config(AWS.config);\n config.update(serviceConfig, true);\n var version = config.apiVersions[this.constructor.serviceIdentifier];\n version = version || config.apiVersion;\n return this.getLatestServiceClass(version);\n }\n },\n\n /**\n * @api private\n */\n getLatestServiceClass: function getLatestServiceClass(version) {\n version = this.getLatestServiceVersion(version);\n if (this.constructor.services[version] === null) {\n AWS.Service.defineServiceApi(this.constructor, version);\n }\n\n return this.constructor.services[version];\n },\n\n /**\n * @api private\n */\n getLatestServiceVersion: function getLatestServiceVersion(version) {\n if (!this.constructor.services || this.constructor.services.length === 0) {\n throw new Error('No services defined on ' +\n this.constructor.serviceIdentifier);\n }\n\n if (!version) {\n version = 'latest';\n } else if (AWS.util.isType(version, Date)) {\n version = AWS.util.date.iso8601(version).split('T')[0];\n }\n\n if (Object.hasOwnProperty(this.constructor.services, version)) {\n return version;\n }\n\n var keys = Object.keys(this.constructor.services).sort();\n var selectedVersion = null;\n for (var i = keys.length - 1; i >= 0; i--) {\n // versions that end in \"*\" are not available on disk and can be\n // skipped, so do not choose these as selectedVersions\n if (keys[i][keys[i].length - 1] !== '*') {\n selectedVersion = keys[i];\n }\n if (keys[i].substr(0, 10) <= version) {\n return selectedVersion;\n }\n }\n\n throw new Error('Could not find ' + this.constructor.serviceIdentifier +\n ' API to satisfy version constraint `' + version + '\\'');\n },\n\n /**\n * @api private\n */\n api: {},\n\n /**\n * @api private\n */\n defaultRetryCount: 3,\n\n /**\n * @api private\n */\n customizeRequests: function customizeRequests(callback) {\n if (!callback) {\n this.customRequestHandler = null;\n } else if (typeof callback === 'function') {\n this.customRequestHandler = callback;\n } else {\n throw new Error('Invalid callback type \\'' + typeof callback + '\\' provided in customizeRequests');\n }\n },\n\n /**\n * Calls an operation on a service with the given input parameters.\n *\n * @param operation [String] the name of the operation to call on the service.\n * @param params [map] a map of input options for the operation\n * @callback callback function(err, data)\n * If a callback is supplied, it is called when a response is returned\n * from the service.\n * @param err [Error] the error object returned from the request.\n * Set to `null` if the request is successful.\n * @param data [Object] the de-serialized data returned from\n * the request. Set to `null` if a request error occurs.\n */\n makeRequest: function makeRequest(operation, params, callback) {\n if (typeof params === 'function') {\n callback = params;\n params = null;\n }\n\n params = params || {};\n if (this.config.params) { // copy only toplevel bound params\n var rules = this.api.operations[operation];\n if (rules) {\n params = AWS.util.copy(params);\n AWS.util.each(this.config.params, function(key, value) {\n if (rules.input.members[key]) {\n if (params[key] === undefined || params[key] === null) {\n params[key] = value;\n }\n }\n });\n }\n }\n\n var request = new AWS.Request(this, operation, params);\n this.addAllRequestListeners(request);\n this.attachMonitoringEmitter(request);\n if (callback) request.send(callback);\n return request;\n },\n\n /**\n * Calls an operation on a service with the given input parameters, without\n * any authentication data. This method is useful for \"public\" API operations.\n *\n * @param operation [String] the name of the operation to call on the service.\n * @param params [map] a map of input options for the operation\n * @callback callback function(err, data)\n * If a callback is supplied, it is called when a response is returned\n * from the service.\n * @param err [Error] the error object returned from the request.\n * Set to `null` if the request is successful.\n * @param data [Object] the de-serialized data returned from\n * the request. Set to `null` if a request error occurs.\n */\n makeUnauthenticatedRequest: function makeUnauthenticatedRequest(operation, params, callback) {\n if (typeof params === 'function') {\n callback = params;\n params = {};\n }\n\n var request = this.makeRequest(operation, params).toUnauthenticated();\n return callback ? request.send(callback) : request;\n },\n\n /**\n * Waits for a given state\n *\n * @param state [String] the state on the service to wait for\n * @param params [map] a map of parameters to pass with each request\n * @option params $waiter [map] a map of configuration options for the waiter\n * @option params $waiter.delay [Number] The number of seconds to wait between\n * requests\n * @option params $waiter.maxAttempts [Number] The maximum number of requests\n * to send while waiting\n * @callback callback function(err, data)\n * If a callback is supplied, it is called when a response is returned\n * from the service.\n * @param err [Error] the error object returned from the request.\n * Set to `null` if the request is successful.\n * @param data [Object] the de-serialized data returned from\n * the request. Set to `null` if a request error occurs.\n */\n waitFor: function waitFor(state, params, callback) {\n var waiter = new AWS.ResourceWaiter(this, state);\n return waiter.wait(params, callback);\n },\n\n /**\n * @api private\n */\n addAllRequestListeners: function addAllRequestListeners(request) {\n var list = [AWS.events, AWS.EventListeners.Core, this.serviceInterface(),\n AWS.EventListeners.CorePost];\n for (var i = 0; i < list.length; i++) {\n if (list[i]) request.addListeners(list[i]);\n }\n\n // disable parameter validation\n if (!this.config.paramValidation) {\n request.removeListener('validate',\n AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n }\n\n if (this.config.logger) { // add logging events\n request.addListeners(AWS.EventListeners.Logger);\n }\n\n this.setupRequestListeners(request);\n // call prototype's customRequestHandler\n if (typeof this.constructor.prototype.customRequestHandler === 'function') {\n this.constructor.prototype.customRequestHandler(request);\n }\n // call instance's customRequestHandler\n if (Object.prototype.hasOwnProperty.call(this, 'customRequestHandler') && typeof this.customRequestHandler === 'function') {\n this.customRequestHandler(request);\n }\n },\n\n /**\n * Event recording metrics for a whole API call.\n * @returns {object} a subset of api call metrics\n * @api private\n */\n apiCallEvent: function apiCallEvent(request) {\n var api = request.service.api.operations[request.operation];\n var monitoringEvent = {\n Type: 'ApiCall',\n Api: api ? api.name : request.operation,\n Version: 1,\n Service: request.service.api.serviceId || request.service.api.endpointPrefix,\n Region: request.httpRequest.region,\n MaxRetriesExceeded: 0,\n UserAgent: request.httpRequest.getUserAgent(),\n };\n var response = request.response;\n if (response.httpResponse.statusCode) {\n monitoringEvent.FinalHttpStatusCode = response.httpResponse.statusCode;\n }\n if (response.error) {\n var error = response.error;\n var statusCode = response.httpResponse.statusCode;\n if (statusCode > 299) {\n if (error.code) monitoringEvent.FinalAwsException = error.code;\n if (error.message) monitoringEvent.FinalAwsExceptionMessage = error.message;\n } else {\n if (error.code || error.name) monitoringEvent.FinalSdkException = error.code || error.name;\n if (error.message) monitoringEvent.FinalSdkExceptionMessage = error.message;\n }\n }\n return monitoringEvent;\n },\n\n /**\n * Event recording metrics for an API call attempt.\n * @returns {object} a subset of api call attempt metrics\n * @api private\n */\n apiAttemptEvent: function apiAttemptEvent(request) {\n var api = request.service.api.operations[request.operation];\n var monitoringEvent = {\n Type: 'ApiCallAttempt',\n Api: api ? api.name : request.operation,\n Version: 1,\n Service: request.service.api.serviceId || request.service.api.endpointPrefix,\n Fqdn: request.httpRequest.endpoint.hostname,\n UserAgent: request.httpRequest.getUserAgent(),\n };\n var response = request.response;\n if (response.httpResponse.statusCode) {\n monitoringEvent.HttpStatusCode = response.httpResponse.statusCode;\n }\n if (\n !request._unAuthenticated &&\n request.service.config.credentials &&\n request.service.config.credentials.accessKeyId\n ) {\n monitoringEvent.AccessKey = request.service.config.credentials.accessKeyId;\n }\n if (!response.httpResponse.headers) return monitoringEvent;\n if (request.httpRequest.headers['x-amz-security-token']) {\n monitoringEvent.SessionToken = request.httpRequest.headers['x-amz-security-token'];\n }\n if (response.httpResponse.headers['x-amzn-requestid']) {\n monitoringEvent.XAmznRequestId = response.httpResponse.headers['x-amzn-requestid'];\n }\n if (response.httpResponse.headers['x-amz-request-id']) {\n monitoringEvent.XAmzRequestId = response.httpResponse.headers['x-amz-request-id'];\n }\n if (response.httpResponse.headers['x-amz-id-2']) {\n monitoringEvent.XAmzId2 = response.httpResponse.headers['x-amz-id-2'];\n }\n return monitoringEvent;\n },\n\n /**\n * Add metrics of failed request.\n * @api private\n */\n attemptFailEvent: function attemptFailEvent(request) {\n var monitoringEvent = this.apiAttemptEvent(request);\n var response = request.response;\n var error = response.error;\n if (response.httpResponse.statusCode > 299 ) {\n if (error.code) monitoringEvent.AwsException = error.code;\n if (error.message) monitoringEvent.AwsExceptionMessage = error.message;\n } else {\n if (error.code || error.name) monitoringEvent.SdkException = error.code || error.name;\n if (error.message) monitoringEvent.SdkExceptionMessage = error.message;\n }\n return monitoringEvent;\n },\n\n /**\n * Attach listeners to request object to fetch metrics of each request\n * and emit data object through \\'ApiCall\\' and \\'ApiCallAttempt\\' events.\n * @api private\n */\n attachMonitoringEmitter: function attachMonitoringEmitter(request) {\n var attemptTimestamp; //timestamp marking the beginning of a request attempt\n var attemptStartRealTime; //Start time of request attempt. Used to calculating attemptLatency\n var attemptLatency; //latency from request sent out to http response reaching SDK\n var callStartRealTime; //Start time of API call. Used to calculating API call latency\n var attemptCount = 0; //request.retryCount is not reliable here\n var region; //region cache region for each attempt since it can be updated in plase (e.g. s3)\n var callTimestamp; //timestamp when the request is created\n var self = this;\n var addToHead = true;\n\n request.on('validate', function () {\n callStartRealTime = AWS.util.realClock.now();\n callTimestamp = Date.now();\n }, addToHead);\n request.on('sign', function () {\n attemptStartRealTime = AWS.util.realClock.now();\n attemptTimestamp = Date.now();\n region = request.httpRequest.region;\n attemptCount++;\n }, addToHead);\n request.on('validateResponse', function() {\n attemptLatency = Math.round(AWS.util.realClock.now() - attemptStartRealTime);\n });\n request.addNamedListener('API_CALL_ATTEMPT', 'success', function API_CALL_ATTEMPT() {\n var apiAttemptEvent = self.apiAttemptEvent(request);\n apiAttemptEvent.Timestamp = attemptTimestamp;\n apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0;\n apiAttemptEvent.Region = region;\n self.emit('apiCallAttempt', [apiAttemptEvent]);\n });\n request.addNamedListener('API_CALL_ATTEMPT_RETRY', 'retry', function API_CALL_ATTEMPT_RETRY() {\n var apiAttemptEvent = self.attemptFailEvent(request);\n apiAttemptEvent.Timestamp = attemptTimestamp;\n //attemptLatency may not be available if fail before response\n attemptLatency = attemptLatency ||\n Math.round(AWS.util.realClock.now() - attemptStartRealTime);\n apiAttemptEvent.AttemptLatency = attemptLatency >= 0 ? attemptLatency : 0;\n apiAttemptEvent.Region = region;\n self.emit('apiCallAttempt', [apiAttemptEvent]);\n });\n request.addNamedListener('API_CALL', 'complete', function API_CALL() {\n var apiCallEvent = self.apiCallEvent(request);\n apiCallEvent.AttemptCount = attemptCount;\n if (apiCallEvent.AttemptCount <= 0) return;\n apiCallEvent.Timestamp = callTimestamp;\n var latency = Math.round(AWS.util.realClock.now() - callStartRealTime);\n apiCallEvent.Latency = latency >= 0 ? latency : 0;\n var response = request.response;\n if (\n response.error &&\n response.error.retryable &&\n typeof response.retryCount === 'number' &&\n typeof response.maxRetries === 'number' &&\n (response.retryCount >= response.maxRetries)\n ) {\n apiCallEvent.MaxRetriesExceeded = 1;\n }\n self.emit('apiCall', [apiCallEvent]);\n });\n },\n\n /**\n * Override this method to setup any custom request listeners for each\n * new request to the service.\n *\n * @method_abstract This is an abstract method.\n */\n setupRequestListeners: function setupRequestListeners(request) {\n },\n\n /**\n * Gets the signing name for a given request\n * @api private\n */\n getSigningName: function getSigningName() {\n return this.api.signingName || this.api.endpointPrefix;\n },\n\n /**\n * Gets the signer class for a given request\n * @api private\n */\n getSignerClass: function getSignerClass(request) {\n var version;\n // get operation authtype if present\n var operation = null;\n var authtype = '';\n if (request) {\n var operations = request.service.api.operations || {};\n operation = operations[request.operation] || null;\n authtype = operation ? operation.authtype : '';\n }\n if (this.config.signatureVersion) {\n version = this.config.signatureVersion;\n } else if (authtype === 'v4' || authtype === 'v4-unsigned-body') {\n version = 'v4';\n } else if (authtype === 'bearer') {\n version = 'bearer';\n } else {\n version = this.api.signatureVersion;\n }\n return AWS.Signers.RequestSigner.getVersion(version);\n },\n\n /**\n * @api private\n */\n serviceInterface: function serviceInterface() {\n switch (this.api.protocol) {\n case 'ec2': return AWS.EventListeners.Query;\n case 'query': return AWS.EventListeners.Query;\n case 'json': return AWS.EventListeners.Json;\n case 'rest-json': return AWS.EventListeners.RestJson;\n case 'rest-xml': return AWS.EventListeners.RestXml;\n }\n if (this.api.protocol) {\n throw new Error('Invalid service `protocol\\' ' +\n this.api.protocol + ' in API config');\n }\n },\n\n /**\n * @api private\n */\n successfulResponse: function successfulResponse(resp) {\n return resp.httpResponse.statusCode < 300;\n },\n\n /**\n * How many times a failed request should be retried before giving up.\n * the defaultRetryCount can be overriden by service classes.\n *\n * @api private\n */\n numRetries: function numRetries() {\n if (this.config.maxRetries !== undefined) {\n return this.config.maxRetries;\n } else {\n return this.defaultRetryCount;\n }\n },\n\n /**\n * @api private\n */\n retryDelays: function retryDelays(retryCount, err) {\n return AWS.util.calculateRetryDelay(retryCount, this.config.retryDelayOptions, err);\n },\n\n /**\n * @api private\n */\n retryableError: function retryableError(error) {\n if (this.timeoutError(error)) return true;\n if (this.networkingError(error)) return true;\n if (this.expiredCredentialsError(error)) return true;\n if (this.throttledError(error)) return true;\n if (error.statusCode >= 500) return true;\n return false;\n },\n\n /**\n * @api private\n */\n networkingError: function networkingError(error) {\n return error.code === 'NetworkingError';\n },\n\n /**\n * @api private\n */\n timeoutError: function timeoutError(error) {\n return error.code === 'TimeoutError';\n },\n\n /**\n * @api private\n */\n expiredCredentialsError: function expiredCredentialsError(error) {\n // TODO : this only handles *one* of the expired credential codes\n return (error.code === 'ExpiredTokenException');\n },\n\n /**\n * @api private\n */\n clockSkewError: function clockSkewError(error) {\n switch (error.code) {\n case 'RequestTimeTooSkewed':\n case 'RequestExpired':\n case 'InvalidSignatureException':\n case 'SignatureDoesNotMatch':\n case 'AuthFailure':\n case 'RequestInTheFuture':\n return true;\n default: return false;\n }\n },\n\n /**\n * @api private\n */\n getSkewCorrectedDate: function getSkewCorrectedDate() {\n return new Date(Date.now() + this.config.systemClockOffset);\n },\n\n /**\n * @api private\n */\n applyClockOffset: function applyClockOffset(newServerTime) {\n if (newServerTime) {\n this.config.systemClockOffset = newServerTime - Date.now();\n }\n },\n\n /**\n * @api private\n */\n isClockSkewed: function isClockSkewed(newServerTime) {\n if (newServerTime) {\n return Math.abs(this.getSkewCorrectedDate().getTime() - newServerTime) >= 300000;\n }\n },\n\n /**\n * @api private\n */\n throttledError: function throttledError(error) {\n // this logic varies between services\n if (error.statusCode === 429) return true;\n switch (error.code) {\n case 'ProvisionedThroughputExceededException':\n case 'Throttling':\n case 'ThrottlingException':\n case 'RequestLimitExceeded':\n case 'RequestThrottled':\n case 'RequestThrottledException':\n case 'TooManyRequestsException':\n case 'TransactionInProgressException': //dynamodb\n case 'EC2ThrottledException':\n return true;\n default:\n return false;\n }\n },\n\n /**\n * @api private\n */\n endpointFromTemplate: function endpointFromTemplate(endpoint) {\n if (typeof endpoint !== 'string') return endpoint;\n\n var e = endpoint;\n e = e.replace(/\\{service\\}/g, this.api.endpointPrefix);\n e = e.replace(/\\{region\\}/g, this.config.region);\n e = e.replace(/\\{scheme\\}/g, this.config.sslEnabled ? 'https' : 'http');\n return e;\n },\n\n /**\n * @api private\n */\n setEndpoint: function setEndpoint(endpoint) {\n this.endpoint = new AWS.Endpoint(endpoint, this.config);\n },\n\n /**\n * @api private\n */\n paginationConfig: function paginationConfig(operation, throwException) {\n var paginator = this.api.operations[operation].paginator;\n if (!paginator) {\n if (throwException) {\n var e = new Error();\n throw AWS.util.error(e, 'No pagination configuration for ' + operation);\n }\n return null;\n }\n\n return paginator;\n }\n});\n\nAWS.util.update(AWS.Service, {\n\n /**\n * Adds one method for each operation described in the api configuration\n *\n * @api private\n */\n defineMethods: function defineMethods(svc) {\n AWS.util.each(svc.prototype.api.operations, function iterator(method) {\n if (svc.prototype[method]) return;\n var operation = svc.prototype.api.operations[method];\n if (operation.authtype === 'none') {\n svc.prototype[method] = function (params, callback) {\n return this.makeUnauthenticatedRequest(method, params, callback);\n };\n } else {\n svc.prototype[method] = function (params, callback) {\n return this.makeRequest(method, params, callback);\n };\n }\n });\n },\n\n /**\n * Defines a new Service class using a service identifier and list of versions\n * including an optional set of features (functions) to apply to the class\n * prototype.\n *\n * @param serviceIdentifier [String] the identifier for the service\n * @param versions [Array] a list of versions that work with this\n * service\n * @param features [Object] an object to attach to the prototype\n * @return [Class] the service class defined by this function.\n */\n defineService: function defineService(serviceIdentifier, versions, features) {\n AWS.Service._serviceMap[serviceIdentifier] = true;\n if (!Array.isArray(versions)) {\n features = versions;\n versions = [];\n }\n\n var svc = inherit(AWS.Service, features || {});\n\n if (typeof serviceIdentifier === 'string') {\n AWS.Service.addVersions(svc, versions);\n\n var identifier = svc.serviceIdentifier || serviceIdentifier;\n svc.serviceIdentifier = identifier;\n } else { // defineService called with an API\n svc.prototype.api = serviceIdentifier;\n AWS.Service.defineMethods(svc);\n }\n AWS.SequentialExecutor.call(this.prototype);\n //util.clientSideMonitoring is only available in node\n if (!this.prototype.publisher && AWS.util.clientSideMonitoring) {\n var Publisher = AWS.util.clientSideMonitoring.Publisher;\n var configProvider = AWS.util.clientSideMonitoring.configProvider;\n var publisherConfig = configProvider();\n this.prototype.publisher = new Publisher(publisherConfig);\n if (publisherConfig.enabled) {\n //if csm is enabled in environment, SDK should send all metrics\n AWS.Service._clientSideMonitoring = true;\n }\n }\n AWS.SequentialExecutor.call(svc.prototype);\n AWS.Service.addDefaultMonitoringListeners(svc.prototype);\n return svc;\n },\n\n /**\n * @api private\n */\n addVersions: function addVersions(svc, versions) {\n if (!Array.isArray(versions)) versions = [versions];\n\n svc.services = svc.services || {};\n for (var i = 0; i < versions.length; i++) {\n if (svc.services[versions[i]] === undefined) {\n svc.services[versions[i]] = null;\n }\n }\n\n svc.apiVersions = Object.keys(svc.services).sort();\n },\n\n /**\n * @api private\n */\n defineServiceApi: function defineServiceApi(superclass, version, apiConfig) {\n var svc = inherit(superclass, {\n serviceIdentifier: superclass.serviceIdentifier\n });\n\n function setApi(api) {\n if (api.isApi) {\n svc.prototype.api = api;\n } else {\n svc.prototype.api = new Api(api, {\n serviceIdentifier: superclass.serviceIdentifier\n });\n }\n }\n\n if (typeof version === 'string') {\n if (apiConfig) {\n setApi(apiConfig);\n } else {\n try {\n setApi(AWS.apiLoader(superclass.serviceIdentifier, version));\n } catch (err) {\n throw AWS.util.error(err, {\n message: 'Could not find API configuration ' +\n superclass.serviceIdentifier + '-' + version\n });\n }\n }\n if (!Object.prototype.hasOwnProperty.call(superclass.services, version)) {\n superclass.apiVersions = superclass.apiVersions.concat(version).sort();\n }\n superclass.services[version] = svc;\n } else {\n setApi(version);\n }\n\n AWS.Service.defineMethods(svc);\n return svc;\n },\n\n /**\n * @api private\n */\n hasService: function(identifier) {\n return Object.prototype.hasOwnProperty.call(AWS.Service._serviceMap, identifier);\n },\n\n /**\n * @param attachOn attach default monitoring listeners to object\n *\n * Each monitoring event should be emitted from service client to service constructor prototype and then\n * to global service prototype like bubbling up. These default monitoring events listener will transfer\n * the monitoring events to the upper layer.\n * @api private\n */\n addDefaultMonitoringListeners: function addDefaultMonitoringListeners(attachOn) {\n attachOn.addNamedListener('MONITOR_EVENTS_BUBBLE', 'apiCallAttempt', function EVENTS_BUBBLE(event) {\n var baseClass = Object.getPrototypeOf(attachOn);\n if (baseClass._events) baseClass.emit('apiCallAttempt', [event]);\n });\n attachOn.addNamedListener('CALL_EVENTS_BUBBLE', 'apiCall', function CALL_EVENTS_BUBBLE(event) {\n var baseClass = Object.getPrototypeOf(attachOn);\n if (baseClass._events) baseClass.emit('apiCall', [event]);\n });\n },\n\n /**\n * @api private\n */\n _serviceMap: {}\n});\n\nAWS.util.mixin(AWS.Service, AWS.SequentialExecutor);\n\n/**\n * @api private\n */\nmodule.exports = AWS.Service;\n","var AWS = require('../core');\n\nAWS.util.update(AWS.APIGateway.prototype, {\n/**\n * Sets the Accept header to application/json.\n *\n * @api private\n */\n setAcceptHeader: function setAcceptHeader(req) {\n var httpRequest = req.httpRequest;\n if (!httpRequest.headers.Accept) {\n httpRequest.headers['Accept'] = 'application/json';\n }\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('build', this.setAcceptHeader);\n if (request.operation === 'getExport') {\n var params = request.params || {};\n if (params.exportType === 'swagger') {\n request.addListener('extractData', AWS.util.convertPayloadToString);\n }\n }\n }\n});\n\n","var AWS = require('../core');\n\n// pull in CloudFront signer\nrequire('../cloudfront/signer');\n\nAWS.util.update(AWS.CloudFront.prototype, {\n\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('extractData', AWS.util.hoistPayloadMember);\n }\n\n});\n","var AWS = require('../core');\n\n/**\n * Constructs a service interface object. Each API operation is exposed as a\n * function on service.\n *\n * ### Sending a Request Using CloudSearchDomain\n *\n * ```javascript\n * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'});\n * csd.search(params, function (err, data) {\n * if (err) console.log(err, err.stack); // an error occurred\n * else console.log(data); // successful response\n * });\n * ```\n *\n * ### Locking the API Version\n *\n * In order to ensure that the CloudSearchDomain object uses this specific API,\n * you can construct the object by passing the `apiVersion` option to the\n * constructor:\n *\n * ```javascript\n * var csd = new AWS.CloudSearchDomain({\n * endpoint: 'my.host.tld',\n * apiVersion: '2013-01-01'\n * });\n * ```\n *\n * You can also set the API version globally in `AWS.config.apiVersions` using\n * the **cloudsearchdomain** service identifier:\n *\n * ```javascript\n * AWS.config.apiVersions = {\n * cloudsearchdomain: '2013-01-01',\n * // other service API versions\n * };\n *\n * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'});\n * ```\n *\n * @note You *must* provide an `endpoint` configuration parameter when\n * constructing this service. See {constructor} for more information.\n *\n * @!method constructor(options = {})\n * Constructs a service object. This object has one method for each\n * API operation.\n *\n * @example Constructing a CloudSearchDomain object\n * var csd = new AWS.CloudSearchDomain({endpoint: 'my.host.tld'});\n * @note You *must* provide an `endpoint` when constructing this service.\n * @option (see AWS.Config.constructor)\n *\n * @service cloudsearchdomain\n * @version 2013-01-01\n */\nAWS.util.update(AWS.CloudSearchDomain.prototype, {\n /**\n * @api private\n */\n validateService: function validateService() {\n if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) {\n var msg = 'AWS.CloudSearchDomain requires an explicit ' +\n '`endpoint\\' configuration option.';\n throw AWS.util.error(new Error(),\n {name: 'InvalidEndpoint', message: msg});\n }\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.removeListener('validate',\n AWS.EventListeners.Core.VALIDATE_CREDENTIALS\n );\n request.onAsync('validate', this.validateCredentials);\n request.addListener('validate', this.updateRegion);\n if (request.operation === 'search') {\n request.addListener('build', this.convertGetToPost);\n }\n },\n\n /**\n * @api private\n */\n validateCredentials: function(req, done) {\n if (!req.service.api.signatureVersion) return done(); // none\n req.service.config.getCredentials(function(err) {\n if (err) {\n req.removeListener('sign', AWS.EventListeners.Core.SIGN);\n }\n done();\n });\n },\n\n /**\n * @api private\n */\n convertGetToPost: function(request) {\n var httpRequest = request.httpRequest;\n // convert queries to POST to avoid length restrictions\n var path = httpRequest.path.split('?');\n httpRequest.method = 'POST';\n httpRequest.path = path[0];\n httpRequest.body = path[1];\n httpRequest.headers['Content-Length'] = httpRequest.body.length;\n httpRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded';\n },\n\n /**\n * @api private\n */\n updateRegion: function updateRegion(request) {\n var endpoint = request.httpRequest.endpoint.hostname;\n var zones = endpoint.split('.');\n request.httpRequest.region = zones[1] || request.httpRequest.region;\n }\n\n});\n","var AWS = require('../core');\nvar rdsutil = require('./rdsutil');\n\n/**\n* @api private\n*/\nvar crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot'];\n\nAWS.util.update(AWS.DocDB.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (\n crossRegionOperations.indexOf(request.operation) !== -1 &&\n this.config.params &&\n this.config.params.SourceRegion &&\n request.params &&\n !request.params.SourceRegion\n ) {\n request.params.SourceRegion = this.config.params.SourceRegion;\n }\n rdsutil.setupRequestListeners(this, request, crossRegionOperations);\n },\n});\n","var AWS = require('../core');\nrequire('../dynamodb/document_client');\n\nAWS.util.update(AWS.DynamoDB.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (request.service.config.dynamoDbCrc32) {\n request.removeListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA);\n request.addListener('extractData', this.checkCrc32);\n request.addListener('extractData', AWS.EventListeners.Json.EXTRACT_DATA);\n }\n },\n\n /**\n * @api private\n */\n checkCrc32: function checkCrc32(resp) {\n if (!resp.httpResponse.streaming && !resp.request.service.crc32IsValid(resp)) {\n resp.data = null;\n resp.error = AWS.util.error(new Error(), {\n code: 'CRC32CheckFailed',\n message: 'CRC32 integrity check failed',\n retryable: true\n });\n resp.request.haltHandlersOnError();\n throw (resp.error);\n }\n },\n\n /**\n * @api private\n */\n crc32IsValid: function crc32IsValid(resp) {\n var crc = resp.httpResponse.headers['x-amz-crc32'];\n if (!crc) return true; // no (valid) CRC32 header\n return parseInt(crc, 10) === AWS.util.crypto.crc32(resp.httpResponse.body);\n },\n\n /**\n * @api private\n */\n defaultRetryCount: 10,\n\n /**\n * @api private\n */\n retryDelays: function retryDelays(retryCount, err) {\n var retryDelayOptions = AWS.util.copy(this.config.retryDelayOptions);\n\n if (typeof retryDelayOptions.base !== 'number') {\n retryDelayOptions.base = 50; // default for dynamodb\n }\n var delay = AWS.util.calculateRetryDelay(retryCount, retryDelayOptions, err);\n return delay;\n }\n});\n","var AWS = require('../core');\n\nAWS.util.update(AWS.EC2.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.removeListener('extractError', AWS.EventListeners.Query.EXTRACT_ERROR);\n request.addListener('extractError', this.extractError);\n\n if (request.operation === 'copySnapshot') {\n request.onAsync('validate', this.buildCopySnapshotPresignedUrl);\n }\n },\n\n /**\n * @api private\n */\n buildCopySnapshotPresignedUrl: function buildCopySnapshotPresignedUrl(req, done) {\n if (req.params.PresignedUrl || req._subRequest) {\n return done();\n }\n\n req.params = AWS.util.copy(req.params);\n req.params.DestinationRegion = req.service.config.region;\n\n var config = AWS.util.copy(req.service.config);\n delete config.endpoint;\n config.region = req.params.SourceRegion;\n var svc = new req.service.constructor(config);\n var newReq = svc[req.operation](req.params);\n newReq._subRequest = true;\n newReq.presign(function(err, url) {\n if (err) done(err);\n else {\n req.params.PresignedUrl = url;\n done();\n }\n });\n },\n\n /**\n * @api private\n */\n extractError: function extractError(resp) {\n // EC2 nests the error code and message deeper than other AWS Query services.\n var httpResponse = resp.httpResponse;\n var data = new AWS.XML.Parser().parse(httpResponse.body.toString() || '');\n if (data.Errors) {\n resp.error = AWS.util.error(new Error(), {\n code: data.Errors.Error.Code,\n message: data.Errors.Error.Message\n });\n } else {\n resp.error = AWS.util.error(new Error(), {\n code: httpResponse.statusCode,\n message: null\n });\n }\n resp.error.requestId = data.RequestID || null;\n }\n});\n","var AWS = require('../core');\n\nAWS.util.update(AWS.EventBridge.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (request.operation === 'putEvents') {\n var params = request.params || {};\n if (params.EndpointId !== undefined) {\n throw new AWS.util.error(new Error(), {\n code: 'InvalidParameter',\n message: 'EndpointId is not supported in current SDK.\\n' +\n 'You should consider switching to V3(https://github.com/aws/aws-sdk-js-v3).'\n });\n }\n }\n },\n});\n","var AWS = require('../core');\n\nAWS.util.update(AWS.Glacier.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (Array.isArray(request._events.validate)) {\n request._events.validate.unshift(this.validateAccountId);\n } else {\n request.on('validate', this.validateAccountId);\n }\n request.removeListener('afterBuild',\n AWS.EventListeners.Core.COMPUTE_SHA256);\n request.on('build', this.addGlacierApiVersion);\n request.on('build', this.addTreeHashHeaders);\n },\n\n /**\n * @api private\n */\n validateAccountId: function validateAccountId(request) {\n if (request.params.accountId !== undefined) return;\n request.params = AWS.util.copy(request.params);\n request.params.accountId = '-';\n },\n\n /**\n * @api private\n */\n addGlacierApiVersion: function addGlacierApiVersion(request) {\n var version = request.service.api.apiVersion;\n request.httpRequest.headers['x-amz-glacier-version'] = version;\n },\n\n /**\n * @api private\n */\n addTreeHashHeaders: function addTreeHashHeaders(request) {\n if (request.params.body === undefined) return;\n\n var hashes = request.service.computeChecksums(request.params.body);\n request.httpRequest.headers['X-Amz-Content-Sha256'] = hashes.linearHash;\n\n if (!request.httpRequest.headers['x-amz-sha256-tree-hash']) {\n request.httpRequest.headers['x-amz-sha256-tree-hash'] = hashes.treeHash;\n }\n },\n\n /**\n * @!group Computing Checksums\n */\n\n /**\n * Computes the SHA-256 linear and tree hash checksums for a given\n * block of Buffer data. Pass the tree hash of the computed checksums\n * as the checksum input to the {completeMultipartUpload} when performing\n * a multi-part upload.\n *\n * @example Calculate checksum of 5.5MB data chunk\n * var glacier = new AWS.Glacier();\n * var data = Buffer.alloc(5.5 * 1024 * 1024);\n * data.fill('0'); // fill with zeros\n * var results = glacier.computeChecksums(data);\n * // Result: { linearHash: '68aff0c5a9...', treeHash: '154e26c78f...' }\n * @param data [Buffer, String] data to calculate the checksum for\n * @return [map] a map containing\n * the linearHash and treeHash properties representing hex based digests\n * of the respective checksums.\n * @see completeMultipartUpload\n */\n computeChecksums: function computeChecksums(data) {\n if (!AWS.util.Buffer.isBuffer(data)) data = AWS.util.buffer.toBuffer(data);\n\n var mb = 1024 * 1024;\n var hashes = [];\n var hash = AWS.util.crypto.createHash('sha256');\n\n // build leaf nodes in 1mb chunks\n for (var i = 0; i < data.length; i += mb) {\n var chunk = data.slice(i, Math.min(i + mb, data.length));\n hash.update(chunk);\n hashes.push(AWS.util.crypto.sha256(chunk));\n }\n\n return {\n linearHash: hash.digest('hex'),\n treeHash: this.buildHashTree(hashes)\n };\n },\n\n /**\n * @api private\n */\n buildHashTree: function buildHashTree(hashes) {\n // merge leaf nodes\n while (hashes.length > 1) {\n var tmpHashes = [];\n for (var i = 0; i < hashes.length; i += 2) {\n if (hashes[i + 1]) {\n var tmpHash = AWS.util.buffer.alloc(64);\n tmpHash.write(hashes[i], 0, 32, 'binary');\n tmpHash.write(hashes[i + 1], 32, 32, 'binary');\n tmpHashes.push(AWS.util.crypto.sha256(tmpHash));\n } else {\n tmpHashes.push(hashes[i]);\n }\n }\n hashes = tmpHashes;\n }\n\n return AWS.util.crypto.toHex(hashes[0]);\n }\n});\n","var AWS = require('../core');\n\n/**\n * @api private\n */\nvar blobPayloadOutputOps = [\n 'deleteThingShadow',\n 'getThingShadow',\n 'updateThingShadow'\n];\n\n/**\n * Constructs a service interface object. Each API operation is exposed as a\n * function on service.\n *\n * ### Sending a Request Using IotData\n *\n * ```javascript\n * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'});\n * iotdata.getThingShadow(params, function (err, data) {\n * if (err) console.log(err, err.stack); // an error occurred\n * else console.log(data); // successful response\n * });\n * ```\n *\n * ### Locking the API Version\n *\n * In order to ensure that the IotData object uses this specific API,\n * you can construct the object by passing the `apiVersion` option to the\n * constructor:\n *\n * ```javascript\n * var iotdata = new AWS.IotData({\n * endpoint: 'my.host.tld',\n * apiVersion: '2015-05-28'\n * });\n * ```\n *\n * You can also set the API version globally in `AWS.config.apiVersions` using\n * the **iotdata** service identifier:\n *\n * ```javascript\n * AWS.config.apiVersions = {\n * iotdata: '2015-05-28',\n * // other service API versions\n * };\n *\n * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'});\n * ```\n *\n * @note You *must* provide an `endpoint` configuration parameter when\n * constructing this service. See {constructor} for more information.\n *\n * @!method constructor(options = {})\n * Constructs a service object. This object has one method for each\n * API operation.\n *\n * @example Constructing a IotData object\n * var iotdata = new AWS.IotData({endpoint: 'my.host.tld'});\n * @note You *must* provide an `endpoint` when constructing this service.\n * @option (see AWS.Config.constructor)\n *\n * @service iotdata\n * @version 2015-05-28\n */\nAWS.util.update(AWS.IotData.prototype, {\n /**\n * @api private\n */\n validateService: function validateService() {\n if (!this.config.endpoint || this.config.endpoint.indexOf('{') >= 0) {\n var msg = 'AWS.IotData requires an explicit ' +\n '`endpoint\\' configuration option.';\n throw AWS.util.error(new Error(),\n {name: 'InvalidEndpoint', message: msg});\n }\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('validateResponse', this.validateResponseBody);\n if (blobPayloadOutputOps.indexOf(request.operation) > -1) {\n request.addListener('extractData', AWS.util.convertPayloadToString);\n }\n },\n\n /**\n * @api private\n */\n validateResponseBody: function validateResponseBody(resp) {\n var body = resp.httpResponse.body.toString() || '{}';\n var bodyCheck = body.trim();\n if (!bodyCheck || bodyCheck.charAt(0) !== '{') {\n resp.httpResponse.body = '';\n }\n }\n\n});\n","var AWS = require('../core');\n\nAWS.util.update(AWS.Lambda.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (request.operation === 'invoke') {\n request.addListener('extractData', AWS.util.convertPayloadToString);\n }\n }\n});\n\n","var AWS = require('../core');\n\nAWS.util.update(AWS.MachineLearning.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (request.operation === 'predict') {\n request.addListener('build', this.buildEndpoint);\n }\n },\n\n /**\n * Updates request endpoint from PredictEndpoint\n * @api private\n */\n buildEndpoint: function buildEndpoint(request) {\n var url = request.params.PredictEndpoint;\n if (url) {\n request.httpRequest.endpoint = new AWS.Endpoint(url);\n }\n }\n\n});\n","var AWS = require('../core');\nvar rdsutil = require('./rdsutil');\n\n/**\n* @api private\n*/\nvar crossRegionOperations = ['createDBCluster', 'copyDBClusterSnapshot'];\n\nAWS.util.update(AWS.Neptune.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n if (\n crossRegionOperations.indexOf(request.operation) !== -1 &&\n this.config.params &&\n this.config.params.SourceRegion &&\n request.params &&\n !request.params.SourceRegion\n ) {\n request.params.SourceRegion = this.config.params.SourceRegion;\n }\n rdsutil.setupRequestListeners(this, request, crossRegionOperations);\n },\n});\n","require('../polly/presigner');\n","var AWS = require('../core');\nvar rdsutil = require('./rdsutil');\nrequire('../rds/signer');\n /**\n * @api private\n */\n var crossRegionOperations = ['copyDBSnapshot', 'createDBInstanceReadReplica', 'createDBCluster', 'copyDBClusterSnapshot', 'startDBInstanceAutomatedBackupsReplication'];\n\n AWS.util.update(AWS.RDS.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n rdsutil.setupRequestListeners(this, request, crossRegionOperations);\n },\n });\n","var AWS = require('../core');\n\nAWS.util.update(AWS.RDSDataService.prototype, {\n /**\n * @return [Boolean] whether the error can be retried\n * @api private\n */\n retryableError: function retryableError(error) {\n if (error.code === 'BadRequestException' &&\n error.message &&\n error.message.match(/^Communications link failure/) &&\n error.statusCode === 400) {\n return true;\n } else {\n var _super = AWS.Service.prototype.retryableError;\n return _super.call(this, error);\n }\n }\n});\n","var AWS = require('../core');\n\nvar rdsutil = {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(service, request, crossRegionOperations) {\n if (crossRegionOperations.indexOf(request.operation) !== -1 &&\n request.params.SourceRegion) {\n request.params = AWS.util.copy(request.params);\n if (request.params.PreSignedUrl ||\n request.params.SourceRegion === service.config.region) {\n delete request.params.SourceRegion;\n } else {\n var doesParamValidation = !!service.config.paramValidation;\n // remove the validate parameters listener so we can re-add it after we build the URL\n if (doesParamValidation) {\n request.removeListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n }\n request.onAsync('validate', rdsutil.buildCrossRegionPresignedUrl);\n if (doesParamValidation) {\n request.addListener('validate', AWS.EventListeners.Core.VALIDATE_PARAMETERS);\n }\n }\n }\n },\n\n /**\n * @api private\n */\n buildCrossRegionPresignedUrl: function buildCrossRegionPresignedUrl(req, done) {\n var config = AWS.util.copy(req.service.config);\n config.region = req.params.SourceRegion;\n delete req.params.SourceRegion;\n delete config.endpoint;\n // relevant params for the operation will already be in req.params\n delete config.params;\n config.signatureVersion = 'v4';\n var destinationRegion = req.service.config.region;\n\n var svc = new req.service.constructor(config);\n var newReq = svc[req.operation](AWS.util.copy(req.params));\n newReq.on('build', function addDestinationRegionParam(request) {\n var httpRequest = request.httpRequest;\n httpRequest.params.DestinationRegion = destinationRegion;\n httpRequest.body = AWS.util.queryParamsToString(httpRequest.params);\n });\n newReq.presign(function(err, url) {\n if (err) done(err);\n else {\n req.params.PreSignedUrl = url;\n done();\n }\n });\n }\n};\n\n/**\n * @api private\n */\nmodule.exports = rdsutil;\n","var AWS = require('../core');\n\nAWS.util.update(AWS.Route53.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.on('build', this.sanitizeUrl);\n },\n\n /**\n * @api private\n */\n sanitizeUrl: function sanitizeUrl(request) {\n var path = request.httpRequest.path;\n request.httpRequest.path = path.replace(/\\/%2F\\w+%2F/, '/');\n },\n\n /**\n * @return [Boolean] whether the error can be retried\n * @api private\n */\n retryableError: function retryableError(error) {\n if (error.code === 'PriorRequestNotComplete' &&\n error.statusCode === 400) {\n return true;\n } else {\n var _super = AWS.Service.prototype.retryableError;\n return _super.call(this, error);\n }\n }\n});\n","var AWS = require('../core');\nvar v4Credentials = require('../signers/v4_credentials');\nvar resolveRegionalEndpointsFlag = require('../config_regional_endpoint');\nvar s3util = require('./s3util');\nvar regionUtil = require('../region_config');\n\n// Pull in managed upload extension\nrequire('../s3/managed_upload');\n\n/**\n * @api private\n */\nvar operationsWith200StatusCodeError = {\n 'completeMultipartUpload': true,\n 'copyObject': true,\n 'uploadPartCopy': true\n};\n\n/**\n * @api private\n */\n var regionRedirectErrorCodes = [\n 'AuthorizationHeaderMalformed', // non-head operations on virtual-hosted global bucket endpoints\n 'BadRequest', // head operations on virtual-hosted global bucket endpoints\n 'PermanentRedirect', // non-head operations on path-style or regional endpoints\n 301 // head operations on path-style or regional endpoints\n ];\n\nvar OBJECT_LAMBDA_SERVICE = 's3-object-lambda';\n\nAWS.util.update(AWS.S3.prototype, {\n /**\n * @api private\n */\n getSignatureVersion: function getSignatureVersion(request) {\n var defaultApiVersion = this.api.signatureVersion;\n var userDefinedVersion = this._originalConfig ? this._originalConfig.signatureVersion : null;\n var regionDefinedVersion = this.config.signatureVersion;\n var isPresigned = request ? request.isPresigned() : false;\n /*\n 1) User defined version specified:\n a) always return user defined version\n 2) No user defined version specified:\n a) If not using presigned urls, default to V4\n b) If using presigned urls, default to lowest version the region supports\n */\n if (userDefinedVersion) {\n userDefinedVersion = userDefinedVersion === 'v2' ? 's3' : userDefinedVersion;\n return userDefinedVersion;\n }\n if (isPresigned !== true) {\n defaultApiVersion = 'v4';\n } else if (regionDefinedVersion) {\n defaultApiVersion = regionDefinedVersion;\n }\n return defaultApiVersion;\n },\n\n /**\n * @api private\n */\n getSigningName: function getSigningName(req) {\n if (req && req.operation === 'writeGetObjectResponse') {\n return OBJECT_LAMBDA_SERVICE;\n }\n\n var _super = AWS.Service.prototype.getSigningName;\n return (req && req._parsedArn && req._parsedArn.service)\n ? req._parsedArn.service\n : _super.call(this);\n },\n\n /**\n * @api private\n */\n getSignerClass: function getSignerClass(request) {\n var signatureVersion = this.getSignatureVersion(request);\n return AWS.Signers.RequestSigner.getVersion(signatureVersion);\n },\n\n /**\n * @api private\n */\n validateService: function validateService() {\n var msg;\n var messages = [];\n\n // default to us-east-1 when no region is provided\n if (!this.config.region) this.config.region = 'us-east-1';\n\n if (!this.config.endpoint && this.config.s3BucketEndpoint) {\n messages.push('An endpoint must be provided when configuring ' +\n '`s3BucketEndpoint` to true.');\n }\n if (messages.length === 1) {\n msg = messages[0];\n } else if (messages.length > 1) {\n msg = 'Multiple configuration errors:\\n' + messages.join('\\n');\n }\n if (msg) {\n throw AWS.util.error(new Error(),\n {name: 'InvalidEndpoint', message: msg});\n }\n },\n\n /**\n * @api private\n */\n shouldDisableBodySigning: function shouldDisableBodySigning(request) {\n var signerClass = this.getSignerClass();\n if (this.config.s3DisableBodySigning === true && signerClass === AWS.Signers.V4\n && request.httpRequest.endpoint.protocol === 'https:') {\n return true;\n }\n return false;\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n var prependListener = true;\n request.addListener('validate', this.validateScheme);\n request.addListener('validate', this.validateBucketName, prependListener);\n request.addListener('validate', this.optInUsEast1RegionalEndpoint, prependListener);\n\n request.removeListener('validate',\n AWS.EventListeners.Core.VALIDATE_REGION);\n request.addListener('build', this.addContentType);\n request.addListener('build', this.computeContentMd5);\n request.addListener('build', this.computeSseCustomerKeyMd5);\n request.addListener('build', this.populateURI);\n request.addListener('afterBuild', this.addExpect100Continue);\n request.addListener('extractError', this.extractError);\n request.addListener('extractData', AWS.util.hoistPayloadMember);\n request.addListener('extractData', this.extractData);\n request.addListener('extractData', this.extractErrorFrom200Response);\n request.addListener('beforePresign', this.prepareSignedUrl);\n if (this.shouldDisableBodySigning(request)) {\n request.removeListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256);\n request.addListener('afterBuild', this.disableBodySigning);\n }\n //deal with ARNs supplied to Bucket\n if (request.operation !== 'createBucket' && s3util.isArnInParam(request, 'Bucket')) {\n // avoid duplicate parsing in the future\n request._parsedArn = AWS.util.ARN.parse(request.params.Bucket);\n\n request.removeListener('validate', this.validateBucketName);\n request.removeListener('build', this.populateURI);\n if (request._parsedArn.service === 's3') {\n request.addListener('validate', s3util.validateS3AccessPointArn);\n request.addListener('validate', this.validateArnResourceType);\n request.addListener('validate', this.validateArnRegion);\n } else if (request._parsedArn.service === 's3-outposts') {\n request.addListener('validate', s3util.validateOutpostsAccessPointArn);\n request.addListener('validate', s3util.validateOutpostsArn);\n request.addListener('validate', s3util.validateArnRegion);\n }\n request.addListener('validate', s3util.validateArnAccount);\n request.addListener('validate', s3util.validateArnService);\n request.addListener('build', this.populateUriFromAccessPointArn);\n request.addListener('build', s3util.validatePopulateUriFromArn);\n return;\n }\n //listeners regarding region inference\n request.addListener('validate', this.validateBucketEndpoint);\n request.addListener('validate', this.correctBucketRegionFromCache);\n request.onAsync('extractError', this.requestBucketRegion);\n if (AWS.util.isBrowser()) {\n request.onAsync('retry', this.reqRegionForNetworkingError);\n }\n },\n\n /**\n * @api private\n */\n validateScheme: function(req) {\n var params = req.params,\n scheme = req.httpRequest.endpoint.protocol,\n sensitive = params.SSECustomerKey || params.CopySourceSSECustomerKey;\n if (sensitive && scheme !== 'https:') {\n var msg = 'Cannot send SSE keys over HTTP. Set \\'sslEnabled\\'' +\n 'to \\'true\\' in your configuration';\n throw AWS.util.error(new Error(),\n { code: 'ConfigError', message: msg });\n }\n },\n\n /**\n * @api private\n */\n validateBucketEndpoint: function(req) {\n if (!req.params.Bucket && req.service.config.s3BucketEndpoint) {\n var msg = 'Cannot send requests to root API with `s3BucketEndpoint` set.';\n throw AWS.util.error(new Error(),\n { code: 'ConfigError', message: msg });\n }\n },\n\n /**\n * @api private\n */\n validateArnRegion: function validateArnRegion(req) {\n s3util.validateArnRegion(req, { allowFipsEndpoint: true });\n },\n\n /**\n * Validate resource-type supplied in S3 ARN\n */\n validateArnResourceType: function validateArnResourceType(req) {\n var resource = req._parsedArn.resource;\n\n if (\n resource.indexOf('accesspoint:') !== 0 &&\n resource.indexOf('accesspoint/') !== 0\n ) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'ARN resource should begin with \\'accesspoint/\\''\n });\n }\n },\n\n /**\n * @api private\n */\n validateBucketName: function validateBucketName(req) {\n var service = req.service;\n var signatureVersion = service.getSignatureVersion(req);\n var bucket = req.params && req.params.Bucket;\n var key = req.params && req.params.Key;\n var slashIndex = bucket && bucket.indexOf('/');\n if (bucket && slashIndex >= 0) {\n if (typeof key === 'string' && slashIndex > 0) {\n req.params = AWS.util.copy(req.params);\n // Need to include trailing slash to match sigv2 behavior\n var prefix = bucket.substr(slashIndex + 1) || '';\n req.params.Key = prefix + '/' + key;\n req.params.Bucket = bucket.substr(0, slashIndex);\n } else if (signatureVersion === 'v4') {\n var msg = 'Bucket names cannot contain forward slashes. Bucket: ' + bucket;\n throw AWS.util.error(new Error(),\n { code: 'InvalidBucket', message: msg });\n }\n }\n },\n\n /**\n * @api private\n */\n isValidAccelerateOperation: function isValidAccelerateOperation(operation) {\n var invalidOperations = [\n 'createBucket',\n 'deleteBucket',\n 'listBuckets'\n ];\n return invalidOperations.indexOf(operation) === -1;\n },\n\n /**\n * When us-east-1 region endpoint configuration is set, in stead of sending request to\n * global endpoint(e.g. 's3.amazonaws.com'), we will send request to\n * 's3.us-east-1.amazonaws.com'.\n * @api private\n */\n optInUsEast1RegionalEndpoint: function optInUsEast1RegionalEndpoint(req) {\n var service = req.service;\n var config = service.config;\n config.s3UsEast1RegionalEndpoint = resolveRegionalEndpointsFlag(service._originalConfig, {\n env: 'AWS_S3_US_EAST_1_REGIONAL_ENDPOINT',\n sharedConfig: 's3_us_east_1_regional_endpoint',\n clientConfig: 's3UsEast1RegionalEndpoint'\n });\n if (\n !(service._originalConfig || {}).endpoint &&\n req.httpRequest.region === 'us-east-1' &&\n config.s3UsEast1RegionalEndpoint === 'regional' &&\n req.httpRequest.endpoint.hostname.indexOf('s3.amazonaws.com') >= 0\n ) {\n var insertPoint = config.endpoint.indexOf('.amazonaws.com');\n regionalEndpoint = config.endpoint.substring(0, insertPoint) +\n '.us-east-1' + config.endpoint.substring(insertPoint);\n req.httpRequest.updateEndpoint(regionalEndpoint);\n }\n },\n\n /**\n * S3 prefers dns-compatible bucket names to be moved from the uri path\n * to the hostname as a sub-domain. This is not possible, even for dns-compat\n * buckets when using SSL and the bucket name contains a dot ('.'). The\n * ssl wildcard certificate is only 1-level deep.\n *\n * @api private\n */\n populateURI: function populateURI(req) {\n var httpRequest = req.httpRequest;\n var b = req.params.Bucket;\n var service = req.service;\n var endpoint = httpRequest.endpoint;\n if (b) {\n if (!service.pathStyleBucketName(b)) {\n if (service.config.useAccelerateEndpoint && service.isValidAccelerateOperation(req.operation)) {\n if (service.config.useDualstackEndpoint) {\n endpoint.hostname = b + '.s3-accelerate.dualstack.amazonaws.com';\n } else {\n endpoint.hostname = b + '.s3-accelerate.amazonaws.com';\n }\n } else if (!service.config.s3BucketEndpoint) {\n endpoint.hostname =\n b + '.' + endpoint.hostname;\n }\n\n var port = endpoint.port;\n if (port !== 80 && port !== 443) {\n endpoint.host = endpoint.hostname + ':' +\n endpoint.port;\n } else {\n endpoint.host = endpoint.hostname;\n }\n\n httpRequest.virtualHostedBucket = b; // needed for signing the request\n service.removeVirtualHostedBucketFromPath(req);\n }\n }\n },\n\n /**\n * Takes the bucket name out of the path if bucket is virtual-hosted\n *\n * @api private\n */\n removeVirtualHostedBucketFromPath: function removeVirtualHostedBucketFromPath(req) {\n var httpRequest = req.httpRequest;\n var bucket = httpRequest.virtualHostedBucket;\n if (bucket && httpRequest.path) {\n if (req.params && req.params.Key) {\n var encodedS3Key = '/' + AWS.util.uriEscapePath(req.params.Key);\n if (httpRequest.path.indexOf(encodedS3Key) === 0 && (httpRequest.path.length === encodedS3Key.length || httpRequest.path[encodedS3Key.length] === '?')) {\n //path only contains key or path contains only key and querystring\n return;\n }\n }\n httpRequest.path = httpRequest.path.replace(new RegExp('/' + bucket), '');\n if (httpRequest.path[0] !== '/') {\n httpRequest.path = '/' + httpRequest.path;\n }\n }\n },\n\n /**\n * When user supply an access point ARN in the Bucket parameter, we need to\n * populate the URI according to the ARN.\n */\n populateUriFromAccessPointArn: function populateUriFromAccessPointArn(req) {\n var accessPointArn = req._parsedArn;\n\n var isOutpostArn = accessPointArn.service === 's3-outposts';\n var isObjectLambdaArn = accessPointArn.service === 's3-object-lambda';\n\n var outpostsSuffix = isOutpostArn ? '.' + accessPointArn.outpostId: '';\n var serviceName = isOutpostArn ? 's3-outposts': 's3-accesspoint';\n var fipsSuffix = !isOutpostArn && req.service.config.useFipsEndpoint ? '-fips': '';\n var dualStackSuffix = !isOutpostArn &&\n req.service.config.useDualstackEndpoint ? '.dualstack' : '';\n\n var endpoint = req.httpRequest.endpoint;\n var dnsSuffix = regionUtil.getEndpointSuffix(accessPointArn.region);\n var useArnRegion = req.service.config.s3UseArnRegion;\n\n endpoint.hostname = [\n accessPointArn.accessPoint + '-' + accessPointArn.accountId + outpostsSuffix,\n serviceName + fipsSuffix + dualStackSuffix,\n useArnRegion ? accessPointArn.region : req.service.config.region,\n dnsSuffix\n ].join('.');\n\n if (isObjectLambdaArn) {\n // should be in the format: \"accesspoint/${accesspointName}\"\n var serviceName = 's3-object-lambda';\n var accesspointName = accessPointArn.resource.split('/')[1];\n var fipsSuffix = req.service.config.useFipsEndpoint ? '-fips': '';\n endpoint.hostname = [\n accesspointName + '-' + accessPointArn.accountId,\n serviceName + fipsSuffix,\n useArnRegion ? accessPointArn.region : req.service.config.region,\n dnsSuffix\n ].join('.');\n }\n endpoint.host = endpoint.hostname;\n var encodedArn = AWS.util.uriEscape(req.params.Bucket);\n var path = req.httpRequest.path;\n //remove the Bucket value from path\n req.httpRequest.path = path.replace(new RegExp('/' + encodedArn), '');\n if (req.httpRequest.path[0] !== '/') {\n req.httpRequest.path = '/' + req.httpRequest.path;\n }\n req.httpRequest.region = accessPointArn.region; //region used to sign\n },\n\n /**\n * Adds Expect: 100-continue header if payload is greater-or-equal 1MB\n * @api private\n */\n addExpect100Continue: function addExpect100Continue(req) {\n var len = req.httpRequest.headers['Content-Length'];\n if (AWS.util.isNode() && (len >= 1024 * 1024 || req.params.Body instanceof AWS.util.stream.Stream)) {\n req.httpRequest.headers['Expect'] = '100-continue';\n }\n },\n\n /**\n * Adds a default content type if none is supplied.\n *\n * @api private\n */\n addContentType: function addContentType(req) {\n var httpRequest = req.httpRequest;\n if (httpRequest.method === 'GET' || httpRequest.method === 'HEAD') {\n // Content-Type is not set in GET/HEAD requests\n delete httpRequest.headers['Content-Type'];\n return;\n }\n\n if (!httpRequest.headers['Content-Type']) { // always have a Content-Type\n httpRequest.headers['Content-Type'] = 'application/octet-stream';\n }\n\n var contentType = httpRequest.headers['Content-Type'];\n if (AWS.util.isBrowser()) {\n if (typeof httpRequest.body === 'string' && !contentType.match(/;\\s*charset=/)) {\n var charset = '; charset=UTF-8';\n httpRequest.headers['Content-Type'] += charset;\n } else {\n var replaceFn = function(_, prefix, charsetName) {\n return prefix + charsetName.toUpperCase();\n };\n\n httpRequest.headers['Content-Type'] =\n contentType.replace(/(;\\s*charset=)(.+)$/, replaceFn);\n }\n }\n },\n\n /**\n * Checks whether checksums should be computed for the request if it's not\n * already set by {AWS.EventListeners.Core.COMPUTE_CHECKSUM}. It depends on\n * whether {AWS.Config.computeChecksums} is set.\n *\n * @param req [AWS.Request] the request to check against\n * @return [Boolean] whether to compute checksums for a request.\n * @api private\n */\n willComputeChecksums: function willComputeChecksums(req) {\n var rules = req.service.api.operations[req.operation].input.members;\n var body = req.httpRequest.body;\n var needsContentMD5 = req.service.config.computeChecksums &&\n rules.ContentMD5 &&\n !req.params.ContentMD5 &&\n body &&\n (AWS.util.Buffer.isBuffer(req.httpRequest.body) || typeof req.httpRequest.body === 'string');\n\n // Sha256 signing disabled, and not a presigned url\n if (needsContentMD5 && req.service.shouldDisableBodySigning(req) && !req.isPresigned()) {\n return true;\n }\n\n // SigV2 and presign, for backwards compatibility purpose.\n if (needsContentMD5 && this.getSignatureVersion(req) === 's3' && req.isPresigned()) {\n return true;\n }\n\n return false;\n },\n\n /**\n * A listener that computes the Content-MD5 and sets it in the header.\n * This listener is to support S3-specific features like\n * s3DisableBodySigning and SigV2 presign. Content MD5 logic for SigV4 is\n * handled in AWS.EventListeners.Core.COMPUTE_CHECKSUM\n *\n * @api private\n */\n computeContentMd5: function computeContentMd5(req) {\n if (req.service.willComputeChecksums(req)) {\n var md5 = AWS.util.crypto.md5(req.httpRequest.body, 'base64');\n req.httpRequest.headers['Content-MD5'] = md5;\n }\n },\n\n /**\n * @api private\n */\n computeSseCustomerKeyMd5: function computeSseCustomerKeyMd5(req) {\n var keys = {\n SSECustomerKey: 'x-amz-server-side-encryption-customer-key-MD5',\n CopySourceSSECustomerKey: 'x-amz-copy-source-server-side-encryption-customer-key-MD5'\n };\n AWS.util.each(keys, function(key, header) {\n if (req.params[key]) {\n var value = AWS.util.crypto.md5(req.params[key], 'base64');\n req.httpRequest.headers[header] = value;\n }\n });\n },\n\n /**\n * Returns true if the bucket name should be left in the URI path for\n * a request to S3. This function takes into account the current\n * endpoint protocol (e.g. http or https).\n *\n * @api private\n */\n pathStyleBucketName: function pathStyleBucketName(bucketName) {\n // user can force path style requests via the configuration\n if (this.config.s3ForcePathStyle) return true;\n if (this.config.s3BucketEndpoint) return false;\n\n if (s3util.dnsCompatibleBucketName(bucketName)) {\n return (this.config.sslEnabled && bucketName.match(/\\./)) ? true : false;\n } else {\n return true; // not dns compatible names must always use path style\n }\n },\n\n /**\n * For COPY operations, some can be error even with status code 200.\n * SDK treats the response as exception when response body indicates\n * an exception or body is empty.\n *\n * @api private\n */\n extractErrorFrom200Response: function extractErrorFrom200Response(resp) {\n if (!operationsWith200StatusCodeError[resp.request.operation]) return;\n var httpResponse = resp.httpResponse;\n if (httpResponse.body && httpResponse.body.toString().match('')) {\n // Response body with '...' indicates an exception.\n // Get S3 client object. In ManagedUpload, this.service refers to\n // S3 client object.\n resp.data = null;\n var service = this.service ? this.service : this;\n service.extractError(resp);\n throw resp.error;\n } else if (!httpResponse.body || !httpResponse.body.toString().match(/<[\\w_]/)) {\n // When body is empty or incomplete, S3 might stop the request on detecting client\n // side aborting the request.\n resp.data = null;\n throw AWS.util.error(new Error(), {\n code: 'InternalError',\n message: 'S3 aborted request'\n });\n }\n },\n\n /**\n * @return [Boolean] whether the error can be retried\n * @api private\n */\n retryableError: function retryableError(error, request) {\n if (operationsWith200StatusCodeError[request.operation] &&\n error.statusCode === 200) {\n return true;\n } else if (request._requestRegionForBucket &&\n request.service.bucketRegionCache[request._requestRegionForBucket]) {\n return false;\n } else if (error && error.code === 'RequestTimeout') {\n return true;\n } else if (error &&\n regionRedirectErrorCodes.indexOf(error.code) != -1 &&\n error.region && error.region != request.httpRequest.region) {\n request.httpRequest.region = error.region;\n if (error.statusCode === 301) {\n request.service.updateReqBucketRegion(request);\n }\n return true;\n } else {\n var _super = AWS.Service.prototype.retryableError;\n return _super.call(this, error, request);\n }\n },\n\n /**\n * Updates httpRequest with region. If region is not provided, then\n * the httpRequest will be updated based on httpRequest.region\n *\n * @api private\n */\n updateReqBucketRegion: function updateReqBucketRegion(request, region) {\n var httpRequest = request.httpRequest;\n if (typeof region === 'string' && region.length) {\n httpRequest.region = region;\n }\n if (!httpRequest.endpoint.host.match(/s3(?!-accelerate).*\\.amazonaws\\.com$/)) {\n return;\n }\n var service = request.service;\n var s3Config = service.config;\n var s3BucketEndpoint = s3Config.s3BucketEndpoint;\n if (s3BucketEndpoint) {\n delete s3Config.s3BucketEndpoint;\n }\n var newConfig = AWS.util.copy(s3Config);\n delete newConfig.endpoint;\n newConfig.region = httpRequest.region;\n\n httpRequest.endpoint = (new AWS.S3(newConfig)).endpoint;\n service.populateURI(request);\n s3Config.s3BucketEndpoint = s3BucketEndpoint;\n httpRequest.headers.Host = httpRequest.endpoint.host;\n\n if (request._asm.currentState === 'validate') {\n request.removeListener('build', service.populateURI);\n request.addListener('build', service.removeVirtualHostedBucketFromPath);\n }\n },\n\n /**\n * Provides a specialized parser for getBucketLocation -- all other\n * operations are parsed by the super class.\n *\n * @api private\n */\n extractData: function extractData(resp) {\n var req = resp.request;\n if (req.operation === 'getBucketLocation') {\n var match = resp.httpResponse.body.toString().match(/>(.+)<\\/Location/);\n delete resp.data['_'];\n if (match) {\n resp.data.LocationConstraint = match[1];\n } else {\n resp.data.LocationConstraint = '';\n }\n }\n var bucket = req.params.Bucket || null;\n if (req.operation === 'deleteBucket' && typeof bucket === 'string' && !resp.error) {\n req.service.clearBucketRegionCache(bucket);\n } else {\n var headers = resp.httpResponse.headers || {};\n var region = headers['x-amz-bucket-region'] || null;\n if (!region && req.operation === 'createBucket' && !resp.error) {\n var createBucketConfiguration = req.params.CreateBucketConfiguration;\n if (!createBucketConfiguration) {\n region = 'us-east-1';\n } else if (createBucketConfiguration.LocationConstraint === 'EU') {\n region = 'eu-west-1';\n } else {\n region = createBucketConfiguration.LocationConstraint;\n }\n }\n if (region) {\n if (bucket && region !== req.service.bucketRegionCache[bucket]) {\n req.service.bucketRegionCache[bucket] = region;\n }\n }\n }\n req.service.extractRequestIds(resp);\n },\n\n /**\n * Extracts an error object from the http response.\n *\n * @api private\n */\n extractError: function extractError(resp) {\n var codes = {\n 304: 'NotModified',\n 403: 'Forbidden',\n 400: 'BadRequest',\n 404: 'NotFound'\n };\n\n var req = resp.request;\n var code = resp.httpResponse.statusCode;\n var body = resp.httpResponse.body || '';\n\n var headers = resp.httpResponse.headers || {};\n var region = headers['x-amz-bucket-region'] || null;\n var bucket = req.params.Bucket || null;\n var bucketRegionCache = req.service.bucketRegionCache;\n if (region && bucket && region !== bucketRegionCache[bucket]) {\n bucketRegionCache[bucket] = region;\n }\n\n var cachedRegion;\n if (codes[code] && body.length === 0) {\n if (bucket && !region) {\n cachedRegion = bucketRegionCache[bucket] || null;\n if (cachedRegion !== req.httpRequest.region) {\n region = cachedRegion;\n }\n }\n resp.error = AWS.util.error(new Error(), {\n code: codes[code],\n message: null,\n region: region\n });\n } else {\n var data = new AWS.XML.Parser().parse(body.toString());\n\n if (data.Region && !region) {\n region = data.Region;\n if (bucket && region !== bucketRegionCache[bucket]) {\n bucketRegionCache[bucket] = region;\n }\n } else if (bucket && !region && !data.Region) {\n cachedRegion = bucketRegionCache[bucket] || null;\n if (cachedRegion !== req.httpRequest.region) {\n region = cachedRegion;\n }\n }\n\n resp.error = AWS.util.error(new Error(), {\n code: data.Code || code,\n message: data.Message || null,\n region: region\n });\n }\n req.service.extractRequestIds(resp);\n },\n\n /**\n * If region was not obtained synchronously, then send async request\n * to get bucket region for errors resulting from wrong region.\n *\n * @api private\n */\n requestBucketRegion: function requestBucketRegion(resp, done) {\n var error = resp.error;\n var req = resp.request;\n var bucket = req.params.Bucket || null;\n\n if (!error || !bucket || error.region || req.operation === 'listObjects' ||\n (AWS.util.isNode() && req.operation === 'headBucket') ||\n (error.statusCode === 400 && req.operation !== 'headObject') ||\n regionRedirectErrorCodes.indexOf(error.code) === -1) {\n return done();\n }\n var reqOperation = AWS.util.isNode() ? 'headBucket' : 'listObjects';\n var reqParams = {Bucket: bucket};\n if (reqOperation === 'listObjects') reqParams.MaxKeys = 0;\n var regionReq = req.service[reqOperation](reqParams);\n regionReq._requestRegionForBucket = bucket;\n regionReq.send(function() {\n var region = req.service.bucketRegionCache[bucket] || null;\n error.region = region;\n done();\n });\n },\n\n /**\n * For browser only. If NetworkingError received, will attempt to obtain\n * the bucket region.\n *\n * @api private\n */\n reqRegionForNetworkingError: function reqRegionForNetworkingError(resp, done) {\n if (!AWS.util.isBrowser()) {\n return done();\n }\n var error = resp.error;\n var request = resp.request;\n var bucket = request.params.Bucket;\n if (!error || error.code !== 'NetworkingError' || !bucket ||\n request.httpRequest.region === 'us-east-1') {\n return done();\n }\n var service = request.service;\n var bucketRegionCache = service.bucketRegionCache;\n var cachedRegion = bucketRegionCache[bucket] || null;\n\n if (cachedRegion && cachedRegion !== request.httpRequest.region) {\n service.updateReqBucketRegion(request, cachedRegion);\n done();\n } else if (!s3util.dnsCompatibleBucketName(bucket)) {\n service.updateReqBucketRegion(request, 'us-east-1');\n if (bucketRegionCache[bucket] !== 'us-east-1') {\n bucketRegionCache[bucket] = 'us-east-1';\n }\n done();\n } else if (request.httpRequest.virtualHostedBucket) {\n var getRegionReq = service.listObjects({Bucket: bucket, MaxKeys: 0});\n service.updateReqBucketRegion(getRegionReq, 'us-east-1');\n getRegionReq._requestRegionForBucket = bucket;\n\n getRegionReq.send(function() {\n var region = service.bucketRegionCache[bucket] || null;\n if (region && region !== request.httpRequest.region) {\n service.updateReqBucketRegion(request, region);\n }\n done();\n });\n } else {\n // DNS-compatible path-style\n // (s3ForcePathStyle or bucket name with dot over https)\n // Cannot obtain region information for this case\n done();\n }\n },\n\n /**\n * Cache for bucket region.\n *\n * @api private\n */\n bucketRegionCache: {},\n\n /**\n * Clears bucket region cache.\n *\n * @api private\n */\n clearBucketRegionCache: function(buckets) {\n var bucketRegionCache = this.bucketRegionCache;\n if (!buckets) {\n buckets = Object.keys(bucketRegionCache);\n } else if (typeof buckets === 'string') {\n buckets = [buckets];\n }\n for (var i = 0; i < buckets.length; i++) {\n delete bucketRegionCache[buckets[i]];\n }\n return bucketRegionCache;\n },\n\n /**\n * Corrects request region if bucket's cached region is different\n *\n * @api private\n */\n correctBucketRegionFromCache: function correctBucketRegionFromCache(req) {\n var bucket = req.params.Bucket || null;\n if (bucket) {\n var service = req.service;\n var requestRegion = req.httpRequest.region;\n var cachedRegion = service.bucketRegionCache[bucket];\n if (cachedRegion && cachedRegion !== requestRegion) {\n service.updateReqBucketRegion(req, cachedRegion);\n }\n }\n },\n\n /**\n * Extracts S3 specific request ids from the http response.\n *\n * @api private\n */\n extractRequestIds: function extractRequestIds(resp) {\n var extendedRequestId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-id-2'] : null;\n var cfId = resp.httpResponse.headers ? resp.httpResponse.headers['x-amz-cf-id'] : null;\n resp.extendedRequestId = extendedRequestId;\n resp.cfId = cfId;\n\n if (resp.error) {\n resp.error.requestId = resp.requestId || null;\n resp.error.extendedRequestId = extendedRequestId;\n resp.error.cfId = cfId;\n }\n },\n\n /**\n * Get a pre-signed URL for a given operation name.\n *\n * @note You must ensure that you have static or previously resolved\n * credentials if you call this method synchronously (with no callback),\n * otherwise it may not properly sign the request. If you cannot guarantee\n * this (you are using an asynchronous credential provider, i.e., EC2\n * IAM roles), you should always call this method with an asynchronous\n * callback.\n * @note Not all operation parameters are supported when using pre-signed\n * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`,\n * `ContentLength`, or `Tagging` must be provided as headers when sending a\n * request. If you are using pre-signed URLs to upload from a browser and\n * need to use these fields, see {createPresignedPost}.\n * @note The default signer allows altering the request by adding corresponding\n * headers to set some parameters (e.g. Range) and these added parameters\n * won't be signed. You must use signatureVersion v4 to to include these\n * parameters in the signed portion of the URL and enforce exact matching\n * between headers and signed params in the URL.\n * @note This operation cannot be used with a promise. See note above regarding\n * asynchronous credentials and use with a callback.\n * @param operation [String] the name of the operation to call\n * @param params [map] parameters to pass to the operation. See the given\n * operation for the expected operation parameters. In addition, you can\n * also pass the \"Expires\" parameter to inform S3 how long the URL should\n * work for.\n * @option params Expires [Integer] (900) the number of seconds to expire\n * the pre-signed URL operation in. Defaults to 15 minutes.\n * @param callback [Function] if a callback is provided, this function will\n * pass the URL as the second parameter (after the error parameter) to\n * the callback function.\n * @return [String] if called synchronously (with no callback), returns the\n * signed URL.\n * @return [null] nothing is returned if a callback is provided.\n * @example Pre-signing a getObject operation (synchronously)\n * var params = {Bucket: 'bucket', Key: 'key'};\n * var url = s3.getSignedUrl('getObject', params);\n * console.log('The URL is', url);\n * @example Pre-signing a putObject (asynchronously)\n * var params = {Bucket: 'bucket', Key: 'key'};\n * s3.getSignedUrl('putObject', params, function (err, url) {\n * console.log('The URL is', url);\n * });\n * @example Pre-signing a putObject operation with a specific payload\n * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};\n * var url = s3.getSignedUrl('putObject', params);\n * console.log('The URL is', url);\n * @example Passing in a 1-minute expiry time for a pre-signed URL\n * var params = {Bucket: 'bucket', Key: 'key', Expires: 60};\n * var url = s3.getSignedUrl('getObject', params);\n * console.log('The URL is', url); // expires in 60 seconds\n */\n getSignedUrl: function getSignedUrl(operation, params, callback) {\n params = AWS.util.copy(params || {});\n var expires = params.Expires || 900;\n\n if (typeof expires !== 'number') {\n throw AWS.util.error(new Error(),\n { code: 'InvalidParameterException', message: 'The expiration must be a number, received ' + typeof expires });\n }\n\n delete params.Expires; // we can't validate this\n var request = this.makeRequest(operation, params);\n\n if (callback) {\n AWS.util.defer(function() {\n request.presign(expires, callback);\n });\n } else {\n return request.presign(expires, callback);\n }\n },\n\n /**\n * @!method getSignedUrlPromise()\n * Returns a 'thenable' promise that will be resolved with a pre-signed URL\n * for a given operation name.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @note Not all operation parameters are supported when using pre-signed\n * URLs. Certain parameters, such as `SSECustomerKey`, `ACL`, `Expires`,\n * `ContentLength`, or `Tagging` must be provided as headers when sending a\n * request. If you are using pre-signed URLs to upload from a browser and\n * need to use these fields, see {createPresignedPost}.\n * @param operation [String] the name of the operation to call\n * @param params [map] parameters to pass to the operation. See the given\n * operation for the expected operation parameters. In addition, you can\n * also pass the \"Expires\" parameter to inform S3 how long the URL should\n * work for.\n * @option params Expires [Integer] (900) the number of seconds to expire\n * the pre-signed URL operation in. Defaults to 15 minutes.\n * @callback fulfilledCallback function(url)\n * Called if the promise is fulfilled.\n * @param url [String] the signed url\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] if an error occurred, this value will be filled\n * @return [Promise] A promise that represents the state of the `refresh` call.\n * @example Pre-signing a getObject operation\n * var params = {Bucket: 'bucket', Key: 'key'};\n * var promise = s3.getSignedUrlPromise('getObject', params);\n * promise.then(function(url) {\n * console.log('The URL is', url);\n * }, function(err) { ... });\n * @example Pre-signing a putObject operation with a specific payload\n * var params = {Bucket: 'bucket', Key: 'key', Body: 'body'};\n * var promise = s3.getSignedUrlPromise('putObject', params);\n * promise.then(function(url) {\n * console.log('The URL is', url);\n * }, function(err) { ... });\n * @example Passing in a 1-minute expiry time for a pre-signed URL\n * var params = {Bucket: 'bucket', Key: 'key', Expires: 60};\n * var promise = s3.getSignedUrlPromise('getObject', params);\n * promise.then(function(url) {\n * console.log('The URL is', url);\n * }, function(err) { ... });\n */\n\n /**\n * Get a pre-signed POST policy to support uploading to S3 directly from an\n * HTML form.\n *\n * @param params [map]\n * @option params Bucket [String] The bucket to which the post should be\n * uploaded\n * @option params Expires [Integer] (3600) The number of seconds for which\n * the presigned policy should be valid.\n * @option params Conditions [Array] An array of conditions that must be met\n * for the presigned policy to allow the\n * upload. This can include required tags,\n * the accepted range for content lengths,\n * etc.\n * @see http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html\n * @option params Fields [map] Fields to include in the form. All\n * values passed in as fields will be\n * signed as exact match conditions.\n * @param callback [Function]\n *\n * @note All fields passed in when creating presigned post data will be signed\n * as exact match conditions. Any fields that will be interpolated by S3\n * must be added to the fields hash after signing, and an appropriate\n * condition for such fields must be explicitly added to the Conditions\n * array passed to this function before signing.\n *\n * @example Presiging post data with a known key\n * var params = {\n * Bucket: 'bucket',\n * Fields: {\n * key: 'key'\n * }\n * };\n * s3.createPresignedPost(params, function(err, data) {\n * if (err) {\n * console.error('Presigning post data encountered an error', err);\n * } else {\n * console.log('The post data is', data);\n * }\n * });\n *\n * @example Presigning post data with an interpolated key\n * var params = {\n * Bucket: 'bucket',\n * Conditions: [\n * ['starts-with', '$key', 'path/to/uploads/']\n * ]\n * };\n * s3.createPresignedPost(params, function(err, data) {\n * if (err) {\n * console.error('Presigning post data encountered an error', err);\n * } else {\n * data.Fields.key = 'path/to/uploads/${filename}';\n * console.log('The post data is', data);\n * }\n * });\n *\n * @note You must ensure that you have static or previously resolved\n * credentials if you call this method synchronously (with no callback),\n * otherwise it may not properly sign the request. If you cannot guarantee\n * this (you are using an asynchronous credential provider, i.e., EC2\n * IAM roles), you should always call this method with an asynchronous\n * callback.\n *\n * @return [map] If called synchronously (with no callback), returns a hash\n * with the url to set as the form action and a hash of fields\n * to include in the form.\n * @return [null] Nothing is returned if a callback is provided.\n *\n * @callback callback function (err, data)\n * @param err [Error] the error object returned from the policy signer\n * @param data [map] The data necessary to construct an HTML form\n * @param data.url [String] The URL to use as the action of the form\n * @param data.fields [map] A hash of fields that must be included in the\n * form for the upload to succeed. This hash will\n * include the signed POST policy, your access key\n * ID and security token (if present), etc. These\n * may be safely included as input elements of type\n * 'hidden.'\n */\n createPresignedPost: function createPresignedPost(params, callback) {\n if (typeof params === 'function' && callback === undefined) {\n callback = params;\n params = null;\n }\n\n params = AWS.util.copy(params || {});\n var boundParams = this.config.params || {};\n var bucket = params.Bucket || boundParams.Bucket,\n self = this,\n config = this.config,\n endpoint = AWS.util.copy(this.endpoint);\n if (!config.s3BucketEndpoint) {\n endpoint.pathname = '/' + bucket;\n }\n\n function finalizePost() {\n return {\n url: AWS.util.urlFormat(endpoint),\n fields: self.preparePostFields(\n config.credentials,\n config.region,\n bucket,\n params.Fields,\n params.Conditions,\n params.Expires\n )\n };\n }\n\n if (callback) {\n config.getCredentials(function (err) {\n if (err) {\n callback(err);\n } else {\n try {\n callback(null, finalizePost());\n } catch (err) {\n callback(err);\n }\n }\n });\n } else {\n return finalizePost();\n }\n },\n\n /**\n * @api private\n */\n preparePostFields: function preparePostFields(\n credentials,\n region,\n bucket,\n fields,\n conditions,\n expiresInSeconds\n ) {\n var now = this.getSkewCorrectedDate();\n if (!credentials || !region || !bucket) {\n throw new Error('Unable to create a POST object policy without a bucket,'\n + ' region, and credentials');\n }\n fields = AWS.util.copy(fields || {});\n conditions = (conditions || []).slice(0);\n expiresInSeconds = expiresInSeconds || 3600;\n\n var signingDate = AWS.util.date.iso8601(now).replace(/[:\\-]|\\.\\d{3}/g, '');\n var shortDate = signingDate.substr(0, 8);\n var scope = v4Credentials.createScope(shortDate, region, 's3');\n var credential = credentials.accessKeyId + '/' + scope;\n\n fields['bucket'] = bucket;\n fields['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256';\n fields['X-Amz-Credential'] = credential;\n fields['X-Amz-Date'] = signingDate;\n if (credentials.sessionToken) {\n fields['X-Amz-Security-Token'] = credentials.sessionToken;\n }\n for (var field in fields) {\n if (fields.hasOwnProperty(field)) {\n var condition = {};\n condition[field] = fields[field];\n conditions.push(condition);\n }\n }\n\n fields.Policy = this.preparePostPolicy(\n new Date(now.valueOf() + expiresInSeconds * 1000),\n conditions\n );\n fields['X-Amz-Signature'] = AWS.util.crypto.hmac(\n v4Credentials.getSigningKey(credentials, shortDate, region, 's3', true),\n fields.Policy,\n 'hex'\n );\n\n return fields;\n },\n\n /**\n * @api private\n */\n preparePostPolicy: function preparePostPolicy(expiration, conditions) {\n return AWS.util.base64.encode(JSON.stringify({\n expiration: AWS.util.date.iso8601(expiration),\n conditions: conditions\n }));\n },\n\n /**\n * @api private\n */\n prepareSignedUrl: function prepareSignedUrl(request) {\n request.addListener('validate', request.service.noPresignedContentLength);\n request.removeListener('build', request.service.addContentType);\n if (!request.params.Body) {\n // no Content-MD5/SHA-256 if body is not provided\n request.removeListener('build', request.service.computeContentMd5);\n } else {\n request.addListener('afterBuild', AWS.EventListeners.Core.COMPUTE_SHA256);\n }\n },\n\n /**\n * @api private\n * @param request\n */\n disableBodySigning: function disableBodySigning(request) {\n var headers = request.httpRequest.headers;\n // Add the header to anything that isn't a presigned url, unless that presigned url had a body defined\n if (!Object.prototype.hasOwnProperty.call(headers, 'presigned-expires')) {\n headers['X-Amz-Content-Sha256'] = 'UNSIGNED-PAYLOAD';\n }\n },\n\n /**\n * @api private\n */\n noPresignedContentLength: function noPresignedContentLength(request) {\n if (request.params.ContentLength !== undefined) {\n throw AWS.util.error(new Error(), {code: 'UnexpectedParameter',\n message: 'ContentLength is not supported in pre-signed URLs.'});\n }\n },\n\n createBucket: function createBucket(params, callback) {\n // When creating a bucket *outside* the classic region, the location\n // constraint must be set for the bucket and it must match the endpoint.\n // This chunk of code will set the location constraint param based\n // on the region (when possible), but it will not override a passed-in\n // location constraint.\n if (typeof params === 'function' || !params) {\n callback = callback || params;\n params = {};\n }\n var hostname = this.endpoint.hostname;\n // copy params so that appending keys does not unintentioinallly\n // mutate params object argument passed in by user\n var copiedParams = AWS.util.copy(params);\n\n if (hostname !== this.api.globalEndpoint && !params.CreateBucketConfiguration) {\n copiedParams.CreateBucketConfiguration = { LocationConstraint: this.config.region };\n }\n return this.makeRequest('createBucket', copiedParams, callback);\n },\n\n writeGetObjectResponse: function writeGetObjectResponse(params, callback) {\n\n var request = this.makeRequest('writeGetObjectResponse', AWS.util.copy(params), callback);\n var hostname = this.endpoint.hostname;\n if (hostname.indexOf(this.config.region) !== -1) {\n // hostname specifies a region already\n hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.');\n } else {\n // Hostname doesn't have a region.\n // Object Lambda requires an explicit region.\n hostname = hostname.replace('s3.', OBJECT_LAMBDA_SERVICE + '.' + this.config.region + '.');\n }\n\n request.httpRequest.endpoint = new AWS.Endpoint(hostname, this.config);\n return request;\n },\n\n /**\n * @see AWS.S3.ManagedUpload\n * @overload upload(params = {}, [options], [callback])\n * Uploads an arbitrarily sized buffer, blob, or stream, using intelligent\n * concurrent handling of parts if the payload is large enough. You can\n * configure the concurrent queue size by setting `options`. Note that this\n * is the only operation for which the SDK can retry requests with stream\n * bodies.\n *\n * @param (see AWS.S3.putObject)\n * @option (see AWS.S3.ManagedUpload.constructor)\n * @return [AWS.S3.ManagedUpload] the managed upload object that can call\n * `send()` or track progress.\n * @example Uploading a stream object\n * var params = {Bucket: 'bucket', Key: 'key', Body: stream};\n * s3.upload(params, function(err, data) {\n * console.log(err, data);\n * });\n * @example Uploading a stream with concurrency of 1 and partSize of 10mb\n * var params = {Bucket: 'bucket', Key: 'key', Body: stream};\n * var options = {partSize: 10 * 1024 * 1024, queueSize: 1};\n * s3.upload(params, options, function(err, data) {\n * console.log(err, data);\n * });\n * @callback callback function(err, data)\n * @param err [Error] an error or null if no error occurred.\n * @param data [map] The response data from the successful upload:\n * @param data.Location [String] the URL of the uploaded object\n * @param data.ETag [String] the ETag of the uploaded object\n * @param data.Bucket [String] the bucket to which the object was uploaded\n * @param data.Key [String] the key to which the object was uploaded\n */\n upload: function upload(params, options, callback) {\n if (typeof options === 'function' && callback === undefined) {\n callback = options;\n options = null;\n }\n\n options = options || {};\n options = AWS.util.merge(options || {}, {service: this, params: params});\n\n var uploader = new AWS.S3.ManagedUpload(options);\n if (typeof callback === 'function') uploader.send(callback);\n return uploader;\n }\n});\n\n/**\n * @api private\n */\nAWS.S3.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.getSignedUrlPromise = AWS.util.promisifyMethod('getSignedUrl', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.S3.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.getSignedUrlPromise;\n};\n\nAWS.util.addPromises(AWS.S3);\n","var AWS = require('../core');\nvar s3util = require('./s3util');\nvar regionUtil = require('../region_config');\n\nAWS.util.update(AWS.S3Control.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('extractError', this.extractHostId);\n request.addListener('extractData', this.extractHostId);\n request.addListener('validate', this.validateAccountId);\n\n var isArnInBucket = s3util.isArnInParam(request, 'Bucket');\n var isArnInName = s3util.isArnInParam(request, 'Name');\n\n if (isArnInBucket) {\n request._parsedArn = AWS.util.ARN.parse(request.params['Bucket']);\n request.addListener('validate', this.validateOutpostsBucketArn);\n request.addListener('validate', s3util.validateOutpostsArn);\n request.addListener('afterBuild', this.addOutpostIdHeader);\n } else if (isArnInName) {\n request._parsedArn = AWS.util.ARN.parse(request.params['Name']);\n request.addListener('validate', s3util.validateOutpostsAccessPointArn);\n request.addListener('validate', s3util.validateOutpostsArn);\n request.addListener('afterBuild', this.addOutpostIdHeader);\n }\n\n if (isArnInBucket || isArnInName) {\n request.addListener('validate', this.validateArnRegion);\n request.addListener('validate', this.validateArnAccountWithParams, true);\n request.addListener('validate', s3util.validateArnAccount);\n request.addListener('validate', s3util.validateArnService);\n request.addListener('build', this.populateParamFromArn, true);\n request.addListener('build', this.populateUriFromArn);\n request.addListener('build', s3util.validatePopulateUriFromArn);\n }\n\n if (request.params.OutpostId &&\n (request.operation === 'createBucket' ||\n request.operation === 'listRegionalBuckets')) {\n request.addListener('build', this.populateEndpointForOutpostId);\n }\n },\n\n /**\n * Adds outpostId header\n */\n addOutpostIdHeader: function addOutpostIdHeader(req) {\n req.httpRequest.headers['x-amz-outpost-id'] = req._parsedArn.outpostId;\n },\n\n /**\n * Validate Outposts ARN supplied in Bucket parameter is a valid bucket name\n */\n validateOutpostsBucketArn: function validateOutpostsBucketArn(req) {\n var parsedArn = req._parsedArn;\n\n //can be ':' or '/'\n var delimiter = parsedArn.resource['outpost'.length];\n\n if (parsedArn.resource.split(delimiter).length !== 4) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Bucket ARN should have two resources outpost/{outpostId}/bucket/{accesspointName}'\n });\n }\n\n var bucket = parsedArn.resource.split(delimiter)[3];\n if (!s3util.dnsCompatibleBucketName(bucket) || bucket.match(/\\./)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Bucket ARN is not DNS compatible. Got ' + bucket\n });\n }\n\n //set parsed valid bucket\n req._parsedArn.bucket = bucket;\n },\n\n /**\n * @api private\n */\n populateParamFromArn: function populateParamFromArn(req) {\n var parsedArn = req._parsedArn;\n if (s3util.isArnInParam(req, 'Bucket')) {\n req.params.Bucket = parsedArn.bucket;\n } else if (s3util.isArnInParam(req, 'Name')) {\n req.params.Name = parsedArn.accessPoint;\n }\n },\n\n /**\n * Populate URI according to the ARN\n */\n populateUriFromArn: function populateUriFromArn(req) {\n var parsedArn = req._parsedArn;\n\n var endpoint = req.httpRequest.endpoint;\n var useArnRegion = req.service.config.s3UseArnRegion;\n var useFipsEndpoint = req.service.config.useFipsEndpoint;\n\n endpoint.hostname = [\n 's3-outposts' + (useFipsEndpoint ? '-fips': ''),\n useArnRegion ? parsedArn.region : req.service.config.region,\n 'amazonaws.com'\n ].join('.');\n endpoint.host = endpoint.hostname;\n },\n\n /**\n * @api private\n */\n populateEndpointForOutpostId: function populateEndpointForOutpostId(req) {\n var endpoint = req.httpRequest.endpoint;\n var useFipsEndpoint = req.service.config.useFipsEndpoint;\n endpoint.hostname = [\n 's3-outposts' + (useFipsEndpoint ? '-fips': ''),\n req.service.config.region,\n 'amazonaws.com'\n ].join('.');\n endpoint.host = endpoint.hostname;\n },\n\n /**\n * @api private\n */\n extractHostId: function(response) {\n var hostId = response.httpResponse.headers ? response.httpResponse.headers['x-amz-id-2'] : null;\n response.extendedRequestId = hostId;\n if (response.error) {\n response.error.extendedRequestId = hostId;\n }\n },\n\n /**\n * @api private\n */\n validateArnRegion: function validateArnRegion(req) {\n s3util.validateArnRegion(req, { allowFipsEndpoint: true });\n },\n\n /**\n * @api private\n */\n validateArnAccountWithParams: function validateArnAccountWithParams(req) {\n var params = req.params;\n var inputModel = req.service.api.operations[req.operation].input;\n if (inputModel.members.AccountId) {\n var parsedArn = req._parsedArn;\n if (parsedArn.accountId) {\n if (params.AccountId) {\n if (params.AccountId !== parsedArn.accountId) {\n throw AWS.util.error(\n new Error(),\n {code: 'ValidationError', message: 'AccountId in ARN and request params should be same.'}\n );\n }\n } else {\n // Store accountId from ARN in params\n params.AccountId = parsedArn.accountId;\n }\n }\n }\n },\n\n /**\n * @api private\n */\n validateAccountId: function(request) {\n var params = request.params;\n if (!Object.prototype.hasOwnProperty.call(params, 'AccountId')) return;\n var accountId = params.AccountId;\n //validate type\n if (typeof accountId !== 'string') {\n throw AWS.util.error(\n new Error(),\n {code: 'ValidationError', message: 'AccountId must be a string.'}\n );\n }\n //validate length\n if (accountId.length < 1 || accountId.length > 63) {\n throw AWS.util.error(\n new Error(),\n {code: 'ValidationError', message: 'AccountId length should be between 1 to 63 characters, inclusive.'}\n );\n }\n //validate pattern\n var hostPattern = /^[a-zA-Z0-9]{1}$|^[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9]$/;\n if (!hostPattern.test(accountId)) {\n throw AWS.util.error(new Error(),\n {code: 'ValidationError', message: 'AccountId should be hostname compatible. AccountId: ' + accountId});\n }\n },\n\n /**\n * @api private\n */\n getSigningName: function getSigningName(req) {\n var _super = AWS.Service.prototype.getSigningName;\n if (req && req._parsedArn && req._parsedArn.service) {\n return req._parsedArn.service;\n } else if (req.params.OutpostId &&\n (req.operation === 'createBucket' ||\n req.operation === 'listRegionalBuckets')) {\n return 's3-outposts';\n } else {\n return _super.call(this, req);\n }\n },\n});\n","var AWS = require('../core');\nvar regionUtil = require('../region_config');\n\nvar s3util = {\n /**\n * @api private\n */\n isArnInParam: function isArnInParam(req, paramName) {\n var inputShape = (req.service.api.operations[req.operation] || {}).input || {};\n var inputMembers = inputShape.members || {};\n if (!req.params[paramName] || !inputMembers[paramName]) return false;\n return AWS.util.ARN.validate(req.params[paramName]);\n },\n\n /**\n * Validate service component from ARN supplied in Bucket parameter\n */\n validateArnService: function validateArnService(req) {\n var parsedArn = req._parsedArn;\n\n if (parsedArn.service !== 's3'\n && parsedArn.service !== 's3-outposts'\n && parsedArn.service !== 's3-object-lambda') {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'expect \\'s3\\' or \\'s3-outposts\\' or \\'s3-object-lambda\\' in ARN service component'\n });\n }\n },\n\n /**\n * Validate account ID from ARN supplied in Bucket parameter is a valid account\n */\n validateArnAccount: function validateArnAccount(req) {\n var parsedArn = req._parsedArn;\n\n if (!/[0-9]{12}/.exec(parsedArn.accountId)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'ARN accountID does not match regex \"[0-9]{12}\"'\n });\n }\n },\n\n /**\n * Validate ARN supplied in Bucket parameter is a valid access point ARN\n */\n validateS3AccessPointArn: function validateS3AccessPointArn(req) {\n var parsedArn = req._parsedArn;\n\n //can be ':' or '/'\n var delimiter = parsedArn.resource['accesspoint'.length];\n\n if (parsedArn.resource.split(delimiter).length !== 2) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Access Point ARN should have one resource accesspoint/{accesspointName}'\n });\n }\n\n var accessPoint = parsedArn.resource.split(delimiter)[1];\n var accessPointPrefix = accessPoint + '-' + parsedArn.accountId;\n if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\\./)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint\n });\n }\n\n //set parsed valid access point\n req._parsedArn.accessPoint = accessPoint;\n },\n\n /**\n * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN\n */\n validateOutpostsArn: function validateOutpostsArn(req) {\n var parsedArn = req._parsedArn;\n\n if (\n parsedArn.resource.indexOf('outpost:') !== 0 &&\n parsedArn.resource.indexOf('outpost/') !== 0\n ) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'ARN resource should begin with \\'outpost/\\''\n });\n }\n\n //can be ':' or '/'\n var delimiter = parsedArn.resource['outpost'.length];\n var outpostId = parsedArn.resource.split(delimiter)[1];\n var dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);\n if (!dnsHostRegex.test(outpostId)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Outpost resource in ARN is not DNS compatible. Got ' + outpostId\n });\n }\n req._parsedArn.outpostId = outpostId;\n },\n\n /**\n * Validate Outposts ARN supplied in Bucket parameter is a valid outposts ARN\n */\n validateOutpostsAccessPointArn: function validateOutpostsAccessPointArn(req) {\n var parsedArn = req._parsedArn;\n\n //can be ':' or '/'\n var delimiter = parsedArn.resource['outpost'.length];\n\n if (parsedArn.resource.split(delimiter).length !== 4) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Outposts ARN should have two resources outpost/{outpostId}/accesspoint/{accesspointName}'\n });\n }\n\n var accessPoint = parsedArn.resource.split(delimiter)[3];\n var accessPointPrefix = accessPoint + '-' + parsedArn.accountId;\n if (!s3util.dnsCompatibleBucketName(accessPointPrefix) || accessPointPrefix.match(/\\./)) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: 'Access point resource in ARN is not DNS compatible. Got ' + accessPoint\n });\n }\n\n //set parsed valid access point\n req._parsedArn.accessPoint = accessPoint;\n },\n\n /**\n * Validate region field in ARN supplied in Bucket parameter is a valid region\n */\n validateArnRegion: function validateArnRegion(req, options) {\n if (options === undefined) {\n options = {};\n }\n\n var useArnRegion = s3util.loadUseArnRegionConfig(req);\n var regionFromArn = req._parsedArn.region;\n var clientRegion = req.service.config.region;\n var useFipsEndpoint = req.service.config.useFipsEndpoint;\n var allowFipsEndpoint = options.allowFipsEndpoint || false;\n\n if (!regionFromArn) {\n var message = 'ARN region is empty';\n if (req._parsedArn.service === 's3') {\n message = message + '\\nYou may want to use multi-regional ARN. The feature is not supported in current SDK. ' +\n 'You should consider switching to V3(https://github.com/aws/aws-sdk-js-v3).';\n }\n throw AWS.util.error(new Error(), {\n code: 'InvalidARN',\n message: message\n });\n }\n\n if (useFipsEndpoint && !allowFipsEndpoint) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'ARN endpoint is not compatible with FIPS region'\n });\n }\n\n if (regionFromArn.indexOf('fips') >= 0) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'FIPS region not allowed in ARN'\n });\n }\n\n if (!useArnRegion && regionFromArn !== clientRegion) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Configured region conflicts with access point region'\n });\n } else if (\n useArnRegion &&\n regionUtil.getEndpointSuffix(regionFromArn) !== regionUtil.getEndpointSuffix(clientRegion)\n ) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Configured region and access point region not in same partition'\n });\n }\n\n if (req.service.config.useAccelerateEndpoint) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'useAccelerateEndpoint config is not supported with access point ARN'\n });\n }\n\n if (req._parsedArn.service === 's3-outposts' && req.service.config.useDualstackEndpoint) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Dualstack is not supported with outposts access point ARN'\n });\n }\n },\n\n loadUseArnRegionConfig: function loadUseArnRegionConfig(req) {\n var envName = 'AWS_S3_USE_ARN_REGION';\n var configName = 's3_use_arn_region';\n var useArnRegion = true;\n var originalConfig = req.service._originalConfig || {};\n if (req.service.config.s3UseArnRegion !== undefined) {\n return req.service.config.s3UseArnRegion;\n } else if (originalConfig.s3UseArnRegion !== undefined) {\n useArnRegion = originalConfig.s3UseArnRegion === true;\n } else if (AWS.util.isNode()) {\n //load from environmental variable AWS_USE_ARN_REGION\n if (process.env[envName]) {\n var value = process.env[envName].trim().toLowerCase();\n if (['false', 'true'].indexOf(value) < 0) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: envName + ' only accepts true or false. Got ' + process.env[envName],\n retryable: false\n });\n }\n useArnRegion = value === 'true';\n } else { //load from shared config property use_arn_region\n var profiles = {};\n var profile = {};\n try {\n profiles = AWS.util.getProfilesFromSharedConfig(AWS.util.iniLoader);\n profile = profiles[process.env.AWS_PROFILE || AWS.util.defaultProfile];\n } catch (e) {}\n if (profile[configName]) {\n if (['false', 'true'].indexOf(profile[configName].trim().toLowerCase()) < 0) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: configName + ' only accepts true or false. Got ' + profile[configName],\n retryable: false\n });\n }\n useArnRegion = profile[configName].trim().toLowerCase() === 'true';\n }\n }\n }\n req.service.config.s3UseArnRegion = useArnRegion;\n return useArnRegion;\n },\n\n /**\n * Validations before URI can be populated\n */\n validatePopulateUriFromArn: function validatePopulateUriFromArn(req) {\n if (req.service._originalConfig && req.service._originalConfig.endpoint) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Custom endpoint is not compatible with access point ARN'\n });\n }\n\n if (req.service.config.s3ForcePathStyle) {\n throw AWS.util.error(new Error(), {\n code: 'InvalidConfiguration',\n message: 'Cannot construct path-style endpoint with access point'\n });\n }\n },\n\n /**\n * Returns true if the bucket name is DNS compatible. Buckets created\n * outside of the classic region MUST be DNS compatible.\n *\n * @api private\n */\n dnsCompatibleBucketName: function dnsCompatibleBucketName(bucketName) {\n var b = bucketName;\n var domain = new RegExp(/^[a-z0-9][a-z0-9\\.\\-]{1,61}[a-z0-9]$/);\n var ipAddress = new RegExp(/(\\d+\\.){3}\\d+/);\n var dots = new RegExp(/\\.\\./);\n return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false;\n },\n};\n\n/**\n * @api private\n */\nmodule.exports = s3util;\n","var AWS = require('../core');\n\nAWS.util.update(AWS.SQS.prototype, {\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('build', this.buildEndpoint);\n\n if (request.service.config.computeChecksums) {\n if (request.operation === 'sendMessage') {\n request.addListener('extractData', this.verifySendMessageChecksum);\n } else if (request.operation === 'sendMessageBatch') {\n request.addListener('extractData', this.verifySendMessageBatchChecksum);\n } else if (request.operation === 'receiveMessage') {\n request.addListener('extractData', this.verifyReceiveMessageChecksum);\n }\n }\n },\n\n /**\n * @api private\n */\n verifySendMessageChecksum: function verifySendMessageChecksum(response) {\n if (!response.data) return;\n\n var md5 = response.data.MD5OfMessageBody;\n var body = this.params.MessageBody;\n var calculatedMd5 = this.service.calculateChecksum(body);\n if (calculatedMd5 !== md5) {\n var msg = 'Got \"' + response.data.MD5OfMessageBody +\n '\", expecting \"' + calculatedMd5 + '\".';\n this.service.throwInvalidChecksumError(response,\n [response.data.MessageId], msg);\n }\n },\n\n /**\n * @api private\n */\n verifySendMessageBatchChecksum: function verifySendMessageBatchChecksum(response) {\n if (!response.data) return;\n\n var service = this.service;\n var entries = {};\n var errors = [];\n var messageIds = [];\n AWS.util.arrayEach(response.data.Successful, function (entry) {\n entries[entry.Id] = entry;\n });\n AWS.util.arrayEach(this.params.Entries, function (entry) {\n if (entries[entry.Id]) {\n var md5 = entries[entry.Id].MD5OfMessageBody;\n var body = entry.MessageBody;\n if (!service.isChecksumValid(md5, body)) {\n errors.push(entry.Id);\n messageIds.push(entries[entry.Id].MessageId);\n }\n }\n });\n\n if (errors.length > 0) {\n service.throwInvalidChecksumError(response, messageIds,\n 'Invalid messages: ' + errors.join(', '));\n }\n },\n\n /**\n * @api private\n */\n verifyReceiveMessageChecksum: function verifyReceiveMessageChecksum(response) {\n if (!response.data) return;\n\n var service = this.service;\n var messageIds = [];\n AWS.util.arrayEach(response.data.Messages, function(message) {\n var md5 = message.MD5OfBody;\n var body = message.Body;\n if (!service.isChecksumValid(md5, body)) {\n messageIds.push(message.MessageId);\n }\n });\n\n if (messageIds.length > 0) {\n service.throwInvalidChecksumError(response, messageIds,\n 'Invalid messages: ' + messageIds.join(', '));\n }\n },\n\n /**\n * @api private\n */\n throwInvalidChecksumError: function throwInvalidChecksumError(response, ids, message) {\n response.error = AWS.util.error(new Error(), {\n retryable: true,\n code: 'InvalidChecksum',\n messageIds: ids,\n message: response.request.operation +\n ' returned an invalid MD5 response. ' + message\n });\n },\n\n /**\n * @api private\n */\n isChecksumValid: function isChecksumValid(checksum, data) {\n return this.calculateChecksum(data) === checksum;\n },\n\n /**\n * @api private\n */\n calculateChecksum: function calculateChecksum(data) {\n return AWS.util.crypto.md5(data, 'hex');\n },\n\n /**\n * @api private\n */\n buildEndpoint: function buildEndpoint(request) {\n var url = request.httpRequest.params.QueueUrl;\n if (url) {\n request.httpRequest.endpoint = new AWS.Endpoint(url);\n\n // signature version 4 requires the region name to be set,\n // sqs queue urls contain the region name\n var matches = request.httpRequest.endpoint.host.match(/^sqs\\.(.+?)\\./);\n if (matches) request.httpRequest.region = matches[1];\n }\n }\n});\n","var AWS = require('../core');\nvar resolveRegionalEndpointsFlag = require('../config_regional_endpoint');\nvar ENV_REGIONAL_ENDPOINT_ENABLED = 'AWS_STS_REGIONAL_ENDPOINTS';\nvar CONFIG_REGIONAL_ENDPOINT_ENABLED = 'sts_regional_endpoints';\n\nAWS.util.update(AWS.STS.prototype, {\n /**\n * @overload credentialsFrom(data, credentials = null)\n * Creates a credentials object from STS response data containing\n * credentials information. Useful for quickly setting AWS credentials.\n *\n * @note This is a low-level utility function. If you want to load temporary\n * credentials into your process for subsequent requests to AWS resources,\n * you should use {AWS.TemporaryCredentials} instead.\n * @param data [map] data retrieved from a call to {getFederatedToken},\n * {getSessionToken}, {assumeRole}, or {assumeRoleWithWebIdentity}.\n * @param credentials [AWS.Credentials] an optional credentials object to\n * fill instead of creating a new object. Useful when modifying an\n * existing credentials object from a refresh call.\n * @return [AWS.TemporaryCredentials] the set of temporary credentials\n * loaded from a raw STS operation response.\n * @example Using credentialsFrom to load global AWS credentials\n * var sts = new AWS.STS();\n * sts.getSessionToken(function (err, data) {\n * if (err) console.log(\"Error getting credentials\");\n * else {\n * AWS.config.credentials = sts.credentialsFrom(data);\n * }\n * });\n * @see AWS.TemporaryCredentials\n */\n credentialsFrom: function credentialsFrom(data, credentials) {\n if (!data) return null;\n if (!credentials) credentials = new AWS.TemporaryCredentials();\n credentials.expired = false;\n credentials.accessKeyId = data.Credentials.AccessKeyId;\n credentials.secretAccessKey = data.Credentials.SecretAccessKey;\n credentials.sessionToken = data.Credentials.SessionToken;\n credentials.expireTime = data.Credentials.Expiration;\n return credentials;\n },\n\n assumeRoleWithWebIdentity: function assumeRoleWithWebIdentity(params, callback) {\n return this.makeUnauthenticatedRequest('assumeRoleWithWebIdentity', params, callback);\n },\n\n assumeRoleWithSAML: function assumeRoleWithSAML(params, callback) {\n return this.makeUnauthenticatedRequest('assumeRoleWithSAML', params, callback);\n },\n\n /**\n * @api private\n */\n setupRequestListeners: function setupRequestListeners(request) {\n request.addListener('validate', this.optInRegionalEndpoint, true);\n },\n\n /**\n * @api private\n */\n optInRegionalEndpoint: function optInRegionalEndpoint(req) {\n var service = req.service;\n var config = service.config;\n config.stsRegionalEndpoints = resolveRegionalEndpointsFlag(service._originalConfig, {\n env: ENV_REGIONAL_ENDPOINT_ENABLED,\n sharedConfig: CONFIG_REGIONAL_ENDPOINT_ENABLED,\n clientConfig: 'stsRegionalEndpoints'\n });\n if (\n config.stsRegionalEndpoints === 'regional' &&\n service.isGlobalEndpoint\n ) {\n //client will throw if region is not supplied; request will be signed with specified region\n if (!config.region) {\n throw AWS.util.error(new Error(),\n {code: 'ConfigError', message: 'Missing region in config'});\n }\n var insertPoint = config.endpoint.indexOf('.amazonaws.com');\n var regionalEndpoint = config.endpoint.substring(0, insertPoint) +\n '.' + config.region + config.endpoint.substring(insertPoint);\n req.httpRequest.updateEndpoint(regionalEndpoint);\n req.httpRequest.region = config.region;\n }\n }\n\n});\n","var AWS = require('../core');\n\nAWS.util.hideProperties(AWS, ['SimpleWorkflow']);\n\n/**\n * @constant\n * @readonly\n * Backwards compatibility for access to the {AWS.SWF} service class.\n */\nAWS.SimpleWorkflow = AWS.SWF;\n","var IniLoader = require('./ini-loader').IniLoader;\n/**\n * Singleton object to load specified config/credentials files.\n * It will cache all the files ever loaded;\n */\nmodule.exports.iniLoader = new IniLoader();\n","var AWS = require('../core');\nvar os = require('os');\nvar path = require('path');\n\nfunction parseFile(filename) {\n return AWS.util.ini.parse(AWS.util.readFileSync(filename));\n}\n\nfunction getProfiles(fileContent) {\n var tmpContent = {};\n Object.keys(fileContent).forEach(function(sectionName) {\n if (/^sso-session\\s/.test(sectionName)) return;\n Object.defineProperty(tmpContent, sectionName.replace(/^profile\\s/, ''), {\n value: fileContent[sectionName],\n enumerable: true\n });\n });\n return tmpContent;\n}\n\nfunction getSsoSessions(fileContent) {\n var tmpContent = {};\n Object.keys(fileContent).forEach(function(sectionName) {\n if (!/^sso-session\\s/.test(sectionName)) return;\n Object.defineProperty(tmpContent, sectionName.replace(/^sso-session\\s/, ''), {\n value: fileContent[sectionName],\n enumerable: true\n });\n });\n return tmpContent;\n}\n\n/**\n * Ini file loader class the same as that used in the SDK. It loads and\n * parses config and credentials files in .ini format and cache the content\n * to assure files are only read once.\n * Note that calling operations on the instance instantiated from this class\n * won't affect the behavior of SDK since SDK uses an internal singleton of\n * this class.\n * @!macro nobrowser\n */\nAWS.IniLoader = AWS.util.inherit({\n constructor: function IniLoader() {\n this.resolvedProfiles = {};\n this.resolvedSsoSessions = {};\n },\n\n /** Remove all cached files. Used after config files are updated. */\n clearCachedFiles: function clearCachedFiles() {\n this.resolvedProfiles = {};\n this.resolvedSsoSessions = {};\n },\n\n /**\n * Load configurations from config/credentials files and cache them\n * for later use. If no file is specified it will try to load default files.\n *\n * @param options [map] information describing the file\n * @option options filename [String] ('~/.aws/credentials' or defined by\n * AWS_SHARED_CREDENTIALS_FILE process env var or '~/.aws/config' if\n * isConfig is set to true)\n * path to the file to be read.\n * @option options isConfig [Boolean] (false) True to read config file.\n * @return [map] object containing contents from file in key-value\n * pairs.\n */\n loadFrom: function loadFrom(options) {\n options = options || {};\n var isConfig = options.isConfig === true;\n var filename = options.filename || this.getDefaultFilePath(isConfig);\n if (!this.resolvedProfiles[filename]) {\n var fileContent = parseFile(filename);\n if (isConfig) {\n Object.defineProperty(this.resolvedProfiles, filename, {\n value: getProfiles(fileContent)\n });\n } else {\n Object.defineProperty(this.resolvedProfiles, filename, { value: fileContent });\n }\n }\n return this.resolvedProfiles[filename];\n },\n\n /**\n * Load sso sessions from config/credentials files and cache them\n * for later use. If no file is specified it will try to load default file.\n *\n * @param options [map] information describing the file\n * @option options filename [String] ('~/.aws/config' or defined by\n * AWS_CONFIG_FILE process env var)\n * @return [map] object containing contents from file in key-value\n * pairs.\n */\n loadSsoSessionsFrom: function loadSsoSessionsFrom(options) {\n options = options || {};\n var filename = options.filename || this.getDefaultFilePath(true);\n if (!this.resolvedSsoSessions[filename]) {\n var fileContent = parseFile(filename);\n Object.defineProperty(this.resolvedSsoSessions, filename, {\n value: getSsoSessions(fileContent)\n });\n }\n return this.resolvedSsoSessions[filename];\n },\n\n /**\n * @api private\n */\n getDefaultFilePath: function getDefaultFilePath(isConfig) {\n return path.join(\n this.getHomeDir(),\n '.aws',\n isConfig ? 'config' : 'credentials'\n );\n },\n\n /**\n * @api private\n */\n getHomeDir: function getHomeDir() {\n var env = process.env;\n var home = env.HOME ||\n env.USERPROFILE ||\n (env.HOMEPATH ? ((env.HOMEDRIVE || 'C:/') + env.HOMEPATH) : null);\n\n if (home) {\n return home;\n }\n\n if (typeof os.homedir === 'function') {\n return os.homedir();\n }\n\n throw AWS.util.error(\n new Error('Cannot load credentials, HOME path not set')\n );\n }\n});\n\nvar IniLoader = AWS.IniLoader;\n\nmodule.exports = {\n IniLoader: IniLoader\n};\n","var AWS = require('../core');\n\n/**\n * @api private\n */\nAWS.Signers.Bearer = AWS.util.inherit(AWS.Signers.RequestSigner, {\n constructor: function Bearer(request) {\n AWS.Signers.RequestSigner.call(this, request);\n },\n\n addAuthorization: function addAuthorization(token) {\n this.request.headers['Authorization'] = 'Bearer ' + token.token;\n }\n});\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nvar expiresHeader = 'presigned-expires';\n\n/**\n * @api private\n */\nfunction signedUrlBuilder(request) {\n var expires = request.httpRequest.headers[expiresHeader];\n var signerClass = request.service.getSignerClass(request);\n\n delete request.httpRequest.headers['User-Agent'];\n delete request.httpRequest.headers['X-Amz-User-Agent'];\n\n if (signerClass === AWS.Signers.V4) {\n if (expires > 604800) { // one week expiry is invalid\n var message = 'Presigning does not support expiry time greater ' +\n 'than a week with SigV4 signing.';\n throw AWS.util.error(new Error(), {\n code: 'InvalidExpiryTime', message: message, retryable: false\n });\n }\n request.httpRequest.headers[expiresHeader] = expires;\n } else if (signerClass === AWS.Signers.S3) {\n var now = request.service ? request.service.getSkewCorrectedDate() : AWS.util.date.getDate();\n request.httpRequest.headers[expiresHeader] = parseInt(\n AWS.util.date.unixTimestamp(now) + expires, 10).toString();\n } else {\n throw AWS.util.error(new Error(), {\n message: 'Presigning only supports S3 or SigV4 signing.',\n code: 'UnsupportedSigner', retryable: false\n });\n }\n}\n\n/**\n * @api private\n */\nfunction signedUrlSigner(request) {\n var endpoint = request.httpRequest.endpoint;\n var parsedUrl = AWS.util.urlParse(request.httpRequest.path);\n var queryParams = {};\n\n if (parsedUrl.search) {\n queryParams = AWS.util.queryStringParse(parsedUrl.search.substr(1));\n }\n\n var auth = request.httpRequest.headers['Authorization'].split(' ');\n if (auth[0] === 'AWS') {\n auth = auth[1].split(':');\n queryParams['Signature'] = auth.pop();\n queryParams['AWSAccessKeyId'] = auth.join(':');\n\n AWS.util.each(request.httpRequest.headers, function (key, value) {\n if (key === expiresHeader) key = 'Expires';\n if (key.indexOf('x-amz-meta-') === 0) {\n // Delete existing, potentially not normalized key\n delete queryParams[key];\n key = key.toLowerCase();\n }\n queryParams[key] = value;\n });\n delete request.httpRequest.headers[expiresHeader];\n delete queryParams['Authorization'];\n delete queryParams['Host'];\n } else if (auth[0] === 'AWS4-HMAC-SHA256') { // SigV4 signing\n auth.shift();\n var rest = auth.join(' ');\n var signature = rest.match(/Signature=(.*?)(?:,|\\s|\\r?\\n|$)/)[1];\n queryParams['X-Amz-Signature'] = signature;\n delete queryParams['Expires'];\n }\n\n // build URL\n endpoint.pathname = parsedUrl.pathname;\n endpoint.search = AWS.util.queryParamsToString(queryParams);\n}\n\n/**\n * @api private\n */\nAWS.Signers.Presign = inherit({\n /**\n * @api private\n */\n sign: function sign(request, expireTime, callback) {\n request.httpRequest.headers[expiresHeader] = expireTime || 3600;\n request.on('build', signedUrlBuilder);\n request.on('sign', signedUrlSigner);\n request.removeListener('afterBuild',\n AWS.EventListeners.Core.SET_CONTENT_LENGTH);\n request.removeListener('afterBuild',\n AWS.EventListeners.Core.COMPUTE_SHA256);\n\n request.emit('beforePresign', [request]);\n\n if (callback) {\n request.build(function() {\n if (this.response.error) callback(this.response.error);\n else {\n callback(null, AWS.util.urlFormat(request.httpRequest.endpoint));\n }\n });\n } else {\n request.build();\n if (request.response.error) throw request.response.error;\n return AWS.util.urlFormat(request.httpRequest.endpoint);\n }\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.Presign;\n","var AWS = require('../core');\n\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nAWS.Signers.RequestSigner = inherit({\n constructor: function RequestSigner(request) {\n this.request = request;\n },\n\n setServiceClientId: function setServiceClientId(id) {\n this.serviceClientId = id;\n },\n\n getServiceClientId: function getServiceClientId() {\n return this.serviceClientId;\n }\n});\n\nAWS.Signers.RequestSigner.getVersion = function getVersion(version) {\n switch (version) {\n case 'v2': return AWS.Signers.V2;\n case 'v3': return AWS.Signers.V3;\n case 's3v4': return AWS.Signers.V4;\n case 'v4': return AWS.Signers.V4;\n case 's3': return AWS.Signers.S3;\n case 'v3https': return AWS.Signers.V3Https;\n case 'bearer': return AWS.Signers.Bearer;\n }\n throw new Error('Unknown signing version ' + version);\n};\n\nrequire('./v2');\nrequire('./v3');\nrequire('./v3https');\nrequire('./v4');\nrequire('./s3');\nrequire('./presign');\nrequire('./bearer');\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nAWS.Signers.S3 = inherit(AWS.Signers.RequestSigner, {\n /**\n * When building the stringToSign, these sub resource params should be\n * part of the canonical resource string with their NON-decoded values\n */\n subResources: {\n 'acl': 1,\n 'accelerate': 1,\n 'analytics': 1,\n 'cors': 1,\n 'lifecycle': 1,\n 'delete': 1,\n 'inventory': 1,\n 'location': 1,\n 'logging': 1,\n 'metrics': 1,\n 'notification': 1,\n 'partNumber': 1,\n 'policy': 1,\n 'requestPayment': 1,\n 'replication': 1,\n 'restore': 1,\n 'tagging': 1,\n 'torrent': 1,\n 'uploadId': 1,\n 'uploads': 1,\n 'versionId': 1,\n 'versioning': 1,\n 'versions': 1,\n 'website': 1\n },\n\n // when building the stringToSign, these querystring params should be\n // part of the canonical resource string with their NON-encoded values\n responseHeaders: {\n 'response-content-type': 1,\n 'response-content-language': 1,\n 'response-expires': 1,\n 'response-cache-control': 1,\n 'response-content-disposition': 1,\n 'response-content-encoding': 1\n },\n\n addAuthorization: function addAuthorization(credentials, date) {\n if (!this.request.headers['presigned-expires']) {\n this.request.headers['X-Amz-Date'] = AWS.util.date.rfc822(date);\n }\n\n if (credentials.sessionToken) {\n // presigned URLs require this header to be lowercased\n this.request.headers['x-amz-security-token'] = credentials.sessionToken;\n }\n\n var signature = this.sign(credentials.secretAccessKey, this.stringToSign());\n var auth = 'AWS ' + credentials.accessKeyId + ':' + signature;\n\n this.request.headers['Authorization'] = auth;\n },\n\n stringToSign: function stringToSign() {\n var r = this.request;\n\n var parts = [];\n parts.push(r.method);\n parts.push(r.headers['Content-MD5'] || '');\n parts.push(r.headers['Content-Type'] || '');\n\n // This is the \"Date\" header, but we use X-Amz-Date.\n // The S3 signing mechanism requires us to pass an empty\n // string for this Date header regardless.\n parts.push(r.headers['presigned-expires'] || '');\n\n var headers = this.canonicalizedAmzHeaders();\n if (headers) parts.push(headers);\n parts.push(this.canonicalizedResource());\n\n return parts.join('\\n');\n\n },\n\n canonicalizedAmzHeaders: function canonicalizedAmzHeaders() {\n\n var amzHeaders = [];\n\n AWS.util.each(this.request.headers, function (name) {\n if (name.match(/^x-amz-/i))\n amzHeaders.push(name);\n });\n\n amzHeaders.sort(function (a, b) {\n return a.toLowerCase() < b.toLowerCase() ? -1 : 1;\n });\n\n var parts = [];\n AWS.util.arrayEach.call(this, amzHeaders, function (name) {\n parts.push(name.toLowerCase() + ':' + String(this.request.headers[name]));\n });\n\n return parts.join('\\n');\n\n },\n\n canonicalizedResource: function canonicalizedResource() {\n\n var r = this.request;\n\n var parts = r.path.split('?');\n var path = parts[0];\n var querystring = parts[1];\n\n var resource = '';\n\n if (r.virtualHostedBucket)\n resource += '/' + r.virtualHostedBucket;\n\n resource += path;\n\n if (querystring) {\n\n // collect a list of sub resources and query params that need to be signed\n var resources = [];\n\n AWS.util.arrayEach.call(this, querystring.split('&'), function (param) {\n var name = param.split('=')[0];\n var value = param.split('=')[1];\n if (this.subResources[name] || this.responseHeaders[name]) {\n var subresource = { name: name };\n if (value !== undefined) {\n if (this.subResources[name]) {\n subresource.value = value;\n } else {\n subresource.value = decodeURIComponent(value);\n }\n }\n resources.push(subresource);\n }\n });\n\n resources.sort(function (a, b) { return a.name < b.name ? -1 : 1; });\n\n if (resources.length) {\n\n querystring = [];\n AWS.util.arrayEach(resources, function (res) {\n if (res.value === undefined) {\n querystring.push(res.name);\n } else {\n querystring.push(res.name + '=' + res.value);\n }\n });\n\n resource += '?' + querystring.join('&');\n }\n\n }\n\n return resource;\n\n },\n\n sign: function sign(secret, string) {\n return AWS.util.crypto.hmac(secret, string, 'base64', 'sha1');\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.S3;\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nAWS.Signers.V2 = inherit(AWS.Signers.RequestSigner, {\n addAuthorization: function addAuthorization(credentials, date) {\n\n if (!date) date = AWS.util.date.getDate();\n\n var r = this.request;\n\n r.params.Timestamp = AWS.util.date.iso8601(date);\n r.params.SignatureVersion = '2';\n r.params.SignatureMethod = 'HmacSHA256';\n r.params.AWSAccessKeyId = credentials.accessKeyId;\n\n if (credentials.sessionToken) {\n r.params.SecurityToken = credentials.sessionToken;\n }\n\n delete r.params.Signature; // delete old Signature for re-signing\n r.params.Signature = this.signature(credentials);\n\n r.body = AWS.util.queryParamsToString(r.params);\n r.headers['Content-Length'] = r.body.length;\n },\n\n signature: function signature(credentials) {\n return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64');\n },\n\n stringToSign: function stringToSign() {\n var parts = [];\n parts.push(this.request.method);\n parts.push(this.request.endpoint.host.toLowerCase());\n parts.push(this.request.pathname());\n parts.push(AWS.util.queryParamsToString(this.request.params));\n return parts.join('\\n');\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.V2;\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nAWS.Signers.V3 = inherit(AWS.Signers.RequestSigner, {\n addAuthorization: function addAuthorization(credentials, date) {\n\n var datetime = AWS.util.date.rfc822(date);\n\n this.request.headers['X-Amz-Date'] = datetime;\n\n if (credentials.sessionToken) {\n this.request.headers['x-amz-security-token'] = credentials.sessionToken;\n }\n\n this.request.headers['X-Amzn-Authorization'] =\n this.authorization(credentials, datetime);\n\n },\n\n authorization: function authorization(credentials) {\n return 'AWS3 ' +\n 'AWSAccessKeyId=' + credentials.accessKeyId + ',' +\n 'Algorithm=HmacSHA256,' +\n 'SignedHeaders=' + this.signedHeaders() + ',' +\n 'Signature=' + this.signature(credentials);\n },\n\n signedHeaders: function signedHeaders() {\n var headers = [];\n AWS.util.arrayEach(this.headersToSign(), function iterator(h) {\n headers.push(h.toLowerCase());\n });\n return headers.sort().join(';');\n },\n\n canonicalHeaders: function canonicalHeaders() {\n var headers = this.request.headers;\n var parts = [];\n AWS.util.arrayEach(this.headersToSign(), function iterator(h) {\n parts.push(h.toLowerCase().trim() + ':' + String(headers[h]).trim());\n });\n return parts.sort().join('\\n') + '\\n';\n },\n\n headersToSign: function headersToSign() {\n var headers = [];\n AWS.util.each(this.request.headers, function iterator(k) {\n if (k === 'Host' || k === 'Content-Encoding' || k.match(/^X-Amz/i)) {\n headers.push(k);\n }\n });\n return headers;\n },\n\n signature: function signature(credentials) {\n return AWS.util.crypto.hmac(credentials.secretAccessKey, this.stringToSign(), 'base64');\n },\n\n stringToSign: function stringToSign() {\n var parts = [];\n parts.push(this.request.method);\n parts.push('/');\n parts.push('');\n parts.push(this.canonicalHeaders());\n parts.push(this.request.body);\n return AWS.util.crypto.sha256(parts.join('\\n'));\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.V3;\n","var AWS = require('../core');\nvar inherit = AWS.util.inherit;\n\nrequire('./v3');\n\n/**\n * @api private\n */\nAWS.Signers.V3Https = inherit(AWS.Signers.V3, {\n authorization: function authorization(credentials) {\n return 'AWS3-HTTPS ' +\n 'AWSAccessKeyId=' + credentials.accessKeyId + ',' +\n 'Algorithm=HmacSHA256,' +\n 'Signature=' + this.signature(credentials);\n },\n\n stringToSign: function stringToSign() {\n return this.request.headers['X-Amz-Date'];\n }\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.V3Https;\n","var AWS = require('../core');\nvar v4Credentials = require('./v4_credentials');\nvar inherit = AWS.util.inherit;\n\n/**\n * @api private\n */\nvar expiresHeader = 'presigned-expires';\n\n/**\n * @api private\n */\nAWS.Signers.V4 = inherit(AWS.Signers.RequestSigner, {\n constructor: function V4(request, serviceName, options) {\n AWS.Signers.RequestSigner.call(this, request);\n this.serviceName = serviceName;\n options = options || {};\n this.signatureCache = typeof options.signatureCache === 'boolean' ? options.signatureCache : true;\n this.operation = options.operation;\n this.signatureVersion = options.signatureVersion;\n },\n\n algorithm: 'AWS4-HMAC-SHA256',\n\n addAuthorization: function addAuthorization(credentials, date) {\n var datetime = AWS.util.date.iso8601(date).replace(/[:\\-]|\\.\\d{3}/g, '');\n\n if (this.isPresigned()) {\n this.updateForPresigned(credentials, datetime);\n } else {\n this.addHeaders(credentials, datetime);\n }\n\n this.request.headers['Authorization'] =\n this.authorization(credentials, datetime);\n },\n\n addHeaders: function addHeaders(credentials, datetime) {\n this.request.headers['X-Amz-Date'] = datetime;\n if (credentials.sessionToken) {\n this.request.headers['x-amz-security-token'] = credentials.sessionToken;\n }\n },\n\n updateForPresigned: function updateForPresigned(credentials, datetime) {\n var credString = this.credentialString(datetime);\n var qs = {\n 'X-Amz-Date': datetime,\n 'X-Amz-Algorithm': this.algorithm,\n 'X-Amz-Credential': credentials.accessKeyId + '/' + credString,\n 'X-Amz-Expires': this.request.headers[expiresHeader],\n 'X-Amz-SignedHeaders': this.signedHeaders()\n };\n\n if (credentials.sessionToken) {\n qs['X-Amz-Security-Token'] = credentials.sessionToken;\n }\n\n if (this.request.headers['Content-Type']) {\n qs['Content-Type'] = this.request.headers['Content-Type'];\n }\n if (this.request.headers['Content-MD5']) {\n qs['Content-MD5'] = this.request.headers['Content-MD5'];\n }\n if (this.request.headers['Cache-Control']) {\n qs['Cache-Control'] = this.request.headers['Cache-Control'];\n }\n\n // need to pull in any other X-Amz-* headers\n AWS.util.each.call(this, this.request.headers, function(key, value) {\n if (key === expiresHeader) return;\n if (this.isSignableHeader(key)) {\n var lowerKey = key.toLowerCase();\n // Metadata should be normalized\n if (lowerKey.indexOf('x-amz-meta-') === 0) {\n qs[lowerKey] = value;\n } else if (lowerKey.indexOf('x-amz-') === 0) {\n qs[key] = value;\n }\n }\n });\n\n var sep = this.request.path.indexOf('?') >= 0 ? '&' : '?';\n this.request.path += sep + AWS.util.queryParamsToString(qs);\n },\n\n authorization: function authorization(credentials, datetime) {\n var parts = [];\n var credString = this.credentialString(datetime);\n parts.push(this.algorithm + ' Credential=' +\n credentials.accessKeyId + '/' + credString);\n parts.push('SignedHeaders=' + this.signedHeaders());\n parts.push('Signature=' + this.signature(credentials, datetime));\n return parts.join(', ');\n },\n\n signature: function signature(credentials, datetime) {\n var signingKey = v4Credentials.getSigningKey(\n credentials,\n datetime.substr(0, 8),\n this.request.region,\n this.serviceName,\n this.signatureCache\n );\n return AWS.util.crypto.hmac(signingKey, this.stringToSign(datetime), 'hex');\n },\n\n stringToSign: function stringToSign(datetime) {\n var parts = [];\n parts.push('AWS4-HMAC-SHA256');\n parts.push(datetime);\n parts.push(this.credentialString(datetime));\n parts.push(this.hexEncodedHash(this.canonicalString()));\n return parts.join('\\n');\n },\n\n canonicalString: function canonicalString() {\n var parts = [], pathname = this.request.pathname();\n if (this.serviceName !== 's3' && this.signatureVersion !== 's3v4') pathname = AWS.util.uriEscapePath(pathname);\n\n parts.push(this.request.method);\n parts.push(pathname);\n parts.push(this.request.search());\n parts.push(this.canonicalHeaders() + '\\n');\n parts.push(this.signedHeaders());\n parts.push(this.hexEncodedBodyHash());\n return parts.join('\\n');\n },\n\n canonicalHeaders: function canonicalHeaders() {\n var headers = [];\n AWS.util.each.call(this, this.request.headers, function (key, item) {\n headers.push([key, item]);\n });\n headers.sort(function (a, b) {\n return a[0].toLowerCase() < b[0].toLowerCase() ? -1 : 1;\n });\n var parts = [];\n AWS.util.arrayEach.call(this, headers, function (item) {\n var key = item[0].toLowerCase();\n if (this.isSignableHeader(key)) {\n var value = item[1];\n if (typeof value === 'undefined' || value === null || typeof value.toString !== 'function') {\n throw AWS.util.error(new Error('Header ' + key + ' contains invalid value'), {\n code: 'InvalidHeader'\n });\n }\n parts.push(key + ':' +\n this.canonicalHeaderValues(value.toString()));\n }\n });\n return parts.join('\\n');\n },\n\n canonicalHeaderValues: function canonicalHeaderValues(values) {\n return values.replace(/\\s+/g, ' ').replace(/^\\s+|\\s+$/g, '');\n },\n\n signedHeaders: function signedHeaders() {\n var keys = [];\n AWS.util.each.call(this, this.request.headers, function (key) {\n key = key.toLowerCase();\n if (this.isSignableHeader(key)) keys.push(key);\n });\n return keys.sort().join(';');\n },\n\n credentialString: function credentialString(datetime) {\n return v4Credentials.createScope(\n datetime.substr(0, 8),\n this.request.region,\n this.serviceName\n );\n },\n\n hexEncodedHash: function hash(string) {\n return AWS.util.crypto.sha256(string, 'hex');\n },\n\n hexEncodedBodyHash: function hexEncodedBodyHash() {\n var request = this.request;\n if (this.isPresigned() && (['s3', 's3-object-lambda'].indexOf(this.serviceName) > -1) && !request.body) {\n return 'UNSIGNED-PAYLOAD';\n } else if (request.headers['X-Amz-Content-Sha256']) {\n return request.headers['X-Amz-Content-Sha256'];\n } else {\n return this.hexEncodedHash(this.request.body || '');\n }\n },\n\n unsignableHeaders: [\n 'authorization',\n 'content-type',\n 'content-length',\n 'user-agent',\n expiresHeader,\n 'expect',\n 'x-amzn-trace-id'\n ],\n\n isSignableHeader: function isSignableHeader(key) {\n if (key.toLowerCase().indexOf('x-amz-') === 0) return true;\n return this.unsignableHeaders.indexOf(key) < 0;\n },\n\n isPresigned: function isPresigned() {\n return this.request.headers[expiresHeader] ? true : false;\n }\n\n});\n\n/**\n * @api private\n */\nmodule.exports = AWS.Signers.V4;\n","var AWS = require('../core');\n\n/**\n * @api private\n */\nvar cachedSecret = {};\n\n/**\n * @api private\n */\nvar cacheQueue = [];\n\n/**\n * @api private\n */\nvar maxCacheEntries = 50;\n\n/**\n * @api private\n */\nvar v4Identifier = 'aws4_request';\n\n/**\n * @api private\n */\nmodule.exports = {\n /**\n * @api private\n *\n * @param date [String]\n * @param region [String]\n * @param serviceName [String]\n * @return [String]\n */\n createScope: function createScope(date, region, serviceName) {\n return [\n date.substr(0, 8),\n region,\n serviceName,\n v4Identifier\n ].join('/');\n },\n\n /**\n * @api private\n *\n * @param credentials [Credentials]\n * @param date [String]\n * @param region [String]\n * @param service [String]\n * @param shouldCache [Boolean]\n * @return [String]\n */\n getSigningKey: function getSigningKey(\n credentials,\n date,\n region,\n service,\n shouldCache\n ) {\n var credsIdentifier = AWS.util.crypto\n .hmac(credentials.secretAccessKey, credentials.accessKeyId, 'base64');\n var cacheKey = [credsIdentifier, date, region, service].join('_');\n shouldCache = shouldCache !== false;\n if (shouldCache && (cacheKey in cachedSecret)) {\n return cachedSecret[cacheKey];\n }\n\n var kDate = AWS.util.crypto.hmac(\n 'AWS4' + credentials.secretAccessKey,\n date,\n 'buffer'\n );\n var kRegion = AWS.util.crypto.hmac(kDate, region, 'buffer');\n var kService = AWS.util.crypto.hmac(kRegion, service, 'buffer');\n\n var signingKey = AWS.util.crypto.hmac(kService, v4Identifier, 'buffer');\n if (shouldCache) {\n cachedSecret[cacheKey] = signingKey;\n cacheQueue.push(cacheKey);\n if (cacheQueue.length > maxCacheEntries) {\n // remove the oldest entry (not the least recently used)\n delete cachedSecret[cacheQueue.shift()];\n }\n }\n\n return signingKey;\n },\n\n /**\n * @api private\n *\n * Empties the derived signing key cache. Made available for testing purposes\n * only.\n */\n emptyCache: function emptyCache() {\n cachedSecret = {};\n cacheQueue = [];\n }\n};\n","function AcceptorStateMachine(states, state) {\n this.currentState = state || null;\n this.states = states || {};\n}\n\nAcceptorStateMachine.prototype.runTo = function runTo(finalState, done, bindObject, inputError) {\n if (typeof finalState === 'function') {\n inputError = bindObject; bindObject = done;\n done = finalState; finalState = null;\n }\n\n var self = this;\n var state = self.states[self.currentState];\n state.fn.call(bindObject || self, inputError, function(err) {\n if (err) {\n if (state.fail) self.currentState = state.fail;\n else return done ? done.call(bindObject, err) : null;\n } else {\n if (state.accept) self.currentState = state.accept;\n else return done ? done.call(bindObject) : null;\n }\n if (self.currentState === finalState) {\n return done ? done.call(bindObject, err) : null;\n }\n\n self.runTo(finalState, done, bindObject, err);\n });\n};\n\nAcceptorStateMachine.prototype.addState = function addState(name, acceptState, failState, fn) {\n if (typeof acceptState === 'function') {\n fn = acceptState; acceptState = null; failState = null;\n } else if (typeof failState === 'function') {\n fn = failState; failState = null;\n }\n\n if (!this.currentState) this.currentState = name;\n this.states[name] = { accept: acceptState, fail: failState, fn: fn };\n return this;\n};\n\n/**\n * @api private\n */\nmodule.exports = AcceptorStateMachine;\n","var AWS = require('./core');\n\n/**\n * Represents AWS token object, which contains {token}, and optional\n * {expireTime}.\n * Creating a `Token` object allows you to pass around your\n * token to configuration and service objects.\n *\n * Note that this class typically does not need to be constructed manually,\n * as the {AWS.Config} and {AWS.Service} classes both accept simple\n * options hashes with the two keys. The token from this object will be used\n * automatically in operations which require them.\n *\n * ## Expiring and Refreshing Token\n *\n * Occasionally token can expire in the middle of a long-running\n * application. In this case, the SDK will automatically attempt to\n * refresh the token from the storage location if the Token\n * class implements the {refresh} method.\n *\n * If you are implementing a token storage location, you\n * will want to create a subclass of the `Token` class and\n * override the {refresh} method. This method allows token to be\n * retrieved from the backing store, be it a file system, database, or\n * some network storage. The method should reset the token attributes\n * on the object.\n *\n * @!attribute token\n * @return [String] represents the literal token string. This will typically\n * be a base64 encoded string.\n * @!attribute expireTime\n * @return [Date] a time when token should be considered expired. Used\n * in conjunction with {expired}.\n * @!attribute expired\n * @return [Boolean] whether the token is expired and require a refresh. Used\n * in conjunction with {expireTime}.\n */\nAWS.Token = AWS.util.inherit({\n /**\n * Creates a Token object with a given set of information in options hash.\n * @option options token [String] represents the literal token string.\n * @option options expireTime [Date] field representing the time at which\n * the token expires.\n * @example Create a token object\n * var token = new AWS.Token({ token: 'token' });\n */\n constructor: function Token(options) {\n // hide token from being displayed with util.inspect\n AWS.util.hideProperties(this, ['token']);\n\n this.expired = false;\n this.expireTime = null;\n this.refreshCallbacks = [];\n if (arguments.length === 1) {\n var options = arguments[0];\n this.token = options.token;\n this.expireTime = options.expireTime;\n }\n },\n\n /**\n * @return [Integer] the number of seconds before {expireTime} during which\n * the token will be considered expired.\n */\n expiryWindow: 15,\n\n /**\n * @return [Boolean] whether the Token object should call {refresh}\n * @note Subclasses should override this method to provide custom refresh\n * logic.\n */\n needsRefresh: function needsRefresh() {\n var currentTime = AWS.util.date.getDate().getTime();\n var adjustedTime = new Date(currentTime + this.expiryWindow * 1000);\n\n if (this.expireTime && adjustedTime > this.expireTime)\n return true;\n\n return this.expired || !this.token;\n },\n\n /**\n * Gets the existing token, refreshing them if they are not yet loaded\n * or have expired. Users should call this method before using {refresh},\n * as this will not attempt to reload token when they are already\n * loaded into the object.\n *\n * @callback callback function(err)\n * When this callback is called with no error, it means either token\n * do not need to be refreshed or refreshed token information has\n * been loaded into the object (as the `token` property).\n * @param err [Error] if an error occurred, this value will be filled\n */\n get: function get(callback) {\n var self = this;\n if (this.needsRefresh()) {\n this.refresh(function(err) {\n if (!err) self.expired = false; // reset expired flag\n if (callback) callback(err);\n });\n } else if (callback) {\n callback();\n }\n },\n\n /**\n * @!method getPromise()\n * Returns a 'thenable' promise.\n * Gets the existing token, refreshing it if it's not yet loaded\n * or have expired. Users should call this method before using {refresh},\n * as this will not attempt to reload token when it's already\n * loaded into the object.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function()\n * Called if the promise is fulfilled. When this callback is called, it means\n * either token does not need to be refreshed or refreshed token information\n * has been loaded into the object (as the `token` property).\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] if an error occurred, this value will be filled.\n * @return [Promise] A promise that represents the state of the `get` call.\n * @example Calling the `getPromise` method.\n * var promise = tokenProvider.getPromise();\n * promise.then(function() { ... }, function(err) { ... });\n */\n\n /**\n * @!method refreshPromise()\n * Returns a 'thenable' promise.\n * Refreshes the token. Users should call {get} before attempting\n * to forcibly refresh token.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function()\n * Called if the promise is fulfilled. When this callback is called, it\n * means refreshed token information has been loaded into the object\n * (as the `token` property).\n * @callback rejectedCallback function(err)\n * Called if the promise is rejected.\n * @param err [Error] if an error occurred, this value will be filled.\n * @return [Promise] A promise that represents the state of the `refresh` call.\n * @example Calling the `refreshPromise` method.\n * var promise = tokenProvider.refreshPromise();\n * promise.then(function() { ... }, function(err) { ... });\n */\n\n /**\n * Refreshes the token. Users should call {get} before attempting\n * to forcibly refresh token.\n *\n * @callback callback function(err)\n * When this callback is called with no error, it means refreshed\n * token information has been loaded into the object (as the\n * `token` property).\n * @param err [Error] if an error occurred, this value will be filled\n * @note Subclasses should override this class to reset the\n * {token} on the token object and then call the callback with\n * any error information.\n * @see get\n */\n refresh: function refresh(callback) {\n this.expired = false;\n callback();\n },\n\n /**\n * @api private\n * @param callback\n */\n coalesceRefresh: function coalesceRefresh(callback, sync) {\n var self = this;\n if (self.refreshCallbacks.push(callback) === 1) {\n self.load(function onLoad(err) {\n AWS.util.arrayEach(self.refreshCallbacks, function(callback) {\n if (sync) {\n callback(err);\n } else {\n // callback could throw, so defer to ensure all callbacks are notified\n AWS.util.defer(function () {\n callback(err);\n });\n }\n });\n self.refreshCallbacks.length = 0;\n });\n }\n },\n\n /**\n * @api private\n * @param callback\n */\n load: function load(callback) {\n callback();\n }\n});\n\n/**\n * @api private\n */\nAWS.Token.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.getPromise = AWS.util.promisifyMethod('get', PromiseDependency);\n this.prototype.refreshPromise = AWS.util.promisifyMethod('refresh', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.Token.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.getPromise;\n delete this.prototype.refreshPromise;\n};\n\nAWS.util.addPromises(AWS.Token);\n","var AWS = require('../core');\nvar crypto = require('crypto');\nvar fs = require('fs');\nvar path = require('path');\nvar iniLoader = AWS.util.iniLoader;\n\n// Tracking refresh attempt to ensure refresh is not attempted more than once every 30 seconds.\nvar lastRefreshAttemptTime = 0;\n\n/**\n * Throws error is key is not present in token object.\n *\n * @param token [Object] Object to be validated.\n * @param key [String] The key to be validated on the object.\n */\nvar validateTokenKey = function validateTokenKey(token, key) {\n if (!token[key]) {\n throw AWS.util.error(\n new Error('Key \"' + key + '\" not present in SSO Token'),\n { code: 'SSOTokenProviderFailure' }\n );\n }\n};\n\n/**\n * Calls callback function with or without error based on provided times in case\n * of unsuccessful refresh.\n *\n * @param currentTime [number] current time in milliseconds since ECMAScript epoch.\n * @param tokenExpireTime [number] token expire time in milliseconds since ECMAScript epoch.\n * @param callback [Function] Callback to call in case of error.\n */\nvar refreshUnsuccessful = function refreshUnsuccessful(\n currentTime,\n tokenExpireTime,\n callback\n) {\n if (tokenExpireTime > currentTime) {\n // Cached token is still valid, return.\n callback(null);\n } else {\n // Token invalid, throw error requesting user to sso login.\n throw AWS.util.error(\n new Error('SSO Token refresh failed. Please log in using \"aws sso login\"'),\n { code: 'SSOTokenProviderFailure' }\n );\n }\n};\n\n/**\n * Represents token loaded from disk derived from the AWS SSO device grant authorication flow.\n *\n * ## Using SSO Token Provider\n *\n * This provider is checked by default in the Node.js environment in TokenProviderChain.\n * To use the SSO Token Provider, simply add your SSO Start URL and Region to the\n * ~/.aws/config file in the following format:\n *\n * [default]\n * sso_start_url = https://d-abc123.awsapps.com/start\n * sso_region = us-east-1\n *\n * ## Using custom profiles\n *\n * The SDK supports loading token for separate profiles. This can be done in two ways:\n *\n * 1. Set the `AWS_PROFILE` environment variable in your process prior to loading the SDK.\n * 2. Directly load the AWS.SSOTokenProvider:\n *\n * ```javascript\n * var ssoTokenProvider = new AWS.SSOTokenProvider({profile: 'myprofile'});\n * ```\n *\n * @!macro nobrowser\n */\nAWS.SSOTokenProvider = AWS.util.inherit(AWS.Token, {\n /**\n * Expiry window of five minutes.\n */\n expiryWindow: 5 * 60,\n\n /**\n * Creates a new token object from cached access token.\n *\n * @param options [map] a set of options\n * @option options profile [String] (AWS_PROFILE env var or 'default')\n * the name of the profile to load.\n * @option options callback [Function] (err) Token is eagerly loaded\n * by the constructor. When the callback is called with no error, the\n * token has been loaded successfully.\n */\n constructor: function SSOTokenProvider(options) {\n AWS.Token.call(this);\n\n options = options || {};\n\n this.expired = true;\n this.profile = options.profile || process.env.AWS_PROFILE || AWS.util.defaultProfile;\n this.get(options.callback || AWS.util.fn.noop);\n },\n\n /**\n * Reads sso_start_url from provided profile, and reads token from\n * ~/.aws/sso/cache/.json\n *\n * Throws an error if required fields token and expiresAt are missing.\n * Throws an error if token has expired and metadata to perform refresh is\n * not available.\n * Attempts to refresh the token if it's within 5 minutes before expiry time.\n *\n * @api private\n */\n load: function load(callback) {\n var self = this;\n var profiles = iniLoader.loadFrom({ isConfig: true });\n var profile = profiles[this.profile] || {};\n\n if (Object.keys(profile).length === 0) {\n throw AWS.util.error(\n new Error('Profile \"' + this.profile + '\" not found'),\n { code: 'SSOTokenProviderFailure' }\n );\n } else if (!profile['sso_session']) {\n throw AWS.util.error(\n new Error('Profile \"' + profileName + '\" is missing required property \"sso_session\".'),\n { code: 'SSOTokenProviderFailure' }\n );\n }\n\n var ssoSessionName = profile['sso_session'];\n var ssoSessions = iniLoader.loadSsoSessionsFrom();\n var ssoSession = ssoSessions[ssoSessionName];\n\n if (!ssoSession) {\n throw AWS.util.error(\n new Error('Sso session \"' + ssoSessionName + '\" not found'),\n { code: 'SSOTokenProviderFailure' }\n );\n } else if (!ssoSession['sso_start_url']) {\n throw AWS.util.error(\n new Error('Sso session \"' + profileName + '\" is missing required property \"sso_start_url\".'),\n { code: 'SSOTokenProviderFailure' }\n );\n } else if (!ssoSession['sso_region']) {\n throw AWS.util.error(\n new Error('Sso session \"' + profileName + '\" is missing required property \"sso_region\".'),\n { code: 'SSOTokenProviderFailure' }\n );\n }\n\n var hasher = crypto.createHash('sha1');\n var fileName = hasher.update(ssoSessionName).digest('hex') + '.json';\n var cachePath = path.join(iniLoader.getHomeDir(), '.aws', 'sso', 'cache', fileName);\n var tokenFromCache = JSON.parse(fs.readFileSync(cachePath));\n\n if (!tokenFromCache) {\n throw AWS.util.error(\n new Error('Cached token not found. Please log in using \"aws sso login\"'\n + ' for profile \"' + this.profile + '\".'),\n { code: 'SSOTokenProviderFailure' }\n );\n }\n\n validateTokenKey(tokenFromCache, 'accessToken');\n validateTokenKey(tokenFromCache, 'expiresAt');\n\n var currentTime = AWS.util.date.getDate().getTime();\n var adjustedTime = new Date(currentTime + this.expiryWindow * 1000);\n var tokenExpireTime = new Date(tokenFromCache['expiresAt']);\n\n if (tokenExpireTime > adjustedTime) {\n // Token is valid and not expired.\n self.token = tokenFromCache.accessToken;\n self.expireTime = tokenExpireTime;\n self.expired = false;\n callback(null);\n return;\n }\n\n // Skip new refresh, if last refresh was done within 30 seconds.\n if (currentTime - lastRefreshAttemptTime < 30 * 1000) {\n refreshUnsuccessful(currentTime, tokenExpireTime, callback);\n return;\n }\n\n // Token is in expiry window, refresh from SSOOIDC.createToken() call.\n validateTokenKey(tokenFromCache, 'clientId');\n validateTokenKey(tokenFromCache, 'clientSecret');\n validateTokenKey(tokenFromCache, 'refreshToken');\n\n if (!self.service || self.service.config.region !== ssoSession.sso_region) {\n self.service = new AWS.SSOOIDC({ region: ssoSession.sso_region });\n }\n\n var params = {\n clientId: tokenFromCache.clientId,\n clientSecret: tokenFromCache.clientSecret,\n refreshToken: tokenFromCache.refreshToken,\n grantType: 'refresh_token',\n };\n\n lastRefreshAttemptTime = AWS.util.date.getDate().getTime();\n self.service.createToken(params, function(err, data) {\n if (err || !data) {\n refreshUnsuccessful(currentTime, tokenExpireTime, callback);\n } else {\n try {\n validateTokenKey(data, 'accessToken');\n validateTokenKey(data, 'expiresIn');\n self.expired = false;\n self.token = data.accessToken;\n self.expireTime = new Date(Date.now() + data.expiresIn * 1000);\n callback(null);\n\n try {\n // Write updated token data to disk.\n tokenFromCache.accessToken = data.accessToken;\n tokenFromCache.expiresAt = self.expireTime.toISOString();\n tokenFromCache.refreshToken = data.refreshToken;\n fs.writeFileSync(cachePath, JSON.stringify(tokenFromCache, null, 2));\n } catch (error) {\n // Swallow error if unable to write token to file.\n }\n } catch (error) {\n refreshUnsuccessful(currentTime, tokenExpireTime, callback);\n }\n }\n });\n },\n\n /**\n * Loads the cached access token from disk.\n *\n * @callback callback function(err)\n * Called after the AWS SSO process has been executed. When this\n * callback is called with no error, it means that the token information\n * has been loaded into the object (as the `token` property).\n * @param err [Error] if an error occurred, this value will be filled.\n * @see get\n */\n refresh: function refresh(callback) {\n iniLoader.clearCachedFiles();\n this.coalesceRefresh(callback || AWS.util.fn.callback);\n },\n});\n","var AWS = require('../core');\n\n/**\n * Creates a token provider chain that searches for token in a list of\n * token providers specified by the {providers} property.\n *\n * By default, the chain will use the {defaultProviders} to resolve token.\n *\n * ## Setting Providers\n *\n * Each provider in the {providers} list should be a function that returns\n * a {AWS.Token} object, or a hardcoded token object. The function\n * form allows for delayed execution of the Token construction.\n *\n * ## Resolving Token from a Chain\n *\n * Call {resolve} to return the first valid token object that can be\n * loaded by the provider chain.\n *\n * For example, to resolve a chain with a custom provider that checks a file\n * on disk after the set of {defaultProviders}:\n *\n * ```javascript\n * var diskProvider = new FileTokenProvider('./token.json');\n * var chain = new AWS.TokenProviderChain();\n * chain.providers.push(diskProvider);\n * chain.resolve();\n * ```\n *\n * The above code will return the `diskProvider` object if the\n * file contains token and the `defaultProviders` do not contain\n * any token.\n *\n * @!attribute providers\n * @return [Array]\n * a list of token objects or functions that return token\n * objects. If the provider is a function, the function will be\n * executed lazily when the provider needs to be checked for valid\n * token. By default, this object will be set to the {defaultProviders}.\n * @see defaultProviders\n */\nAWS.TokenProviderChain = AWS.util.inherit(AWS.Token, {\n\n /**\n * Creates a new TokenProviderChain with a default set of providers\n * specified by {defaultProviders}.\n */\n constructor: function TokenProviderChain(providers) {\n if (providers) {\n this.providers = providers;\n } else {\n this.providers = AWS.TokenProviderChain.defaultProviders.slice(0);\n }\n this.resolveCallbacks = [];\n },\n\n /**\n * @!method resolvePromise()\n * Returns a 'thenable' promise.\n * Resolves the provider chain by searching for the first token in {providers}.\n *\n * Two callbacks can be provided to the `then` method on the returned promise.\n * The first callback will be called if the promise is fulfilled, and the second\n * callback will be called if the promise is rejected.\n * @callback fulfilledCallback function(token)\n * Called if the promise is fulfilled and the provider resolves the chain\n * to a token object\n * @param token [AWS.Token] the token object resolved by the provider chain.\n * @callback rejectedCallback function(error)\n * Called if the promise is rejected.\n * @param err [Error] the error object returned if no token is found.\n * @return [Promise] A promise that represents the state of the `resolve` method call.\n * @example Calling the `resolvePromise` method.\n * var promise = chain.resolvePromise();\n * promise.then(function(token) { ... }, function(err) { ... });\n */\n\n /**\n * Resolves the provider chain by searching for the first token in {providers}.\n *\n * @callback callback function(err, token)\n * Called when the provider resolves the chain to a token object\n * or null if no token can be found.\n *\n * @param err [Error] the error object returned if no token is found.\n * @param token [AWS.Token] the token object resolved by the provider chain.\n * @return [AWS.TokenProviderChain] the provider, for chaining.\n */\n resolve: function resolve(callback) {\n var self = this;\n if (self.providers.length === 0) {\n callback(new Error('No providers'));\n return self;\n }\n\n if (self.resolveCallbacks.push(callback) === 1) {\n var index = 0;\n var providers = self.providers.slice(0);\n\n function resolveNext(err, token) {\n if ((!err && token) || index === providers.length) {\n AWS.util.arrayEach(self.resolveCallbacks, function (callback) {\n callback(err, token);\n });\n self.resolveCallbacks.length = 0;\n return;\n }\n\n var provider = providers[index++];\n if (typeof provider === 'function') {\n token = provider.call();\n } else {\n token = provider;\n }\n\n if (token.get) {\n token.get(function (getErr) {\n resolveNext(getErr, getErr ? null : token);\n });\n } else {\n resolveNext(null, token);\n }\n }\n\n resolveNext();\n }\n\n return self;\n }\n});\n\n/**\n * The default set of providers used by a vanilla TokenProviderChain.\n *\n * In the browser:\n *\n * ```javascript\n * AWS.TokenProviderChain.defaultProviders = []\n * ```\n *\n * In Node.js:\n *\n * ```javascript\n * AWS.TokenProviderChain.defaultProviders = [\n * function () { return new AWS.SSOTokenProvider(); },\n * ]\n * ```\n */\nAWS.TokenProviderChain.defaultProviders = [];\n\n/**\n * @api private\n */\nAWS.TokenProviderChain.addPromisesToClass = function addPromisesToClass(PromiseDependency) {\n this.prototype.resolvePromise = AWS.util.promisifyMethod('resolve', PromiseDependency);\n};\n\n/**\n * @api private\n */\nAWS.TokenProviderChain.deletePromisesFromClass = function deletePromisesFromClass() {\n delete this.prototype.resolvePromise;\n};\n\nAWS.util.addPromises(AWS.TokenProviderChain);\n","/* eslint guard-for-in:0 */\nvar AWS;\n\n/**\n * A set of utility methods for use with the AWS SDK.\n *\n * @!attribute abort\n * Return this value from an iterator function {each} or {arrayEach}\n * to break out of the iteration.\n * @example Breaking out of an iterator function\n * AWS.util.each({a: 1, b: 2, c: 3}, function(key, value) {\n * if (key == 'b') return AWS.util.abort;\n * });\n * @see each\n * @see arrayEach\n * @api private\n */\nvar util = {\n environment: 'nodejs',\n engine: function engine() {\n if (util.isBrowser() && typeof navigator !== 'undefined') {\n return navigator.userAgent;\n } else {\n var engine = process.platform + '/' + process.version;\n if (process.env.AWS_EXECUTION_ENV) {\n engine += ' exec-env/' + process.env.AWS_EXECUTION_ENV;\n }\n return engine;\n }\n },\n\n userAgent: function userAgent() {\n var name = util.environment;\n var agent = 'aws-sdk-' + name + '/' + require('./core').VERSION;\n if (name === 'nodejs') agent += ' ' + util.engine();\n return agent;\n },\n\n uriEscape: function uriEscape(string) {\n var output = encodeURIComponent(string);\n output = output.replace(/[^A-Za-z0-9_.~\\-%]+/g, escape);\n\n // AWS percent-encodes some extra non-standard characters in a URI\n output = output.replace(/[*]/g, function(ch) {\n return '%' + ch.charCodeAt(0).toString(16).toUpperCase();\n });\n\n return output;\n },\n\n uriEscapePath: function uriEscapePath(string) {\n var parts = [];\n util.arrayEach(string.split('/'), function (part) {\n parts.push(util.uriEscape(part));\n });\n return parts.join('/');\n },\n\n urlParse: function urlParse(url) {\n return util.url.parse(url);\n },\n\n urlFormat: function urlFormat(url) {\n return util.url.format(url);\n },\n\n queryStringParse: function queryStringParse(qs) {\n return util.querystring.parse(qs);\n },\n\n queryParamsToString: function queryParamsToString(params) {\n var items = [];\n var escape = util.uriEscape;\n var sortedKeys = Object.keys(params).sort();\n\n util.arrayEach(sortedKeys, function(name) {\n var value = params[name];\n var ename = escape(name);\n var result = ename + '=';\n if (Array.isArray(value)) {\n var vals = [];\n util.arrayEach(value, function(item) { vals.push(escape(item)); });\n result = ename + '=' + vals.sort().join('&' + ename + '=');\n } else if (value !== undefined && value !== null) {\n result = ename + '=' + escape(value);\n }\n items.push(result);\n });\n\n return items.join('&');\n },\n\n readFileSync: function readFileSync(path) {\n if (util.isBrowser()) return null;\n return require('fs').readFileSync(path, 'utf-8');\n },\n\n base64: {\n encode: function encode64(string) {\n if (typeof string === 'number') {\n throw util.error(new Error('Cannot base64 encode number ' + string));\n }\n if (string === null || typeof string === 'undefined') {\n return string;\n }\n var buf = util.buffer.toBuffer(string);\n return buf.toString('base64');\n },\n\n decode: function decode64(string) {\n if (typeof string === 'number') {\n throw util.error(new Error('Cannot base64 decode number ' + string));\n }\n if (string === null || typeof string === 'undefined') {\n return string;\n }\n return util.buffer.toBuffer(string, 'base64');\n }\n\n },\n\n buffer: {\n /**\n * Buffer constructor for Node buffer and buffer pollyfill\n */\n toBuffer: function(data, encoding) {\n return (typeof util.Buffer.from === 'function' && util.Buffer.from !== Uint8Array.from) ?\n util.Buffer.from(data, encoding) : new util.Buffer(data, encoding);\n },\n\n alloc: function(size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new Error('size passed to alloc must be a number.');\n }\n if (typeof util.Buffer.alloc === 'function') {\n return util.Buffer.alloc(size, fill, encoding);\n } else {\n var buf = new util.Buffer(size);\n if (fill !== undefined && typeof buf.fill === 'function') {\n buf.fill(fill, undefined, undefined, encoding);\n }\n return buf;\n }\n },\n\n toStream: function toStream(buffer) {\n if (!util.Buffer.isBuffer(buffer)) buffer = util.buffer.toBuffer(buffer);\n\n var readable = new (util.stream.Readable)();\n var pos = 0;\n readable._read = function(size) {\n if (pos >= buffer.length) return readable.push(null);\n\n var end = pos + size;\n if (end > buffer.length) end = buffer.length;\n readable.push(buffer.slice(pos, end));\n pos = end;\n };\n\n return readable;\n },\n\n /**\n * Concatenates a list of Buffer objects.\n */\n concat: function(buffers) {\n var length = 0,\n offset = 0,\n buffer = null, i;\n\n for (i = 0; i < buffers.length; i++) {\n length += buffers[i].length;\n }\n\n buffer = util.buffer.alloc(length);\n\n for (i = 0; i < buffers.length; i++) {\n buffers[i].copy(buffer, offset);\n offset += buffers[i].length;\n }\n\n return buffer;\n }\n },\n\n string: {\n byteLength: function byteLength(string) {\n if (string === null || string === undefined) return 0;\n if (typeof string === 'string') string = util.buffer.toBuffer(string);\n\n if (typeof string.byteLength === 'number') {\n return string.byteLength;\n } else if (typeof string.length === 'number') {\n return string.length;\n } else if (typeof string.size === 'number') {\n return string.size;\n } else if (typeof string.path === 'string') {\n return require('fs').lstatSync(string.path).size;\n } else {\n throw util.error(new Error('Cannot determine length of ' + string),\n { object: string });\n }\n },\n\n upperFirst: function upperFirst(string) {\n return string[0].toUpperCase() + string.substr(1);\n },\n\n lowerFirst: function lowerFirst(string) {\n return string[0].toLowerCase() + string.substr(1);\n }\n },\n\n ini: {\n parse: function string(ini) {\n var currentSection, map = {};\n util.arrayEach(ini.split(/\\r?\\n/), function(line) {\n line = line.split(/(^|\\s)[;#]/)[0].trim(); // remove comments and trim\n var isSection = line[0] === '[' && line[line.length - 1] === ']';\n if (isSection) {\n currentSection = line.substring(1, line.length - 1);\n if (currentSection === '__proto__' || currentSection.split(/\\s/)[1] === '__proto__') {\n throw util.error(\n new Error('Cannot load profile name \\'' + currentSection + '\\' from shared ini file.')\n );\n }\n } else if (currentSection) {\n var indexOfEqualsSign = line.indexOf('=');\n var start = 0;\n var end = line.length - 1;\n var isAssignment =\n indexOfEqualsSign !== -1 && indexOfEqualsSign !== start && indexOfEqualsSign !== end;\n\n if (isAssignment) {\n var name = line.substring(0, indexOfEqualsSign).trim();\n var value = line.substring(indexOfEqualsSign + 1).trim();\n\n map[currentSection] = map[currentSection] || {};\n map[currentSection][name] = value;\n }\n }\n });\n\n return map;\n }\n },\n\n fn: {\n noop: function() {},\n callback: function (err) { if (err) throw err; },\n\n /**\n * Turn a synchronous function into as \"async\" function by making it call\n * a callback. The underlying function is called with all but the last argument,\n * which is treated as the callback. The callback is passed passed a first argument\n * of null on success to mimick standard node callbacks.\n */\n makeAsync: function makeAsync(fn, expectedArgs) {\n if (expectedArgs && expectedArgs <= fn.length) {\n return fn;\n }\n\n return function() {\n var args = Array.prototype.slice.call(arguments, 0);\n var callback = args.pop();\n var result = fn.apply(null, args);\n callback(result);\n };\n }\n },\n\n /**\n * Date and time utility functions.\n */\n date: {\n\n /**\n * @return [Date] the current JavaScript date object. Since all\n * AWS services rely on this date object, you can override\n * this function to provide a special time value to AWS service\n * requests.\n */\n getDate: function getDate() {\n if (!AWS) AWS = require('./core');\n if (AWS.config.systemClockOffset) { // use offset when non-zero\n return new Date(new Date().getTime() + AWS.config.systemClockOffset);\n } else {\n return new Date();\n }\n },\n\n /**\n * @return [String] the date in ISO-8601 format\n */\n iso8601: function iso8601(date) {\n if (date === undefined) { date = util.date.getDate(); }\n return date.toISOString().replace(/\\.\\d{3}Z$/, 'Z');\n },\n\n /**\n * @return [String] the date in RFC 822 format\n */\n rfc822: function rfc822(date) {\n if (date === undefined) { date = util.date.getDate(); }\n return date.toUTCString();\n },\n\n /**\n * @return [Integer] the UNIX timestamp value for the current time\n */\n unixTimestamp: function unixTimestamp(date) {\n if (date === undefined) { date = util.date.getDate(); }\n return date.getTime() / 1000;\n },\n\n /**\n * @param [String,number,Date] date\n * @return [Date]\n */\n from: function format(date) {\n if (typeof date === 'number') {\n return new Date(date * 1000); // unix timestamp\n } else {\n return new Date(date);\n }\n },\n\n /**\n * Given a Date or date-like value, this function formats the\n * date into a string of the requested value.\n * @param [String,number,Date] date\n * @param [String] formatter Valid formats are:\n # * 'iso8601'\n # * 'rfc822'\n # * 'unixTimestamp'\n * @return [String]\n */\n format: function format(date, formatter) {\n if (!formatter) formatter = 'iso8601';\n return util.date[formatter](util.date.from(date));\n },\n\n parseTimestamp: function parseTimestamp(value) {\n if (typeof value === 'number') { // unix timestamp (number)\n return new Date(value * 1000);\n } else if (value.match(/^\\d+$/)) { // unix timestamp\n return new Date(value * 1000);\n } else if (value.match(/^\\d{4}/)) { // iso8601\n return new Date(value);\n } else if (value.match(/^\\w{3},/)) { // rfc822\n return new Date(value);\n } else {\n throw util.error(\n new Error('unhandled timestamp format: ' + value),\n {code: 'TimestampParserError'});\n }\n }\n\n },\n\n crypto: {\n crc32Table: [\n 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419,\n 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4,\n 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07,\n 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE,\n 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856,\n 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9,\n 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4,\n 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,\n 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3,\n 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A,\n 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599,\n 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924,\n 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190,\n 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F,\n 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E,\n 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,\n 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED,\n 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950,\n 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3,\n 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2,\n 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A,\n 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5,\n 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010,\n 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,\n 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17,\n 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6,\n 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615,\n 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,\n 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344,\n 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB,\n 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A,\n 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,\n 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1,\n 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C,\n 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF,\n 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236,\n 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE,\n 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31,\n 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C,\n 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,\n 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B,\n 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,\n 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1,\n 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C,\n 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278,\n 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7,\n 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66,\n 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,\n 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605,\n 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8,\n 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B,\n 0x2D02EF8D],\n\n crc32: function crc32(data) {\n var tbl = util.crypto.crc32Table;\n var crc = 0 ^ -1;\n\n if (typeof data === 'string') {\n data = util.buffer.toBuffer(data);\n }\n\n for (var i = 0; i < data.length; i++) {\n var code = data.readUInt8(i);\n crc = (crc >>> 8) ^ tbl[(crc ^ code) & 0xFF];\n }\n return (crc ^ -1) >>> 0;\n },\n\n hmac: function hmac(key, string, digest, fn) {\n if (!digest) digest = 'binary';\n if (digest === 'buffer') { digest = undefined; }\n if (!fn) fn = 'sha256';\n if (typeof string === 'string') string = util.buffer.toBuffer(string);\n return util.crypto.lib.createHmac(fn, key).update(string).digest(digest);\n },\n\n md5: function md5(data, digest, callback) {\n return util.crypto.hash('md5', data, digest, callback);\n },\n\n sha256: function sha256(data, digest, callback) {\n return util.crypto.hash('sha256', data, digest, callback);\n },\n\n hash: function(algorithm, data, digest, callback) {\n var hash = util.crypto.createHash(algorithm);\n if (!digest) { digest = 'binary'; }\n if (digest === 'buffer') { digest = undefined; }\n if (typeof data === 'string') data = util.buffer.toBuffer(data);\n var sliceFn = util.arraySliceFn(data);\n var isBuffer = util.Buffer.isBuffer(data);\n //Identifying objects with an ArrayBuffer as buffers\n if (util.isBrowser() && typeof ArrayBuffer !== 'undefined' && data && data.buffer instanceof ArrayBuffer) isBuffer = true;\n\n if (callback && typeof data === 'object' &&\n typeof data.on === 'function' && !isBuffer) {\n data.on('data', function(chunk) { hash.update(chunk); });\n data.on('error', function(err) { callback(err); });\n data.on('end', function() { callback(null, hash.digest(digest)); });\n } else if (callback && sliceFn && !isBuffer &&\n typeof FileReader !== 'undefined') {\n // this might be a File/Blob\n var index = 0, size = 1024 * 512;\n var reader = new FileReader();\n reader.onerror = function() {\n callback(new Error('Failed to read data.'));\n };\n reader.onload = function() {\n var buf = new util.Buffer(new Uint8Array(reader.result));\n hash.update(buf);\n index += buf.length;\n reader._continueReading();\n };\n reader._continueReading = function() {\n if (index >= data.size) {\n callback(null, hash.digest(digest));\n return;\n }\n\n var back = index + size;\n if (back > data.size) back = data.size;\n reader.readAsArrayBuffer(sliceFn.call(data, index, back));\n };\n\n reader._continueReading();\n } else {\n if (util.isBrowser() && typeof data === 'object' && !isBuffer) {\n data = new util.Buffer(new Uint8Array(data));\n }\n var out = hash.update(data).digest(digest);\n if (callback) callback(null, out);\n return out;\n }\n },\n\n toHex: function toHex(data) {\n var out = [];\n for (var i = 0; i < data.length; i++) {\n out.push(('0' + data.charCodeAt(i).toString(16)).substr(-2, 2));\n }\n return out.join('');\n },\n\n createHash: function createHash(algorithm) {\n return util.crypto.lib.createHash(algorithm);\n }\n\n },\n\n /** @!ignore */\n\n /* Abort constant */\n abort: {},\n\n each: function each(object, iterFunction) {\n for (var key in object) {\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n var ret = iterFunction.call(this, key, object[key]);\n if (ret === util.abort) break;\n }\n }\n },\n\n arrayEach: function arrayEach(array, iterFunction) {\n for (var idx in array) {\n if (Object.prototype.hasOwnProperty.call(array, idx)) {\n var ret = iterFunction.call(this, array[idx], parseInt(idx, 10));\n if (ret === util.abort) break;\n }\n }\n },\n\n update: function update(obj1, obj2) {\n util.each(obj2, function iterator(key, item) {\n obj1[key] = item;\n });\n return obj1;\n },\n\n merge: function merge(obj1, obj2) {\n return util.update(util.copy(obj1), obj2);\n },\n\n copy: function copy(object) {\n if (object === null || object === undefined) return object;\n var dupe = {};\n // jshint forin:false\n for (var key in object) {\n dupe[key] = object[key];\n }\n return dupe;\n },\n\n isEmpty: function isEmpty(obj) {\n for (var prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) {\n return false;\n }\n }\n return true;\n },\n\n arraySliceFn: function arraySliceFn(obj) {\n var fn = obj.slice || obj.webkitSlice || obj.mozSlice;\n return typeof fn === 'function' ? fn : null;\n },\n\n isType: function isType(obj, type) {\n // handle cross-\"frame\" objects\n if (typeof type === 'function') type = util.typeName(type);\n return Object.prototype.toString.call(obj) === '[object ' + type + ']';\n },\n\n typeName: function typeName(type) {\n if (Object.prototype.hasOwnProperty.call(type, 'name')) return type.name;\n var str = type.toString();\n var match = str.match(/^\\s*function (.+)\\(/);\n return match ? match[1] : str;\n },\n\n error: function error(err, options) {\n var originalError = null;\n if (typeof err.message === 'string' && err.message !== '') {\n if (typeof options === 'string' || (options && options.message)) {\n originalError = util.copy(err);\n originalError.message = err.message;\n }\n }\n err.message = err.message || null;\n\n if (typeof options === 'string') {\n err.message = options;\n } else if (typeof options === 'object' && options !== null) {\n util.update(err, options);\n if (options.message)\n err.message = options.message;\n if (options.code || options.name)\n err.code = options.code || options.name;\n if (options.stack)\n err.stack = options.stack;\n }\n\n if (typeof Object.defineProperty === 'function') {\n Object.defineProperty(err, 'name', {writable: true, enumerable: false});\n Object.defineProperty(err, 'message', {enumerable: true});\n }\n\n err.name = String(options && options.name || err.name || err.code || 'Error');\n err.time = new Date();\n\n if (originalError) {\n err.originalError = originalError;\n }\n\n\n for (var key in options || {}) {\n if (key[0] === '[' && key[key.length - 1] === ']') {\n key = key.slice(1, -1);\n if (key === 'code' || key === 'message') {\n continue;\n }\n err['[' + key + ']'] = 'See error.' + key + ' for details.';\n Object.defineProperty(err, key, {\n value: err[key] || (options && options[key]) || (originalError && originalError[key]),\n enumerable: false,\n writable: true\n });\n }\n }\n\n return err;\n },\n\n /**\n * @api private\n */\n inherit: function inherit(klass, features) {\n var newObject = null;\n if (features === undefined) {\n features = klass;\n klass = Object;\n newObject = {};\n } else {\n var ctor = function ConstructorWrapper() {};\n ctor.prototype = klass.prototype;\n newObject = new ctor();\n }\n\n // constructor not supplied, create pass-through ctor\n if (features.constructor === Object) {\n features.constructor = function() {\n if (klass !== Object) {\n return klass.apply(this, arguments);\n }\n };\n }\n\n features.constructor.prototype = newObject;\n util.update(features.constructor.prototype, features);\n features.constructor.__super__ = klass;\n return features.constructor;\n },\n\n /**\n * @api private\n */\n mixin: function mixin() {\n var klass = arguments[0];\n for (var i = 1; i < arguments.length; i++) {\n // jshint forin:false\n for (var prop in arguments[i].prototype) {\n var fn = arguments[i].prototype[prop];\n if (prop !== 'constructor') {\n klass.prototype[prop] = fn;\n }\n }\n }\n return klass;\n },\n\n /**\n * @api private\n */\n hideProperties: function hideProperties(obj, props) {\n if (typeof Object.defineProperty !== 'function') return;\n\n util.arrayEach(props, function (key) {\n Object.defineProperty(obj, key, {\n enumerable: false, writable: true, configurable: true });\n });\n },\n\n /**\n * @api private\n */\n property: function property(obj, name, value, enumerable, isValue) {\n var opts = {\n configurable: true,\n enumerable: enumerable !== undefined ? enumerable : true\n };\n if (typeof value === 'function' && !isValue) {\n opts.get = value;\n }\n else {\n opts.value = value; opts.writable = true;\n }\n\n Object.defineProperty(obj, name, opts);\n },\n\n /**\n * @api private\n */\n memoizedProperty: function memoizedProperty(obj, name, get, enumerable) {\n var cachedValue = null;\n\n // build enumerable attribute for each value with lazy accessor.\n util.property(obj, name, function() {\n if (cachedValue === null) {\n cachedValue = get();\n }\n return cachedValue;\n }, enumerable);\n },\n\n /**\n * TODO Remove in major version revision\n * This backfill populates response data without the\n * top-level payload name.\n *\n * @api private\n */\n hoistPayloadMember: function hoistPayloadMember(resp) {\n var req = resp.request;\n var operationName = req.operation;\n var operation = req.service.api.operations[operationName];\n var output = operation.output;\n if (output.payload && !operation.hasEventOutput) {\n var payloadMember = output.members[output.payload];\n var responsePayload = resp.data[output.payload];\n if (payloadMember.type === 'structure') {\n util.each(responsePayload, function(key, value) {\n util.property(resp.data, key, value, false);\n });\n }\n }\n },\n\n /**\n * Compute SHA-256 checksums of streams\n *\n * @api private\n */\n computeSha256: function computeSha256(body, done) {\n if (util.isNode()) {\n var Stream = util.stream.Stream;\n var fs = require('fs');\n if (typeof Stream === 'function' && body instanceof Stream) {\n if (typeof body.path === 'string') { // assume file object\n var settings = {};\n if (typeof body.start === 'number') {\n settings.start = body.start;\n }\n if (typeof body.end === 'number') {\n settings.end = body.end;\n }\n body = fs.createReadStream(body.path, settings);\n } else { // TODO support other stream types\n return done(new Error('Non-file stream objects are ' +\n 'not supported with SigV4'));\n }\n }\n }\n\n util.crypto.sha256(body, 'hex', function(err, sha) {\n if (err) done(err);\n else done(null, sha);\n });\n },\n\n /**\n * @api private\n */\n isClockSkewed: function isClockSkewed(serverTime) {\n if (serverTime) {\n util.property(AWS.config, 'isClockSkewed',\n Math.abs(new Date().getTime() - serverTime) >= 300000, false);\n return AWS.config.isClockSkewed;\n }\n },\n\n applyClockOffset: function applyClockOffset(serverTime) {\n if (serverTime)\n AWS.config.systemClockOffset = serverTime - new Date().getTime();\n },\n\n /**\n * @api private\n */\n extractRequestId: function extractRequestId(resp) {\n var requestId = resp.httpResponse.headers['x-amz-request-id'] ||\n resp.httpResponse.headers['x-amzn-requestid'];\n\n if (!requestId && resp.data && resp.data.ResponseMetadata) {\n requestId = resp.data.ResponseMetadata.RequestId;\n }\n\n if (requestId) {\n resp.requestId = requestId;\n }\n\n if (resp.error) {\n resp.error.requestId = requestId;\n }\n },\n\n /**\n * @api private\n */\n addPromises: function addPromises(constructors, PromiseDependency) {\n var deletePromises = false;\n if (PromiseDependency === undefined && AWS && AWS.config) {\n PromiseDependency = AWS.config.getPromisesDependency();\n }\n if (PromiseDependency === undefined && typeof Promise !== 'undefined') {\n PromiseDependency = Promise;\n }\n if (typeof PromiseDependency !== 'function') deletePromises = true;\n if (!Array.isArray(constructors)) constructors = [constructors];\n\n for (var ind = 0; ind < constructors.length; ind++) {\n var constructor = constructors[ind];\n if (deletePromises) {\n if (constructor.deletePromisesFromClass) {\n constructor.deletePromisesFromClass();\n }\n } else if (constructor.addPromisesToClass) {\n constructor.addPromisesToClass(PromiseDependency);\n }\n }\n },\n\n /**\n * @api private\n * Return a function that will return a promise whose fate is decided by the\n * callback behavior of the given method with `methodName`. The method to be\n * promisified should conform to node.js convention of accepting a callback as\n * last argument and calling that callback with error as the first argument\n * and success value on the second argument.\n */\n promisifyMethod: function promisifyMethod(methodName, PromiseDependency) {\n return function promise() {\n var self = this;\n var args = Array.prototype.slice.call(arguments);\n return new PromiseDependency(function(resolve, reject) {\n args.push(function(err, data) {\n if (err) {\n reject(err);\n } else {\n resolve(data);\n }\n });\n self[methodName].apply(self, args);\n });\n };\n },\n\n /**\n * @api private\n */\n isDualstackAvailable: function isDualstackAvailable(service) {\n if (!service) return false;\n var metadata = require('../apis/metadata.json');\n if (typeof service !== 'string') service = service.serviceIdentifier;\n if (typeof service !== 'string' || !metadata.hasOwnProperty(service)) return false;\n return !!metadata[service].dualstackAvailable;\n },\n\n /**\n * @api private\n */\n calculateRetryDelay: function calculateRetryDelay(retryCount, retryDelayOptions, err) {\n if (!retryDelayOptions) retryDelayOptions = {};\n var customBackoff = retryDelayOptions.customBackoff || null;\n if (typeof customBackoff === 'function') {\n return customBackoff(retryCount, err);\n }\n var base = typeof retryDelayOptions.base === 'number' ? retryDelayOptions.base : 100;\n var delay = Math.random() * (Math.pow(2, retryCount) * base);\n return delay;\n },\n\n /**\n * @api private\n */\n handleRequestWithRetries: function handleRequestWithRetries(httpRequest, options, cb) {\n if (!options) options = {};\n var http = AWS.HttpClient.getInstance();\n var httpOptions = options.httpOptions || {};\n var retryCount = 0;\n\n var errCallback = function(err) {\n var maxRetries = options.maxRetries || 0;\n if (err && err.code === 'TimeoutError') err.retryable = true;\n\n // Call `calculateRetryDelay()` only when relevant, see #3401\n if (err && err.retryable && retryCount < maxRetries) {\n var delay = util.calculateRetryDelay(retryCount, options.retryDelayOptions, err);\n if (delay >= 0) {\n retryCount++;\n setTimeout(sendRequest, delay + (err.retryAfter || 0));\n return;\n }\n }\n cb(err);\n };\n\n var sendRequest = function() {\n var data = '';\n http.handleRequest(httpRequest, httpOptions, function(httpResponse) {\n httpResponse.on('data', function(chunk) { data += chunk.toString(); });\n httpResponse.on('end', function() {\n var statusCode = httpResponse.statusCode;\n if (statusCode < 300) {\n cb(null, data);\n } else {\n var retryAfter = parseInt(httpResponse.headers['retry-after'], 10) * 1000 || 0;\n var err = util.error(new Error(),\n {\n statusCode: statusCode,\n retryable: statusCode >= 500 || statusCode === 429\n }\n );\n if (retryAfter && err.retryable) err.retryAfter = retryAfter;\n errCallback(err);\n }\n });\n }, errCallback);\n };\n\n AWS.util.defer(sendRequest);\n },\n\n /**\n * @api private\n */\n uuid: {\n v4: function uuidV4() {\n return require('uuid').v4();\n }\n },\n\n /**\n * @api private\n */\n convertPayloadToString: function convertPayloadToString(resp) {\n var req = resp.request;\n var operation = req.operation;\n var rules = req.service.api.operations[operation].output || {};\n if (rules.payload && resp.data[rules.payload]) {\n resp.data[rules.payload] = resp.data[rules.payload].toString();\n }\n },\n\n /**\n * @api private\n */\n defer: function defer(callback) {\n if (typeof process === 'object' && typeof process.nextTick === 'function') {\n process.nextTick(callback);\n } else if (typeof setImmediate === 'function') {\n setImmediate(callback);\n } else {\n setTimeout(callback, 0);\n }\n },\n\n /**\n * @api private\n */\n getRequestPayloadShape: function getRequestPayloadShape(req) {\n var operations = req.service.api.operations;\n if (!operations) return undefined;\n var operation = (operations || {})[req.operation];\n if (!operation || !operation.input || !operation.input.payload) return undefined;\n return operation.input.members[operation.input.payload];\n },\n\n getProfilesFromSharedConfig: function getProfilesFromSharedConfig(iniLoader, filename) {\n var profiles = {};\n var profilesFromConfig = {};\n if (process.env[util.configOptInEnv]) {\n var profilesFromConfig = iniLoader.loadFrom({\n isConfig: true,\n filename: process.env[util.sharedConfigFileEnv]\n });\n }\n var profilesFromCreds= {};\n try {\n var profilesFromCreds = iniLoader.loadFrom({\n filename: filename ||\n (process.env[util.configOptInEnv] && process.env[util.sharedCredentialsFileEnv])\n });\n } catch (error) {\n // if using config, assume it is fully descriptive without a credentials file:\n if (!process.env[util.configOptInEnv]) throw error;\n }\n for (var i = 0, profileNames = Object.keys(profilesFromConfig); i < profileNames.length; i++) {\n profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromConfig[profileNames[i]]);\n }\n for (var i = 0, profileNames = Object.keys(profilesFromCreds); i < profileNames.length; i++) {\n profiles[profileNames[i]] = objectAssign(profiles[profileNames[i]] || {}, profilesFromCreds[profileNames[i]]);\n }\n return profiles;\n\n /**\n * Roughly the semantics of `Object.assign(target, source)`\n */\n function objectAssign(target, source) {\n for (var i = 0, keys = Object.keys(source); i < keys.length; i++) {\n target[keys[i]] = source[keys[i]];\n }\n return target;\n }\n },\n\n /**\n * @api private\n */\n ARN: {\n validate: function validateARN(str) {\n return str && str.indexOf('arn:') === 0 && str.split(':').length >= 6;\n },\n parse: function parseARN(arn) {\n var matched = arn.split(':');\n return {\n partition: matched[1],\n service: matched[2],\n region: matched[3],\n accountId: matched[4],\n resource: matched.slice(5).join(':')\n };\n },\n build: function buildARN(arnObject) {\n if (\n arnObject.service === undefined ||\n arnObject.region === undefined ||\n arnObject.accountId === undefined ||\n arnObject.resource === undefined\n ) throw util.error(new Error('Input ARN object is invalid'));\n return 'arn:'+ (arnObject.partition || 'aws') + ':' + arnObject.service +\n ':' + arnObject.region + ':' + arnObject.accountId + ':' + arnObject.resource;\n }\n },\n\n /**\n * @api private\n */\n defaultProfile: 'default',\n\n /**\n * @api private\n */\n configOptInEnv: 'AWS_SDK_LOAD_CONFIG',\n\n /**\n * @api private\n */\n sharedCredentialsFileEnv: 'AWS_SHARED_CREDENTIALS_FILE',\n\n /**\n * @api private\n */\n sharedConfigFileEnv: 'AWS_CONFIG_FILE',\n\n /**\n * @api private\n */\n imdsDisabledEnv: 'AWS_EC2_METADATA_DISABLED'\n};\n\n/**\n * @api private\n */\nmodule.exports = util;\n","var util = require('../util');\nvar XmlNode = require('./xml-node').XmlNode;\nvar XmlText = require('./xml-text').XmlText;\n\nfunction XmlBuilder() { }\n\nXmlBuilder.prototype.toXML = function(params, shape, rootElement, noEmpty) {\n var xml = new XmlNode(rootElement);\n applyNamespaces(xml, shape, true);\n serialize(xml, params, shape);\n return xml.children.length > 0 || noEmpty ? xml.toString() : '';\n};\n\nfunction serialize(xml, value, shape) {\n switch (shape.type) {\n case 'structure': return serializeStructure(xml, value, shape);\n case 'map': return serializeMap(xml, value, shape);\n case 'list': return serializeList(xml, value, shape);\n default: return serializeScalar(xml, value, shape);\n }\n}\n\nfunction serializeStructure(xml, params, shape) {\n util.arrayEach(shape.memberNames, function(memberName) {\n var memberShape = shape.members[memberName];\n if (memberShape.location !== 'body') return;\n\n var value = params[memberName];\n var name = memberShape.name;\n if (value !== undefined && value !== null) {\n if (memberShape.isXmlAttribute) {\n xml.addAttribute(name, value);\n } else if (memberShape.flattened) {\n serialize(xml, value, memberShape);\n } else {\n var element = new XmlNode(name);\n xml.addChildNode(element);\n applyNamespaces(element, memberShape);\n serialize(element, value, memberShape);\n }\n }\n });\n}\n\nfunction serializeMap(xml, map, shape) {\n var xmlKey = shape.key.name || 'key';\n var xmlValue = shape.value.name || 'value';\n\n util.each(map, function(key, value) {\n var entry = new XmlNode(shape.flattened ? shape.name : 'entry');\n xml.addChildNode(entry);\n\n var entryKey = new XmlNode(xmlKey);\n var entryValue = new XmlNode(xmlValue);\n entry.addChildNode(entryKey);\n entry.addChildNode(entryValue);\n\n serialize(entryKey, key, shape.key);\n serialize(entryValue, value, shape.value);\n });\n}\n\nfunction serializeList(xml, list, shape) {\n if (shape.flattened) {\n util.arrayEach(list, function(value) {\n var name = shape.member.name || shape.name;\n var element = new XmlNode(name);\n xml.addChildNode(element);\n serialize(element, value, shape.member);\n });\n } else {\n util.arrayEach(list, function(value) {\n var name = shape.member.name || 'member';\n var element = new XmlNode(name);\n xml.addChildNode(element);\n serialize(element, value, shape.member);\n });\n }\n}\n\nfunction serializeScalar(xml, value, shape) {\n xml.addChildNode(\n new XmlText(shape.toWireFormat(value))\n );\n}\n\nfunction applyNamespaces(xml, shape, isRoot) {\n var uri, prefix = 'xmlns';\n if (shape.xmlNamespaceUri) {\n uri = shape.xmlNamespaceUri;\n if (shape.xmlNamespacePrefix) prefix += ':' + shape.xmlNamespacePrefix;\n } else if (isRoot && shape.api.xmlNamespaceUri) {\n uri = shape.api.xmlNamespaceUri;\n }\n\n if (uri) xml.addAttribute(prefix, uri);\n}\n\n/**\n * @api private\n */\nmodule.exports = XmlBuilder;\n","/**\n * Escapes characters that can not be in an XML attribute.\n */\nfunction escapeAttribute(value) {\n return value.replace(/&/g, '&').replace(/'/g, ''').replace(//g, '>').replace(/\"/g, '"');\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n escapeAttribute: escapeAttribute\n};\n","/**\n * Escapes characters that can not be in an XML element.\n */\nfunction escapeElement(value) {\n return value.replace(/&/g, '&')\n .replace(//g, '>')\n .replace(/\\r/g, ' ')\n .replace(/\\n/g, ' ')\n .replace(/\\u0085/g, '…')\n .replace(/\\u2028/, '
');\n}\n\n/**\n * @api private\n */\nmodule.exports = {\n escapeElement: escapeElement\n};\n","var AWS = require('../core');\nvar util = AWS.util;\nvar Shape = AWS.Model.Shape;\n\nvar xml2js = require('xml2js');\n\n/**\n * @api private\n */\nvar options = { // options passed to xml2js parser\n explicitCharkey: false, // undocumented\n trim: false, // trim the leading/trailing whitespace from text nodes\n normalize: false, // trim interior whitespace inside text nodes\n explicitRoot: false, // return the root node in the resulting object?\n emptyTag: null, // the default value for empty nodes\n explicitArray: true, // always put child nodes in an array\n ignoreAttrs: false, // ignore attributes, only create text nodes\n mergeAttrs: false, // merge attributes and child elements\n validator: null // a callable validator\n};\n\nfunction NodeXmlParser() { }\n\nNodeXmlParser.prototype.parse = function(xml, shape) {\n shape = shape || {};\n\n var result = null;\n var error = null;\n\n var parser = new xml2js.Parser(options);\n parser.parseString(xml, function (e, r) {\n error = e;\n result = r;\n });\n\n if (result) {\n var data = parseXml(result, shape);\n if (result.ResponseMetadata) {\n data.ResponseMetadata = parseXml(result.ResponseMetadata[0], {});\n }\n return data;\n } else if (error) {\n throw util.error(error, {code: 'XMLParserError', retryable: true});\n } else { // empty xml document\n return parseXml({}, shape);\n }\n};\n\nfunction parseXml(xml, shape) {\n switch (shape.type) {\n case 'structure': return parseStructure(xml, shape);\n case 'map': return parseMap(xml, shape);\n case 'list': return parseList(xml, shape);\n case undefined: case null: return parseUnknown(xml);\n default: return parseScalar(xml, shape);\n }\n}\n\nfunction parseStructure(xml, shape) {\n var data = {};\n if (xml === null) return data;\n\n util.each(shape.members, function(memberName, memberShape) {\n var xmlName = memberShape.name;\n if (Object.prototype.hasOwnProperty.call(xml, xmlName) && Array.isArray(xml[xmlName])) {\n var xmlChild = xml[xmlName];\n if (!memberShape.flattened) xmlChild = xmlChild[0];\n\n data[memberName] = parseXml(xmlChild, memberShape);\n } else if (memberShape.isXmlAttribute &&\n xml.$ && Object.prototype.hasOwnProperty.call(xml.$, xmlName)) {\n data[memberName] = parseScalar(xml.$[xmlName], memberShape);\n } else if (memberShape.type === 'list' && !shape.api.xmlNoDefaultLists) {\n data[memberName] = memberShape.defaultValue;\n }\n });\n\n return data;\n}\n\nfunction parseMap(xml, shape) {\n var data = {};\n if (xml === null) return data;\n\n var xmlKey = shape.key.name || 'key';\n var xmlValue = shape.value.name || 'value';\n var iterable = shape.flattened ? xml : xml.entry;\n\n if (Array.isArray(iterable)) {\n util.arrayEach(iterable, function(child) {\n data[child[xmlKey][0]] = parseXml(child[xmlValue][0], shape.value);\n });\n }\n\n return data;\n}\n\nfunction parseList(xml, shape) {\n var data = [];\n var name = shape.member.name || 'member';\n if (shape.flattened) {\n util.arrayEach(xml, function(xmlChild) {\n data.push(parseXml(xmlChild, shape.member));\n });\n } else if (xml && Array.isArray(xml[name])) {\n util.arrayEach(xml[name], function(child) {\n data.push(parseXml(child, shape.member));\n });\n }\n\n return data;\n}\n\nfunction parseScalar(text, shape) {\n if (text && text.$ && text.$.encoding === 'base64') {\n shape = new Shape.create({type: text.$.encoding});\n }\n if (text && text._) text = text._;\n\n if (typeof shape.toType === 'function') {\n return shape.toType(text);\n } else {\n return text;\n }\n}\n\nfunction parseUnknown(xml) {\n if (xml === undefined || xml === null) return '';\n if (typeof xml === 'string') return xml;\n\n // parse a list\n if (Array.isArray(xml)) {\n var arr = [];\n for (i = 0; i < xml.length; i++) {\n arr.push(parseXml(xml[i], {}));\n }\n return arr;\n }\n\n // empty object\n var keys = Object.keys(xml), i;\n if (keys.length === 0 || (keys.length === 1 && keys[0] === '$')) {\n return {};\n }\n\n // object, parse as structure\n var data = {};\n for (i = 0; i < keys.length; i++) {\n var key = keys[i], value = xml[key];\n if (key === '$') continue;\n if (value.length > 1) { // this member is a list\n data[key] = parseList(value, {member: {}});\n } else { // this member is a single item\n data[key] = parseXml(value[0], {});\n }\n }\n return data;\n}\n\n/**\n * @api private\n */\nmodule.exports = NodeXmlParser;\n","var escapeAttribute = require('./escape-attribute').escapeAttribute;\n\n/**\n * Represents an XML node.\n * @api private\n */\nfunction XmlNode(name, children) {\n if (children === void 0) { children = []; }\n this.name = name;\n this.children = children;\n this.attributes = {};\n}\nXmlNode.prototype.addAttribute = function (name, value) {\n this.attributes[name] = value;\n return this;\n};\nXmlNode.prototype.addChildNode = function (child) {\n this.children.push(child);\n return this;\n};\nXmlNode.prototype.removeAttribute = function (name) {\n delete this.attributes[name];\n return this;\n};\nXmlNode.prototype.toString = function () {\n var hasChildren = Boolean(this.children.length);\n var xmlText = '<' + this.name;\n // add attributes\n var attributes = this.attributes;\n for (var i = 0, attributeNames = Object.keys(attributes); i < attributeNames.length; i++) {\n var attributeName = attributeNames[i];\n var attribute = attributes[attributeName];\n if (typeof attribute !== 'undefined' && attribute !== null) {\n xmlText += ' ' + attributeName + '=\\\"' + escapeAttribute('' + attribute) + '\\\"';\n }\n }\n return xmlText += !hasChildren ? '/>' : '>' + this.children.map(function (c) { return c.toString(); }).join('') + '';\n};\n\n/**\n * @api private\n */\nmodule.exports = {\n XmlNode: XmlNode\n};\n","var escapeElement = require('./escape-element').escapeElement;\n\n/**\n * Represents an XML text value.\n * @api private\n */\nfunction XmlText(value) {\n this.value = value;\n}\n\nXmlText.prototype.toString = function () {\n return escapeElement('' + this.value);\n};\n\n/**\n * @api private\n */\nmodule.exports = {\n XmlText: XmlText\n};\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\n/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\n\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex; // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n\n 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('');\n}\n\nvar _default = bytesToUuid;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"v1\", {\n enumerable: true,\n get: function () {\n return _v.default;\n }\n});\nObject.defineProperty(exports, \"v3\", {\n enumerable: true,\n get: function () {\n return _v2.default;\n }\n});\nObject.defineProperty(exports, \"v4\", {\n enumerable: true,\n get: function () {\n return _v3.default;\n }\n});\nObject.defineProperty(exports, \"v5\", {\n enumerable: true,\n get: function () {\n return _v4.default;\n }\n});\n\nvar _v = _interopRequireDefault(require(\"./v1.js\"));\n\nvar _v2 = _interopRequireDefault(require(\"./v3.js\"));\n\nvar _v3 = _interopRequireDefault(require(\"./v4.js\"));\n\nvar _v4 = _interopRequireDefault(require(\"./v5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction md5(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('md5').update(bytes).digest();\n}\n\nvar _default = md5;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = rng;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction rng() {\n return _crypto.default.randomBytes(16);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _crypto = _interopRequireDefault(require(\"crypto\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction sha1(bytes) {\n if (Array.isArray(bytes)) {\n bytes = Buffer.from(bytes);\n } else if (typeof bytes === 'string') {\n bytes = Buffer.from(bytes, 'utf8');\n }\n\n return _crypto.default.createHash('sha1').update(bytes).digest();\n}\n\nvar _default = sha1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _bytesToUuid = _interopRequireDefault(require(\"./bytesToUuid.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\nvar _nodeId;\n\nvar _clockseq; // Previous uuid creation time\n\n\nvar _lastMSecs = 0;\nvar _lastNSecs = 0; // See https://github.com/uuidjs/uuid for API details\n\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n\n if (node == null || clockseq == null) {\n var seedBytes = options.random || (options.rng || _rng.default)();\n\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [seedBytes[0] | 0x01, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];\n }\n\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n } // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n\n\n 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\n // cycle to simulate higher resolution clock\n\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; // Time since last uuid creation (in msecs)\n\n var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000; // Per 4.2.1.2, Bump clockseq on clock regression\n\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n } // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n\n\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n } // Per 4.2.1.2 Throw error if too many uuids are requested\n\n\n if (nsecs >= 10000) {\n throw new Error(\"uuid.v1(): Can't create more than 10M uuids/sec\");\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq; // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n\n msecs += 12219292800000; // `time_low`\n\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff; // `time_mid`\n\n var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff; // `time_high_and_version`\n\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n\n b[i++] = tmh >>> 16 & 0xff; // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n\n b[i++] = clockseq >>> 8 | 0x80; // `clock_seq_low`\n\n b[i++] = clockseq & 0xff; // `node`\n\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : (0, _bytesToUuid.default)(b);\n}\n\nvar _default = v1;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _md = _interopRequireDefault(require(\"./md5.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v3 = (0, _v.default)('v3', 0x30, _md.default);\nvar _default = v3;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = _default;\nexports.URL = exports.DNS = void 0;\n\nvar _bytesToUuid = _interopRequireDefault(require(\"./bytesToUuid.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction uuidToBytes(uuid) {\n // Note: We assume we're being passed a valid uuid string\n var bytes = [];\n uuid.replace(/[a-fA-F0-9]{2}/g, function (hex) {\n bytes.push(parseInt(hex, 16));\n });\n return bytes;\n}\n\nfunction stringToBytes(str) {\n str = unescape(encodeURIComponent(str)); // UTF8 escape\n\n var bytes = new Array(str.length);\n\n for (var i = 0; i < str.length; i++) {\n bytes[i] = str.charCodeAt(i);\n }\n\n return bytes;\n}\n\nconst DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8';\nexports.DNS = DNS;\nconst URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8';\nexports.URL = URL;\n\nfunction _default(name, version, hashfunc) {\n var generateUUID = function (value, namespace, buf, offset) {\n var off = buf && offset || 0;\n if (typeof value == 'string') value = stringToBytes(value);\n if (typeof namespace == 'string') namespace = uuidToBytes(namespace);\n if (!Array.isArray(value)) throw TypeError('value must be an array of bytes');\n if (!Array.isArray(namespace) || namespace.length !== 16) throw TypeError('namespace must be uuid string or an Array of 16 byte values'); // Per 4.3\n\n var bytes = hashfunc(namespace.concat(value));\n bytes[6] = bytes[6] & 0x0f | version;\n bytes[8] = bytes[8] & 0x3f | 0x80;\n\n if (buf) {\n for (var idx = 0; idx < 16; ++idx) {\n buf[off + idx] = bytes[idx];\n }\n }\n\n return buf || (0, _bytesToUuid.default)(bytes);\n }; // Function#name is not settable on some platforms (#270)\n\n\n try {\n generateUUID.name = name;\n } catch (err) {} // For CommonJS default export support\n\n\n generateUUID.DNS = DNS;\n generateUUID.URL = URL;\n return generateUUID;\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _rng = _interopRequireDefault(require(\"./rng.js\"));\n\nvar _bytesToUuid = _interopRequireDefault(require(\"./bytesToUuid.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof options == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n\n options = options || {};\n\n var rnds = options.random || (options.rng || _rng.default)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n\n\n rnds[6] = rnds[6] & 0x0f | 0x40;\n rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided\n\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || (0, _bytesToUuid.default)(rnds);\n}\n\nvar _default = v4;\nexports.default = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _v = _interopRequireDefault(require(\"./v35.js\"));\n\nvar _sha = _interopRequireDefault(require(\"./sha1.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nconst v5 = (0, _v.default)('v5', 0x50, _sha.default);\nvar _default = v5;\nexports.default = _default;","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LRU_1 = require(\"./utils/LRU\");\nvar CACHE_SIZE = 1000;\n/**\n * Inspired node-lru-cache[https://github.com/isaacs/node-lru-cache]\n */\nvar EndpointCache = /** @class */ (function () {\n function EndpointCache(maxSize) {\n if (maxSize === void 0) { maxSize = CACHE_SIZE; }\n this.maxSize = maxSize;\n this.cache = new LRU_1.LRUCache(maxSize);\n }\n ;\n Object.defineProperty(EndpointCache.prototype, \"size\", {\n get: function () {\n return this.cache.length;\n },\n enumerable: true,\n configurable: true\n });\n EndpointCache.prototype.put = function (key, value) {\n var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;\n var endpointRecord = this.populateValue(value);\n this.cache.put(keyString, endpointRecord);\n };\n EndpointCache.prototype.get = function (key) {\n var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;\n var now = Date.now();\n var records = this.cache.get(keyString);\n if (records) {\n for (var i = records.length-1; i >= 0; i--) {\n var record = records[i];\n if (record.Expire < now) {\n records.splice(i, 1);\n }\n }\n if (records.length === 0) {\n this.cache.remove(keyString);\n return undefined;\n }\n }\n return records;\n };\n EndpointCache.getKeyString = function (key) {\n var identifiers = [];\n var identifierNames = Object.keys(key).sort();\n for (var i = 0; i < identifierNames.length; i++) {\n var identifierName = identifierNames[i];\n if (key[identifierName] === undefined)\n continue;\n identifiers.push(key[identifierName]);\n }\n return identifiers.join(' ');\n };\n EndpointCache.prototype.populateValue = function (endpoints) {\n var now = Date.now();\n return endpoints.map(function (endpoint) { return ({\n Address: endpoint.Address || '',\n Expire: now + (endpoint.CachePeriodInMinutes || 1) * 60 * 1000\n }); });\n };\n EndpointCache.prototype.empty = function () {\n this.cache.empty();\n };\n EndpointCache.prototype.remove = function (key) {\n var keyString = typeof key !== 'string' ? EndpointCache.getKeyString(key) : key;\n this.cache.remove(keyString);\n };\n return EndpointCache;\n}());\nexports.EndpointCache = EndpointCache;","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LinkedListNode = /** @class */ (function () {\n function LinkedListNode(key, value) {\n this.key = key;\n this.value = value;\n }\n return LinkedListNode;\n}());\nvar LRUCache = /** @class */ (function () {\n function LRUCache(size) {\n this.nodeMap = {};\n this.size = 0;\n if (typeof size !== 'number' || size < 1) {\n throw new Error('Cache size can only be positive number');\n }\n this.sizeLimit = size;\n }\n Object.defineProperty(LRUCache.prototype, \"length\", {\n get: function () {\n return this.size;\n },\n enumerable: true,\n configurable: true\n });\n LRUCache.prototype.prependToList = function (node) {\n if (!this.headerNode) {\n this.tailNode = node;\n }\n else {\n this.headerNode.prev = node;\n node.next = this.headerNode;\n }\n this.headerNode = node;\n this.size++;\n };\n LRUCache.prototype.removeFromTail = function () {\n if (!this.tailNode) {\n return undefined;\n }\n var node = this.tailNode;\n var prevNode = node.prev;\n if (prevNode) {\n prevNode.next = undefined;\n }\n node.prev = undefined;\n this.tailNode = prevNode;\n this.size--;\n return node;\n };\n LRUCache.prototype.detachFromList = function (node) {\n if (this.headerNode === node) {\n this.headerNode = node.next;\n }\n if (this.tailNode === node) {\n this.tailNode = node.prev;\n }\n if (node.prev) {\n node.prev.next = node.next;\n }\n if (node.next) {\n node.next.prev = node.prev;\n }\n node.next = undefined;\n node.prev = undefined;\n this.size--;\n };\n LRUCache.prototype.get = function (key) {\n if (this.nodeMap[key]) {\n var node = this.nodeMap[key];\n this.detachFromList(node);\n this.prependToList(node);\n return node.value;\n }\n };\n LRUCache.prototype.remove = function (key) {\n if (this.nodeMap[key]) {\n var node = this.nodeMap[key];\n this.detachFromList(node);\n delete this.nodeMap[key];\n }\n };\n LRUCache.prototype.put = function (key, value) {\n if (this.nodeMap[key]) {\n this.remove(key);\n }\n else if (this.size === this.sizeLimit) {\n var tailNode = this.removeFromTail();\n var key_1 = tailNode.key;\n delete this.nodeMap[key_1];\n }\n var newNode = new LinkedListNode(key, value);\n this.nodeMap[key] = newNode;\n this.prependToList(newNode);\n };\n LRUCache.prototype.empty = function () {\n var keys = Object.keys(this.nodeMap);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n var node = this.nodeMap[key];\n this.detachFromList(node);\n delete this.nodeMap[key];\n }\n };\n return LRUCache;\n}());\nexports.LRUCache = LRUCache;","\n/*!\n * Copyright 2010 LearnBoost \n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Module dependencies.\n */\n\nvar crypto = require('crypto')\n , parse = require('url').parse\n ;\n\n/**\n * Valid keys.\n */\n\nvar keys = \n [ 'acl'\n , 'location'\n , 'logging'\n , 'notification'\n , 'partNumber'\n , 'policy'\n , 'requestPayment'\n , 'torrent'\n , 'uploadId'\n , 'uploads'\n , 'versionId'\n , 'versioning'\n , 'versions'\n , 'website'\n ]\n\n/**\n * Return an \"Authorization\" header value with the given `options`\n * in the form of \"AWS :\"\n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction authorization (options) {\n return 'AWS ' + options.key + ':' + sign(options)\n}\n\nmodule.exports = authorization\nmodule.exports.authorization = authorization\n\n/**\n * Simple HMAC-SHA1 Wrapper\n *\n * @param {Object} options\n * @return {String}\n * @api private\n */ \n\nfunction hmacSha1 (options) {\n return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')\n}\n\nmodule.exports.hmacSha1 = hmacSha1\n\n/**\n * Create a base64 sha1 HMAC for `options`. \n * \n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction sign (options) {\n options.message = stringToSign(options)\n return hmacSha1(options)\n}\nmodule.exports.sign = sign\n\n/**\n * Create a base64 sha1 HMAC for `options`. \n *\n * Specifically to be used with S3 presigned URLs\n * \n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction signQuery (options) {\n options.message = queryStringToSign(options)\n return hmacSha1(options)\n}\nmodule.exports.signQuery= signQuery\n\n/**\n * Return a string for sign() with the given `options`.\n *\n * Spec:\n * \n * \\n\n * \\n\n * \\n\n * \\n\n * [headers\\n]\n * \n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction stringToSign (options) {\n var headers = options.amazonHeaders || ''\n if (headers) headers += '\\n'\n var r = \n [ options.verb\n , options.md5\n , options.contentType\n , options.date ? options.date.toUTCString() : ''\n , headers + options.resource\n ]\n return r.join('\\n')\n}\nmodule.exports.stringToSign = stringToSign\n\n/**\n * Return a string for sign() with the given `options`, but is meant exclusively\n * for S3 presigned URLs\n *\n * Spec:\n * \n * \\n\n * \n *\n * @param {Object} options\n * @return {String}\n * @api private\n */\n\nfunction queryStringToSign (options){\n return 'GET\\n\\n\\n' + options.date + '\\n' + options.resource\n}\nmodule.exports.queryStringToSign = queryStringToSign\n\n/**\n * Perform the following:\n *\n * - ignore non-amazon headers\n * - lowercase fields\n * - sort lexicographically\n * - trim whitespace between \":\"\n * - join with newline\n *\n * @param {Object} headers\n * @return {String}\n * @api private\n */\n\nfunction canonicalizeHeaders (headers) {\n var buf = []\n , fields = Object.keys(headers)\n ;\n for (var i = 0, len = fields.length; i < len; ++i) {\n var field = fields[i]\n , val = headers[field]\n , field = field.toLowerCase()\n ;\n if (0 !== field.indexOf('x-amz')) continue\n buf.push(field + ':' + val)\n }\n return buf.sort().join('\\n')\n}\nmodule.exports.canonicalizeHeaders = canonicalizeHeaders\n\n/**\n * Perform the following:\n *\n * - ignore non sub-resources\n * - sort lexicographically\n *\n * @param {String} resource\n * @return {String}\n * @api private\n */\n\nfunction canonicalizeResource (resource) {\n var url = parse(resource, true)\n , path = url.pathname\n , buf = []\n ;\n\n Object.keys(url.query).forEach(function(key){\n if (!~keys.indexOf(key)) return\n var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])\n buf.push(key + val)\n })\n\n return path + (buf.length ? '?' + buf.sort().join('&') : '')\n}\nmodule.exports.canonicalizeResource = canonicalizeResource\n","var aws4 = exports,\n url = require('url'),\n querystring = require('querystring'),\n crypto = require('crypto'),\n lru = require('./lru'),\n credentialsCache = lru(1000)\n\n// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html\n\nfunction hmac(key, string, encoding) {\n return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding)\n}\n\nfunction hash(string, encoding) {\n return crypto.createHash('sha256').update(string, 'utf8').digest(encoding)\n}\n\n// This function assumes the string has already been percent encoded\nfunction encodeRfc3986(urlEncodedString) {\n return urlEncodedString.replace(/[!'()*]/g, function(c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\nfunction encodeRfc3986Full(str) {\n return encodeRfc3986(encodeURIComponent(str))\n}\n\n// A bit of a combination of:\n// https://github.com/aws/aws-sdk-java-v2/blob/dc695de6ab49ad03934e1b02e7263abbd2354be0/core/auth/src/main/java/software/amazon/awssdk/auth/signer/internal/AbstractAws4Signer.java#L59\n// https://github.com/aws/aws-sdk-js/blob/18cb7e5b463b46239f9fdd4a65e2ff8c81831e8f/lib/signers/v4.js#L191-L199\n// https://github.com/mhart/aws4fetch/blob/b3aed16b6f17384cf36ea33bcba3c1e9f3bdfefd/src/main.js#L25-L34\nvar HEADERS_TO_IGNORE = {\n 'authorization': true,\n 'connection': true,\n 'x-amzn-trace-id': true,\n 'user-agent': true,\n 'expect': true,\n 'presigned-expires': true,\n 'range': true,\n}\n\n// request: { path | body, [host], [method], [headers], [service], [region] }\n// credentials: { accessKeyId, secretAccessKey, [sessionToken] }\nfunction RequestSigner(request, credentials) {\n\n if (typeof request === 'string') request = url.parse(request)\n\n var headers = request.headers = (request.headers || {}),\n hostParts = (!this.service || !this.region) && this.matchHost(request.hostname || request.host || headers.Host || headers.host)\n\n this.request = request\n this.credentials = credentials || this.defaultCredentials()\n\n this.service = request.service || hostParts[0] || ''\n this.region = request.region || hostParts[1] || 'us-east-1'\n\n // SES uses a different domain from the service name\n if (this.service === 'email') this.service = 'ses'\n\n if (!request.method && request.body)\n request.method = 'POST'\n\n if (!headers.Host && !headers.host) {\n headers.Host = request.hostname || request.host || this.createHost()\n\n // If a port is specified explicitly, use it as is\n if (request.port)\n headers.Host += ':' + request.port\n }\n if (!request.hostname && !request.host)\n request.hostname = headers.Host || headers.host\n\n this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT'\n\n this.extraHeadersToIgnore = request.extraHeadersToIgnore || Object.create(null)\n this.extraHeadersToInclude = request.extraHeadersToInclude || Object.create(null)\n}\n\nRequestSigner.prototype.matchHost = function(host) {\n var match = (host || '').match(/([^\\.]+)\\.(?:([^\\.]*)\\.)?amazonaws\\.com(\\.cn)?$/)\n var hostParts = (match || []).slice(1, 3)\n\n // ES's hostParts are sometimes the other way round, if the value that is expected\n // to be region equals ‘es’ switch them back\n // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com\n if (hostParts[1] === 'es' || hostParts[1] === 'aoss')\n hostParts = hostParts.reverse()\n\n if (hostParts[1] == 's3') {\n hostParts[0] = 's3'\n hostParts[1] = 'us-east-1'\n } else {\n for (var i = 0; i < 2; i++) {\n if (/^s3-/.test(hostParts[i])) {\n hostParts[1] = hostParts[i].slice(3)\n hostParts[0] = 's3'\n break\n }\n }\n }\n\n return hostParts\n}\n\n// http://docs.aws.amazon.com/general/latest/gr/rande.html\nRequestSigner.prototype.isSingleRegion = function() {\n // Special case for S3 and SimpleDB in us-east-1\n if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true\n\n return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts']\n .indexOf(this.service) >= 0\n}\n\nRequestSigner.prototype.createHost = function() {\n var region = this.isSingleRegion() ? '' : '.' + this.region,\n subdomain = this.service === 'ses' ? 'email' : this.service\n return subdomain + region + '.amazonaws.com'\n}\n\nRequestSigner.prototype.prepareRequest = function() {\n this.parsePath()\n\n var request = this.request, headers = request.headers, query\n\n if (request.signQuery) {\n\n this.parsedPath.query = query = this.parsedPath.query || {}\n\n if (this.credentials.sessionToken)\n query['X-Amz-Security-Token'] = this.credentials.sessionToken\n\n if (this.service === 's3' && !query['X-Amz-Expires'])\n query['X-Amz-Expires'] = 86400\n\n if (query['X-Amz-Date'])\n this.datetime = query['X-Amz-Date']\n else\n query['X-Amz-Date'] = this.getDateTime()\n\n query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'\n query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString()\n query['X-Amz-SignedHeaders'] = this.signedHeaders()\n\n } else {\n\n if (!request.doNotModifyHeaders && !this.isCodeCommitGit) {\n if (request.body && !headers['Content-Type'] && !headers['content-type'])\n headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'\n\n if (request.body && !headers['Content-Length'] && !headers['content-length'])\n headers['Content-Length'] = Buffer.byteLength(request.body)\n\n if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token'])\n headers['X-Amz-Security-Token'] = this.credentials.sessionToken\n\n if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256'])\n headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex')\n\n if (headers['X-Amz-Date'] || headers['x-amz-date'])\n this.datetime = headers['X-Amz-Date'] || headers['x-amz-date']\n else\n headers['X-Amz-Date'] = this.getDateTime()\n }\n\n delete headers.Authorization\n delete headers.authorization\n }\n}\n\nRequestSigner.prototype.sign = function() {\n if (!this.parsedPath) this.prepareRequest()\n\n if (this.request.signQuery) {\n this.parsedPath.query['X-Amz-Signature'] = this.signature()\n } else {\n this.request.headers.Authorization = this.authHeader()\n }\n\n this.request.path = this.formatPath()\n\n return this.request\n}\n\nRequestSigner.prototype.getDateTime = function() {\n if (!this.datetime) {\n var headers = this.request.headers,\n date = new Date(headers.Date || headers.date || new Date)\n\n this.datetime = date.toISOString().replace(/[:\\-]|\\.\\d{3}/g, '')\n\n // Remove the trailing 'Z' on the timestamp string for CodeCommit git access\n if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1)\n }\n return this.datetime\n}\n\nRequestSigner.prototype.getDate = function() {\n return this.getDateTime().substr(0, 8)\n}\n\nRequestSigner.prototype.authHeader = function() {\n return [\n 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(),\n 'SignedHeaders=' + this.signedHeaders(),\n 'Signature=' + this.signature(),\n ].join(', ')\n}\n\nRequestSigner.prototype.signature = function() {\n var date = this.getDate(),\n cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(),\n kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)\n if (!kCredentials) {\n kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)\n kRegion = hmac(kDate, this.region)\n kService = hmac(kRegion, this.service)\n kCredentials = hmac(kService, 'aws4_request')\n credentialsCache.set(cacheKey, kCredentials)\n }\n return hmac(kCredentials, this.stringToSign(), 'hex')\n}\n\nRequestSigner.prototype.stringToSign = function() {\n return [\n 'AWS4-HMAC-SHA256',\n this.getDateTime(),\n this.credentialString(),\n hash(this.canonicalString(), 'hex'),\n ].join('\\n')\n}\n\nRequestSigner.prototype.canonicalString = function() {\n if (!this.parsedPath) this.prepareRequest()\n\n var pathStr = this.parsedPath.path,\n query = this.parsedPath.query,\n headers = this.request.headers,\n queryStr = '',\n normalizePath = this.service !== 's3',\n decodePath = this.service === 's3' || this.request.doNotEncodePath,\n decodeSlashesInPath = this.service === 's3',\n firstValOnly = this.service === 's3',\n bodyHash\n\n if (this.service === 's3' && this.request.signQuery) {\n bodyHash = 'UNSIGNED-PAYLOAD'\n } else if (this.isCodeCommitGit) {\n bodyHash = ''\n } else {\n bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] ||\n hash(this.request.body || '', 'hex')\n }\n\n if (query) {\n var reducedQuery = Object.keys(query).reduce(function(obj, key) {\n if (!key) return obj\n obj[encodeRfc3986Full(key)] = !Array.isArray(query[key]) ? query[key] :\n (firstValOnly ? query[key][0] : query[key])\n return obj\n }, {})\n var encodedQueryPieces = []\n Object.keys(reducedQuery).sort().forEach(function(key) {\n if (!Array.isArray(reducedQuery[key])) {\n encodedQueryPieces.push(key + '=' + encodeRfc3986Full(reducedQuery[key]))\n } else {\n reducedQuery[key].map(encodeRfc3986Full).sort()\n .forEach(function(val) { encodedQueryPieces.push(key + '=' + val) })\n }\n })\n queryStr = encodedQueryPieces.join('&')\n }\n if (pathStr !== '/') {\n if (normalizePath) pathStr = pathStr.replace(/\\/{2,}/g, '/')\n pathStr = pathStr.split('/').reduce(function(path, piece) {\n if (normalizePath && piece === '..') {\n path.pop()\n } else if (!normalizePath || piece !== '.') {\n if (decodePath) piece = decodeURIComponent(piece.replace(/\\+/g, ' '))\n path.push(encodeRfc3986Full(piece))\n }\n return path\n }, []).join('/')\n if (pathStr[0] !== '/') pathStr = '/' + pathStr\n if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')\n }\n\n return [\n this.request.method || 'GET',\n pathStr,\n queryStr,\n this.canonicalHeaders() + '\\n',\n this.signedHeaders(),\n bodyHash,\n ].join('\\n')\n}\n\nRequestSigner.prototype.canonicalHeaders = function() {\n var headers = this.request.headers\n function trimAll(header) {\n return header.toString().trim().replace(/\\s+/g, ' ')\n }\n return Object.keys(headers)\n .filter(function(key) { return HEADERS_TO_IGNORE[key.toLowerCase()] == null })\n .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })\n .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })\n .join('\\n')\n}\n\nRequestSigner.prototype.signedHeaders = function() {\n var extraHeadersToInclude = this.extraHeadersToInclude,\n extraHeadersToIgnore = this.extraHeadersToIgnore\n return Object.keys(this.request.headers)\n .map(function(key) { return key.toLowerCase() })\n .filter(function(key) {\n return extraHeadersToInclude[key] ||\n (HEADERS_TO_IGNORE[key] == null && !extraHeadersToIgnore[key])\n })\n .sort()\n .join(';')\n}\n\nRequestSigner.prototype.credentialString = function() {\n return [\n this.getDate(),\n this.region,\n this.service,\n 'aws4_request',\n ].join('/')\n}\n\nRequestSigner.prototype.defaultCredentials = function() {\n var env = process.env\n return {\n accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,\n secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,\n sessionToken: env.AWS_SESSION_TOKEN,\n }\n}\n\nRequestSigner.prototype.parsePath = function() {\n var path = this.request.path || '/'\n\n // S3 doesn't always encode characters > 127 correctly and\n // all services don't encode characters > 255 correctly\n // So if there are non-reserved chars (and it's not already all % encoded), just encode them all\n if (/[^0-9A-Za-z;,/?:@&=+$\\-_.!~*'()#%]/.test(path)) {\n path = encodeURI(decodeURI(path))\n }\n\n var queryIx = path.indexOf('?'),\n query = null\n\n if (queryIx >= 0) {\n query = querystring.parse(path.slice(queryIx + 1))\n path = path.slice(0, queryIx)\n }\n\n this.parsedPath = {\n path: path,\n query: query,\n }\n}\n\nRequestSigner.prototype.formatPath = function() {\n var path = this.parsedPath.path,\n query = this.parsedPath.query\n\n if (!query) return path\n\n // Services don't support empty query string keys\n if (query[''] != null) delete query['']\n\n return path + '?' + encodeRfc3986(querystring.stringify(query))\n}\n\naws4.RequestSigner = RequestSigner\n\naws4.sign = function(request, credentials) {\n return new RequestSigner(request, credentials).sign()\n}\n","module.exports = function(size) {\n return new LruCache(size)\n}\n\nfunction LruCache(size) {\n this.capacity = size | 0\n this.map = Object.create(null)\n this.list = new DoublyLinkedList()\n}\n\nLruCache.prototype.get = function(key) {\n var node = this.map[key]\n if (node == null) return undefined\n this.used(node)\n return node.val\n}\n\nLruCache.prototype.set = function(key, val) {\n var node = this.map[key]\n if (node != null) {\n node.val = val\n } else {\n if (!this.capacity) this.prune()\n if (!this.capacity) return false\n node = new DoublyLinkedNode(key, val)\n this.map[key] = node\n this.capacity--\n }\n this.used(node)\n return true\n}\n\nLruCache.prototype.used = function(node) {\n this.list.moveToFront(node)\n}\n\nLruCache.prototype.prune = function() {\n var node = this.list.pop()\n if (node != null) {\n delete this.map[node.key]\n this.capacity++\n }\n}\n\n\nfunction DoublyLinkedList() {\n this.firstNode = null\n this.lastNode = null\n}\n\nDoublyLinkedList.prototype.moveToFront = function(node) {\n if (this.firstNode == node) return\n\n this.remove(node)\n\n if (this.firstNode == null) {\n this.firstNode = node\n this.lastNode = node\n node.prev = null\n node.next = null\n } else {\n node.prev = null\n node.next = this.firstNode\n node.next.prev = node\n this.firstNode = node\n }\n}\n\nDoublyLinkedList.prototype.pop = function() {\n var lastNode = this.lastNode\n if (lastNode != null) {\n this.remove(lastNode)\n }\n return lastNode\n}\n\nDoublyLinkedList.prototype.remove = function(node) {\n if (this.firstNode == node) {\n this.firstNode = node.next\n } else if (node.prev != null) {\n node.prev.next = node.next\n }\n if (this.lastNode == node) {\n this.lastNode = node.prev\n } else if (node.next != null) {\n node.next.prev = node.prev\n }\n}\n\n\nfunction DoublyLinkedNode(key, val) {\n this.key = key\n this.val = val\n this.prev = null\n this.next = null\n}\n","'use strict';\nmodule.exports = balanced;\nfunction balanced(a, b, str) {\n if (a instanceof RegExp) a = maybeMatch(a, str);\n if (b instanceof RegExp) b = maybeMatch(b, str);\n\n var r = range(a, b, str);\n\n return r && {\n start: r[0],\n end: r[1],\n pre: str.slice(0, r[0]),\n body: str.slice(r[0] + a.length, r[1]),\n post: str.slice(r[1] + b.length)\n };\n}\n\nfunction maybeMatch(reg, str) {\n var m = str.match(reg);\n return m ? m[0] : null;\n}\n\nbalanced.range = range;\nfunction range(a, b, str) {\n var begs, beg, left, right, result;\n var ai = str.indexOf(a);\n var bi = str.indexOf(b, ai + 1);\n var i = ai;\n\n if (ai >= 0 && bi > 0) {\n if(a===b) {\n return [ai, bi];\n }\n begs = [];\n left = str.length;\n\n while (i >= 0 && !result) {\n if (i == ai) {\n begs.push(i);\n ai = str.indexOf(a, i + 1);\n } else if (begs.length == 1) {\n result = [ begs.pop(), bi ];\n } else {\n beg = begs.pop();\n if (beg < left) {\n left = beg;\n right = bi;\n }\n\n bi = str.indexOf(b, i + 1);\n }\n\n i = ai < bi && ai >= 0 ? ai : bi;\n }\n\n if (begs.length) {\n result = [ left, right ];\n }\n }\n\n return result;\n}\n","/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */\n;(function(root) {\n\n\t// Detect free variables `exports`.\n\tvar freeExports = typeof exports == 'object' && exports;\n\n\t// Detect free variable `module`.\n\tvar freeModule = typeof module == 'object' && module &&\n\t\tmodule.exports == freeExports && module;\n\n\t// Detect free variable `global`, from Node.js or Browserified code, and use\n\t// it as `root`.\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\troot = freeGlobal;\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\tvar InvalidCharacterError = function(message) {\n\t\tthis.message = message;\n\t};\n\tInvalidCharacterError.prototype = new Error;\n\tInvalidCharacterError.prototype.name = 'InvalidCharacterError';\n\n\tvar error = function(message) {\n\t\t// Note: the error messages used throughout this file match those used by\n\t\t// the native `atob`/`btoa` implementation in Chromium.\n\t\tthrow new InvalidCharacterError(message);\n\t};\n\n\tvar TABLE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n\t// http://whatwg.org/html/common-microsyntaxes.html#space-character\n\tvar REGEX_SPACE_CHARACTERS = /[\\t\\n\\f\\r ]/g;\n\n\t// `decode` is designed to be fully compatible with `atob` as described in the\n\t// HTML Standard. http://whatwg.org/html/webappapis.html#dom-windowbase64-atob\n\t// The optimized base64-decoding algorithm used is based on @atk’s excellent\n\t// implementation. https://gist.github.com/atk/1020396\n\tvar decode = function(input) {\n\t\tinput = String(input)\n\t\t\t.replace(REGEX_SPACE_CHARACTERS, '');\n\t\tvar length = input.length;\n\t\tif (length % 4 == 0) {\n\t\t\tinput = input.replace(/==?$/, '');\n\t\t\tlength = input.length;\n\t\t}\n\t\tif (\n\t\t\tlength % 4 == 1 ||\n\t\t\t// http://whatwg.org/C#alphanumeric-ascii-characters\n\t\t\t/[^+a-zA-Z0-9/]/.test(input)\n\t\t) {\n\t\t\terror(\n\t\t\t\t'Invalid character: the string to be decoded is not correctly encoded.'\n\t\t\t);\n\t\t}\n\t\tvar bitCounter = 0;\n\t\tvar bitStorage;\n\t\tvar buffer;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\twhile (++position < length) {\n\t\t\tbuffer = TABLE.indexOf(input.charAt(position));\n\t\t\tbitStorage = bitCounter % 4 ? bitStorage * 64 + buffer : buffer;\n\t\t\t// Unless this is the first of a group of 4 characters…\n\t\t\tif (bitCounter++ % 4) {\n\t\t\t\t// …convert the first 8 bits to a single ASCII character.\n\t\t\t\toutput += String.fromCharCode(\n\t\t\t\t\t0xFF & bitStorage >> (-2 * bitCounter & 6)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t};\n\n\t// `encode` is designed to be fully compatible with `btoa` as described in the\n\t// HTML Standard: http://whatwg.org/html/webappapis.html#dom-windowbase64-btoa\n\tvar encode = function(input) {\n\t\tinput = String(input);\n\t\tif (/[^\\0-\\xFF]/.test(input)) {\n\t\t\t// Note: no need to special-case astral symbols here, as surrogates are\n\t\t\t// matched, and the input is supposed to only contain ASCII anyway.\n\t\t\terror(\n\t\t\t\t'The string to be encoded contains characters outside of the ' +\n\t\t\t\t'Latin1 range.'\n\t\t\t);\n\t\t}\n\t\tvar padding = input.length % 3;\n\t\tvar output = '';\n\t\tvar position = -1;\n\t\tvar a;\n\t\tvar b;\n\t\tvar c;\n\t\tvar buffer;\n\t\t// Make sure any padding is handled outside of the loop.\n\t\tvar length = input.length - padding;\n\n\t\twhile (++position < length) {\n\t\t\t// Read three bytes, i.e. 24 bits.\n\t\t\ta = input.charCodeAt(position) << 16;\n\t\t\tb = input.charCodeAt(++position) << 8;\n\t\t\tc = input.charCodeAt(++position);\n\t\t\tbuffer = a + b + c;\n\t\t\t// Turn the 24 bits into four chunks of 6 bits each, and append the\n\t\t\t// matching character for each of them to the output.\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 18 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 12 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer >> 6 & 0x3F) +\n\t\t\t\tTABLE.charAt(buffer & 0x3F)\n\t\t\t);\n\t\t}\n\n\t\tif (padding == 2) {\n\t\t\ta = input.charCodeAt(position) << 8;\n\t\t\tb = input.charCodeAt(++position);\n\t\t\tbuffer = a + b;\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 10) +\n\t\t\t\tTABLE.charAt((buffer >> 4) & 0x3F) +\n\t\t\t\tTABLE.charAt((buffer << 2) & 0x3F) +\n\t\t\t\t'='\n\t\t\t);\n\t\t} else if (padding == 1) {\n\t\t\tbuffer = input.charCodeAt(position);\n\t\t\toutput += (\n\t\t\t\tTABLE.charAt(buffer >> 2) +\n\t\t\t\tTABLE.charAt((buffer << 4) & 0x3F) +\n\t\t\t\t'=='\n\t\t\t);\n\t\t}\n\n\t\treturn output;\n\t};\n\n\tvar base64 = {\n\t\t'encode': encode,\n\t\t'decode': decode,\n\t\t'version': '1.0.0'\n\t};\n\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine(function() {\n\t\t\treturn base64;\n\t\t});\n\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = base64;\n\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (var key in base64) {\n\t\t\t\tbase64.hasOwnProperty(key) && (freeExports[key] = base64[key]);\n\t\t\t}\n\t\t}\n\t} else { // in Rhino or a web browser\n\t\troot.base64 = base64;\n\t}\n\n}(this));\n","'use strict';\n\nvar crypto_hash_sha512 = require('tweetnacl').lowlevel.crypto_hash;\n\n/*\n * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a\n * result, it retains the original copyright and license. The two files are\n * under slightly different (but compatible) licenses, and are here combined in\n * one file.\n *\n * Credit for the actual porting work goes to:\n * Devi Mandiri \n */\n\n/*\n * The Blowfish portions are under the following license:\n *\n * Blowfish block cipher for OpenBSD\n * Copyright 1997 Niels Provos \n * All rights reserved.\n *\n * Implementation advice by David Mazieres .\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. The name of the author may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\n\n/*\n * The bcrypt_pbkdf portions are under the following license:\n *\n * Copyright (c) 2013 Ted Unangst \n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/*\n * Performance improvements (Javascript-specific):\n *\n * Copyright 2016, Joyent Inc\n * Author: Alex Wilson \n *\n * Permission to use, copy, modify, and distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n// Ported from OpenBSD bcrypt_pbkdf.c v1.9\n\nvar BLF_J = 0;\n\nvar Blowfish = function() {\n this.S = [\n new Uint32Array([\n 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,\n 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,\n 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,\n 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,\n 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,\n 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,\n 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,\n 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,\n 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,\n 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,\n 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,\n 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,\n 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,\n 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,\n 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,\n 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,\n 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,\n 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,\n 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,\n 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,\n 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,\n 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,\n 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,\n 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,\n 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,\n 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,\n 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,\n 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,\n 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,\n 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,\n 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,\n 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,\n 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,\n 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,\n 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,\n 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,\n 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,\n 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,\n 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,\n 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,\n 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,\n 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,\n 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,\n 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,\n 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,\n 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,\n 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,\n 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,\n 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,\n 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,\n 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,\n 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,\n 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,\n 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,\n 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,\n 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,\n 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,\n 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,\n 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,\n 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,\n 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,\n 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,\n 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,\n 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]),\n new Uint32Array([\n 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,\n 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,\n 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,\n 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,\n 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,\n 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,\n 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,\n 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,\n 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,\n 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,\n 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,\n 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,\n 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,\n 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,\n 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,\n 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,\n 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,\n 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,\n 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,\n 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,\n 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,\n 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,\n 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,\n 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,\n 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,\n 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,\n 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,\n 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,\n 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,\n 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,\n 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,\n 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,\n 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,\n 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,\n 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,\n 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,\n 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,\n 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,\n 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,\n 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,\n 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,\n 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,\n 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,\n 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,\n 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,\n 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,\n 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,\n 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,\n 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,\n 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,\n 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,\n 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,\n 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,\n 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,\n 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,\n 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,\n 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,\n 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,\n 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,\n 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,\n 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,\n 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,\n 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,\n 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]),\n new Uint32Array([\n 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,\n 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,\n 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,\n 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,\n 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,\n 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,\n 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,\n 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,\n 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,\n 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,\n 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,\n 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,\n 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,\n 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,\n 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,\n 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,\n 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,\n 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,\n 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,\n 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,\n 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,\n 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,\n 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,\n 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,\n 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,\n 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,\n 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,\n 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,\n 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,\n 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,\n 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,\n 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,\n 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,\n 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,\n 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,\n 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,\n 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,\n 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,\n 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,\n 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,\n 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,\n 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,\n 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,\n 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,\n 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,\n 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,\n 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,\n 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,\n 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,\n 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,\n 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,\n 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,\n 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,\n 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,\n 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,\n 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,\n 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,\n 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,\n 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,\n 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,\n 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,\n 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,\n 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,\n 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]),\n new Uint32Array([\n 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,\n 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,\n 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,\n 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,\n 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,\n 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,\n 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,\n 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,\n 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,\n 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,\n 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,\n 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,\n 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,\n 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,\n 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,\n 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,\n 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,\n 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,\n 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,\n 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,\n 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,\n 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,\n 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,\n 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,\n 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,\n 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,\n 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,\n 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,\n 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,\n 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,\n 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,\n 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,\n 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,\n 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,\n 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,\n 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,\n 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,\n 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,\n 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,\n 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,\n 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,\n 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,\n 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,\n 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,\n 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,\n 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,\n 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,\n 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,\n 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,\n 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,\n 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,\n 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,\n 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,\n 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,\n 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,\n 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,\n 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,\n 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,\n 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,\n 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,\n 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,\n 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,\n 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,\n 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6])\n ];\n this.P = new Uint32Array([\n 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,\n 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,\n 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,\n 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,\n 0x9216d5d9, 0x8979fb1b]);\n};\n\nfunction F(S, x8, i) {\n return (((S[0][x8[i+3]] +\n S[1][x8[i+2]]) ^\n S[2][x8[i+1]]) +\n S[3][x8[i]]);\n};\n\nBlowfish.prototype.encipher = function(x, x8) {\n if (x8 === undefined) {\n x8 = new Uint8Array(x.buffer);\n if (x.byteOffset !== 0)\n x8 = x8.subarray(x.byteOffset);\n }\n x[0] ^= this.P[0];\n for (var i = 1; i < 16; i += 2) {\n x[1] ^= F(this.S, x8, 0) ^ this.P[i];\n x[0] ^= F(this.S, x8, 4) ^ this.P[i+1];\n }\n var t = x[0];\n x[0] = x[1] ^ this.P[17];\n x[1] = t;\n};\n\nBlowfish.prototype.decipher = function(x) {\n var x8 = new Uint8Array(x.buffer);\n if (x.byteOffset !== 0)\n x8 = x8.subarray(x.byteOffset);\n x[0] ^= this.P[17];\n for (var i = 16; i > 0; i -= 2) {\n x[1] ^= F(this.S, x8, 0) ^ this.P[i];\n x[0] ^= F(this.S, x8, 4) ^ this.P[i-1];\n }\n var t = x[0];\n x[0] = x[1] ^ this.P[0];\n x[1] = t;\n};\n\nfunction stream2word(data, databytes){\n var i, temp = 0;\n for (i = 0; i < 4; i++, BLF_J++) {\n if (BLF_J >= databytes) BLF_J = 0;\n temp = (temp << 8) | data[BLF_J];\n }\n return temp;\n};\n\nBlowfish.prototype.expand0state = function(key, keybytes) {\n var d = new Uint32Array(2), i, k;\n var d8 = new Uint8Array(d.buffer);\n\n for (i = 0, BLF_J = 0; i < 18; i++) {\n this.P[i] ^= stream2word(key, keybytes);\n }\n BLF_J = 0;\n\n for (i = 0; i < 18; i += 2) {\n this.encipher(d, d8);\n this.P[i] = d[0];\n this.P[i+1] = d[1];\n }\n\n for (i = 0; i < 4; i++) {\n for (k = 0; k < 256; k += 2) {\n this.encipher(d, d8);\n this.S[i][k] = d[0];\n this.S[i][k+1] = d[1];\n }\n }\n};\n\nBlowfish.prototype.expandstate = function(data, databytes, key, keybytes) {\n var d = new Uint32Array(2), i, k;\n\n for (i = 0, BLF_J = 0; i < 18; i++) {\n this.P[i] ^= stream2word(key, keybytes);\n }\n\n for (i = 0, BLF_J = 0; i < 18; i += 2) {\n d[0] ^= stream2word(data, databytes);\n d[1] ^= stream2word(data, databytes);\n this.encipher(d);\n this.P[i] = d[0];\n this.P[i+1] = d[1];\n }\n\n for (i = 0; i < 4; i++) {\n for (k = 0; k < 256; k += 2) {\n d[0] ^= stream2word(data, databytes);\n d[1] ^= stream2word(data, databytes);\n this.encipher(d);\n this.S[i][k] = d[0];\n this.S[i][k+1] = d[1];\n }\n }\n BLF_J = 0;\n};\n\nBlowfish.prototype.enc = function(data, blocks) {\n for (var i = 0; i < blocks; i++) {\n this.encipher(data.subarray(i*2));\n }\n};\n\nBlowfish.prototype.dec = function(data, blocks) {\n for (var i = 0; i < blocks; i++) {\n this.decipher(data.subarray(i*2));\n }\n};\n\nvar BCRYPT_BLOCKS = 8,\n BCRYPT_HASHSIZE = 32;\n\nfunction bcrypt_hash(sha2pass, sha2salt, out) {\n var state = new Blowfish(),\n cdata = new Uint32Array(BCRYPT_BLOCKS), i,\n ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,\n 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,\n 105,116,101]); //\"OxychromaticBlowfishSwatDynamite\"\n\n state.expandstate(sha2salt, 64, sha2pass, 64);\n for (i = 0; i < 64; i++) {\n state.expand0state(sha2salt, 64);\n state.expand0state(sha2pass, 64);\n }\n\n for (i = 0; i < BCRYPT_BLOCKS; i++)\n cdata[i] = stream2word(ciphertext, ciphertext.byteLength);\n for (i = 0; i < 64; i++)\n state.enc(cdata, cdata.byteLength / 8);\n\n for (i = 0; i < BCRYPT_BLOCKS; i++) {\n out[4*i+3] = cdata[i] >>> 24;\n out[4*i+2] = cdata[i] >>> 16;\n out[4*i+1] = cdata[i] >>> 8;\n out[4*i+0] = cdata[i];\n }\n};\n\nfunction bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {\n var sha2pass = new Uint8Array(64),\n sha2salt = new Uint8Array(64),\n out = new Uint8Array(BCRYPT_HASHSIZE),\n tmpout = new Uint8Array(BCRYPT_HASHSIZE),\n countsalt = new Uint8Array(saltlen+4),\n i, j, amt, stride, dest, count,\n origkeylen = keylen;\n\n if (rounds < 1)\n return -1;\n if (passlen === 0 || saltlen === 0 || keylen === 0 ||\n keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20))\n return -1;\n\n stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength);\n amt = Math.floor((keylen + stride - 1) / stride);\n\n for (i = 0; i < saltlen; i++)\n countsalt[i] = salt[i];\n\n crypto_hash_sha512(sha2pass, pass, passlen);\n\n for (count = 1; keylen > 0; count++) {\n countsalt[saltlen+0] = count >>> 24;\n countsalt[saltlen+1] = count >>> 16;\n countsalt[saltlen+2] = count >>> 8;\n countsalt[saltlen+3] = count;\n\n crypto_hash_sha512(sha2salt, countsalt, saltlen + 4);\n bcrypt_hash(sha2pass, sha2salt, tmpout);\n for (i = out.byteLength; i--;)\n out[i] = tmpout[i];\n\n for (i = 1; i < rounds; i++) {\n crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength);\n bcrypt_hash(sha2pass, sha2salt, tmpout);\n for (j = 0; j < out.byteLength; j++)\n out[j] ^= tmpout[j];\n }\n\n amt = Math.min(amt, keylen);\n for (i = 0; i < amt; i++) {\n dest = i * stride + (count - 1);\n if (dest >= origkeylen)\n break;\n key[dest] = out[i];\n }\n keylen -= i;\n }\n\n return 0;\n};\n\nmodule.exports = {\n BLOCKS: BCRYPT_BLOCKS,\n HASHSIZE: BCRYPT_HASHSIZE,\n hash: bcrypt_hash,\n pbkdf: bcrypt_pbkdf\n};\n","var register = require(\"./lib/register\");\nvar addHook = require(\"./lib/add\");\nvar removeHook = require(\"./lib/remove\");\n\n// bind with array of arguments: https://stackoverflow.com/a/21792913\nvar bind = Function.bind;\nvar bindable = bind.bind(bind);\n\nfunction bindApi(hook, state, name) {\n var removeHookRef = bindable(removeHook, null).apply(\n null,\n name ? [state, name] : [state]\n );\n hook.api = { remove: removeHookRef };\n hook.remove = removeHookRef;\n [\"before\", \"error\", \"after\", \"wrap\"].forEach(function (kind) {\n var args = name ? [state, kind, name] : [state, kind];\n hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args);\n });\n}\n\nfunction HookSingular() {\n var singularHookName = \"h\";\n var singularHookState = {\n registry: {},\n };\n var singularHook = register.bind(null, singularHookState, singularHookName);\n bindApi(singularHook, singularHookState, singularHookName);\n return singularHook;\n}\n\nfunction HookCollection() {\n var state = {\n registry: {},\n };\n\n var hook = register.bind(null, state);\n bindApi(hook, state);\n\n return hook;\n}\n\nvar collectionHookDeprecationMessageDisplayed = false;\nfunction Hook() {\n if (!collectionHookDeprecationMessageDisplayed) {\n console.warn(\n '[before-after-hook]: \"Hook()\" repurposing warning, use \"Hook.Collection()\". Read more: https://git.io/upgrade-before-after-hook-to-1.4'\n );\n collectionHookDeprecationMessageDisplayed = true;\n }\n return HookCollection();\n}\n\nHook.Singular = HookSingular.bind();\nHook.Collection = HookCollection.bind();\n\nmodule.exports = Hook;\n// expose constructors as a named property for TypeScript\nmodule.exports.Hook = Hook;\nmodule.exports.Singular = Hook.Singular;\nmodule.exports.Collection = Hook.Collection;\n","module.exports = addHook;\n\nfunction addHook(state, kind, name, hook) {\n var orig = hook;\n if (!state.registry[name]) {\n state.registry[name] = [];\n }\n\n if (kind === \"before\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(orig.bind(null, options))\n .then(method.bind(null, options));\n };\n }\n\n if (kind === \"after\") {\n hook = function (method, options) {\n var result;\n return Promise.resolve()\n .then(method.bind(null, options))\n .then(function (result_) {\n result = result_;\n return orig(result, options);\n })\n .then(function () {\n return result;\n });\n };\n }\n\n if (kind === \"error\") {\n hook = function (method, options) {\n return Promise.resolve()\n .then(method.bind(null, options))\n .catch(function (error) {\n return orig(error, options);\n });\n };\n }\n\n state.registry[name].push({\n hook: hook,\n orig: orig,\n });\n}\n","module.exports = register;\n\nfunction register(state, name, method, options) {\n if (typeof method !== \"function\") {\n throw new Error(\"method for before hook must be a function\");\n }\n\n if (!options) {\n options = {};\n }\n\n if (Array.isArray(name)) {\n return name.reverse().reduce(function (callback, name) {\n return register.bind(null, state, name, callback, options);\n }, method)();\n }\n\n return Promise.resolve().then(function () {\n if (!state.registry[name]) {\n return method(options);\n }\n\n return state.registry[name].reduce(function (method, registered) {\n return registered.hook.bind(null, method, options);\n }, method)();\n });\n}\n","module.exports = removeHook;\n\nfunction removeHook(state, name, method) {\n if (!state.registry[name]) {\n return;\n }\n\n var index = state.registry[name]\n .map(function (registered) {\n return registered.orig;\n })\n .indexOf(method);\n\n if (index === -1) {\n return;\n }\n\n state.registry[name].splice(index, 1);\n}\n","var concatMap = require('concat-map');\nvar balanced = require('balanced-match');\n\nmodule.exports = expandTop;\n\nvar escSlash = '\\0SLASH'+Math.random()+'\\0';\nvar escOpen = '\\0OPEN'+Math.random()+'\\0';\nvar escClose = '\\0CLOSE'+Math.random()+'\\0';\nvar escComma = '\\0COMMA'+Math.random()+'\\0';\nvar escPeriod = '\\0PERIOD'+Math.random()+'\\0';\n\nfunction numeric(str) {\n return parseInt(str, 10) == str\n ? parseInt(str, 10)\n : str.charCodeAt(0);\n}\n\nfunction escapeBraces(str) {\n return str.split('\\\\\\\\').join(escSlash)\n .split('\\\\{').join(escOpen)\n .split('\\\\}').join(escClose)\n .split('\\\\,').join(escComma)\n .split('\\\\.').join(escPeriod);\n}\n\nfunction unescapeBraces(str) {\n return str.split(escSlash).join('\\\\')\n .split(escOpen).join('{')\n .split(escClose).join('}')\n .split(escComma).join(',')\n .split(escPeriod).join('.');\n}\n\n\n// Basically just str.split(\",\"), but handling cases\n// where we have nested braced sections, which should be\n// treated as individual members, like {a,{b,c},d}\nfunction parseCommaParts(str) {\n if (!str)\n return [''];\n\n var parts = [];\n var m = balanced('{', '}', str);\n\n if (!m)\n return str.split(',');\n\n var pre = m.pre;\n var body = m.body;\n var post = m.post;\n var p = pre.split(',');\n\n p[p.length-1] += '{' + body + '}';\n var postParts = parseCommaParts(post);\n if (post.length) {\n p[p.length-1] += postParts.shift();\n p.push.apply(p, postParts);\n }\n\n parts.push.apply(parts, p);\n\n return parts;\n}\n\nfunction expandTop(str) {\n if (!str)\n return [];\n\n // I don't know why Bash 4.3 does this, but it does.\n // Anything starting with {} will have the first two bytes preserved\n // but *only* at the top level, so {},a}b will not expand to anything,\n // but a{},b}c will be expanded to [a}c,abc].\n // One could argue that this is a bug in Bash, but since the goal of\n // this module is to match Bash's rules, we escape a leading {}\n if (str.substr(0, 2) === '{}') {\n str = '\\\\{\\\\}' + str.substr(2);\n }\n\n return expand(escapeBraces(str), true).map(unescapeBraces);\n}\n\nfunction identity(e) {\n return e;\n}\n\nfunction embrace(str) {\n return '{' + str + '}';\n}\nfunction isPadded(el) {\n return /^-?0\\d/.test(el);\n}\n\nfunction lte(i, y) {\n return i <= y;\n}\nfunction gte(i, y) {\n return i >= y;\n}\n\nfunction expand(str, isTop) {\n var expansions = [];\n\n var m = balanced('{', '}', str);\n if (!m || /\\$$/.test(m.pre)) return [str];\n\n var isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body);\n var isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(m.body);\n var isSequence = isNumericSequence || isAlphaSequence;\n var isOptions = m.body.indexOf(',') >= 0;\n if (!isSequence && !isOptions) {\n // {a},b}\n if (m.post.match(/,.*\\}/)) {\n str = m.pre + '{' + m.body + escClose + m.post;\n return expand(str);\n }\n return [str];\n }\n\n var n;\n if (isSequence) {\n n = m.body.split(/\\.\\./);\n } else {\n n = parseCommaParts(m.body);\n if (n.length === 1) {\n // x{{a,b}}y ==> x{a}y x{b}y\n n = expand(n[0], false).map(embrace);\n if (n.length === 1) {\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n return post.map(function(p) {\n return m.pre + n[0] + p;\n });\n }\n }\n }\n\n // at this point, n is the parts, and we know it's not a comma set\n // with a single entry.\n\n // no need to expand pre, since it is guaranteed to be free of brace-sets\n var pre = m.pre;\n var post = m.post.length\n ? expand(m.post, false)\n : [''];\n\n var N;\n\n if (isSequence) {\n var x = numeric(n[0]);\n var y = numeric(n[1]);\n var width = Math.max(n[0].length, n[1].length)\n var incr = n.length == 3\n ? Math.abs(numeric(n[2]))\n : 1;\n var test = lte;\n var reverse = y < x;\n if (reverse) {\n incr *= -1;\n test = gte;\n }\n var pad = n.some(isPadded);\n\n N = [];\n\n for (var i = x; test(i, y); i += incr) {\n var c;\n if (isAlphaSequence) {\n c = String.fromCharCode(i);\n if (c === '\\\\')\n c = '';\n } else {\n c = String(i);\n if (pad) {\n var need = width - c.length;\n if (need > 0) {\n var z = new Array(need + 1).join('0');\n if (i < 0)\n c = '-' + z + c.slice(1);\n else\n c = z + c;\n }\n }\n }\n N.push(c);\n }\n } else {\n N = concatMap(n, function(el) { return expand(el, false) });\n }\n\n for (var j = 0; j < N.length; j++) {\n for (var k = 0; k < post.length; k++) {\n var expansion = pre + N[j] + post[k];\n if (!isTop || isSequence || expansion)\n expansions.push(expansion);\n }\n }\n\n return expansions;\n}\n\n","// Copyright (C) 2011-2015 John Hewson\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to\n// deal in the Software without restriction, including without limitation the\n// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n// sell copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n// IN THE SOFTWARE.\n\nvar stream = require('stream'),\n util = require('util'),\n timers = require('timers');\n\n// convinience API\nmodule.exports = function(readStream, options) {\n return module.exports.createStream(readStream, options);\n};\n\n// basic API\nmodule.exports.createStream = function(readStream, options) {\n if (readStream) {\n return createLineStream(readStream, options);\n } else {\n return new LineStream(options);\n }\n};\n\n// deprecated API\nmodule.exports.createLineStream = function(readStream) {\n console.log('WARNING: byline#createLineStream is deprecated and will be removed soon');\n return createLineStream(readStream);\n};\n\nfunction createLineStream(readStream, options) {\n if (!readStream) {\n throw new Error('expected readStream');\n }\n if (!readStream.readable) {\n throw new Error('readStream must be readable');\n }\n var ls = new LineStream(options);\n readStream.pipe(ls);\n return ls;\n}\n\n//\n// using the new node v0.10 \"streams2\" API\n//\n\nmodule.exports.LineStream = LineStream;\n\nfunction LineStream(options) {\n stream.Transform.call(this, options);\n options = options || {};\n\n // use objectMode to stop the output from being buffered\n // which re-concatanates the lines, just without newlines.\n this._readableState.objectMode = true;\n this._lineBuffer = [];\n this._keepEmptyLines = options.keepEmptyLines || false;\n this._lastChunkEndedWithCR = false;\n\n // take the source's encoding if we don't have one\n var self = this;\n this.on('pipe', function(src) {\n if (!self.encoding) {\n // but we can't do this for old-style streams\n if (src instanceof stream.Readable) {\n self.encoding = src._readableState.encoding;\n }\n }\n });\n}\nutil.inherits(LineStream, stream.Transform);\n\nLineStream.prototype._transform = function(chunk, encoding, done) {\n // decode binary chunks as UTF-8\n encoding = encoding || 'utf8';\n \n if (Buffer.isBuffer(chunk)) {\n if (encoding == 'buffer') {\n chunk = chunk.toString(); // utf8\n encoding = 'utf8';\n }\n else {\n chunk = chunk.toString(encoding);\n }\n }\n this._chunkEncoding = encoding;\n \n // see: http://www.unicode.org/reports/tr18/#Line_Boundaries\n var lines = chunk.split(/\\r\\n|[\\n\\v\\f\\r\\x85\\u2028\\u2029]/g);\n \n // don't split CRLF which spans chunks\n if (this._lastChunkEndedWithCR && chunk[0] == '\\n') {\n lines.shift();\n }\n \n if (this._lineBuffer.length > 0) {\n this._lineBuffer[this._lineBuffer.length - 1] += lines[0];\n lines.shift();\n }\n\n this._lastChunkEndedWithCR = chunk[chunk.length - 1] == '\\r';\n this._lineBuffer = this._lineBuffer.concat(lines);\n this._pushBuffer(encoding, 1, done);\n};\n\nLineStream.prototype._pushBuffer = function(encoding, keep, done) {\n // always buffer the last (possibly partial) line\n while (this._lineBuffer.length > keep) {\n var line = this._lineBuffer.shift();\n // skip empty lines\n if (this._keepEmptyLines || line.length > 0 ) {\n if (!this.push(this._reencode(line, encoding))) {\n // when the high-water mark is reached, defer pushes until the next tick\n var self = this;\n timers.setImmediate(function() {\n self._pushBuffer(encoding, keep, done);\n });\n return;\n }\n }\n }\n done();\n};\n\nLineStream.prototype._flush = function(done) {\n this._pushBuffer(this._chunkEncoding, 0, done);\n};\n\n// see Readable::push\nLineStream.prototype._reencode = function(line, chunkEncoding) {\n if (this.encoding && this.encoding != chunkEncoding) {\n return new Buffer(line, chunkEncoding).toString(this.encoding);\n }\n else if (this.encoding) {\n // this should be the most common case, i.e. we're using an encoded source stream\n return line;\n }\n else {\n return new Buffer(line, chunkEncoding);\n }\n};\n","'use strict';\nconst {\n\tV4MAPPED,\n\tADDRCONFIG,\n\tALL,\n\tpromises: {\n\t\tResolver: AsyncResolver\n\t},\n\tlookup: dnsLookup\n} = require('dns');\nconst {promisify} = require('util');\nconst os = require('os');\n\nconst kCacheableLookupCreateConnection = Symbol('cacheableLookupCreateConnection');\nconst kCacheableLookupInstance = Symbol('cacheableLookupInstance');\nconst kExpires = Symbol('expires');\n\nconst supportsALL = typeof ALL === 'number';\n\nconst verifyAgent = agent => {\n\tif (!(agent && typeof agent.createConnection === 'function')) {\n\t\tthrow new Error('Expected an Agent instance as the first argument');\n\t}\n};\n\nconst map4to6 = entries => {\n\tfor (const entry of entries) {\n\t\tif (entry.family === 6) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tentry.address = `::ffff:${entry.address}`;\n\t\tentry.family = 6;\n\t}\n};\n\nconst getIfaceInfo = () => {\n\tlet has4 = false;\n\tlet has6 = false;\n\n\tfor (const device of Object.values(os.networkInterfaces())) {\n\t\tfor (const iface of device) {\n\t\t\tif (iface.internal) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (iface.family === 'IPv6') {\n\t\t\t\thas6 = true;\n\t\t\t} else {\n\t\t\t\thas4 = true;\n\t\t\t}\n\n\t\t\tif (has4 && has6) {\n\t\t\t\treturn {has4, has6};\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {has4, has6};\n};\n\nconst isIterable = map => {\n\treturn Symbol.iterator in map;\n};\n\nconst ttl = {ttl: true};\nconst all = {all: true};\n\nclass CacheableLookup {\n\tconstructor({\n\t\tcache = new Map(),\n\t\tmaxTtl = Infinity,\n\t\tfallbackDuration = 3600,\n\t\terrorTtl = 0.15,\n\t\tresolver = new AsyncResolver(),\n\t\tlookup = dnsLookup\n\t} = {}) {\n\t\tthis.maxTtl = maxTtl;\n\t\tthis.errorTtl = errorTtl;\n\n\t\tthis._cache = cache;\n\t\tthis._resolver = resolver;\n\t\tthis._dnsLookup = promisify(lookup);\n\n\t\tif (this._resolver instanceof AsyncResolver) {\n\t\t\tthis._resolve4 = this._resolver.resolve4.bind(this._resolver);\n\t\t\tthis._resolve6 = this._resolver.resolve6.bind(this._resolver);\n\t\t} else {\n\t\t\tthis._resolve4 = promisify(this._resolver.resolve4.bind(this._resolver));\n\t\t\tthis._resolve6 = promisify(this._resolver.resolve6.bind(this._resolver));\n\t\t}\n\n\t\tthis._iface = getIfaceInfo();\n\n\t\tthis._pending = {};\n\t\tthis._nextRemovalTime = false;\n\t\tthis._hostnamesToFallback = new Set();\n\n\t\tif (fallbackDuration < 1) {\n\t\t\tthis._fallback = false;\n\t\t} else {\n\t\t\tthis._fallback = true;\n\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tthis._hostnamesToFallback.clear();\n\t\t\t}, fallbackDuration * 1000);\n\n\t\t\t/* istanbul ignore next: There is no `interval.unref()` when running inside an Electron renderer */\n\t\t\tif (interval.unref) {\n\t\t\t\tinterval.unref();\n\t\t\t}\n\t\t}\n\n\t\tthis.lookup = this.lookup.bind(this);\n\t\tthis.lookupAsync = this.lookupAsync.bind(this);\n\t}\n\n\tset servers(servers) {\n\t\tthis.clear();\n\n\t\tthis._resolver.setServers(servers);\n\t}\n\n\tget servers() {\n\t\treturn this._resolver.getServers();\n\t}\n\n\tlookup(hostname, options, callback) {\n\t\tif (typeof options === 'function') {\n\t\t\tcallback = options;\n\t\t\toptions = {};\n\t\t} else if (typeof options === 'number') {\n\t\t\toptions = {\n\t\t\t\tfamily: options\n\t\t\t};\n\t\t}\n\n\t\tif (!callback) {\n\t\t\tthrow new Error('Callback must be a function.');\n\t\t}\n\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\tthis.lookupAsync(hostname, options).then(result => {\n\t\t\tif (options.all) {\n\t\t\t\tcallback(null, result);\n\t\t\t} else {\n\t\t\t\tcallback(null, result.address, result.family, result.expires, result.ttl);\n\t\t\t}\n\t\t}, callback);\n\t}\n\n\tasync lookupAsync(hostname, options = {}) {\n\t\tif (typeof options === 'number') {\n\t\t\toptions = {\n\t\t\t\tfamily: options\n\t\t\t};\n\t\t}\n\n\t\tlet cached = await this.query(hostname);\n\n\t\tif (options.family === 6) {\n\t\t\tconst filtered = cached.filter(entry => entry.family === 6);\n\n\t\t\tif (options.hints & V4MAPPED) {\n\t\t\t\tif ((supportsALL && options.hints & ALL) || filtered.length === 0) {\n\t\t\t\t\tmap4to6(cached);\n\t\t\t\t} else {\n\t\t\t\t\tcached = filtered;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcached = filtered;\n\t\t\t}\n\t\t} else if (options.family === 4) {\n\t\t\tcached = cached.filter(entry => entry.family === 4);\n\t\t}\n\n\t\tif (options.hints & ADDRCONFIG) {\n\t\t\tconst {_iface} = this;\n\t\t\tcached = cached.filter(entry => entry.family === 6 ? _iface.has6 : _iface.has4);\n\t\t}\n\n\t\tif (cached.length === 0) {\n\t\t\tconst error = new Error(`cacheableLookup ENOTFOUND ${hostname}`);\n\t\t\terror.code = 'ENOTFOUND';\n\t\t\terror.hostname = hostname;\n\n\t\t\tthrow error;\n\t\t}\n\n\t\tif (options.all) {\n\t\t\treturn cached;\n\t\t}\n\n\t\treturn cached[0];\n\t}\n\n\tasync query(hostname) {\n\t\tlet cached = await this._cache.get(hostname);\n\n\t\tif (!cached) {\n\t\t\tconst pending = this._pending[hostname];\n\n\t\t\tif (pending) {\n\t\t\t\tcached = await pending;\n\t\t\t} else {\n\t\t\t\tconst newPromise = this.queryAndCache(hostname);\n\t\t\t\tthis._pending[hostname] = newPromise;\n\n\t\t\t\ttry {\n\t\t\t\t\tcached = await newPromise;\n\t\t\t\t} finally {\n\t\t\t\t\tdelete this._pending[hostname];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tcached = cached.map(entry => {\n\t\t\treturn {...entry};\n\t\t});\n\n\t\treturn cached;\n\t}\n\n\tasync _resolve(hostname) {\n\t\tconst wrap = async promise => {\n\t\t\ttry {\n\t\t\t\treturn await promise;\n\t\t\t} catch (error) {\n\t\t\t\tif (error.code === 'ENODATA' || error.code === 'ENOTFOUND') {\n\t\t\t\t\treturn [];\n\t\t\t\t}\n\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t};\n\n\t\t// ANY is unsafe as it doesn't trigger new queries in the underlying server.\n\t\tconst [A, AAAA] = await Promise.all([\n\t\t\tthis._resolve4(hostname, ttl),\n\t\t\tthis._resolve6(hostname, ttl)\n\t\t].map(promise => wrap(promise)));\n\n\t\tlet aTtl = 0;\n\t\tlet aaaaTtl = 0;\n\t\tlet cacheTtl = 0;\n\n\t\tconst now = Date.now();\n\n\t\tfor (const entry of A) {\n\t\t\tentry.family = 4;\n\t\t\tentry.expires = now + (entry.ttl * 1000);\n\n\t\t\taTtl = Math.max(aTtl, entry.ttl);\n\t\t}\n\n\t\tfor (const entry of AAAA) {\n\t\t\tentry.family = 6;\n\t\t\tentry.expires = now + (entry.ttl * 1000);\n\n\t\t\taaaaTtl = Math.max(aaaaTtl, entry.ttl);\n\t\t}\n\n\t\tif (A.length > 0) {\n\t\t\tif (AAAA.length > 0) {\n\t\t\t\tcacheTtl = Math.min(aTtl, aaaaTtl);\n\t\t\t} else {\n\t\t\t\tcacheTtl = aTtl;\n\t\t\t}\n\t\t} else {\n\t\t\tcacheTtl = aaaaTtl;\n\t\t}\n\n\t\treturn {\n\t\t\tentries: [\n\t\t\t\t...A,\n\t\t\t\t...AAAA\n\t\t\t],\n\t\t\tcacheTtl\n\t\t};\n\t}\n\n\tasync _lookup(hostname) {\n\t\ttry {\n\t\t\tconst entries = await this._dnsLookup(hostname, {\n\t\t\t\tall: true\n\t\t\t});\n\n\t\t\treturn {\n\t\t\t\tentries,\n\t\t\t\tcacheTtl: 0\n\t\t\t};\n\t\t} catch (_) {\n\t\t\treturn {\n\t\t\t\tentries: [],\n\t\t\t\tcacheTtl: 0\n\t\t\t};\n\t\t}\n\t}\n\n\tasync _set(hostname, data, cacheTtl) {\n\t\tif (this.maxTtl > 0 && cacheTtl > 0) {\n\t\t\tcacheTtl = Math.min(cacheTtl, this.maxTtl) * 1000;\n\t\t\tdata[kExpires] = Date.now() + cacheTtl;\n\n\t\t\ttry {\n\t\t\t\tawait this._cache.set(hostname, data, cacheTtl);\n\t\t\t} catch (error) {\n\t\t\t\tthis.lookupAsync = async () => {\n\t\t\t\t\tconst cacheError = new Error('Cache Error. Please recreate the CacheableLookup instance.');\n\t\t\t\t\tcacheError.cause = error;\n\n\t\t\t\t\tthrow cacheError;\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (isIterable(this._cache)) {\n\t\t\t\tthis._tick(cacheTtl);\n\t\t\t}\n\t\t}\n\t}\n\n\tasync queryAndCache(hostname) {\n\t\tif (this._hostnamesToFallback.has(hostname)) {\n\t\t\treturn this._dnsLookup(hostname, all);\n\t\t}\n\n\t\tlet query = await this._resolve(hostname);\n\n\t\tif (query.entries.length === 0 && this._fallback) {\n\t\t\tquery = await this._lookup(hostname);\n\n\t\t\tif (query.entries.length !== 0) {\n\t\t\t\t// Use `dns.lookup(...)` for that particular hostname\n\t\t\t\tthis._hostnamesToFallback.add(hostname);\n\t\t\t}\n\t\t}\n\n\t\tconst cacheTtl = query.entries.length === 0 ? this.errorTtl : query.cacheTtl;\n\t\tawait this._set(hostname, query.entries, cacheTtl);\n\n\t\treturn query.entries;\n\t}\n\n\t_tick(ms) {\n\t\tconst nextRemovalTime = this._nextRemovalTime;\n\n\t\tif (!nextRemovalTime || ms < nextRemovalTime) {\n\t\t\tclearTimeout(this._removalTimeout);\n\n\t\t\tthis._nextRemovalTime = ms;\n\n\t\t\tthis._removalTimeout = setTimeout(() => {\n\t\t\t\tthis._nextRemovalTime = false;\n\n\t\t\t\tlet nextExpiry = Infinity;\n\n\t\t\t\tconst now = Date.now();\n\n\t\t\t\tfor (const [hostname, entries] of this._cache) {\n\t\t\t\t\tconst expires = entries[kExpires];\n\n\t\t\t\t\tif (now >= expires) {\n\t\t\t\t\t\tthis._cache.delete(hostname);\n\t\t\t\t\t} else if (expires < nextExpiry) {\n\t\t\t\t\t\tnextExpiry = expires;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (nextExpiry !== Infinity) {\n\t\t\t\t\tthis._tick(nextExpiry - now);\n\t\t\t\t}\n\t\t\t}, ms);\n\n\t\t\t/* istanbul ignore next: There is no `timeout.unref()` when running inside an Electron renderer */\n\t\t\tif (this._removalTimeout.unref) {\n\t\t\t\tthis._removalTimeout.unref();\n\t\t\t}\n\t\t}\n\t}\n\n\tinstall(agent) {\n\t\tverifyAgent(agent);\n\n\t\tif (kCacheableLookupCreateConnection in agent) {\n\t\t\tthrow new Error('CacheableLookup has been already installed');\n\t\t}\n\n\t\tagent[kCacheableLookupCreateConnection] = agent.createConnection;\n\t\tagent[kCacheableLookupInstance] = this;\n\n\t\tagent.createConnection = (options, callback) => {\n\t\t\tif (!('lookup' in options)) {\n\t\t\t\toptions.lookup = this.lookup;\n\t\t\t}\n\n\t\t\treturn agent[kCacheableLookupCreateConnection](options, callback);\n\t\t};\n\t}\n\n\tuninstall(agent) {\n\t\tverifyAgent(agent);\n\n\t\tif (agent[kCacheableLookupCreateConnection]) {\n\t\t\tif (agent[kCacheableLookupInstance] !== this) {\n\t\t\t\tthrow new Error('The agent is not owned by this CacheableLookup instance');\n\t\t\t}\n\n\t\t\tagent.createConnection = agent[kCacheableLookupCreateConnection];\n\n\t\t\tdelete agent[kCacheableLookupCreateConnection];\n\t\t\tdelete agent[kCacheableLookupInstance];\n\t\t}\n\t}\n\n\tupdateInterfaceInfo() {\n\t\tconst {_iface} = this;\n\n\t\tthis._iface = getIfaceInfo();\n\n\t\tif ((_iface.has4 && !this._iface.has4) || (_iface.has6 && !this._iface.has6)) {\n\t\t\tthis._cache.clear();\n\t\t}\n\t}\n\n\tclear(hostname) {\n\t\tif (hostname) {\n\t\t\tthis._cache.delete(hostname);\n\t\t\treturn;\n\t\t}\n\n\t\tthis._cache.clear();\n\t}\n}\n\nmodule.exports = CacheableLookup;\nmodule.exports.default = CacheableLookup;\n","function Caseless (dict) {\n this.dict = dict || {}\n}\nCaseless.prototype.set = function (name, value, clobber) {\n if (typeof name === 'object') {\n for (var i in name) {\n this.set(i, name[i], value)\n }\n } else {\n if (typeof clobber === 'undefined') clobber = true\n var has = this.has(name)\n\n if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value\n else this.dict[has || name] = value\n return has\n }\n}\nCaseless.prototype.has = function (name) {\n var keys = Object.keys(this.dict)\n , name = name.toLowerCase()\n ;\n for (var i=0;i {\n try {\n return fs[LCHOWNSYNC](path, uid, gid)\n } catch (er) {\n if (er.code !== 'ENOENT')\n throw er\n }\n}\n\n/* istanbul ignore next */\nconst chownSync = (path, uid, gid) => {\n try {\n return fs.chownSync(path, uid, gid)\n } catch (er) {\n if (er.code !== 'ENOENT')\n throw er\n }\n}\n\n/* istanbul ignore next */\nconst handleEISDIR =\n needEISDIRHandled ? (path, uid, gid, cb) => er => {\n // Node prior to v10 had a very questionable implementation of\n // fs.lchown, which would always try to call fs.open on a directory\n // Fall back to fs.chown in those cases.\n if (!er || er.code !== 'EISDIR')\n cb(er)\n else\n fs.chown(path, uid, gid, cb)\n }\n : (_, __, ___, cb) => cb\n\n/* istanbul ignore next */\nconst handleEISDirSync =\n needEISDIRHandled ? (path, uid, gid) => {\n try {\n return lchownSync(path, uid, gid)\n } catch (er) {\n if (er.code !== 'EISDIR')\n throw er\n chownSync(path, uid, gid)\n }\n }\n : (path, uid, gid) => lchownSync(path, uid, gid)\n\n// fs.readdir could only accept an options object as of node v6\nconst nodeVersion = process.version\nlet readdir = (path, options, cb) => fs.readdir(path, options, cb)\nlet readdirSync = (path, options) => fs.readdirSync(path, options)\n/* istanbul ignore next */\nif (/^v4\\./.test(nodeVersion))\n readdir = (path, options, cb) => fs.readdir(path, cb)\n\nconst chown = (cpath, uid, gid, cb) => {\n fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => {\n // Skip ENOENT error\n cb(er && er.code !== 'ENOENT' ? er : null)\n }))\n}\n\nconst chownrKid = (p, child, uid, gid, cb) => {\n if (typeof child === 'string')\n return fs.lstat(path.resolve(p, child), (er, stats) => {\n // Skip ENOENT error\n if (er)\n return cb(er.code !== 'ENOENT' ? er : null)\n stats.name = child\n chownrKid(p, stats, uid, gid, cb)\n })\n\n if (child.isDirectory()) {\n chownr(path.resolve(p, child.name), uid, gid, er => {\n if (er)\n return cb(er)\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n })\n } else {\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n }\n}\n\n\nconst chownr = (p, uid, gid, cb) => {\n readdir(p, { withFileTypes: true }, (er, children) => {\n // any error other than ENOTDIR or ENOTSUP means it's not readable,\n // or doesn't exist. give up.\n if (er) {\n if (er.code === 'ENOENT')\n return cb()\n else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')\n return cb(er)\n }\n if (er || !children.length)\n return chown(p, uid, gid, cb)\n\n let len = children.length\n let errState = null\n const then = er => {\n if (errState)\n return\n if (er)\n return cb(errState = er)\n if (-- len === 0)\n return chown(p, uid, gid, cb)\n }\n\n children.forEach(child => chownrKid(p, child, uid, gid, then))\n })\n}\n\nconst chownrKidSync = (p, child, uid, gid) => {\n if (typeof child === 'string') {\n try {\n const stats = fs.lstatSync(path.resolve(p, child))\n stats.name = child\n child = stats\n } catch (er) {\n if (er.code === 'ENOENT')\n return\n else\n throw er\n }\n }\n\n if (child.isDirectory())\n chownrSync(path.resolve(p, child.name), uid, gid)\n\n handleEISDirSync(path.resolve(p, child.name), uid, gid)\n}\n\nconst chownrSync = (p, uid, gid) => {\n let children\n try {\n children = readdirSync(p, { withFileTypes: true })\n } catch (er) {\n if (er.code === 'ENOENT')\n return\n else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP')\n return handleEISDirSync(p, uid, gid)\n else\n throw er\n }\n\n if (children && children.length)\n children.forEach(child => chownrKidSync(p, child, uid, gid))\n\n return handleEISDirSync(p, uid, gid)\n}\n\nmodule.exports = chownr\nchownr.sync = chownrSync\n","'use strict';\nconst os = require('os');\n\nconst extractPathRegex = /\\s+at.*(?:\\(|\\s)(.*)\\)?/;\nconst pathRegex = /^(?:(?:(?:node|(?:internal\\/[\\w/]*|.*node_modules\\/(?:babel-polyfill|pirates)\\/.*)?\\w+)\\.js:\\d+:\\d+)|native)/;\nconst homeDir = typeof os.homedir === 'undefined' ? '' : os.homedir();\n\nmodule.exports = (stack, options) => {\n\toptions = Object.assign({pretty: false}, options);\n\n\treturn stack.replace(/\\\\/g, '/')\n\t\t.split('\\n')\n\t\t.filter(line => {\n\t\t\tconst pathMatches = line.match(extractPathRegex);\n\t\t\tif (pathMatches === null || !pathMatches[1]) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst match = pathMatches[1];\n\n\t\t\t// Electron\n\t\t\tif (\n\t\t\t\tmatch.includes('.app/Contents/Resources/electron.asar') ||\n\t\t\t\tmatch.includes('.app/Contents/Resources/default_app.asar')\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn !pathRegex.test(match);\n\t\t})\n\t\t.filter(line => line.trim() !== '')\n\t\t.map(line => {\n\t\t\tif (options.pretty) {\n\t\t\t\treturn line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~')));\n\t\t\t}\n\n\t\t\treturn line;\n\t\t})\n\t\t.join('\\n');\n};\n","'use strict';\n\nconst PassThrough = require('stream').PassThrough;\nconst mimicResponse = require('mimic-response');\n\nconst cloneResponse = response => {\n\tif (!(response && response.pipe)) {\n\t\tthrow new TypeError('Parameter `response` must be a response stream.');\n\t}\n\n\tconst clone = new PassThrough();\n\tmimicResponse(response, clone);\n\n\treturn response.pipe(clone);\n};\n\nmodule.exports = cloneResponse;\n","var util = require('util');\nvar Stream = require('stream').Stream;\nvar DelayedStream = require('delayed-stream');\n\nmodule.exports = CombinedStream;\nfunction CombinedStream() {\n this.writable = false;\n this.readable = true;\n this.dataSize = 0;\n this.maxDataSize = 2 * 1024 * 1024;\n this.pauseStreams = true;\n\n this._released = false;\n this._streams = [];\n this._currentStream = null;\n this._insideLoop = false;\n this._pendingNext = false;\n}\nutil.inherits(CombinedStream, Stream);\n\nCombinedStream.create = function(options) {\n var combinedStream = new this();\n\n options = options || {};\n for (var option in options) {\n combinedStream[option] = options[option];\n }\n\n return combinedStream;\n};\n\nCombinedStream.isStreamLike = function(stream) {\n return (typeof stream !== 'function')\n && (typeof stream !== 'string')\n && (typeof stream !== 'boolean')\n && (typeof stream !== 'number')\n && (!Buffer.isBuffer(stream));\n};\n\nCombinedStream.prototype.append = function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n\n if (isStreamLike) {\n if (!(stream instanceof DelayedStream)) {\n var newStream = DelayedStream.create(stream, {\n maxDataSize: Infinity,\n pauseStream: this.pauseStreams,\n });\n stream.on('data', this._checkDataSize.bind(this));\n stream = newStream;\n }\n\n this._handleErrors(stream);\n\n if (this.pauseStreams) {\n stream.pause();\n }\n }\n\n this._streams.push(stream);\n return this;\n};\n\nCombinedStream.prototype.pipe = function(dest, options) {\n Stream.prototype.pipe.call(this, dest, options);\n this.resume();\n return dest;\n};\n\nCombinedStream.prototype._getNext = function() {\n this._currentStream = null;\n\n if (this._insideLoop) {\n this._pendingNext = true;\n return; // defer call\n }\n\n this._insideLoop = true;\n try {\n do {\n this._pendingNext = false;\n this._realGetNext();\n } while (this._pendingNext);\n } finally {\n this._insideLoop = false;\n }\n};\n\nCombinedStream.prototype._realGetNext = function() {\n var stream = this._streams.shift();\n\n\n if (typeof stream == 'undefined') {\n this.end();\n return;\n }\n\n if (typeof stream !== 'function') {\n this._pipeNext(stream);\n return;\n }\n\n var getStream = stream;\n getStream(function(stream) {\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('data', this._checkDataSize.bind(this));\n this._handleErrors(stream);\n }\n\n this._pipeNext(stream);\n }.bind(this));\n};\n\nCombinedStream.prototype._pipeNext = function(stream) {\n this._currentStream = stream;\n\n var isStreamLike = CombinedStream.isStreamLike(stream);\n if (isStreamLike) {\n stream.on('end', this._getNext.bind(this));\n stream.pipe(this, {end: false});\n return;\n }\n\n var value = stream;\n this.write(value);\n this._getNext();\n};\n\nCombinedStream.prototype._handleErrors = function(stream) {\n var self = this;\n stream.on('error', function(err) {\n self._emitError(err);\n });\n};\n\nCombinedStream.prototype.write = function(data) {\n this.emit('data', data);\n};\n\nCombinedStream.prototype.pause = function() {\n if (!this.pauseStreams) {\n return;\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();\n this.emit('pause');\n};\n\nCombinedStream.prototype.resume = function() {\n if (!this._released) {\n this._released = true;\n this.writable = true;\n this._getNext();\n }\n\n if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();\n this.emit('resume');\n};\n\nCombinedStream.prototype.end = function() {\n this._reset();\n this.emit('end');\n};\n\nCombinedStream.prototype.destroy = function() {\n this._reset();\n this.emit('close');\n};\n\nCombinedStream.prototype._reset = function() {\n this.writable = false;\n this._streams = [];\n this._currentStream = null;\n};\n\nCombinedStream.prototype._checkDataSize = function() {\n this._updateDataSize();\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';\n this._emitError(new Error(message));\n};\n\nCombinedStream.prototype._updateDataSize = function() {\n this.dataSize = 0;\n\n var self = this;\n this._streams.forEach(function(stream) {\n if (!stream.dataSize) {\n return;\n }\n\n self.dataSize += stream.dataSize;\n });\n\n if (this._currentStream && this._currentStream.dataSize) {\n this.dataSize += this._currentStream.dataSize;\n }\n};\n\nCombinedStream.prototype._emitError = function(err) {\n this._reset();\n this.emit('error', err);\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.action = void 0;\nconst commander = require(\"commander\");\nfunction action() {\n return (target, propertyKey, descriptor) => {\n commander.action(target[propertyKey]);\n };\n}\nexports.action = action;\n//# sourceMappingURL=action.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.alias = void 0;\nconst program = require(\"commander\");\nfunction alias(text) {\n return (target) => {\n program.usage(text);\n };\n}\nexports.alias = alias;\n//# sourceMappingURL=alias.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.variadicArg = exports.requiredArg = exports.optionalArg = void 0;\nconst metadata_1 = require(\"../metadata\");\nconst models_1 = require(\"../models\");\nconst utils_1 = require(\"../utils\");\n/**\n * Parameter decorator used in subcommand function to denote an optional argument.\n */\nfunction optionalArg(name) {\n return (target, propertyKey, parameterIndex) => {\n const args = (0, utils_1.decorateIfNot)(metadata_1.ArgsMetadata, [], target, propertyKey);\n args.unshift(new models_1.OptionalArg(name, parameterIndex));\n };\n}\nexports.optionalArg = optionalArg;\n/**\n * Parameter decorator used in subcommand function to denote a required argument.\n */\nfunction requiredArg(name) {\n return (target, propertyKey, parameterIndex) => {\n const args = (0, utils_1.decorateIfNot)(metadata_1.ArgsMetadata, [], target, propertyKey);\n args.unshift(new models_1.RequiredArg(name, parameterIndex));\n };\n}\nexports.requiredArg = requiredArg;\n/**\n * Parameter decorator used in subcommand function to denote variadic arguments.\n */\nfunction variadicArg(name) {\n return (target, propertyKey, parameterIndex) => {\n const args = (0, utils_1.decorateIfNot)(metadata_1.ArgsMetadata, [], target, propertyKey);\n args.unshift(new models_1.VariadicArg(name, parameterIndex));\n };\n}\nexports.variadicArg = variadicArg;\n//# sourceMappingURL=arg.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.args = void 0;\nconst commander = require(\"commander\");\nfunction args() {\n return (target, propertyKey, parameterIndex) => {\n commander\n .option(propertyKey)\n .action(target[propertyKey]);\n };\n}\nexports.args = args;\n//# sourceMappingURL=arguments.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.commandOption = void 0;\nconst metadata_1 = require(\"../metadata\");\nconst utils_1 = require(\"../utils\");\nfunction commandOption(...args) {\n return ((target, propertyKey, descriptor) => {\n args[0] = args[0] || `--${String(propertyKey)}`;\n (0, utils_1.decorateIfNot)(metadata_1.CommandOptionsMetadata, [], target, propertyKey);\n const options = Reflect.getMetadata(metadata_1.CommandOptionsMetadata, target, propertyKey);\n options.push(args);\n });\n}\nexports.commandOption = commandOption;\n//# sourceMappingURL=command-option.decorator.js.map","\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.command = void 0;\nconst commander = require(\"commander\");\nconst helpers_1 = require(\"../helpers\");\nconst metadata_1 = require(\"../metadata\");\nfunction command() {\n return (target, propertyKey, descriptor) => {\n try {\n const cmd = (0, helpers_1.prepareSubcommand)(target, propertyKey);\n let chain = commander.command(cmd);\n if (Reflect.hasMetadata(metadata_1.CommandOptionsMetadata, target, propertyKey)) {\n const options = Reflect.getMetadata(metadata_1.CommandOptionsMetadata, target, propertyKey);\n chain = options.reduce((prev, opt) => {\n const [arg1, arg2, arg3, arg4] = opt;\n return chain.option(arg1, arg2, arg3, arg4);\n }, chain);\n }\n chain.action((...args) => __awaiter(this, void 0, void 0, function* () {\n const context = args[args.length - 1];\n const cmdArgs = args.slice(0, args.length - 1);\n try {\n const result = target[propertyKey].apply(context, cmdArgs);\n if (result instanceof Promise) {\n yield result;\n }\n }\n catch (_a) {\n process.exit(1);\n }\n finally {\n process.exit(0);\n }\n }));\n }\n catch (e) {\n console.error(e.message);\n process.exit(1);\n }\n };\n}\nexports.command = command;\n//# sourceMappingURL=command.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.description = void 0;\nconst program = require(\"commander\");\nfunction description(text) {\n return (target) => {\n program.description(text);\n };\n}\nexports.description = description;\n//# sourceMappingURL=description.decorator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"../metadata\"), exports);\n__exportStar(require(\"./action.decorator\"), exports);\n__exportStar(require(\"./alias.decorator\"), exports);\n__exportStar(require(\"./arg.decorator\"), exports);\n__exportStar(require(\"./arguments.decorator\"), exports);\n__exportStar(require(\"./command-option.decorator\"), exports);\n__exportStar(require(\"./command.decorator\"), exports);\n__exportStar(require(\"./description.decorator\"), exports);\n__exportStar(require(\"./on.decorator\"), exports);\n__exportStar(require(\"./option.decorator\"), exports);\n__exportStar(require(\"./program.decorator\"), exports);\n__exportStar(require(\"./usage.decorator\"), exports);\n__exportStar(require(\"./version.decorator\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.on = void 0;\nconst commander = require(\"commander\");\nfunction on(event, handler) {\n return (target, propertyKey, descriptor) => {\n commander.on(event, handler);\n };\n}\nexports.on = on;\n//# sourceMappingURL=on.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.option = void 0;\nconst metadata_1 = require(\"../metadata\");\nconst models_1 = require(\"../models\");\nconst utils_1 = require(\"../utils\");\nfunction option(...args) {\n return ((target, propertyKey) => {\n args[0] = args[0] || `--${String(propertyKey)}`;\n (0, utils_1.decorateIfNot)(metadata_1.OptionsMetadata, [], target, propertyKey);\n const options = Reflect.getMetadata(metadata_1.OptionsMetadata, target, propertyKey);\n options.push(new models_1.Option(propertyKey, args));\n });\n}\nexports.option = option;\n//# sourceMappingURL=option.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.program = void 0;\nconst commander = require(\"commander\");\nconst helpers_1 = require(\"../helpers\");\nconst metadata_1 = require(\"../metadata\");\nlet instances = 0;\nfunction program() {\n instances += 1;\n if (instances > 1) {\n throw new Error('Only one instance of @program is permitted.');\n }\n return function (constructor) {\n const mixin = class extends constructor {\n constructor(...args) {\n super(...args);\n if (!this.run) {\n console.error('Program class must define a run() method.');\n process.exit(1);\n }\n const cmd = (0, helpers_1.prepareCommand)(this, 'run');\n if (cmd) {\n commander.command(cmd);\n }\n const options = Object.keys(this).reduce((list, prop) => {\n if (Reflect.hasMetadata(metadata_1.OptionsMetadata, this, prop)) {\n const metadata = Reflect.getMetadata(metadata_1.OptionsMetadata, this, prop);\n list.push(metadata);\n }\n return list;\n }, []);\n const chainAfterOptions = options\n .reduce((prev, option) => {\n return prev.option.apply(prev, option[0].args);\n }, commander);\n commander.parse(process.argv);\n if (this.run) {\n this.run.apply(commander, (0, helpers_1.injectArgs)(commander, this, 'run'));\n }\n }\n };\n (0, helpers_1.initCommander)(constructor);\n return mixin;\n };\n}\nexports.program = program;\nfunction prepareProgram(target) {\n let argList = '';\n if (Reflect.hasMetadata(metadata_1.OptionsMetadata, target)) {\n const args = Reflect.getMetadata(metadata_1.OptionsMetadata, target);\n argList = args\n .map((arg) => {\n return arg.toString();\n })\n .join(' ')\n .replace(/^(.)/, ' $1');\n }\n return `${argList}`;\n}\n//# sourceMappingURL=program.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.usage = void 0;\nconst commander = require(\"commander\");\nfunction usage(text) {\n return (target) => {\n commander.usage(text);\n };\n}\nexports.usage = usage;\n//# sourceMappingURL=usage.decorator.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\nconst helpers_1 = require(\"../helpers\");\nconst metadata_1 = require(\"../metadata\");\nfunction version(text) {\n return (target) => {\n (0, helpers_1.initCommander)(target);\n const program = Reflect.getMetadata(metadata_1.ProgramMetadata, target);\n program.version(text);\n };\n}\nexports.version = version;\n//# sourceMappingURL=version.decorator.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./init-commander\"), exports);\n__exportStar(require(\"./inject-args\"), exports);\n__exportStar(require(\"./prepare-command\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.initCommander = void 0;\nconst commander = require(\"commander\");\nconst metadata_1 = require(\"../metadata\");\nfunction initCommander(target) {\n if (!Reflect.hasMetadata(metadata_1.ProgramMetadata, target)) {\n const decorator = Reflect.metadata(metadata_1.ProgramMetadata, commander);\n Reflect.decorate([decorator], target);\n }\n}\nexports.initCommander = initCommander;\n//# sourceMappingURL=init-commander.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.injectArgs = void 0;\nconst metadata_1 = require(\"../metadata\");\nconst index_1 = require(\"../models/index\");\nfunction injectArgs(program, target, propertyKey) {\n if (Reflect.hasMetadata(metadata_1.ArgsMetadata, target, propertyKey)) {\n const args = Reflect.getMetadata(metadata_1.ArgsMetadata, target, propertyKey);\n const predicate = (arg) => arg instanceof index_1.VariadicArg;\n const variadic = args.find(predicate);\n if (variadic && (args.findIndex(predicate) !== (args.length - 1))) {\n throw new TypeError(`Variadic argument must be specified last the argument list of the ${String(propertyKey)}() function.`);\n }\n const argv = [];\n let index = 0;\n for (let i = 0; i < args.length; i += 1) {\n if (args.find(arg => arg.index === i)) {\n argv.push(program.args[index]);\n index += 1;\n }\n else {\n argv.push(undefined);\n }\n }\n return argv;\n }\n}\nexports.injectArgs = injectArgs;\n//# sourceMappingURL=inject-args.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.prepareSubcommand = exports.prepareCommand = void 0;\nconst metadata_1 = require(\"../metadata\");\nconst index_1 = require(\"../models/index\");\nfunction prepareCommand(target, propertyKey) {\n let argList = '';\n if (Reflect.hasMetadata(metadata_1.ArgsMetadata, target, propertyKey)) {\n const args = Reflect.getMetadata(metadata_1.ArgsMetadata, target, propertyKey);\n const predicate = (arg) => arg instanceof index_1.VariadicArg;\n const variadic = args.find(predicate);\n if (variadic && (args.findIndex(predicate) !== (args.length - 1))) {\n throw new TypeError(`Variadic argument must be specified last the argument list of the ${String(propertyKey)}() function.`);\n }\n argList = args\n .map((arg) => {\n return arg.toString();\n })\n .join(' ')\n .replace(/^(.)/, '$1');\n }\n return `${argList}`;\n}\nexports.prepareCommand = prepareCommand;\nfunction prepareSubcommand(target, propertyKey) {\n const argList = prepareCommand(target, propertyKey);\n return `${String(propertyKey)} ${argList}`;\n}\nexports.prepareSubcommand = prepareSubcommand;\n//# sourceMappingURL=prepare-command.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Option = exports.Command = void 0;\nrequire(\"reflect-metadata\");\nvar commander_1 = require(\"commander\");\nObject.defineProperty(exports, \"Command\", { enumerable: true, get: function () { return commander_1.Command; } });\nObject.defineProperty(exports, \"Option\", { enumerable: true, get: function () { return commander_1.Option; } });\n__exportStar(require(\"./decorators\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SubcommandMetadata = exports.ProgramMetadata = exports.OptionsMetadata = exports.CommandOptionsMetadata = exports.ArgsMetadata = void 0;\nexports.ArgsMetadata = Symbol('ArgsMetadata');\nexports.CommandOptionsMetadata = Symbol('CommandOptionsMetadata');\nexports.OptionsMetadata = Symbol('OptionsMetadata');\nexports.ProgramMetadata = Symbol('ProgramMetadata');\nexports.SubcommandMetadata = Symbol('SubcommandMetadata');\n//# sourceMappingURL=metadata.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VariadicArg = exports.RequiredArg = exports.OptionalArg = exports.CommandArg = void 0;\nclass CommandArg {\n constructor(name, index) {\n this.name = name;\n this.index = index;\n if (typeof name === 'symbol') {\n throw new TypeError('Symbols are not supported as argument names.');\n }\n }\n}\nexports.CommandArg = CommandArg;\nclass OptionalArg extends CommandArg {\n toString() {\n return `[${String(this.name)}]`;\n }\n}\nexports.OptionalArg = OptionalArg;\nclass RequiredArg extends CommandArg {\n toString() {\n return `<${String(this.name)}>`;\n }\n}\nexports.RequiredArg = RequiredArg;\nclass VariadicArg extends CommandArg {\n toString() {\n return `[${String(this.name)}...]`;\n }\n}\nexports.VariadicArg = VariadicArg;\n//# sourceMappingURL=arg.model.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./arg.model\"), exports);\n__exportStar(require(\"./option.model\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Option = void 0;\nclass Option {\n constructor(name, args) {\n this.name = name;\n this.args = args;\n }\n}\nexports.Option = Option;\n//# sourceMappingURL=option.model.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.decorateIfNot = void 0;\nfunction decorateIfNot(metadataKey, value, target, propertyKey) {\n if (!Reflect.hasMetadata(metadataKey, target, propertyKey)) {\n const decorator = Reflect.metadata(metadataKey, value);\n Reflect.decorate([decorator], target, propertyKey);\n }\n return Reflect.getMetadata(metadataKey, target, propertyKey);\n}\nexports.decorateIfNot = decorateIfNot;\n//# sourceMappingURL=decorateIfNot.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./decorateIfNot\"), exports);\n//# sourceMappingURL=index.js.map","module.exports = function (xs, fn) {\n var res = [];\n for (var i = 0; i < xs.length; i++) {\n var x = fn(xs[i], i);\n if (isArray(x)) res.push.apply(res, x);\n else res.push(x);\n }\n return res;\n};\n\nvar isArray = Array.isArray || function (xs) {\n return Object.prototype.toString.call(xs) === '[object Array]';\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n// NOTE: These type checking functions intentionally don't use `instanceof`\n// because it is fragile and can be easily faked with `Object.create()`.\n\nfunction isArray(arg) {\n if (Array.isArray) {\n return Array.isArray(arg);\n }\n return objectToString(arg) === '[object Array]';\n}\nexports.isArray = isArray;\n\nfunction isBoolean(arg) {\n return typeof arg === 'boolean';\n}\nexports.isBoolean = isBoolean;\n\nfunction isNull(arg) {\n return arg === null;\n}\nexports.isNull = isNull;\n\nfunction isNullOrUndefined(arg) {\n return arg == null;\n}\nexports.isNullOrUndefined = isNullOrUndefined;\n\nfunction isNumber(arg) {\n return typeof arg === 'number';\n}\nexports.isNumber = isNumber;\n\nfunction isString(arg) {\n return typeof arg === 'string';\n}\nexports.isString = isString;\n\nfunction isSymbol(arg) {\n return typeof arg === 'symbol';\n}\nexports.isSymbol = isSymbol;\n\nfunction isUndefined(arg) {\n return arg === void 0;\n}\nexports.isUndefined = isUndefined;\n\nfunction isRegExp(re) {\n return objectToString(re) === '[object RegExp]';\n}\nexports.isRegExp = isRegExp;\n\nfunction isObject(arg) {\n return typeof arg === 'object' && arg !== null;\n}\nexports.isObject = isObject;\n\nfunction isDate(d) {\n return objectToString(d) === '[object Date]';\n}\nexports.isDate = isDate;\n\nfunction isError(e) {\n return (objectToString(e) === '[object Error]' || e instanceof Error);\n}\nexports.isError = isError;\n\nfunction isFunction(arg) {\n return typeof arg === 'function';\n}\nexports.isFunction = isFunction;\n\nfunction isPrimitive(arg) {\n return arg === null ||\n typeof arg === 'boolean' ||\n typeof arg === 'number' ||\n typeof arg === 'string' ||\n typeof arg === 'symbol' || // ES6 symbol\n typeof arg === 'undefined';\n}\nexports.isPrimitive = isPrimitive;\n\nexports.isBuffer = Buffer.isBuffer;\n\nfunction objectToString(o) {\n return Object.prototype.toString.call(o);\n}\n","'use strict';\n\nconst cp = require('child_process');\nconst parse = require('./lib/parse');\nconst enoent = require('./lib/enoent');\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);\n\n // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n enoent.hookChildProcess(spawned, parsed);\n\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);\n\n // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n\n return result;\n}\n\nmodule.exports = spawn;\nmodule.exports.spawn = spawn;\nmodule.exports.sync = spawnSync;\n\nmodule.exports._parse = parse;\nmodule.exports._enoent = enoent;\n","'use strict';\n\nconst isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: `${syscall} ${original.command}`,\n path: original.command,\n spawnargs: original.args,\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n const originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n const err = verifyENOENT(arg1, parsed, 'spawn');\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nmodule.exports = {\n hookChildProcess,\n verifyENOENT,\n verifyENOENTSync,\n notFoundError,\n};\n","'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n","'use strict';\n\n// See http://www.robvanderwoude.com/escapechars.php\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = `${arg}`;\n\n // Algorithm below is based on https://qntm.org/cmd\n\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n arg = arg.replace(/(\\\\*)\"/g, '$1$1\\\\\"');\n\n // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n arg = arg.replace(/(\\\\*)$/, '$1$1');\n\n // All other backslashes occur literally\n\n // Quote the whole thing:\n arg = `\"${arg}\"`;\n\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n // Double escape meta chars if necessary\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\nmodule.exports.command = escapeCommand;\nmodule.exports.argument = escapeArgument;\n","'use strict';\n\nconst fs = require('fs');\nconst shebangCommand = require('shebang-command');\n\nfunction readShebang(command) {\n // Read the first 150 bytes from the file\n const size = 150;\n const buffer = Buffer.alloc(size);\n\n let fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) { /* Empty */ }\n\n // Attempt to extract shebang (null is returned if not a shebang)\n return shebangCommand(buffer.toString());\n}\n\nmodule.exports = readShebang;\n","'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n","var Stream = require('stream').Stream;\nvar util = require('util');\n\nmodule.exports = DelayedStream;\nfunction DelayedStream() {\n this.source = null;\n this.dataSize = 0;\n this.maxDataSize = 1024 * 1024;\n this.pauseStream = true;\n\n this._maxDataSizeExceeded = false;\n this._released = false;\n this._bufferedEvents = [];\n}\nutil.inherits(DelayedStream, Stream);\n\nDelayedStream.create = function(source, options) {\n var delayedStream = new this();\n\n options = options || {};\n for (var option in options) {\n delayedStream[option] = options[option];\n }\n\n delayedStream.source = source;\n\n var realEmit = source.emit;\n source.emit = function() {\n delayedStream._handleEmit(arguments);\n return realEmit.apply(source, arguments);\n };\n\n source.on('error', function() {});\n if (delayedStream.pauseStream) {\n source.pause();\n }\n\n return delayedStream;\n};\n\nObject.defineProperty(DelayedStream.prototype, 'readable', {\n configurable: true,\n enumerable: true,\n get: function() {\n return this.source.readable;\n }\n});\n\nDelayedStream.prototype.setEncoding = function() {\n return this.source.setEncoding.apply(this.source, arguments);\n};\n\nDelayedStream.prototype.resume = function() {\n if (!this._released) {\n this.release();\n }\n\n this.source.resume();\n};\n\nDelayedStream.prototype.pause = function() {\n this.source.pause();\n};\n\nDelayedStream.prototype.release = function() {\n this._released = true;\n\n this._bufferedEvents.forEach(function(args) {\n this.emit.apply(this, args);\n }.bind(this));\n this._bufferedEvents = [];\n};\n\nDelayedStream.prototype.pipe = function() {\n var r = Stream.prototype.pipe.apply(this, arguments);\n this.resume();\n return r;\n};\n\nDelayedStream.prototype._handleEmit = function(args) {\n if (this._released) {\n this.emit.apply(this, args);\n return;\n }\n\n if (args[0] === 'data') {\n this.dataSize += args[1].length;\n this._checkIfMaxDataSizeExceeded();\n }\n\n this._bufferedEvents.push(args);\n};\n\nDelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {\n if (this._maxDataSizeExceeded) {\n return;\n }\n\n if (this.dataSize <= this.maxDataSize) {\n return;\n }\n\n this._maxDataSizeExceeded = true;\n var message =\n 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'\n this.emit('error', new Error(message));\n};\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nclass Deprecation extends Error {\n constructor(message) {\n super(message); // Maintains proper stack trace (only available on V8)\n\n /* istanbul ignore next */\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n }\n\n this.name = 'Deprecation';\n }\n\n}\n\nexports.Deprecation = Deprecation;\n","var crypto = require(\"crypto\");\nvar BigInteger = require(\"jsbn\").BigInteger;\nvar ECPointFp = require(\"./lib/ec.js\").ECPointFp;\nvar Buffer = require(\"safer-buffer\").Buffer;\nexports.ECCurves = require(\"./lib/sec.js\");\n\n// zero prepad\nfunction unstupid(hex,len)\n{\n\treturn (hex.length >= len) ? hex : unstupid(\"0\"+hex,len);\n}\n\nexports.ECKey = function(curve, key, isPublic)\n{\n var priv;\n\tvar c = curve();\n\tvar n = c.getN();\n var bytes = Math.floor(n.bitLength()/8);\n\n if(key)\n {\n if(isPublic)\n {\n var curve = c.getCurve();\n// var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format\n// var y = key.slice(bytes+1);\n// this.P = new ECPointFp(curve,\n// curve.fromBigInteger(new BigInteger(x.toString(\"hex\"), 16)),\n// curve.fromBigInteger(new BigInteger(y.toString(\"hex\"), 16))); \n this.P = curve.decodePointHex(key.toString(\"hex\"));\n }else{\n if(key.length != bytes) return false;\n priv = new BigInteger(key.toString(\"hex\"), 16); \n }\n }else{\n var n1 = n.subtract(BigInteger.ONE);\n var r = new BigInteger(crypto.randomBytes(n.bitLength()));\n priv = r.mod(n1).add(BigInteger.ONE);\n this.P = c.getG().multiply(priv);\n }\n if(this.P)\n {\n// var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2);\n// this.PublicKey = Buffer.from(\"04\"+pubhex,\"hex\");\n this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),\"hex\");\n }\n if(priv)\n {\n this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),\"hex\");\n this.deriveSharedSecret = function(key)\n {\n if(!key || !key.P) return false;\n var S = key.P.multiply(priv);\n return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),\"hex\");\n } \n }\n}\n\n","// Basic Javascript Elliptic Curve implementation\n// Ported loosely from BouncyCastle's Java EC code\n// Only Fp curves implemented for now\n\n// Requires jsbn.js and jsbn2.js\nvar BigInteger = require('jsbn').BigInteger\nvar Barrett = BigInteger.prototype.Barrett\n\n// ----------------\n// ECFieldElementFp\n\n// constructor\nfunction ECFieldElementFp(q,x) {\n this.x = x;\n // TODO if(x.compareTo(q) >= 0) error\n this.q = q;\n}\n\nfunction feFpEquals(other) {\n if(other == this) return true;\n return (this.q.equals(other.q) && this.x.equals(other.x));\n}\n\nfunction feFpToBigInteger() {\n return this.x;\n}\n\nfunction feFpNegate() {\n return new ECFieldElementFp(this.q, this.x.negate().mod(this.q));\n}\n\nfunction feFpAdd(b) {\n return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpSubtract(b) {\n return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpMultiply(b) {\n return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q));\n}\n\nfunction feFpSquare() {\n return new ECFieldElementFp(this.q, this.x.square().mod(this.q));\n}\n\nfunction feFpDivide(b) {\n return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q));\n}\n\nECFieldElementFp.prototype.equals = feFpEquals;\nECFieldElementFp.prototype.toBigInteger = feFpToBigInteger;\nECFieldElementFp.prototype.negate = feFpNegate;\nECFieldElementFp.prototype.add = feFpAdd;\nECFieldElementFp.prototype.subtract = feFpSubtract;\nECFieldElementFp.prototype.multiply = feFpMultiply;\nECFieldElementFp.prototype.square = feFpSquare;\nECFieldElementFp.prototype.divide = feFpDivide;\n\n// ----------------\n// ECPointFp\n\n// constructor\nfunction ECPointFp(curve,x,y,z) {\n this.curve = curve;\n this.x = x;\n this.y = y;\n // Projective coordinates: either zinv == null or z * zinv == 1\n // z and zinv are just BigIntegers, not fieldElements\n if(z == null) {\n this.z = BigInteger.ONE;\n }\n else {\n this.z = z;\n }\n this.zinv = null;\n //TODO: compression flag\n}\n\nfunction pointFpGetX() {\n if(this.zinv == null) {\n this.zinv = this.z.modInverse(this.curve.q);\n }\n var r = this.x.toBigInteger().multiply(this.zinv);\n this.curve.reduce(r);\n return this.curve.fromBigInteger(r);\n}\n\nfunction pointFpGetY() {\n if(this.zinv == null) {\n this.zinv = this.z.modInverse(this.curve.q);\n }\n var r = this.y.toBigInteger().multiply(this.zinv);\n this.curve.reduce(r);\n return this.curve.fromBigInteger(r);\n}\n\nfunction pointFpEquals(other) {\n if(other == this) return true;\n if(this.isInfinity()) return other.isInfinity();\n if(other.isInfinity()) return this.isInfinity();\n var u, v;\n // u = Y2 * Z1 - Y1 * Z2\n u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q);\n if(!u.equals(BigInteger.ZERO)) return false;\n // v = X2 * Z1 - X1 * Z2\n v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q);\n return v.equals(BigInteger.ZERO);\n}\n\nfunction pointFpIsInfinity() {\n if((this.x == null) && (this.y == null)) return true;\n return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO);\n}\n\nfunction pointFpNegate() {\n return new ECPointFp(this.curve, this.x, this.y.negate(), this.z);\n}\n\nfunction pointFpAdd(b) {\n if(this.isInfinity()) return b;\n if(b.isInfinity()) return this;\n\n // u = Y2 * Z1 - Y1 * Z2\n var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q);\n // v = X2 * Z1 - X1 * Z2\n var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);\n\n if(BigInteger.ZERO.equals(v)) {\n if(BigInteger.ZERO.equals(u)) {\n return this.twice(); // this == b, so double\n }\n\treturn this.curve.getInfinity(); // this = -b, so infinity\n }\n\n var THREE = new BigInteger(\"3\");\n var x1 = this.x.toBigInteger();\n var y1 = this.y.toBigInteger();\n var x2 = b.x.toBigInteger();\n var y2 = b.y.toBigInteger();\n\n var v2 = v.square();\n var v3 = v2.multiply(v);\n var x1v2 = x1.multiply(v2);\n var zu2 = u.square().multiply(this.z);\n\n // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)\n var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q);\n // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3\n var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q);\n // z3 = v^3 * z1 * z2\n var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q);\n\n return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);\n}\n\nfunction pointFpTwice() {\n if(this.isInfinity()) return this;\n if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity();\n\n // TODO: optimized handling of constants\n var THREE = new BigInteger(\"3\");\n var x1 = this.x.toBigInteger();\n var y1 = this.y.toBigInteger();\n\n var y1z1 = y1.multiply(this.z);\n var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q);\n var a = this.curve.a.toBigInteger();\n\n // w = 3 * x1^2 + a * z1^2\n var w = x1.square().multiply(THREE);\n if(!BigInteger.ZERO.equals(a)) {\n w = w.add(this.z.square().multiply(a));\n }\n w = w.mod(this.curve.q);\n //this.curve.reduce(w);\n // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)\n var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q);\n // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3\n var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q);\n // z3 = 8 * (y1 * z1)^3\n var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);\n\n return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);\n}\n\n// Simple NAF (Non-Adjacent Form) multiplication algorithm\n// TODO: modularize the multiplication algorithm\nfunction pointFpMultiply(k) {\n if(this.isInfinity()) return this;\n if(k.signum() == 0) return this.curve.getInfinity();\n\n var e = k;\n var h = e.multiply(new BigInteger(\"3\"));\n\n var neg = this.negate();\n var R = this;\n\n var i;\n for(i = h.bitLength() - 2; i > 0; --i) {\n\tR = R.twice();\n\n\tvar hBit = h.testBit(i);\n\tvar eBit = e.testBit(i);\n\n\tif (hBit != eBit) {\n\t R = R.add(hBit ? this : neg);\n\t}\n }\n\n return R;\n}\n\n// Compute this*j + x*k (simultaneous multiplication)\nfunction pointFpMultiplyTwo(j,x,k) {\n var i;\n if(j.bitLength() > k.bitLength())\n i = j.bitLength() - 1;\n else\n i = k.bitLength() - 1;\n\n var R = this.curve.getInfinity();\n var both = this.add(x);\n while(i >= 0) {\n R = R.twice();\n if(j.testBit(i)) {\n if(k.testBit(i)) {\n R = R.add(both);\n }\n else {\n R = R.add(this);\n }\n }\n else {\n if(k.testBit(i)) {\n R = R.add(x);\n }\n }\n --i;\n }\n\n return R;\n}\n\nECPointFp.prototype.getX = pointFpGetX;\nECPointFp.prototype.getY = pointFpGetY;\nECPointFp.prototype.equals = pointFpEquals;\nECPointFp.prototype.isInfinity = pointFpIsInfinity;\nECPointFp.prototype.negate = pointFpNegate;\nECPointFp.prototype.add = pointFpAdd;\nECPointFp.prototype.twice = pointFpTwice;\nECPointFp.prototype.multiply = pointFpMultiply;\nECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo;\n\n// ----------------\n// ECCurveFp\n\n// constructor\nfunction ECCurveFp(q,a,b) {\n this.q = q;\n this.a = this.fromBigInteger(a);\n this.b = this.fromBigInteger(b);\n this.infinity = new ECPointFp(this, null, null);\n this.reducer = new Barrett(this.q);\n}\n\nfunction curveFpGetQ() {\n return this.q;\n}\n\nfunction curveFpGetA() {\n return this.a;\n}\n\nfunction curveFpGetB() {\n return this.b;\n}\n\nfunction curveFpEquals(other) {\n if(other == this) return true;\n return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b));\n}\n\nfunction curveFpGetInfinity() {\n return this.infinity;\n}\n\nfunction curveFpFromBigInteger(x) {\n return new ECFieldElementFp(this.q, x);\n}\n\nfunction curveReduce(x) {\n this.reducer.reduce(x);\n}\n\n// for now, work with hex strings because they're easier in JS\nfunction curveFpDecodePointHex(s) {\n switch(parseInt(s.substr(0,2), 16)) { // first byte\n case 0:\n\treturn this.infinity;\n case 2:\n case 3:\n\t// point compression not supported yet\n\treturn null;\n case 4:\n case 6:\n case 7:\n\tvar len = (s.length - 2) / 2;\n\tvar xHex = s.substr(2, len);\n\tvar yHex = s.substr(len+2, len);\n\n\treturn new ECPointFp(this,\n\t\t\t this.fromBigInteger(new BigInteger(xHex, 16)),\n\t\t\t this.fromBigInteger(new BigInteger(yHex, 16)));\n\n default: // unsupported\n\treturn null;\n }\n}\n\nfunction curveFpEncodePointHex(p) {\n\tif (p.isInfinity()) return \"00\";\n\tvar xHex = p.getX().toBigInteger().toString(16);\n\tvar yHex = p.getY().toBigInteger().toString(16);\n\tvar oLen = this.getQ().toString(16).length;\n\tif ((oLen % 2) != 0) oLen++;\n\twhile (xHex.length < oLen) {\n\t\txHex = \"0\" + xHex;\n\t}\n\twhile (yHex.length < oLen) {\n\t\tyHex = \"0\" + yHex;\n\t}\n\treturn \"04\" + xHex + yHex;\n}\n\nECCurveFp.prototype.getQ = curveFpGetQ;\nECCurveFp.prototype.getA = curveFpGetA;\nECCurveFp.prototype.getB = curveFpGetB;\nECCurveFp.prototype.equals = curveFpEquals;\nECCurveFp.prototype.getInfinity = curveFpGetInfinity;\nECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger;\nECCurveFp.prototype.reduce = curveReduce;\n//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex;\nECCurveFp.prototype.encodePointHex = curveFpEncodePointHex;\n\n// from: https://github.com/kaielvin/jsbn-ec-point-compression\nECCurveFp.prototype.decodePointHex = function(s)\n{\n\tvar yIsEven;\n switch(parseInt(s.substr(0,2), 16)) { // first byte\n case 0:\n\treturn this.infinity;\n case 2:\n\tyIsEven = false;\n case 3:\n\tif(yIsEven == undefined) yIsEven = true;\n\tvar len = s.length - 2;\n\tvar xHex = s.substr(2, len);\n\tvar x = this.fromBigInteger(new BigInteger(xHex,16));\n\tvar alpha = x.multiply(x.square().add(this.getA())).add(this.getB());\n\tvar beta = alpha.sqrt();\n\n if (beta == null) throw \"Invalid point compression\";\n\n var betaValue = beta.toBigInteger();\n if (betaValue.testBit(0) != yIsEven)\n {\n // Use the other root\n beta = this.fromBigInteger(this.getQ().subtract(betaValue));\n }\n return new ECPointFp(this,x,beta);\n case 4:\n case 6:\n case 7:\n\tvar len = (s.length - 2) / 2;\n\tvar xHex = s.substr(2, len);\n\tvar yHex = s.substr(len+2, len);\n\n\treturn new ECPointFp(this,\n\t\t\t this.fromBigInteger(new BigInteger(xHex, 16)),\n\t\t\t this.fromBigInteger(new BigInteger(yHex, 16)));\n\n default: // unsupported\n\treturn null;\n }\n}\nECCurveFp.prototype.encodeCompressedPointHex = function(p)\n{\n\tif (p.isInfinity()) return \"00\";\n\tvar xHex = p.getX().toBigInteger().toString(16);\n\tvar oLen = this.getQ().toString(16).length;\n\tif ((oLen % 2) != 0) oLen++;\n\twhile (xHex.length < oLen)\n\t\txHex = \"0\" + xHex;\n\tvar yPrefix;\n\tif(p.getY().toBigInteger().isEven()) yPrefix = \"02\";\n\telse yPrefix = \"03\";\n\n\treturn yPrefix + xHex;\n}\n\n\nECFieldElementFp.prototype.getR = function()\n{\n\tif(this.r != undefined) return this.r;\n\n this.r = null;\n var bitLength = this.q.bitLength();\n if (bitLength > 128)\n {\n var firstWord = this.q.shiftRight(bitLength - 64);\n if (firstWord.intValue() == -1)\n {\n this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q);\n }\n }\n return this.r;\n}\nECFieldElementFp.prototype.modMult = function(x1,x2)\n{\n return this.modReduce(x1.multiply(x2));\n}\nECFieldElementFp.prototype.modReduce = function(x)\n{\n if (this.getR() != null)\n {\n var qLen = q.bitLength();\n while (x.bitLength() > (qLen + 1))\n {\n var u = x.shiftRight(qLen);\n var v = x.subtract(u.shiftLeft(qLen));\n if (!this.getR().equals(BigInteger.ONE))\n {\n u = u.multiply(this.getR());\n }\n x = u.add(v); \n }\n while (x.compareTo(q) >= 0)\n {\n x = x.subtract(q);\n }\n }\n else\n {\n x = x.mod(q);\n }\n return x;\n}\nECFieldElementFp.prototype.sqrt = function()\n{\n if (!this.q.testBit(0)) throw \"unsupported\";\n\n // p mod 4 == 3\n if (this.q.testBit(1))\n {\n \tvar z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q));\n \treturn z.square().equals(this) ? z : null;\n }\n\n // p mod 4 == 1\n var qMinusOne = this.q.subtract(BigInteger.ONE);\n\n var legendreExponent = qMinusOne.shiftRight(1);\n if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)))\n {\n return null;\n }\n\n var u = qMinusOne.shiftRight(2);\n var k = u.shiftLeft(1).add(BigInteger.ONE);\n\n var Q = this.x;\n var fourQ = modDouble(modDouble(Q));\n\n var U, V;\n do\n {\n var P;\n do\n {\n P = new BigInteger(this.q.bitLength(), new SecureRandom());\n }\n while (P.compareTo(this.q) >= 0\n || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne)));\n\n var result = this.lucasSequence(P, Q, k);\n U = result[0];\n V = result[1];\n\n if (this.modMult(V, V).equals(fourQ))\n {\n // Integer division by 2, mod q\n if (V.testBit(0))\n {\n V = V.add(q);\n }\n\n V = V.shiftRight(1);\n\n return new ECFieldElementFp(q,V);\n }\n }\n while (U.equals(BigInteger.ONE) || U.equals(qMinusOne));\n\n return null;\n}\nECFieldElementFp.prototype.lucasSequence = function(P,Q,k)\n{\n var n = k.bitLength();\n var s = k.getLowestSetBit();\n\n var Uh = BigInteger.ONE;\n var Vl = BigInteger.TWO;\n var Vh = P;\n var Ql = BigInteger.ONE;\n var Qh = BigInteger.ONE;\n\n for (var j = n - 1; j >= s + 1; --j)\n {\n Ql = this.modMult(Ql, Qh);\n\n if (k.testBit(j))\n {\n Qh = this.modMult(Ql, Q);\n Uh = this.modMult(Uh, Vh);\n Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)));\n }\n else\n {\n Qh = Ql;\n Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));\n Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));\n }\n }\n\n Ql = this.modMult(Ql, Qh);\n Qh = this.modMult(Ql, Q);\n Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));\n Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));\n Ql = this.modMult(Ql, Qh);\n\n for (var j = 1; j <= s; ++j)\n {\n Uh = this.modMult(Uh, Vl);\n Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));\n Ql = this.modMult(Ql, Ql);\n }\n\n return [ Uh, Vl ];\n}\n\nvar exports = {\n ECCurveFp: ECCurveFp,\n ECPointFp: ECPointFp,\n ECFieldElementFp: ECFieldElementFp\n}\n\nmodule.exports = exports\n","// Named EC curves\n\n// Requires ec.js, jsbn.js, and jsbn2.js\nvar BigInteger = require('jsbn').BigInteger\nvar ECCurveFp = require('./ec.js').ECCurveFp\n\n\n// ----------------\n// X9ECParameters\n\n// constructor\nfunction X9ECParameters(curve,g,n,h) {\n this.curve = curve;\n this.g = g;\n this.n = n;\n this.h = h;\n}\n\nfunction x9getCurve() {\n return this.curve;\n}\n\nfunction x9getG() {\n return this.g;\n}\n\nfunction x9getN() {\n return this.n;\n}\n\nfunction x9getH() {\n return this.h;\n}\n\nX9ECParameters.prototype.getCurve = x9getCurve;\nX9ECParameters.prototype.getG = x9getG;\nX9ECParameters.prototype.getN = x9getN;\nX9ECParameters.prototype.getH = x9getH;\n\n// ----------------\n// SECNamedCurves\n\nfunction fromHex(s) { return new BigInteger(s, 16); }\n\nfunction secp128r1() {\n // p = 2^128 - 2^97 - 1\n var p = fromHex(\"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"E87579C11079F43DD824993C2CEE5ED3\");\n //byte[] S = Hex.decode(\"000E0D4D696E6768756151750CC03A4473D03679\");\n var n = fromHex(\"FFFFFFFE0000000075A30D1B9038A115\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"161FF7528B899B2D0C28607CA52C5B86\"\n\t\t+ \"CF5AC8395BAFEB13C02DA292DDED7A83\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp160k1() {\n // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73\");\n var a = BigInteger.ZERO;\n var b = fromHex(\"7\");\n //byte[] S = null;\n var n = fromHex(\"0100000000000000000001B8FA16DFAB9ACA16B6B3\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"3B4C382CE37AA192A4019E763036F4F5DD4D7EBB\"\n + \"938CF935318FDCED6BC28286531733C3F03C4FEE\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp160r1() {\n // p = 2^160 - 2^31 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC\");\n var b = fromHex(\"1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45\");\n //byte[] S = Hex.decode(\"1053CDE42C14D696E67687561517533BF3F83345\");\n var n = fromHex(\"0100000000000000000001F4C8F927AED3CA752257\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n\t\t+ \"4A96B5688EF573284664698968C38BB913CBFC82\"\n\t\t+ \"23A628553168947D59DCC912042351377AC5FB32\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp192k1() {\n // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37\");\n var a = BigInteger.ZERO;\n var b = fromHex(\"3\");\n //byte[] S = null;\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D\"\n + \"9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp192r1() {\n // p = 2^192 - 2^64 - 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1\");\n //byte[] S = Hex.decode(\"3045AE6FC8422F64ED579528D38120EAE12196D5\");\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012\"\n + \"07192B95FFC8DA78631011ED6B24CDD573F977A11E794811\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp224r1() {\n // p = 2^224 - 2^96 + 1\n var p = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001\");\n var a = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE\");\n var b = fromHex(\"B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4\");\n //byte[] S = Hex.decode(\"BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5\");\n var n = fromHex(\"FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21\"\n + \"BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34\");\n return new X9ECParameters(curve, G, n, h);\n}\n\nfunction secp256r1() {\n // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1\n var p = fromHex(\"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF\");\n var a = fromHex(\"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC\");\n var b = fromHex(\"5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B\");\n //byte[] S = Hex.decode(\"C49D360886E704936A6678E1139D26B7819F7E90\");\n var n = fromHex(\"FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551\");\n var h = BigInteger.ONE;\n var curve = new ECCurveFp(p, a, b);\n var G = curve.decodePointHex(\"04\"\n + \"6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296\"\n\t\t+ \"4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5\");\n return new X9ECParameters(curve, G, n, h);\n}\n\n// TODO: make this into a proper hashtable\nfunction getSECCurveByName(name) {\n if(name == \"secp128r1\") return secp128r1();\n if(name == \"secp160k1\") return secp160k1();\n if(name == \"secp160r1\") return secp160r1();\n if(name == \"secp192k1\") return secp192k1();\n if(name == \"secp192r1\") return secp192r1();\n if(name == \"secp224r1\") return secp224r1();\n if(name == \"secp256r1\") return secp256r1();\n return null;\n}\n\nmodule.exports = {\n \"secp128r1\":secp128r1,\n \"secp160k1\":secp160k1,\n \"secp160r1\":secp160r1,\n \"secp192k1\":secp192k1,\n \"secp192r1\":secp192r1,\n \"secp224r1\":secp224r1,\n \"secp256r1\":secp256r1\n}\n","var once = require('once');\n\nvar noop = function() {};\n\nvar isRequest = function(stream) {\n\treturn stream.setHeader && typeof stream.abort === 'function';\n};\n\nvar isChildProcess = function(stream) {\n\treturn stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3\n};\n\nvar eos = function(stream, opts, callback) {\n\tif (typeof opts === 'function') return eos(stream, null, opts);\n\tif (!opts) opts = {};\n\n\tcallback = once(callback || noop);\n\n\tvar ws = stream._writableState;\n\tvar rs = stream._readableState;\n\tvar readable = opts.readable || (opts.readable !== false && stream.readable);\n\tvar writable = opts.writable || (opts.writable !== false && stream.writable);\n\tvar cancelled = false;\n\n\tvar onlegacyfinish = function() {\n\t\tif (!stream.writable) onfinish();\n\t};\n\n\tvar onfinish = function() {\n\t\twritable = false;\n\t\tif (!readable) callback.call(stream);\n\t};\n\n\tvar onend = function() {\n\t\treadable = false;\n\t\tif (!writable) callback.call(stream);\n\t};\n\n\tvar onexit = function(exitCode) {\n\t\tcallback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);\n\t};\n\n\tvar onerror = function(err) {\n\t\tcallback.call(stream, err);\n\t};\n\n\tvar onclose = function() {\n\t\tprocess.nextTick(onclosenexttick);\n\t};\n\n\tvar onclosenexttick = function() {\n\t\tif (cancelled) return;\n\t\tif (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));\n\t\tif (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));\n\t};\n\n\tvar onrequest = function() {\n\t\tstream.req.on('finish', onfinish);\n\t};\n\n\tif (isRequest(stream)) {\n\t\tstream.on('complete', onfinish);\n\t\tstream.on('abort', onclose);\n\t\tif (stream.req) onrequest();\n\t\telse stream.on('request', onrequest);\n\t} else if (writable && !ws) { // legacy streams\n\t\tstream.on('end', onlegacyfinish);\n\t\tstream.on('close', onlegacyfinish);\n\t}\n\n\tif (isChildProcess(stream)) stream.on('exit', onexit);\n\n\tstream.on('end', onend);\n\tstream.on('finish', onfinish);\n\tif (opts.error !== false) stream.on('error', onerror);\n\tstream.on('close', onclose);\n\n\treturn function() {\n\t\tcancelled = true;\n\t\tstream.removeListener('complete', onfinish);\n\t\tstream.removeListener('abort', onclose);\n\t\tstream.removeListener('request', onrequest);\n\t\tif (stream.req) stream.req.removeListener('finish', onfinish);\n\t\tstream.removeListener('end', onlegacyfinish);\n\t\tstream.removeListener('close', onlegacyfinish);\n\t\tstream.removeListener('finish', onfinish);\n\t\tstream.removeListener('exit', onexit);\n\t\tstream.removeListener('end', onend);\n\t\tstream.removeListener('error', onerror);\n\t\tstream.removeListener('close', onclose);\n\t};\n};\n\nmodule.exports = eos;\n","'use strict';\n\nvar hasOwn = Object.prototype.hasOwnProperty;\nvar toStr = Object.prototype.toString;\nvar defineProperty = Object.defineProperty;\nvar gOPD = Object.getOwnPropertyDescriptor;\n\nvar isArray = function isArray(arr) {\n\tif (typeof Array.isArray === 'function') {\n\t\treturn Array.isArray(arr);\n\t}\n\n\treturn toStr.call(arr) === '[object Array]';\n};\n\nvar isPlainObject = function isPlainObject(obj) {\n\tif (!obj || toStr.call(obj) !== '[object Object]') {\n\t\treturn false;\n\t}\n\n\tvar hasOwnConstructor = hasOwn.call(obj, 'constructor');\n\tvar hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');\n\t// Not own constructor property must be Object\n\tif (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {\n\t\treturn false;\n\t}\n\n\t// Own properties are enumerated firstly, so to speed up,\n\t// if last one is own, then all properties are own.\n\tvar key;\n\tfor (key in obj) { /**/ }\n\n\treturn typeof key === 'undefined' || hasOwn.call(obj, key);\n};\n\n// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target\nvar setProperty = function setProperty(target, options) {\n\tif (defineProperty && options.name === '__proto__') {\n\t\tdefineProperty(target, options.name, {\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true,\n\t\t\tvalue: options.newValue,\n\t\t\twritable: true\n\t\t});\n\t} else {\n\t\ttarget[options.name] = options.newValue;\n\t}\n};\n\n// Return undefined instead of __proto__ if '__proto__' is not an own property\nvar getProperty = function getProperty(obj, name) {\n\tif (name === '__proto__') {\n\t\tif (!hasOwn.call(obj, name)) {\n\t\t\treturn void 0;\n\t\t} else if (gOPD) {\n\t\t\t// In early versions of node, obj['__proto__'] is buggy when obj has\n\t\t\t// __proto__ as an own property. Object.getOwnPropertyDescriptor() works.\n\t\t\treturn gOPD(obj, name).value;\n\t\t}\n\t}\n\n\treturn obj[name];\n};\n\nmodule.exports = function extend() {\n\tvar options, name, src, copy, copyIsArray, clone;\n\tvar target = arguments[0];\n\tvar i = 1;\n\tvar length = arguments.length;\n\tvar deep = false;\n\n\t// Handle a deep copy situation\n\tif (typeof target === 'boolean') {\n\t\tdeep = target;\n\t\ttarget = arguments[1] || {};\n\t\t// skip the boolean and the target\n\t\ti = 2;\n\t}\n\tif (target == null || (typeof target !== 'object' && typeof target !== 'function')) {\n\t\ttarget = {};\n\t}\n\n\tfor (; i < length; ++i) {\n\t\toptions = arguments[i];\n\t\t// Only deal with non-null/undefined values\n\t\tif (options != null) {\n\t\t\t// Extend the base object\n\t\t\tfor (name in options) {\n\t\t\t\tsrc = getProperty(target, name);\n\t\t\t\tcopy = getProperty(options, name);\n\n\t\t\t\t// Prevent never-ending loop\n\t\t\t\tif (target !== copy) {\n\t\t\t\t\t// Recurse if we're merging plain objects or arrays\n\t\t\t\t\tif (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {\n\t\t\t\t\t\tif (copyIsArray) {\n\t\t\t\t\t\t\tcopyIsArray = false;\n\t\t\t\t\t\t\tclone = src && isArray(src) ? src : [];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tclone = src && isPlainObject(src) ? src : {};\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Never move original objects, clone them\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: extend(deep, clone, copy) });\n\n\t\t\t\t\t// Don't bring in undefined values\n\t\t\t\t\t} else if (typeof copy !== 'undefined') {\n\t\t\t\t\t\tsetProperty(target, { name: name, newValue: copy });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t// Return the modified object\n\treturn target;\n};\n","/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert = require('assert');\nvar mod_util = require('util');\n\n/*\n * Public interface\n */\nexports.sprintf = jsSprintf;\nexports.printf = jsPrintf;\nexports.fprintf = jsFprintf;\n\n/*\n * Stripped down version of s[n]printf(3c). We make a best effort to throw an\n * exception when given a format string we don't understand, rather than\n * ignoring it, so that we won't break existing programs if/when we go implement\n * the rest of this.\n *\n * This implementation currently supports specifying\n *\t- field alignment ('-' flag),\n * \t- zero-pad ('0' flag)\n *\t- always show numeric sign ('+' flag),\n *\t- field width\n *\t- conversions for strings, decimal integers, and floats (numbers).\n *\t- argument size specifiers. These are all accepted but ignored, since\n *\t Javascript has no notion of the physical size of an argument.\n *\n * Everything else is currently unsupported, most notably precision, unsigned\n * numbers, non-decimal numbers, and characters.\n */\nfunction jsSprintf(fmt)\n{\n\tvar regex = [\n\t '([^%]*)',\t\t\t\t/* normal text */\n\t '%',\t\t\t\t/* start of format */\n\t '([\\'\\\\-+ #0]*?)',\t\t\t/* flags (optional) */\n\t '([1-9]\\\\d*)?',\t\t\t/* width (optional) */\n\t '(\\\\.([1-9]\\\\d*))?',\t\t/* precision (optional) */\n\t '[lhjztL]*?',\t\t\t/* length mods (ignored) */\n\t '([diouxXfFeEgGaAcCsSp%jr])'\t/* conversion */\n\t].join('');\n\n\tvar re = new RegExp(regex);\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\tvar flags, width, precision, conversion;\n\tvar left, pad, sign, arg, match;\n\tvar ret = '';\n\tvar argn = 1;\n\n\tmod_assert.equal('string', typeof (fmt));\n\n\twhile ((match = re.exec(fmt)) !== null) {\n\t\tret += match[1];\n\t\tfmt = fmt.substring(match[0].length);\n\n\t\tflags = match[2] || '';\n\t\twidth = match[3] || 0;\n\t\tprecision = match[4] || '';\n\t\tconversion = match[6];\n\t\tleft = false;\n\t\tsign = false;\n\t\tpad = ' ';\n\n\t\tif (conversion == '%') {\n\t\t\tret += '%';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (args.length === 0)\n\t\t\tthrow (new Error('too few args to sprintf'));\n\n\t\targ = args.shift();\n\t\targn++;\n\n\t\tif (flags.match(/[\\' #]/))\n\t\t\tthrow (new Error(\n\t\t\t 'unsupported flags: ' + flags));\n\n\t\tif (precision.length > 0)\n\t\t\tthrow (new Error(\n\t\t\t 'non-zero precision not supported'));\n\n\t\tif (flags.match(/-/))\n\t\t\tleft = true;\n\n\t\tif (flags.match(/0/))\n\t\t\tpad = '0';\n\n\t\tif (flags.match(/\\+/))\n\t\t\tsign = true;\n\n\t\tswitch (conversion) {\n\t\tcase 's':\n\t\t\tif (arg === undefined || arg === null)\n\t\t\t\tthrow (new Error('argument ' + argn +\n\t\t\t\t ': attempted to print undefined or null ' +\n\t\t\t\t 'as a string'));\n\t\t\tret += doPad(pad, width, left, arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'd':\n\t\t\targ = Math.floor(arg);\n\t\t\t/*jsl:fallthru*/\n\t\tcase 'f':\n\t\t\tsign = sign && arg > 0 ? '+' : '';\n\t\t\tret += sign + doPad(pad, width, left,\n\t\t\t arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'x':\n\t\t\tret += doPad(pad, width, left, arg.toString(16));\n\t\t\tbreak;\n\n\t\tcase 'j': /* non-standard */\n\t\t\tif (width === 0)\n\t\t\t\twidth = 10;\n\t\t\tret += mod_util.inspect(arg, false, width);\n\t\t\tbreak;\n\n\t\tcase 'r': /* non-standard */\n\t\t\tret += dumpException(arg);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow (new Error('unsupported conversion: ' +\n\t\t\t conversion));\n\t\t}\n\t}\n\n\tret += fmt;\n\treturn (ret);\n}\n\nfunction jsPrintf() {\n\tvar args = Array.prototype.slice.call(arguments);\n\targs.unshift(process.stdout);\n\tjsFprintf.apply(null, args);\n}\n\nfunction jsFprintf(stream) {\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\treturn (stream.write(jsSprintf.apply(this, args)));\n}\n\nfunction doPad(chr, width, left, str)\n{\n\tvar ret = str;\n\n\twhile (ret.length < width) {\n\t\tif (left)\n\t\t\tret += chr;\n\t\telse\n\t\t\tret = chr + ret;\n\t}\n\n\treturn (ret);\n}\n\n/*\n * This function dumps long stack traces for exceptions having a cause() method.\n * See node-verror for an example.\n */\nfunction dumpException(ex)\n{\n\tvar ret;\n\n\tif (!(ex instanceof Error))\n\t\tthrow (new Error(jsSprintf('invalid type for %%r: %j', ex)));\n\n\t/* Note that V8 prepends \"ex.stack\" with ex.toString(). */\n\tret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;\n\n\tif (ex.cause && typeof (ex.cause) === 'function') {\n\t\tvar cex = ex.cause();\n\t\tif (cex) {\n\t\t\tret += '\\nCaused by: ' + dumpException(cex);\n\t\t}\n\t}\n\n\treturn (ret);\n}\n","'use strict';\n\n// do not edit .js files directly - edit src/index.jst\n\n\n\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;)\n if (!equal(a[i], b[i])) return false;\n return true;\n }\n\n\n\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n\n for (i = length; i-- !== 0;)\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n\n if (!equal(a[key], b[key])) return false;\n }\n\n return true;\n }\n\n // true if both NaN, false otherwise\n return a!==a && b!==b;\n};\n","'use strict';\n\nmodule.exports = function (data, opts) {\n if (!opts) opts = {};\n if (typeof opts === 'function') opts = { cmp: opts };\n var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;\n\n var cmp = opts.cmp && (function (f) {\n return function (node) {\n return function (a, b) {\n var aobj = { key: a, value: node[a] };\n var bobj = { key: b, value: node[b] };\n return f(aobj, bobj);\n };\n };\n })(opts.cmp);\n\n var seen = [];\n return (function stringify (node) {\n if (node && node.toJSON && typeof node.toJSON === 'function') {\n node = node.toJSON();\n }\n\n if (node === undefined) return;\n if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';\n if (typeof node !== 'object') return JSON.stringify(node);\n\n var i, out;\n if (Array.isArray(node)) {\n out = '[';\n for (i = 0; i < node.length; i++) {\n if (i) out += ',';\n out += stringify(node[i]) || 'null';\n }\n return out + ']';\n }\n\n if (node === null) return 'null';\n\n if (seen.indexOf(node) !== -1) {\n if (cycles) return JSON.stringify('__cycle__');\n throw new TypeError('Converting circular structure to JSON');\n }\n\n var seenIndex = seen.push(node) - 1;\n var keys = Object.keys(node).sort(cmp && cmp(node));\n out = '';\n for (i = 0; i < keys.length; i++) {\n var key = keys[i];\n var value = stringify(node[key]);\n\n if (!value) continue;\n if (out) out += ',';\n out += JSON.stringify(key) + ':' + value;\n }\n seen.splice(seenIndex, 1);\n return '{' + out + '}';\n })(data);\n};\n","module.exports = ForeverAgent\nForeverAgent.SSL = ForeverAgentSSL\n\nvar util = require('util')\n , Agent = require('http').Agent\n , net = require('net')\n , tls = require('tls')\n , AgentSSL = require('https').Agent\n \nfunction getConnectionName(host, port) { \n var name = ''\n if (typeof host === 'string') {\n name = host + ':' + port\n } else {\n // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.\n name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')\n }\n return name\n} \n\nfunction ForeverAgent(options) {\n var self = this\n self.options = options || {}\n self.requests = {}\n self.sockets = {}\n self.freeSockets = {}\n self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets\n self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets\n self.on('free', function(socket, host, port) {\n var name = getConnectionName(host, port)\n\n if (self.requests[name] && self.requests[name].length) {\n self.requests[name].shift().onSocket(socket)\n } else if (self.sockets[name].length < self.minSockets) {\n if (!self.freeSockets[name]) self.freeSockets[name] = []\n self.freeSockets[name].push(socket)\n \n // if an error happens while we don't use the socket anyway, meh, throw the socket away\n var onIdleError = function() {\n socket.destroy()\n }\n socket._onIdleError = onIdleError\n socket.on('error', onIdleError)\n } else {\n // If there are no pending requests just destroy the\n // socket and it will get removed from the pool. This\n // gets us out of timeout issues and allows us to\n // default to Connection:keep-alive.\n socket.destroy()\n }\n })\n\n}\nutil.inherits(ForeverAgent, Agent)\n\nForeverAgent.defaultMinSockets = 5\n\n\nForeverAgent.prototype.createConnection = net.createConnection\nForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest\nForeverAgent.prototype.addRequest = function(req, host, port) {\n var name = getConnectionName(host, port)\n \n if (typeof host !== 'string') {\n var options = host\n port = options.port\n host = options.host\n }\n\n if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {\n var idleSocket = this.freeSockets[name].pop()\n idleSocket.removeListener('error', idleSocket._onIdleError)\n delete idleSocket._onIdleError\n req._reusedSocket = true\n req.onSocket(idleSocket)\n } else {\n this.addRequestNoreuse(req, host, port)\n }\n}\n\nForeverAgent.prototype.removeSocket = function(s, name, host, port) {\n if (this.sockets[name]) {\n var index = this.sockets[name].indexOf(s)\n if (index !== -1) {\n this.sockets[name].splice(index, 1)\n }\n } else if (this.sockets[name] && this.sockets[name].length === 0) {\n // don't leak\n delete this.sockets[name]\n delete this.requests[name]\n }\n \n if (this.freeSockets[name]) {\n var index = this.freeSockets[name].indexOf(s)\n if (index !== -1) {\n this.freeSockets[name].splice(index, 1)\n if (this.freeSockets[name].length === 0) {\n delete this.freeSockets[name]\n }\n }\n }\n\n if (this.requests[name] && this.requests[name].length) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(name, host, port).emit('free')\n }\n}\n\nfunction ForeverAgentSSL (options) {\n ForeverAgent.call(this, options)\n}\nutil.inherits(ForeverAgentSSL, ForeverAgent)\n\nForeverAgentSSL.prototype.createConnection = createConnectionSSL\nForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest\n\nfunction createConnectionSSL (port, host, options) {\n if (typeof port === 'object') {\n options = port;\n } else if (typeof host === 'object') {\n options = host;\n } else if (typeof options === 'object') {\n options = options;\n } else {\n options = {};\n }\n\n if (typeof port === 'number') {\n options.port = port;\n }\n\n if (typeof host === 'string') {\n options.host = host;\n }\n\n return tls.connect(options);\n}\n","'use strict'\nconst MiniPass = require('minipass')\nconst EE = require('events').EventEmitter\nconst fs = require('fs')\n\nlet writev = fs.writev\n/* istanbul ignore next */\nif (!writev) {\n // This entire block can be removed if support for earlier than Node.js\n // 12.9.0 is not needed.\n const binding = process.binding('fs')\n const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback\n\n writev = (fd, iovec, pos, cb) => {\n const done = (er, bw) => cb(er, bw, iovec)\n const req = new FSReqWrap()\n req.oncomplete = done\n binding.writeBuffers(fd, iovec, pos, req)\n }\n}\n\nconst _autoClose = Symbol('_autoClose')\nconst _close = Symbol('_close')\nconst _ended = Symbol('_ended')\nconst _fd = Symbol('_fd')\nconst _finished = Symbol('_finished')\nconst _flags = Symbol('_flags')\nconst _flush = Symbol('_flush')\nconst _handleChunk = Symbol('_handleChunk')\nconst _makeBuf = Symbol('_makeBuf')\nconst _mode = Symbol('_mode')\nconst _needDrain = Symbol('_needDrain')\nconst _onerror = Symbol('_onerror')\nconst _onopen = Symbol('_onopen')\nconst _onread = Symbol('_onread')\nconst _onwrite = Symbol('_onwrite')\nconst _open = Symbol('_open')\nconst _path = Symbol('_path')\nconst _pos = Symbol('_pos')\nconst _queue = Symbol('_queue')\nconst _read = Symbol('_read')\nconst _readSize = Symbol('_readSize')\nconst _reading = Symbol('_reading')\nconst _remain = Symbol('_remain')\nconst _size = Symbol('_size')\nconst _write = Symbol('_write')\nconst _writing = Symbol('_writing')\nconst _defaultFlag = Symbol('_defaultFlag')\nconst _errored = Symbol('_errored')\n\nclass ReadStream extends MiniPass {\n constructor (path, opt) {\n opt = opt || {}\n super(opt)\n\n this.readable = true\n this.writable = false\n\n if (typeof path !== 'string')\n throw new TypeError('path must be a string')\n\n this[_errored] = false\n this[_fd] = typeof opt.fd === 'number' ? opt.fd : null\n this[_path] = path\n this[_readSize] = opt.readSize || 16*1024*1024\n this[_reading] = false\n this[_size] = typeof opt.size === 'number' ? opt.size : Infinity\n this[_remain] = this[_size]\n this[_autoClose] = typeof opt.autoClose === 'boolean' ?\n opt.autoClose : true\n\n if (typeof this[_fd] === 'number')\n this[_read]()\n else\n this[_open]()\n }\n\n get fd () { return this[_fd] }\n get path () { return this[_path] }\n\n write () {\n throw new TypeError('this is a readable stream')\n }\n\n end () {\n throw new TypeError('this is a readable stream')\n }\n\n [_open] () {\n fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd))\n }\n\n [_onopen] (er, fd) {\n if (er)\n this[_onerror](er)\n else {\n this[_fd] = fd\n this.emit('open', fd)\n this[_read]()\n }\n }\n\n [_makeBuf] () {\n return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]))\n }\n\n [_read] () {\n if (!this[_reading]) {\n this[_reading] = true\n const buf = this[_makeBuf]()\n /* istanbul ignore if */\n if (buf.length === 0)\n return process.nextTick(() => this[_onread](null, 0, buf))\n fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) =>\n this[_onread](er, br, buf))\n }\n }\n\n [_onread] (er, br, buf) {\n this[_reading] = false\n if (er)\n this[_onerror](er)\n else if (this[_handleChunk](br, buf))\n this[_read]()\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'))\n }\n }\n\n [_onerror] (er) {\n this[_reading] = true\n this[_close]()\n this.emit('error', er)\n }\n\n [_handleChunk] (br, buf) {\n let ret = false\n // no effect if infinite\n this[_remain] -= br\n if (br > 0)\n ret = super.write(br < buf.length ? buf.slice(0, br) : buf)\n\n if (br === 0 || this[_remain] <= 0) {\n ret = false\n this[_close]()\n super.end()\n }\n\n return ret\n }\n\n emit (ev, data) {\n switch (ev) {\n case 'prefinish':\n case 'finish':\n break\n\n case 'drain':\n if (typeof this[_fd] === 'number')\n this[_read]()\n break\n\n case 'error':\n if (this[_errored])\n return\n this[_errored] = true\n return super.emit(ev, data)\n\n default:\n return super.emit(ev, data)\n }\n }\n}\n\nclass ReadStreamSync extends ReadStream {\n [_open] () {\n let threw = true\n try {\n this[_onopen](null, fs.openSync(this[_path], 'r'))\n threw = false\n } finally {\n if (threw)\n this[_close]()\n }\n }\n\n [_read] () {\n let threw = true\n try {\n if (!this[_reading]) {\n this[_reading] = true\n do {\n const buf = this[_makeBuf]()\n /* istanbul ignore next */\n const br = buf.length === 0 ? 0\n : fs.readSync(this[_fd], buf, 0, buf.length, null)\n if (!this[_handleChunk](br, buf))\n break\n } while (true)\n this[_reading] = false\n }\n threw = false\n } finally {\n if (threw)\n this[_close]()\n }\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.closeSync(fd)\n this.emit('close')\n }\n }\n}\n\nclass WriteStream extends EE {\n constructor (path, opt) {\n opt = opt || {}\n super(opt)\n this.readable = false\n this.writable = true\n this[_errored] = false\n this[_writing] = false\n this[_ended] = false\n this[_needDrain] = false\n this[_queue] = []\n this[_path] = path\n this[_fd] = typeof opt.fd === 'number' ? opt.fd : null\n this[_mode] = opt.mode === undefined ? 0o666 : opt.mode\n this[_pos] = typeof opt.start === 'number' ? opt.start : null\n this[_autoClose] = typeof opt.autoClose === 'boolean' ?\n opt.autoClose : true\n\n // truncating makes no sense when writing into the middle\n const defaultFlag = this[_pos] !== null ? 'r+' : 'w'\n this[_defaultFlag] = opt.flags === undefined\n this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags\n\n if (this[_fd] === null)\n this[_open]()\n }\n\n emit (ev, data) {\n if (ev === 'error') {\n if (this[_errored])\n return\n this[_errored] = true\n }\n return super.emit(ev, data)\n }\n\n\n get fd () { return this[_fd] }\n get path () { return this[_path] }\n\n [_onerror] (er) {\n this[_close]()\n this[_writing] = true\n this.emit('error', er)\n }\n\n [_open] () {\n fs.open(this[_path], this[_flags], this[_mode],\n (er, fd) => this[_onopen](er, fd))\n }\n\n [_onopen] (er, fd) {\n if (this[_defaultFlag] &&\n this[_flags] === 'r+' &&\n er && er.code === 'ENOENT') {\n this[_flags] = 'w'\n this[_open]()\n } else if (er)\n this[_onerror](er)\n else {\n this[_fd] = fd\n this.emit('open', fd)\n this[_flush]()\n }\n }\n\n end (buf, enc) {\n if (buf)\n this.write(buf, enc)\n\n this[_ended] = true\n\n // synthetic after-write logic, where drain/finish live\n if (!this[_writing] && !this[_queue].length &&\n typeof this[_fd] === 'number')\n this[_onwrite](null, 0)\n return this\n }\n\n write (buf, enc) {\n if (typeof buf === 'string')\n buf = Buffer.from(buf, enc)\n\n if (this[_ended]) {\n this.emit('error', new Error('write() after end()'))\n return false\n }\n\n if (this[_fd] === null || this[_writing] || this[_queue].length) {\n this[_queue].push(buf)\n this[_needDrain] = true\n return false\n }\n\n this[_writing] = true\n this[_write](buf)\n return true\n }\n\n [_write] (buf) {\n fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) =>\n this[_onwrite](er, bw))\n }\n\n [_onwrite] (er, bw) {\n if (er)\n this[_onerror](er)\n else {\n if (this[_pos] !== null)\n this[_pos] += bw\n if (this[_queue].length)\n this[_flush]()\n else {\n this[_writing] = false\n\n if (this[_ended] && !this[_finished]) {\n this[_finished] = true\n this[_close]()\n this.emit('finish')\n } else if (this[_needDrain]) {\n this[_needDrain] = false\n this.emit('drain')\n }\n }\n }\n }\n\n [_flush] () {\n if (this[_queue].length === 0) {\n if (this[_ended])\n this[_onwrite](null, 0)\n } else if (this[_queue].length === 1)\n this[_write](this[_queue].pop())\n else {\n const iovec = this[_queue]\n this[_queue] = []\n writev(this[_fd], iovec, this[_pos],\n (er, bw) => this[_onwrite](er, bw))\n }\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'))\n }\n }\n}\n\nclass WriteStreamSync extends WriteStream {\n [_open] () {\n let fd\n // only wrap in a try{} block if we know we'll retry, to avoid\n // the rethrow obscuring the error's source frame in most cases.\n if (this[_defaultFlag] && this[_flags] === 'r+') {\n try {\n fd = fs.openSync(this[_path], this[_flags], this[_mode])\n } catch (er) {\n if (er.code === 'ENOENT') {\n this[_flags] = 'w'\n return this[_open]()\n } else\n throw er\n }\n } else\n fd = fs.openSync(this[_path], this[_flags], this[_mode])\n\n this[_onopen](null, fd)\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.closeSync(fd)\n this.emit('close')\n }\n }\n\n [_write] (buf) {\n // throw the original, but try to close if it fails\n let threw = true\n try {\n this[_onwrite](null,\n fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos]))\n threw = false\n } finally {\n if (threw)\n try { this[_close]() } catch (_) {}\n }\n }\n}\n\nexports.ReadStream = ReadStream\nexports.ReadStreamSync = ReadStreamSync\n\nexports.WriteStream = WriteStream\nexports.WriteStreamSync = WriteStreamSync\n","module.exports = realpath\nrealpath.realpath = realpath\nrealpath.sync = realpathSync\nrealpath.realpathSync = realpathSync\nrealpath.monkeypatch = monkeypatch\nrealpath.unmonkeypatch = unmonkeypatch\n\nvar fs = require('fs')\nvar origRealpath = fs.realpath\nvar origRealpathSync = fs.realpathSync\n\nvar version = process.version\nvar ok = /^v[0-5]\\./.test(version)\nvar old = require('./old.js')\n\nfunction newError (er) {\n return er && er.syscall === 'realpath' && (\n er.code === 'ELOOP' ||\n er.code === 'ENOMEM' ||\n er.code === 'ENAMETOOLONG'\n )\n}\n\nfunction realpath (p, cache, cb) {\n if (ok) {\n return origRealpath(p, cache, cb)\n }\n\n if (typeof cache === 'function') {\n cb = cache\n cache = null\n }\n origRealpath(p, cache, function (er, result) {\n if (newError(er)) {\n old.realpath(p, cache, cb)\n } else {\n cb(er, result)\n }\n })\n}\n\nfunction realpathSync (p, cache) {\n if (ok) {\n return origRealpathSync(p, cache)\n }\n\n try {\n return origRealpathSync(p, cache)\n } catch (er) {\n if (newError(er)) {\n return old.realpathSync(p, cache)\n } else {\n throw er\n }\n }\n}\n\nfunction monkeypatch () {\n fs.realpath = realpath\n fs.realpathSync = realpathSync\n}\n\nfunction unmonkeypatch () {\n fs.realpath = origRealpath\n fs.realpathSync = origRealpathSync\n}\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\nvar pathModule = require('path');\nvar isWindows = process.platform === 'win32';\nvar fs = require('fs');\n\n// JavaScript implementation of realpath, ported from node pre-v6\n\nvar DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);\n\nfunction rethrow() {\n // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and\n // is fairly slow to generate.\n var callback;\n if (DEBUG) {\n var backtrace = new Error;\n callback = debugCallback;\n } else\n callback = missingCallback;\n\n return callback;\n\n function debugCallback(err) {\n if (err) {\n backtrace.message = err.message;\n err = backtrace;\n missingCallback(err);\n }\n }\n\n function missingCallback(err) {\n if (err) {\n if (process.throwDeprecation)\n throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs\n else if (!process.noDeprecation) {\n var msg = 'fs: missing callback ' + (err.stack || err.message);\n if (process.traceDeprecation)\n console.trace(msg);\n else\n console.error(msg);\n }\n }\n }\n}\n\nfunction maybeCallback(cb) {\n return typeof cb === 'function' ? cb : rethrow();\n}\n\nvar normalize = pathModule.normalize;\n\n// Regexp that finds the next partion of a (partial) path\n// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']\nif (isWindows) {\n var nextPartRe = /(.*?)(?:[\\/\\\\]+|$)/g;\n} else {\n var nextPartRe = /(.*?)(?:[\\/]+|$)/g;\n}\n\n// Regex to find the device root, including trailing slash. E.g. 'c:\\\\'.\nif (isWindows) {\n var splitRootRe = /^(?:[a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/][^\\\\\\/]+)?[\\\\\\/]*/;\n} else {\n var splitRootRe = /^[\\/]*/;\n}\n\nexports.realpathSync = function realpathSync(p, cache) {\n // make p is absolute\n p = pathModule.resolve(p);\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {\n return cache[p];\n }\n\n var original = p,\n seenLinks = {},\n knownHard = {};\n\n // current character position in p\n var pos;\n // the partial path so far, including a trailing slash if any\n var current;\n // the partial path without a trailing slash (except when pointing at a root)\n var base;\n // the partial path scanned in the previous round, with slash\n var previous;\n\n start();\n\n function start() {\n // Skip over roots\n var m = splitRootRe.exec(p);\n pos = m[0].length;\n current = m[0];\n base = m[0];\n previous = '';\n\n // On windows, check that the root exists. On unix there is no need.\n if (isWindows && !knownHard[base]) {\n fs.lstatSync(base);\n knownHard[base] = true;\n }\n }\n\n // walk down the path, swapping out linked pathparts for their real\n // values\n // NB: p.length changes.\n while (pos < p.length) {\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n continue;\n }\n\n var resolvedLink;\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // some known symbolic link. no need to stat again.\n resolvedLink = cache[base];\n } else {\n var stat = fs.lstatSync(base);\n if (!stat.isSymbolicLink()) {\n knownHard[base] = true;\n if (cache) cache[base] = base;\n continue;\n }\n\n // read the link if it wasn't read before\n // dev/ino always return 0 on windows, so skip the check.\n var linkTarget = null;\n if (!isWindows) {\n var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);\n if (seenLinks.hasOwnProperty(id)) {\n linkTarget = seenLinks[id];\n }\n }\n if (linkTarget === null) {\n fs.statSync(base);\n linkTarget = fs.readlinkSync(base);\n }\n resolvedLink = pathModule.resolve(previous, linkTarget);\n // track this, if given a cache.\n if (cache) cache[base] = resolvedLink;\n if (!isWindows) seenLinks[id] = linkTarget;\n }\n\n // resolve the link, then start over\n p = pathModule.resolve(resolvedLink, p.slice(pos));\n start();\n }\n\n if (cache) cache[original] = p;\n\n return p;\n};\n\n\nexports.realpath = function realpath(p, cache, cb) {\n if (typeof cb !== 'function') {\n cb = maybeCallback(cache);\n cache = null;\n }\n\n // make p is absolute\n p = pathModule.resolve(p);\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {\n return process.nextTick(cb.bind(null, null, cache[p]));\n }\n\n var original = p,\n seenLinks = {},\n knownHard = {};\n\n // current character position in p\n var pos;\n // the partial path so far, including a trailing slash if any\n var current;\n // the partial path without a trailing slash (except when pointing at a root)\n var base;\n // the partial path scanned in the previous round, with slash\n var previous;\n\n start();\n\n function start() {\n // Skip over roots\n var m = splitRootRe.exec(p);\n pos = m[0].length;\n current = m[0];\n base = m[0];\n previous = '';\n\n // On windows, check that the root exists. On unix there is no need.\n if (isWindows && !knownHard[base]) {\n fs.lstat(base, function(err) {\n if (err) return cb(err);\n knownHard[base] = true;\n LOOP();\n });\n } else {\n process.nextTick(LOOP);\n }\n }\n\n // walk down the path, swapping out linked pathparts for their real\n // values\n function LOOP() {\n // stop if scanned past end of path\n if (pos >= p.length) {\n if (cache) cache[original] = p;\n return cb(null, p);\n }\n\n // find the next part\n nextPartRe.lastIndex = pos;\n var result = nextPartRe.exec(p);\n previous = current;\n current += result[0];\n base = previous + result[1];\n pos = nextPartRe.lastIndex;\n\n // continue if not a symlink\n if (knownHard[base] || (cache && cache[base] === base)) {\n return process.nextTick(LOOP);\n }\n\n if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {\n // known symbolic link. no need to stat again.\n return gotResolvedLink(cache[base]);\n }\n\n return fs.lstat(base, gotStat);\n }\n\n function gotStat(err, stat) {\n if (err) return cb(err);\n\n // if not a symlink, skip to the next path part\n if (!stat.isSymbolicLink()) {\n knownHard[base] = true;\n if (cache) cache[base] = base;\n return process.nextTick(LOOP);\n }\n\n // stat & read the link if not read before\n // call gotTarget as soon as the link target is known\n // dev/ino always return 0 on windows, so skip the check.\n if (!isWindows) {\n var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);\n if (seenLinks.hasOwnProperty(id)) {\n return gotTarget(null, seenLinks[id], base);\n }\n }\n fs.stat(base, function(err) {\n if (err) return cb(err);\n\n fs.readlink(base, function(err, target) {\n if (!isWindows) seenLinks[id] = target;\n gotTarget(err, target);\n });\n });\n }\n\n function gotTarget(err, target, base) {\n if (err) return cb(err);\n\n var resolvedLink = pathModule.resolve(previous, target);\n if (cache) cache[base] = resolvedLink;\n gotResolvedLink(resolvedLink);\n }\n\n function gotResolvedLink(resolvedLink) {\n // resolve the link, then start over\n p = pathModule.resolve(resolvedLink, p.slice(pos));\n start();\n }\n};\n","'use strict';\nconst {PassThrough: PassThroughStream} = require('stream');\n\nmodule.exports = options => {\n\toptions = {...options};\n\n\tconst {array} = options;\n\tlet {encoding} = options;\n\tconst isBuffer = encoding === 'buffer';\n\tlet objectMode = false;\n\n\tif (array) {\n\t\tobjectMode = !(encoding || isBuffer);\n\t} else {\n\t\tencoding = encoding || 'utf8';\n\t}\n\n\tif (isBuffer) {\n\t\tencoding = null;\n\t}\n\n\tconst stream = new PassThroughStream({objectMode});\n\n\tif (encoding) {\n\t\tstream.setEncoding(encoding);\n\t}\n\n\tlet length = 0;\n\tconst chunks = [];\n\n\tstream.on('data', chunk => {\n\t\tchunks.push(chunk);\n\n\t\tif (objectMode) {\n\t\t\tlength = chunks.length;\n\t\t} else {\n\t\t\tlength += chunk.length;\n\t\t}\n\t});\n\n\tstream.getBufferedValue = () => {\n\t\tif (array) {\n\t\t\treturn chunks;\n\t\t}\n\n\t\treturn isBuffer ? Buffer.concat(chunks, length) : chunks.join('');\n\t};\n\n\tstream.getBufferedLength = () => length;\n\n\treturn stream;\n};\n","'use strict';\nconst {constants: BufferConstants} = require('buffer');\nconst stream = require('stream');\nconst {promisify} = require('util');\nconst bufferStream = require('./buffer-stream');\n\nconst streamPipelinePromisified = promisify(stream.pipeline);\n\nclass MaxBufferError extends Error {\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t\tthis.name = 'MaxBufferError';\n\t}\n}\n\nasync function getStream(inputStream, options) {\n\tif (!inputStream) {\n\t\tthrow new Error('Expected a stream');\n\t}\n\n\toptions = {\n\t\tmaxBuffer: Infinity,\n\t\t...options\n\t};\n\n\tconst {maxBuffer} = options;\n\tconst stream = bufferStream(options);\n\n\tawait new Promise((resolve, reject) => {\n\t\tconst rejectPromise = error => {\n\t\t\t// Don't retrieve an oversized buffer.\n\t\t\tif (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {\n\t\t\t\terror.bufferedData = stream.getBufferedValue();\n\t\t\t}\n\n\t\t\treject(error);\n\t\t};\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tawait streamPipelinePromisified(inputStream, stream);\n\t\t\t\tresolve();\n\t\t\t} catch (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t}\n\t\t})();\n\n\t\tstream.on('data', () => {\n\t\t\tif (stream.getBufferedLength() > maxBuffer) {\n\t\t\t\trejectPromise(new MaxBufferError());\n\t\t\t}\n\t\t});\n\t});\n\n\treturn stream.getBufferedValue();\n}\n\nmodule.exports = getStream;\nmodule.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});\nmodule.exports.array = (stream, options) => getStream(stream, {...options, array: true});\nmodule.exports.MaxBufferError = MaxBufferError;\n","exports.setopts = setopts\nexports.ownProp = ownProp\nexports.makeAbs = makeAbs\nexports.finish = finish\nexports.mark = mark\nexports.isIgnored = isIgnored\nexports.childrenIgnored = childrenIgnored\n\nfunction ownProp (obj, field) {\n return Object.prototype.hasOwnProperty.call(obj, field)\n}\n\nvar fs = require(\"fs\")\nvar path = require(\"path\")\nvar minimatch = require(\"minimatch\")\nvar isAbsolute = require(\"path-is-absolute\")\nvar Minimatch = minimatch.Minimatch\n\nfunction alphasort (a, b) {\n return a.localeCompare(b, 'en')\n}\n\nfunction setupIgnores (self, options) {\n self.ignore = options.ignore || []\n\n if (!Array.isArray(self.ignore))\n self.ignore = [self.ignore]\n\n if (self.ignore.length) {\n self.ignore = self.ignore.map(ignoreMap)\n }\n}\n\n// ignore patterns are always in dot:true mode.\nfunction ignoreMap (pattern) {\n var gmatcher = null\n if (pattern.slice(-3) === '/**') {\n var gpattern = pattern.replace(/(\\/\\*\\*)+$/, '')\n gmatcher = new Minimatch(gpattern, { dot: true })\n }\n\n return {\n matcher: new Minimatch(pattern, { dot: true }),\n gmatcher: gmatcher\n }\n}\n\nfunction setopts (self, pattern, options) {\n if (!options)\n options = {}\n\n // base-matching: just use globstar for that.\n if (options.matchBase && -1 === pattern.indexOf(\"/\")) {\n if (options.noglobstar) {\n throw new Error(\"base matching requires globstar\")\n }\n pattern = \"**/\" + pattern\n }\n\n self.silent = !!options.silent\n self.pattern = pattern\n self.strict = options.strict !== false\n self.realpath = !!options.realpath\n self.realpathCache = options.realpathCache || Object.create(null)\n self.follow = !!options.follow\n self.dot = !!options.dot\n self.mark = !!options.mark\n self.nodir = !!options.nodir\n if (self.nodir)\n self.mark = true\n self.sync = !!options.sync\n self.nounique = !!options.nounique\n self.nonull = !!options.nonull\n self.nosort = !!options.nosort\n self.nocase = !!options.nocase\n self.stat = !!options.stat\n self.noprocess = !!options.noprocess\n self.absolute = !!options.absolute\n self.fs = options.fs || fs\n\n self.maxLength = options.maxLength || Infinity\n self.cache = options.cache || Object.create(null)\n self.statCache = options.statCache || Object.create(null)\n self.symlinks = options.symlinks || Object.create(null)\n\n setupIgnores(self, options)\n\n self.changedCwd = false\n var cwd = process.cwd()\n if (!ownProp(options, \"cwd\"))\n self.cwd = cwd\n else {\n self.cwd = path.resolve(options.cwd)\n self.changedCwd = self.cwd !== cwd\n }\n\n self.root = options.root || path.resolve(self.cwd, \"/\")\n self.root = path.resolve(self.root)\n if (process.platform === \"win32\")\n self.root = self.root.replace(/\\\\/g, \"/\")\n\n // TODO: is an absolute `cwd` supposed to be resolved against `root`?\n // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')\n self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)\n if (process.platform === \"win32\")\n self.cwdAbs = self.cwdAbs.replace(/\\\\/g, \"/\")\n self.nomount = !!options.nomount\n\n // disable comments and negation in Minimatch.\n // Note that they are not supported in Glob itself anyway.\n options.nonegate = true\n options.nocomment = true\n // always treat \\ in patterns as escapes, not path separators\n options.allowWindowsEscape = false\n\n self.minimatch = new Minimatch(pattern, options)\n self.options = self.minimatch.options\n}\n\nfunction finish (self) {\n var nou = self.nounique\n var all = nou ? [] : Object.create(null)\n\n for (var i = 0, l = self.matches.length; i < l; i ++) {\n var matches = self.matches[i]\n if (!matches || Object.keys(matches).length === 0) {\n if (self.nonull) {\n // do like the shell, and spit out the literal glob\n var literal = self.minimatch.globSet[i]\n if (nou)\n all.push(literal)\n else\n all[literal] = true\n }\n } else {\n // had matches\n var m = Object.keys(matches)\n if (nou)\n all.push.apply(all, m)\n else\n m.forEach(function (m) {\n all[m] = true\n })\n }\n }\n\n if (!nou)\n all = Object.keys(all)\n\n if (!self.nosort)\n all = all.sort(alphasort)\n\n // at *some* point we statted all of these\n if (self.mark) {\n for (var i = 0; i < all.length; i++) {\n all[i] = self._mark(all[i])\n }\n if (self.nodir) {\n all = all.filter(function (e) {\n var notDir = !(/\\/$/.test(e))\n var c = self.cache[e] || self.cache[makeAbs(self, e)]\n if (notDir && c)\n notDir = c !== 'DIR' && !Array.isArray(c)\n return notDir\n })\n }\n }\n\n if (self.ignore.length)\n all = all.filter(function(m) {\n return !isIgnored(self, m)\n })\n\n self.found = all\n}\n\nfunction mark (self, p) {\n var abs = makeAbs(self, p)\n var c = self.cache[abs]\n var m = p\n if (c) {\n var isDir = c === 'DIR' || Array.isArray(c)\n var slash = p.slice(-1) === '/'\n\n if (isDir && !slash)\n m += '/'\n else if (!isDir && slash)\n m = m.slice(0, -1)\n\n if (m !== p) {\n var mabs = makeAbs(self, m)\n self.statCache[mabs] = self.statCache[abs]\n self.cache[mabs] = self.cache[abs]\n }\n }\n\n return m\n}\n\n// lotta situps...\nfunction makeAbs (self, f) {\n var abs = f\n if (f.charAt(0) === '/') {\n abs = path.join(self.root, f)\n } else if (isAbsolute(f) || f === '') {\n abs = f\n } else if (self.changedCwd) {\n abs = path.resolve(self.cwd, f)\n } else {\n abs = path.resolve(f)\n }\n\n if (process.platform === 'win32')\n abs = abs.replace(/\\\\/g, '/')\n\n return abs\n}\n\n\n// Return true, if pattern ends with globstar '**', for the accompanying parent directory.\n// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents\nfunction isIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))\n })\n}\n\nfunction childrenIgnored (self, path) {\n if (!self.ignore.length)\n return false\n\n return self.ignore.some(function(item) {\n return !!(item.gmatcher && item.gmatcher.match(path))\n })\n}\n","// Approach:\n//\n// 1. Get the minimatch set\n// 2. For each pattern in the set, PROCESS(pattern, false)\n// 3. Store matches per-set, then uniq them\n//\n// PROCESS(pattern, inGlobStar)\n// Get the first [n] items from pattern that are all strings\n// Join these together. This is PREFIX.\n// If there is no more remaining, then stat(PREFIX) and\n// add to matches if it succeeds. END.\n//\n// If inGlobStar and PREFIX is symlink and points to dir\n// set ENTRIES = []\n// else readdir(PREFIX) as ENTRIES\n// If fail, END\n//\n// with ENTRIES\n// If pattern[n] is GLOBSTAR\n// // handle the case where the globstar match is empty\n// // by pruning it out, and testing the resulting pattern\n// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)\n// // handle other cases.\n// for ENTRY in ENTRIES (not dotfiles)\n// // attach globstar + tail onto the entry\n// // Mark that this entry is a globstar match\n// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)\n//\n// else // not globstar\n// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)\n// Test ENTRY against pattern[n]\n// If fails, continue\n// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])\n//\n// Caveat:\n// Cache all stats and readdirs results to minimize syscall. Since all\n// we ever care about is existence and directory-ness, we can just keep\n// `true` for files, and [children,...] for directories, or `false` for\n// things that don't exist.\n\nmodule.exports = glob\n\nvar rp = require('fs.realpath')\nvar minimatch = require('minimatch')\nvar Minimatch = minimatch.Minimatch\nvar inherits = require('inherits')\nvar EE = require('events').EventEmitter\nvar path = require('path')\nvar assert = require('assert')\nvar isAbsolute = require('path-is-absolute')\nvar globSync = require('./sync.js')\nvar common = require('./common.js')\nvar setopts = common.setopts\nvar ownProp = common.ownProp\nvar inflight = require('inflight')\nvar util = require('util')\nvar childrenIgnored = common.childrenIgnored\nvar isIgnored = common.isIgnored\n\nvar once = require('once')\n\nfunction glob (pattern, options, cb) {\n if (typeof options === 'function') cb = options, options = {}\n if (!options) options = {}\n\n if (options.sync) {\n if (cb)\n throw new TypeError('callback provided to sync glob')\n return globSync(pattern, options)\n }\n\n return new Glob(pattern, options, cb)\n}\n\nglob.sync = globSync\nvar GlobSync = glob.GlobSync = globSync.GlobSync\n\n// old api surface\nglob.glob = glob\n\nfunction extend (origin, add) {\n if (add === null || typeof add !== 'object') {\n return origin\n }\n\n var keys = Object.keys(add)\n var i = keys.length\n while (i--) {\n origin[keys[i]] = add[keys[i]]\n }\n return origin\n}\n\nglob.hasMagic = function (pattern, options_) {\n var options = extend({}, options_)\n options.noprocess = true\n\n var g = new Glob(pattern, options)\n var set = g.minimatch.set\n\n if (!pattern)\n return false\n\n if (set.length > 1)\n return true\n\n for (var j = 0; j < set[0].length; j++) {\n if (typeof set[0][j] !== 'string')\n return true\n }\n\n return false\n}\n\nglob.Glob = Glob\ninherits(Glob, EE)\nfunction Glob (pattern, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n\n if (options && options.sync) {\n if (cb)\n throw new TypeError('callback provided to sync glob')\n return new GlobSync(pattern, options)\n }\n\n if (!(this instanceof Glob))\n return new Glob(pattern, options, cb)\n\n setopts(this, pattern, options)\n this._didRealPath = false\n\n // process each pattern in the minimatch set\n var n = this.minimatch.set.length\n\n // The matches are stored as {: true,...} so that\n // duplicates are automagically pruned.\n // Later, we do an Object.keys() on these.\n // Keep them as a list so we can fill in when nonull is set.\n this.matches = new Array(n)\n\n if (typeof cb === 'function') {\n cb = once(cb)\n this.on('error', cb)\n this.on('end', function (matches) {\n cb(null, matches)\n })\n }\n\n var self = this\n this._processing = 0\n\n this._emitQueue = []\n this._processQueue = []\n this.paused = false\n\n if (this.noprocess)\n return this\n\n if (n === 0)\n return done()\n\n var sync = true\n for (var i = 0; i < n; i ++) {\n this._process(this.minimatch.set[i], i, false, done)\n }\n sync = false\n\n function done () {\n --self._processing\n if (self._processing <= 0) {\n if (sync) {\n process.nextTick(function () {\n self._finish()\n })\n } else {\n self._finish()\n }\n }\n }\n}\n\nGlob.prototype._finish = function () {\n assert(this instanceof Glob)\n if (this.aborted)\n return\n\n if (this.realpath && !this._didRealpath)\n return this._realpath()\n\n common.finish(this)\n this.emit('end', this.found)\n}\n\nGlob.prototype._realpath = function () {\n if (this._didRealpath)\n return\n\n this._didRealpath = true\n\n var n = this.matches.length\n if (n === 0)\n return this._finish()\n\n var self = this\n for (var i = 0; i < this.matches.length; i++)\n this._realpathSet(i, next)\n\n function next () {\n if (--n === 0)\n self._finish()\n }\n}\n\nGlob.prototype._realpathSet = function (index, cb) {\n var matchset = this.matches[index]\n if (!matchset)\n return cb()\n\n var found = Object.keys(matchset)\n var self = this\n var n = found.length\n\n if (n === 0)\n return cb()\n\n var set = this.matches[index] = Object.create(null)\n found.forEach(function (p, i) {\n // If there's a problem with the stat, then it means that\n // one or more of the links in the realpath couldn't be\n // resolved. just return the abs value in that case.\n p = self._makeAbs(p)\n rp.realpath(p, self.realpathCache, function (er, real) {\n if (!er)\n set[real] = true\n else if (er.syscall === 'stat')\n set[p] = true\n else\n self.emit('error', er) // srsly wtf right here\n\n if (--n === 0) {\n self.matches[index] = set\n cb()\n }\n })\n })\n}\n\nGlob.prototype._mark = function (p) {\n return common.mark(this, p)\n}\n\nGlob.prototype._makeAbs = function (f) {\n return common.makeAbs(this, f)\n}\n\nGlob.prototype.abort = function () {\n this.aborted = true\n this.emit('abort')\n}\n\nGlob.prototype.pause = function () {\n if (!this.paused) {\n this.paused = true\n this.emit('pause')\n }\n}\n\nGlob.prototype.resume = function () {\n if (this.paused) {\n this.emit('resume')\n this.paused = false\n if (this._emitQueue.length) {\n var eq = this._emitQueue.slice(0)\n this._emitQueue.length = 0\n for (var i = 0; i < eq.length; i ++) {\n var e = eq[i]\n this._emitMatch(e[0], e[1])\n }\n }\n if (this._processQueue.length) {\n var pq = this._processQueue.slice(0)\n this._processQueue.length = 0\n for (var i = 0; i < pq.length; i ++) {\n var p = pq[i]\n this._processing--\n this._process(p[0], p[1], p[2], p[3])\n }\n }\n }\n}\n\nGlob.prototype._process = function (pattern, index, inGlobStar, cb) {\n assert(this instanceof Glob)\n assert(typeof cb === 'function')\n\n if (this.aborted)\n return\n\n this._processing++\n if (this.paused) {\n this._processQueue.push([pattern, index, inGlobStar, cb])\n return\n }\n\n //console.error('PROCESS %d', this._processing, pattern)\n\n // Get the first [n] parts of pattern that are all strings.\n var n = 0\n while (typeof pattern[n] === 'string') {\n n ++\n }\n // now n is the index of the first one that is *not* a string.\n\n // see if there's anything else\n var prefix\n switch (n) {\n // if not, then this is rather simple\n case pattern.length:\n this._processSimple(pattern.join('/'), index, cb)\n return\n\n case 0:\n // pattern *starts* with some non-trivial item.\n // going to readdir(cwd), but not include the prefix in matches.\n prefix = null\n break\n\n default:\n // pattern has some string bits in the front.\n // whatever it starts with, whether that's 'absolute' like /foo/bar,\n // or 'relative' like '../baz'\n prefix = pattern.slice(0, n).join('/')\n break\n }\n\n var remain = pattern.slice(n)\n\n // get the list of entries.\n var read\n if (prefix === null)\n read = '.'\n else if (isAbsolute(prefix) ||\n isAbsolute(pattern.map(function (p) {\n return typeof p === 'string' ? p : '[*]'\n }).join('/'))) {\n if (!prefix || !isAbsolute(prefix))\n prefix = '/' + prefix\n read = prefix\n } else\n read = prefix\n\n var abs = this._makeAbs(read)\n\n //if ignored, skip _processing\n if (childrenIgnored(this, read))\n return cb()\n\n var isGlobStar = remain[0] === minimatch.GLOBSTAR\n if (isGlobStar)\n this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)\n else\n this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)\n}\n\nGlob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {\n var self = this\n this._readdir(abs, inGlobStar, function (er, entries) {\n return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)\n })\n}\n\nGlob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {\n\n // if the abs isn't a dir, then nothing can match!\n if (!entries)\n return cb()\n\n // It will only match dot entries if it starts with a dot, or if\n // dot is set. Stuff like @(.foo|.bar) isn't allowed.\n var pn = remain[0]\n var negate = !!this.minimatch.negate\n var rawGlob = pn._glob\n var dotOk = this.dot || rawGlob.charAt(0) === '.'\n\n var matchedEntries = []\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i]\n if (e.charAt(0) !== '.' || dotOk) {\n var m\n if (negate && !prefix) {\n m = !e.match(pn)\n } else {\n m = e.match(pn)\n }\n if (m)\n matchedEntries.push(e)\n }\n }\n\n //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)\n\n var len = matchedEntries.length\n // If there are no matched entries, then nothing matches.\n if (len === 0)\n return cb()\n\n // if this is the last remaining pattern bit, then no need for\n // an additional stat *unless* the user has specified mark or\n // stat explicitly. We know they exist, since readdir returned\n // them.\n\n if (remain.length === 1 && !this.mark && !this.stat) {\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n if (prefix) {\n if (prefix !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n\n if (e.charAt(0) === '/' && !this.nomount) {\n e = path.join(this.root, e)\n }\n this._emitMatch(index, e)\n }\n // This was the last one, and no stats were needed\n return cb()\n }\n\n // now test all matched entries as stand-ins for that part\n // of the pattern.\n remain.shift()\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n var newPattern\n if (prefix) {\n if (prefix !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n this._process([e].concat(remain), index, inGlobStar, cb)\n }\n cb()\n}\n\nGlob.prototype._emitMatch = function (index, e) {\n if (this.aborted)\n return\n\n if (isIgnored(this, e))\n return\n\n if (this.paused) {\n this._emitQueue.push([index, e])\n return\n }\n\n var abs = isAbsolute(e) ? e : this._makeAbs(e)\n\n if (this.mark)\n e = this._mark(e)\n\n if (this.absolute)\n e = abs\n\n if (this.matches[index][e])\n return\n\n if (this.nodir) {\n var c = this.cache[abs]\n if (c === 'DIR' || Array.isArray(c))\n return\n }\n\n this.matches[index][e] = true\n\n var st = this.statCache[abs]\n if (st)\n this.emit('stat', e, st)\n\n this.emit('match', e)\n}\n\nGlob.prototype._readdirInGlobStar = function (abs, cb) {\n if (this.aborted)\n return\n\n // follow all symlinked directories forever\n // just proceed as if this is a non-globstar situation\n if (this.follow)\n return this._readdir(abs, false, cb)\n\n var lstatkey = 'lstat\\0' + abs\n var self = this\n var lstatcb = inflight(lstatkey, lstatcb_)\n\n if (lstatcb)\n self.fs.lstat(abs, lstatcb)\n\n function lstatcb_ (er, lstat) {\n if (er && er.code === 'ENOENT')\n return cb()\n\n var isSym = lstat && lstat.isSymbolicLink()\n self.symlinks[abs] = isSym\n\n // If it's not a symlink or a dir, then it's definitely a regular file.\n // don't bother doing a readdir in that case.\n if (!isSym && lstat && !lstat.isDirectory()) {\n self.cache[abs] = 'FILE'\n cb()\n } else\n self._readdir(abs, false, cb)\n }\n}\n\nGlob.prototype._readdir = function (abs, inGlobStar, cb) {\n if (this.aborted)\n return\n\n cb = inflight('readdir\\0'+abs+'\\0'+inGlobStar, cb)\n if (!cb)\n return\n\n //console.error('RD %j %j', +inGlobStar, abs)\n if (inGlobStar && !ownProp(this.symlinks, abs))\n return this._readdirInGlobStar(abs, cb)\n\n if (ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n if (!c || c === 'FILE')\n return cb()\n\n if (Array.isArray(c))\n return cb(null, c)\n }\n\n var self = this\n self.fs.readdir(abs, readdirCb(this, abs, cb))\n}\n\nfunction readdirCb (self, abs, cb) {\n return function (er, entries) {\n if (er)\n self._readdirError(abs, er, cb)\n else\n self._readdirEntries(abs, entries, cb)\n }\n}\n\nGlob.prototype._readdirEntries = function (abs, entries, cb) {\n if (this.aborted)\n return\n\n // if we haven't asked to stat everything, then just\n // assume that everything in there exists, so we can avoid\n // having to stat it a second time.\n if (!this.mark && !this.stat) {\n for (var i = 0; i < entries.length; i ++) {\n var e = entries[i]\n if (abs === '/')\n e = abs + e\n else\n e = abs + '/' + e\n this.cache[e] = true\n }\n }\n\n this.cache[abs] = entries\n return cb(null, entries)\n}\n\nGlob.prototype._readdirError = function (f, er, cb) {\n if (this.aborted)\n return\n\n // handle errors, and cache the information\n switch (er.code) {\n case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205\n case 'ENOTDIR': // totally normal. means it *does* exist.\n var abs = this._makeAbs(f)\n this.cache[abs] = 'FILE'\n if (abs === this.cwdAbs) {\n var error = new Error(er.code + ' invalid cwd ' + this.cwd)\n error.path = this.cwd\n error.code = er.code\n this.emit('error', error)\n this.abort()\n }\n break\n\n case 'ENOENT': // not terribly unusual\n case 'ELOOP':\n case 'ENAMETOOLONG':\n case 'UNKNOWN':\n this.cache[this._makeAbs(f)] = false\n break\n\n default: // some unusual error. Treat as failure.\n this.cache[this._makeAbs(f)] = false\n if (this.strict) {\n this.emit('error', er)\n // If the error is handled, then we abort\n // if not, we threw out of here\n this.abort()\n }\n if (!this.silent)\n console.error('glob error', er)\n break\n }\n\n return cb()\n}\n\nGlob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {\n var self = this\n this._readdir(abs, inGlobStar, function (er, entries) {\n self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)\n })\n}\n\n\nGlob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {\n //console.error('pgs2', prefix, remain[0], entries)\n\n // no entries means not a dir, so it can never have matches\n // foo.txt/** doesn't match foo.txt\n if (!entries)\n return cb()\n\n // test without the globstar, and with every child both below\n // and replacing the globstar.\n var remainWithoutGlobStar = remain.slice(1)\n var gspref = prefix ? [ prefix ] : []\n var noGlobStar = gspref.concat(remainWithoutGlobStar)\n\n // the noGlobStar pattern exits the inGlobStar state\n this._process(noGlobStar, index, false, cb)\n\n var isSym = this.symlinks[abs]\n var len = entries.length\n\n // If it's a symlink, and we're in a globstar, then stop\n if (isSym && inGlobStar)\n return cb()\n\n for (var i = 0; i < len; i++) {\n var e = entries[i]\n if (e.charAt(0) === '.' && !this.dot)\n continue\n\n // these two cases enter the inGlobStar state\n var instead = gspref.concat(entries[i], remainWithoutGlobStar)\n this._process(instead, index, true, cb)\n\n var below = gspref.concat(entries[i], remain)\n this._process(below, index, true, cb)\n }\n\n cb()\n}\n\nGlob.prototype._processSimple = function (prefix, index, cb) {\n // XXX review this. Shouldn't it be doing the mounting etc\n // before doing stat? kinda weird?\n var self = this\n this._stat(prefix, function (er, exists) {\n self._processSimple2(prefix, index, er, exists, cb)\n })\n}\nGlob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {\n\n //console.error('ps2', prefix, exists)\n\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n // If it doesn't exist, then just mark the lack of results\n if (!exists)\n return cb()\n\n if (prefix && isAbsolute(prefix) && !this.nomount) {\n var trail = /[\\/\\\\]$/.test(prefix)\n if (prefix.charAt(0) === '/') {\n prefix = path.join(this.root, prefix)\n } else {\n prefix = path.resolve(this.root, prefix)\n if (trail)\n prefix += '/'\n }\n }\n\n if (process.platform === 'win32')\n prefix = prefix.replace(/\\\\/g, '/')\n\n // Mark this as a match\n this._emitMatch(index, prefix)\n cb()\n}\n\n// Returns either 'DIR', 'FILE', or false\nGlob.prototype._stat = function (f, cb) {\n var abs = this._makeAbs(f)\n var needDir = f.slice(-1) === '/'\n\n if (f.length > this.maxLength)\n return cb()\n\n if (!this.stat && ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n\n if (Array.isArray(c))\n c = 'DIR'\n\n // It exists, but maybe not how we need it\n if (!needDir || c === 'DIR')\n return cb(null, c)\n\n if (needDir && c === 'FILE')\n return cb()\n\n // otherwise we have to stat, because maybe c=true\n // if we know it exists, but not what it is.\n }\n\n var exists\n var stat = this.statCache[abs]\n if (stat !== undefined) {\n if (stat === false)\n return cb(null, stat)\n else {\n var type = stat.isDirectory() ? 'DIR' : 'FILE'\n if (needDir && type === 'FILE')\n return cb()\n else\n return cb(null, type, stat)\n }\n }\n\n var self = this\n var statcb = inflight('stat\\0' + abs, lstatcb_)\n if (statcb)\n self.fs.lstat(abs, statcb)\n\n function lstatcb_ (er, lstat) {\n if (lstat && lstat.isSymbolicLink()) {\n // If it's a symlink, then treat it as the target, unless\n // the target does not exist, then treat it as a file.\n return self.fs.stat(abs, function (er, stat) {\n if (er)\n self._stat2(f, abs, null, lstat, cb)\n else\n self._stat2(f, abs, er, stat, cb)\n })\n } else {\n self._stat2(f, abs, er, lstat, cb)\n }\n }\n}\n\nGlob.prototype._stat2 = function (f, abs, er, stat, cb) {\n if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {\n this.statCache[abs] = false\n return cb()\n }\n\n var needDir = f.slice(-1) === '/'\n this.statCache[abs] = stat\n\n if (abs.slice(-1) === '/' && stat && !stat.isDirectory())\n return cb(null, false, stat)\n\n var c = true\n if (stat)\n c = stat.isDirectory() ? 'DIR' : 'FILE'\n this.cache[abs] = this.cache[abs] || c\n\n if (needDir && c === 'FILE')\n return cb()\n\n return cb(null, c, stat)\n}\n","module.exports = globSync\nglobSync.GlobSync = GlobSync\n\nvar rp = require('fs.realpath')\nvar minimatch = require('minimatch')\nvar Minimatch = minimatch.Minimatch\nvar Glob = require('./glob.js').Glob\nvar util = require('util')\nvar path = require('path')\nvar assert = require('assert')\nvar isAbsolute = require('path-is-absolute')\nvar common = require('./common.js')\nvar setopts = common.setopts\nvar ownProp = common.ownProp\nvar childrenIgnored = common.childrenIgnored\nvar isIgnored = common.isIgnored\n\nfunction globSync (pattern, options) {\n if (typeof options === 'function' || arguments.length === 3)\n throw new TypeError('callback provided to sync glob\\n'+\n 'See: https://github.com/isaacs/node-glob/issues/167')\n\n return new GlobSync(pattern, options).found\n}\n\nfunction GlobSync (pattern, options) {\n if (!pattern)\n throw new Error('must provide pattern')\n\n if (typeof options === 'function' || arguments.length === 3)\n throw new TypeError('callback provided to sync glob\\n'+\n 'See: https://github.com/isaacs/node-glob/issues/167')\n\n if (!(this instanceof GlobSync))\n return new GlobSync(pattern, options)\n\n setopts(this, pattern, options)\n\n if (this.noprocess)\n return this\n\n var n = this.minimatch.set.length\n this.matches = new Array(n)\n for (var i = 0; i < n; i ++) {\n this._process(this.minimatch.set[i], i, false)\n }\n this._finish()\n}\n\nGlobSync.prototype._finish = function () {\n assert.ok(this instanceof GlobSync)\n if (this.realpath) {\n var self = this\n this.matches.forEach(function (matchset, index) {\n var set = self.matches[index] = Object.create(null)\n for (var p in matchset) {\n try {\n p = self._makeAbs(p)\n var real = rp.realpathSync(p, self.realpathCache)\n set[real] = true\n } catch (er) {\n if (er.syscall === 'stat')\n set[self._makeAbs(p)] = true\n else\n throw er\n }\n }\n })\n }\n common.finish(this)\n}\n\n\nGlobSync.prototype._process = function (pattern, index, inGlobStar) {\n assert.ok(this instanceof GlobSync)\n\n // Get the first [n] parts of pattern that are all strings.\n var n = 0\n while (typeof pattern[n] === 'string') {\n n ++\n }\n // now n is the index of the first one that is *not* a string.\n\n // See if there's anything else\n var prefix\n switch (n) {\n // if not, then this is rather simple\n case pattern.length:\n this._processSimple(pattern.join('/'), index)\n return\n\n case 0:\n // pattern *starts* with some non-trivial item.\n // going to readdir(cwd), but not include the prefix in matches.\n prefix = null\n break\n\n default:\n // pattern has some string bits in the front.\n // whatever it starts with, whether that's 'absolute' like /foo/bar,\n // or 'relative' like '../baz'\n prefix = pattern.slice(0, n).join('/')\n break\n }\n\n var remain = pattern.slice(n)\n\n // get the list of entries.\n var read\n if (prefix === null)\n read = '.'\n else if (isAbsolute(prefix) ||\n isAbsolute(pattern.map(function (p) {\n return typeof p === 'string' ? p : '[*]'\n }).join('/'))) {\n if (!prefix || !isAbsolute(prefix))\n prefix = '/' + prefix\n read = prefix\n } else\n read = prefix\n\n var abs = this._makeAbs(read)\n\n //if ignored, skip processing\n if (childrenIgnored(this, read))\n return\n\n var isGlobStar = remain[0] === minimatch.GLOBSTAR\n if (isGlobStar)\n this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)\n else\n this._processReaddir(prefix, read, abs, remain, index, inGlobStar)\n}\n\n\nGlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {\n var entries = this._readdir(abs, inGlobStar)\n\n // if the abs isn't a dir, then nothing can match!\n if (!entries)\n return\n\n // It will only match dot entries if it starts with a dot, or if\n // dot is set. Stuff like @(.foo|.bar) isn't allowed.\n var pn = remain[0]\n var negate = !!this.minimatch.negate\n var rawGlob = pn._glob\n var dotOk = this.dot || rawGlob.charAt(0) === '.'\n\n var matchedEntries = []\n for (var i = 0; i < entries.length; i++) {\n var e = entries[i]\n if (e.charAt(0) !== '.' || dotOk) {\n var m\n if (negate && !prefix) {\n m = !e.match(pn)\n } else {\n m = e.match(pn)\n }\n if (m)\n matchedEntries.push(e)\n }\n }\n\n var len = matchedEntries.length\n // If there are no matched entries, then nothing matches.\n if (len === 0)\n return\n\n // if this is the last remaining pattern bit, then no need for\n // an additional stat *unless* the user has specified mark or\n // stat explicitly. We know they exist, since readdir returned\n // them.\n\n if (remain.length === 1 && !this.mark && !this.stat) {\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n if (prefix) {\n if (prefix.slice(-1) !== '/')\n e = prefix + '/' + e\n else\n e = prefix + e\n }\n\n if (e.charAt(0) === '/' && !this.nomount) {\n e = path.join(this.root, e)\n }\n this._emitMatch(index, e)\n }\n // This was the last one, and no stats were needed\n return\n }\n\n // now test all matched entries as stand-ins for that part\n // of the pattern.\n remain.shift()\n for (var i = 0; i < len; i ++) {\n var e = matchedEntries[i]\n var newPattern\n if (prefix)\n newPattern = [prefix, e]\n else\n newPattern = [e]\n this._process(newPattern.concat(remain), index, inGlobStar)\n }\n}\n\n\nGlobSync.prototype._emitMatch = function (index, e) {\n if (isIgnored(this, e))\n return\n\n var abs = this._makeAbs(e)\n\n if (this.mark)\n e = this._mark(e)\n\n if (this.absolute) {\n e = abs\n }\n\n if (this.matches[index][e])\n return\n\n if (this.nodir) {\n var c = this.cache[abs]\n if (c === 'DIR' || Array.isArray(c))\n return\n }\n\n this.matches[index][e] = true\n\n if (this.stat)\n this._stat(e)\n}\n\n\nGlobSync.prototype._readdirInGlobStar = function (abs) {\n // follow all symlinked directories forever\n // just proceed as if this is a non-globstar situation\n if (this.follow)\n return this._readdir(abs, false)\n\n var entries\n var lstat\n var stat\n try {\n lstat = this.fs.lstatSync(abs)\n } catch (er) {\n if (er.code === 'ENOENT') {\n // lstat failed, doesn't exist\n return null\n }\n }\n\n var isSym = lstat && lstat.isSymbolicLink()\n this.symlinks[abs] = isSym\n\n // If it's not a symlink or a dir, then it's definitely a regular file.\n // don't bother doing a readdir in that case.\n if (!isSym && lstat && !lstat.isDirectory())\n this.cache[abs] = 'FILE'\n else\n entries = this._readdir(abs, false)\n\n return entries\n}\n\nGlobSync.prototype._readdir = function (abs, inGlobStar) {\n var entries\n\n if (inGlobStar && !ownProp(this.symlinks, abs))\n return this._readdirInGlobStar(abs)\n\n if (ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n if (!c || c === 'FILE')\n return null\n\n if (Array.isArray(c))\n return c\n }\n\n try {\n return this._readdirEntries(abs, this.fs.readdirSync(abs))\n } catch (er) {\n this._readdirError(abs, er)\n return null\n }\n}\n\nGlobSync.prototype._readdirEntries = function (abs, entries) {\n // if we haven't asked to stat everything, then just\n // assume that everything in there exists, so we can avoid\n // having to stat it a second time.\n if (!this.mark && !this.stat) {\n for (var i = 0; i < entries.length; i ++) {\n var e = entries[i]\n if (abs === '/')\n e = abs + e\n else\n e = abs + '/' + e\n this.cache[e] = true\n }\n }\n\n this.cache[abs] = entries\n\n // mark and cache dir-ness\n return entries\n}\n\nGlobSync.prototype._readdirError = function (f, er) {\n // handle errors, and cache the information\n switch (er.code) {\n case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205\n case 'ENOTDIR': // totally normal. means it *does* exist.\n var abs = this._makeAbs(f)\n this.cache[abs] = 'FILE'\n if (abs === this.cwdAbs) {\n var error = new Error(er.code + ' invalid cwd ' + this.cwd)\n error.path = this.cwd\n error.code = er.code\n throw error\n }\n break\n\n case 'ENOENT': // not terribly unusual\n case 'ELOOP':\n case 'ENAMETOOLONG':\n case 'UNKNOWN':\n this.cache[this._makeAbs(f)] = false\n break\n\n default: // some unusual error. Treat as failure.\n this.cache[this._makeAbs(f)] = false\n if (this.strict)\n throw er\n if (!this.silent)\n console.error('glob error', er)\n break\n }\n}\n\nGlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {\n\n var entries = this._readdir(abs, inGlobStar)\n\n // no entries means not a dir, so it can never have matches\n // foo.txt/** doesn't match foo.txt\n if (!entries)\n return\n\n // test without the globstar, and with every child both below\n // and replacing the globstar.\n var remainWithoutGlobStar = remain.slice(1)\n var gspref = prefix ? [ prefix ] : []\n var noGlobStar = gspref.concat(remainWithoutGlobStar)\n\n // the noGlobStar pattern exits the inGlobStar state\n this._process(noGlobStar, index, false)\n\n var len = entries.length\n var isSym = this.symlinks[abs]\n\n // If it's a symlink, and we're in a globstar, then stop\n if (isSym && inGlobStar)\n return\n\n for (var i = 0; i < len; i++) {\n var e = entries[i]\n if (e.charAt(0) === '.' && !this.dot)\n continue\n\n // these two cases enter the inGlobStar state\n var instead = gspref.concat(entries[i], remainWithoutGlobStar)\n this._process(instead, index, true)\n\n var below = gspref.concat(entries[i], remain)\n this._process(below, index, true)\n }\n}\n\nGlobSync.prototype._processSimple = function (prefix, index) {\n // XXX review this. Shouldn't it be doing the mounting etc\n // before doing stat? kinda weird?\n var exists = this._stat(prefix)\n\n if (!this.matches[index])\n this.matches[index] = Object.create(null)\n\n // If it doesn't exist, then just mark the lack of results\n if (!exists)\n return\n\n if (prefix && isAbsolute(prefix) && !this.nomount) {\n var trail = /[\\/\\\\]$/.test(prefix)\n if (prefix.charAt(0) === '/') {\n prefix = path.join(this.root, prefix)\n } else {\n prefix = path.resolve(this.root, prefix)\n if (trail)\n prefix += '/'\n }\n }\n\n if (process.platform === 'win32')\n prefix = prefix.replace(/\\\\/g, '/')\n\n // Mark this as a match\n this._emitMatch(index, prefix)\n}\n\n// Returns either 'DIR', 'FILE', or false\nGlobSync.prototype._stat = function (f) {\n var abs = this._makeAbs(f)\n var needDir = f.slice(-1) === '/'\n\n if (f.length > this.maxLength)\n return false\n\n if (!this.stat && ownProp(this.cache, abs)) {\n var c = this.cache[abs]\n\n if (Array.isArray(c))\n c = 'DIR'\n\n // It exists, but maybe not how we need it\n if (!needDir || c === 'DIR')\n return c\n\n if (needDir && c === 'FILE')\n return false\n\n // otherwise we have to stat, because maybe c=true\n // if we know it exists, but not what it is.\n }\n\n var exists\n var stat = this.statCache[abs]\n if (!stat) {\n var lstat\n try {\n lstat = this.fs.lstatSync(abs)\n } catch (er) {\n if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {\n this.statCache[abs] = false\n return false\n }\n }\n\n if (lstat && lstat.isSymbolicLink()) {\n try {\n stat = this.fs.statSync(abs)\n } catch (er) {\n stat = lstat\n }\n } else {\n stat = lstat\n }\n }\n\n this.statCache[abs] = stat\n\n var c = true\n if (stat)\n c = stat.isDirectory() ? 'DIR' : 'FILE'\n\n this.cache[abs] = this.cache[abs] || c\n\n if (needDir && c === 'FILE')\n return false\n\n return c\n}\n\nGlobSync.prototype._mark = function (p) {\n return common.mark(this, p)\n}\n\nGlobSync.prototype._makeAbs = function (f) {\n return common.makeAbs(this, f)\n}\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst types_1 = require(\"./types\");\nfunction createRejection(error, ...beforeErrorGroups) {\n const promise = (async () => {\n if (error instanceof types_1.RequestError) {\n try {\n for (const hooks of beforeErrorGroups) {\n if (hooks) {\n for (const hook of hooks) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n }\n }\n }\n catch (error_) {\n error = error_;\n }\n }\n throw error;\n })();\n const returnPromise = () => promise;\n promise.json = returnPromise;\n promise.text = returnPromise;\n promise.buffer = returnPromise;\n promise.on = returnPromise;\n return promise;\n}\nexports.default = createRejection;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst events_1 = require(\"events\");\nconst is_1 = require(\"@sindresorhus/is\");\nconst PCancelable = require(\"p-cancelable\");\nconst types_1 = require(\"./types\");\nconst parse_body_1 = require(\"./parse-body\");\nconst core_1 = require(\"../core\");\nconst proxy_events_1 = require(\"../core/utils/proxy-events\");\nconst get_buffer_1 = require(\"../core/utils/get-buffer\");\nconst is_response_ok_1 = require(\"../core/utils/is-response-ok\");\nconst proxiedRequestEvents = [\n 'request',\n 'response',\n 'redirect',\n 'uploadProgress',\n 'downloadProgress'\n];\nfunction asPromise(normalizedOptions) {\n let globalRequest;\n let globalResponse;\n const emitter = new events_1.EventEmitter();\n const promise = new PCancelable((resolve, reject, onCancel) => {\n const makeRequest = (retryCount) => {\n const request = new core_1.default(undefined, normalizedOptions);\n request.retryCount = retryCount;\n request._noPipe = true;\n onCancel(() => request.destroy());\n onCancel.shouldReject = false;\n onCancel(() => reject(new types_1.CancelError(request)));\n globalRequest = request;\n request.once('response', async (response) => {\n var _a;\n response.retryCount = retryCount;\n if (response.request.aborted) {\n // Canceled while downloading - will throw a `CancelError` or `TimeoutError` error\n return;\n }\n // Download body\n let rawBody;\n try {\n rawBody = await get_buffer_1.default(request);\n response.rawBody = rawBody;\n }\n catch (_b) {\n // The same error is caught below.\n // See request.once('error')\n return;\n }\n if (request._isAboutToError) {\n return;\n }\n // Parse body\n const contentEncoding = ((_a = response.headers['content-encoding']) !== null && _a !== void 0 ? _a : '').toLowerCase();\n const isCompressed = ['gzip', 'deflate', 'br'].includes(contentEncoding);\n const { options } = request;\n if (isCompressed && !options.decompress) {\n response.body = rawBody;\n }\n else {\n try {\n response.body = parse_body_1.default(response, options.responseType, options.parseJson, options.encoding);\n }\n catch (error) {\n // Fallback to `utf8`\n response.body = rawBody.toString();\n if (is_response_ok_1.isResponseOk(response)) {\n request._beforeError(error);\n return;\n }\n }\n }\n try {\n for (const [index, hook] of options.hooks.afterResponse.entries()) {\n // @ts-expect-error TS doesn't notice that CancelableRequest is a Promise\n // eslint-disable-next-line no-await-in-loop\n response = await hook(response, async (updatedOptions) => {\n const typedOptions = core_1.default.normalizeArguments(undefined, {\n ...updatedOptions,\n retry: {\n calculateDelay: () => 0\n },\n throwHttpErrors: false,\n resolveBodyOnly: false\n }, options);\n // Remove any further hooks for that request, because we'll call them anyway.\n // The loop continues. We don't want duplicates (asPromise recursion).\n typedOptions.hooks.afterResponse = typedOptions.hooks.afterResponse.slice(0, index);\n for (const hook of typedOptions.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n await hook(typedOptions);\n }\n const promise = asPromise(typedOptions);\n onCancel(() => {\n promise.catch(() => { });\n promise.cancel();\n });\n return promise;\n });\n }\n }\n catch (error) {\n request._beforeError(new types_1.RequestError(error.message, error, request));\n return;\n }\n globalResponse = response;\n if (!is_response_ok_1.isResponseOk(response)) {\n request._beforeError(new types_1.HTTPError(response));\n return;\n }\n request.destroy();\n resolve(request.options.resolveBodyOnly ? response.body : response);\n });\n const onError = (error) => {\n if (promise.isCanceled) {\n return;\n }\n const { options } = request;\n if (error instanceof types_1.HTTPError && !options.throwHttpErrors) {\n const { response } = error;\n resolve(request.options.resolveBodyOnly ? response.body : response);\n return;\n }\n reject(error);\n };\n request.once('error', onError);\n const previousBody = request.options.body;\n request.once('retry', (newRetryCount, error) => {\n var _a, _b;\n if (previousBody === ((_a = error.request) === null || _a === void 0 ? void 0 : _a.options.body) && is_1.default.nodeStream((_b = error.request) === null || _b === void 0 ? void 0 : _b.options.body)) {\n onError(error);\n return;\n }\n makeRequest(newRetryCount);\n });\n proxy_events_1.default(request, emitter, proxiedRequestEvents);\n };\n makeRequest(0);\n });\n promise.on = (event, fn) => {\n emitter.on(event, fn);\n return promise;\n };\n const shortcut = (responseType) => {\n const newPromise = (async () => {\n // Wait until downloading has ended\n await promise;\n const { options } = globalResponse.request;\n return parse_body_1.default(globalResponse, responseType, options.parseJson, options.encoding);\n })();\n Object.defineProperties(newPromise, Object.getOwnPropertyDescriptors(promise));\n return newPromise;\n };\n promise.json = () => {\n const { headers } = globalRequest.options;\n if (!globalRequest.writableFinished && headers.accept === undefined) {\n headers.accept = 'application/json';\n }\n return shortcut('json');\n };\n promise.buffer = () => shortcut('buffer');\n promise.text = () => shortcut('text');\n return promise;\n}\nexports.default = asPromise;\n__exportStar(require(\"./types\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst is_1 = require(\"@sindresorhus/is\");\nconst normalizeArguments = (options, defaults) => {\n if (is_1.default.null_(options.encoding)) {\n throw new TypeError('To get a Buffer, set `options.responseType` to `buffer` instead');\n }\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.encoding);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.resolveBodyOnly);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.methodRewriting);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.isStream);\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.responseType);\n // `options.responseType`\n if (options.responseType === undefined) {\n options.responseType = 'text';\n }\n // `options.retry`\n const { retry } = options;\n if (defaults) {\n options.retry = { ...defaults.retry };\n }\n else {\n options.retry = {\n calculateDelay: retryObject => retryObject.computedValue,\n limit: 0,\n methods: [],\n statusCodes: [],\n errorCodes: [],\n maxRetryAfter: undefined\n };\n }\n if (is_1.default.object(retry)) {\n options.retry = {\n ...options.retry,\n ...retry\n };\n options.retry.methods = [...new Set(options.retry.methods.map(method => method.toUpperCase()))];\n options.retry.statusCodes = [...new Set(options.retry.statusCodes)];\n options.retry.errorCodes = [...new Set(options.retry.errorCodes)];\n }\n else if (is_1.default.number(retry)) {\n options.retry.limit = retry;\n }\n if (is_1.default.undefined(options.retry.maxRetryAfter)) {\n options.retry.maxRetryAfter = Math.min(\n // TypeScript is not smart enough to handle `.filter(x => is.number(x))`.\n // eslint-disable-next-line unicorn/no-fn-reference-in-iterator\n ...[options.timeout.request, options.timeout.connect].filter(is_1.default.number));\n }\n // `options.pagination`\n if (is_1.default.object(options.pagination)) {\n if (defaults) {\n options.pagination = {\n ...defaults.pagination,\n ...options.pagination\n };\n }\n const { pagination } = options;\n if (!is_1.default.function_(pagination.transform)) {\n throw new Error('`options.pagination.transform` must be implemented');\n }\n if (!is_1.default.function_(pagination.shouldContinue)) {\n throw new Error('`options.pagination.shouldContinue` must be implemented');\n }\n if (!is_1.default.function_(pagination.filter)) {\n throw new TypeError('`options.pagination.filter` must be implemented');\n }\n if (!is_1.default.function_(pagination.paginate)) {\n throw new Error('`options.pagination.paginate` must be implemented');\n }\n }\n // JSON mode\n if (options.responseType === 'json' && options.headers.accept === undefined) {\n options.headers.accept = 'application/json';\n }\n return options;\n};\nexports.default = normalizeArguments;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst types_1 = require(\"./types\");\nconst parseBody = (response, responseType, parseJson, encoding) => {\n const { rawBody } = response;\n try {\n if (responseType === 'text') {\n return rawBody.toString(encoding);\n }\n if (responseType === 'json') {\n return rawBody.length === 0 ? '' : parseJson(rawBody.toString());\n }\n if (responseType === 'buffer') {\n return rawBody;\n }\n throw new types_1.ParseError({\n message: `Unknown body type '${responseType}'`,\n name: 'Error'\n }, response);\n }\n catch (error) {\n throw new types_1.ParseError(error, response);\n }\n};\nexports.default = parseBody;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CancelError = exports.ParseError = void 0;\nconst core_1 = require(\"../core\");\n/**\nAn error to be thrown when server response code is 2xx, and parsing body fails.\nIncludes a `response` property.\n*/\nclass ParseError extends core_1.RequestError {\n constructor(error, response) {\n const { options } = response.request;\n super(`${error.message} in \"${options.url.toString()}\"`, error, response.request);\n this.name = 'ParseError';\n this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_BODY_PARSE_FAILURE' : this.code;\n }\n}\nexports.ParseError = ParseError;\n/**\nAn error to be thrown when the request is aborted with `.cancel()`.\n*/\nclass CancelError extends core_1.RequestError {\n constructor(request) {\n super('Promise was canceled', {}, request);\n this.name = 'CancelError';\n this.code = 'ERR_CANCELED';\n }\n get isCanceled() {\n return true;\n }\n}\nexports.CancelError = CancelError;\n__exportStar(require(\"../core\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.retryAfterStatusCodes = void 0;\nexports.retryAfterStatusCodes = new Set([413, 429, 503]);\nconst calculateRetryDelay = ({ attemptCount, retryOptions, error, retryAfter }) => {\n if (attemptCount > retryOptions.limit) {\n return 0;\n }\n const hasMethod = retryOptions.methods.includes(error.options.method);\n const hasErrorCode = retryOptions.errorCodes.includes(error.code);\n const hasStatusCode = error.response && retryOptions.statusCodes.includes(error.response.statusCode);\n if (!hasMethod || (!hasErrorCode && !hasStatusCode)) {\n return 0;\n }\n if (error.response) {\n if (retryAfter) {\n if (retryOptions.maxRetryAfter === undefined || retryAfter > retryOptions.maxRetryAfter) {\n return 0;\n }\n return retryAfter;\n }\n if (error.response.statusCode === 413) {\n return 0;\n }\n }\n const noise = Math.random() * 100;\n return ((2 ** (attemptCount - 1)) * 1000) + noise;\n};\nexports.default = calculateRetryDelay;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UnsupportedProtocolError = exports.ReadError = exports.TimeoutError = exports.UploadError = exports.CacheError = exports.HTTPError = exports.MaxRedirectsError = exports.RequestError = exports.setNonEnumerableProperties = exports.knownHookEvents = exports.withoutBody = exports.kIsNormalizedAlready = void 0;\nconst util_1 = require(\"util\");\nconst stream_1 = require(\"stream\");\nconst fs_1 = require(\"fs\");\nconst url_1 = require(\"url\");\nconst http = require(\"http\");\nconst http_1 = require(\"http\");\nconst https = require(\"https\");\nconst http_timer_1 = require(\"@szmarczak/http-timer\");\nconst cacheable_lookup_1 = require(\"cacheable-lookup\");\nconst CacheableRequest = require(\"cacheable-request\");\nconst decompressResponse = require(\"decompress-response\");\n// @ts-expect-error Missing types\nconst http2wrapper = require(\"http2-wrapper\");\nconst lowercaseKeys = require(\"lowercase-keys\");\nconst is_1 = require(\"@sindresorhus/is\");\nconst get_body_size_1 = require(\"./utils/get-body-size\");\nconst is_form_data_1 = require(\"./utils/is-form-data\");\nconst proxy_events_1 = require(\"./utils/proxy-events\");\nconst timed_out_1 = require(\"./utils/timed-out\");\nconst url_to_options_1 = require(\"./utils/url-to-options\");\nconst options_to_url_1 = require(\"./utils/options-to-url\");\nconst weakable_map_1 = require(\"./utils/weakable-map\");\nconst get_buffer_1 = require(\"./utils/get-buffer\");\nconst dns_ip_version_1 = require(\"./utils/dns-ip-version\");\nconst is_response_ok_1 = require(\"./utils/is-response-ok\");\nconst deprecation_warning_1 = require(\"../utils/deprecation-warning\");\nconst normalize_arguments_1 = require(\"../as-promise/normalize-arguments\");\nconst calculate_retry_delay_1 = require(\"./calculate-retry-delay\");\nlet globalDnsCache;\nconst kRequest = Symbol('request');\nconst kResponse = Symbol('response');\nconst kResponseSize = Symbol('responseSize');\nconst kDownloadedSize = Symbol('downloadedSize');\nconst kBodySize = Symbol('bodySize');\nconst kUploadedSize = Symbol('uploadedSize');\nconst kServerResponsesPiped = Symbol('serverResponsesPiped');\nconst kUnproxyEvents = Symbol('unproxyEvents');\nconst kIsFromCache = Symbol('isFromCache');\nconst kCancelTimeouts = Symbol('cancelTimeouts');\nconst kStartedReading = Symbol('startedReading');\nconst kStopReading = Symbol('stopReading');\nconst kTriggerRead = Symbol('triggerRead');\nconst kBody = Symbol('body');\nconst kJobs = Symbol('jobs');\nconst kOriginalResponse = Symbol('originalResponse');\nconst kRetryTimeout = Symbol('retryTimeout');\nexports.kIsNormalizedAlready = Symbol('isNormalizedAlready');\nconst supportsBrotli = is_1.default.string(process.versions.brotli);\nexports.withoutBody = new Set(['GET', 'HEAD']);\nexports.knownHookEvents = [\n 'init',\n 'beforeRequest',\n 'beforeRedirect',\n 'beforeError',\n 'beforeRetry',\n // Promise-Only\n 'afterResponse'\n];\nfunction validateSearchParameters(searchParameters) {\n // eslint-disable-next-line guard-for-in\n for (const key in searchParameters) {\n const value = searchParameters[key];\n if (!is_1.default.string(value) && !is_1.default.number(value) && !is_1.default.boolean(value) && !is_1.default.null_(value) && !is_1.default.undefined(value)) {\n throw new TypeError(`The \\`searchParams\\` value '${String(value)}' must be a string, number, boolean or null`);\n }\n }\n}\nfunction isClientRequest(clientRequest) {\n return is_1.default.object(clientRequest) && !('statusCode' in clientRequest);\n}\nconst cacheableStore = new weakable_map_1.default();\nconst waitForOpenFile = async (file) => new Promise((resolve, reject) => {\n const onError = (error) => {\n reject(error);\n };\n // Node.js 12 has incomplete types\n if (!file.pending) {\n resolve();\n }\n file.once('error', onError);\n file.once('ready', () => {\n file.off('error', onError);\n resolve();\n });\n});\nconst redirectCodes = new Set([300, 301, 302, 303, 304, 307, 308]);\nconst nonEnumerableProperties = [\n 'context',\n 'body',\n 'json',\n 'form'\n];\nexports.setNonEnumerableProperties = (sources, to) => {\n // Non enumerable properties shall not be merged\n const properties = {};\n for (const source of sources) {\n if (!source) {\n continue;\n }\n for (const name of nonEnumerableProperties) {\n if (!(name in source)) {\n continue;\n }\n properties[name] = {\n writable: true,\n configurable: true,\n enumerable: false,\n // @ts-expect-error TS doesn't see the check above\n value: source[name]\n };\n }\n }\n Object.defineProperties(to, properties);\n};\n/**\nAn error to be thrown when a request fails.\nContains a `code` property with error class code, like `ECONNREFUSED`.\n*/\nclass RequestError extends Error {\n constructor(message, error, self) {\n var _a, _b;\n super(message);\n Error.captureStackTrace(this, this.constructor);\n this.name = 'RequestError';\n this.code = (_a = error.code) !== null && _a !== void 0 ? _a : 'ERR_GOT_REQUEST_ERROR';\n if (self instanceof Request) {\n Object.defineProperty(this, 'request', {\n enumerable: false,\n value: self\n });\n Object.defineProperty(this, 'response', {\n enumerable: false,\n value: self[kResponse]\n });\n Object.defineProperty(this, 'options', {\n // This fails because of TS 3.7.2 useDefineForClassFields\n // Ref: https://github.com/microsoft/TypeScript/issues/34972\n enumerable: false,\n value: self.options\n });\n }\n else {\n Object.defineProperty(this, 'options', {\n // This fails because of TS 3.7.2 useDefineForClassFields\n // Ref: https://github.com/microsoft/TypeScript/issues/34972\n enumerable: false,\n value: self\n });\n }\n this.timings = (_b = this.request) === null || _b === void 0 ? void 0 : _b.timings;\n // Recover the original stacktrace\n if (is_1.default.string(error.stack) && is_1.default.string(this.stack)) {\n const indexOfMessage = this.stack.indexOf(this.message) + this.message.length;\n const thisStackTrace = this.stack.slice(indexOfMessage).split('\\n').reverse();\n const errorStackTrace = error.stack.slice(error.stack.indexOf(error.message) + error.message.length).split('\\n').reverse();\n // Remove duplicated traces\n while (errorStackTrace.length !== 0 && errorStackTrace[0] === thisStackTrace[0]) {\n thisStackTrace.shift();\n }\n this.stack = `${this.stack.slice(0, indexOfMessage)}${thisStackTrace.reverse().join('\\n')}${errorStackTrace.reverse().join('\\n')}`;\n }\n }\n}\nexports.RequestError = RequestError;\n/**\nAn error to be thrown when the server redirects you more than ten times.\nIncludes a `response` property.\n*/\nclass MaxRedirectsError extends RequestError {\n constructor(request) {\n super(`Redirected ${request.options.maxRedirects} times. Aborting.`, {}, request);\n this.name = 'MaxRedirectsError';\n this.code = 'ERR_TOO_MANY_REDIRECTS';\n }\n}\nexports.MaxRedirectsError = MaxRedirectsError;\n/**\nAn error to be thrown when the server response code is not 2xx nor 3xx if `options.followRedirect` is `true`, but always except for 304.\nIncludes a `response` property.\n*/\nclass HTTPError extends RequestError {\n constructor(response) {\n super(`Response code ${response.statusCode} (${response.statusMessage})`, {}, response.request);\n this.name = 'HTTPError';\n this.code = 'ERR_NON_2XX_3XX_RESPONSE';\n }\n}\nexports.HTTPError = HTTPError;\n/**\nAn error to be thrown when a cache method fails.\nFor example, if the database goes down or there's a filesystem error.\n*/\nclass CacheError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'CacheError';\n this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_CACHE_ACCESS' : this.code;\n }\n}\nexports.CacheError = CacheError;\n/**\nAn error to be thrown when the request body is a stream and an error occurs while reading from that stream.\n*/\nclass UploadError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'UploadError';\n this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_UPLOAD' : this.code;\n }\n}\nexports.UploadError = UploadError;\n/**\nAn error to be thrown when the request is aborted due to a timeout.\nIncludes an `event` and `timings` property.\n*/\nclass TimeoutError extends RequestError {\n constructor(error, timings, request) {\n super(error.message, error, request);\n this.name = 'TimeoutError';\n this.event = error.event;\n this.timings = timings;\n }\n}\nexports.TimeoutError = TimeoutError;\n/**\nAn error to be thrown when reading from response stream fails.\n*/\nclass ReadError extends RequestError {\n constructor(error, request) {\n super(error.message, error, request);\n this.name = 'ReadError';\n this.code = this.code === 'ERR_GOT_REQUEST_ERROR' ? 'ERR_READING_RESPONSE_STREAM' : this.code;\n }\n}\nexports.ReadError = ReadError;\n/**\nAn error to be thrown when given an unsupported protocol.\n*/\nclass UnsupportedProtocolError extends RequestError {\n constructor(options) {\n super(`Unsupported protocol \"${options.url.protocol}\"`, {}, options);\n this.name = 'UnsupportedProtocolError';\n this.code = 'ERR_UNSUPPORTED_PROTOCOL';\n }\n}\nexports.UnsupportedProtocolError = UnsupportedProtocolError;\nconst proxiedRequestEvents = [\n 'socket',\n 'connect',\n 'continue',\n 'information',\n 'upgrade',\n 'timeout'\n];\nclass Request extends stream_1.Duplex {\n constructor(url, options = {}, defaults) {\n super({\n // This must be false, to enable throwing after destroy\n // It is used for retry logic in Promise API\n autoDestroy: false,\n // It needs to be zero because we're just proxying the data to another stream\n highWaterMark: 0\n });\n this[kDownloadedSize] = 0;\n this[kUploadedSize] = 0;\n this.requestInitialized = false;\n this[kServerResponsesPiped] = new Set();\n this.redirects = [];\n this[kStopReading] = false;\n this[kTriggerRead] = false;\n this[kJobs] = [];\n this.retryCount = 0;\n // TODO: Remove this when targeting Node.js >= 12\n this._progressCallbacks = [];\n const unlockWrite = () => this._unlockWrite();\n const lockWrite = () => this._lockWrite();\n this.on('pipe', (source) => {\n source.prependListener('data', unlockWrite);\n source.on('data', lockWrite);\n source.prependListener('end', unlockWrite);\n source.on('end', lockWrite);\n });\n this.on('unpipe', (source) => {\n source.off('data', unlockWrite);\n source.off('data', lockWrite);\n source.off('end', unlockWrite);\n source.off('end', lockWrite);\n });\n this.on('pipe', source => {\n if (source instanceof http_1.IncomingMessage) {\n this.options.headers = {\n ...source.headers,\n ...this.options.headers\n };\n }\n });\n const { json, body, form } = options;\n if (json || body || form) {\n this._lockWrite();\n }\n if (exports.kIsNormalizedAlready in options) {\n this.options = options;\n }\n else {\n try {\n // @ts-expect-error Common TypeScript bug saying that `this.constructor` is not accessible\n this.options = this.constructor.normalizeArguments(url, options, defaults);\n }\n catch (error) {\n // TODO: Move this to `_destroy()`\n if (is_1.default.nodeStream(options.body)) {\n options.body.destroy();\n }\n this.destroy(error);\n return;\n }\n }\n (async () => {\n var _a;\n try {\n if (this.options.body instanceof fs_1.ReadStream) {\n await waitForOpenFile(this.options.body);\n }\n const { url: normalizedURL } = this.options;\n if (!normalizedURL) {\n throw new TypeError('Missing `url` property');\n }\n this.requestUrl = normalizedURL.toString();\n decodeURI(this.requestUrl);\n await this._finalizeBody();\n await this._makeRequest();\n if (this.destroyed) {\n (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroy();\n return;\n }\n // Queued writes etc.\n for (const job of this[kJobs]) {\n job();\n }\n // Prevent memory leak\n this[kJobs].length = 0;\n this.requestInitialized = true;\n }\n catch (error) {\n if (error instanceof RequestError) {\n this._beforeError(error);\n return;\n }\n // This is a workaround for https://github.com/nodejs/node/issues/33335\n if (!this.destroyed) {\n this.destroy(error);\n }\n }\n })();\n }\n static normalizeArguments(url, options, defaults) {\n var _a, _b, _c, _d, _e;\n const rawOptions = options;\n if (is_1.default.object(url) && !is_1.default.urlInstance(url)) {\n options = { ...defaults, ...url, ...options };\n }\n else {\n if (url && options && options.url !== undefined) {\n throw new TypeError('The `url` option is mutually exclusive with the `input` argument');\n }\n options = { ...defaults, ...options };\n if (url !== undefined) {\n options.url = url;\n }\n if (is_1.default.urlInstance(options.url)) {\n options.url = new url_1.URL(options.url.toString());\n }\n }\n // TODO: Deprecate URL options in Got 12.\n // Support extend-specific options\n if (options.cache === false) {\n options.cache = undefined;\n }\n if (options.dnsCache === false) {\n options.dnsCache = undefined;\n }\n // Nice type assertions\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.method);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.headers);\n is_1.assert.any([is_1.default.string, is_1.default.urlInstance, is_1.default.undefined], options.prefixUrl);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.cookieJar);\n is_1.assert.any([is_1.default.object, is_1.default.string, is_1.default.undefined], options.searchParams);\n is_1.assert.any([is_1.default.object, is_1.default.string, is_1.default.undefined], options.cache);\n is_1.assert.any([is_1.default.object, is_1.default.number, is_1.default.undefined], options.timeout);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.context);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.hooks);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.decompress);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.ignoreInvalidCookies);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.followRedirect);\n is_1.assert.any([is_1.default.number, is_1.default.undefined], options.maxRedirects);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.throwHttpErrors);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.http2);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.allowGetBody);\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.localAddress);\n is_1.assert.any([dns_ip_version_1.isDnsLookupIpVersion, is_1.default.undefined], options.dnsLookupIpVersion);\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.https);\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.rejectUnauthorized);\n if (options.https) {\n is_1.assert.any([is_1.default.boolean, is_1.default.undefined], options.https.rejectUnauthorized);\n is_1.assert.any([is_1.default.function_, is_1.default.undefined], options.https.checkServerIdentity);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.certificateAuthority);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.key);\n is_1.assert.any([is_1.default.string, is_1.default.object, is_1.default.array, is_1.default.undefined], options.https.certificate);\n is_1.assert.any([is_1.default.string, is_1.default.undefined], options.https.passphrase);\n is_1.assert.any([is_1.default.string, is_1.default.buffer, is_1.default.array, is_1.default.undefined], options.https.pfx);\n }\n is_1.assert.any([is_1.default.object, is_1.default.undefined], options.cacheOptions);\n // `options.method`\n if (is_1.default.string(options.method)) {\n options.method = options.method.toUpperCase();\n }\n else {\n options.method = 'GET';\n }\n // `options.headers`\n if (options.headers === (defaults === null || defaults === void 0 ? void 0 : defaults.headers)) {\n options.headers = { ...options.headers };\n }\n else {\n options.headers = lowercaseKeys({ ...(defaults === null || defaults === void 0 ? void 0 : defaults.headers), ...options.headers });\n }\n // Disallow legacy `url.Url`\n if ('slashes' in options) {\n throw new TypeError('The legacy `url.Url` has been deprecated. Use `URL` instead.');\n }\n // `options.auth`\n if ('auth' in options) {\n throw new TypeError('Parameter `auth` is deprecated. Use `username` / `password` instead.');\n }\n // `options.searchParams`\n if ('searchParams' in options) {\n if (options.searchParams && options.searchParams !== (defaults === null || defaults === void 0 ? void 0 : defaults.searchParams)) {\n let searchParameters;\n if (is_1.default.string(options.searchParams) || (options.searchParams instanceof url_1.URLSearchParams)) {\n searchParameters = new url_1.URLSearchParams(options.searchParams);\n }\n else {\n validateSearchParameters(options.searchParams);\n searchParameters = new url_1.URLSearchParams();\n // eslint-disable-next-line guard-for-in\n for (const key in options.searchParams) {\n const value = options.searchParams[key];\n if (value === null) {\n searchParameters.append(key, '');\n }\n else if (value !== undefined) {\n searchParameters.append(key, value);\n }\n }\n }\n // `normalizeArguments()` is also used to merge options\n (_a = defaults === null || defaults === void 0 ? void 0 : defaults.searchParams) === null || _a === void 0 ? void 0 : _a.forEach((value, key) => {\n // Only use default if one isn't already defined\n if (!searchParameters.has(key)) {\n searchParameters.append(key, value);\n }\n });\n options.searchParams = searchParameters;\n }\n }\n // `options.username` & `options.password`\n options.username = (_b = options.username) !== null && _b !== void 0 ? _b : '';\n options.password = (_c = options.password) !== null && _c !== void 0 ? _c : '';\n // `options.prefixUrl` & `options.url`\n if (is_1.default.undefined(options.prefixUrl)) {\n options.prefixUrl = (_d = defaults === null || defaults === void 0 ? void 0 : defaults.prefixUrl) !== null && _d !== void 0 ? _d : '';\n }\n else {\n options.prefixUrl = options.prefixUrl.toString();\n if (options.prefixUrl !== '' && !options.prefixUrl.endsWith('/')) {\n options.prefixUrl += '/';\n }\n }\n if (is_1.default.string(options.url)) {\n if (options.url.startsWith('/')) {\n throw new Error('`input` must not start with a slash when using `prefixUrl`');\n }\n options.url = options_to_url_1.default(options.prefixUrl + options.url, options);\n }\n else if ((is_1.default.undefined(options.url) && options.prefixUrl !== '') || options.protocol) {\n options.url = options_to_url_1.default(options.prefixUrl, options);\n }\n if (options.url) {\n if ('port' in options) {\n delete options.port;\n }\n // Make it possible to change `options.prefixUrl`\n let { prefixUrl } = options;\n Object.defineProperty(options, 'prefixUrl', {\n set: (value) => {\n const url = options.url;\n if (!url.href.startsWith(value)) {\n throw new Error(`Cannot change \\`prefixUrl\\` from ${prefixUrl} to ${value}: ${url.href}`);\n }\n options.url = new url_1.URL(value + url.href.slice(prefixUrl.length));\n prefixUrl = value;\n },\n get: () => prefixUrl\n });\n // Support UNIX sockets\n let { protocol } = options.url;\n if (protocol === 'unix:') {\n protocol = 'http:';\n options.url = new url_1.URL(`http://unix${options.url.pathname}${options.url.search}`);\n }\n // Set search params\n if (options.searchParams) {\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n options.url.search = options.searchParams.toString();\n }\n // Protocol check\n if (protocol !== 'http:' && protocol !== 'https:') {\n throw new UnsupportedProtocolError(options);\n }\n // Update `username`\n if (options.username === '') {\n options.username = options.url.username;\n }\n else {\n options.url.username = options.username;\n }\n // Update `password`\n if (options.password === '') {\n options.password = options.url.password;\n }\n else {\n options.url.password = options.password;\n }\n }\n // `options.cookieJar`\n const { cookieJar } = options;\n if (cookieJar) {\n let { setCookie, getCookieString } = cookieJar;\n is_1.assert.function_(setCookie);\n is_1.assert.function_(getCookieString);\n /* istanbul ignore next: Horrible `tough-cookie` v3 check */\n if (setCookie.length === 4 && getCookieString.length === 0) {\n setCookie = util_1.promisify(setCookie.bind(options.cookieJar));\n getCookieString = util_1.promisify(getCookieString.bind(options.cookieJar));\n options.cookieJar = {\n setCookie,\n getCookieString: getCookieString\n };\n }\n }\n // `options.cache`\n const { cache } = options;\n if (cache) {\n if (!cacheableStore.has(cache)) {\n cacheableStore.set(cache, new CacheableRequest(((requestOptions, handler) => {\n const result = requestOptions[kRequest](requestOptions, handler);\n // TODO: remove this when `cacheable-request` supports async request functions.\n if (is_1.default.promise(result)) {\n // @ts-expect-error\n // We only need to implement the error handler in order to support HTTP2 caching.\n // The result will be a promise anyway.\n result.once = (event, handler) => {\n if (event === 'error') {\n result.catch(handler);\n }\n else if (event === 'abort') {\n // The empty catch is needed here in case when\n // it rejects before it's `await`ed in `_makeRequest`.\n (async () => {\n try {\n const request = (await result);\n request.once('abort', handler);\n }\n catch (_a) { }\n })();\n }\n else {\n /* istanbul ignore next: safety check */\n throw new Error(`Unknown HTTP2 promise event: ${event}`);\n }\n return result;\n };\n }\n return result;\n }), cache));\n }\n }\n // `options.cacheOptions`\n options.cacheOptions = { ...options.cacheOptions };\n // `options.dnsCache`\n if (options.dnsCache === true) {\n if (!globalDnsCache) {\n globalDnsCache = new cacheable_lookup_1.default();\n }\n options.dnsCache = globalDnsCache;\n }\n else if (!is_1.default.undefined(options.dnsCache) && !options.dnsCache.lookup) {\n throw new TypeError(`Parameter \\`dnsCache\\` must be a CacheableLookup instance or a boolean, got ${is_1.default(options.dnsCache)}`);\n }\n // `options.timeout`\n if (is_1.default.number(options.timeout)) {\n options.timeout = { request: options.timeout };\n }\n else if (defaults && options.timeout !== defaults.timeout) {\n options.timeout = {\n ...defaults.timeout,\n ...options.timeout\n };\n }\n else {\n options.timeout = { ...options.timeout };\n }\n // `options.context`\n if (!options.context) {\n options.context = {};\n }\n // `options.hooks`\n const areHooksDefault = options.hooks === (defaults === null || defaults === void 0 ? void 0 : defaults.hooks);\n options.hooks = { ...options.hooks };\n for (const event of exports.knownHookEvents) {\n if (event in options.hooks) {\n if (is_1.default.array(options.hooks[event])) {\n // See https://github.com/microsoft/TypeScript/issues/31445#issuecomment-576929044\n options.hooks[event] = [...options.hooks[event]];\n }\n else {\n throw new TypeError(`Parameter \\`${event}\\` must be an Array, got ${is_1.default(options.hooks[event])}`);\n }\n }\n else {\n options.hooks[event] = [];\n }\n }\n if (defaults && !areHooksDefault) {\n for (const event of exports.knownHookEvents) {\n const defaultHooks = defaults.hooks[event];\n if (defaultHooks.length > 0) {\n // See https://github.com/microsoft/TypeScript/issues/31445#issuecomment-576929044\n options.hooks[event] = [\n ...defaults.hooks[event],\n ...options.hooks[event]\n ];\n }\n }\n }\n // DNS options\n if ('family' in options) {\n deprecation_warning_1.default('\"options.family\" was never documented, please use \"options.dnsLookupIpVersion\"');\n }\n // HTTPS options\n if (defaults === null || defaults === void 0 ? void 0 : defaults.https) {\n options.https = { ...defaults.https, ...options.https };\n }\n if ('rejectUnauthorized' in options) {\n deprecation_warning_1.default('\"options.rejectUnauthorized\" is now deprecated, please use \"options.https.rejectUnauthorized\"');\n }\n if ('checkServerIdentity' in options) {\n deprecation_warning_1.default('\"options.checkServerIdentity\" was never documented, please use \"options.https.checkServerIdentity\"');\n }\n if ('ca' in options) {\n deprecation_warning_1.default('\"options.ca\" was never documented, please use \"options.https.certificateAuthority\"');\n }\n if ('key' in options) {\n deprecation_warning_1.default('\"options.key\" was never documented, please use \"options.https.key\"');\n }\n if ('cert' in options) {\n deprecation_warning_1.default('\"options.cert\" was never documented, please use \"options.https.certificate\"');\n }\n if ('passphrase' in options) {\n deprecation_warning_1.default('\"options.passphrase\" was never documented, please use \"options.https.passphrase\"');\n }\n if ('pfx' in options) {\n deprecation_warning_1.default('\"options.pfx\" was never documented, please use \"options.https.pfx\"');\n }\n // Other options\n if ('followRedirects' in options) {\n throw new TypeError('The `followRedirects` option does not exist. Use `followRedirect` instead.');\n }\n if (options.agent) {\n for (const key in options.agent) {\n if (key !== 'http' && key !== 'https' && key !== 'http2') {\n throw new TypeError(`Expected the \\`options.agent\\` properties to be \\`http\\`, \\`https\\` or \\`http2\\`, got \\`${key}\\``);\n }\n }\n }\n options.maxRedirects = (_e = options.maxRedirects) !== null && _e !== void 0 ? _e : 0;\n // Set non-enumerable properties\n exports.setNonEnumerableProperties([defaults, rawOptions], options);\n return normalize_arguments_1.default(options, defaults);\n }\n _lockWrite() {\n const onLockedWrite = () => {\n throw new TypeError('The payload has been already provided');\n };\n this.write = onLockedWrite;\n this.end = onLockedWrite;\n }\n _unlockWrite() {\n this.write = super.write;\n this.end = super.end;\n }\n async _finalizeBody() {\n const { options } = this;\n const { headers } = options;\n const isForm = !is_1.default.undefined(options.form);\n const isJSON = !is_1.default.undefined(options.json);\n const isBody = !is_1.default.undefined(options.body);\n const hasPayload = isForm || isJSON || isBody;\n const cannotHaveBody = exports.withoutBody.has(options.method) && !(options.method === 'GET' && options.allowGetBody);\n this._cannotHaveBody = cannotHaveBody;\n if (hasPayload) {\n if (cannotHaveBody) {\n throw new TypeError(`The \\`${options.method}\\` method cannot be used with a body`);\n }\n if ([isBody, isForm, isJSON].filter(isTrue => isTrue).length > 1) {\n throw new TypeError('The `body`, `json` and `form` options are mutually exclusive');\n }\n if (isBody &&\n !(options.body instanceof stream_1.Readable) &&\n !is_1.default.string(options.body) &&\n !is_1.default.buffer(options.body) &&\n !is_form_data_1.default(options.body)) {\n throw new TypeError('The `body` option must be a stream.Readable, string or Buffer');\n }\n if (isForm && !is_1.default.object(options.form)) {\n throw new TypeError('The `form` option must be an Object');\n }\n {\n // Serialize body\n const noContentType = !is_1.default.string(headers['content-type']);\n if (isBody) {\n // Special case for https://github.com/form-data/form-data\n if (is_form_data_1.default(options.body) && noContentType) {\n headers['content-type'] = `multipart/form-data; boundary=${options.body.getBoundary()}`;\n }\n this[kBody] = options.body;\n }\n else if (isForm) {\n if (noContentType) {\n headers['content-type'] = 'application/x-www-form-urlencoded';\n }\n this[kBody] = (new url_1.URLSearchParams(options.form)).toString();\n }\n else {\n if (noContentType) {\n headers['content-type'] = 'application/json';\n }\n this[kBody] = options.stringifyJson(options.json);\n }\n const uploadBodySize = await get_body_size_1.default(this[kBody], options.headers);\n // See https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD send a Content-Length in a request message when\n // no Transfer-Encoding is sent and the request method defines a meaning\n // for an enclosed payload body. For example, a Content-Length header\n // field is normally sent in a POST request even when the value is 0\n // (indicating an empty payload body). A user agent SHOULD NOT send a\n // Content-Length header field when the request message does not contain\n // a payload body and the method semantics do not anticipate such a\n // body.\n if (is_1.default.undefined(headers['content-length']) && is_1.default.undefined(headers['transfer-encoding'])) {\n if (!cannotHaveBody && !is_1.default.undefined(uploadBodySize)) {\n headers['content-length'] = String(uploadBodySize);\n }\n }\n }\n }\n else if (cannotHaveBody) {\n this._lockWrite();\n }\n else {\n this._unlockWrite();\n }\n this[kBodySize] = Number(headers['content-length']) || undefined;\n }\n async _onResponseBase(response) {\n const { options } = this;\n const { url } = options;\n this[kOriginalResponse] = response;\n if (options.decompress) {\n response = decompressResponse(response);\n }\n const statusCode = response.statusCode;\n const typedResponse = response;\n typedResponse.statusMessage = typedResponse.statusMessage ? typedResponse.statusMessage : http.STATUS_CODES[statusCode];\n typedResponse.url = options.url.toString();\n typedResponse.requestUrl = this.requestUrl;\n typedResponse.redirectUrls = this.redirects;\n typedResponse.request = this;\n typedResponse.isFromCache = response.fromCache || false;\n typedResponse.ip = this.ip;\n typedResponse.retryCount = this.retryCount;\n this[kIsFromCache] = typedResponse.isFromCache;\n this[kResponseSize] = Number(response.headers['content-length']) || undefined;\n this[kResponse] = response;\n response.once('end', () => {\n this[kResponseSize] = this[kDownloadedSize];\n this.emit('downloadProgress', this.downloadProgress);\n });\n response.once('error', (error) => {\n // Force clean-up, because some packages don't do this.\n // TODO: Fix decompress-response\n response.destroy();\n this._beforeError(new ReadError(error, this));\n });\n response.once('aborted', () => {\n this._beforeError(new ReadError({\n name: 'Error',\n message: 'The server aborted pending request',\n code: 'ECONNRESET'\n }, this));\n });\n this.emit('downloadProgress', this.downloadProgress);\n const rawCookies = response.headers['set-cookie'];\n if (is_1.default.object(options.cookieJar) && rawCookies) {\n let promises = rawCookies.map(async (rawCookie) => options.cookieJar.setCookie(rawCookie, url.toString()));\n if (options.ignoreInvalidCookies) {\n promises = promises.map(async (p) => p.catch(() => { }));\n }\n try {\n await Promise.all(promises);\n }\n catch (error) {\n this._beforeError(error);\n return;\n }\n }\n if (options.followRedirect && response.headers.location && redirectCodes.has(statusCode)) {\n // We're being redirected, we don't care about the response.\n // It'd be best to abort the request, but we can't because\n // we would have to sacrifice the TCP connection. We don't want that.\n response.resume();\n if (this[kRequest]) {\n this[kCancelTimeouts]();\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this[kRequest];\n this[kUnproxyEvents]();\n }\n const shouldBeGet = statusCode === 303 && options.method !== 'GET' && options.method !== 'HEAD';\n if (shouldBeGet || !options.methodRewriting) {\n // Server responded with \"see other\", indicating that the resource exists at another location,\n // and the client should request it from that location via GET or HEAD.\n options.method = 'GET';\n if ('body' in options) {\n delete options.body;\n }\n if ('json' in options) {\n delete options.json;\n }\n if ('form' in options) {\n delete options.form;\n }\n this[kBody] = undefined;\n delete options.headers['content-length'];\n }\n if (this.redirects.length >= options.maxRedirects) {\n this._beforeError(new MaxRedirectsError(this));\n return;\n }\n try {\n // Do not remove. See https://github.com/sindresorhus/got/pull/214\n const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString();\n // Handles invalid URLs. See https://github.com/sindresorhus/got/issues/604\n const redirectUrl = new url_1.URL(redirectBuffer, url);\n const redirectString = redirectUrl.toString();\n decodeURI(redirectString);\n // eslint-disable-next-line no-inner-declarations\n function isUnixSocketURL(url) {\n return url.protocol === 'unix:' || url.hostname === 'unix';\n }\n if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) {\n this._beforeError(new RequestError('Cannot redirect to UNIX socket', {}, this));\n return;\n }\n // Redirecting to a different site, clear sensitive data.\n if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) {\n if ('host' in options.headers) {\n delete options.headers.host;\n }\n if ('cookie' in options.headers) {\n delete options.headers.cookie;\n }\n if ('authorization' in options.headers) {\n delete options.headers.authorization;\n }\n if (options.username || options.password) {\n options.username = '';\n options.password = '';\n }\n }\n else {\n redirectUrl.username = options.username;\n redirectUrl.password = options.password;\n }\n this.redirects.push(redirectString);\n options.url = redirectUrl;\n for (const hook of options.hooks.beforeRedirect) {\n // eslint-disable-next-line no-await-in-loop\n await hook(options, typedResponse);\n }\n this.emit('redirect', typedResponse, options);\n await this._makeRequest();\n }\n catch (error) {\n this._beforeError(error);\n return;\n }\n return;\n }\n if (options.isStream && options.throwHttpErrors && !is_response_ok_1.isResponseOk(typedResponse)) {\n this._beforeError(new HTTPError(typedResponse));\n return;\n }\n response.on('readable', () => {\n if (this[kTriggerRead]) {\n this._read();\n }\n });\n this.on('resume', () => {\n response.resume();\n });\n this.on('pause', () => {\n response.pause();\n });\n response.once('end', () => {\n this.push(null);\n });\n this.emit('response', response);\n for (const destination of this[kServerResponsesPiped]) {\n if (destination.headersSent) {\n continue;\n }\n // eslint-disable-next-line guard-for-in\n for (const key in response.headers) {\n const isAllowed = options.decompress ? key !== 'content-encoding' : true;\n const value = response.headers[key];\n if (isAllowed) {\n destination.setHeader(key, value);\n }\n }\n destination.statusCode = statusCode;\n }\n }\n async _onResponse(response) {\n try {\n await this._onResponseBase(response);\n }\n catch (error) {\n /* istanbul ignore next: better safe than sorry */\n this._beforeError(error);\n }\n }\n _onRequest(request) {\n const { options } = this;\n const { timeout, url } = options;\n http_timer_1.default(request);\n this[kCancelTimeouts] = timed_out_1.default(request, timeout, url);\n const responseEventName = options.cache ? 'cacheableResponse' : 'response';\n request.once(responseEventName, (response) => {\n void this._onResponse(response);\n });\n request.once('error', (error) => {\n var _a;\n // Force clean-up, because some packages (e.g. nock) don't do this.\n request.destroy();\n // Node.js <= 12.18.2 mistakenly emits the response `end` first.\n (_a = request.res) === null || _a === void 0 ? void 0 : _a.removeAllListeners('end');\n error = error instanceof timed_out_1.TimeoutError ? new TimeoutError(error, this.timings, this) : new RequestError(error.message, error, this);\n this._beforeError(error);\n });\n this[kUnproxyEvents] = proxy_events_1.default(request, this, proxiedRequestEvents);\n this[kRequest] = request;\n this.emit('uploadProgress', this.uploadProgress);\n // Send body\n const body = this[kBody];\n const currentRequest = this.redirects.length === 0 ? this : request;\n if (is_1.default.nodeStream(body)) {\n body.pipe(currentRequest);\n body.once('error', (error) => {\n this._beforeError(new UploadError(error, this));\n });\n }\n else {\n this._unlockWrite();\n if (!is_1.default.undefined(body)) {\n this._writeRequest(body, undefined, () => { });\n currentRequest.end();\n this._lockWrite();\n }\n else if (this._cannotHaveBody || this._noPipe) {\n currentRequest.end();\n this._lockWrite();\n }\n }\n this.emit('request', request);\n }\n async _createCacheableRequest(url, options) {\n return new Promise((resolve, reject) => {\n // TODO: Remove `utils/url-to-options.ts` when `cacheable-request` is fixed\n Object.assign(options, url_to_options_1.default(url));\n // `http-cache-semantics` checks this\n // TODO: Fix this ignore.\n // @ts-expect-error\n delete options.url;\n let request;\n // This is ugly\n const cacheRequest = cacheableStore.get(options.cache)(options, async (response) => {\n // TODO: Fix `cacheable-response`\n response._readableState.autoDestroy = false;\n if (request) {\n (await request).emit('cacheableResponse', response);\n }\n resolve(response);\n });\n // Restore options\n options.url = url;\n cacheRequest.once('error', reject);\n cacheRequest.once('request', async (requestOrPromise) => {\n request = requestOrPromise;\n resolve(request);\n });\n });\n }\n async _makeRequest() {\n var _a, _b, _c, _d, _e;\n const { options } = this;\n const { headers } = options;\n for (const key in headers) {\n if (is_1.default.undefined(headers[key])) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete headers[key];\n }\n else if (is_1.default.null_(headers[key])) {\n throw new TypeError(`Use \\`undefined\\` instead of \\`null\\` to delete the \\`${key}\\` header`);\n }\n }\n if (options.decompress && is_1.default.undefined(headers['accept-encoding'])) {\n headers['accept-encoding'] = supportsBrotli ? 'gzip, deflate, br' : 'gzip, deflate';\n }\n // Set cookies\n if (options.cookieJar) {\n const cookieString = await options.cookieJar.getCookieString(options.url.toString());\n if (is_1.default.nonEmptyString(cookieString)) {\n options.headers.cookie = cookieString;\n }\n }\n for (const hook of options.hooks.beforeRequest) {\n // eslint-disable-next-line no-await-in-loop\n const result = await hook(options);\n if (!is_1.default.undefined(result)) {\n // @ts-expect-error Skip the type mismatch to support abstract responses\n options.request = () => result;\n break;\n }\n }\n if (options.body && this[kBody] !== options.body) {\n this[kBody] = options.body;\n }\n const { agent, request, timeout, url } = options;\n if (options.dnsCache && !('lookup' in options)) {\n options.lookup = options.dnsCache.lookup;\n }\n // UNIX sockets\n if (url.hostname === 'unix') {\n const matches = /(?.+?):(?.+)/.exec(`${url.pathname}${url.search}`);\n if (matches === null || matches === void 0 ? void 0 : matches.groups) {\n const { socketPath, path } = matches.groups;\n Object.assign(options, {\n socketPath,\n path,\n host: ''\n });\n }\n }\n const isHttps = url.protocol === 'https:';\n // Fallback function\n let fallbackFn;\n if (options.http2) {\n fallbackFn = http2wrapper.auto;\n }\n else {\n fallbackFn = isHttps ? https.request : http.request;\n }\n const realFn = (_a = options.request) !== null && _a !== void 0 ? _a : fallbackFn;\n // Cache support\n const fn = options.cache ? this._createCacheableRequest : realFn;\n // Pass an agent directly when HTTP2 is disabled\n if (agent && !options.http2) {\n options.agent = agent[isHttps ? 'https' : 'http'];\n }\n // Prepare plain HTTP request options\n options[kRequest] = realFn;\n delete options.request;\n // TODO: Fix this ignore.\n // @ts-expect-error\n delete options.timeout;\n const requestOptions = options;\n requestOptions.shared = (_b = options.cacheOptions) === null || _b === void 0 ? void 0 : _b.shared;\n requestOptions.cacheHeuristic = (_c = options.cacheOptions) === null || _c === void 0 ? void 0 : _c.cacheHeuristic;\n requestOptions.immutableMinTimeToLive = (_d = options.cacheOptions) === null || _d === void 0 ? void 0 : _d.immutableMinTimeToLive;\n requestOptions.ignoreCargoCult = (_e = options.cacheOptions) === null || _e === void 0 ? void 0 : _e.ignoreCargoCult;\n // If `dnsLookupIpVersion` is not present do not override `family`\n if (options.dnsLookupIpVersion !== undefined) {\n try {\n requestOptions.family = dns_ip_version_1.dnsLookupIpVersionToFamily(options.dnsLookupIpVersion);\n }\n catch (_f) {\n throw new Error('Invalid `dnsLookupIpVersion` option value');\n }\n }\n // HTTPS options remapping\n if (options.https) {\n if ('rejectUnauthorized' in options.https) {\n requestOptions.rejectUnauthorized = options.https.rejectUnauthorized;\n }\n if (options.https.checkServerIdentity) {\n requestOptions.checkServerIdentity = options.https.checkServerIdentity;\n }\n if (options.https.certificateAuthority) {\n requestOptions.ca = options.https.certificateAuthority;\n }\n if (options.https.certificate) {\n requestOptions.cert = options.https.certificate;\n }\n if (options.https.key) {\n requestOptions.key = options.https.key;\n }\n if (options.https.passphrase) {\n requestOptions.passphrase = options.https.passphrase;\n }\n if (options.https.pfx) {\n requestOptions.pfx = options.https.pfx;\n }\n }\n try {\n let requestOrResponse = await fn(url, requestOptions);\n if (is_1.default.undefined(requestOrResponse)) {\n requestOrResponse = fallbackFn(url, requestOptions);\n }\n // Restore options\n options.request = request;\n options.timeout = timeout;\n options.agent = agent;\n // HTTPS options restore\n if (options.https) {\n if ('rejectUnauthorized' in options.https) {\n delete requestOptions.rejectUnauthorized;\n }\n if (options.https.checkServerIdentity) {\n // @ts-expect-error - This one will be removed when we remove the alias.\n delete requestOptions.checkServerIdentity;\n }\n if (options.https.certificateAuthority) {\n delete requestOptions.ca;\n }\n if (options.https.certificate) {\n delete requestOptions.cert;\n }\n if (options.https.key) {\n delete requestOptions.key;\n }\n if (options.https.passphrase) {\n delete requestOptions.passphrase;\n }\n if (options.https.pfx) {\n delete requestOptions.pfx;\n }\n }\n if (isClientRequest(requestOrResponse)) {\n this._onRequest(requestOrResponse);\n // Emit the response after the stream has been ended\n }\n else if (this.writable) {\n this.once('finish', () => {\n void this._onResponse(requestOrResponse);\n });\n this._unlockWrite();\n this.end();\n this._lockWrite();\n }\n else {\n void this._onResponse(requestOrResponse);\n }\n }\n catch (error) {\n if (error instanceof CacheableRequest.CacheError) {\n throw new CacheError(error, this);\n }\n throw new RequestError(error.message, error, this);\n }\n }\n async _error(error) {\n try {\n for (const hook of this.options.hooks.beforeError) {\n // eslint-disable-next-line no-await-in-loop\n error = await hook(error);\n }\n }\n catch (error_) {\n error = new RequestError(error_.message, error_, this);\n }\n this.destroy(error);\n }\n _beforeError(error) {\n if (this[kStopReading]) {\n return;\n }\n const { options } = this;\n const retryCount = this.retryCount + 1;\n this[kStopReading] = true;\n if (!(error instanceof RequestError)) {\n error = new RequestError(error.message, error, this);\n }\n const typedError = error;\n const { response } = typedError;\n void (async () => {\n if (response && !response.body) {\n response.setEncoding(this._readableState.encoding);\n try {\n response.rawBody = await get_buffer_1.default(response);\n response.body = response.rawBody.toString();\n }\n catch (_a) { }\n }\n if (this.listenerCount('retry') !== 0) {\n let backoff;\n try {\n let retryAfter;\n if (response && 'retry-after' in response.headers) {\n retryAfter = Number(response.headers['retry-after']);\n if (Number.isNaN(retryAfter)) {\n retryAfter = Date.parse(response.headers['retry-after']) - Date.now();\n if (retryAfter <= 0) {\n retryAfter = 1;\n }\n }\n else {\n retryAfter *= 1000;\n }\n }\n backoff = await options.retry.calculateDelay({\n attemptCount: retryCount,\n retryOptions: options.retry,\n error: typedError,\n retryAfter,\n computedValue: calculate_retry_delay_1.default({\n attemptCount: retryCount,\n retryOptions: options.retry,\n error: typedError,\n retryAfter,\n computedValue: 0\n })\n });\n }\n catch (error_) {\n void this._error(new RequestError(error_.message, error_, this));\n return;\n }\n if (backoff) {\n const retry = async () => {\n try {\n for (const hook of this.options.hooks.beforeRetry) {\n // eslint-disable-next-line no-await-in-loop\n await hook(this.options, typedError, retryCount);\n }\n }\n catch (error_) {\n void this._error(new RequestError(error_.message, error, this));\n return;\n }\n // Something forced us to abort the retry\n if (this.destroyed) {\n return;\n }\n this.destroy();\n this.emit('retry', retryCount, error);\n };\n this[kRetryTimeout] = setTimeout(retry, backoff);\n return;\n }\n }\n void this._error(typedError);\n })();\n }\n _read() {\n this[kTriggerRead] = true;\n const response = this[kResponse];\n if (response && !this[kStopReading]) {\n // We cannot put this in the `if` above\n // because `.read()` also triggers the `end` event\n if (response.readableLength) {\n this[kTriggerRead] = false;\n }\n let data;\n while ((data = response.read()) !== null) {\n this[kDownloadedSize] += data.length;\n this[kStartedReading] = true;\n const progress = this.downloadProgress;\n if (progress.percent < 1) {\n this.emit('downloadProgress', progress);\n }\n this.push(data);\n }\n }\n }\n // Node.js 12 has incorrect types, so the encoding must be a string\n _write(chunk, encoding, callback) {\n const write = () => {\n this._writeRequest(chunk, encoding, callback);\n };\n if (this.requestInitialized) {\n write();\n }\n else {\n this[kJobs].push(write);\n }\n }\n _writeRequest(chunk, encoding, callback) {\n if (this[kRequest].destroyed) {\n // Probably the `ClientRequest` instance will throw\n return;\n }\n this._progressCallbacks.push(() => {\n this[kUploadedSize] += Buffer.byteLength(chunk, encoding);\n const progress = this.uploadProgress;\n if (progress.percent < 1) {\n this.emit('uploadProgress', progress);\n }\n });\n // TODO: What happens if it's from cache? Then this[kRequest] won't be defined.\n this[kRequest].write(chunk, encoding, (error) => {\n if (!error && this._progressCallbacks.length > 0) {\n this._progressCallbacks.shift()();\n }\n callback(error);\n });\n }\n _final(callback) {\n const endRequest = () => {\n // FIX: Node.js 10 calls the write callback AFTER the end callback!\n while (this._progressCallbacks.length !== 0) {\n this._progressCallbacks.shift()();\n }\n // We need to check if `this[kRequest]` is present,\n // because it isn't when we use cache.\n if (!(kRequest in this)) {\n callback();\n return;\n }\n if (this[kRequest].destroyed) {\n callback();\n return;\n }\n this[kRequest].end((error) => {\n if (!error) {\n this[kBodySize] = this[kUploadedSize];\n this.emit('uploadProgress', this.uploadProgress);\n this[kRequest].emit('upload-complete');\n }\n callback(error);\n });\n };\n if (this.requestInitialized) {\n endRequest();\n }\n else {\n this[kJobs].push(endRequest);\n }\n }\n _destroy(error, callback) {\n var _a;\n this[kStopReading] = true;\n // Prevent further retries\n clearTimeout(this[kRetryTimeout]);\n if (kRequest in this) {\n this[kCancelTimeouts]();\n // TODO: Remove the next `if` when these get fixed:\n // - https://github.com/nodejs/node/issues/32851\n if (!((_a = this[kResponse]) === null || _a === void 0 ? void 0 : _a.complete)) {\n this[kRequest].destroy();\n }\n }\n if (error !== null && !is_1.default.undefined(error) && !(error instanceof RequestError)) {\n error = new RequestError(error.message, error, this);\n }\n callback(error);\n }\n get _isAboutToError() {\n return this[kStopReading];\n }\n /**\n The remote IP address.\n */\n get ip() {\n var _a;\n return (_a = this.socket) === null || _a === void 0 ? void 0 : _a.remoteAddress;\n }\n /**\n Indicates whether the request has been aborted or not.\n */\n get aborted() {\n var _a, _b, _c;\n return ((_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.destroyed) !== null && _b !== void 0 ? _b : this.destroyed) && !((_c = this[kOriginalResponse]) === null || _c === void 0 ? void 0 : _c.complete);\n }\n get socket() {\n var _a, _b;\n return (_b = (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.socket) !== null && _b !== void 0 ? _b : undefined;\n }\n /**\n Progress event for downloading (receiving a response).\n */\n get downloadProgress() {\n let percent;\n if (this[kResponseSize]) {\n percent = this[kDownloadedSize] / this[kResponseSize];\n }\n else if (this[kResponseSize] === this[kDownloadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kDownloadedSize],\n total: this[kResponseSize]\n };\n }\n /**\n Progress event for uploading (sending a request).\n */\n get uploadProgress() {\n let percent;\n if (this[kBodySize]) {\n percent = this[kUploadedSize] / this[kBodySize];\n }\n else if (this[kBodySize] === this[kUploadedSize]) {\n percent = 1;\n }\n else {\n percent = 0;\n }\n return {\n percent,\n transferred: this[kUploadedSize],\n total: this[kBodySize]\n };\n }\n /**\n The object contains the following properties:\n\n - `start` - Time when the request started.\n - `socket` - Time when a socket was assigned to the request.\n - `lookup` - Time when the DNS lookup finished.\n - `connect` - Time when the socket successfully connected.\n - `secureConnect` - Time when the socket securely connected.\n - `upload` - Time when the request finished uploading.\n - `response` - Time when the request fired `response` event.\n - `end` - Time when the response fired `end` event.\n - `error` - Time when the request fired `error` event.\n - `abort` - Time when the request fired `abort` event.\n - `phases`\n - `wait` - `timings.socket - timings.start`\n - `dns` - `timings.lookup - timings.socket`\n - `tcp` - `timings.connect - timings.lookup`\n - `tls` - `timings.secureConnect - timings.connect`\n - `request` - `timings.upload - (timings.secureConnect || timings.connect)`\n - `firstByte` - `timings.response - timings.upload`\n - `download` - `timings.end - timings.response`\n - `total` - `(timings.end || timings.error || timings.abort) - timings.start`\n\n If something has not been measured yet, it will be `undefined`.\n\n __Note__: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.\n */\n get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings;\n }\n /**\n Whether the response was retrieved from the cache.\n */\n get isFromCache() {\n return this[kIsFromCache];\n }\n pipe(destination, options) {\n if (this[kStartedReading]) {\n throw new Error('Failed to pipe. The response has been emitted already.');\n }\n if (destination instanceof http_1.ServerResponse) {\n this[kServerResponsesPiped].add(destination);\n }\n return super.pipe(destination, options);\n }\n unpipe(destination) {\n if (destination instanceof http_1.ServerResponse) {\n this[kServerResponsesPiped].delete(destination);\n }\n super.unpipe(destination);\n return this;\n }\n}\nexports.default = Request;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.dnsLookupIpVersionToFamily = exports.isDnsLookupIpVersion = void 0;\nconst conversionTable = {\n auto: 0,\n ipv4: 4,\n ipv6: 6\n};\nexports.isDnsLookupIpVersion = (value) => {\n return value in conversionTable;\n};\nexports.dnsLookupIpVersionToFamily = (dnsLookupIpVersion) => {\n if (exports.isDnsLookupIpVersion(dnsLookupIpVersion)) {\n return conversionTable[dnsLookupIpVersion];\n }\n throw new Error('Invalid DNS lookup IP version');\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst fs_1 = require(\"fs\");\nconst util_1 = require(\"util\");\nconst is_1 = require(\"@sindresorhus/is\");\nconst is_form_data_1 = require(\"./is-form-data\");\nconst statAsync = util_1.promisify(fs_1.stat);\nexports.default = async (body, headers) => {\n if (headers && 'content-length' in headers) {\n return Number(headers['content-length']);\n }\n if (!body) {\n return 0;\n }\n if (is_1.default.string(body)) {\n return Buffer.byteLength(body);\n }\n if (is_1.default.buffer(body)) {\n return body.length;\n }\n if (is_form_data_1.default(body)) {\n return util_1.promisify(body.getLength.bind(body))();\n }\n if (body instanceof fs_1.ReadStream) {\n const { size } = await statAsync(body.path);\n if (size === 0) {\n return undefined;\n }\n return size;\n }\n return undefined;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// TODO: Update https://github.com/sindresorhus/get-stream\nconst getBuffer = async (stream) => {\n const chunks = [];\n let length = 0;\n for await (const chunk of stream) {\n chunks.push(chunk);\n length += Buffer.byteLength(chunk);\n }\n if (Buffer.isBuffer(chunks[0])) {\n return Buffer.concat(chunks, length);\n }\n return Buffer.from(chunks.join(''));\n};\nexports.default = getBuffer;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst is_1 = require(\"@sindresorhus/is\");\nexports.default = (body) => is_1.default.nodeStream(body) && is_1.default.function_(body.getBoundary);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isResponseOk = void 0;\nexports.isResponseOk = (response) => {\n const { statusCode } = response;\n const limitStatusCode = response.request.options.followRedirect ? 299 : 399;\n return (statusCode >= 200 && statusCode <= limitStatusCode) || statusCode === 304;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/* istanbul ignore file: deprecated */\nconst url_1 = require(\"url\");\nconst keys = [\n 'protocol',\n 'host',\n 'hostname',\n 'port',\n 'pathname',\n 'search'\n];\nexports.default = (origin, options) => {\n var _a, _b;\n if (options.path) {\n if (options.pathname) {\n throw new TypeError('Parameters `path` and `pathname` are mutually exclusive.');\n }\n if (options.search) {\n throw new TypeError('Parameters `path` and `search` are mutually exclusive.');\n }\n if (options.searchParams) {\n throw new TypeError('Parameters `path` and `searchParams` are mutually exclusive.');\n }\n }\n if (options.search && options.searchParams) {\n throw new TypeError('Parameters `search` and `searchParams` are mutually exclusive.');\n }\n if (!origin) {\n if (!options.protocol) {\n throw new TypeError('No URL protocol specified');\n }\n origin = `${options.protocol}//${(_b = (_a = options.hostname) !== null && _a !== void 0 ? _a : options.host) !== null && _b !== void 0 ? _b : ''}`;\n }\n const url = new url_1.URL(origin);\n if (options.path) {\n const searchIndex = options.path.indexOf('?');\n if (searchIndex === -1) {\n options.pathname = options.path;\n }\n else {\n options.pathname = options.path.slice(0, searchIndex);\n options.search = options.path.slice(searchIndex + 1);\n }\n delete options.path;\n }\n for (const key of keys) {\n if (options[key]) {\n url[key] = options[key].toString();\n }\n }\n return url;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction default_1(from, to, events) {\n const fns = {};\n for (const event of events) {\n fns[event] = (...args) => {\n to.emit(event, ...args);\n };\n from.on(event, fns[event]);\n }\n return () => {\n for (const event of events) {\n from.off(event, fns[event]);\n }\n };\n}\nexports.default = default_1;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TimeoutError = void 0;\nconst net = require(\"net\");\nconst unhandle_1 = require(\"./unhandle\");\nconst reentry = Symbol('reentry');\nconst noop = () => { };\nclass TimeoutError extends Error {\n constructor(threshold, event) {\n super(`Timeout awaiting '${event}' for ${threshold}ms`);\n this.event = event;\n this.name = 'TimeoutError';\n this.code = 'ETIMEDOUT';\n }\n}\nexports.TimeoutError = TimeoutError;\nexports.default = (request, delays, options) => {\n if (reentry in request) {\n return noop;\n }\n request[reentry] = true;\n const cancelers = [];\n const { once, unhandleAll } = unhandle_1.default();\n const addTimeout = (delay, callback, event) => {\n var _a;\n const timeout = setTimeout(callback, delay, delay, event);\n (_a = timeout.unref) === null || _a === void 0 ? void 0 : _a.call(timeout);\n const cancel = () => {\n clearTimeout(timeout);\n };\n cancelers.push(cancel);\n return cancel;\n };\n const { host, hostname } = options;\n const timeoutHandler = (delay, event) => {\n request.destroy(new TimeoutError(delay, event));\n };\n const cancelTimeouts = () => {\n for (const cancel of cancelers) {\n cancel();\n }\n unhandleAll();\n };\n request.once('error', error => {\n cancelTimeouts();\n // Save original behavior\n /* istanbul ignore next */\n if (request.listenerCount('error') === 0) {\n throw error;\n }\n });\n request.once('close', cancelTimeouts);\n once(request, 'response', (response) => {\n once(response, 'end', cancelTimeouts);\n });\n if (typeof delays.request !== 'undefined') {\n addTimeout(delays.request, timeoutHandler, 'request');\n }\n if (typeof delays.socket !== 'undefined') {\n const socketTimeoutHandler = () => {\n timeoutHandler(delays.socket, 'socket');\n };\n request.setTimeout(delays.socket, socketTimeoutHandler);\n // `request.setTimeout(0)` causes a memory leak.\n // We can just remove the listener and forget about the timer - it's unreffed.\n // See https://github.com/sindresorhus/got/issues/690\n cancelers.push(() => {\n request.removeListener('timeout', socketTimeoutHandler);\n });\n }\n once(request, 'socket', (socket) => {\n var _a;\n const { socketPath } = request;\n /* istanbul ignore next: hard to test */\n if (socket.connecting) {\n const hasPath = Boolean(socketPath !== null && socketPath !== void 0 ? socketPath : net.isIP((_a = hostname !== null && hostname !== void 0 ? hostname : host) !== null && _a !== void 0 ? _a : '') !== 0);\n if (typeof delays.lookup !== 'undefined' && !hasPath && typeof socket.address().address === 'undefined') {\n const cancelTimeout = addTimeout(delays.lookup, timeoutHandler, 'lookup');\n once(socket, 'lookup', cancelTimeout);\n }\n if (typeof delays.connect !== 'undefined') {\n const timeConnect = () => addTimeout(delays.connect, timeoutHandler, 'connect');\n if (hasPath) {\n once(socket, 'connect', timeConnect());\n }\n else {\n once(socket, 'lookup', (error) => {\n if (error === null) {\n once(socket, 'connect', timeConnect());\n }\n });\n }\n }\n if (typeof delays.secureConnect !== 'undefined' && options.protocol === 'https:') {\n once(socket, 'connect', () => {\n const cancelTimeout = addTimeout(delays.secureConnect, timeoutHandler, 'secureConnect');\n once(socket, 'secureConnect', cancelTimeout);\n });\n }\n }\n if (typeof delays.send !== 'undefined') {\n const timeRequest = () => addTimeout(delays.send, timeoutHandler, 'send');\n /* istanbul ignore next: hard to test */\n if (socket.connecting) {\n once(socket, 'connect', () => {\n once(request, 'upload-complete', timeRequest());\n });\n }\n else {\n once(request, 'upload-complete', timeRequest());\n }\n }\n });\n if (typeof delays.response !== 'undefined') {\n once(request, 'upload-complete', () => {\n const cancelTimeout = addTimeout(delays.response, timeoutHandler, 'response');\n once(request, 'response', cancelTimeout);\n });\n }\n return cancelTimeouts;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// When attaching listeners, it's very easy to forget about them.\n// Especially if you do error handling and set timeouts.\n// So instead of checking if it's proper to throw an error on every timeout ever,\n// use this simple tool which will remove all listeners you have attached.\nexports.default = () => {\n const handlers = [];\n return {\n once(origin, event, fn) {\n origin.once(event, fn);\n handlers.push({ origin, event, fn });\n },\n unhandleAll() {\n for (const handler of handlers) {\n const { origin, event, fn } = handler;\n origin.removeListener(event, fn);\n }\n handlers.length = 0;\n }\n };\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst is_1 = require(\"@sindresorhus/is\");\nexports.default = (url) => {\n // Cast to URL\n url = url;\n const options = {\n protocol: url.protocol,\n hostname: is_1.default.string(url.hostname) && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,\n host: url.host,\n hash: url.hash,\n search: url.search,\n pathname: url.pathname,\n href: url.href,\n path: `${url.pathname || ''}${url.search || ''}`\n };\n if (is_1.default.string(url.port) && url.port.length > 0) {\n options.port = Number(url.port);\n }\n if (url.username || url.password) {\n options.auth = `${url.username || ''}:${url.password || ''}`;\n }\n return options;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass WeakableMap {\n constructor() {\n this.weakMap = new WeakMap();\n this.map = new Map();\n }\n set(key, value) {\n if (typeof key === 'object') {\n this.weakMap.set(key, value);\n }\n else {\n this.map.set(key, value);\n }\n }\n get(key) {\n if (typeof key === 'object') {\n return this.weakMap.get(key);\n }\n return this.map.get(key);\n }\n has(key) {\n if (typeof key === 'object') {\n return this.weakMap.has(key);\n }\n return this.map.has(key);\n }\n}\nexports.default = WeakableMap;\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.defaultHandler = void 0;\nconst is_1 = require(\"@sindresorhus/is\");\nconst as_promise_1 = require(\"./as-promise\");\nconst create_rejection_1 = require(\"./as-promise/create-rejection\");\nconst core_1 = require(\"./core\");\nconst deep_freeze_1 = require(\"./utils/deep-freeze\");\nconst errors = {\n RequestError: as_promise_1.RequestError,\n CacheError: as_promise_1.CacheError,\n ReadError: as_promise_1.ReadError,\n HTTPError: as_promise_1.HTTPError,\n MaxRedirectsError: as_promise_1.MaxRedirectsError,\n TimeoutError: as_promise_1.TimeoutError,\n ParseError: as_promise_1.ParseError,\n CancelError: as_promise_1.CancelError,\n UnsupportedProtocolError: as_promise_1.UnsupportedProtocolError,\n UploadError: as_promise_1.UploadError\n};\n// The `delay` package weighs 10KB (!)\nconst delay = async (ms) => new Promise(resolve => {\n setTimeout(resolve, ms);\n});\nconst { normalizeArguments } = core_1.default;\nconst mergeOptions = (...sources) => {\n let mergedOptions;\n for (const source of sources) {\n mergedOptions = normalizeArguments(undefined, source, mergedOptions);\n }\n return mergedOptions;\n};\nconst getPromiseOrStream = (options) => options.isStream ? new core_1.default(undefined, options) : as_promise_1.default(options);\nconst isGotInstance = (value) => ('defaults' in value && 'options' in value.defaults);\nconst aliases = [\n 'get',\n 'post',\n 'put',\n 'patch',\n 'head',\n 'delete'\n];\nexports.defaultHandler = (options, next) => next(options);\nconst callInitHooks = (hooks, options) => {\n if (hooks) {\n for (const hook of hooks) {\n hook(options);\n }\n }\n};\nconst create = (defaults) => {\n // Proxy properties from next handlers\n defaults._rawHandlers = defaults.handlers;\n defaults.handlers = defaults.handlers.map(fn => ((options, next) => {\n // This will be assigned by assigning result\n let root;\n const result = fn(options, newOptions => {\n root = next(newOptions);\n return root;\n });\n if (result !== root && !options.isStream && root) {\n const typedResult = result;\n const { then: promiseThen, catch: promiseCatch, finally: promiseFianlly } = typedResult;\n Object.setPrototypeOf(typedResult, Object.getPrototypeOf(root));\n Object.defineProperties(typedResult, Object.getOwnPropertyDescriptors(root));\n // These should point to the new promise\n // eslint-disable-next-line promise/prefer-await-to-then\n typedResult.then = promiseThen;\n typedResult.catch = promiseCatch;\n typedResult.finally = promiseFianlly;\n }\n return result;\n }));\n // Got interface\n const got = ((url, options = {}, _defaults) => {\n var _a, _b;\n let iteration = 0;\n const iterateHandlers = (newOptions) => {\n return defaults.handlers[iteration++](newOptions, iteration === defaults.handlers.length ? getPromiseOrStream : iterateHandlers);\n };\n // TODO: Remove this in Got 12.\n if (is_1.default.plainObject(url)) {\n const mergedOptions = {\n ...url,\n ...options\n };\n core_1.setNonEnumerableProperties([url, options], mergedOptions);\n options = mergedOptions;\n url = undefined;\n }\n try {\n // Call `init` hooks\n let initHookError;\n try {\n callInitHooks(defaults.options.hooks.init, options);\n callInitHooks((_a = options.hooks) === null || _a === void 0 ? void 0 : _a.init, options);\n }\n catch (error) {\n initHookError = error;\n }\n // Normalize options & call handlers\n const normalizedOptions = normalizeArguments(url, options, _defaults !== null && _defaults !== void 0 ? _defaults : defaults.options);\n normalizedOptions[core_1.kIsNormalizedAlready] = true;\n if (initHookError) {\n throw new as_promise_1.RequestError(initHookError.message, initHookError, normalizedOptions);\n }\n return iterateHandlers(normalizedOptions);\n }\n catch (error) {\n if (options.isStream) {\n throw error;\n }\n else {\n return create_rejection_1.default(error, defaults.options.hooks.beforeError, (_b = options.hooks) === null || _b === void 0 ? void 0 : _b.beforeError);\n }\n }\n });\n got.extend = (...instancesOrOptions) => {\n const optionsArray = [defaults.options];\n let handlers = [...defaults._rawHandlers];\n let isMutableDefaults;\n for (const value of instancesOrOptions) {\n if (isGotInstance(value)) {\n optionsArray.push(value.defaults.options);\n handlers.push(...value.defaults._rawHandlers);\n isMutableDefaults = value.defaults.mutableDefaults;\n }\n else {\n optionsArray.push(value);\n if ('handlers' in value) {\n handlers.push(...value.handlers);\n }\n isMutableDefaults = value.mutableDefaults;\n }\n }\n handlers = handlers.filter(handler => handler !== exports.defaultHandler);\n if (handlers.length === 0) {\n handlers.push(exports.defaultHandler);\n }\n return create({\n options: mergeOptions(...optionsArray),\n handlers,\n mutableDefaults: Boolean(isMutableDefaults)\n });\n };\n // Pagination\n const paginateEach = (async function* (url, options) {\n // TODO: Remove this `@ts-expect-error` when upgrading to TypeScript 4.\n // Error: Argument of type 'Merge> | undefined' is not assignable to parameter of type 'Options | undefined'.\n // @ts-expect-error\n let normalizedOptions = normalizeArguments(url, options, defaults.options);\n normalizedOptions.resolveBodyOnly = false;\n const pagination = normalizedOptions.pagination;\n if (!is_1.default.object(pagination)) {\n throw new TypeError('`options.pagination` must be implemented');\n }\n const all = [];\n let { countLimit } = pagination;\n let numberOfRequests = 0;\n while (numberOfRequests < pagination.requestLimit) {\n if (numberOfRequests !== 0) {\n // eslint-disable-next-line no-await-in-loop\n await delay(pagination.backoff);\n }\n // @ts-expect-error FIXME!\n // TODO: Throw when result is not an instance of Response\n // eslint-disable-next-line no-await-in-loop\n const result = (await got(undefined, undefined, normalizedOptions));\n // eslint-disable-next-line no-await-in-loop\n const parsed = await pagination.transform(result);\n const current = [];\n for (const item of parsed) {\n if (pagination.filter(item, all, current)) {\n if (!pagination.shouldContinue(item, all, current)) {\n return;\n }\n yield item;\n if (pagination.stackAllItems) {\n all.push(item);\n }\n current.push(item);\n if (--countLimit <= 0) {\n return;\n }\n }\n }\n const optionsToMerge = pagination.paginate(result, all, current);\n if (optionsToMerge === false) {\n return;\n }\n if (optionsToMerge === result.request.options) {\n normalizedOptions = result.request.options;\n }\n else if (optionsToMerge !== undefined) {\n normalizedOptions = normalizeArguments(undefined, optionsToMerge, normalizedOptions);\n }\n numberOfRequests++;\n }\n });\n got.paginate = paginateEach;\n got.paginate.all = (async (url, options) => {\n const results = [];\n for await (const item of paginateEach(url, options)) {\n results.push(item);\n }\n return results;\n });\n // For those who like very descriptive names\n got.paginate.each = paginateEach;\n // Stream API\n got.stream = ((url, options) => got(url, { ...options, isStream: true }));\n // Shortcuts\n for (const method of aliases) {\n got[method] = ((url, options) => got(url, { ...options, method }));\n got.stream[method] = ((url, options) => {\n return got(url, { ...options, method, isStream: true });\n });\n }\n Object.assign(got, errors);\n Object.defineProperty(got, 'defaults', {\n value: defaults.mutableDefaults ? defaults : deep_freeze_1.default(defaults),\n writable: defaults.mutableDefaults,\n configurable: defaults.mutableDefaults,\n enumerable: true\n });\n got.mergeOptions = mergeOptions;\n return got;\n};\nexports.default = create;\n__exportStar(require(\"./types\"), exports);\n","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst url_1 = require(\"url\");\nconst create_1 = require(\"./create\");\nconst defaults = {\n options: {\n method: 'GET',\n retry: {\n limit: 2,\n methods: [\n 'GET',\n 'PUT',\n 'HEAD',\n 'DELETE',\n 'OPTIONS',\n 'TRACE'\n ],\n statusCodes: [\n 408,\n 413,\n 429,\n 500,\n 502,\n 503,\n 504,\n 521,\n 522,\n 524\n ],\n errorCodes: [\n 'ETIMEDOUT',\n 'ECONNRESET',\n 'EADDRINUSE',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EAI_AGAIN'\n ],\n maxRetryAfter: undefined,\n calculateDelay: ({ computedValue }) => computedValue\n },\n timeout: {},\n headers: {\n 'user-agent': 'got (https://github.com/sindresorhus/got)'\n },\n hooks: {\n init: [],\n beforeRequest: [],\n beforeRedirect: [],\n beforeRetry: [],\n beforeError: [],\n afterResponse: []\n },\n cache: undefined,\n dnsCache: undefined,\n decompress: true,\n throwHttpErrors: true,\n followRedirect: true,\n isStream: false,\n responseType: 'text',\n resolveBodyOnly: false,\n maxRedirects: 10,\n prefixUrl: '',\n methodRewriting: true,\n ignoreInvalidCookies: false,\n context: {},\n // TODO: Set this to `true` when Got 12 gets released\n http2: false,\n allowGetBody: false,\n https: undefined,\n pagination: {\n transform: (response) => {\n if (response.request.options.responseType === 'json') {\n return response.body;\n }\n return JSON.parse(response.body);\n },\n paginate: response => {\n if (!Reflect.has(response.headers, 'link')) {\n return false;\n }\n const items = response.headers.link.split(',');\n let next;\n for (const item of items) {\n const parsed = item.split(';');\n if (parsed[1].includes('next')) {\n next = parsed[0].trimStart().trim();\n next = next.slice(1, -1);\n break;\n }\n }\n if (next) {\n const options = {\n url: new url_1.URL(next)\n };\n return options;\n }\n return false;\n },\n filter: () => true,\n shouldContinue: () => true,\n countLimit: Infinity,\n backoff: 0,\n requestLimit: 10000,\n stackAllItems: true\n },\n parseJson: (text) => JSON.parse(text),\n stringifyJson: (object) => JSON.stringify(object),\n cacheOptions: {}\n },\n handlers: [create_1.defaultHandler],\n mutableDefaults: false\n};\nconst got = create_1.default(defaults);\nexports.default = got;\n// For CommonJS default export support\nmodule.exports = got;\nmodule.exports.default = got;\nmodule.exports.__esModule = true; // Workaround for TS issue: https://github.com/sindresorhus/got/pull/1267\n__exportStar(require(\"./create\"), exports);\n__exportStar(require(\"./as-promise\"), exports);\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst is_1 = require(\"@sindresorhus/is\");\nfunction deepFreeze(object) {\n for (const value of Object.values(object)) {\n if (is_1.default.plainObject(value) || is_1.default.array(value)) {\n deepFreeze(value);\n }\n }\n return Object.freeze(object);\n}\nexports.default = deepFreeze;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst alreadyWarned = new Set();\nexports.default = (message) => {\n if (alreadyWarned.has(message)) {\n return;\n }\n alreadyWarned.add(message);\n // @ts-expect-error Missing types.\n process.emitWarning(`Got: ${message}`, {\n type: 'DeprecationWarning'\n });\n};\n","\"use strict\";\n/// \n/// \n/// \nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst typedArrayTypeNames = [\n 'Int8Array',\n 'Uint8Array',\n 'Uint8ClampedArray',\n 'Int16Array',\n 'Uint16Array',\n 'Int32Array',\n 'Uint32Array',\n 'Float32Array',\n 'Float64Array',\n 'BigInt64Array',\n 'BigUint64Array'\n];\nfunction isTypedArrayName(name) {\n return typedArrayTypeNames.includes(name);\n}\nconst objectTypeNames = [\n 'Function',\n 'Generator',\n 'AsyncGenerator',\n 'GeneratorFunction',\n 'AsyncGeneratorFunction',\n 'AsyncFunction',\n 'Observable',\n 'Array',\n 'Buffer',\n 'Blob',\n 'Object',\n 'RegExp',\n 'Date',\n 'Error',\n 'Map',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n 'ArrayBuffer',\n 'SharedArrayBuffer',\n 'DataView',\n 'Promise',\n 'URL',\n 'FormData',\n 'URLSearchParams',\n 'HTMLElement',\n ...typedArrayTypeNames\n];\nfunction isObjectTypeName(name) {\n return objectTypeNames.includes(name);\n}\nconst primitiveTypeNames = [\n 'null',\n 'undefined',\n 'string',\n 'number',\n 'bigint',\n 'boolean',\n 'symbol'\n];\nfunction isPrimitiveTypeName(name) {\n return primitiveTypeNames.includes(name);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isOfType(type) {\n return (value) => typeof value === type;\n}\nconst { toString } = Object.prototype;\nconst getObjectType = (value) => {\n const objectTypeName = toString.call(value).slice(8, -1);\n if (/HTML\\w+Element/.test(objectTypeName) && is.domElement(value)) {\n return 'HTMLElement';\n }\n if (isObjectTypeName(objectTypeName)) {\n return objectTypeName;\n }\n return undefined;\n};\nconst isObjectOfType = (type) => (value) => getObjectType(value) === type;\nfunction is(value) {\n if (value === null) {\n return 'null';\n }\n switch (typeof value) {\n case 'undefined':\n return 'undefined';\n case 'string':\n return 'string';\n case 'number':\n return 'number';\n case 'boolean':\n return 'boolean';\n case 'function':\n return 'Function';\n case 'bigint':\n return 'bigint';\n case 'symbol':\n return 'symbol';\n default:\n }\n if (is.observable(value)) {\n return 'Observable';\n }\n if (is.array(value)) {\n return 'Array';\n }\n if (is.buffer(value)) {\n return 'Buffer';\n }\n const tagType = getObjectType(value);\n if (tagType) {\n return tagType;\n }\n if (value instanceof String || value instanceof Boolean || value instanceof Number) {\n throw new TypeError('Please don\\'t use object wrappers for primitive types');\n }\n return 'Object';\n}\nis.undefined = isOfType('undefined');\nis.string = isOfType('string');\nconst isNumberType = isOfType('number');\nis.number = (value) => isNumberType(value) && !is.nan(value);\nis.bigint = isOfType('bigint');\n// eslint-disable-next-line @typescript-eslint/ban-types\nis.function_ = isOfType('function');\nis.null_ = (value) => value === null;\nis.class_ = (value) => is.function_(value) && value.toString().startsWith('class ');\nis.boolean = (value) => value === true || value === false;\nis.symbol = isOfType('symbol');\nis.numericString = (value) => is.string(value) && !is.emptyStringOrWhitespace(value) && !Number.isNaN(Number(value));\nis.array = (value, assertion) => {\n if (!Array.isArray(value)) {\n return false;\n }\n if (!is.function_(assertion)) {\n return true;\n }\n return value.every(assertion);\n};\nis.buffer = (value) => { var _a, _b, _c, _d; return (_d = (_c = (_b = (_a = value) === null || _a === void 0 ? void 0 : _a.constructor) === null || _b === void 0 ? void 0 : _b.isBuffer) === null || _c === void 0 ? void 0 : _c.call(_b, value)) !== null && _d !== void 0 ? _d : false; };\nis.blob = (value) => isObjectOfType('Blob')(value);\nis.nullOrUndefined = (value) => is.null_(value) || is.undefined(value);\nis.object = (value) => !is.null_(value) && (typeof value === 'object' || is.function_(value));\nis.iterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.iterator]); };\nis.asyncIterable = (value) => { var _a; return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a[Symbol.asyncIterator]); };\nis.generator = (value) => { var _a, _b; return is.iterable(value) && is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.next) && is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.throw); };\nis.asyncGenerator = (value) => is.asyncIterable(value) && is.function_(value.next) && is.function_(value.throw);\nis.nativePromise = (value) => isObjectOfType('Promise')(value);\nconst hasPromiseAPI = (value) => {\n var _a, _b;\n return is.function_((_a = value) === null || _a === void 0 ? void 0 : _a.then) &&\n is.function_((_b = value) === null || _b === void 0 ? void 0 : _b.catch);\n};\nis.promise = (value) => is.nativePromise(value) || hasPromiseAPI(value);\nis.generatorFunction = isObjectOfType('GeneratorFunction');\nis.asyncGeneratorFunction = (value) => getObjectType(value) === 'AsyncGeneratorFunction';\nis.asyncFunction = (value) => getObjectType(value) === 'AsyncFunction';\n// eslint-disable-next-line no-prototype-builtins, @typescript-eslint/ban-types\nis.boundFunction = (value) => is.function_(value) && !value.hasOwnProperty('prototype');\nis.regExp = isObjectOfType('RegExp');\nis.date = isObjectOfType('Date');\nis.error = isObjectOfType('Error');\nis.map = (value) => isObjectOfType('Map')(value);\nis.set = (value) => isObjectOfType('Set')(value);\nis.weakMap = (value) => isObjectOfType('WeakMap')(value);\nis.weakSet = (value) => isObjectOfType('WeakSet')(value);\nis.int8Array = isObjectOfType('Int8Array');\nis.uint8Array = isObjectOfType('Uint8Array');\nis.uint8ClampedArray = isObjectOfType('Uint8ClampedArray');\nis.int16Array = isObjectOfType('Int16Array');\nis.uint16Array = isObjectOfType('Uint16Array');\nis.int32Array = isObjectOfType('Int32Array');\nis.uint32Array = isObjectOfType('Uint32Array');\nis.float32Array = isObjectOfType('Float32Array');\nis.float64Array = isObjectOfType('Float64Array');\nis.bigInt64Array = isObjectOfType('BigInt64Array');\nis.bigUint64Array = isObjectOfType('BigUint64Array');\nis.arrayBuffer = isObjectOfType('ArrayBuffer');\nis.sharedArrayBuffer = isObjectOfType('SharedArrayBuffer');\nis.dataView = isObjectOfType('DataView');\nis.enumCase = (value, targetEnum) => Object.values(targetEnum).includes(value);\nis.directInstanceOf = (instance, class_) => Object.getPrototypeOf(instance) === class_.prototype;\nis.urlInstance = (value) => isObjectOfType('URL')(value);\nis.urlString = (value) => {\n if (!is.string(value)) {\n return false;\n }\n try {\n new URL(value); // eslint-disable-line no-new\n return true;\n }\n catch (_a) {\n return false;\n }\n};\n// Example: `is.truthy = (value: unknown): value is (not false | not 0 | not '' | not undefined | not null) => Boolean(value);`\nis.truthy = (value) => Boolean(value);\n// Example: `is.falsy = (value: unknown): value is (not true | 0 | '' | undefined | null) => Boolean(value);`\nis.falsy = (value) => !value;\nis.nan = (value) => Number.isNaN(value);\nis.primitive = (value) => is.null_(value) || isPrimitiveTypeName(typeof value);\nis.integer = (value) => Number.isInteger(value);\nis.safeInteger = (value) => Number.isSafeInteger(value);\nis.plainObject = (value) => {\n // From: https://github.com/sindresorhus/is-plain-obj/blob/main/index.js\n if (toString.call(value) !== '[object Object]') {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === null || prototype === Object.getPrototypeOf({});\n};\nis.typedArray = (value) => isTypedArrayName(getObjectType(value));\nconst isValidLength = (value) => is.safeInteger(value) && value >= 0;\nis.arrayLike = (value) => !is.nullOrUndefined(value) && !is.function_(value) && isValidLength(value.length);\nis.inRange = (value, range) => {\n if (is.number(range)) {\n return value >= Math.min(0, range) && value <= Math.max(range, 0);\n }\n if (is.array(range) && range.length === 2) {\n return value >= Math.min(...range) && value <= Math.max(...range);\n }\n throw new TypeError(`Invalid range: ${JSON.stringify(range)}`);\n};\nconst NODE_TYPE_ELEMENT = 1;\nconst DOM_PROPERTIES_TO_CHECK = [\n 'innerHTML',\n 'ownerDocument',\n 'style',\n 'attributes',\n 'nodeValue'\n];\nis.domElement = (value) => {\n return is.object(value) &&\n value.nodeType === NODE_TYPE_ELEMENT &&\n is.string(value.nodeName) &&\n !is.plainObject(value) &&\n DOM_PROPERTIES_TO_CHECK.every(property => property in value);\n};\nis.observable = (value) => {\n var _a, _b, _c, _d;\n if (!value) {\n return false;\n }\n // eslint-disable-next-line no-use-extend-native/no-use-extend-native\n if (value === ((_b = (_a = value)[Symbol.observable]) === null || _b === void 0 ? void 0 : _b.call(_a))) {\n return true;\n }\n if (value === ((_d = (_c = value)['@@observable']) === null || _d === void 0 ? void 0 : _d.call(_c))) {\n return true;\n }\n return false;\n};\nis.nodeStream = (value) => is.object(value) && is.function_(value.pipe) && !is.observable(value);\nis.infinite = (value) => value === Infinity || value === -Infinity;\nconst isAbsoluteMod2 = (remainder) => (value) => is.integer(value) && Math.abs(value % 2) === remainder;\nis.evenInteger = isAbsoluteMod2(0);\nis.oddInteger = isAbsoluteMod2(1);\nis.emptyArray = (value) => is.array(value) && value.length === 0;\nis.nonEmptyArray = (value) => is.array(value) && value.length > 0;\nis.emptyString = (value) => is.string(value) && value.length === 0;\nconst isWhiteSpaceString = (value) => is.string(value) && !/\\S/.test(value);\nis.emptyStringOrWhitespace = (value) => is.emptyString(value) || isWhiteSpaceString(value);\n// TODO: Use `not ''` when the `not` operator is available.\nis.nonEmptyString = (value) => is.string(value) && value.length > 0;\n// TODO: Use `not ''` when the `not` operator is available.\nis.nonEmptyStringAndNotWhitespace = (value) => is.string(value) && !is.emptyStringOrWhitespace(value);\nis.emptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length === 0;\n// TODO: Use `not` operator here to remove `Map` and `Set` from type guard:\n// - https://github.com/Microsoft/TypeScript/pull/29317\nis.nonEmptyObject = (value) => is.object(value) && !is.map(value) && !is.set(value) && Object.keys(value).length > 0;\nis.emptySet = (value) => is.set(value) && value.size === 0;\nis.nonEmptySet = (value) => is.set(value) && value.size > 0;\nis.emptyMap = (value) => is.map(value) && value.size === 0;\nis.nonEmptyMap = (value) => is.map(value) && value.size > 0;\n// `PropertyKey` is any value that can be used as an object key (string, number, or symbol)\nis.propertyKey = (value) => is.any([is.string, is.number, is.symbol], value);\nis.formData = (value) => isObjectOfType('FormData')(value);\nis.urlSearchParams = (value) => isObjectOfType('URLSearchParams')(value);\nconst predicateOnArray = (method, predicate, values) => {\n if (!is.function_(predicate)) {\n throw new TypeError(`Invalid predicate: ${JSON.stringify(predicate)}`);\n }\n if (values.length === 0) {\n throw new TypeError('Invalid number of values');\n }\n return method.call(values, predicate);\n};\nis.any = (predicate, ...values) => {\n const predicates = is.array(predicate) ? predicate : [predicate];\n return predicates.some(singlePredicate => predicateOnArray(Array.prototype.some, singlePredicate, values));\n};\nis.all = (predicate, ...values) => predicateOnArray(Array.prototype.every, predicate, values);\nconst assertType = (condition, description, value, options = {}) => {\n if (!condition) {\n const { multipleValues } = options;\n const valuesMessage = multipleValues ?\n `received values of types ${[\n ...new Set(value.map(singleValue => `\\`${is(singleValue)}\\``))\n ].join(', ')}` :\n `received value of type \\`${is(value)}\\``;\n throw new TypeError(`Expected value which is \\`${description}\\`, ${valuesMessage}.`);\n }\n};\nexports.assert = {\n // Unknowns.\n undefined: (value) => assertType(is.undefined(value), 'undefined', value),\n string: (value) => assertType(is.string(value), 'string', value),\n number: (value) => assertType(is.number(value), 'number', value),\n bigint: (value) => assertType(is.bigint(value), 'bigint', value),\n // eslint-disable-next-line @typescript-eslint/ban-types\n function_: (value) => assertType(is.function_(value), 'Function', value),\n null_: (value) => assertType(is.null_(value), 'null', value),\n class_: (value) => assertType(is.class_(value), \"Class\" /* class_ */, value),\n boolean: (value) => assertType(is.boolean(value), 'boolean', value),\n symbol: (value) => assertType(is.symbol(value), 'symbol', value),\n numericString: (value) => assertType(is.numericString(value), \"string with a number\" /* numericString */, value),\n array: (value, assertion) => {\n const assert = assertType;\n assert(is.array(value), 'Array', value);\n if (assertion) {\n value.forEach(assertion);\n }\n },\n buffer: (value) => assertType(is.buffer(value), 'Buffer', value),\n blob: (value) => assertType(is.blob(value), 'Blob', value),\n nullOrUndefined: (value) => assertType(is.nullOrUndefined(value), \"null or undefined\" /* nullOrUndefined */, value),\n object: (value) => assertType(is.object(value), 'Object', value),\n iterable: (value) => assertType(is.iterable(value), \"Iterable\" /* iterable */, value),\n asyncIterable: (value) => assertType(is.asyncIterable(value), \"AsyncIterable\" /* asyncIterable */, value),\n generator: (value) => assertType(is.generator(value), 'Generator', value),\n asyncGenerator: (value) => assertType(is.asyncGenerator(value), 'AsyncGenerator', value),\n nativePromise: (value) => assertType(is.nativePromise(value), \"native Promise\" /* nativePromise */, value),\n promise: (value) => assertType(is.promise(value), 'Promise', value),\n generatorFunction: (value) => assertType(is.generatorFunction(value), 'GeneratorFunction', value),\n asyncGeneratorFunction: (value) => assertType(is.asyncGeneratorFunction(value), 'AsyncGeneratorFunction', value),\n // eslint-disable-next-line @typescript-eslint/ban-types\n asyncFunction: (value) => assertType(is.asyncFunction(value), 'AsyncFunction', value),\n // eslint-disable-next-line @typescript-eslint/ban-types\n boundFunction: (value) => assertType(is.boundFunction(value), 'Function', value),\n regExp: (value) => assertType(is.regExp(value), 'RegExp', value),\n date: (value) => assertType(is.date(value), 'Date', value),\n error: (value) => assertType(is.error(value), 'Error', value),\n map: (value) => assertType(is.map(value), 'Map', value),\n set: (value) => assertType(is.set(value), 'Set', value),\n weakMap: (value) => assertType(is.weakMap(value), 'WeakMap', value),\n weakSet: (value) => assertType(is.weakSet(value), 'WeakSet', value),\n int8Array: (value) => assertType(is.int8Array(value), 'Int8Array', value),\n uint8Array: (value) => assertType(is.uint8Array(value), 'Uint8Array', value),\n uint8ClampedArray: (value) => assertType(is.uint8ClampedArray(value), 'Uint8ClampedArray', value),\n int16Array: (value) => assertType(is.int16Array(value), 'Int16Array', value),\n uint16Array: (value) => assertType(is.uint16Array(value), 'Uint16Array', value),\n int32Array: (value) => assertType(is.int32Array(value), 'Int32Array', value),\n uint32Array: (value) => assertType(is.uint32Array(value), 'Uint32Array', value),\n float32Array: (value) => assertType(is.float32Array(value), 'Float32Array', value),\n float64Array: (value) => assertType(is.float64Array(value), 'Float64Array', value),\n bigInt64Array: (value) => assertType(is.bigInt64Array(value), 'BigInt64Array', value),\n bigUint64Array: (value) => assertType(is.bigUint64Array(value), 'BigUint64Array', value),\n arrayBuffer: (value) => assertType(is.arrayBuffer(value), 'ArrayBuffer', value),\n sharedArrayBuffer: (value) => assertType(is.sharedArrayBuffer(value), 'SharedArrayBuffer', value),\n dataView: (value) => assertType(is.dataView(value), 'DataView', value),\n enumCase: (value, targetEnum) => assertType(is.enumCase(value, targetEnum), 'EnumCase', value),\n urlInstance: (value) => assertType(is.urlInstance(value), 'URL', value),\n urlString: (value) => assertType(is.urlString(value), \"string with a URL\" /* urlString */, value),\n truthy: (value) => assertType(is.truthy(value), \"truthy\" /* truthy */, value),\n falsy: (value) => assertType(is.falsy(value), \"falsy\" /* falsy */, value),\n nan: (value) => assertType(is.nan(value), \"NaN\" /* nan */, value),\n primitive: (value) => assertType(is.primitive(value), \"primitive\" /* primitive */, value),\n integer: (value) => assertType(is.integer(value), \"integer\" /* integer */, value),\n safeInteger: (value) => assertType(is.safeInteger(value), \"integer\" /* safeInteger */, value),\n plainObject: (value) => assertType(is.plainObject(value), \"plain object\" /* plainObject */, value),\n typedArray: (value) => assertType(is.typedArray(value), \"TypedArray\" /* typedArray */, value),\n arrayLike: (value) => assertType(is.arrayLike(value), \"array-like\" /* arrayLike */, value),\n domElement: (value) => assertType(is.domElement(value), \"HTMLElement\" /* domElement */, value),\n observable: (value) => assertType(is.observable(value), 'Observable', value),\n nodeStream: (value) => assertType(is.nodeStream(value), \"Node.js Stream\" /* nodeStream */, value),\n infinite: (value) => assertType(is.infinite(value), \"infinite number\" /* infinite */, value),\n emptyArray: (value) => assertType(is.emptyArray(value), \"empty array\" /* emptyArray */, value),\n nonEmptyArray: (value) => assertType(is.nonEmptyArray(value), \"non-empty array\" /* nonEmptyArray */, value),\n emptyString: (value) => assertType(is.emptyString(value), \"empty string\" /* emptyString */, value),\n emptyStringOrWhitespace: (value) => assertType(is.emptyStringOrWhitespace(value), \"empty string or whitespace\" /* emptyStringOrWhitespace */, value),\n nonEmptyString: (value) => assertType(is.nonEmptyString(value), \"non-empty string\" /* nonEmptyString */, value),\n nonEmptyStringAndNotWhitespace: (value) => assertType(is.nonEmptyStringAndNotWhitespace(value), \"non-empty string and not whitespace\" /* nonEmptyStringAndNotWhitespace */, value),\n emptyObject: (value) => assertType(is.emptyObject(value), \"empty object\" /* emptyObject */, value),\n nonEmptyObject: (value) => assertType(is.nonEmptyObject(value), \"non-empty object\" /* nonEmptyObject */, value),\n emptySet: (value) => assertType(is.emptySet(value), \"empty set\" /* emptySet */, value),\n nonEmptySet: (value) => assertType(is.nonEmptySet(value), \"non-empty set\" /* nonEmptySet */, value),\n emptyMap: (value) => assertType(is.emptyMap(value), \"empty map\" /* emptyMap */, value),\n nonEmptyMap: (value) => assertType(is.nonEmptyMap(value), \"non-empty map\" /* nonEmptyMap */, value),\n propertyKey: (value) => assertType(is.propertyKey(value), 'PropertyKey', value),\n formData: (value) => assertType(is.formData(value), 'FormData', value),\n urlSearchParams: (value) => assertType(is.urlSearchParams(value), 'URLSearchParams', value),\n // Numbers.\n evenInteger: (value) => assertType(is.evenInteger(value), \"even integer\" /* evenInteger */, value),\n oddInteger: (value) => assertType(is.oddInteger(value), \"odd integer\" /* oddInteger */, value),\n // Two arguments.\n directInstanceOf: (instance, class_) => assertType(is.directInstanceOf(instance, class_), \"T\" /* directInstanceOf */, instance),\n inRange: (value, range) => assertType(is.inRange(value, range), \"in range\" /* inRange */, value),\n // Variadic functions.\n any: (predicate, ...values) => {\n return assertType(is.any(predicate, ...values), \"predicate returns truthy for any value\" /* any */, values, { multipleValues: true });\n },\n all: (predicate, ...values) => assertType(is.all(predicate, ...values), \"predicate returns truthy for all values\" /* all */, values, { multipleValues: true })\n};\n// Some few keywords are reserved, but we'll populate them for Node.js users\n// See https://github.com/Microsoft/TypeScript/issues/2536\nObject.defineProperties(is, {\n class: {\n value: is.class_\n },\n function: {\n value: is.function_\n },\n null: {\n value: is.null_\n }\n});\nObject.defineProperties(exports.assert, {\n class: {\n value: exports.assert.class_\n },\n function: {\n value: exports.assert.function_\n },\n null: {\n value: exports.assert.null_\n }\n});\nexports.default = is;\n// For CommonJS default export support\nmodule.exports = is;\nmodule.exports.default = is;\nmodule.exports.assert = exports.assert;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst defer_to_connect_1 = require(\"defer-to-connect\");\nconst util_1 = require(\"util\");\nconst nodejsMajorVersion = Number(process.versions.node.split('.')[0]);\nconst timer = (request) => {\n if (request.timings) {\n return request.timings;\n }\n const timings = {\n start: Date.now(),\n socket: undefined,\n lookup: undefined,\n connect: undefined,\n secureConnect: undefined,\n upload: undefined,\n response: undefined,\n end: undefined,\n error: undefined,\n abort: undefined,\n phases: {\n wait: undefined,\n dns: undefined,\n tcp: undefined,\n tls: undefined,\n request: undefined,\n firstByte: undefined,\n download: undefined,\n total: undefined\n }\n };\n request.timings = timings;\n const handleError = (origin) => {\n const emit = origin.emit.bind(origin);\n origin.emit = (event, ...args) => {\n // Catches the `error` event\n if (event === 'error') {\n timings.error = Date.now();\n timings.phases.total = timings.error - timings.start;\n origin.emit = emit;\n }\n // Saves the original behavior\n return emit(event, ...args);\n };\n };\n handleError(request);\n const onAbort = () => {\n timings.abort = Date.now();\n // Let the `end` response event be responsible for setting the total phase,\n // unless the Node.js major version is >= 13.\n if (!timings.response || nodejsMajorVersion >= 13) {\n timings.phases.total = Date.now() - timings.start;\n }\n };\n request.prependOnceListener('abort', onAbort);\n const onSocket = (socket) => {\n timings.socket = Date.now();\n timings.phases.wait = timings.socket - timings.start;\n if (util_1.types.isProxy(socket)) {\n return;\n }\n const lookupListener = () => {\n timings.lookup = Date.now();\n timings.phases.dns = timings.lookup - timings.socket;\n };\n socket.prependOnceListener('lookup', lookupListener);\n defer_to_connect_1.default(socket, {\n connect: () => {\n timings.connect = Date.now();\n if (timings.lookup === undefined) {\n socket.removeListener('lookup', lookupListener);\n timings.lookup = timings.connect;\n timings.phases.dns = timings.lookup - timings.socket;\n }\n timings.phases.tcp = timings.connect - timings.lookup;\n // This callback is called before flushing any data,\n // so we don't need to set `timings.phases.request` here.\n },\n secureConnect: () => {\n timings.secureConnect = Date.now();\n timings.phases.tls = timings.secureConnect - timings.connect;\n }\n });\n };\n if (request.socket) {\n onSocket(request.socket);\n }\n else {\n request.prependOnceListener('socket', onSocket);\n }\n const onUpload = () => {\n var _a;\n timings.upload = Date.now();\n timings.phases.request = timings.upload - ((_a = timings.secureConnect) !== null && _a !== void 0 ? _a : timings.connect);\n };\n const writableFinished = () => {\n if (typeof request.writableFinished === 'boolean') {\n return request.writableFinished;\n }\n // Node.js doesn't have `request.writableFinished` property\n return request.finished && request.outputSize === 0 && (!request.socket || request.socket.writableLength === 0);\n };\n if (writableFinished()) {\n onUpload();\n }\n else {\n request.prependOnceListener('finish', onUpload);\n }\n request.prependOnceListener('response', (response) => {\n timings.response = Date.now();\n timings.phases.firstByte = timings.response - timings.upload;\n response.timings = timings;\n handleError(response);\n response.prependOnceListener('end', () => {\n timings.end = Date.now();\n timings.phases.download = timings.end - timings.response;\n timings.phases.total = timings.end - timings.start;\n });\n response.prependOnceListener('aborted', onAbort);\n });\n return timings;\n};\nexports.default = timer;\n// For CommonJS default export support\nmodule.exports = timer;\nmodule.exports.default = timer;\n","'use strict';\n\nconst EventEmitter = require('events');\nconst urlLib = require('url');\nconst normalizeUrl = require('normalize-url');\nconst getStream = require('get-stream');\nconst CachePolicy = require('http-cache-semantics');\nconst Response = require('responselike');\nconst lowercaseKeys = require('lowercase-keys');\nconst cloneResponse = require('clone-response');\nconst Keyv = require('keyv');\n\nclass CacheableRequest {\n\tconstructor(request, cacheAdapter) {\n\t\tif (typeof request !== 'function') {\n\t\t\tthrow new TypeError('Parameter `request` must be a function');\n\t\t}\n\n\t\tthis.cache = new Keyv({\n\t\t\turi: typeof cacheAdapter === 'string' && cacheAdapter,\n\t\t\tstore: typeof cacheAdapter !== 'string' && cacheAdapter,\n\t\t\tnamespace: 'cacheable-request'\n\t\t});\n\n\t\treturn this.createCacheableRequest(request);\n\t}\n\n\tcreateCacheableRequest(request) {\n\t\treturn (opts, cb) => {\n\t\t\tlet url;\n\t\t\tif (typeof opts === 'string') {\n\t\t\t\turl = normalizeUrlObject(urlLib.parse(opts));\n\t\t\t\topts = {};\n\t\t\t} else if (opts instanceof urlLib.URL) {\n\t\t\t\turl = normalizeUrlObject(urlLib.parse(opts.toString()));\n\t\t\t\topts = {};\n\t\t\t} else {\n\t\t\t\tconst [pathname, ...searchParts] = (opts.path || '').split('?');\n\t\t\t\tconst search = searchParts.length > 0 ?\n\t\t\t\t\t`?${searchParts.join('?')}` :\n\t\t\t\t\t'';\n\t\t\t\turl = normalizeUrlObject({ ...opts, pathname, search });\n\t\t\t}\n\n\t\t\topts = {\n\t\t\t\theaders: {},\n\t\t\t\tmethod: 'GET',\n\t\t\t\tcache: true,\n\t\t\t\tstrictTtl: false,\n\t\t\t\tautomaticFailover: false,\n\t\t\t\t...opts,\n\t\t\t\t...urlObjectToRequestOptions(url)\n\t\t\t};\n\t\t\topts.headers = lowercaseKeys(opts.headers);\n\n\t\t\tconst ee = new EventEmitter();\n\t\t\tconst normalizedUrlString = normalizeUrl(\n\t\t\t\turlLib.format(url),\n\t\t\t\t{\n\t\t\t\t\tstripWWW: false,\n\t\t\t\t\tremoveTrailingSlash: false,\n\t\t\t\t\tstripAuthentication: false\n\t\t\t\t}\n\t\t\t);\n\t\t\tconst key = `${opts.method}:${normalizedUrlString}`;\n\t\t\tlet revalidate = false;\n\t\t\tlet madeRequest = false;\n\n\t\t\tconst makeRequest = opts => {\n\t\t\t\tmadeRequest = true;\n\t\t\t\tlet requestErrored = false;\n\t\t\t\tlet requestErrorCallback;\n\n\t\t\t\tconst requestErrorPromise = new Promise(resolve => {\n\t\t\t\t\trequestErrorCallback = () => {\n\t\t\t\t\t\tif (!requestErrored) {\n\t\t\t\t\t\t\trequestErrored = true;\n\t\t\t\t\t\t\tresolve();\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\tconst handler = response => {\n\t\t\t\t\tif (revalidate && !opts.forceRefresh) {\n\t\t\t\t\t\tresponse.status = response.statusCode;\n\t\t\t\t\t\tconst revalidatedPolicy = CachePolicy.fromObject(revalidate.cachePolicy).revalidatedPolicy(opts, response);\n\t\t\t\t\t\tif (!revalidatedPolicy.modified) {\n\t\t\t\t\t\t\tconst headers = revalidatedPolicy.policy.responseHeaders();\n\t\t\t\t\t\t\tresponse = new Response(revalidate.statusCode, headers, revalidate.body, revalidate.url);\n\t\t\t\t\t\t\tresponse.cachePolicy = revalidatedPolicy.policy;\n\t\t\t\t\t\t\tresponse.fromCache = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!response.fromCache) {\n\t\t\t\t\t\tresponse.cachePolicy = new CachePolicy(opts, response, opts);\n\t\t\t\t\t\tresponse.fromCache = false;\n\t\t\t\t\t}\n\n\t\t\t\t\tlet clonedResponse;\n\t\t\t\t\tif (opts.cache && response.cachePolicy.storable()) {\n\t\t\t\t\t\tclonedResponse = cloneResponse(response);\n\n\t\t\t\t\t\t(async () => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tconst bodyPromise = getStream.buffer(response);\n\n\t\t\t\t\t\t\t\tawait Promise.race([\n\t\t\t\t\t\t\t\t\trequestErrorPromise,\n\t\t\t\t\t\t\t\t\tnew Promise(resolve => response.once('end', resolve))\n\t\t\t\t\t\t\t\t]);\n\n\t\t\t\t\t\t\t\tif (requestErrored) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst body = await bodyPromise;\n\n\t\t\t\t\t\t\t\tconst value = {\n\t\t\t\t\t\t\t\t\tcachePolicy: response.cachePolicy.toObject(),\n\t\t\t\t\t\t\t\t\turl: response.url,\n\t\t\t\t\t\t\t\t\tstatusCode: response.fromCache ? revalidate.statusCode : response.statusCode,\n\t\t\t\t\t\t\t\t\tbody\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tlet ttl = opts.strictTtl ? response.cachePolicy.timeToLive() : undefined;\n\t\t\t\t\t\t\t\tif (opts.maxTtl) {\n\t\t\t\t\t\t\t\t\tttl = ttl ? Math.min(ttl, opts.maxTtl) : opts.maxTtl;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tawait this.cache.set(key, value, ttl);\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tee.emit('error', new CacheableRequest.CacheError(error));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})();\n\t\t\t\t\t} else if (opts.cache && revalidate) {\n\t\t\t\t\t\t(async () => {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tawait this.cache.delete(key);\n\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\tee.emit('error', new CacheableRequest.CacheError(error));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t})();\n\t\t\t\t\t}\n\n\t\t\t\t\tee.emit('response', clonedResponse || response);\n\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\tcb(clonedResponse || response);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\ttry {\n\t\t\t\t\tconst req = request(opts, handler);\n\t\t\t\t\treq.once('error', requestErrorCallback);\n\t\t\t\t\treq.once('abort', requestErrorCallback);\n\t\t\t\t\tee.emit('request', req);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tee.emit('error', new CacheableRequest.RequestError(error));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t(async () => {\n\t\t\t\tconst get = async opts => {\n\t\t\t\t\tawait Promise.resolve();\n\n\t\t\t\t\tconst cacheEntry = opts.cache ? await this.cache.get(key) : undefined;\n\t\t\t\t\tif (typeof cacheEntry === 'undefined') {\n\t\t\t\t\t\treturn makeRequest(opts);\n\t\t\t\t\t}\n\n\t\t\t\t\tconst policy = CachePolicy.fromObject(cacheEntry.cachePolicy);\n\t\t\t\t\tif (policy.satisfiesWithoutRevalidation(opts) && !opts.forceRefresh) {\n\t\t\t\t\t\tconst headers = policy.responseHeaders();\n\t\t\t\t\t\tconst response = new Response(cacheEntry.statusCode, headers, cacheEntry.body, cacheEntry.url);\n\t\t\t\t\t\tresponse.cachePolicy = policy;\n\t\t\t\t\t\tresponse.fromCache = true;\n\n\t\t\t\t\t\tee.emit('response', response);\n\t\t\t\t\t\tif (typeof cb === 'function') {\n\t\t\t\t\t\t\tcb(response);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\trevalidate = cacheEntry;\n\t\t\t\t\t\topts.headers = policy.revalidationHeaders(opts);\n\t\t\t\t\t\tmakeRequest(opts);\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\tconst errorHandler = error => ee.emit('error', new CacheableRequest.CacheError(error));\n\t\t\t\tthis.cache.once('error', errorHandler);\n\t\t\t\tee.on('response', () => this.cache.removeListener('error', errorHandler));\n\n\t\t\t\ttry {\n\t\t\t\t\tawait get(opts);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (opts.automaticFailover && !madeRequest) {\n\t\t\t\t\t\tmakeRequest(opts);\n\t\t\t\t\t}\n\n\t\t\t\t\tee.emit('error', new CacheableRequest.CacheError(error));\n\t\t\t\t}\n\t\t\t})();\n\n\t\t\treturn ee;\n\t\t};\n\t}\n}\n\nfunction urlObjectToRequestOptions(url) {\n\tconst options = { ...url };\n\toptions.path = `${url.pathname || '/'}${url.search || ''}`;\n\tdelete options.pathname;\n\tdelete options.search;\n\treturn options;\n}\n\nfunction normalizeUrlObject(url) {\n\t// If url was parsed by url.parse or new URL:\n\t// - hostname will be set\n\t// - host will be hostname[:port]\n\t// - port will be set if it was explicit in the parsed string\n\t// Otherwise, url was from request options:\n\t// - hostname or host may be set\n\t// - host shall not have port encoded\n\treturn {\n\t\tprotocol: url.protocol,\n\t\tauth: url.auth,\n\t\thostname: url.hostname || url.host || 'localhost',\n\t\tport: url.port,\n\t\tpathname: url.pathname,\n\t\tsearch: url.search\n\t};\n}\n\nCacheableRequest.RequestError = class extends Error {\n\tconstructor(error) {\n\t\tsuper(error.message);\n\t\tthis.name = 'RequestError';\n\t\tObject.assign(this, error);\n\t}\n};\n\nCacheableRequest.CacheError = class extends Error {\n\tconstructor(error) {\n\t\tsuper(error.message);\n\t\tthis.name = 'CacheError';\n\t\tObject.assign(this, error);\n\t}\n};\n\nmodule.exports = CacheableRequest;\n","'use strict';\nconst {Transform, PassThrough} = require('stream');\nconst zlib = require('zlib');\nconst mimicResponse = require('mimic-response');\n\nmodule.exports = response => {\n\tconst contentEncoding = (response.headers['content-encoding'] || '').toLowerCase();\n\n\tif (!['gzip', 'deflate', 'br'].includes(contentEncoding)) {\n\t\treturn response;\n\t}\n\n\t// TODO: Remove this when targeting Node.js 12.\n\tconst isBrotli = contentEncoding === 'br';\n\tif (isBrotli && typeof zlib.createBrotliDecompress !== 'function') {\n\t\tresponse.destroy(new Error('Brotli is not supported on Node.js < 12'));\n\t\treturn response;\n\t}\n\n\tlet isEmpty = true;\n\n\tconst checker = new Transform({\n\t\ttransform(data, _encoding, callback) {\n\t\t\tisEmpty = false;\n\n\t\t\tcallback(null, data);\n\t\t},\n\n\t\tflush(callback) {\n\t\t\tcallback();\n\t\t}\n\t});\n\n\tconst finalStream = new PassThrough({\n\t\tautoDestroy: false,\n\t\tdestroy(error, callback) {\n\t\t\tresponse.destroy();\n\n\t\t\tcallback(error);\n\t\t}\n\t});\n\n\tconst decompressStream = isBrotli ? zlib.createBrotliDecompress() : zlib.createUnzip();\n\n\tdecompressStream.once('error', error => {\n\t\tif (isEmpty && !response.readable) {\n\t\t\tfinalStream.end();\n\t\t\treturn;\n\t\t}\n\n\t\tfinalStream.destroy(error);\n\t});\n\n\tmimicResponse(response, finalStream);\n\tresponse.pipe(checker).pipe(decompressStream).pipe(finalStream);\n\n\treturn finalStream;\n};\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction isTLSSocket(socket) {\n return socket.encrypted;\n}\nconst deferToConnect = (socket, fn) => {\n let listeners;\n if (typeof fn === 'function') {\n const connect = fn;\n listeners = { connect };\n }\n else {\n listeners = fn;\n }\n const hasConnectListener = typeof listeners.connect === 'function';\n const hasSecureConnectListener = typeof listeners.secureConnect === 'function';\n const hasCloseListener = typeof listeners.close === 'function';\n const onConnect = () => {\n if (hasConnectListener) {\n listeners.connect();\n }\n if (isTLSSocket(socket) && hasSecureConnectListener) {\n if (socket.authorized) {\n listeners.secureConnect();\n }\n else if (!socket.authorizationError) {\n socket.once('secureConnect', listeners.secureConnect);\n }\n }\n if (hasCloseListener) {\n socket.once('close', listeners.close);\n }\n };\n if (socket.writable && !socket.connecting) {\n onConnect();\n }\n else if (socket.connecting) {\n socket.once('connect', onConnect);\n }\n else if (socket.destroyed && hasCloseListener) {\n listeners.close(socket._hadError);\n }\n};\nexports.default = deferToConnect;\n// For CommonJS default export support\nmodule.exports = deferToConnect;\nmodule.exports.default = deferToConnect;\n","'use strict';\nconst {PassThrough: PassThroughStream} = require('stream');\n\nmodule.exports = options => {\n\toptions = {...options};\n\n\tconst {array} = options;\n\tlet {encoding} = options;\n\tconst isBuffer = encoding === 'buffer';\n\tlet objectMode = false;\n\n\tif (array) {\n\t\tobjectMode = !(encoding || isBuffer);\n\t} else {\n\t\tencoding = encoding || 'utf8';\n\t}\n\n\tif (isBuffer) {\n\t\tencoding = null;\n\t}\n\n\tconst stream = new PassThroughStream({objectMode});\n\n\tif (encoding) {\n\t\tstream.setEncoding(encoding);\n\t}\n\n\tlet length = 0;\n\tconst chunks = [];\n\n\tstream.on('data', chunk => {\n\t\tchunks.push(chunk);\n\n\t\tif (objectMode) {\n\t\t\tlength = chunks.length;\n\t\t} else {\n\t\t\tlength += chunk.length;\n\t\t}\n\t});\n\n\tstream.getBufferedValue = () => {\n\t\tif (array) {\n\t\t\treturn chunks;\n\t\t}\n\n\t\treturn isBuffer ? Buffer.concat(chunks, length) : chunks.join('');\n\t};\n\n\tstream.getBufferedLength = () => length;\n\n\treturn stream;\n};\n","'use strict';\nconst {constants: BufferConstants} = require('buffer');\nconst pump = require('pump');\nconst bufferStream = require('./buffer-stream');\n\nclass MaxBufferError extends Error {\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t\tthis.name = 'MaxBufferError';\n\t}\n}\n\nasync function getStream(inputStream, options) {\n\tif (!inputStream) {\n\t\treturn Promise.reject(new Error('Expected a stream'));\n\t}\n\n\toptions = {\n\t\tmaxBuffer: Infinity,\n\t\t...options\n\t};\n\n\tconst {maxBuffer} = options;\n\n\tlet stream;\n\tawait new Promise((resolve, reject) => {\n\t\tconst rejectPromise = error => {\n\t\t\t// Don't retrieve an oversized buffer.\n\t\t\tif (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {\n\t\t\t\terror.bufferedData = stream.getBufferedValue();\n\t\t\t}\n\n\t\t\treject(error);\n\t\t};\n\n\t\tstream = pump(inputStream, bufferStream(options), error => {\n\t\t\tif (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolve();\n\t\t});\n\n\t\tstream.on('data', () => {\n\t\t\tif (stream.getBufferedLength() > maxBuffer) {\n\t\t\t\trejectPromise(new MaxBufferError());\n\t\t\t}\n\t\t});\n\t});\n\n\treturn stream.getBufferedValue();\n}\n\nmodule.exports = getStream;\n// TODO: Remove this for the next major release\nmodule.exports.default = getStream;\nmodule.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});\nmodule.exports.array = (stream, options) => getStream(stream, {...options, array: true});\nmodule.exports.MaxBufferError = MaxBufferError;\n","//TODO: handle reviver/dehydrate function like normal\n//and handle indentation, like normal.\n//if anyone needs this... please send pull request.\n\nexports.stringify = function stringify (o) {\n if('undefined' == typeof o) return o\n\n if(o && Buffer.isBuffer(o))\n return JSON.stringify(':base64:' + o.toString('base64'))\n\n if(o && o.toJSON)\n o = o.toJSON()\n\n if(o && 'object' === typeof o) {\n var s = ''\n var array = Array.isArray(o)\n s = array ? '[' : '{'\n var first = true\n\n for(var k in o) {\n var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k])\n if(Object.hasOwnProperty.call(o, k) && !ignore) {\n if(!first)\n s += ','\n first = false\n if (array) {\n if(o[k] == undefined)\n s += 'null'\n else\n s += stringify(o[k])\n } else if (o[k] !== void(0)) {\n s += stringify(k) + ':' + stringify(o[k])\n }\n }\n }\n\n s += array ? ']' : '}'\n\n return s\n } else if ('string' === typeof o) {\n return JSON.stringify(/^:/.test(o) ? ':' + o : o)\n } else if ('undefined' === typeof o) {\n return 'null';\n } else\n return JSON.stringify(o)\n}\n\nexports.parse = function (s) {\n return JSON.parse(s, function (key, value) {\n if('string' === typeof value) {\n if(/^:base64:/.test(value))\n return Buffer.from(value.substring(8), 'base64')\n else\n return /^:/.test(value) ? value.substring(1) : value \n }\n return value\n })\n}\n",null,"'use strict';\n\n// We define these manually to ensure they're always copied\n// even if they would move up the prototype chain\n// https://nodejs.org/api/http.html#http_class_http_incomingmessage\nconst knownProperties = [\n\t'aborted',\n\t'complete',\n\t'headers',\n\t'httpVersion',\n\t'httpVersionMinor',\n\t'httpVersionMajor',\n\t'method',\n\t'rawHeaders',\n\t'rawTrailers',\n\t'setTimeout',\n\t'socket',\n\t'statusCode',\n\t'statusMessage',\n\t'trailers',\n\t'url'\n];\n\nmodule.exports = (fromStream, toStream) => {\n\tif (toStream._readableState.autoDestroy) {\n\t\tthrow new Error('The second stream must have the `autoDestroy` option set to `false`');\n\t}\n\n\tconst fromProperties = new Set(Object.keys(fromStream).concat(knownProperties));\n\n\tconst properties = {};\n\n\tfor (const property of fromProperties) {\n\t\t// Don't overwrite existing properties.\n\t\tif (property in toStream) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tproperties[property] = {\n\t\t\tget() {\n\t\t\t\tconst value = fromStream[property];\n\t\t\t\tconst isFunction = typeof value === 'function';\n\n\t\t\t\treturn isFunction ? value.bind(fromStream) : value;\n\t\t\t},\n\t\t\tset(value) {\n\t\t\t\tfromStream[property] = value;\n\t\t\t},\n\t\t\tenumerable: true,\n\t\t\tconfigurable: false\n\t\t};\n\t}\n\n\tObject.defineProperties(toStream, properties);\n\n\tfromStream.once('aborted', () => {\n\t\ttoStream.destroy();\n\n\t\ttoStream.emit('aborted');\n\t});\n\n\tfromStream.once('close', () => {\n\t\tif (fromStream.complete) {\n\t\t\tif (toStream.readable) {\n\t\t\t\ttoStream.once('end', () => {\n\t\t\t\t\ttoStream.emit('close');\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\ttoStream.emit('close');\n\t\t\t}\n\t\t} else {\n\t\t\ttoStream.emit('close');\n\t\t}\n\t});\n\n\treturn toStream;\n};\n","'use strict';\n\n// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Data_URIs\nconst DATA_URL_DEFAULT_MIME_TYPE = 'text/plain';\nconst DATA_URL_DEFAULT_CHARSET = 'us-ascii';\n\nconst testParameter = (name, filters) => {\n\treturn filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);\n};\n\nconst normalizeDataURL = (urlString, {stripHash}) => {\n\tconst match = /^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(urlString);\n\n\tif (!match) {\n\t\tthrow new Error(`Invalid URL: ${urlString}`);\n\t}\n\n\tlet {type, data, hash} = match.groups;\n\tconst mediaType = type.split(';');\n\thash = stripHash ? '' : hash;\n\n\tlet isBase64 = false;\n\tif (mediaType[mediaType.length - 1] === 'base64') {\n\t\tmediaType.pop();\n\t\tisBase64 = true;\n\t}\n\n\t// Lowercase MIME type\n\tconst mimeType = (mediaType.shift() || '').toLowerCase();\n\tconst attributes = mediaType\n\t\t.map(attribute => {\n\t\t\tlet [key, value = ''] = attribute.split('=').map(string => string.trim());\n\n\t\t\t// Lowercase `charset`\n\t\t\tif (key === 'charset') {\n\t\t\t\tvalue = value.toLowerCase();\n\n\t\t\t\tif (value === DATA_URL_DEFAULT_CHARSET) {\n\t\t\t\t\treturn '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn `${key}${value ? `=${value}` : ''}`;\n\t\t})\n\t\t.filter(Boolean);\n\n\tconst normalizedMediaType = [\n\t\t...attributes\n\t];\n\n\tif (isBase64) {\n\t\tnormalizedMediaType.push('base64');\n\t}\n\n\tif (normalizedMediaType.length !== 0 || (mimeType && mimeType !== DATA_URL_DEFAULT_MIME_TYPE)) {\n\t\tnormalizedMediaType.unshift(mimeType);\n\t}\n\n\treturn `data:${normalizedMediaType.join(';')},${isBase64 ? data.trim() : data}${hash ? `#${hash}` : ''}`;\n};\n\nconst normalizeUrl = (urlString, options) => {\n\toptions = {\n\t\tdefaultProtocol: 'http:',\n\t\tnormalizeProtocol: true,\n\t\tforceHttp: false,\n\t\tforceHttps: false,\n\t\tstripAuthentication: true,\n\t\tstripHash: false,\n\t\tstripTextFragment: true,\n\t\tstripWWW: true,\n\t\tremoveQueryParameters: [/^utm_\\w+/i],\n\t\tremoveTrailingSlash: true,\n\t\tremoveSingleSlash: true,\n\t\tremoveDirectoryIndex: false,\n\t\tsortQueryParameters: true,\n\t\t...options\n\t};\n\n\turlString = urlString.trim();\n\n\t// Data URL\n\tif (/^data:/i.test(urlString)) {\n\t\treturn normalizeDataURL(urlString, options);\n\t}\n\n\tif (/^view-source:/i.test(urlString)) {\n\t\tthrow new Error('`view-source:` is not supported as it is a non-standard protocol');\n\t}\n\n\tconst hasRelativeProtocol = urlString.startsWith('//');\n\tconst isRelativeUrl = !hasRelativeProtocol && /^\\.*\\//.test(urlString);\n\n\t// Prepend protocol\n\tif (!isRelativeUrl) {\n\t\turlString = urlString.replace(/^(?!(?:\\w+:)?\\/\\/)|^\\/\\//, options.defaultProtocol);\n\t}\n\n\tconst urlObj = new URL(urlString);\n\n\tif (options.forceHttp && options.forceHttps) {\n\t\tthrow new Error('The `forceHttp` and `forceHttps` options cannot be used together');\n\t}\n\n\tif (options.forceHttp && urlObj.protocol === 'https:') {\n\t\turlObj.protocol = 'http:';\n\t}\n\n\tif (options.forceHttps && urlObj.protocol === 'http:') {\n\t\turlObj.protocol = 'https:';\n\t}\n\n\t// Remove auth\n\tif (options.stripAuthentication) {\n\t\turlObj.username = '';\n\t\turlObj.password = '';\n\t}\n\n\t// Remove hash\n\tif (options.stripHash) {\n\t\turlObj.hash = '';\n\t} else if (options.stripTextFragment) {\n\t\turlObj.hash = urlObj.hash.replace(/#?:~:text.*?$/i, '');\n\t}\n\n\t// Remove duplicate slashes if not preceded by a protocol\n\tif (urlObj.pathname) {\n\t\turlObj.pathname = urlObj.pathname.replace(/(? 0) {\n\t\tlet pathComponents = urlObj.pathname.split('/');\n\t\tconst lastComponent = pathComponents[pathComponents.length - 1];\n\n\t\tif (testParameter(lastComponent, options.removeDirectoryIndex)) {\n\t\t\tpathComponents = pathComponents.slice(0, pathComponents.length - 1);\n\t\t\turlObj.pathname = pathComponents.slice(1).join('/') + '/';\n\t\t}\n\t}\n\n\tif (urlObj.hostname) {\n\t\t// Remove trailing dot\n\t\turlObj.hostname = urlObj.hostname.replace(/\\.$/, '');\n\n\t\t// Remove `www.`\n\t\tif (options.stripWWW && /^www\\.(?!www\\.)(?:[a-z\\-\\d]{1,63})\\.(?:[a-z.\\-\\d]{2,63})$/.test(urlObj.hostname)) {\n\t\t\t// Each label should be max 63 at length (min: 1).\n\t\t\t// Source: https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names\n\t\t\t// Each TLD should be up to 63 characters long (min: 2).\n\t\t\t// It is technically possible to have a single character TLD, but none currently exist.\n\t\t\turlObj.hostname = urlObj.hostname.replace(/^www\\./, '');\n\t\t}\n\t}\n\n\t// Remove query unwanted parameters\n\tif (Array.isArray(options.removeQueryParameters)) {\n\t\tfor (const key of [...urlObj.searchParams.keys()]) {\n\t\t\tif (testParameter(key, options.removeQueryParameters)) {\n\t\t\t\turlObj.searchParams.delete(key);\n\t\t\t}\n\t\t}\n\t}\n\n\tif (options.removeQueryParameters === true) {\n\t\turlObj.search = '';\n\t}\n\n\t// Sort query parameters\n\tif (options.sortQueryParameters) {\n\t\turlObj.searchParams.sort();\n\t}\n\n\tif (options.removeTrailingSlash) {\n\t\turlObj.pathname = urlObj.pathname.replace(/\\/$/, '');\n\t}\n\n\tconst oldUrlString = urlString;\n\n\t// Take advantage of many of the Node `url` normalizations\n\turlString = urlObj.toString();\n\n\tif (!options.removeSingleSlash && urlObj.pathname === '/' && !oldUrlString.endsWith('/') && urlObj.hash === '') {\n\t\turlString = urlString.replace(/\\/$/, '');\n\t}\n\n\t// Remove ending `/` unless removeSingleSlash is false\n\tif ((options.removeTrailingSlash || urlObj.pathname === '/') && urlObj.hash === '' && options.removeSingleSlash) {\n\t\turlString = urlString.replace(/\\/$/, '');\n\t}\n\n\t// Restore relative protocol, if applicable\n\tif (hasRelativeProtocol && !options.normalizeProtocol) {\n\t\turlString = urlString.replace(/^http:\\/\\//, '//');\n\t}\n\n\t// Remove http/https\n\tif (options.stripProtocol) {\n\t\turlString = urlString.replace(/^(?:https?:)?\\/\\//, '');\n\t}\n\n\treturn urlString;\n};\n\nmodule.exports = normalizeUrl;\n","'use strict'\n\nmodule.exports = {\n afterRequest: require('./afterRequest.json'),\n beforeRequest: require('./beforeRequest.json'),\n browser: require('./browser.json'),\n cache: require('./cache.json'),\n content: require('./content.json'),\n cookie: require('./cookie.json'),\n creator: require('./creator.json'),\n entry: require('./entry.json'),\n har: require('./har.json'),\n header: require('./header.json'),\n log: require('./log.json'),\n page: require('./page.json'),\n pageTimings: require('./pageTimings.json'),\n postData: require('./postData.json'),\n query: require('./query.json'),\n request: require('./request.json'),\n response: require('./response.json'),\n timings: require('./timings.json')\n}\n","function HARError (errors) {\n var message = 'validation failed'\n\n this.name = 'HARError'\n this.message = message\n this.errors = errors\n\n if (typeof Error.captureStackTrace === 'function') {\n Error.captureStackTrace(this, this.constructor)\n } else {\n this.stack = (new Error(message)).stack\n }\n}\n\nHARError.prototype = Error.prototype\n\nmodule.exports = HARError\n","var Ajv = require('ajv')\nvar HARError = require('./error')\nvar schemas = require('har-schema')\n\nvar ajv\n\nfunction createAjvInstance () {\n var ajv = new Ajv({\n allErrors: true\n })\n ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'))\n ajv.addSchema(schemas)\n\n return ajv\n}\n\nfunction validate (name, data) {\n data = data || {}\n\n // validator config\n ajv = ajv || createAjvInstance()\n\n var validate = ajv.getSchema(name + '.json')\n\n return new Promise(function (resolve, reject) {\n var valid = validate(data)\n\n !valid ? reject(new HARError(validate.errors)) : resolve(data)\n })\n}\n\nexports.afterRequest = function (data) {\n return validate('afterRequest', data)\n}\n\nexports.beforeRequest = function (data) {\n return validate('beforeRequest', data)\n}\n\nexports.browser = function (data) {\n return validate('browser', data)\n}\n\nexports.cache = function (data) {\n return validate('cache', data)\n}\n\nexports.content = function (data) {\n return validate('content', data)\n}\n\nexports.cookie = function (data) {\n return validate('cookie', data)\n}\n\nexports.creator = function (data) {\n return validate('creator', data)\n}\n\nexports.entry = function (data) {\n return validate('entry', data)\n}\n\nexports.har = function (data) {\n return validate('har', data)\n}\n\nexports.header = function (data) {\n return validate('header', data)\n}\n\nexports.log = function (data) {\n return validate('log', data)\n}\n\nexports.page = function (data) {\n return validate('page', data)\n}\n\nexports.pageTimings = function (data) {\n return validate('pageTimings', data)\n}\n\nexports.postData = function (data) {\n return validate('postData', data)\n}\n\nexports.query = function (data) {\n return validate('query', data)\n}\n\nexports.request = function (data) {\n return validate('request', data)\n}\n\nexports.response = function (data) {\n return validate('response', data)\n}\n\nexports.timings = function (data) {\n return validate('timings', data)\n}\n","'use strict';\n// rfc7231 6.1\nconst statusCodeCacheableByDefault = new Set([\n 200,\n 203,\n 204,\n 206,\n 300,\n 301,\n 308,\n 404,\n 405,\n 410,\n 414,\n 501,\n]);\n\n// This implementation does not understand partial responses (206)\nconst understoodStatuses = new Set([\n 200,\n 203,\n 204,\n 300,\n 301,\n 302,\n 303,\n 307,\n 308,\n 404,\n 405,\n 410,\n 414,\n 501,\n]);\n\nconst errorStatusCodes = new Set([\n 500,\n 502,\n 503, \n 504,\n]);\n\nconst hopByHopHeaders = {\n date: true, // included, because we add Age update Date\n connection: true,\n 'keep-alive': true,\n 'proxy-authenticate': true,\n 'proxy-authorization': true,\n te: true,\n trailer: true,\n 'transfer-encoding': true,\n upgrade: true,\n};\n\nconst excludedFromRevalidationUpdate = {\n // Since the old body is reused, it doesn't make sense to change properties of the body\n 'content-length': true,\n 'content-encoding': true,\n 'transfer-encoding': true,\n 'content-range': true,\n};\n\nfunction toNumberOrZero(s) {\n const n = parseInt(s, 10);\n return isFinite(n) ? n : 0;\n}\n\n// RFC 5861\nfunction isErrorResponse(response) {\n // consider undefined response as faulty\n if(!response) {\n return true\n }\n return errorStatusCodes.has(response.status);\n}\n\nfunction parseCacheControl(header) {\n const cc = {};\n if (!header) return cc;\n\n // TODO: When there is more than one value present for a given directive (e.g., two Expires header fields, multiple Cache-Control: max-age directives),\n // the directive's value is considered invalid. Caches are encouraged to consider responses that have invalid freshness information to be stale\n const parts = header.trim().split(/,/);\n for (const part of parts) {\n const [k, v] = part.split(/=/, 2);\n cc[k.trim()] = v === undefined ? true : v.trim().replace(/^\"|\"$/g, '');\n }\n\n return cc;\n}\n\nfunction formatCacheControl(cc) {\n let parts = [];\n for (const k in cc) {\n const v = cc[k];\n parts.push(v === true ? k : k + '=' + v);\n }\n if (!parts.length) {\n return undefined;\n }\n return parts.join(', ');\n}\n\nmodule.exports = class CachePolicy {\n constructor(\n req,\n res,\n {\n shared,\n cacheHeuristic,\n immutableMinTimeToLive,\n ignoreCargoCult,\n _fromObject,\n } = {}\n ) {\n if (_fromObject) {\n this._fromObject(_fromObject);\n return;\n }\n\n if (!res || !res.headers) {\n throw Error('Response headers missing');\n }\n this._assertRequestHasHeaders(req);\n\n this._responseTime = this.now();\n this._isShared = shared !== false;\n this._cacheHeuristic =\n undefined !== cacheHeuristic ? cacheHeuristic : 0.1; // 10% matches IE\n this._immutableMinTtl =\n undefined !== immutableMinTimeToLive\n ? immutableMinTimeToLive\n : 24 * 3600 * 1000;\n\n this._status = 'status' in res ? res.status : 200;\n this._resHeaders = res.headers;\n this._rescc = parseCacheControl(res.headers['cache-control']);\n this._method = 'method' in req ? req.method : 'GET';\n this._url = req.url;\n this._host = req.headers.host;\n this._noAuthorization = !req.headers.authorization;\n this._reqHeaders = res.headers.vary ? req.headers : null; // Don't keep all request headers if they won't be used\n this._reqcc = parseCacheControl(req.headers['cache-control']);\n\n // Assume that if someone uses legacy, non-standard uncecessary options they don't understand caching,\n // so there's no point stricly adhering to the blindly copy&pasted directives.\n if (\n ignoreCargoCult &&\n 'pre-check' in this._rescc &&\n 'post-check' in this._rescc\n ) {\n delete this._rescc['pre-check'];\n delete this._rescc['post-check'];\n delete this._rescc['no-cache'];\n delete this._rescc['no-store'];\n delete this._rescc['must-revalidate'];\n this._resHeaders = Object.assign({}, this._resHeaders, {\n 'cache-control': formatCacheControl(this._rescc),\n });\n delete this._resHeaders.expires;\n delete this._resHeaders.pragma;\n }\n\n // When the Cache-Control header field is not present in a request, caches MUST consider the no-cache request pragma-directive\n // as having the same effect as if \"Cache-Control: no-cache\" were present (see Section 5.2.1).\n if (\n res.headers['cache-control'] == null &&\n /no-cache/.test(res.headers.pragma)\n ) {\n this._rescc['no-cache'] = true;\n }\n }\n\n now() {\n return Date.now();\n }\n\n storable() {\n // The \"no-store\" request directive indicates that a cache MUST NOT store any part of either this request or any response to it.\n return !!(\n !this._reqcc['no-store'] &&\n // A cache MUST NOT store a response to any request, unless:\n // The request method is understood by the cache and defined as being cacheable, and\n ('GET' === this._method ||\n 'HEAD' === this._method ||\n ('POST' === this._method && this._hasExplicitExpiration())) &&\n // the response status code is understood by the cache, and\n understoodStatuses.has(this._status) &&\n // the \"no-store\" cache directive does not appear in request or response header fields, and\n !this._rescc['no-store'] &&\n // the \"private\" response directive does not appear in the response, if the cache is shared, and\n (!this._isShared || !this._rescc.private) &&\n // the Authorization header field does not appear in the request, if the cache is shared,\n (!this._isShared ||\n this._noAuthorization ||\n this._allowsStoringAuthenticated()) &&\n // the response either:\n // contains an Expires header field, or\n (this._resHeaders.expires ||\n // contains a max-age response directive, or\n // contains a s-maxage response directive and the cache is shared, or\n // contains a public response directive.\n this._rescc['max-age'] ||\n (this._isShared && this._rescc['s-maxage']) ||\n this._rescc.public ||\n // has a status code that is defined as cacheable by default\n statusCodeCacheableByDefault.has(this._status))\n );\n }\n\n _hasExplicitExpiration() {\n // 4.2.1 Calculating Freshness Lifetime\n return (\n (this._isShared && this._rescc['s-maxage']) ||\n this._rescc['max-age'] ||\n this._resHeaders.expires\n );\n }\n\n _assertRequestHasHeaders(req) {\n if (!req || !req.headers) {\n throw Error('Request headers missing');\n }\n }\n\n satisfiesWithoutRevalidation(req) {\n this._assertRequestHasHeaders(req);\n\n // When presented with a request, a cache MUST NOT reuse a stored response, unless:\n // the presented request does not contain the no-cache pragma (Section 5.4), nor the no-cache cache directive,\n // unless the stored response is successfully validated (Section 4.3), and\n const requestCC = parseCacheControl(req.headers['cache-control']);\n if (requestCC['no-cache'] || /no-cache/.test(req.headers.pragma)) {\n return false;\n }\n\n if (requestCC['max-age'] && this.age() > requestCC['max-age']) {\n return false;\n }\n\n if (\n requestCC['min-fresh'] &&\n this.timeToLive() < 1000 * requestCC['min-fresh']\n ) {\n return false;\n }\n\n // the stored response is either:\n // fresh, or allowed to be served stale\n if (this.stale()) {\n const allowsStale =\n requestCC['max-stale'] &&\n !this._rescc['must-revalidate'] &&\n (true === requestCC['max-stale'] ||\n requestCC['max-stale'] > this.age() - this.maxAge());\n if (!allowsStale) {\n return false;\n }\n }\n\n return this._requestMatches(req, false);\n }\n\n _requestMatches(req, allowHeadMethod) {\n // The presented effective request URI and that of the stored response match, and\n return (\n (!this._url || this._url === req.url) &&\n this._host === req.headers.host &&\n // the request method associated with the stored response allows it to be used for the presented request, and\n (!req.method ||\n this._method === req.method ||\n (allowHeadMethod && 'HEAD' === req.method)) &&\n // selecting header fields nominated by the stored response (if any) match those presented, and\n this._varyMatches(req)\n );\n }\n\n _allowsStoringAuthenticated() {\n // following Cache-Control response directives (Section 5.2.2) have such an effect: must-revalidate, public, and s-maxage.\n return (\n this._rescc['must-revalidate'] ||\n this._rescc.public ||\n this._rescc['s-maxage']\n );\n }\n\n _varyMatches(req) {\n if (!this._resHeaders.vary) {\n return true;\n }\n\n // A Vary header field-value of \"*\" always fails to match\n if (this._resHeaders.vary === '*') {\n return false;\n }\n\n const fields = this._resHeaders.vary\n .trim()\n .toLowerCase()\n .split(/\\s*,\\s*/);\n for (const name of fields) {\n if (req.headers[name] !== this._reqHeaders[name]) return false;\n }\n return true;\n }\n\n _copyWithoutHopByHopHeaders(inHeaders) {\n const headers = {};\n for (const name in inHeaders) {\n if (hopByHopHeaders[name]) continue;\n headers[name] = inHeaders[name];\n }\n // 9.1. Connection\n if (inHeaders.connection) {\n const tokens = inHeaders.connection.trim().split(/\\s*,\\s*/);\n for (const name of tokens) {\n delete headers[name];\n }\n }\n if (headers.warning) {\n const warnings = headers.warning.split(/,/).filter(warning => {\n return !/^\\s*1[0-9][0-9]/.test(warning);\n });\n if (!warnings.length) {\n delete headers.warning;\n } else {\n headers.warning = warnings.join(',').trim();\n }\n }\n return headers;\n }\n\n responseHeaders() {\n const headers = this._copyWithoutHopByHopHeaders(this._resHeaders);\n const age = this.age();\n\n // A cache SHOULD generate 113 warning if it heuristically chose a freshness\n // lifetime greater than 24 hours and the response's age is greater than 24 hours.\n if (\n age > 3600 * 24 &&\n !this._hasExplicitExpiration() &&\n this.maxAge() > 3600 * 24\n ) {\n headers.warning =\n (headers.warning ? `${headers.warning}, ` : '') +\n '113 - \"rfc7234 5.5.4\"';\n }\n headers.age = `${Math.round(age)}`;\n headers.date = new Date(this.now()).toUTCString();\n return headers;\n }\n\n /**\n * Value of the Date response header or current time if Date was invalid\n * @return timestamp\n */\n date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }\n\n /**\n * Value of the Age header, in seconds, updated for the current time.\n * May be fractional.\n *\n * @return Number\n */\n age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }\n\n _ageValue() {\n return toNumberOrZero(this._resHeaders.age);\n }\n\n /**\n * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`.\n *\n * For an up-to-date value, see `timeToLive()`.\n *\n * @return Number\n */\n maxAge() {\n if (!this.storable() || this._rescc['no-cache']) {\n return 0;\n }\n\n // Shared responses with cookies are cacheable according to the RFC, but IMHO it'd be unwise to do so by default\n // so this implementation requires explicit opt-in via public header\n if (\n this._isShared &&\n (this._resHeaders['set-cookie'] &&\n !this._rescc.public &&\n !this._rescc.immutable)\n ) {\n return 0;\n }\n\n if (this._resHeaders.vary === '*') {\n return 0;\n }\n\n if (this._isShared) {\n if (this._rescc['proxy-revalidate']) {\n return 0;\n }\n // if a response includes the s-maxage directive, a shared cache recipient MUST ignore the Expires field.\n if (this._rescc['s-maxage']) {\n return toNumberOrZero(this._rescc['s-maxage']);\n }\n }\n\n // If a response includes a Cache-Control field with the max-age directive, a recipient MUST ignore the Expires field.\n if (this._rescc['max-age']) {\n return toNumberOrZero(this._rescc['max-age']);\n }\n\n const defaultMinTtl = this._rescc.immutable ? this._immutableMinTtl : 0;\n\n const serverDate = this.date();\n if (this._resHeaders.expires) {\n const expires = Date.parse(this._resHeaders.expires);\n // A cache recipient MUST interpret invalid date formats, especially the value \"0\", as representing a time in the past (i.e., \"already expired\").\n if (Number.isNaN(expires) || expires < serverDate) {\n return 0;\n }\n return Math.max(defaultMinTtl, (expires - serverDate) / 1000);\n }\n\n if (this._resHeaders['last-modified']) {\n const lastModified = Date.parse(this._resHeaders['last-modified']);\n if (isFinite(lastModified) && serverDate > lastModified) {\n return Math.max(\n defaultMinTtl,\n ((serverDate - lastModified) / 1000) * this._cacheHeuristic\n );\n }\n }\n\n return defaultMinTtl;\n }\n\n timeToLive() {\n const age = this.maxAge() - this.age();\n const staleIfErrorAge = age + toNumberOrZero(this._rescc['stale-if-error']);\n const staleWhileRevalidateAge = age + toNumberOrZero(this._rescc['stale-while-revalidate']);\n return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1000;\n }\n\n stale() {\n return this.maxAge() <= this.age();\n }\n\n _useStaleIfError() {\n return this.maxAge() + toNumberOrZero(this._rescc['stale-if-error']) > this.age();\n }\n\n useStaleWhileRevalidate() {\n return this.maxAge() + toNumberOrZero(this._rescc['stale-while-revalidate']) > this.age();\n }\n\n static fromObject(obj) {\n return new this(undefined, undefined, { _fromObject: obj });\n }\n\n _fromObject(obj) {\n if (this._responseTime) throw Error('Reinitialized');\n if (!obj || obj.v !== 1) throw Error('Invalid serialization');\n\n this._responseTime = obj.t;\n this._isShared = obj.sh;\n this._cacheHeuristic = obj.ch;\n this._immutableMinTtl =\n obj.imm !== undefined ? obj.imm : 24 * 3600 * 1000;\n this._status = obj.st;\n this._resHeaders = obj.resh;\n this._rescc = obj.rescc;\n this._method = obj.m;\n this._url = obj.u;\n this._host = obj.h;\n this._noAuthorization = obj.a;\n this._reqHeaders = obj.reqh;\n this._reqcc = obj.reqcc;\n }\n\n toObject() {\n return {\n v: 1,\n t: this._responseTime,\n sh: this._isShared,\n ch: this._cacheHeuristic,\n imm: this._immutableMinTtl,\n st: this._status,\n resh: this._resHeaders,\n rescc: this._rescc,\n m: this._method,\n u: this._url,\n h: this._host,\n a: this._noAuthorization,\n reqh: this._reqHeaders,\n reqcc: this._reqcc,\n };\n }\n\n /**\n * Headers for sending to the origin server to revalidate stale response.\n * Allows server to return 304 to allow reuse of the previous response.\n *\n * Hop by hop headers are always stripped.\n * Revalidation headers may be added or removed, depending on request.\n */\n revalidationHeaders(incomingReq) {\n this._assertRequestHasHeaders(incomingReq);\n const headers = this._copyWithoutHopByHopHeaders(incomingReq.headers);\n\n // This implementation does not understand range requests\n delete headers['if-range'];\n\n if (!this._requestMatches(incomingReq, true) || !this.storable()) {\n // revalidation allowed via HEAD\n // not for the same resource, or wasn't allowed to be cached anyway\n delete headers['if-none-match'];\n delete headers['if-modified-since'];\n return headers;\n }\n\n /* MUST send that entity-tag in any cache validation request (using If-Match or If-None-Match) if an entity-tag has been provided by the origin server. */\n if (this._resHeaders.etag) {\n headers['if-none-match'] = headers['if-none-match']\n ? `${headers['if-none-match']}, ${this._resHeaders.etag}`\n : this._resHeaders.etag;\n }\n\n // Clients MAY issue simple (non-subrange) GET requests with either weak validators or strong validators. Clients MUST NOT use weak validators in other forms of request.\n const forbidsWeakValidators =\n headers['accept-ranges'] ||\n headers['if-match'] ||\n headers['if-unmodified-since'] ||\n (this._method && this._method != 'GET');\n\n /* SHOULD send the Last-Modified value in non-subrange cache validation requests (using If-Modified-Since) if only a Last-Modified value has been provided by the origin server.\n Note: This implementation does not understand partial responses (206) */\n if (forbidsWeakValidators) {\n delete headers['if-modified-since'];\n\n if (headers['if-none-match']) {\n const etags = headers['if-none-match']\n .split(/,/)\n .filter(etag => {\n return !/^\\s*W\\//.test(etag);\n });\n if (!etags.length) {\n delete headers['if-none-match'];\n } else {\n headers['if-none-match'] = etags.join(',').trim();\n }\n }\n } else if (\n this._resHeaders['last-modified'] &&\n !headers['if-modified-since']\n ) {\n headers['if-modified-since'] = this._resHeaders['last-modified'];\n }\n\n return headers;\n }\n\n /**\n * Creates new CachePolicy with information combined from the previews response,\n * and the new revalidation response.\n *\n * Returns {policy, modified} where modified is a boolean indicating\n * whether the response body has been modified, and old cached body can't be used.\n *\n * @return {Object} {policy: CachePolicy, modified: Boolean}\n */\n revalidatedPolicy(request, response) {\n this._assertRequestHasHeaders(request);\n if(this._useStaleIfError() && isErrorResponse(response)) { // I consider the revalidation request unsuccessful\n return {\n modified: false,\n matches: false,\n policy: this,\n };\n }\n if (!response || !response.headers) {\n throw Error('Response headers missing');\n }\n\n // These aren't going to be supported exactly, since one CachePolicy object\n // doesn't know about all the other cached objects.\n let matches = false;\n if (response.status !== undefined && response.status != 304) {\n matches = false;\n } else if (\n response.headers.etag &&\n !/^\\s*W\\//.test(response.headers.etag)\n ) {\n // \"All of the stored responses with the same strong validator are selected.\n // If none of the stored responses contain the same strong validator,\n // then the cache MUST NOT use the new response to update any stored responses.\"\n matches =\n this._resHeaders.etag &&\n this._resHeaders.etag.replace(/^\\s*W\\//, '') ===\n response.headers.etag;\n } else if (this._resHeaders.etag && response.headers.etag) {\n // \"If the new response contains a weak validator and that validator corresponds\n // to one of the cache's stored responses,\n // then the most recent of those matching stored responses is selected for update.\"\n matches =\n this._resHeaders.etag.replace(/^\\s*W\\//, '') ===\n response.headers.etag.replace(/^\\s*W\\//, '');\n } else if (this._resHeaders['last-modified']) {\n matches =\n this._resHeaders['last-modified'] ===\n response.headers['last-modified'];\n } else {\n // If the new response does not include any form of validator (such as in the case where\n // a client generates an If-Modified-Since request from a source other than the Last-Modified\n // response header field), and there is only one stored response, and that stored response also\n // lacks a validator, then that stored response is selected for update.\n if (\n !this._resHeaders.etag &&\n !this._resHeaders['last-modified'] &&\n !response.headers.etag &&\n !response.headers['last-modified']\n ) {\n matches = true;\n }\n }\n\n if (!matches) {\n return {\n policy: new this.constructor(request, response),\n // Client receiving 304 without body, even if it's invalid/mismatched has no option\n // but to reuse a cached body. We don't have a good way to tell clients to do\n // error recovery in such case.\n modified: response.status != 304,\n matches: false,\n };\n }\n\n // use other header fields provided in the 304 (Not Modified) response to replace all instances\n // of the corresponding header fields in the stored response.\n const headers = {};\n for (const k in this._resHeaders) {\n headers[k] =\n k in response.headers && !excludedFromRevalidationUpdate[k]\n ? response.headers[k]\n : this._resHeaders[k];\n }\n\n const newResponse = Object.assign({}, response, {\n status: this._status,\n method: this._method,\n headers,\n });\n return {\n policy: new this.constructor(request, newResponse, {\n shared: this._isShared,\n cacheHeuristic: this._cacheHeuristic,\n immutableMinTimeToLive: this._immutableMinTtl,\n }),\n modified: false,\n matches: true,\n };\n }\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar parser = require('./parser');\nvar signer = require('./signer');\nvar verify = require('./verify');\nvar utils = require('./utils');\n\n\n\n///--- API\n\nmodule.exports = {\n\n parse: parser.parseRequest,\n parseRequest: parser.parseRequest,\n\n sign: signer.signRequest,\n signRequest: signer.signRequest,\n createSigner: signer.createSigner,\n isSigner: signer.isSigner,\n\n sshKeyToPEM: utils.sshKeyToPEM,\n sshKeyFingerprint: utils.fingerprint,\n pemToRsaSSHKey: utils.pemToRsaSSHKey,\n\n verify: verify.verifySignature,\n verifySignature: verify.verifySignature,\n verifyHMAC: verify.verifyHMAC\n};\n","// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = require('assert-plus');\nvar util = require('util');\nvar utils = require('./utils');\n\n\n\n///--- Globals\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\nvar State = {\n New: 0,\n Params: 1\n};\n\nvar ParamsState = {\n Name: 0,\n Quote: 1,\n Value: 2,\n Comma: 3\n};\n\n\n///--- Specific Errors\n\n\nfunction ExpiredRequestError(message) {\n HttpSignatureError.call(this, message, ExpiredRequestError);\n}\nutil.inherits(ExpiredRequestError, HttpSignatureError);\n\n\nfunction InvalidHeaderError(message) {\n HttpSignatureError.call(this, message, InvalidHeaderError);\n}\nutil.inherits(InvalidHeaderError, HttpSignatureError);\n\n\nfunction InvalidParamsError(message) {\n HttpSignatureError.call(this, message, InvalidParamsError);\n}\nutil.inherits(InvalidParamsError, HttpSignatureError);\n\n\nfunction MissingHeaderError(message) {\n HttpSignatureError.call(this, message, MissingHeaderError);\n}\nutil.inherits(MissingHeaderError, HttpSignatureError);\n\nfunction StrictParsingError(message) {\n HttpSignatureError.call(this, message, StrictParsingError);\n}\nutil.inherits(StrictParsingError, HttpSignatureError);\n\n///--- Exported API\n\nmodule.exports = {\n\n /**\n * Parses the 'Authorization' header out of an http.ServerRequest object.\n *\n * Note that this API will fully validate the Authorization header, and throw\n * on any error. It will not however check the signature, or the keyId format\n * as those are specific to your environment. You can use the options object\n * to pass in extra constraints.\n *\n * As a response object you can expect this:\n *\n * {\n * \"scheme\": \"Signature\",\n * \"params\": {\n * \"keyId\": \"foo\",\n * \"algorithm\": \"rsa-sha256\",\n * \"headers\": [\n * \"date\" or \"x-date\",\n * \"digest\"\n * ],\n * \"signature\": \"base64\"\n * },\n * \"signingString\": \"ready to be passed to crypto.verify()\"\n * }\n *\n * @param {Object} request an http.ServerRequest.\n * @param {Object} options an optional options object with:\n * - clockSkew: allowed clock skew in seconds (default 300).\n * - headers: required header names (def: date or x-date)\n * - algorithms: algorithms to support (default: all).\n * - strict: should enforce latest spec parsing\n * (default: false).\n * @return {Object} parsed out object (see above).\n * @throws {TypeError} on invalid input.\n * @throws {InvalidHeaderError} on an invalid Authorization header error.\n * @throws {InvalidParamsError} if the params in the scheme are invalid.\n * @throws {MissingHeaderError} if the params indicate a header not present,\n * either in the request headers from the params,\n * or not in the params from a required header\n * in options.\n * @throws {StrictParsingError} if old attributes are used in strict parsing\n * mode.\n * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.\n */\n parseRequest: function parseRequest(request, options) {\n assert.object(request, 'request');\n assert.object(request.headers, 'request.headers');\n if (options === undefined) {\n options = {};\n }\n if (options.headers === undefined) {\n options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];\n }\n assert.object(options, 'options');\n assert.arrayOfString(options.headers, 'options.headers');\n assert.optionalFinite(options.clockSkew, 'options.clockSkew');\n\n var authzHeaderName = options.authorizationHeaderName || 'authorization';\n\n if (!request.headers[authzHeaderName]) {\n throw new MissingHeaderError('no ' + authzHeaderName + ' header ' +\n 'present in the request');\n }\n\n options.clockSkew = options.clockSkew || 300;\n\n\n var i = 0;\n var state = State.New;\n var substate = ParamsState.Name;\n var tmpName = '';\n var tmpValue = '';\n\n var parsed = {\n scheme: '',\n params: {},\n signingString: ''\n };\n\n var authz = request.headers[authzHeaderName];\n for (i = 0; i < authz.length; i++) {\n var c = authz.charAt(i);\n\n switch (Number(state)) {\n\n case State.New:\n if (c !== ' ') parsed.scheme += c;\n else state = State.Params;\n break;\n\n case State.Params:\n switch (Number(substate)) {\n\n case ParamsState.Name:\n var code = c.charCodeAt(0);\n // restricted name of A-Z / a-z\n if ((code >= 0x41 && code <= 0x5a) || // A-Z\n (code >= 0x61 && code <= 0x7a)) { // a-z\n tmpName += c;\n } else if (c === '=') {\n if (tmpName.length === 0)\n throw new InvalidHeaderError('bad param format');\n substate = ParamsState.Quote;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n case ParamsState.Quote:\n if (c === '\"') {\n tmpValue = '';\n substate = ParamsState.Value;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n case ParamsState.Value:\n if (c === '\"') {\n parsed.params[tmpName] = tmpValue;\n substate = ParamsState.Comma;\n } else {\n tmpValue += c;\n }\n break;\n\n case ParamsState.Comma:\n if (c === ',') {\n tmpName = '';\n substate = ParamsState.Name;\n } else {\n throw new InvalidHeaderError('bad param format');\n }\n break;\n\n default:\n throw new Error('Invalid substate');\n }\n break;\n\n default:\n throw new Error('Invalid substate');\n }\n\n }\n\n if (!parsed.params.headers || parsed.params.headers === '') {\n if (request.headers['x-date']) {\n parsed.params.headers = ['x-date'];\n } else {\n parsed.params.headers = ['date'];\n }\n } else {\n parsed.params.headers = parsed.params.headers.split(' ');\n }\n\n // Minimally validate the parsed object\n if (!parsed.scheme || parsed.scheme !== 'Signature')\n throw new InvalidHeaderError('scheme was not \"Signature\"');\n\n if (!parsed.params.keyId)\n throw new InvalidHeaderError('keyId was not specified');\n\n if (!parsed.params.algorithm)\n throw new InvalidHeaderError('algorithm was not specified');\n\n if (!parsed.params.signature)\n throw new InvalidHeaderError('signature was not specified');\n\n // Check the algorithm against the official list\n parsed.params.algorithm = parsed.params.algorithm.toLowerCase();\n try {\n validateAlgorithm(parsed.params.algorithm);\n } catch (e) {\n if (e instanceof InvalidAlgorithmError)\n throw (new InvalidParamsError(parsed.params.algorithm + ' is not ' +\n 'supported'));\n else\n throw (e);\n }\n\n // Build the signingString\n for (i = 0; i < parsed.params.headers.length; i++) {\n var h = parsed.params.headers[i].toLowerCase();\n parsed.params.headers[i] = h;\n\n if (h === 'request-line') {\n if (!options.strict) {\n /*\n * We allow headers from the older spec drafts if strict parsing isn't\n * specified in options.\n */\n parsed.signingString +=\n request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;\n } else {\n /* Strict parsing doesn't allow older draft headers. */\n throw (new StrictParsingError('request-line is not a valid header ' +\n 'with strict parsing enabled.'));\n }\n } else if (h === '(request-target)') {\n parsed.signingString +=\n '(request-target): ' + request.method.toLowerCase() + ' ' +\n request.url;\n } else {\n var value = request.headers[h];\n if (value === undefined)\n throw new MissingHeaderError(h + ' was not in the request');\n parsed.signingString += h + ': ' + value;\n }\n\n if ((i + 1) < parsed.params.headers.length)\n parsed.signingString += '\\n';\n }\n\n // Check against the constraints\n var date;\n if (request.headers.date || request.headers['x-date']) {\n if (request.headers['x-date']) {\n date = new Date(request.headers['x-date']);\n } else {\n date = new Date(request.headers.date);\n }\n var now = new Date();\n var skew = Math.abs(now.getTime() - date.getTime());\n\n if (skew > options.clockSkew * 1000) {\n throw new ExpiredRequestError('clock skew of ' +\n (skew / 1000) +\n 's was greater than ' +\n options.clockSkew + 's');\n }\n }\n\n options.headers.forEach(function (hdr) {\n // Remember that we already checked any headers in the params\n // were in the request, so if this passes we're good.\n if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0)\n throw new MissingHeaderError(hdr + ' was not a signed header');\n });\n\n if (options.algorithms) {\n if (options.algorithms.indexOf(parsed.params.algorithm) === -1)\n throw new InvalidParamsError(parsed.params.algorithm +\n ' is not a supported algorithm');\n }\n\n parsed.algorithm = parsed.params.algorithm.toUpperCase();\n parsed.keyId = parsed.params.keyId;\n return parsed;\n }\n\n};\n","// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = require('assert-plus');\nvar crypto = require('crypto');\nvar http = require('http');\nvar util = require('util');\nvar sshpk = require('sshpk');\nvar jsprim = require('jsprim');\nvar utils = require('./utils');\n\nvar sprintf = require('util').format;\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\n///--- Globals\n\nvar AUTHZ_FMT =\n 'Signature keyId=\"%s\",algorithm=\"%s\",headers=\"%s\",signature=\"%s\"';\n\n///--- Specific Errors\n\nfunction MissingHeaderError(message) {\n HttpSignatureError.call(this, message, MissingHeaderError);\n}\nutil.inherits(MissingHeaderError, HttpSignatureError);\n\nfunction StrictParsingError(message) {\n HttpSignatureError.call(this, message, StrictParsingError);\n}\nutil.inherits(StrictParsingError, HttpSignatureError);\n\n/* See createSigner() */\nfunction RequestSigner(options) {\n assert.object(options, 'options');\n\n var alg = [];\n if (options.algorithm !== undefined) {\n assert.string(options.algorithm, 'options.algorithm');\n alg = validateAlgorithm(options.algorithm);\n }\n this.rs_alg = alg;\n\n /*\n * RequestSigners come in two varieties: ones with an rs_signFunc, and ones\n * with an rs_signer.\n *\n * rs_signFunc-based RequestSigners have to build up their entire signing\n * string within the rs_lines array and give it to rs_signFunc as a single\n * concat'd blob. rs_signer-based RequestSigners can add a line at a time to\n * their signing state by using rs_signer.update(), thus only needing to\n * buffer the hash function state and one line at a time.\n */\n if (options.sign !== undefined) {\n assert.func(options.sign, 'options.sign');\n this.rs_signFunc = options.sign;\n\n } else if (alg[0] === 'hmac' && options.key !== undefined) {\n assert.string(options.keyId, 'options.keyId');\n this.rs_keyId = options.keyId;\n\n if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))\n throw (new TypeError('options.key for HMAC must be a string or Buffer'));\n\n /*\n * Make an rs_signer for HMACs, not a rs_signFunc -- HMACs digest their\n * data in chunks rather than requiring it all to be given in one go\n * at the end, so they are more similar to signers than signFuncs.\n */\n this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key);\n this.rs_signer.sign = function () {\n var digest = this.digest('base64');\n return ({\n hashAlgorithm: alg[1],\n toString: function () { return (digest); }\n });\n };\n\n } else if (options.key !== undefined) {\n var key = options.key;\n if (typeof (key) === 'string' || Buffer.isBuffer(key))\n key = sshpk.parsePrivateKey(key);\n\n assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),\n 'options.key must be a sshpk.PrivateKey');\n this.rs_key = key;\n\n assert.string(options.keyId, 'options.keyId');\n this.rs_keyId = options.keyId;\n\n if (!PK_ALGOS[key.type]) {\n throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +\n 'keys are not supported'));\n }\n\n if (alg[0] !== undefined && key.type !== alg[0]) {\n throw (new InvalidAlgorithmError('options.key must be a ' +\n alg[0].toUpperCase() + ' key, was given a ' +\n key.type.toUpperCase() + ' key instead'));\n }\n\n this.rs_signer = key.createSign(alg[1]);\n\n } else {\n throw (new TypeError('options.sign (func) or options.key is required'));\n }\n\n this.rs_headers = [];\n this.rs_lines = [];\n}\n\n/**\n * Adds a header to be signed, with its value, into this signer.\n *\n * @param {String} header\n * @param {String} value\n * @return {String} value written\n */\nRequestSigner.prototype.writeHeader = function (header, value) {\n assert.string(header, 'header');\n header = header.toLowerCase();\n assert.string(value, 'value');\n\n this.rs_headers.push(header);\n\n if (this.rs_signFunc) {\n this.rs_lines.push(header + ': ' + value);\n\n } else {\n var line = header + ': ' + value;\n if (this.rs_headers.length > 0)\n line = '\\n' + line;\n this.rs_signer.update(line);\n }\n\n return (value);\n};\n\n/**\n * Adds a default Date header, returning its value.\n *\n * @return {String}\n */\nRequestSigner.prototype.writeDateHeader = function () {\n return (this.writeHeader('date', jsprim.rfc1123(new Date())));\n};\n\n/**\n * Adds the request target line to be signed.\n *\n * @param {String} method, HTTP method (e.g. 'get', 'post', 'put')\n * @param {String} path\n */\nRequestSigner.prototype.writeTarget = function (method, path) {\n assert.string(method, 'method');\n assert.string(path, 'path');\n method = method.toLowerCase();\n this.writeHeader('(request-target)', method + ' ' + path);\n};\n\n/**\n * Calculate the value for the Authorization header on this request\n * asynchronously.\n *\n * @param {Func} callback (err, authz)\n */\nRequestSigner.prototype.sign = function (cb) {\n assert.func(cb, 'callback');\n\n if (this.rs_headers.length < 1)\n throw (new Error('At least one header must be signed'));\n\n var alg, authz;\n if (this.rs_signFunc) {\n var data = this.rs_lines.join('\\n');\n var self = this;\n this.rs_signFunc(data, function (err, sig) {\n if (err) {\n cb(err);\n return;\n }\n try {\n assert.object(sig, 'signature');\n assert.string(sig.keyId, 'signature.keyId');\n assert.string(sig.algorithm, 'signature.algorithm');\n assert.string(sig.signature, 'signature.signature');\n alg = validateAlgorithm(sig.algorithm);\n\n authz = sprintf(AUTHZ_FMT,\n sig.keyId,\n sig.algorithm,\n self.rs_headers.join(' '),\n sig.signature);\n } catch (e) {\n cb(e);\n return;\n }\n cb(null, authz);\n });\n\n } else {\n try {\n var sigObj = this.rs_signer.sign();\n } catch (e) {\n cb(e);\n return;\n }\n alg = (this.rs_alg[0] || this.rs_key.type) + '-' + sigObj.hashAlgorithm;\n var signature = sigObj.toString();\n authz = sprintf(AUTHZ_FMT,\n this.rs_keyId,\n alg,\n this.rs_headers.join(' '),\n signature);\n cb(null, authz);\n }\n};\n\n///--- Exported API\n\nmodule.exports = {\n /**\n * Identifies whether a given object is a request signer or not.\n *\n * @param {Object} object, the object to identify\n * @returns {Boolean}\n */\n isSigner: function (obj) {\n if (typeof (obj) === 'object' && obj instanceof RequestSigner)\n return (true);\n return (false);\n },\n\n /**\n * Creates a request signer, used to asynchronously build a signature\n * for a request (does not have to be an http.ClientRequest).\n *\n * @param {Object} options, either:\n * - {String} keyId\n * - {String|Buffer} key\n * - {String} algorithm (optional, required for HMAC)\n * or:\n * - {Func} sign (data, cb)\n * @return {RequestSigner}\n */\n createSigner: function createSigner(options) {\n return (new RequestSigner(options));\n },\n\n /**\n * Adds an 'Authorization' header to an http.ClientRequest object.\n *\n * Note that this API will add a Date header if it's not already set. Any\n * other headers in the options.headers array MUST be present, or this\n * will throw.\n *\n * You shouldn't need to check the return type; it's just there if you want\n * to be pedantic.\n *\n * The optional flag indicates whether parsing should use strict enforcement\n * of the version draft-cavage-http-signatures-04 of the spec or beyond.\n * The default is to be loose and support\n * older versions for compatibility.\n *\n * @param {Object} request an instance of http.ClientRequest.\n * @param {Object} options signing parameters object:\n * - {String} keyId required.\n * - {String} key required (either a PEM or HMAC key).\n * - {Array} headers optional; defaults to ['date'].\n * - {String} algorithm optional (unless key is HMAC);\n * default is the same as the sshpk default\n * signing algorithm for the type of key given\n * - {String} httpVersion optional; defaults to '1.1'.\n * - {Boolean} strict optional; defaults to 'false'.\n * @return {Boolean} true if Authorization (and optionally Date) were added.\n * @throws {TypeError} on bad parameter types (input).\n * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with\n * the given key.\n * @throws {sshpk.KeyParseError} if key was bad.\n * @throws {MissingHeaderError} if a header to be signed was specified but\n * was not present.\n */\n signRequest: function signRequest(request, options) {\n assert.object(request, 'request');\n assert.object(options, 'options');\n assert.optionalString(options.algorithm, 'options.algorithm');\n assert.string(options.keyId, 'options.keyId');\n assert.optionalArrayOfString(options.headers, 'options.headers');\n assert.optionalString(options.httpVersion, 'options.httpVersion');\n\n if (!request.getHeader('Date'))\n request.setHeader('Date', jsprim.rfc1123(new Date()));\n if (!options.headers)\n options.headers = ['date'];\n if (!options.httpVersion)\n options.httpVersion = '1.1';\n\n var alg = [];\n if (options.algorithm) {\n options.algorithm = options.algorithm.toLowerCase();\n alg = validateAlgorithm(options.algorithm);\n }\n\n var i;\n var stringToSign = '';\n for (i = 0; i < options.headers.length; i++) {\n if (typeof (options.headers[i]) !== 'string')\n throw new TypeError('options.headers must be an array of Strings');\n\n var h = options.headers[i].toLowerCase();\n\n if (h === 'request-line') {\n if (!options.strict) {\n /**\n * We allow headers from the older spec drafts if strict parsing isn't\n * specified in options.\n */\n stringToSign +=\n request.method + ' ' + request.path + ' HTTP/' +\n options.httpVersion;\n } else {\n /* Strict parsing doesn't allow older draft headers. */\n throw (new StrictParsingError('request-line is not a valid header ' +\n 'with strict parsing enabled.'));\n }\n } else if (h === '(request-target)') {\n stringToSign +=\n '(request-target): ' + request.method.toLowerCase() + ' ' +\n request.path;\n } else {\n var value = request.getHeader(h);\n if (value === undefined || value === '') {\n throw new MissingHeaderError(h + ' was not in the request');\n }\n stringToSign += h + ': ' + value;\n }\n\n if ((i + 1) < options.headers.length)\n stringToSign += '\\n';\n }\n\n /* This is just for unit tests. */\n if (request.hasOwnProperty('_stringToSign')) {\n request._stringToSign = stringToSign;\n }\n\n var signature;\n if (alg[0] === 'hmac') {\n if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))\n throw (new TypeError('options.key must be a string or Buffer'));\n\n var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key);\n hmac.update(stringToSign);\n signature = hmac.digest('base64');\n\n } else {\n var key = options.key;\n if (typeof (key) === 'string' || Buffer.isBuffer(key))\n key = sshpk.parsePrivateKey(options.key);\n\n assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),\n 'options.key must be a sshpk.PrivateKey');\n\n if (!PK_ALGOS[key.type]) {\n throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +\n 'keys are not supported'));\n }\n\n if (alg[0] !== undefined && key.type !== alg[0]) {\n throw (new InvalidAlgorithmError('options.key must be a ' +\n alg[0].toUpperCase() + ' key, was given a ' +\n key.type.toUpperCase() + ' key instead'));\n }\n\n var signer = key.createSign(alg[1]);\n signer.update(stringToSign);\n var sigObj = signer.sign();\n if (!HASH_ALGOS[sigObj.hashAlgorithm]) {\n throw (new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() +\n ' is not a supported hash algorithm'));\n }\n options.algorithm = key.type + '-' + sigObj.hashAlgorithm;\n signature = sigObj.toString();\n assert.notStrictEqual(signature, '', 'empty signature produced');\n }\n\n var authzHeaderName = options.authorizationHeaderName || 'Authorization';\n\n request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT,\n options.keyId,\n options.algorithm,\n options.headers.join(' '),\n signature));\n\n return true;\n }\n\n};\n","// Copyright 2012 Joyent, Inc. All rights reserved.\n\nvar assert = require('assert-plus');\nvar sshpk = require('sshpk');\nvar util = require('util');\n\nvar HASH_ALGOS = {\n 'sha1': true,\n 'sha256': true,\n 'sha512': true\n};\n\nvar PK_ALGOS = {\n 'rsa': true,\n 'dsa': true,\n 'ecdsa': true\n};\n\nfunction HttpSignatureError(message, caller) {\n if (Error.captureStackTrace)\n Error.captureStackTrace(this, caller || HttpSignatureError);\n\n this.message = message;\n this.name = caller.name;\n}\nutil.inherits(HttpSignatureError, Error);\n\nfunction InvalidAlgorithmError(message) {\n HttpSignatureError.call(this, message, InvalidAlgorithmError);\n}\nutil.inherits(InvalidAlgorithmError, HttpSignatureError);\n\nfunction validateAlgorithm(algorithm) {\n var alg = algorithm.toLowerCase().split('-');\n\n if (alg.length !== 2) {\n throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' +\n 'valid algorithm'));\n }\n\n if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) {\n throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' +\n 'are not supported'));\n }\n\n if (!HASH_ALGOS[alg[1]]) {\n throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' +\n 'supported hash algorithm'));\n }\n\n return (alg);\n}\n\n///--- API\n\nmodule.exports = {\n\n HASH_ALGOS: HASH_ALGOS,\n PK_ALGOS: PK_ALGOS,\n\n HttpSignatureError: HttpSignatureError,\n InvalidAlgorithmError: InvalidAlgorithmError,\n\n validateAlgorithm: validateAlgorithm,\n\n /**\n * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.\n *\n * The intent of this module is to interoperate with OpenSSL only,\n * specifically the node crypto module's `verify` method.\n *\n * @param {String} key an OpenSSH public key.\n * @return {String} PEM encoded form of the RSA public key.\n * @throws {TypeError} on bad input.\n * @throws {Error} on invalid ssh key formatted data.\n */\n sshKeyToPEM: function sshKeyToPEM(key) {\n assert.string(key, 'ssh_key');\n\n var k = sshpk.parseKey(key, 'ssh');\n return (k.toString('pem'));\n },\n\n\n /**\n * Generates an OpenSSH fingerprint from an ssh public key.\n *\n * @param {String} key an OpenSSH public key.\n * @return {String} key fingerprint.\n * @throws {TypeError} on bad input.\n * @throws {Error} if what you passed doesn't look like an ssh public key.\n */\n fingerprint: function fingerprint(key) {\n assert.string(key, 'ssh_key');\n\n var k = sshpk.parseKey(key, 'ssh');\n return (k.fingerprint('md5').toString('hex'));\n },\n\n /**\n * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)\n *\n * The reverse of the above function.\n */\n pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {\n assert.equal('string', typeof (pem), 'typeof pem');\n\n var k = sshpk.parseKey(pem, 'pem');\n k.comment = comment;\n return (k.toString('ssh'));\n }\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar assert = require('assert-plus');\nvar crypto = require('crypto');\nvar sshpk = require('sshpk');\nvar utils = require('./utils');\n\nvar HASH_ALGOS = utils.HASH_ALGOS;\nvar PK_ALGOS = utils.PK_ALGOS;\nvar InvalidAlgorithmError = utils.InvalidAlgorithmError;\nvar HttpSignatureError = utils.HttpSignatureError;\nvar validateAlgorithm = utils.validateAlgorithm;\n\n///--- Exported API\n\nmodule.exports = {\n /**\n * Verify RSA/DSA signature against public key. You are expected to pass in\n * an object that was returned from `parse()`.\n *\n * @param {Object} parsedSignature the object you got from `parse`.\n * @param {String} pubkey RSA/DSA private key PEM.\n * @return {Boolean} true if valid, false otherwise.\n * @throws {TypeError} if you pass in bad arguments.\n * @throws {InvalidAlgorithmError}\n */\n verifySignature: function verifySignature(parsedSignature, pubkey) {\n assert.object(parsedSignature, 'parsedSignature');\n if (typeof (pubkey) === 'string' || Buffer.isBuffer(pubkey))\n pubkey = sshpk.parseKey(pubkey);\n assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), 'pubkey must be a sshpk.Key');\n\n var alg = validateAlgorithm(parsedSignature.algorithm);\n if (alg[0] === 'hmac' || alg[0] !== pubkey.type)\n return (false);\n\n var v = pubkey.createVerify(alg[1]);\n v.update(parsedSignature.signingString);\n return (v.verify(parsedSignature.params.signature, 'base64'));\n },\n\n /**\n * Verify HMAC against shared secret. You are expected to pass in an object\n * that was returned from `parse()`.\n *\n * @param {Object} parsedSignature the object you got from `parse`.\n * @param {String} secret HMAC shared secret.\n * @return {Boolean} true if valid, false otherwise.\n * @throws {TypeError} if you pass in bad arguments.\n * @throws {InvalidAlgorithmError}\n */\n verifyHMAC: function verifyHMAC(parsedSignature, secret) {\n assert.object(parsedSignature, 'parsedHMAC');\n assert.string(secret, 'secret');\n\n var alg = validateAlgorithm(parsedSignature.algorithm);\n if (alg[0] !== 'hmac')\n return (false);\n\n var hashAlg = alg[1].toUpperCase();\n\n var hmac = crypto.createHmac(hashAlg, secret);\n hmac.update(parsedSignature.signingString);\n\n /*\n * Now double-hash to avoid leaking timing information - there's\n * no easy constant-time compare in JS, so we use this approach\n * instead. See for more info:\n * https://www.isecpartners.com/blog/2011/february/double-hmac-\n * verification.aspx\n */\n var h1 = crypto.createHmac(hashAlg, secret);\n h1.update(hmac.digest());\n h1 = h1.digest();\n var h2 = crypto.createHmac(hashAlg, secret);\n h2.update(new Buffer(parsedSignature.params.signature, 'base64'));\n h2 = h2.digest();\n\n /* Node 0.8 returns strings from .digest(). */\n if (typeof (h1) === 'string')\n return (h1 === h2);\n /* And node 0.10 lacks the .equals() method on Buffers. */\n if (Buffer.isBuffer(h1) && !h1.equals)\n return (h1.toString('binary') === h2.toString('binary'));\n\n return (h1.equals(h2));\n }\n};\n","'use strict';\nconst EventEmitter = require('events');\nconst tls = require('tls');\nconst http2 = require('http2');\nconst QuickLRU = require('quick-lru');\n\nconst kCurrentStreamsCount = Symbol('currentStreamsCount');\nconst kRequest = Symbol('request');\nconst kOriginSet = Symbol('cachedOriginSet');\nconst kGracefullyClosing = Symbol('gracefullyClosing');\n\nconst nameKeys = [\n\t// `http2.connect()` options\n\t'maxDeflateDynamicTableSize',\n\t'maxSessionMemory',\n\t'maxHeaderListPairs',\n\t'maxOutstandingPings',\n\t'maxReservedRemoteStreams',\n\t'maxSendHeaderBlockLength',\n\t'paddingStrategy',\n\n\t// `tls.connect()` options\n\t'localAddress',\n\t'path',\n\t'rejectUnauthorized',\n\t'minDHSize',\n\n\t// `tls.createSecureContext()` options\n\t'ca',\n\t'cert',\n\t'clientCertEngine',\n\t'ciphers',\n\t'key',\n\t'pfx',\n\t'servername',\n\t'minVersion',\n\t'maxVersion',\n\t'secureProtocol',\n\t'crl',\n\t'honorCipherOrder',\n\t'ecdhCurve',\n\t'dhparam',\n\t'secureOptions',\n\t'sessionIdContext'\n];\n\nconst getSortedIndex = (array, value, compare) => {\n\tlet low = 0;\n\tlet high = array.length;\n\n\twhile (low < high) {\n\t\tconst mid = (low + high) >>> 1;\n\n\t\t/* istanbul ignore next */\n\t\tif (compare(array[mid], value)) {\n\t\t\t// This never gets called because we use descending sort. Better to have this anyway.\n\t\t\tlow = mid + 1;\n\t\t} else {\n\t\t\thigh = mid;\n\t\t}\n\t}\n\n\treturn low;\n};\n\nconst compareSessions = (a, b) => {\n\treturn a.remoteSettings.maxConcurrentStreams > b.remoteSettings.maxConcurrentStreams;\n};\n\n// See https://tools.ietf.org/html/rfc8336\nconst closeCoveredSessions = (where, session) => {\n\t// Clients SHOULD NOT emit new requests on any connection whose Origin\n\t// Set is a proper subset of another connection's Origin Set, and they\n\t// SHOULD close it once all outstanding requests are satisfied.\n\tfor (const coveredSession of where) {\n\t\tif (\n\t\t\t// The set is a proper subset when its length is less than the other set.\n\t\t\tcoveredSession[kOriginSet].length < session[kOriginSet].length &&\n\n\t\t\t// And the other set includes all elements of the subset.\n\t\t\tcoveredSession[kOriginSet].every(origin => session[kOriginSet].includes(origin)) &&\n\n\t\t\t// Makes sure that the session can handle all requests from the covered session.\n\t\t\tcoveredSession[kCurrentStreamsCount] + session[kCurrentStreamsCount] <= session.remoteSettings.maxConcurrentStreams\n\t\t) {\n\t\t\t// This allows pending requests to finish and prevents making new requests.\n\t\t\tgracefullyClose(coveredSession);\n\t\t}\n\t}\n};\n\n// This is basically inverted `closeCoveredSessions(...)`.\nconst closeSessionIfCovered = (where, coveredSession) => {\n\tfor (const session of where) {\n\t\tif (\n\t\t\tcoveredSession[kOriginSet].length < session[kOriginSet].length &&\n\t\t\tcoveredSession[kOriginSet].every(origin => session[kOriginSet].includes(origin)) &&\n\t\t\tcoveredSession[kCurrentStreamsCount] + session[kCurrentStreamsCount] <= session.remoteSettings.maxConcurrentStreams\n\t\t) {\n\t\t\tgracefullyClose(coveredSession);\n\t\t}\n\t}\n};\n\nconst getSessions = ({agent, isFree}) => {\n\tconst result = {};\n\n\t// eslint-disable-next-line guard-for-in\n\tfor (const normalizedOptions in agent.sessions) {\n\t\tconst sessions = agent.sessions[normalizedOptions];\n\n\t\tconst filtered = sessions.filter(session => {\n\t\t\tconst result = session[Agent.kCurrentStreamsCount] < session.remoteSettings.maxConcurrentStreams;\n\n\t\t\treturn isFree ? result : !result;\n\t\t});\n\n\t\tif (filtered.length !== 0) {\n\t\t\tresult[normalizedOptions] = filtered;\n\t\t}\n\t}\n\n\treturn result;\n};\n\nconst gracefullyClose = session => {\n\tsession[kGracefullyClosing] = true;\n\n\tif (session[kCurrentStreamsCount] === 0) {\n\t\tsession.close();\n\t}\n};\n\nclass Agent extends EventEmitter {\n\tconstructor({timeout = 60000, maxSessions = Infinity, maxFreeSessions = 10, maxCachedTlsSessions = 100} = {}) {\n\t\tsuper();\n\n\t\t// A session is considered busy when its current streams count\n\t\t// is equal to or greater than the `maxConcurrentStreams` value.\n\n\t\t// A session is considered free when its current streams count\n\t\t// is less than the `maxConcurrentStreams` value.\n\n\t\t// SESSIONS[NORMALIZED_OPTIONS] = [];\n\t\tthis.sessions = {};\n\n\t\t// The queue for creating new sessions. It looks like this:\n\t\t// QUEUE[NORMALIZED_OPTIONS][NORMALIZED_ORIGIN] = ENTRY_FUNCTION\n\t\t//\n\t\t// The entry function has `listeners`, `completed` and `destroyed` properties.\n\t\t// `listeners` is an array of objects containing `resolve` and `reject` functions.\n\t\t// `completed` is a boolean. It's set to true after ENTRY_FUNCTION is executed.\n\t\t// `destroyed` is a boolean. If it's set to true, the session will be destroyed if hasn't connected yet.\n\t\tthis.queue = {};\n\n\t\t// Each session will use this timeout value.\n\t\tthis.timeout = timeout;\n\n\t\t// Max sessions in total\n\t\tthis.maxSessions = maxSessions;\n\n\t\t// Max free sessions in total\n\t\t// TODO: decreasing `maxFreeSessions` should close some sessions\n\t\tthis.maxFreeSessions = maxFreeSessions;\n\n\t\tthis._freeSessionsCount = 0;\n\t\tthis._sessionsCount = 0;\n\n\t\t// We don't support push streams by default.\n\t\tthis.settings = {\n\t\t\tenablePush: false\n\t\t};\n\n\t\t// Reusing TLS sessions increases performance.\n\t\tthis.tlsSessionCache = new QuickLRU({maxSize: maxCachedTlsSessions});\n\t}\n\n\tstatic normalizeOrigin(url, servername) {\n\t\tif (typeof url === 'string') {\n\t\t\turl = new URL(url);\n\t\t}\n\n\t\tif (servername && url.hostname !== servername) {\n\t\t\turl.hostname = servername;\n\t\t}\n\n\t\treturn url.origin;\n\t}\n\n\tnormalizeOptions(options) {\n\t\tlet normalized = '';\n\n\t\tif (options) {\n\t\t\tfor (const key of nameKeys) {\n\t\t\t\tif (options[key]) {\n\t\t\t\t\tnormalized += `:${options[key]}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn normalized;\n\t}\n\n\t_tryToCreateNewSession(normalizedOptions, normalizedOrigin) {\n\t\tif (!(normalizedOptions in this.queue) || !(normalizedOrigin in this.queue[normalizedOptions])) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst item = this.queue[normalizedOptions][normalizedOrigin];\n\n\t\t// The entry function can be run only once.\n\t\t// BUG: The session may be never created when:\n\t\t// - the first condition is false AND\n\t\t// - this function is never called with the same arguments in the future.\n\t\tif (this._sessionsCount < this.maxSessions && !item.completed) {\n\t\t\titem.completed = true;\n\n\t\t\titem();\n\t\t}\n\t}\n\n\tgetSession(origin, options, listeners) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tif (Array.isArray(listeners)) {\n\t\t\t\tlisteners = [...listeners];\n\n\t\t\t\t// Resolve the current promise ASAP, we're just moving the listeners.\n\t\t\t\t// They will be executed at a different time.\n\t\t\t\tresolve();\n\t\t\t} else {\n\t\t\t\tlisteners = [{resolve, reject}];\n\t\t\t}\n\n\t\t\tconst normalizedOptions = this.normalizeOptions(options);\n\t\t\tconst normalizedOrigin = Agent.normalizeOrigin(origin, options && options.servername);\n\n\t\t\tif (normalizedOrigin === undefined) {\n\t\t\t\tfor (const {reject} of listeners) {\n\t\t\t\t\treject(new TypeError('The `origin` argument needs to be a string or an URL object'));\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (normalizedOptions in this.sessions) {\n\t\t\t\tconst sessions = this.sessions[normalizedOptions];\n\n\t\t\t\tlet maxConcurrentStreams = -1;\n\t\t\t\tlet currentStreamsCount = -1;\n\t\t\t\tlet optimalSession;\n\n\t\t\t\t// We could just do this.sessions[normalizedOptions].find(...) but that isn't optimal.\n\t\t\t\t// Additionally, we are looking for session which has biggest current pending streams count.\n\t\t\t\tfor (const session of sessions) {\n\t\t\t\t\tconst sessionMaxConcurrentStreams = session.remoteSettings.maxConcurrentStreams;\n\n\t\t\t\t\tif (sessionMaxConcurrentStreams < maxConcurrentStreams) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (session[kOriginSet].includes(normalizedOrigin)) {\n\t\t\t\t\t\tconst sessionCurrentStreamsCount = session[kCurrentStreamsCount];\n\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tsessionCurrentStreamsCount >= sessionMaxConcurrentStreams ||\n\t\t\t\t\t\t\tsession[kGracefullyClosing] ||\n\t\t\t\t\t\t\t// Unfortunately the `close` event isn't called immediately,\n\t\t\t\t\t\t\t// so `session.destroyed` is `true`, but `session.closed` is `false`.\n\t\t\t\t\t\t\tsession.destroyed\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// We only need set this once.\n\t\t\t\t\t\tif (!optimalSession) {\n\t\t\t\t\t\t\tmaxConcurrentStreams = sessionMaxConcurrentStreams;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// We're looking for the session which has biggest current pending stream count,\n\t\t\t\t\t\t// in order to minimalize the amount of active sessions.\n\t\t\t\t\t\tif (sessionCurrentStreamsCount > currentStreamsCount) {\n\t\t\t\t\t\t\toptimalSession = session;\n\t\t\t\t\t\t\tcurrentStreamsCount = sessionCurrentStreamsCount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (optimalSession) {\n\t\t\t\t\t/* istanbul ignore next: safety check */\n\t\t\t\t\tif (listeners.length !== 1) {\n\t\t\t\t\t\tfor (const {reject} of listeners) {\n\t\t\t\t\t\t\tconst error = new Error(\n\t\t\t\t\t\t\t\t`Expected the length of listeners to be 1, got ${listeners.length}.\\n` +\n\t\t\t\t\t\t\t\t'Please report this to https://github.com/szmarczak/http2-wrapper/'\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tlisteners[0].resolve(optimalSession);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (normalizedOptions in this.queue) {\n\t\t\t\tif (normalizedOrigin in this.queue[normalizedOptions]) {\n\t\t\t\t\t// There's already an item in the queue, just attach ourselves to it.\n\t\t\t\t\tthis.queue[normalizedOptions][normalizedOrigin].listeners.push(...listeners);\n\n\t\t\t\t\t// This shouldn't be executed here.\n\t\t\t\t\t// See the comment inside _tryToCreateNewSession.\n\t\t\t\t\tthis._tryToCreateNewSession(normalizedOptions, normalizedOrigin);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tthis.queue[normalizedOptions] = {};\n\t\t\t}\n\n\t\t\t// The entry must be removed from the queue IMMEDIATELY when:\n\t\t\t// 1. the session connects successfully,\n\t\t\t// 2. an error occurs.\n\t\t\tconst removeFromQueue = () => {\n\t\t\t\t// Our entry can be replaced. We cannot remove the new one.\n\t\t\t\tif (normalizedOptions in this.queue && this.queue[normalizedOptions][normalizedOrigin] === entry) {\n\t\t\t\t\tdelete this.queue[normalizedOptions][normalizedOrigin];\n\n\t\t\t\t\tif (Object.keys(this.queue[normalizedOptions]).length === 0) {\n\t\t\t\t\t\tdelete this.queue[normalizedOptions];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// The main logic is here\n\t\t\tconst entry = () => {\n\t\t\t\tconst name = `${normalizedOrigin}:${normalizedOptions}`;\n\t\t\t\tlet receivedSettings = false;\n\n\t\t\t\ttry {\n\t\t\t\t\tconst session = http2.connect(origin, {\n\t\t\t\t\t\tcreateConnection: this.createConnection,\n\t\t\t\t\t\tsettings: this.settings,\n\t\t\t\t\t\tsession: this.tlsSessionCache.get(name),\n\t\t\t\t\t\t...options\n\t\t\t\t\t});\n\t\t\t\t\tsession[kCurrentStreamsCount] = 0;\n\t\t\t\t\tsession[kGracefullyClosing] = false;\n\n\t\t\t\t\tconst isFree = () => session[kCurrentStreamsCount] < session.remoteSettings.maxConcurrentStreams;\n\t\t\t\t\tlet wasFree = true;\n\n\t\t\t\t\tsession.socket.once('session', tlsSession => {\n\t\t\t\t\t\tthis.tlsSessionCache.set(name, tlsSession);\n\t\t\t\t\t});\n\n\t\t\t\t\tsession.once('error', error => {\n\t\t\t\t\t\t// Listeners are empty when the session successfully connected.\n\t\t\t\t\t\tfor (const {reject} of listeners) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// The connection got broken, purge the cache.\n\t\t\t\t\t\tthis.tlsSessionCache.delete(name);\n\t\t\t\t\t});\n\n\t\t\t\t\tsession.setTimeout(this.timeout, () => {\n\t\t\t\t\t\t// Terminates all streams owned by this session.\n\t\t\t\t\t\t// TODO: Maybe the streams should have a \"Session timed out\" error?\n\t\t\t\t\t\tsession.destroy();\n\t\t\t\t\t});\n\n\t\t\t\t\tsession.once('close', () => {\n\t\t\t\t\t\tif (receivedSettings) {\n\t\t\t\t\t\t\t// 1. If it wasn't free then no need to decrease because\n\t\t\t\t\t\t\t// it has been decreased already in session.request().\n\t\t\t\t\t\t\t// 2. `stream.once('close')` won't increment the count\n\t\t\t\t\t\t\t// because the session is already closed.\n\t\t\t\t\t\t\tif (wasFree) {\n\t\t\t\t\t\t\t\tthis._freeSessionsCount--;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthis._sessionsCount--;\n\n\t\t\t\t\t\t\t// This cannot be moved to the stream logic,\n\t\t\t\t\t\t\t// because there may be a session that hadn't made a single request.\n\t\t\t\t\t\t\tconst where = this.sessions[normalizedOptions];\n\t\t\t\t\t\t\twhere.splice(where.indexOf(session), 1);\n\n\t\t\t\t\t\t\tif (where.length === 0) {\n\t\t\t\t\t\t\t\tdelete this.sessions[normalizedOptions];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Broken connection\n\t\t\t\t\t\t\tconst error = new Error('Session closed without receiving a SETTINGS frame');\n\t\t\t\t\t\t\terror.code = 'HTTP2WRAPPER_NOSETTINGS';\n\n\t\t\t\t\t\t\tfor (const {reject} of listeners) {\n\t\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tremoveFromQueue();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// There may be another session awaiting.\n\t\t\t\t\t\tthis._tryToCreateNewSession(normalizedOptions, normalizedOrigin);\n\t\t\t\t\t});\n\n\t\t\t\t\t// Iterates over the queue and processes listeners.\n\t\t\t\t\tconst processListeners = () => {\n\t\t\t\t\t\tif (!(normalizedOptions in this.queue) || !isFree()) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tfor (const origin of session[kOriginSet]) {\n\t\t\t\t\t\t\tif (origin in this.queue[normalizedOptions]) {\n\t\t\t\t\t\t\t\tconst {listeners} = this.queue[normalizedOptions][origin];\n\n\t\t\t\t\t\t\t\t// Prevents session overloading.\n\t\t\t\t\t\t\t\twhile (listeners.length !== 0 && isFree()) {\n\t\t\t\t\t\t\t\t\t// We assume `resolve(...)` calls `request(...)` *directly*,\n\t\t\t\t\t\t\t\t\t// otherwise the session will get overloaded.\n\t\t\t\t\t\t\t\t\tlisteners.shift().resolve(session);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tconst where = this.queue[normalizedOptions];\n\t\t\t\t\t\t\t\tif (where[origin].listeners.length === 0) {\n\t\t\t\t\t\t\t\t\tdelete where[origin];\n\n\t\t\t\t\t\t\t\t\tif (Object.keys(where).length === 0) {\n\t\t\t\t\t\t\t\t\t\tdelete this.queue[normalizedOptions];\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// We're no longer free, no point in continuing.\n\t\t\t\t\t\t\t\tif (!isFree()) {\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\n\t\t\t\t\t// The Origin Set cannot shrink. No need to check if it suddenly became covered by another one.\n\t\t\t\t\tsession.on('origin', () => {\n\t\t\t\t\t\tsession[kOriginSet] = session.originSet;\n\n\t\t\t\t\t\tif (!isFree()) {\n\t\t\t\t\t\t\t// The session is full.\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprocessListeners();\n\n\t\t\t\t\t\t// Close covered sessions (if possible).\n\t\t\t\t\t\tcloseCoveredSessions(this.sessions[normalizedOptions], session);\n\t\t\t\t\t});\n\n\t\t\t\t\tsession.once('remoteSettings', () => {\n\t\t\t\t\t\t// Fix Node.js bug preventing the process from exiting\n\t\t\t\t\t\tsession.ref();\n\t\t\t\t\t\tsession.unref();\n\n\t\t\t\t\t\tthis._sessionsCount++;\n\n\t\t\t\t\t\t// The Agent could have been destroyed already.\n\t\t\t\t\t\tif (entry.destroyed) {\n\t\t\t\t\t\t\tconst error = new Error('Agent has been destroyed');\n\n\t\t\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\t\t\tlistener.reject(error);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsession.destroy();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tsession[kOriginSet] = session.originSet;\n\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconst where = this.sessions;\n\n\t\t\t\t\t\t\tif (normalizedOptions in where) {\n\t\t\t\t\t\t\t\tconst sessions = where[normalizedOptions];\n\t\t\t\t\t\t\t\tsessions.splice(getSortedIndex(sessions, session, compareSessions), 0, session);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\twhere[normalizedOptions] = [session];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tthis._freeSessionsCount += 1;\n\t\t\t\t\t\treceivedSettings = true;\n\n\t\t\t\t\t\tthis.emit('session', session);\n\n\t\t\t\t\t\tprocessListeners();\n\t\t\t\t\t\tremoveFromQueue();\n\n\t\t\t\t\t\t// TODO: Close last recently used (or least used?) session\n\t\t\t\t\t\tif (session[kCurrentStreamsCount] === 0 && this._freeSessionsCount > this.maxFreeSessions) {\n\t\t\t\t\t\t\tsession.close();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Check if we haven't managed to execute all listeners.\n\t\t\t\t\t\tif (listeners.length !== 0) {\n\t\t\t\t\t\t\t// Request for a new session with predefined listeners.\n\t\t\t\t\t\t\tthis.getSession(normalizedOrigin, options, listeners);\n\t\t\t\t\t\t\tlisteners.length = 0;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// `session.remoteSettings.maxConcurrentStreams` might get increased\n\t\t\t\t\t\tsession.on('remoteSettings', () => {\n\t\t\t\t\t\t\tprocessListeners();\n\n\t\t\t\t\t\t\t// In case the Origin Set changes\n\t\t\t\t\t\t\tcloseCoveredSessions(this.sessions[normalizedOptions], session);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n\t\t\t\t\t// Shim `session.request()` in order to catch all streams\n\t\t\t\t\tsession[kRequest] = session.request;\n\t\t\t\t\tsession.request = (headers, streamOptions) => {\n\t\t\t\t\t\tif (session[kGracefullyClosing]) {\n\t\t\t\t\t\t\tthrow new Error('The session is gracefully closing. No new streams are allowed.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst stream = session[kRequest](headers, streamOptions);\n\n\t\t\t\t\t\t// The process won't exit until the session is closed or all requests are gone.\n\t\t\t\t\t\tsession.ref();\n\n\t\t\t\t\t\t++session[kCurrentStreamsCount];\n\n\t\t\t\t\t\tif (session[kCurrentStreamsCount] === session.remoteSettings.maxConcurrentStreams) {\n\t\t\t\t\t\t\tthis._freeSessionsCount--;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tstream.once('close', () => {\n\t\t\t\t\t\t\twasFree = isFree();\n\n\t\t\t\t\t\t\t--session[kCurrentStreamsCount];\n\n\t\t\t\t\t\t\tif (!session.destroyed && !session.closed) {\n\t\t\t\t\t\t\t\tcloseSessionIfCovered(this.sessions[normalizedOptions], session);\n\n\t\t\t\t\t\t\t\tif (isFree() && !session.closed) {\n\t\t\t\t\t\t\t\t\tif (!wasFree) {\n\t\t\t\t\t\t\t\t\t\tthis._freeSessionsCount++;\n\n\t\t\t\t\t\t\t\t\t\twasFree = true;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tconst isEmpty = session[kCurrentStreamsCount] === 0;\n\n\t\t\t\t\t\t\t\t\tif (isEmpty) {\n\t\t\t\t\t\t\t\t\t\tsession.unref();\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tisEmpty &&\n\t\t\t\t\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\t\t\t\tthis._freeSessionsCount > this.maxFreeSessions ||\n\t\t\t\t\t\t\t\t\t\t\tsession[kGracefullyClosing]\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tsession.close();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tcloseCoveredSessions(this.sessions[normalizedOptions], session);\n\t\t\t\t\t\t\t\t\t\tprocessListeners();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treturn stream;\n\t\t\t\t\t};\n\t\t\t\t} catch (error) {\n\t\t\t\t\tfor (const listener of listeners) {\n\t\t\t\t\t\tlistener.reject(error);\n\t\t\t\t\t}\n\n\t\t\t\t\tremoveFromQueue();\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tentry.listeners = listeners;\n\t\t\tentry.completed = false;\n\t\t\tentry.destroyed = false;\n\n\t\t\tthis.queue[normalizedOptions][normalizedOrigin] = entry;\n\t\t\tthis._tryToCreateNewSession(normalizedOptions, normalizedOrigin);\n\t\t});\n\t}\n\n\trequest(origin, options, headers, streamOptions) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tthis.getSession(origin, options, [{\n\t\t\t\treject,\n\t\t\t\tresolve: session => {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresolve(session.request(headers, streamOptions));\n\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}]);\n\t\t});\n\t}\n\n\tcreateConnection(origin, options) {\n\t\treturn Agent.connect(origin, options);\n\t}\n\n\tstatic connect(origin, options) {\n\t\toptions.ALPNProtocols = ['h2'];\n\n\t\tconst port = origin.port || 443;\n\t\tconst host = origin.hostname || origin.host;\n\n\t\tif (typeof options.servername === 'undefined') {\n\t\t\toptions.servername = host;\n\t\t}\n\n\t\treturn tls.connect(port, host, options);\n\t}\n\n\tcloseFreeSessions() {\n\t\tfor (const sessions of Object.values(this.sessions)) {\n\t\t\tfor (const session of sessions) {\n\t\t\t\tif (session[kCurrentStreamsCount] === 0) {\n\t\t\t\t\tsession.close();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdestroy(reason) {\n\t\tfor (const sessions of Object.values(this.sessions)) {\n\t\t\tfor (const session of sessions) {\n\t\t\t\tsession.destroy(reason);\n\t\t\t}\n\t\t}\n\n\t\tfor (const entriesOfAuthority of Object.values(this.queue)) {\n\t\t\tfor (const entry of Object.values(entriesOfAuthority)) {\n\t\t\t\tentry.destroyed = true;\n\t\t\t}\n\t\t}\n\n\t\t// New requests should NOT attach to destroyed sessions\n\t\tthis.queue = {};\n\t}\n\n\tget freeSessions() {\n\t\treturn getSessions({agent: this, isFree: true});\n\t}\n\n\tget busySessions() {\n\t\treturn getSessions({agent: this, isFree: false});\n\t}\n}\n\nAgent.kCurrentStreamsCount = kCurrentStreamsCount;\nAgent.kGracefullyClosing = kGracefullyClosing;\n\nmodule.exports = {\n\tAgent,\n\tglobalAgent: new Agent()\n};\n","'use strict';\nconst http = require('http');\nconst https = require('https');\nconst resolveALPN = require('resolve-alpn');\nconst QuickLRU = require('quick-lru');\nconst Http2ClientRequest = require('./client-request');\nconst calculateServerName = require('./utils/calculate-server-name');\nconst urlToOptions = require('./utils/url-to-options');\n\nconst cache = new QuickLRU({maxSize: 100});\nconst queue = new Map();\n\nconst installSocket = (agent, socket, options) => {\n\tsocket._httpMessage = {shouldKeepAlive: true};\n\n\tconst onFree = () => {\n\t\tagent.emit('free', socket, options);\n\t};\n\n\tsocket.on('free', onFree);\n\n\tconst onClose = () => {\n\t\tagent.removeSocket(socket, options);\n\t};\n\n\tsocket.on('close', onClose);\n\n\tconst onRemove = () => {\n\t\tagent.removeSocket(socket, options);\n\t\tsocket.off('close', onClose);\n\t\tsocket.off('free', onFree);\n\t\tsocket.off('agentRemove', onRemove);\n\t};\n\n\tsocket.on('agentRemove', onRemove);\n\n\tagent.emit('free', socket, options);\n};\n\nconst resolveProtocol = async options => {\n\tconst name = `${options.host}:${options.port}:${options.ALPNProtocols.sort()}`;\n\n\tif (!cache.has(name)) {\n\t\tif (queue.has(name)) {\n\t\t\tconst result = await queue.get(name);\n\t\t\treturn result.alpnProtocol;\n\t\t}\n\n\t\tconst {path, agent} = options;\n\t\toptions.path = options.socketPath;\n\n\t\tconst resultPromise = resolveALPN(options);\n\t\tqueue.set(name, resultPromise);\n\n\t\ttry {\n\t\t\tconst {socket, alpnProtocol} = await resultPromise;\n\t\t\tcache.set(name, alpnProtocol);\n\n\t\t\toptions.path = path;\n\n\t\t\tif (alpnProtocol === 'h2') {\n\t\t\t\t// https://github.com/nodejs/node/issues/33343\n\t\t\t\tsocket.destroy();\n\t\t\t} else {\n\t\t\t\tconst {globalAgent} = https;\n\t\t\t\tconst defaultCreateConnection = https.Agent.prototype.createConnection;\n\n\t\t\t\tif (agent) {\n\t\t\t\t\tif (agent.createConnection === defaultCreateConnection) {\n\t\t\t\t\t\tinstallSocket(agent, socket, options);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsocket.destroy();\n\t\t\t\t\t}\n\t\t\t\t} else if (globalAgent.createConnection === defaultCreateConnection) {\n\t\t\t\t\tinstallSocket(globalAgent, socket, options);\n\t\t\t\t} else {\n\t\t\t\t\tsocket.destroy();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tqueue.delete(name);\n\n\t\t\treturn alpnProtocol;\n\t\t} catch (error) {\n\t\t\tqueue.delete(name);\n\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\treturn cache.get(name);\n};\n\nmodule.exports = async (input, options, callback) => {\n\tif (typeof input === 'string' || input instanceof URL) {\n\t\tinput = urlToOptions(new URL(input));\n\t}\n\n\tif (typeof options === 'function') {\n\t\tcallback = options;\n\t\toptions = undefined;\n\t}\n\n\toptions = {\n\t\tALPNProtocols: ['h2', 'http/1.1'],\n\t\t...input,\n\t\t...options,\n\t\tresolveSocket: true\n\t};\n\n\tif (!Array.isArray(options.ALPNProtocols) || options.ALPNProtocols.length === 0) {\n\t\tthrow new Error('The `ALPNProtocols` option must be an Array with at least one entry');\n\t}\n\n\toptions.protocol = options.protocol || 'https:';\n\tconst isHttps = options.protocol === 'https:';\n\n\toptions.host = options.hostname || options.host || 'localhost';\n\toptions.session = options.tlsSession;\n\toptions.servername = options.servername || calculateServerName(options);\n\toptions.port = options.port || (isHttps ? 443 : 80);\n\toptions._defaultAgent = isHttps ? https.globalAgent : http.globalAgent;\n\n\tconst agents = options.agent;\n\n\tif (agents) {\n\t\tif (agents.addRequest) {\n\t\t\tthrow new Error('The `options.agent` object can contain only `http`, `https` or `http2` properties');\n\t\t}\n\n\t\toptions.agent = agents[isHttps ? 'https' : 'http'];\n\t}\n\n\tif (isHttps) {\n\t\tconst protocol = await resolveProtocol(options);\n\n\t\tif (protocol === 'h2') {\n\t\t\tif (agents) {\n\t\t\t\toptions.agent = agents.http2;\n\t\t\t}\n\n\t\t\treturn new Http2ClientRequest(options, callback);\n\t\t}\n\t}\n\n\treturn http.request(options, callback);\n};\n\nmodule.exports.protocolCache = cache;\n","'use strict';\nconst http2 = require('http2');\nconst {Writable} = require('stream');\nconst {Agent, globalAgent} = require('./agent');\nconst IncomingMessage = require('./incoming-message');\nconst urlToOptions = require('./utils/url-to-options');\nconst proxyEvents = require('./utils/proxy-events');\nconst isRequestPseudoHeader = require('./utils/is-request-pseudo-header');\nconst {\n\tERR_INVALID_ARG_TYPE,\n\tERR_INVALID_PROTOCOL,\n\tERR_HTTP_HEADERS_SENT,\n\tERR_INVALID_HTTP_TOKEN,\n\tERR_HTTP_INVALID_HEADER_VALUE,\n\tERR_INVALID_CHAR\n} = require('./utils/errors');\n\nconst {\n\tHTTP2_HEADER_STATUS,\n\tHTTP2_HEADER_METHOD,\n\tHTTP2_HEADER_PATH,\n\tHTTP2_METHOD_CONNECT\n} = http2.constants;\n\nconst kHeaders = Symbol('headers');\nconst kOrigin = Symbol('origin');\nconst kSession = Symbol('session');\nconst kOptions = Symbol('options');\nconst kFlushedHeaders = Symbol('flushedHeaders');\nconst kJobs = Symbol('jobs');\n\nconst isValidHttpToken = /^[\\^`\\-\\w!#$%&*+.|~]+$/;\nconst isInvalidHeaderValue = /[^\\t\\u0020-\\u007E\\u0080-\\u00FF]/;\n\nclass ClientRequest extends Writable {\n\tconstructor(input, options, callback) {\n\t\tsuper({\n\t\t\tautoDestroy: false\n\t\t});\n\n\t\tconst hasInput = typeof input === 'string' || input instanceof URL;\n\t\tif (hasInput) {\n\t\t\tinput = urlToOptions(input instanceof URL ? input : new URL(input));\n\t\t}\n\n\t\tif (typeof options === 'function' || options === undefined) {\n\t\t\t// (options, callback)\n\t\t\tcallback = options;\n\t\t\toptions = hasInput ? input : {...input};\n\t\t} else {\n\t\t\t// (input, options, callback)\n\t\t\toptions = {...input, ...options};\n\t\t}\n\n\t\tif (options.h2session) {\n\t\t\tthis[kSession] = options.h2session;\n\t\t} else if (options.agent === false) {\n\t\t\tthis.agent = new Agent({maxFreeSessions: 0});\n\t\t} else if (typeof options.agent === 'undefined' || options.agent === null) {\n\t\t\tif (typeof options.createConnection === 'function') {\n\t\t\t\t// This is a workaround - we don't have to create the session on our own.\n\t\t\t\tthis.agent = new Agent({maxFreeSessions: 0});\n\t\t\t\tthis.agent.createConnection = options.createConnection;\n\t\t\t} else {\n\t\t\t\tthis.agent = globalAgent;\n\t\t\t}\n\t\t} else if (typeof options.agent.request === 'function') {\n\t\t\tthis.agent = options.agent;\n\t\t} else {\n\t\t\tthrow new ERR_INVALID_ARG_TYPE('options.agent', ['Agent-like Object', 'undefined', 'false'], options.agent);\n\t\t}\n\n\t\tif (options.protocol && options.protocol !== 'https:') {\n\t\t\tthrow new ERR_INVALID_PROTOCOL(options.protocol, 'https:');\n\t\t}\n\n\t\tconst port = options.port || options.defaultPort || (this.agent && this.agent.defaultPort) || 443;\n\t\tconst host = options.hostname || options.host || 'localhost';\n\n\t\t// Don't enforce the origin via options. It may be changed in an Agent.\n\t\tdelete options.hostname;\n\t\tdelete options.host;\n\t\tdelete options.port;\n\n\t\tconst {timeout} = options;\n\t\toptions.timeout = undefined;\n\n\t\tthis[kHeaders] = Object.create(null);\n\t\tthis[kJobs] = [];\n\n\t\tthis.socket = null;\n\t\tthis.connection = null;\n\n\t\tthis.method = options.method || 'GET';\n\t\tthis.path = options.path;\n\n\t\tthis.res = null;\n\t\tthis.aborted = false;\n\t\tthis.reusedSocket = false;\n\n\t\tif (options.headers) {\n\t\t\tfor (const [header, value] of Object.entries(options.headers)) {\n\t\t\t\tthis.setHeader(header, value);\n\t\t\t}\n\t\t}\n\n\t\tif (options.auth && !('authorization' in this[kHeaders])) {\n\t\t\tthis[kHeaders].authorization = 'Basic ' + Buffer.from(options.auth).toString('base64');\n\t\t}\n\n\t\toptions.session = options.tlsSession;\n\t\toptions.path = options.socketPath;\n\n\t\tthis[kOptions] = options;\n\n\t\t// Clients that generate HTTP/2 requests directly SHOULD use the :authority pseudo-header field instead of the Host header field.\n\t\tif (port === 443) {\n\t\t\tthis[kOrigin] = `https://${host}`;\n\n\t\t\tif (!(':authority' in this[kHeaders])) {\n\t\t\t\tthis[kHeaders][':authority'] = host;\n\t\t\t}\n\t\t} else {\n\t\t\tthis[kOrigin] = `https://${host}:${port}`;\n\n\t\t\tif (!(':authority' in this[kHeaders])) {\n\t\t\t\tthis[kHeaders][':authority'] = `${host}:${port}`;\n\t\t\t}\n\t\t}\n\n\t\tif (timeout) {\n\t\t\tthis.setTimeout(timeout);\n\t\t}\n\n\t\tif (callback) {\n\t\t\tthis.once('response', callback);\n\t\t}\n\n\t\tthis[kFlushedHeaders] = false;\n\t}\n\n\tget method() {\n\t\treturn this[kHeaders][HTTP2_HEADER_METHOD];\n\t}\n\n\tset method(value) {\n\t\tif (value) {\n\t\t\tthis[kHeaders][HTTP2_HEADER_METHOD] = value.toUpperCase();\n\t\t}\n\t}\n\n\tget path() {\n\t\treturn this[kHeaders][HTTP2_HEADER_PATH];\n\t}\n\n\tset path(value) {\n\t\tif (value) {\n\t\t\tthis[kHeaders][HTTP2_HEADER_PATH] = value;\n\t\t}\n\t}\n\n\tget _mustNotHaveABody() {\n\t\treturn this.method === 'GET' || this.method === 'HEAD' || this.method === 'DELETE';\n\t}\n\n\t_write(chunk, encoding, callback) {\n\t\t// https://github.com/nodejs/node/blob/654df09ae0c5e17d1b52a900a545f0664d8c7627/lib/internal/http2/util.js#L148-L156\n\t\tif (this._mustNotHaveABody) {\n\t\t\tcallback(new Error('The GET, HEAD and DELETE methods must NOT have a body'));\n\t\t\t/* istanbul ignore next: Node.js 12 throws directly */\n\t\t\treturn;\n\t\t}\n\n\t\tthis.flushHeaders();\n\n\t\tconst callWrite = () => this._request.write(chunk, encoding, callback);\n\t\tif (this._request) {\n\t\t\tcallWrite();\n\t\t} else {\n\t\t\tthis[kJobs].push(callWrite);\n\t\t}\n\t}\n\n\t_final(callback) {\n\t\tif (this.destroyed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.flushHeaders();\n\n\t\tconst callEnd = () => {\n\t\t\t// For GET, HEAD and DELETE\n\t\t\tif (this._mustNotHaveABody) {\n\t\t\t\tcallback();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._request.end(callback);\n\t\t};\n\n\t\tif (this._request) {\n\t\t\tcallEnd();\n\t\t} else {\n\t\t\tthis[kJobs].push(callEnd);\n\t\t}\n\t}\n\n\tabort() {\n\t\tif (this.res && this.res.complete) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!this.aborted) {\n\t\t\tprocess.nextTick(() => this.emit('abort'));\n\t\t}\n\n\t\tthis.aborted = true;\n\n\t\tthis.destroy();\n\t}\n\n\t_destroy(error, callback) {\n\t\tif (this.res) {\n\t\t\tthis.res._dump();\n\t\t}\n\n\t\tif (this._request) {\n\t\t\tthis._request.destroy();\n\t\t}\n\n\t\tcallback(error);\n\t}\n\n\tasync flushHeaders() {\n\t\tif (this[kFlushedHeaders] || this.destroyed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis[kFlushedHeaders] = true;\n\n\t\tconst isConnectMethod = this.method === HTTP2_METHOD_CONNECT;\n\n\t\t// The real magic is here\n\t\tconst onStream = stream => {\n\t\t\tthis._request = stream;\n\n\t\t\tif (this.destroyed) {\n\t\t\t\tstream.destroy();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Forwards `timeout`, `continue`, `close` and `error` events to this instance.\n\t\t\tif (!isConnectMethod) {\n\t\t\t\tproxyEvents(stream, this, ['timeout', 'continue', 'close', 'error']);\n\t\t\t}\n\n\t\t\t// Wait for the `finish` event. We don't want to emit the `response` event\n\t\t\t// before `request.end()` is called.\n\t\t\tconst waitForEnd = fn => {\n\t\t\t\treturn (...args) => {\n\t\t\t\t\tif (!this.writable && !this.destroyed) {\n\t\t\t\t\t\tfn(...args);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.once('finish', () => {\n\t\t\t\t\t\t\tfn(...args);\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t};\n\n\t\t\t// This event tells we are ready to listen for the data.\n\t\t\tstream.once('response', waitForEnd((headers, flags, rawHeaders) => {\n\t\t\t\t// If we were to emit raw request stream, it would be as fast as the native approach.\n\t\t\t\t// Note that wrapping the raw stream in a Proxy instance won't improve the performance (already tested it).\n\t\t\t\tconst response = new IncomingMessage(this.socket, stream.readableHighWaterMark);\n\t\t\t\tthis.res = response;\n\n\t\t\t\tresponse.req = this;\n\t\t\t\tresponse.statusCode = headers[HTTP2_HEADER_STATUS];\n\t\t\t\tresponse.headers = headers;\n\t\t\t\tresponse.rawHeaders = rawHeaders;\n\n\t\t\t\tresponse.once('end', () => {\n\t\t\t\t\tif (this.aborted) {\n\t\t\t\t\t\tresponse.aborted = true;\n\t\t\t\t\t\tresponse.emit('aborted');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresponse.complete = true;\n\n\t\t\t\t\t\t// Has no effect, just be consistent with the Node.js behavior\n\t\t\t\t\t\tresponse.socket = null;\n\t\t\t\t\t\tresponse.connection = null;\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (isConnectMethod) {\n\t\t\t\t\tresponse.upgrade = true;\n\n\t\t\t\t\t// The HTTP1 API says the socket is detached here,\n\t\t\t\t\t// but we can't do that so we pass the original HTTP2 request.\n\t\t\t\t\tif (this.emit('connect', response, stream, Buffer.alloc(0))) {\n\t\t\t\t\t\tthis.emit('close');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// No listeners attached, destroy the original request.\n\t\t\t\t\t\tstream.destroy();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// Forwards data\n\t\t\t\t\tstream.on('data', chunk => {\n\t\t\t\t\t\tif (!response._dumped && !response.push(chunk)) {\n\t\t\t\t\t\t\tstream.pause();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tstream.once('end', () => {\n\t\t\t\t\t\tresponse.push(null);\n\t\t\t\t\t});\n\n\t\t\t\t\tif (!this.emit('response', response)) {\n\t\t\t\t\t\t// No listeners attached, dump the response.\n\t\t\t\t\t\tresponse._dump();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}));\n\n\t\t\t// Emits `information` event\n\t\t\tstream.once('headers', waitForEnd(\n\t\t\t\theaders => this.emit('information', {statusCode: headers[HTTP2_HEADER_STATUS]})\n\t\t\t));\n\n\t\t\tstream.once('trailers', waitForEnd((trailers, flags, rawTrailers) => {\n\t\t\t\tconst {res} = this;\n\n\t\t\t\t// Assigns trailers to the response object.\n\t\t\t\tres.trailers = trailers;\n\t\t\t\tres.rawTrailers = rawTrailers;\n\t\t\t}));\n\n\t\t\tconst {socket} = stream.session;\n\t\t\tthis.socket = socket;\n\t\t\tthis.connection = socket;\n\n\t\t\tfor (const job of this[kJobs]) {\n\t\t\t\tjob();\n\t\t\t}\n\n\t\t\tthis.emit('socket', this.socket);\n\t\t};\n\n\t\t// Makes a HTTP2 request\n\t\tif (this[kSession]) {\n\t\t\ttry {\n\t\t\t\tonStream(this[kSession].request(this[kHeaders]));\n\t\t\t} catch (error) {\n\t\t\t\tthis.emit('error', error);\n\t\t\t}\n\t\t} else {\n\t\t\tthis.reusedSocket = true;\n\n\t\t\ttry {\n\t\t\t\tonStream(await this.agent.request(this[kOrigin], this[kOptions], this[kHeaders]));\n\t\t\t} catch (error) {\n\t\t\t\tthis.emit('error', error);\n\t\t\t}\n\t\t}\n\t}\n\n\tgetHeader(name) {\n\t\tif (typeof name !== 'string') {\n\t\t\tthrow new ERR_INVALID_ARG_TYPE('name', 'string', name);\n\t\t}\n\n\t\treturn this[kHeaders][name.toLowerCase()];\n\t}\n\n\tget headersSent() {\n\t\treturn this[kFlushedHeaders];\n\t}\n\n\tremoveHeader(name) {\n\t\tif (typeof name !== 'string') {\n\t\t\tthrow new ERR_INVALID_ARG_TYPE('name', 'string', name);\n\t\t}\n\n\t\tif (this.headersSent) {\n\t\t\tthrow new ERR_HTTP_HEADERS_SENT('remove');\n\t\t}\n\n\t\tdelete this[kHeaders][name.toLowerCase()];\n\t}\n\n\tsetHeader(name, value) {\n\t\tif (this.headersSent) {\n\t\t\tthrow new ERR_HTTP_HEADERS_SENT('set');\n\t\t}\n\n\t\tif (typeof name !== 'string' || (!isValidHttpToken.test(name) && !isRequestPseudoHeader(name))) {\n\t\t\tthrow new ERR_INVALID_HTTP_TOKEN('Header name', name);\n\t\t}\n\n\t\tif (typeof value === 'undefined') {\n\t\t\tthrow new ERR_HTTP_INVALID_HEADER_VALUE(value, name);\n\t\t}\n\n\t\tif (isInvalidHeaderValue.test(value)) {\n\t\t\tthrow new ERR_INVALID_CHAR('header content', name);\n\t\t}\n\n\t\tthis[kHeaders][name.toLowerCase()] = value;\n\t}\n\n\tsetNoDelay() {\n\t\t// HTTP2 sockets cannot be malformed, do nothing.\n\t}\n\n\tsetSocketKeepAlive() {\n\t\t// HTTP2 sockets cannot be malformed, do nothing.\n\t}\n\n\tsetTimeout(ms, callback) {\n\t\tconst applyTimeout = () => this._request.setTimeout(ms, callback);\n\n\t\tif (this._request) {\n\t\t\tapplyTimeout();\n\t\t} else {\n\t\t\tthis[kJobs].push(applyTimeout);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\tget maxHeadersCount() {\n\t\tif (!this.destroyed && this._request) {\n\t\t\treturn this._request.session.localSettings.maxHeaderListSize;\n\t\t}\n\n\t\treturn undefined;\n\t}\n\n\tset maxHeadersCount(_value) {\n\t\t// Updating HTTP2 settings would affect all requests, do nothing.\n\t}\n}\n\nmodule.exports = ClientRequest;\n","'use strict';\nconst {Readable} = require('stream');\n\nclass IncomingMessage extends Readable {\n\tconstructor(socket, highWaterMark) {\n\t\tsuper({\n\t\t\thighWaterMark,\n\t\t\tautoDestroy: false\n\t\t});\n\n\t\tthis.statusCode = null;\n\t\tthis.statusMessage = '';\n\t\tthis.httpVersion = '2.0';\n\t\tthis.httpVersionMajor = 2;\n\t\tthis.httpVersionMinor = 0;\n\t\tthis.headers = {};\n\t\tthis.trailers = {};\n\t\tthis.req = null;\n\n\t\tthis.aborted = false;\n\t\tthis.complete = false;\n\t\tthis.upgrade = null;\n\n\t\tthis.rawHeaders = [];\n\t\tthis.rawTrailers = [];\n\n\t\tthis.socket = socket;\n\t\tthis.connection = socket;\n\n\t\tthis._dumped = false;\n\t}\n\n\t_destroy(error) {\n\t\tthis.req._request.destroy(error);\n\t}\n\n\tsetTimeout(ms, callback) {\n\t\tthis.req.setTimeout(ms, callback);\n\t\treturn this;\n\t}\n\n\t_dump() {\n\t\tif (!this._dumped) {\n\t\t\tthis._dumped = true;\n\n\t\t\tthis.removeAllListeners('data');\n\t\t\tthis.resume();\n\t\t}\n\t}\n\n\t_read() {\n\t\tif (this.req) {\n\t\t\tthis.req._request.resume();\n\t\t}\n\t}\n}\n\nmodule.exports = IncomingMessage;\n","'use strict';\nconst http2 = require('http2');\nconst agent = require('./agent');\nconst ClientRequest = require('./client-request');\nconst IncomingMessage = require('./incoming-message');\nconst auto = require('./auto');\n\nconst request = (url, options, callback) => {\n\treturn new ClientRequest(url, options, callback);\n};\n\nconst get = (url, options, callback) => {\n\t// eslint-disable-next-line unicorn/prevent-abbreviations\n\tconst req = new ClientRequest(url, options, callback);\n\treq.end();\n\n\treturn req;\n};\n\nmodule.exports = {\n\t...http2,\n\tClientRequest,\n\tIncomingMessage,\n\t...agent,\n\trequest,\n\tget,\n\tauto\n};\n","'use strict';\nconst net = require('net');\n/* istanbul ignore file: https://github.com/nodejs/node/blob/v13.0.1/lib/_http_agent.js */\n\nmodule.exports = options => {\n\tlet servername = options.host;\n\tconst hostHeader = options.headers && options.headers.host;\n\n\tif (hostHeader) {\n\t\tif (hostHeader.startsWith('[')) {\n\t\t\tconst index = hostHeader.indexOf(']');\n\t\t\tif (index === -1) {\n\t\t\t\tservername = hostHeader;\n\t\t\t} else {\n\t\t\t\tservername = hostHeader.slice(1, -1);\n\t\t\t}\n\t\t} else {\n\t\t\tservername = hostHeader.split(':', 1)[0];\n\t\t}\n\t}\n\n\tif (net.isIP(servername)) {\n\t\treturn '';\n\t}\n\n\treturn servername;\n};\n","'use strict';\n/* istanbul ignore file: https://github.com/nodejs/node/blob/master/lib/internal/errors.js */\n\nconst makeError = (Base, key, getMessage) => {\n\tmodule.exports[key] = class NodeError extends Base {\n\t\tconstructor(...args) {\n\t\t\tsuper(typeof getMessage === 'string' ? getMessage : getMessage(args));\n\t\t\tthis.name = `${super.name} [${key}]`;\n\t\t\tthis.code = key;\n\t\t}\n\t};\n};\n\nmakeError(TypeError, 'ERR_INVALID_ARG_TYPE', args => {\n\tconst type = args[0].includes('.') ? 'property' : 'argument';\n\n\tlet valid = args[1];\n\tconst isManyTypes = Array.isArray(valid);\n\n\tif (isManyTypes) {\n\t\tvalid = `${valid.slice(0, -1).join(', ')} or ${valid.slice(-1)}`;\n\t}\n\n\treturn `The \"${args[0]}\" ${type} must be ${isManyTypes ? 'one of' : 'of'} type ${valid}. Received ${typeof args[2]}`;\n});\n\nmakeError(TypeError, 'ERR_INVALID_PROTOCOL', args => {\n\treturn `Protocol \"${args[0]}\" not supported. Expected \"${args[1]}\"`;\n});\n\nmakeError(Error, 'ERR_HTTP_HEADERS_SENT', args => {\n\treturn `Cannot ${args[0]} headers after they are sent to the client`;\n});\n\nmakeError(TypeError, 'ERR_INVALID_HTTP_TOKEN', args => {\n\treturn `${args[0]} must be a valid HTTP token [${args[1]}]`;\n});\n\nmakeError(TypeError, 'ERR_HTTP_INVALID_HEADER_VALUE', args => {\n\treturn `Invalid value \"${args[0]} for header \"${args[1]}\"`;\n});\n\nmakeError(TypeError, 'ERR_INVALID_CHAR', args => {\n\treturn `Invalid character in ${args[0]} [${args[1]}]`;\n});\n","'use strict';\n\nmodule.exports = header => {\n\tswitch (header) {\n\t\tcase ':method':\n\t\tcase ':scheme':\n\t\tcase ':authority':\n\t\tcase ':path':\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n};\n","'use strict';\n\nmodule.exports = (from, to, events) => {\n\tfor (const event of events) {\n\t\tfrom.on(event, (...args) => to.emit(event, ...args));\n\t}\n};\n","'use strict';\n/* istanbul ignore file: https://github.com/nodejs/node/blob/a91293d4d9ab403046ab5eb022332e4e3d249bd3/lib/internal/url.js#L1257 */\n\nmodule.exports = url => {\n\tconst options = {\n\t\tprotocol: url.protocol,\n\t\thostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,\n\t\thost: url.host,\n\t\thash: url.hash,\n\t\tsearch: url.search,\n\t\tpathname: url.pathname,\n\t\thref: url.href,\n\t\tpath: `${url.pathname || ''}${url.search || ''}`\n\t};\n\n\tif (typeof url.port === 'string' && url.port.length !== 0) {\n\t\toptions.port = Number(url.port);\n\t}\n\n\tif (url.username || url.password) {\n\t\toptions.auth = `${url.username || ''}:${url.password || ''}`;\n\t}\n\n\treturn options;\n};\n","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});exports.SIGNALS=void 0;\n\nconst SIGNALS=[\n{\nname:\"SIGHUP\",\nnumber:1,\naction:\"terminate\",\ndescription:\"Terminal closed\",\nstandard:\"posix\"},\n\n{\nname:\"SIGINT\",\nnumber:2,\naction:\"terminate\",\ndescription:\"User interruption with CTRL-C\",\nstandard:\"ansi\"},\n\n{\nname:\"SIGQUIT\",\nnumber:3,\naction:\"core\",\ndescription:\"User interruption with CTRL-\\\\\",\nstandard:\"posix\"},\n\n{\nname:\"SIGILL\",\nnumber:4,\naction:\"core\",\ndescription:\"Invalid machine instruction\",\nstandard:\"ansi\"},\n\n{\nname:\"SIGTRAP\",\nnumber:5,\naction:\"core\",\ndescription:\"Debugger breakpoint\",\nstandard:\"posix\"},\n\n{\nname:\"SIGABRT\",\nnumber:6,\naction:\"core\",\ndescription:\"Aborted\",\nstandard:\"ansi\"},\n\n{\nname:\"SIGIOT\",\nnumber:6,\naction:\"core\",\ndescription:\"Aborted\",\nstandard:\"bsd\"},\n\n{\nname:\"SIGBUS\",\nnumber:7,\naction:\"core\",\ndescription:\n\"Bus error due to misaligned, non-existing address or paging error\",\nstandard:\"bsd\"},\n\n{\nname:\"SIGEMT\",\nnumber:7,\naction:\"terminate\",\ndescription:\"Command should be emulated but is not implemented\",\nstandard:\"other\"},\n\n{\nname:\"SIGFPE\",\nnumber:8,\naction:\"core\",\ndescription:\"Floating point arithmetic error\",\nstandard:\"ansi\"},\n\n{\nname:\"SIGKILL\",\nnumber:9,\naction:\"terminate\",\ndescription:\"Forced termination\",\nstandard:\"posix\",\nforced:true},\n\n{\nname:\"SIGUSR1\",\nnumber:10,\naction:\"terminate\",\ndescription:\"Application-specific signal\",\nstandard:\"posix\"},\n\n{\nname:\"SIGSEGV\",\nnumber:11,\naction:\"core\",\ndescription:\"Segmentation fault\",\nstandard:\"ansi\"},\n\n{\nname:\"SIGUSR2\",\nnumber:12,\naction:\"terminate\",\ndescription:\"Application-specific signal\",\nstandard:\"posix\"},\n\n{\nname:\"SIGPIPE\",\nnumber:13,\naction:\"terminate\",\ndescription:\"Broken pipe or socket\",\nstandard:\"posix\"},\n\n{\nname:\"SIGALRM\",\nnumber:14,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"posix\"},\n\n{\nname:\"SIGTERM\",\nnumber:15,\naction:\"terminate\",\ndescription:\"Termination\",\nstandard:\"ansi\"},\n\n{\nname:\"SIGSTKFLT\",\nnumber:16,\naction:\"terminate\",\ndescription:\"Stack is empty or overflowed\",\nstandard:\"other\"},\n\n{\nname:\"SIGCHLD\",\nnumber:17,\naction:\"ignore\",\ndescription:\"Child process terminated, paused or unpaused\",\nstandard:\"posix\"},\n\n{\nname:\"SIGCLD\",\nnumber:17,\naction:\"ignore\",\ndescription:\"Child process terminated, paused or unpaused\",\nstandard:\"other\"},\n\n{\nname:\"SIGCONT\",\nnumber:18,\naction:\"unpause\",\ndescription:\"Unpaused\",\nstandard:\"posix\",\nforced:true},\n\n{\nname:\"SIGSTOP\",\nnumber:19,\naction:\"pause\",\ndescription:\"Paused\",\nstandard:\"posix\",\nforced:true},\n\n{\nname:\"SIGTSTP\",\nnumber:20,\naction:\"pause\",\ndescription:\"Paused using CTRL-Z or \\\"suspend\\\"\",\nstandard:\"posix\"},\n\n{\nname:\"SIGTTIN\",\nnumber:21,\naction:\"pause\",\ndescription:\"Background process cannot read terminal input\",\nstandard:\"posix\"},\n\n{\nname:\"SIGBREAK\",\nnumber:21,\naction:\"terminate\",\ndescription:\"User interruption with CTRL-BREAK\",\nstandard:\"other\"},\n\n{\nname:\"SIGTTOU\",\nnumber:22,\naction:\"pause\",\ndescription:\"Background process cannot write to terminal output\",\nstandard:\"posix\"},\n\n{\nname:\"SIGURG\",\nnumber:23,\naction:\"ignore\",\ndescription:\"Socket received out-of-band data\",\nstandard:\"bsd\"},\n\n{\nname:\"SIGXCPU\",\nnumber:24,\naction:\"core\",\ndescription:\"Process timed out\",\nstandard:\"bsd\"},\n\n{\nname:\"SIGXFSZ\",\nnumber:25,\naction:\"core\",\ndescription:\"File too big\",\nstandard:\"bsd\"},\n\n{\nname:\"SIGVTALRM\",\nnumber:26,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"bsd\"},\n\n{\nname:\"SIGPROF\",\nnumber:27,\naction:\"terminate\",\ndescription:\"Timeout or timer\",\nstandard:\"bsd\"},\n\n{\nname:\"SIGWINCH\",\nnumber:28,\naction:\"ignore\",\ndescription:\"Terminal window size changed\",\nstandard:\"bsd\"},\n\n{\nname:\"SIGIO\",\nnumber:29,\naction:\"terminate\",\ndescription:\"I/O is available\",\nstandard:\"other\"},\n\n{\nname:\"SIGPOLL\",\nnumber:29,\naction:\"terminate\",\ndescription:\"Watched event\",\nstandard:\"other\"},\n\n{\nname:\"SIGINFO\",\nnumber:29,\naction:\"ignore\",\ndescription:\"Request for process information\",\nstandard:\"other\"},\n\n{\nname:\"SIGPWR\",\nnumber:30,\naction:\"terminate\",\ndescription:\"Device running out of power\",\nstandard:\"systemv\"},\n\n{\nname:\"SIGSYS\",\nnumber:31,\naction:\"core\",\ndescription:\"Invalid system call\",\nstandard:\"other\"},\n\n{\nname:\"SIGUNUSED\",\nnumber:31,\naction:\"terminate\",\ndescription:\"Invalid system call\",\nstandard:\"other\"}];exports.SIGNALS=SIGNALS;\n//# sourceMappingURL=core.js.map","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});exports.signalsByNumber=exports.signalsByName=void 0;var _os=require(\"os\");\n\nvar _signals=require(\"./signals.js\");\nvar _realtime=require(\"./realtime.js\");\n\n\n\nconst getSignalsByName=function(){\nconst signals=(0,_signals.getSignals)();\nreturn signals.reduce(getSignalByName,{});\n};\n\nconst getSignalByName=function(\nsignalByNameMemo,\n{name,number,description,supported,action,forced,standard})\n{\nreturn{\n...signalByNameMemo,\n[name]:{name,number,description,supported,action,forced,standard}};\n\n};\n\nconst signalsByName=getSignalsByName();exports.signalsByName=signalsByName;\n\n\n\n\nconst getSignalsByNumber=function(){\nconst signals=(0,_signals.getSignals)();\nconst length=_realtime.SIGRTMAX+1;\nconst signalsA=Array.from({length},(value,number)=>\ngetSignalByNumber(number,signals));\n\nreturn Object.assign({},...signalsA);\n};\n\nconst getSignalByNumber=function(number,signals){\nconst signal=findSignalByNumber(number,signals);\n\nif(signal===undefined){\nreturn{};\n}\n\nconst{name,description,supported,action,forced,standard}=signal;\nreturn{\n[number]:{\nname,\nnumber,\ndescription,\nsupported,\naction,\nforced,\nstandard}};\n\n\n};\n\n\n\nconst findSignalByNumber=function(number,signals){\nconst signal=signals.find(({name})=>_os.constants.signals[name]===number);\n\nif(signal!==undefined){\nreturn signal;\n}\n\nreturn signals.find(signalA=>signalA.number===number);\n};\n\nconst signalsByNumber=getSignalsByNumber();exports.signalsByNumber=signalsByNumber;\n//# sourceMappingURL=main.js.map","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});exports.SIGRTMAX=exports.getRealtimeSignals=void 0;\nconst getRealtimeSignals=function(){\nconst length=SIGRTMAX-SIGRTMIN+1;\nreturn Array.from({length},getRealtimeSignal);\n};exports.getRealtimeSignals=getRealtimeSignals;\n\nconst getRealtimeSignal=function(value,index){\nreturn{\nname:`SIGRT${index+1}`,\nnumber:SIGRTMIN+index,\naction:\"terminate\",\ndescription:\"Application-specific signal (realtime)\",\nstandard:\"posix\"};\n\n};\n\nconst SIGRTMIN=34;\nconst SIGRTMAX=64;exports.SIGRTMAX=SIGRTMAX;\n//# sourceMappingURL=realtime.js.map","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});exports.getSignals=void 0;var _os=require(\"os\");\n\nvar _core=require(\"./core.js\");\nvar _realtime=require(\"./realtime.js\");\n\n\n\nconst getSignals=function(){\nconst realtimeSignals=(0,_realtime.getRealtimeSignals)();\nconst signals=[..._core.SIGNALS,...realtimeSignals].map(normalizeSignal);\nreturn signals;\n};exports.getSignals=getSignals;\n\n\n\n\n\n\n\nconst normalizeSignal=function({\nname,\nnumber:defaultNumber,\ndescription,\naction,\nforced=false,\nstandard})\n{\nconst{\nsignals:{[name]:constantSignal}}=\n_os.constants;\nconst supported=constantSignal!==undefined;\nconst number=supported?constantSignal:defaultNumber;\nreturn{name,number,description,supported,action,forced,standard};\n};\n//# sourceMappingURL=signals.js.map","'use strict';\n\nmodule.exports = (string, count = 1, options) => {\n\toptions = {\n\t\tindent: ' ',\n\t\tincludeEmptyLines: false,\n\t\t...options\n\t};\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (typeof options.indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof options.indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = options.includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, options.indent.repeat(count));\n};\n","var wrappy = require('wrappy')\nvar reqs = Object.create(null)\nvar once = require('once')\n\nmodule.exports = wrappy(inflight)\n\nfunction inflight (key, cb) {\n if (reqs[key]) {\n reqs[key].push(cb)\n return null\n } else {\n reqs[key] = [cb]\n return makeres(key)\n }\n}\n\nfunction makeres (key) {\n return once(function RES () {\n var cbs = reqs[key]\n var len = cbs.length\n var args = slice(arguments)\n\n // XXX It's somewhat ambiguous whether a new callback added in this\n // pass should be queued for later execution if something in the\n // list of callbacks throws, or if it should just be discarded.\n // However, it's such an edge case that it hardly matters, and either\n // choice is likely as surprising as the other.\n // As it happens, we do go ahead and schedule it for later execution.\n try {\n for (var i = 0; i < len; i++) {\n cbs[i].apply(null, args)\n }\n } finally {\n if (cbs.length > len) {\n // added more in the interim.\n // de-zalgo, just in case, but don't call again.\n cbs.splice(0, len)\n process.nextTick(function () {\n RES.apply(null, args)\n })\n } else {\n delete reqs[key]\n }\n }\n })\n}\n\nfunction slice (args) {\n var length = args.length\n var array = []\n\n for (var i = 0; i < length; i++) array[i] = args[i]\n return array\n}\n","try {\n var util = require('util');\n /* istanbul ignore next */\n if (typeof util.inherits !== 'function') throw '';\n module.exports = util.inherits;\n} catch (e) {\n /* istanbul ignore next */\n module.exports = require('./inherits_browser.js');\n}\n","if (typeof Object.create === 'function') {\n // implementation from standard node.js 'util' module\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n })\n }\n };\n} else {\n // old school shim for old browsers\n module.exports = function inherits(ctor, superCtor) {\n if (superCtor) {\n ctor.super_ = superCtor\n var TempCtor = function () {}\n TempCtor.prototype = superCtor.prototype\n ctor.prototype = new TempCtor()\n ctor.prototype.constructor = ctor\n }\n }\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*!\n * is-plain-object \n *\n * Copyright (c) 2014-2017, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nfunction isObject(o) {\n return Object.prototype.toString.call(o) === '[object Object]';\n}\n\nfunction isPlainObject(o) {\n var ctor,prot;\n\n if (isObject(o) === false) return false;\n\n // If has modified constructor\n ctor = o.constructor;\n if (ctor === undefined) return true;\n\n // If has modified prototype\n prot = ctor.prototype;\n if (isObject(prot) === false) return false;\n\n // If constructor does not have an Object-specific method\n if (prot.hasOwnProperty('isPrototypeOf') === false) {\n return false;\n }\n\n // Most likely a plain Object\n return true;\n}\n\nexports.isPlainObject = isPlainObject;\n","'use strict';\n\nconst isStream = stream =>\n\tstream !== null &&\n\ttypeof stream === 'object' &&\n\ttypeof stream.pipe === 'function';\n\nisStream.writable = stream =>\n\tisStream(stream) &&\n\tstream.writable !== false &&\n\ttypeof stream._write === 'function' &&\n\ttypeof stream._writableState === 'object';\n\nisStream.readable = stream =>\n\tisStream(stream) &&\n\tstream.readable !== false &&\n\ttypeof stream._read === 'function' &&\n\ttypeof stream._readableState === 'object';\n\nisStream.duplex = stream =>\n\tisStream.writable(stream) &&\n\tisStream.readable(stream);\n\nisStream.transform = stream =>\n\tisStream.duplex(stream) &&\n\ttypeof stream._transform === 'function';\n\nmodule.exports = isStream;\n","module.exports = isTypedArray\nisTypedArray.strict = isStrictTypedArray\nisTypedArray.loose = isLooseTypedArray\n\nvar toString = Object.prototype.toString\nvar names = {\n '[object Int8Array]': true\n , '[object Int16Array]': true\n , '[object Int32Array]': true\n , '[object Uint8Array]': true\n , '[object Uint8ClampedArray]': true\n , '[object Uint16Array]': true\n , '[object Uint32Array]': true\n , '[object Float32Array]': true\n , '[object Float64Array]': true\n}\n\nfunction isTypedArray(arr) {\n return (\n isStrictTypedArray(arr)\n || isLooseTypedArray(arr)\n )\n}\n\nfunction isStrictTypedArray(arr) {\n return (\n arr instanceof Int8Array\n || arr instanceof Int16Array\n || arr instanceof Int32Array\n || arr instanceof Uint8Array\n || arr instanceof Uint8ClampedArray\n || arr instanceof Uint16Array\n || arr instanceof Uint32Array\n || arr instanceof Float32Array\n || arr instanceof Float64Array\n )\n}\n\nfunction isLooseTypedArray(arr) {\n return names[toString.call(arr)]\n}\n","var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n","module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n","\"use strict\";\n\nmodule.exports = require('ws');","var stream = require('stream')\n\n\nfunction isStream (obj) {\n return obj instanceof stream.Stream\n}\n\n\nfunction isReadable (obj) {\n return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'\n}\n\n\nfunction isWritable (obj) {\n return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'\n}\n\n\nfunction isDuplex (obj) {\n return isReadable(obj) && isWritable(obj)\n}\n\n\nmodule.exports = isStream\nmodule.exports.isReadable = isReadable\nmodule.exports.isWritable = isWritable\nmodule.exports.isDuplex = isDuplex\n","(function(exports) {\n \"use strict\";\n\n function isArray(obj) {\n if (obj !== null) {\n return Object.prototype.toString.call(obj) === \"[object Array]\";\n } else {\n return false;\n }\n }\n\n function isObject(obj) {\n if (obj !== null) {\n return Object.prototype.toString.call(obj) === \"[object Object]\";\n } else {\n return false;\n }\n }\n\n function strictDeepEqual(first, second) {\n // Check the scalar case first.\n if (first === second) {\n return true;\n }\n\n // Check if they are the same type.\n var firstType = Object.prototype.toString.call(first);\n if (firstType !== Object.prototype.toString.call(second)) {\n return false;\n }\n // We know that first and second have the same type so we can just check the\n // first type from now on.\n if (isArray(first) === true) {\n // Short circuit if they're not the same length;\n if (first.length !== second.length) {\n return false;\n }\n for (var i = 0; i < first.length; i++) {\n if (strictDeepEqual(first[i], second[i]) === false) {\n return false;\n }\n }\n return true;\n }\n if (isObject(first) === true) {\n // An object is equal if it has the same key/value pairs.\n var keysSeen = {};\n for (var key in first) {\n if (hasOwnProperty.call(first, key)) {\n if (strictDeepEqual(first[key], second[key]) === false) {\n return false;\n }\n keysSeen[key] = true;\n }\n }\n // Now check that there aren't any keys in second that weren't\n // in first.\n for (var key2 in second) {\n if (hasOwnProperty.call(second, key2)) {\n if (keysSeen[key2] !== true) {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }\n\n function isFalse(obj) {\n // From the spec:\n // A false value corresponds to the following values:\n // Empty list\n // Empty object\n // Empty string\n // False boolean\n // null value\n\n // First check the scalar values.\n if (obj === \"\" || obj === false || obj === null) {\n return true;\n } else if (isArray(obj) && obj.length === 0) {\n // Check for an empty array.\n return true;\n } else if (isObject(obj)) {\n // Check for an empty object.\n for (var key in obj) {\n // If there are any keys, then\n // the object is not empty so the object\n // is not false.\n if (obj.hasOwnProperty(key)) {\n return false;\n }\n }\n return true;\n } else {\n return false;\n }\n }\n\n function objValues(obj) {\n var keys = Object.keys(obj);\n var values = [];\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n return values;\n }\n\n function merge(a, b) {\n var merged = {};\n for (var key in a) {\n merged[key] = a[key];\n }\n for (var key2 in b) {\n merged[key2] = b[key2];\n }\n return merged;\n }\n\n var trimLeft;\n if (typeof String.prototype.trimLeft === \"function\") {\n trimLeft = function(str) {\n return str.trimLeft();\n };\n } else {\n trimLeft = function(str) {\n return str.match(/^\\s*(.*)/)[1];\n };\n }\n\n // Type constants used to define functions.\n var TYPE_NUMBER = 0;\n var TYPE_ANY = 1;\n var TYPE_STRING = 2;\n var TYPE_ARRAY = 3;\n var TYPE_OBJECT = 4;\n var TYPE_BOOLEAN = 5;\n var TYPE_EXPREF = 6;\n var TYPE_NULL = 7;\n var TYPE_ARRAY_NUMBER = 8;\n var TYPE_ARRAY_STRING = 9;\n var TYPE_NAME_TABLE = {\n 0: 'number',\n 1: 'any',\n 2: 'string',\n 3: 'array',\n 4: 'object',\n 5: 'boolean',\n 6: 'expression',\n 7: 'null',\n 8: 'Array',\n 9: 'Array'\n };\n\n var TOK_EOF = \"EOF\";\n var TOK_UNQUOTEDIDENTIFIER = \"UnquotedIdentifier\";\n var TOK_QUOTEDIDENTIFIER = \"QuotedIdentifier\";\n var TOK_RBRACKET = \"Rbracket\";\n var TOK_RPAREN = \"Rparen\";\n var TOK_COMMA = \"Comma\";\n var TOK_COLON = \"Colon\";\n var TOK_RBRACE = \"Rbrace\";\n var TOK_NUMBER = \"Number\";\n var TOK_CURRENT = \"Current\";\n var TOK_EXPREF = \"Expref\";\n var TOK_PIPE = \"Pipe\";\n var TOK_OR = \"Or\";\n var TOK_AND = \"And\";\n var TOK_EQ = \"EQ\";\n var TOK_GT = \"GT\";\n var TOK_LT = \"LT\";\n var TOK_GTE = \"GTE\";\n var TOK_LTE = \"LTE\";\n var TOK_NE = \"NE\";\n var TOK_FLATTEN = \"Flatten\";\n var TOK_STAR = \"Star\";\n var TOK_FILTER = \"Filter\";\n var TOK_DOT = \"Dot\";\n var TOK_NOT = \"Not\";\n var TOK_LBRACE = \"Lbrace\";\n var TOK_LBRACKET = \"Lbracket\";\n var TOK_LPAREN= \"Lparen\";\n var TOK_LITERAL= \"Literal\";\n\n // The \"&\", \"[\", \"<\", \">\" tokens\n // are not in basicToken because\n // there are two token variants\n // (\"&&\", \"[?\", \"<=\", \">=\"). This is specially handled\n // below.\n\n var basicTokens = {\n \".\": TOK_DOT,\n \"*\": TOK_STAR,\n \",\": TOK_COMMA,\n \":\": TOK_COLON,\n \"{\": TOK_LBRACE,\n \"}\": TOK_RBRACE,\n \"]\": TOK_RBRACKET,\n \"(\": TOK_LPAREN,\n \")\": TOK_RPAREN,\n \"@\": TOK_CURRENT\n };\n\n var operatorStartToken = {\n \"<\": true,\n \">\": true,\n \"=\": true,\n \"!\": true\n };\n\n var skipChars = {\n \" \": true,\n \"\\t\": true,\n \"\\n\": true\n };\n\n\n function isAlpha(ch) {\n return (ch >= \"a\" && ch <= \"z\") ||\n (ch >= \"A\" && ch <= \"Z\") ||\n ch === \"_\";\n }\n\n function isNum(ch) {\n return (ch >= \"0\" && ch <= \"9\") ||\n ch === \"-\";\n }\n function isAlphaNum(ch) {\n return (ch >= \"a\" && ch <= \"z\") ||\n (ch >= \"A\" && ch <= \"Z\") ||\n (ch >= \"0\" && ch <= \"9\") ||\n ch === \"_\";\n }\n\n function Lexer() {\n }\n Lexer.prototype = {\n tokenize: function(stream) {\n var tokens = [];\n this._current = 0;\n var start;\n var identifier;\n var token;\n while (this._current < stream.length) {\n if (isAlpha(stream[this._current])) {\n start = this._current;\n identifier = this._consumeUnquotedIdentifier(stream);\n tokens.push({type: TOK_UNQUOTEDIDENTIFIER,\n value: identifier,\n start: start});\n } else if (basicTokens[stream[this._current]] !== undefined) {\n tokens.push({type: basicTokens[stream[this._current]],\n value: stream[this._current],\n start: this._current});\n this._current++;\n } else if (isNum(stream[this._current])) {\n token = this._consumeNumber(stream);\n tokens.push(token);\n } else if (stream[this._current] === \"[\") {\n // No need to increment this._current. This happens\n // in _consumeLBracket\n token = this._consumeLBracket(stream);\n tokens.push(token);\n } else if (stream[this._current] === \"\\\"\") {\n start = this._current;\n identifier = this._consumeQuotedIdentifier(stream);\n tokens.push({type: TOK_QUOTEDIDENTIFIER,\n value: identifier,\n start: start});\n } else if (stream[this._current] === \"'\") {\n start = this._current;\n identifier = this._consumeRawStringLiteral(stream);\n tokens.push({type: TOK_LITERAL,\n value: identifier,\n start: start});\n } else if (stream[this._current] === \"`\") {\n start = this._current;\n var literal = this._consumeLiteral(stream);\n tokens.push({type: TOK_LITERAL,\n value: literal,\n start: start});\n } else if (operatorStartToken[stream[this._current]] !== undefined) {\n tokens.push(this._consumeOperator(stream));\n } else if (skipChars[stream[this._current]] !== undefined) {\n // Ignore whitespace.\n this._current++;\n } else if (stream[this._current] === \"&\") {\n start = this._current;\n this._current++;\n if (stream[this._current] === \"&\") {\n this._current++;\n tokens.push({type: TOK_AND, value: \"&&\", start: start});\n } else {\n tokens.push({type: TOK_EXPREF, value: \"&\", start: start});\n }\n } else if (stream[this._current] === \"|\") {\n start = this._current;\n this._current++;\n if (stream[this._current] === \"|\") {\n this._current++;\n tokens.push({type: TOK_OR, value: \"||\", start: start});\n } else {\n tokens.push({type: TOK_PIPE, value: \"|\", start: start});\n }\n } else {\n var error = new Error(\"Unknown character:\" + stream[this._current]);\n error.name = \"LexerError\";\n throw error;\n }\n }\n return tokens;\n },\n\n _consumeUnquotedIdentifier: function(stream) {\n var start = this._current;\n this._current++;\n while (this._current < stream.length && isAlphaNum(stream[this._current])) {\n this._current++;\n }\n return stream.slice(start, this._current);\n },\n\n _consumeQuotedIdentifier: function(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n while (stream[this._current] !== \"\\\"\" && this._current < maxLength) {\n // You can escape a double quote and you can escape an escape.\n var current = this._current;\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" ||\n stream[current + 1] === \"\\\"\")) {\n current += 2;\n } else {\n current++;\n }\n this._current = current;\n }\n this._current++;\n return JSON.parse(stream.slice(start, this._current));\n },\n\n _consumeRawStringLiteral: function(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n while (stream[this._current] !== \"'\" && this._current < maxLength) {\n // You can escape a single quote and you can escape an escape.\n var current = this._current;\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" ||\n stream[current + 1] === \"'\")) {\n current += 2;\n } else {\n current++;\n }\n this._current = current;\n }\n this._current++;\n var literal = stream.slice(start + 1, this._current - 1);\n return literal.replace(\"\\\\'\", \"'\");\n },\n\n _consumeNumber: function(stream) {\n var start = this._current;\n this._current++;\n var maxLength = stream.length;\n while (isNum(stream[this._current]) && this._current < maxLength) {\n this._current++;\n }\n var value = parseInt(stream.slice(start, this._current));\n return {type: TOK_NUMBER, value: value, start: start};\n },\n\n _consumeLBracket: function(stream) {\n var start = this._current;\n this._current++;\n if (stream[this._current] === \"?\") {\n this._current++;\n return {type: TOK_FILTER, value: \"[?\", start: start};\n } else if (stream[this._current] === \"]\") {\n this._current++;\n return {type: TOK_FLATTEN, value: \"[]\", start: start};\n } else {\n return {type: TOK_LBRACKET, value: \"[\", start: start};\n }\n },\n\n _consumeOperator: function(stream) {\n var start = this._current;\n var startingChar = stream[start];\n this._current++;\n if (startingChar === \"!\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {type: TOK_NE, value: \"!=\", start: start};\n } else {\n return {type: TOK_NOT, value: \"!\", start: start};\n }\n } else if (startingChar === \"<\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {type: TOK_LTE, value: \"<=\", start: start};\n } else {\n return {type: TOK_LT, value: \"<\", start: start};\n }\n } else if (startingChar === \">\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {type: TOK_GTE, value: \">=\", start: start};\n } else {\n return {type: TOK_GT, value: \">\", start: start};\n }\n } else if (startingChar === \"=\") {\n if (stream[this._current] === \"=\") {\n this._current++;\n return {type: TOK_EQ, value: \"==\", start: start};\n }\n }\n },\n\n _consumeLiteral: function(stream) {\n this._current++;\n var start = this._current;\n var maxLength = stream.length;\n var literal;\n while(stream[this._current] !== \"`\" && this._current < maxLength) {\n // You can escape a literal char or you can escape the escape.\n var current = this._current;\n if (stream[current] === \"\\\\\" && (stream[current + 1] === \"\\\\\" ||\n stream[current + 1] === \"`\")) {\n current += 2;\n } else {\n current++;\n }\n this._current = current;\n }\n var literalString = trimLeft(stream.slice(start, this._current));\n literalString = literalString.replace(\"\\\\`\", \"`\");\n if (this._looksLikeJSON(literalString)) {\n literal = JSON.parse(literalString);\n } else {\n // Try to JSON parse it as \"\"\n literal = JSON.parse(\"\\\"\" + literalString + \"\\\"\");\n }\n // +1 gets us to the ending \"`\", +1 to move on to the next char.\n this._current++;\n return literal;\n },\n\n _looksLikeJSON: function(literalString) {\n var startingChars = \"[{\\\"\";\n var jsonLiterals = [\"true\", \"false\", \"null\"];\n var numberLooking = \"-0123456789\";\n\n if (literalString === \"\") {\n return false;\n } else if (startingChars.indexOf(literalString[0]) >= 0) {\n return true;\n } else if (jsonLiterals.indexOf(literalString) >= 0) {\n return true;\n } else if (numberLooking.indexOf(literalString[0]) >= 0) {\n try {\n JSON.parse(literalString);\n return true;\n } catch (ex) {\n return false;\n }\n } else {\n return false;\n }\n }\n };\n\n var bindingPower = {};\n bindingPower[TOK_EOF] = 0;\n bindingPower[TOK_UNQUOTEDIDENTIFIER] = 0;\n bindingPower[TOK_QUOTEDIDENTIFIER] = 0;\n bindingPower[TOK_RBRACKET] = 0;\n bindingPower[TOK_RPAREN] = 0;\n bindingPower[TOK_COMMA] = 0;\n bindingPower[TOK_RBRACE] = 0;\n bindingPower[TOK_NUMBER] = 0;\n bindingPower[TOK_CURRENT] = 0;\n bindingPower[TOK_EXPREF] = 0;\n bindingPower[TOK_PIPE] = 1;\n bindingPower[TOK_OR] = 2;\n bindingPower[TOK_AND] = 3;\n bindingPower[TOK_EQ] = 5;\n bindingPower[TOK_GT] = 5;\n bindingPower[TOK_LT] = 5;\n bindingPower[TOK_GTE] = 5;\n bindingPower[TOK_LTE] = 5;\n bindingPower[TOK_NE] = 5;\n bindingPower[TOK_FLATTEN] = 9;\n bindingPower[TOK_STAR] = 20;\n bindingPower[TOK_FILTER] = 21;\n bindingPower[TOK_DOT] = 40;\n bindingPower[TOK_NOT] = 45;\n bindingPower[TOK_LBRACE] = 50;\n bindingPower[TOK_LBRACKET] = 55;\n bindingPower[TOK_LPAREN] = 60;\n\n function Parser() {\n }\n\n Parser.prototype = {\n parse: function(expression) {\n this._loadTokens(expression);\n this.index = 0;\n var ast = this.expression(0);\n if (this._lookahead(0) !== TOK_EOF) {\n var t = this._lookaheadToken(0);\n var error = new Error(\n \"Unexpected token type: \" + t.type + \", value: \" + t.value);\n error.name = \"ParserError\";\n throw error;\n }\n return ast;\n },\n\n _loadTokens: function(expression) {\n var lexer = new Lexer();\n var tokens = lexer.tokenize(expression);\n tokens.push({type: TOK_EOF, value: \"\", start: expression.length});\n this.tokens = tokens;\n },\n\n expression: function(rbp) {\n var leftToken = this._lookaheadToken(0);\n this._advance();\n var left = this.nud(leftToken);\n var currentToken = this._lookahead(0);\n while (rbp < bindingPower[currentToken]) {\n this._advance();\n left = this.led(currentToken, left);\n currentToken = this._lookahead(0);\n }\n return left;\n },\n\n _lookahead: function(number) {\n return this.tokens[this.index + number].type;\n },\n\n _lookaheadToken: function(number) {\n return this.tokens[this.index + number];\n },\n\n _advance: function() {\n this.index++;\n },\n\n nud: function(token) {\n var left;\n var right;\n var expression;\n switch (token.type) {\n case TOK_LITERAL:\n return {type: \"Literal\", value: token.value};\n case TOK_UNQUOTEDIDENTIFIER:\n return {type: \"Field\", name: token.value};\n case TOK_QUOTEDIDENTIFIER:\n var node = {type: \"Field\", name: token.value};\n if (this._lookahead(0) === TOK_LPAREN) {\n throw new Error(\"Quoted identifier not allowed for function names.\");\n }\n return node;\n case TOK_NOT:\n right = this.expression(bindingPower.Not);\n return {type: \"NotExpression\", children: [right]};\n case TOK_STAR:\n left = {type: \"Identity\"};\n right = null;\n if (this._lookahead(0) === TOK_RBRACKET) {\n // This can happen in a multiselect,\n // [a, b, *]\n right = {type: \"Identity\"};\n } else {\n right = this._parseProjectionRHS(bindingPower.Star);\n }\n return {type: \"ValueProjection\", children: [left, right]};\n case TOK_FILTER:\n return this.led(token.type, {type: \"Identity\"});\n case TOK_LBRACE:\n return this._parseMultiselectHash();\n case TOK_FLATTEN:\n left = {type: TOK_FLATTEN, children: [{type: \"Identity\"}]};\n right = this._parseProjectionRHS(bindingPower.Flatten);\n return {type: \"Projection\", children: [left, right]};\n case TOK_LBRACKET:\n if (this._lookahead(0) === TOK_NUMBER || this._lookahead(0) === TOK_COLON) {\n right = this._parseIndexExpression();\n return this._projectIfSlice({type: \"Identity\"}, right);\n } else if (this._lookahead(0) === TOK_STAR &&\n this._lookahead(1) === TOK_RBRACKET) {\n this._advance();\n this._advance();\n right = this._parseProjectionRHS(bindingPower.Star);\n return {type: \"Projection\",\n children: [{type: \"Identity\"}, right]};\n }\n return this._parseMultiselectList();\n case TOK_CURRENT:\n return {type: TOK_CURRENT};\n case TOK_EXPREF:\n expression = this.expression(bindingPower.Expref);\n return {type: \"ExpressionReference\", children: [expression]};\n case TOK_LPAREN:\n var args = [];\n while (this._lookahead(0) !== TOK_RPAREN) {\n if (this._lookahead(0) === TOK_CURRENT) {\n expression = {type: TOK_CURRENT};\n this._advance();\n } else {\n expression = this.expression(0);\n }\n args.push(expression);\n }\n this._match(TOK_RPAREN);\n return args[0];\n default:\n this._errorToken(token);\n }\n },\n\n led: function(tokenName, left) {\n var right;\n switch(tokenName) {\n case TOK_DOT:\n var rbp = bindingPower.Dot;\n if (this._lookahead(0) !== TOK_STAR) {\n right = this._parseDotRHS(rbp);\n return {type: \"Subexpression\", children: [left, right]};\n }\n // Creating a projection.\n this._advance();\n right = this._parseProjectionRHS(rbp);\n return {type: \"ValueProjection\", children: [left, right]};\n case TOK_PIPE:\n right = this.expression(bindingPower.Pipe);\n return {type: TOK_PIPE, children: [left, right]};\n case TOK_OR:\n right = this.expression(bindingPower.Or);\n return {type: \"OrExpression\", children: [left, right]};\n case TOK_AND:\n right = this.expression(bindingPower.And);\n return {type: \"AndExpression\", children: [left, right]};\n case TOK_LPAREN:\n var name = left.name;\n var args = [];\n var expression, node;\n while (this._lookahead(0) !== TOK_RPAREN) {\n if (this._lookahead(0) === TOK_CURRENT) {\n expression = {type: TOK_CURRENT};\n this._advance();\n } else {\n expression = this.expression(0);\n }\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n }\n args.push(expression);\n }\n this._match(TOK_RPAREN);\n node = {type: \"Function\", name: name, children: args};\n return node;\n case TOK_FILTER:\n var condition = this.expression(0);\n this._match(TOK_RBRACKET);\n if (this._lookahead(0) === TOK_FLATTEN) {\n right = {type: \"Identity\"};\n } else {\n right = this._parseProjectionRHS(bindingPower.Filter);\n }\n return {type: \"FilterProjection\", children: [left, right, condition]};\n case TOK_FLATTEN:\n var leftNode = {type: TOK_FLATTEN, children: [left]};\n var rightNode = this._parseProjectionRHS(bindingPower.Flatten);\n return {type: \"Projection\", children: [leftNode, rightNode]};\n case TOK_EQ:\n case TOK_NE:\n case TOK_GT:\n case TOK_GTE:\n case TOK_LT:\n case TOK_LTE:\n return this._parseComparator(left, tokenName);\n case TOK_LBRACKET:\n var token = this._lookaheadToken(0);\n if (token.type === TOK_NUMBER || token.type === TOK_COLON) {\n right = this._parseIndexExpression();\n return this._projectIfSlice(left, right);\n }\n this._match(TOK_STAR);\n this._match(TOK_RBRACKET);\n right = this._parseProjectionRHS(bindingPower.Star);\n return {type: \"Projection\", children: [left, right]};\n default:\n this._errorToken(this._lookaheadToken(0));\n }\n },\n\n _match: function(tokenType) {\n if (this._lookahead(0) === tokenType) {\n this._advance();\n } else {\n var t = this._lookaheadToken(0);\n var error = new Error(\"Expected \" + tokenType + \", got: \" + t.type);\n error.name = \"ParserError\";\n throw error;\n }\n },\n\n _errorToken: function(token) {\n var error = new Error(\"Invalid token (\" +\n token.type + \"): \\\"\" +\n token.value + \"\\\"\");\n error.name = \"ParserError\";\n throw error;\n },\n\n\n _parseIndexExpression: function() {\n if (this._lookahead(0) === TOK_COLON || this._lookahead(1) === TOK_COLON) {\n return this._parseSliceExpression();\n } else {\n var node = {\n type: \"Index\",\n value: this._lookaheadToken(0).value};\n this._advance();\n this._match(TOK_RBRACKET);\n return node;\n }\n },\n\n _projectIfSlice: function(left, right) {\n var indexExpr = {type: \"IndexExpression\", children: [left, right]};\n if (right.type === \"Slice\") {\n return {\n type: \"Projection\",\n children: [indexExpr, this._parseProjectionRHS(bindingPower.Star)]\n };\n } else {\n return indexExpr;\n }\n },\n\n _parseSliceExpression: function() {\n // [start:end:step] where each part is optional, as well as the last\n // colon.\n var parts = [null, null, null];\n var index = 0;\n var currentToken = this._lookahead(0);\n while (currentToken !== TOK_RBRACKET && index < 3) {\n if (currentToken === TOK_COLON) {\n index++;\n this._advance();\n } else if (currentToken === TOK_NUMBER) {\n parts[index] = this._lookaheadToken(0).value;\n this._advance();\n } else {\n var t = this._lookahead(0);\n var error = new Error(\"Syntax error, unexpected token: \" +\n t.value + \"(\" + t.type + \")\");\n error.name = \"Parsererror\";\n throw error;\n }\n currentToken = this._lookahead(0);\n }\n this._match(TOK_RBRACKET);\n return {\n type: \"Slice\",\n children: parts\n };\n },\n\n _parseComparator: function(left, comparator) {\n var right = this.expression(bindingPower[comparator]);\n return {type: \"Comparator\", name: comparator, children: [left, right]};\n },\n\n _parseDotRHS: function(rbp) {\n var lookahead = this._lookahead(0);\n var exprTokens = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER, TOK_STAR];\n if (exprTokens.indexOf(lookahead) >= 0) {\n return this.expression(rbp);\n } else if (lookahead === TOK_LBRACKET) {\n this._match(TOK_LBRACKET);\n return this._parseMultiselectList();\n } else if (lookahead === TOK_LBRACE) {\n this._match(TOK_LBRACE);\n return this._parseMultiselectHash();\n }\n },\n\n _parseProjectionRHS: function(rbp) {\n var right;\n if (bindingPower[this._lookahead(0)] < 10) {\n right = {type: \"Identity\"};\n } else if (this._lookahead(0) === TOK_LBRACKET) {\n right = this.expression(rbp);\n } else if (this._lookahead(0) === TOK_FILTER) {\n right = this.expression(rbp);\n } else if (this._lookahead(0) === TOK_DOT) {\n this._match(TOK_DOT);\n right = this._parseDotRHS(rbp);\n } else {\n var t = this._lookaheadToken(0);\n var error = new Error(\"Sytanx error, unexpected token: \" +\n t.value + \"(\" + t.type + \")\");\n error.name = \"ParserError\";\n throw error;\n }\n return right;\n },\n\n _parseMultiselectList: function() {\n var expressions = [];\n while (this._lookahead(0) !== TOK_RBRACKET) {\n var expression = this.expression(0);\n expressions.push(expression);\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n if (this._lookahead(0) === TOK_RBRACKET) {\n throw new Error(\"Unexpected token Rbracket\");\n }\n }\n }\n this._match(TOK_RBRACKET);\n return {type: \"MultiSelectList\", children: expressions};\n },\n\n _parseMultiselectHash: function() {\n var pairs = [];\n var identifierTypes = [TOK_UNQUOTEDIDENTIFIER, TOK_QUOTEDIDENTIFIER];\n var keyToken, keyName, value, node;\n for (;;) {\n keyToken = this._lookaheadToken(0);\n if (identifierTypes.indexOf(keyToken.type) < 0) {\n throw new Error(\"Expecting an identifier token, got: \" +\n keyToken.type);\n }\n keyName = keyToken.value;\n this._advance();\n this._match(TOK_COLON);\n value = this.expression(0);\n node = {type: \"KeyValuePair\", name: keyName, value: value};\n pairs.push(node);\n if (this._lookahead(0) === TOK_COMMA) {\n this._match(TOK_COMMA);\n } else if (this._lookahead(0) === TOK_RBRACE) {\n this._match(TOK_RBRACE);\n break;\n }\n }\n return {type: \"MultiSelectHash\", children: pairs};\n }\n };\n\n\n function TreeInterpreter(runtime) {\n this.runtime = runtime;\n }\n\n TreeInterpreter.prototype = {\n search: function(node, value) {\n return this.visit(node, value);\n },\n\n visit: function(node, value) {\n var matched, current, result, first, second, field, left, right, collected, i;\n switch (node.type) {\n case \"Field\":\n if (value !== null && isObject(value)) {\n field = value[node.name];\n if (field === undefined) {\n return null;\n } else {\n return field;\n }\n }\n return null;\n case \"Subexpression\":\n result = this.visit(node.children[0], value);\n for (i = 1; i < node.children.length; i++) {\n result = this.visit(node.children[1], result);\n if (result === null) {\n return null;\n }\n }\n return result;\n case \"IndexExpression\":\n left = this.visit(node.children[0], value);\n right = this.visit(node.children[1], left);\n return right;\n case \"Index\":\n if (!isArray(value)) {\n return null;\n }\n var index = node.value;\n if (index < 0) {\n index = value.length + index;\n }\n result = value[index];\n if (result === undefined) {\n result = null;\n }\n return result;\n case \"Slice\":\n if (!isArray(value)) {\n return null;\n }\n var sliceParams = node.children.slice(0);\n var computed = this.computeSliceParams(value.length, sliceParams);\n var start = computed[0];\n var stop = computed[1];\n var step = computed[2];\n result = [];\n if (step > 0) {\n for (i = start; i < stop; i += step) {\n result.push(value[i]);\n }\n } else {\n for (i = start; i > stop; i += step) {\n result.push(value[i]);\n }\n }\n return result;\n case \"Projection\":\n // Evaluate left child.\n var base = this.visit(node.children[0], value);\n if (!isArray(base)) {\n return null;\n }\n collected = [];\n for (i = 0; i < base.length; i++) {\n current = this.visit(node.children[1], base[i]);\n if (current !== null) {\n collected.push(current);\n }\n }\n return collected;\n case \"ValueProjection\":\n // Evaluate left child.\n base = this.visit(node.children[0], value);\n if (!isObject(base)) {\n return null;\n }\n collected = [];\n var values = objValues(base);\n for (i = 0; i < values.length; i++) {\n current = this.visit(node.children[1], values[i]);\n if (current !== null) {\n collected.push(current);\n }\n }\n return collected;\n case \"FilterProjection\":\n base = this.visit(node.children[0], value);\n if (!isArray(base)) {\n return null;\n }\n var filtered = [];\n var finalResults = [];\n for (i = 0; i < base.length; i++) {\n matched = this.visit(node.children[2], base[i]);\n if (!isFalse(matched)) {\n filtered.push(base[i]);\n }\n }\n for (var j = 0; j < filtered.length; j++) {\n current = this.visit(node.children[1], filtered[j]);\n if (current !== null) {\n finalResults.push(current);\n }\n }\n return finalResults;\n case \"Comparator\":\n first = this.visit(node.children[0], value);\n second = this.visit(node.children[1], value);\n switch(node.name) {\n case TOK_EQ:\n result = strictDeepEqual(first, second);\n break;\n case TOK_NE:\n result = !strictDeepEqual(first, second);\n break;\n case TOK_GT:\n result = first > second;\n break;\n case TOK_GTE:\n result = first >= second;\n break;\n case TOK_LT:\n result = first < second;\n break;\n case TOK_LTE:\n result = first <= second;\n break;\n default:\n throw new Error(\"Unknown comparator: \" + node.name);\n }\n return result;\n case TOK_FLATTEN:\n var original = this.visit(node.children[0], value);\n if (!isArray(original)) {\n return null;\n }\n var merged = [];\n for (i = 0; i < original.length; i++) {\n current = original[i];\n if (isArray(current)) {\n merged.push.apply(merged, current);\n } else {\n merged.push(current);\n }\n }\n return merged;\n case \"Identity\":\n return value;\n case \"MultiSelectList\":\n if (value === null) {\n return null;\n }\n collected = [];\n for (i = 0; i < node.children.length; i++) {\n collected.push(this.visit(node.children[i], value));\n }\n return collected;\n case \"MultiSelectHash\":\n if (value === null) {\n return null;\n }\n collected = {};\n var child;\n for (i = 0; i < node.children.length; i++) {\n child = node.children[i];\n collected[child.name] = this.visit(child.value, value);\n }\n return collected;\n case \"OrExpression\":\n matched = this.visit(node.children[0], value);\n if (isFalse(matched)) {\n matched = this.visit(node.children[1], value);\n }\n return matched;\n case \"AndExpression\":\n first = this.visit(node.children[0], value);\n\n if (isFalse(first) === true) {\n return first;\n }\n return this.visit(node.children[1], value);\n case \"NotExpression\":\n first = this.visit(node.children[0], value);\n return isFalse(first);\n case \"Literal\":\n return node.value;\n case TOK_PIPE:\n left = this.visit(node.children[0], value);\n return this.visit(node.children[1], left);\n case TOK_CURRENT:\n return value;\n case \"Function\":\n var resolvedArgs = [];\n for (i = 0; i < node.children.length; i++) {\n resolvedArgs.push(this.visit(node.children[i], value));\n }\n return this.runtime.callFunction(node.name, resolvedArgs);\n case \"ExpressionReference\":\n var refNode = node.children[0];\n // Tag the node with a specific attribute so the type\n // checker verify the type.\n refNode.jmespathType = TOK_EXPREF;\n return refNode;\n default:\n throw new Error(\"Unknown node type: \" + node.type);\n }\n },\n\n computeSliceParams: function(arrayLength, sliceParams) {\n var start = sliceParams[0];\n var stop = sliceParams[1];\n var step = sliceParams[2];\n var computed = [null, null, null];\n if (step === null) {\n step = 1;\n } else if (step === 0) {\n var error = new Error(\"Invalid slice, step cannot be 0\");\n error.name = \"RuntimeError\";\n throw error;\n }\n var stepValueNegative = step < 0 ? true : false;\n\n if (start === null) {\n start = stepValueNegative ? arrayLength - 1 : 0;\n } else {\n start = this.capSliceRange(arrayLength, start, step);\n }\n\n if (stop === null) {\n stop = stepValueNegative ? -1 : arrayLength;\n } else {\n stop = this.capSliceRange(arrayLength, stop, step);\n }\n computed[0] = start;\n computed[1] = stop;\n computed[2] = step;\n return computed;\n },\n\n capSliceRange: function(arrayLength, actualValue, step) {\n if (actualValue < 0) {\n actualValue += arrayLength;\n if (actualValue < 0) {\n actualValue = step < 0 ? -1 : 0;\n }\n } else if (actualValue >= arrayLength) {\n actualValue = step < 0 ? arrayLength - 1 : arrayLength;\n }\n return actualValue;\n }\n\n };\n\n function Runtime(interpreter) {\n this._interpreter = interpreter;\n this.functionTable = {\n // name: [function, ]\n // The can be:\n //\n // {\n // args: [[type1, type2], [type1, type2]],\n // variadic: true|false\n // }\n //\n // Each arg in the arg list is a list of valid types\n // (if the function is overloaded and supports multiple\n // types. If the type is \"any\" then no type checking\n // occurs on the argument. Variadic is optional\n // and if not provided is assumed to be false.\n abs: {_func: this._functionAbs, _signature: [{types: [TYPE_NUMBER]}]},\n avg: {_func: this._functionAvg, _signature: [{types: [TYPE_ARRAY_NUMBER]}]},\n ceil: {_func: this._functionCeil, _signature: [{types: [TYPE_NUMBER]}]},\n contains: {\n _func: this._functionContains,\n _signature: [{types: [TYPE_STRING, TYPE_ARRAY]},\n {types: [TYPE_ANY]}]},\n \"ends_with\": {\n _func: this._functionEndsWith,\n _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]},\n floor: {_func: this._functionFloor, _signature: [{types: [TYPE_NUMBER]}]},\n length: {\n _func: this._functionLength,\n _signature: [{types: [TYPE_STRING, TYPE_ARRAY, TYPE_OBJECT]}]},\n map: {\n _func: this._functionMap,\n _signature: [{types: [TYPE_EXPREF]}, {types: [TYPE_ARRAY]}]},\n max: {\n _func: this._functionMax,\n _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]},\n \"merge\": {\n _func: this._functionMerge,\n _signature: [{types: [TYPE_OBJECT], variadic: true}]\n },\n \"max_by\": {\n _func: this._functionMaxBy,\n _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]\n },\n sum: {_func: this._functionSum, _signature: [{types: [TYPE_ARRAY_NUMBER]}]},\n \"starts_with\": {\n _func: this._functionStartsWith,\n _signature: [{types: [TYPE_STRING]}, {types: [TYPE_STRING]}]},\n min: {\n _func: this._functionMin,\n _signature: [{types: [TYPE_ARRAY_NUMBER, TYPE_ARRAY_STRING]}]},\n \"min_by\": {\n _func: this._functionMinBy,\n _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]\n },\n type: {_func: this._functionType, _signature: [{types: [TYPE_ANY]}]},\n keys: {_func: this._functionKeys, _signature: [{types: [TYPE_OBJECT]}]},\n values: {_func: this._functionValues, _signature: [{types: [TYPE_OBJECT]}]},\n sort: {_func: this._functionSort, _signature: [{types: [TYPE_ARRAY_STRING, TYPE_ARRAY_NUMBER]}]},\n \"sort_by\": {\n _func: this._functionSortBy,\n _signature: [{types: [TYPE_ARRAY]}, {types: [TYPE_EXPREF]}]\n },\n join: {\n _func: this._functionJoin,\n _signature: [\n {types: [TYPE_STRING]},\n {types: [TYPE_ARRAY_STRING]}\n ]\n },\n reverse: {\n _func: this._functionReverse,\n _signature: [{types: [TYPE_STRING, TYPE_ARRAY]}]},\n \"to_array\": {_func: this._functionToArray, _signature: [{types: [TYPE_ANY]}]},\n \"to_string\": {_func: this._functionToString, _signature: [{types: [TYPE_ANY]}]},\n \"to_number\": {_func: this._functionToNumber, _signature: [{types: [TYPE_ANY]}]},\n \"not_null\": {\n _func: this._functionNotNull,\n _signature: [{types: [TYPE_ANY], variadic: true}]\n }\n };\n }\n\n Runtime.prototype = {\n callFunction: function(name, resolvedArgs) {\n var functionEntry = this.functionTable[name];\n if (functionEntry === undefined) {\n throw new Error(\"Unknown function: \" + name + \"()\");\n }\n this._validateArgs(name, resolvedArgs, functionEntry._signature);\n return functionEntry._func.call(this, resolvedArgs);\n },\n\n _validateArgs: function(name, args, signature) {\n // Validating the args requires validating\n // the correct arity and the correct type of each arg.\n // If the last argument is declared as variadic, then we need\n // a minimum number of args to be required. Otherwise it has to\n // be an exact amount.\n var pluralized;\n if (signature[signature.length - 1].variadic) {\n if (args.length < signature.length) {\n pluralized = signature.length === 1 ? \" argument\" : \" arguments\";\n throw new Error(\"ArgumentError: \" + name + \"() \" +\n \"takes at least\" + signature.length + pluralized +\n \" but received \" + args.length);\n }\n } else if (args.length !== signature.length) {\n pluralized = signature.length === 1 ? \" argument\" : \" arguments\";\n throw new Error(\"ArgumentError: \" + name + \"() \" +\n \"takes \" + signature.length + pluralized +\n \" but received \" + args.length);\n }\n var currentSpec;\n var actualType;\n var typeMatched;\n for (var i = 0; i < signature.length; i++) {\n typeMatched = false;\n currentSpec = signature[i].types;\n actualType = this._getTypeName(args[i]);\n for (var j = 0; j < currentSpec.length; j++) {\n if (this._typeMatches(actualType, currentSpec[j], args[i])) {\n typeMatched = true;\n break;\n }\n }\n if (!typeMatched) {\n var expected = currentSpec\n .map(function(typeIdentifier) {\n return TYPE_NAME_TABLE[typeIdentifier];\n })\n .join(',');\n throw new Error(\"TypeError: \" + name + \"() \" +\n \"expected argument \" + (i + 1) +\n \" to be type \" + expected +\n \" but received type \" +\n TYPE_NAME_TABLE[actualType] + \" instead.\");\n }\n }\n },\n\n _typeMatches: function(actual, expected, argValue) {\n if (expected === TYPE_ANY) {\n return true;\n }\n if (expected === TYPE_ARRAY_STRING ||\n expected === TYPE_ARRAY_NUMBER ||\n expected === TYPE_ARRAY) {\n // The expected type can either just be array,\n // or it can require a specific subtype (array of numbers).\n //\n // The simplest case is if \"array\" with no subtype is specified.\n if (expected === TYPE_ARRAY) {\n return actual === TYPE_ARRAY;\n } else if (actual === TYPE_ARRAY) {\n // Otherwise we need to check subtypes.\n // I think this has potential to be improved.\n var subtype;\n if (expected === TYPE_ARRAY_NUMBER) {\n subtype = TYPE_NUMBER;\n } else if (expected === TYPE_ARRAY_STRING) {\n subtype = TYPE_STRING;\n }\n for (var i = 0; i < argValue.length; i++) {\n if (!this._typeMatches(\n this._getTypeName(argValue[i]), subtype,\n argValue[i])) {\n return false;\n }\n }\n return true;\n }\n } else {\n return actual === expected;\n }\n },\n _getTypeName: function(obj) {\n switch (Object.prototype.toString.call(obj)) {\n case \"[object String]\":\n return TYPE_STRING;\n case \"[object Number]\":\n return TYPE_NUMBER;\n case \"[object Array]\":\n return TYPE_ARRAY;\n case \"[object Boolean]\":\n return TYPE_BOOLEAN;\n case \"[object Null]\":\n return TYPE_NULL;\n case \"[object Object]\":\n // Check if it's an expref. If it has, it's been\n // tagged with a jmespathType attr of 'Expref';\n if (obj.jmespathType === TOK_EXPREF) {\n return TYPE_EXPREF;\n } else {\n return TYPE_OBJECT;\n }\n }\n },\n\n _functionStartsWith: function(resolvedArgs) {\n return resolvedArgs[0].lastIndexOf(resolvedArgs[1]) === 0;\n },\n\n _functionEndsWith: function(resolvedArgs) {\n var searchStr = resolvedArgs[0];\n var suffix = resolvedArgs[1];\n return searchStr.indexOf(suffix, searchStr.length - suffix.length) !== -1;\n },\n\n _functionReverse: function(resolvedArgs) {\n var typeName = this._getTypeName(resolvedArgs[0]);\n if (typeName === TYPE_STRING) {\n var originalStr = resolvedArgs[0];\n var reversedStr = \"\";\n for (var i = originalStr.length - 1; i >= 0; i--) {\n reversedStr += originalStr[i];\n }\n return reversedStr;\n } else {\n var reversedArray = resolvedArgs[0].slice(0);\n reversedArray.reverse();\n return reversedArray;\n }\n },\n\n _functionAbs: function(resolvedArgs) {\n return Math.abs(resolvedArgs[0]);\n },\n\n _functionCeil: function(resolvedArgs) {\n return Math.ceil(resolvedArgs[0]);\n },\n\n _functionAvg: function(resolvedArgs) {\n var sum = 0;\n var inputArray = resolvedArgs[0];\n for (var i = 0; i < inputArray.length; i++) {\n sum += inputArray[i];\n }\n return sum / inputArray.length;\n },\n\n _functionContains: function(resolvedArgs) {\n return resolvedArgs[0].indexOf(resolvedArgs[1]) >= 0;\n },\n\n _functionFloor: function(resolvedArgs) {\n return Math.floor(resolvedArgs[0]);\n },\n\n _functionLength: function(resolvedArgs) {\n if (!isObject(resolvedArgs[0])) {\n return resolvedArgs[0].length;\n } else {\n // As far as I can tell, there's no way to get the length\n // of an object without O(n) iteration through the object.\n return Object.keys(resolvedArgs[0]).length;\n }\n },\n\n _functionMap: function(resolvedArgs) {\n var mapped = [];\n var interpreter = this._interpreter;\n var exprefNode = resolvedArgs[0];\n var elements = resolvedArgs[1];\n for (var i = 0; i < elements.length; i++) {\n mapped.push(interpreter.visit(exprefNode, elements[i]));\n }\n return mapped;\n },\n\n _functionMerge: function(resolvedArgs) {\n var merged = {};\n for (var i = 0; i < resolvedArgs.length; i++) {\n var current = resolvedArgs[i];\n for (var key in current) {\n merged[key] = current[key];\n }\n }\n return merged;\n },\n\n _functionMax: function(resolvedArgs) {\n if (resolvedArgs[0].length > 0) {\n var typeName = this._getTypeName(resolvedArgs[0][0]);\n if (typeName === TYPE_NUMBER) {\n return Math.max.apply(Math, resolvedArgs[0]);\n } else {\n var elements = resolvedArgs[0];\n var maxElement = elements[0];\n for (var i = 1; i < elements.length; i++) {\n if (maxElement.localeCompare(elements[i]) < 0) {\n maxElement = elements[i];\n }\n }\n return maxElement;\n }\n } else {\n return null;\n }\n },\n\n _functionMin: function(resolvedArgs) {\n if (resolvedArgs[0].length > 0) {\n var typeName = this._getTypeName(resolvedArgs[0][0]);\n if (typeName === TYPE_NUMBER) {\n return Math.min.apply(Math, resolvedArgs[0]);\n } else {\n var elements = resolvedArgs[0];\n var minElement = elements[0];\n for (var i = 1; i < elements.length; i++) {\n if (elements[i].localeCompare(minElement) < 0) {\n minElement = elements[i];\n }\n }\n return minElement;\n }\n } else {\n return null;\n }\n },\n\n _functionSum: function(resolvedArgs) {\n var sum = 0;\n var listToSum = resolvedArgs[0];\n for (var i = 0; i < listToSum.length; i++) {\n sum += listToSum[i];\n }\n return sum;\n },\n\n _functionType: function(resolvedArgs) {\n switch (this._getTypeName(resolvedArgs[0])) {\n case TYPE_NUMBER:\n return \"number\";\n case TYPE_STRING:\n return \"string\";\n case TYPE_ARRAY:\n return \"array\";\n case TYPE_OBJECT:\n return \"object\";\n case TYPE_BOOLEAN:\n return \"boolean\";\n case TYPE_EXPREF:\n return \"expref\";\n case TYPE_NULL:\n return \"null\";\n }\n },\n\n _functionKeys: function(resolvedArgs) {\n return Object.keys(resolvedArgs[0]);\n },\n\n _functionValues: function(resolvedArgs) {\n var obj = resolvedArgs[0];\n var keys = Object.keys(obj);\n var values = [];\n for (var i = 0; i < keys.length; i++) {\n values.push(obj[keys[i]]);\n }\n return values;\n },\n\n _functionJoin: function(resolvedArgs) {\n var joinChar = resolvedArgs[0];\n var listJoin = resolvedArgs[1];\n return listJoin.join(joinChar);\n },\n\n _functionToArray: function(resolvedArgs) {\n if (this._getTypeName(resolvedArgs[0]) === TYPE_ARRAY) {\n return resolvedArgs[0];\n } else {\n return [resolvedArgs[0]];\n }\n },\n\n _functionToString: function(resolvedArgs) {\n if (this._getTypeName(resolvedArgs[0]) === TYPE_STRING) {\n return resolvedArgs[0];\n } else {\n return JSON.stringify(resolvedArgs[0]);\n }\n },\n\n _functionToNumber: function(resolvedArgs) {\n var typeName = this._getTypeName(resolvedArgs[0]);\n var convertedValue;\n if (typeName === TYPE_NUMBER) {\n return resolvedArgs[0];\n } else if (typeName === TYPE_STRING) {\n convertedValue = +resolvedArgs[0];\n if (!isNaN(convertedValue)) {\n return convertedValue;\n }\n }\n return null;\n },\n\n _functionNotNull: function(resolvedArgs) {\n for (var i = 0; i < resolvedArgs.length; i++) {\n if (this._getTypeName(resolvedArgs[i]) !== TYPE_NULL) {\n return resolvedArgs[i];\n }\n }\n return null;\n },\n\n _functionSort: function(resolvedArgs) {\n var sortedArray = resolvedArgs[0].slice(0);\n sortedArray.sort();\n return sortedArray;\n },\n\n _functionSortBy: function(resolvedArgs) {\n var sortedArray = resolvedArgs[0].slice(0);\n if (sortedArray.length === 0) {\n return sortedArray;\n }\n var interpreter = this._interpreter;\n var exprefNode = resolvedArgs[1];\n var requiredType = this._getTypeName(\n interpreter.visit(exprefNode, sortedArray[0]));\n if ([TYPE_NUMBER, TYPE_STRING].indexOf(requiredType) < 0) {\n throw new Error(\"TypeError\");\n }\n var that = this;\n // In order to get a stable sort out of an unstable\n // sort algorithm, we decorate/sort/undecorate (DSU)\n // by creating a new list of [index, element] pairs.\n // In the cmp function, if the evaluated elements are\n // equal, then the index will be used as the tiebreaker.\n // After the decorated list has been sorted, it will be\n // undecorated to extract the original elements.\n var decorated = [];\n for (var i = 0; i < sortedArray.length; i++) {\n decorated.push([i, sortedArray[i]]);\n }\n decorated.sort(function(a, b) {\n var exprA = interpreter.visit(exprefNode, a[1]);\n var exprB = interpreter.visit(exprefNode, b[1]);\n if (that._getTypeName(exprA) !== requiredType) {\n throw new Error(\n \"TypeError: expected \" + requiredType + \", received \" +\n that._getTypeName(exprA));\n } else if (that._getTypeName(exprB) !== requiredType) {\n throw new Error(\n \"TypeError: expected \" + requiredType + \", received \" +\n that._getTypeName(exprB));\n }\n if (exprA > exprB) {\n return 1;\n } else if (exprA < exprB) {\n return -1;\n } else {\n // If they're equal compare the items by their\n // order to maintain relative order of equal keys\n // (i.e. to get a stable sort).\n return a[0] - b[0];\n }\n });\n // Undecorate: extract out the original list elements.\n for (var j = 0; j < decorated.length; j++) {\n sortedArray[j] = decorated[j][1];\n }\n return sortedArray;\n },\n\n _functionMaxBy: function(resolvedArgs) {\n var exprefNode = resolvedArgs[1];\n var resolvedArray = resolvedArgs[0];\n var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);\n var maxNumber = -Infinity;\n var maxRecord;\n var current;\n for (var i = 0; i < resolvedArray.length; i++) {\n current = keyFunction(resolvedArray[i]);\n if (current > maxNumber) {\n maxNumber = current;\n maxRecord = resolvedArray[i];\n }\n }\n return maxRecord;\n },\n\n _functionMinBy: function(resolvedArgs) {\n var exprefNode = resolvedArgs[1];\n var resolvedArray = resolvedArgs[0];\n var keyFunction = this.createKeyFunction(exprefNode, [TYPE_NUMBER, TYPE_STRING]);\n var minNumber = Infinity;\n var minRecord;\n var current;\n for (var i = 0; i < resolvedArray.length; i++) {\n current = keyFunction(resolvedArray[i]);\n if (current < minNumber) {\n minNumber = current;\n minRecord = resolvedArray[i];\n }\n }\n return minRecord;\n },\n\n createKeyFunction: function(exprefNode, allowedTypes) {\n var that = this;\n var interpreter = this._interpreter;\n var keyFunc = function(x) {\n var current = interpreter.visit(exprefNode, x);\n if (allowedTypes.indexOf(that._getTypeName(current)) < 0) {\n var msg = \"TypeError: expected one of \" + allowedTypes +\n \", received \" + that._getTypeName(current);\n throw new Error(msg);\n }\n return current;\n };\n return keyFunc;\n }\n\n };\n\n function compile(stream) {\n var parser = new Parser();\n var ast = parser.parse(stream);\n return ast;\n }\n\n function tokenize(stream) {\n var lexer = new Lexer();\n return lexer.tokenize(stream);\n }\n\n function search(data, expression) {\n var parser = new Parser();\n // This needs to be improved. Both the interpreter and runtime depend on\n // each other. The runtime needs the interpreter to support exprefs.\n // There's likely a clean way to avoid the cyclic dependency.\n var runtime = new Runtime();\n var interpreter = new TreeInterpreter(runtime);\n runtime._interpreter = interpreter;\n var node = parser.parse(expression);\n return interpreter.search(node, data);\n }\n\n exports.tokenize = tokenize;\n exports.compile = compile;\n exports.search = search;\n exports.strictDeepEqual = strictDeepEqual;\n})(typeof exports === \"undefined\" ? this.jmespath = {} : exports);\n","'use strict';\n\n\nvar loader = require('./lib/loader');\nvar dumper = require('./lib/dumper');\n\n\nfunction renamed(from, to) {\n return function () {\n throw new Error('Function yaml.' + from + ' is removed in js-yaml 4. ' +\n 'Use yaml.' + to + ' instead, which is now safe by default.');\n };\n}\n\n\nmodule.exports.Type = require('./lib/type');\nmodule.exports.Schema = require('./lib/schema');\nmodule.exports.FAILSAFE_SCHEMA = require('./lib/schema/failsafe');\nmodule.exports.JSON_SCHEMA = require('./lib/schema/json');\nmodule.exports.CORE_SCHEMA = require('./lib/schema/core');\nmodule.exports.DEFAULT_SCHEMA = require('./lib/schema/default');\nmodule.exports.load = loader.load;\nmodule.exports.loadAll = loader.loadAll;\nmodule.exports.dump = dumper.dump;\nmodule.exports.YAMLException = require('./lib/exception');\n\n// Re-export all types in case user wants to create custom schema\nmodule.exports.types = {\n binary: require('./lib/type/binary'),\n float: require('./lib/type/float'),\n map: require('./lib/type/map'),\n null: require('./lib/type/null'),\n pairs: require('./lib/type/pairs'),\n set: require('./lib/type/set'),\n timestamp: require('./lib/type/timestamp'),\n bool: require('./lib/type/bool'),\n int: require('./lib/type/int'),\n merge: require('./lib/type/merge'),\n omap: require('./lib/type/omap'),\n seq: require('./lib/type/seq'),\n str: require('./lib/type/str')\n};\n\n// Removed functions from JS-YAML 3.0.x\nmodule.exports.safeLoad = renamed('safeLoad', 'load');\nmodule.exports.safeLoadAll = renamed('safeLoadAll', 'loadAll');\nmodule.exports.safeDump = renamed('safeDump', 'dump');\n","'use strict';\n\n\nfunction isNothing(subject) {\n return (typeof subject === 'undefined') || (subject === null);\n}\n\n\nfunction isObject(subject) {\n return (typeof subject === 'object') && (subject !== null);\n}\n\n\nfunction toArray(sequence) {\n if (Array.isArray(sequence)) return sequence;\n else if (isNothing(sequence)) return [];\n\n return [ sequence ];\n}\n\n\nfunction extend(target, source) {\n var index, length, key, sourceKeys;\n\n if (source) {\n sourceKeys = Object.keys(source);\n\n for (index = 0, length = sourceKeys.length; index < length; index += 1) {\n key = sourceKeys[index];\n target[key] = source[key];\n }\n }\n\n return target;\n}\n\n\nfunction repeat(string, count) {\n var result = '', cycle;\n\n for (cycle = 0; cycle < count; cycle += 1) {\n result += string;\n }\n\n return result;\n}\n\n\nfunction isNegativeZero(number) {\n return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);\n}\n\n\nmodule.exports.isNothing = isNothing;\nmodule.exports.isObject = isObject;\nmodule.exports.toArray = toArray;\nmodule.exports.repeat = repeat;\nmodule.exports.isNegativeZero = isNegativeZero;\nmodule.exports.extend = extend;\n","'use strict';\n\n/*eslint-disable no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar DEFAULT_SCHEMA = require('./schema/default');\n\nvar _toString = Object.prototype.toString;\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nvar CHAR_BOM = 0xFEFF;\nvar CHAR_TAB = 0x09; /* Tab */\nvar CHAR_LINE_FEED = 0x0A; /* LF */\nvar CHAR_CARRIAGE_RETURN = 0x0D; /* CR */\nvar CHAR_SPACE = 0x20; /* Space */\nvar CHAR_EXCLAMATION = 0x21; /* ! */\nvar CHAR_DOUBLE_QUOTE = 0x22; /* \" */\nvar CHAR_SHARP = 0x23; /* # */\nvar CHAR_PERCENT = 0x25; /* % */\nvar CHAR_AMPERSAND = 0x26; /* & */\nvar CHAR_SINGLE_QUOTE = 0x27; /* ' */\nvar CHAR_ASTERISK = 0x2A; /* * */\nvar CHAR_COMMA = 0x2C; /* , */\nvar CHAR_MINUS = 0x2D; /* - */\nvar CHAR_COLON = 0x3A; /* : */\nvar CHAR_EQUALS = 0x3D; /* = */\nvar CHAR_GREATER_THAN = 0x3E; /* > */\nvar CHAR_QUESTION = 0x3F; /* ? */\nvar CHAR_COMMERCIAL_AT = 0x40; /* @ */\nvar CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */\nvar CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */\nvar CHAR_GRAVE_ACCENT = 0x60; /* ` */\nvar CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */\nvar CHAR_VERTICAL_LINE = 0x7C; /* | */\nvar CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */\n\nvar ESCAPE_SEQUENCES = {};\n\nESCAPE_SEQUENCES[0x00] = '\\\\0';\nESCAPE_SEQUENCES[0x07] = '\\\\a';\nESCAPE_SEQUENCES[0x08] = '\\\\b';\nESCAPE_SEQUENCES[0x09] = '\\\\t';\nESCAPE_SEQUENCES[0x0A] = '\\\\n';\nESCAPE_SEQUENCES[0x0B] = '\\\\v';\nESCAPE_SEQUENCES[0x0C] = '\\\\f';\nESCAPE_SEQUENCES[0x0D] = '\\\\r';\nESCAPE_SEQUENCES[0x1B] = '\\\\e';\nESCAPE_SEQUENCES[0x22] = '\\\\\"';\nESCAPE_SEQUENCES[0x5C] = '\\\\\\\\';\nESCAPE_SEQUENCES[0x85] = '\\\\N';\nESCAPE_SEQUENCES[0xA0] = '\\\\_';\nESCAPE_SEQUENCES[0x2028] = '\\\\L';\nESCAPE_SEQUENCES[0x2029] = '\\\\P';\n\nvar DEPRECATED_BOOLEANS_SYNTAX = [\n 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',\n 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'\n];\n\nvar DEPRECATED_BASE60_SYNTAX = /^[-+]?[0-9_]+(?::[0-9_]+)+(?:\\.[0-9_]*)?$/;\n\nfunction compileStyleMap(schema, map) {\n var result, keys, index, length, tag, style, type;\n\n if (map === null) return {};\n\n result = {};\n keys = Object.keys(map);\n\n for (index = 0, length = keys.length; index < length; index += 1) {\n tag = keys[index];\n style = String(map[tag]);\n\n if (tag.slice(0, 2) === '!!') {\n tag = 'tag:yaml.org,2002:' + tag.slice(2);\n }\n type = schema.compiledTypeMap['fallback'][tag];\n\n if (type && _hasOwnProperty.call(type.styleAliases, style)) {\n style = type.styleAliases[style];\n }\n\n result[tag] = style;\n }\n\n return result;\n}\n\nfunction encodeHex(character) {\n var string, handle, length;\n\n string = character.toString(16).toUpperCase();\n\n if (character <= 0xFF) {\n handle = 'x';\n length = 2;\n } else if (character <= 0xFFFF) {\n handle = 'u';\n length = 4;\n } else if (character <= 0xFFFFFFFF) {\n handle = 'U';\n length = 8;\n } else {\n throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');\n }\n\n return '\\\\' + handle + common.repeat('0', length - string.length) + string;\n}\n\n\nvar QUOTING_TYPE_SINGLE = 1,\n QUOTING_TYPE_DOUBLE = 2;\n\nfunction State(options) {\n this.schema = options['schema'] || DEFAULT_SCHEMA;\n this.indent = Math.max(1, (options['indent'] || 2));\n this.noArrayIndent = options['noArrayIndent'] || false;\n this.skipInvalid = options['skipInvalid'] || false;\n this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);\n this.styleMap = compileStyleMap(this.schema, options['styles'] || null);\n this.sortKeys = options['sortKeys'] || false;\n this.lineWidth = options['lineWidth'] || 80;\n this.noRefs = options['noRefs'] || false;\n this.noCompatMode = options['noCompatMode'] || false;\n this.condenseFlow = options['condenseFlow'] || false;\n this.quotingType = options['quotingType'] === '\"' ? QUOTING_TYPE_DOUBLE : QUOTING_TYPE_SINGLE;\n this.forceQuotes = options['forceQuotes'] || false;\n this.replacer = typeof options['replacer'] === 'function' ? options['replacer'] : null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.explicitTypes = this.schema.compiledExplicit;\n\n this.tag = null;\n this.result = '';\n\n this.duplicates = [];\n this.usedDuplicates = null;\n}\n\n// Indents every line in a string. Empty lines (\\n only) are not indented.\nfunction indentString(string, spaces) {\n var ind = common.repeat(' ', spaces),\n position = 0,\n next = -1,\n result = '',\n line,\n length = string.length;\n\n while (position < length) {\n next = string.indexOf('\\n', position);\n if (next === -1) {\n line = string.slice(position);\n position = length;\n } else {\n line = string.slice(position, next + 1);\n position = next + 1;\n }\n\n if (line.length && line !== '\\n') result += ind;\n\n result += line;\n }\n\n return result;\n}\n\nfunction generateNextLine(state, level) {\n return '\\n' + common.repeat(' ', state.indent * level);\n}\n\nfunction testImplicitResolving(state, str) {\n var index, length, type;\n\n for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {\n type = state.implicitTypes[index];\n\n if (type.resolve(str)) {\n return true;\n }\n }\n\n return false;\n}\n\n// [33] s-white ::= s-space | s-tab\nfunction isWhitespace(c) {\n return c === CHAR_SPACE || c === CHAR_TAB;\n}\n\n// Returns true if the character can be printed without escaping.\n// From YAML 1.2: \"any allowed characters known to be non-printable\n// should also be escaped. [However,] This isn’t mandatory\"\n// Derived from nb-char - \\t - #x85 - #xA0 - #x2028 - #x2029.\nfunction isPrintable(c) {\n return (0x00020 <= c && c <= 0x00007E)\n || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)\n || ((0x0E000 <= c && c <= 0x00FFFD) && c !== CHAR_BOM)\n || (0x10000 <= c && c <= 0x10FFFF);\n}\n\n// [34] ns-char ::= nb-char - s-white\n// [27] nb-char ::= c-printable - b-char - c-byte-order-mark\n// [26] b-char ::= b-line-feed | b-carriage-return\n// Including s-white (for some reason, examples doesn't match specs in this aspect)\n// ns-char ::= c-printable - b-line-feed - b-carriage-return - c-byte-order-mark\nfunction isNsCharOrWhitespace(c) {\n return isPrintable(c)\n && c !== CHAR_BOM\n // - b-char\n && c !== CHAR_CARRIAGE_RETURN\n && c !== CHAR_LINE_FEED;\n}\n\n// [127] ns-plain-safe(c) ::= c = flow-out ⇒ ns-plain-safe-out\n// c = flow-in ⇒ ns-plain-safe-in\n// c = block-key ⇒ ns-plain-safe-out\n// c = flow-key ⇒ ns-plain-safe-in\n// [128] ns-plain-safe-out ::= ns-char\n// [129] ns-plain-safe-in ::= ns-char - c-flow-indicator\n// [130] ns-plain-char(c) ::= ( ns-plain-safe(c) - “:” - “#” )\n// | ( /* An ns-char preceding */ “#” )\n// | ( “:” /* Followed by an ns-plain-safe(c) */ )\nfunction isPlainSafe(c, prev, inblock) {\n var cIsNsCharOrWhitespace = isNsCharOrWhitespace(c);\n var cIsNsChar = cIsNsCharOrWhitespace && !isWhitespace(c);\n return (\n // ns-plain-safe\n inblock ? // c = flow-in\n cIsNsCharOrWhitespace\n : cIsNsCharOrWhitespace\n // - c-flow-indicator\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n )\n // ns-plain-char\n && c !== CHAR_SHARP // false on '#'\n && !(prev === CHAR_COLON && !cIsNsChar) // false on ': '\n || (isNsCharOrWhitespace(prev) && !isWhitespace(prev) && c === CHAR_SHARP) // change to true on '[^ ]#'\n || (prev === CHAR_COLON && cIsNsChar); // change to true on ':[^ ]'\n}\n\n// Simplified test for values allowed as the first character in plain style.\nfunction isPlainSafeFirst(c) {\n // Uses a subset of ns-char - c-indicator\n // where ns-char = nb-char - s-white.\n // No support of ( ( “?” | “:” | “-” ) /* Followed by an ns-plain-safe(c)) */ ) part\n return isPrintable(c) && c !== CHAR_BOM\n && !isWhitespace(c) // - s-white\n // - (c-indicator ::=\n // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”\n && c !== CHAR_MINUS\n && c !== CHAR_QUESTION\n && c !== CHAR_COLON\n && c !== CHAR_COMMA\n && c !== CHAR_LEFT_SQUARE_BRACKET\n && c !== CHAR_RIGHT_SQUARE_BRACKET\n && c !== CHAR_LEFT_CURLY_BRACKET\n && c !== CHAR_RIGHT_CURLY_BRACKET\n // | “#” | “&” | “*” | “!” | “|” | “=” | “>” | “'” | “\"”\n && c !== CHAR_SHARP\n && c !== CHAR_AMPERSAND\n && c !== CHAR_ASTERISK\n && c !== CHAR_EXCLAMATION\n && c !== CHAR_VERTICAL_LINE\n && c !== CHAR_EQUALS\n && c !== CHAR_GREATER_THAN\n && c !== CHAR_SINGLE_QUOTE\n && c !== CHAR_DOUBLE_QUOTE\n // | “%” | “@” | “`”)\n && c !== CHAR_PERCENT\n && c !== CHAR_COMMERCIAL_AT\n && c !== CHAR_GRAVE_ACCENT;\n}\n\n// Simplified test for values allowed as the last character in plain style.\nfunction isPlainSafeLast(c) {\n // just not whitespace or colon, it will be checked to be plain character later\n return !isWhitespace(c) && c !== CHAR_COLON;\n}\n\n// Same as 'string'.codePointAt(pos), but works in older browsers.\nfunction codePointAt(string, pos) {\n var first = string.charCodeAt(pos), second;\n if (first >= 0xD800 && first <= 0xDBFF && pos + 1 < string.length) {\n second = string.charCodeAt(pos + 1);\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;\n }\n }\n return first;\n}\n\n// Determines whether block indentation indicator is required.\nfunction needIndentIndicator(string) {\n var leadingSpaceRe = /^\\n* /;\n return leadingSpaceRe.test(string);\n}\n\nvar STYLE_PLAIN = 1,\n STYLE_SINGLE = 2,\n STYLE_LITERAL = 3,\n STYLE_FOLDED = 4,\n STYLE_DOUBLE = 5;\n\n// Determines which scalar styles are possible and returns the preferred style.\n// lineWidth = -1 => no limit.\n// Pre-conditions: str.length > 0.\n// Post-conditions:\n// STYLE_PLAIN or STYLE_SINGLE => no \\n are in the string.\n// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).\n// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).\nfunction chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth,\n testAmbiguousType, quotingType, forceQuotes, inblock) {\n\n var i;\n var char = 0;\n var prevChar = null;\n var hasLineBreak = false;\n var hasFoldableLine = false; // only checked if shouldTrackWidth\n var shouldTrackWidth = lineWidth !== -1;\n var previousLineBreak = -1; // count the first line correctly\n var plain = isPlainSafeFirst(codePointAt(string, 0))\n && isPlainSafeLast(codePointAt(string, string.length - 1));\n\n if (singleLineOnly || forceQuotes) {\n // Case: no block styles.\n // Check for disallowed characters to rule out plain and single.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char, prevChar, inblock);\n prevChar = char;\n }\n } else {\n // Case: block styles permitted.\n for (i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n if (char === CHAR_LINE_FEED) {\n hasLineBreak = true;\n // Check if any line can be folded.\n if (shouldTrackWidth) {\n hasFoldableLine = hasFoldableLine ||\n // Foldable line = too long, and not more-indented.\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' ');\n previousLineBreak = i;\n }\n } else if (!isPrintable(char)) {\n return STYLE_DOUBLE;\n }\n plain = plain && isPlainSafe(char, prevChar, inblock);\n prevChar = char;\n }\n // in case the end is missing a \\n\n hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&\n (i - previousLineBreak - 1 > lineWidth &&\n string[previousLineBreak + 1] !== ' '));\n }\n // Although every style can represent \\n without escaping, prefer block styles\n // for multiline, since they're more readable and they don't add empty lines.\n // Also prefer folding a super-long line.\n if (!hasLineBreak && !hasFoldableLine) {\n // Strings interpretable as another type have to be quoted;\n // e.g. the string 'true' vs. the boolean true.\n if (plain && !forceQuotes && !testAmbiguousType(string)) {\n return STYLE_PLAIN;\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;\n }\n // Edge case: block indentation indicator can only have one digit.\n if (indentPerLevel > 9 && needIndentIndicator(string)) {\n return STYLE_DOUBLE;\n }\n // At this point we know block styles are valid.\n // Prefer literal style unless we want to fold.\n if (!forceQuotes) {\n return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;\n }\n return quotingType === QUOTING_TYPE_DOUBLE ? STYLE_DOUBLE : STYLE_SINGLE;\n}\n\n// Note: line breaking/folding is implemented for only the folded style.\n// NB. We drop the last trailing newline (if any) of a returned block scalar\n// since the dumper adds its own newline. This always works:\n// • No ending newline => unaffected; already using strip \"-\" chomping.\n// • Ending newline => removed then restored.\n// Importantly, this keeps the \"+\" chomp indicator from gaining an extra line.\nfunction writeScalar(state, string, level, iskey, inblock) {\n state.dump = (function () {\n if (string.length === 0) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? '\"\"' : \"''\";\n }\n if (!state.noCompatMode) {\n if (DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1 || DEPRECATED_BASE60_SYNTAX.test(string)) {\n return state.quotingType === QUOTING_TYPE_DOUBLE ? ('\"' + string + '\"') : (\"'\" + string + \"'\");\n }\n }\n\n var indent = state.indent * Math.max(1, level); // no 0-indent scalars\n // As indentation gets deeper, let the width decrease monotonically\n // to the lower bound min(state.lineWidth, 40).\n // Note that this implies\n // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.\n // state.lineWidth > 40 + state.indent: width decreases until the lower bound.\n // This behaves better than a constant minimum width which disallows narrower options,\n // or an indent threshold which causes the width to suddenly increase.\n var lineWidth = state.lineWidth === -1\n ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);\n\n // Without knowing if keys are implicit/explicit, assume implicit for safety.\n var singleLineOnly = iskey\n // No block styles in flow mode.\n || (state.flowLevel > -1 && level >= state.flowLevel);\n function testAmbiguity(string) {\n return testImplicitResolving(state, string);\n }\n\n switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth,\n testAmbiguity, state.quotingType, state.forceQuotes && !iskey, inblock)) {\n\n case STYLE_PLAIN:\n return string;\n case STYLE_SINGLE:\n return \"'\" + string.replace(/'/g, \"''\") + \"'\";\n case STYLE_LITERAL:\n return '|' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(string, indent));\n case STYLE_FOLDED:\n return '>' + blockHeader(string, state.indent)\n + dropEndingNewline(indentString(foldString(string, lineWidth), indent));\n case STYLE_DOUBLE:\n return '\"' + escapeString(string, lineWidth) + '\"';\n default:\n throw new YAMLException('impossible error: invalid scalar style');\n }\n }());\n}\n\n// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.\nfunction blockHeader(string, indentPerLevel) {\n var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';\n\n // note the special case: the string '\\n' counts as a \"trailing\" empty line.\n var clip = string[string.length - 1] === '\\n';\n var keep = clip && (string[string.length - 2] === '\\n' || string === '\\n');\n var chomp = keep ? '+' : (clip ? '' : '-');\n\n return indentIndicator + chomp + '\\n';\n}\n\n// (See the note for writeScalar.)\nfunction dropEndingNewline(string) {\n return string[string.length - 1] === '\\n' ? string.slice(0, -1) : string;\n}\n\n// Note: a long line without a suitable break point will exceed the width limit.\n// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.\nfunction foldString(string, width) {\n // In folded style, $k$ consecutive newlines output as $k+1$ newlines—\n // unless they're before or after a more-indented line, or at the very\n // beginning or end, in which case $k$ maps to $k$.\n // Therefore, parse each chunk as newline(s) followed by a content line.\n var lineRe = /(\\n+)([^\\n]*)/g;\n\n // first line (possibly an empty line)\n var result = (function () {\n var nextLF = string.indexOf('\\n');\n nextLF = nextLF !== -1 ? nextLF : string.length;\n lineRe.lastIndex = nextLF;\n return foldLine(string.slice(0, nextLF), width);\n }());\n // If we haven't reached the first content line yet, don't add an extra \\n.\n var prevMoreIndented = string[0] === '\\n' || string[0] === ' ';\n var moreIndented;\n\n // rest of the lines\n var match;\n while ((match = lineRe.exec(string))) {\n var prefix = match[1], line = match[2];\n moreIndented = (line[0] === ' ');\n result += prefix\n + (!prevMoreIndented && !moreIndented && line !== ''\n ? '\\n' : '')\n + foldLine(line, width);\n prevMoreIndented = moreIndented;\n }\n\n return result;\n}\n\n// Greedy line breaking.\n// Picks the longest line under the limit each time,\n// otherwise settles for the shortest line over the limit.\n// NB. More-indented lines *cannot* be folded, as that would add an extra \\n.\nfunction foldLine(line, width) {\n if (line === '' || line[0] === ' ') return line;\n\n // Since a more-indented line adds a \\n, breaks can't be followed by a space.\n var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.\n var match;\n // start is an inclusive index. end, curr, and next are exclusive.\n var start = 0, end, curr = 0, next = 0;\n var result = '';\n\n // Invariants: 0 <= start <= length-1.\n // 0 <= curr <= next <= max(0, length-2). curr - start <= width.\n // Inside the loop:\n // A match implies length >= 2, so curr and next are <= length-2.\n while ((match = breakRe.exec(line))) {\n next = match.index;\n // maintain invariant: curr - start <= width\n if (next - start > width) {\n end = (curr > start) ? curr : next; // derive end <= length-2\n result += '\\n' + line.slice(start, end);\n // skip the space that was output as \\n\n start = end + 1; // derive start <= length-1\n }\n curr = next;\n }\n\n // By the invariants, start <= length-1, so there is something left over.\n // It is either the whole string or a part starting from non-whitespace.\n result += '\\n';\n // Insert a break if the remainder is too long and there is a break available.\n if (line.length - start > width && curr > start) {\n result += line.slice(start, curr) + '\\n' + line.slice(curr + 1);\n } else {\n result += line.slice(start);\n }\n\n return result.slice(1); // drop extra \\n joiner\n}\n\n// Escapes a double-quoted string.\nfunction escapeString(string) {\n var result = '';\n var char = 0;\n var escapeSeq;\n\n for (var i = 0; i < string.length; char >= 0x10000 ? i += 2 : i++) {\n char = codePointAt(string, i);\n escapeSeq = ESCAPE_SEQUENCES[char];\n\n if (!escapeSeq && isPrintable(char)) {\n result += string[i];\n if (char >= 0x10000) result += string[i + 1];\n } else {\n result += escapeSeq || encodeHex(char);\n }\n }\n\n return result;\n}\n\nfunction writeFlowSequence(state, level, object) {\n var _result = '',\n _tag = state.tag,\n index,\n length,\n value;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n value = object[index];\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value);\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level, value, false, false) ||\n (typeof value === 'undefined' &&\n writeNode(state, level, null, false, false))) {\n\n if (_result !== '') _result += ',' + (!state.condenseFlow ? ' ' : '');\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = '[' + _result + ']';\n}\n\nfunction writeBlockSequence(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n index,\n length,\n value;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n value = object[index];\n\n if (state.replacer) {\n value = state.replacer.call(object, String(index), value);\n }\n\n // Write only valid elements, put null instead of invalid elements.\n if (writeNode(state, level + 1, value, true, true, false, true) ||\n (typeof value === 'undefined' &&\n writeNode(state, level + 1, null, true, true, false, true))) {\n\n if (!compact || _result !== '') {\n _result += generateNextLine(state, level);\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n _result += '-';\n } else {\n _result += '- ';\n }\n\n _result += state.dump;\n }\n }\n\n state.tag = _tag;\n state.dump = _result || '[]'; // Empty sequence if no valid values.\n}\n\nfunction writeFlowMapping(state, level, object) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n pairBuffer;\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n\n pairBuffer = '';\n if (_result !== '') pairBuffer += ', ';\n\n if (state.condenseFlow) pairBuffer += '\"';\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue);\n }\n\n if (!writeNode(state, level, objectKey, false, false)) {\n continue; // Skip this pair because of invalid key;\n }\n\n if (state.dump.length > 1024) pairBuffer += '? ';\n\n pairBuffer += state.dump + (state.condenseFlow ? '\"' : '') + ':' + (state.condenseFlow ? '' : ' ');\n\n if (!writeNode(state, level, objectValue, false, false)) {\n continue; // Skip this pair because of invalid value.\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = '{' + _result + '}';\n}\n\nfunction writeBlockMapping(state, level, object, compact) {\n var _result = '',\n _tag = state.tag,\n objectKeyList = Object.keys(object),\n index,\n length,\n objectKey,\n objectValue,\n explicitPair,\n pairBuffer;\n\n // Allow sorting keys so that the output file is deterministic\n if (state.sortKeys === true) {\n // Default sorting\n objectKeyList.sort();\n } else if (typeof state.sortKeys === 'function') {\n // Custom sort function\n objectKeyList.sort(state.sortKeys);\n } else if (state.sortKeys) {\n // Something is wrong\n throw new YAMLException('sortKeys must be a boolean or a function');\n }\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n pairBuffer = '';\n\n if (!compact || _result !== '') {\n pairBuffer += generateNextLine(state, level);\n }\n\n objectKey = objectKeyList[index];\n objectValue = object[objectKey];\n\n if (state.replacer) {\n objectValue = state.replacer.call(object, objectKey, objectValue);\n }\n\n if (!writeNode(state, level + 1, objectKey, true, true, true)) {\n continue; // Skip this pair because of invalid key.\n }\n\n explicitPair = (state.tag !== null && state.tag !== '?') ||\n (state.dump && state.dump.length > 1024);\n\n if (explicitPair) {\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += '?';\n } else {\n pairBuffer += '? ';\n }\n }\n\n pairBuffer += state.dump;\n\n if (explicitPair) {\n pairBuffer += generateNextLine(state, level);\n }\n\n if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {\n continue; // Skip this pair because of invalid value.\n }\n\n if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {\n pairBuffer += ':';\n } else {\n pairBuffer += ': ';\n }\n\n pairBuffer += state.dump;\n\n // Both key and value are valid.\n _result += pairBuffer;\n }\n\n state.tag = _tag;\n state.dump = _result || '{}'; // Empty mapping if no valid pairs.\n}\n\nfunction detectType(state, object, explicit) {\n var _result, typeList, index, length, type, style;\n\n typeList = explicit ? state.explicitTypes : state.implicitTypes;\n\n for (index = 0, length = typeList.length; index < length; index += 1) {\n type = typeList[index];\n\n if ((type.instanceOf || type.predicate) &&\n (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&\n (!type.predicate || type.predicate(object))) {\n\n if (explicit) {\n if (type.multi && type.representName) {\n state.tag = type.representName(object);\n } else {\n state.tag = type.tag;\n }\n } else {\n state.tag = '?';\n }\n\n if (type.represent) {\n style = state.styleMap[type.tag] || type.defaultStyle;\n\n if (_toString.call(type.represent) === '[object Function]') {\n _result = type.represent(object, style);\n } else if (_hasOwnProperty.call(type.represent, style)) {\n _result = type.represent[style](object, style);\n } else {\n throw new YAMLException('!<' + type.tag + '> tag resolver accepts not \"' + style + '\" style');\n }\n\n state.dump = _result;\n }\n\n return true;\n }\n }\n\n return false;\n}\n\n// Serializes `object` and writes it to global `result`.\n// Returns true on success, or false on invalid object.\n//\nfunction writeNode(state, level, object, block, compact, iskey, isblockseq) {\n state.tag = null;\n state.dump = object;\n\n if (!detectType(state, object, false)) {\n detectType(state, object, true);\n }\n\n var type = _toString.call(state.dump);\n var inblock = block;\n var tagStr;\n\n if (block) {\n block = (state.flowLevel < 0 || state.flowLevel > level);\n }\n\n var objectOrArray = type === '[object Object]' || type === '[object Array]',\n duplicateIndex,\n duplicate;\n\n if (objectOrArray) {\n duplicateIndex = state.duplicates.indexOf(object);\n duplicate = duplicateIndex !== -1;\n }\n\n if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {\n compact = false;\n }\n\n if (duplicate && state.usedDuplicates[duplicateIndex]) {\n state.dump = '*ref_' + duplicateIndex;\n } else {\n if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {\n state.usedDuplicates[duplicateIndex] = true;\n }\n if (type === '[object Object]') {\n if (block && (Object.keys(state.dump).length !== 0)) {\n writeBlockMapping(state, level, state.dump, compact);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowMapping(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object Array]') {\n if (block && (state.dump.length !== 0)) {\n if (state.noArrayIndent && !isblockseq && level > 0) {\n writeBlockSequence(state, level - 1, state.dump, compact);\n } else {\n writeBlockSequence(state, level, state.dump, compact);\n }\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + state.dump;\n }\n } else {\n writeFlowSequence(state, level, state.dump);\n if (duplicate) {\n state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;\n }\n }\n } else if (type === '[object String]') {\n if (state.tag !== '?') {\n writeScalar(state, state.dump, level, iskey, inblock);\n }\n } else if (type === '[object Undefined]') {\n return false;\n } else {\n if (state.skipInvalid) return false;\n throw new YAMLException('unacceptable kind of an object to dump ' + type);\n }\n\n if (state.tag !== null && state.tag !== '?') {\n // Need to encode all characters except those allowed by the spec:\n //\n // [35] ns-dec-digit ::= [#x30-#x39] /* 0-9 */\n // [36] ns-hex-digit ::= ns-dec-digit\n // | [#x41-#x46] /* A-F */ | [#x61-#x66] /* a-f */\n // [37] ns-ascii-letter ::= [#x41-#x5A] /* A-Z */ | [#x61-#x7A] /* a-z */\n // [38] ns-word-char ::= ns-dec-digit | ns-ascii-letter | “-”\n // [39] ns-uri-char ::= “%” ns-hex-digit ns-hex-digit | ns-word-char | “#”\n // | “;” | “/” | “?” | “:” | “@” | “&” | “=” | “+” | “$” | “,”\n // | “_” | “.” | “!” | “~” | “*” | “'” | “(” | “)” | “[” | “]”\n //\n // Also need to encode '!' because it has special meaning (end of tag prefix).\n //\n tagStr = encodeURI(\n state.tag[0] === '!' ? state.tag.slice(1) : state.tag\n ).replace(/!/g, '%21');\n\n if (state.tag[0] === '!') {\n tagStr = '!' + tagStr;\n } else if (tagStr.slice(0, 18) === 'tag:yaml.org,2002:') {\n tagStr = '!!' + tagStr.slice(18);\n } else {\n tagStr = '!<' + tagStr + '>';\n }\n\n state.dump = tagStr + ' ' + state.dump;\n }\n }\n\n return true;\n}\n\nfunction getDuplicateReferences(object, state) {\n var objects = [],\n duplicatesIndexes = [],\n index,\n length;\n\n inspectNode(object, objects, duplicatesIndexes);\n\n for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {\n state.duplicates.push(objects[duplicatesIndexes[index]]);\n }\n state.usedDuplicates = new Array(length);\n}\n\nfunction inspectNode(object, objects, duplicatesIndexes) {\n var objectKeyList,\n index,\n length;\n\n if (object !== null && typeof object === 'object') {\n index = objects.indexOf(object);\n if (index !== -1) {\n if (duplicatesIndexes.indexOf(index) === -1) {\n duplicatesIndexes.push(index);\n }\n } else {\n objects.push(object);\n\n if (Array.isArray(object)) {\n for (index = 0, length = object.length; index < length; index += 1) {\n inspectNode(object[index], objects, duplicatesIndexes);\n }\n } else {\n objectKeyList = Object.keys(object);\n\n for (index = 0, length = objectKeyList.length; index < length; index += 1) {\n inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);\n }\n }\n }\n }\n}\n\nfunction dump(input, options) {\n options = options || {};\n\n var state = new State(options);\n\n if (!state.noRefs) getDuplicateReferences(input, state);\n\n var value = input;\n\n if (state.replacer) {\n value = state.replacer.call({ '': value }, '', value);\n }\n\n if (writeNode(state, 0, value, true, true)) return state.dump + '\\n';\n\n return '';\n}\n\nmodule.exports.dump = dump;\n","// YAML error class. http://stackoverflow.com/questions/8458984\n//\n'use strict';\n\n\nfunction formatError(exception, compact) {\n var where = '', message = exception.reason || '(unknown reason)';\n\n if (!exception.mark) return message;\n\n if (exception.mark.name) {\n where += 'in \"' + exception.mark.name + '\" ';\n }\n\n where += '(' + (exception.mark.line + 1) + ':' + (exception.mark.column + 1) + ')';\n\n if (!compact && exception.mark.snippet) {\n where += '\\n\\n' + exception.mark.snippet;\n }\n\n return message + ' ' + where;\n}\n\n\nfunction YAMLException(reason, mark) {\n // Super constructor\n Error.call(this);\n\n this.name = 'YAMLException';\n this.reason = reason;\n this.mark = mark;\n this.message = formatError(this, false);\n\n // Include stack trace in error object\n if (Error.captureStackTrace) {\n // Chrome and NodeJS\n Error.captureStackTrace(this, this.constructor);\n } else {\n // FF, IE 10+ and Safari 6+. Fallback for others\n this.stack = (new Error()).stack || '';\n }\n}\n\n\n// Inherit from Error\nYAMLException.prototype = Object.create(Error.prototype);\nYAMLException.prototype.constructor = YAMLException;\n\n\nYAMLException.prototype.toString = function toString(compact) {\n return this.name + ': ' + formatError(this, compact);\n};\n\n\nmodule.exports = YAMLException;\n","'use strict';\n\n/*eslint-disable max-len,no-use-before-define*/\n\nvar common = require('./common');\nvar YAMLException = require('./exception');\nvar makeSnippet = require('./snippet');\nvar DEFAULT_SCHEMA = require('./schema/default');\n\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\n\nvar CONTEXT_FLOW_IN = 1;\nvar CONTEXT_FLOW_OUT = 2;\nvar CONTEXT_BLOCK_IN = 3;\nvar CONTEXT_BLOCK_OUT = 4;\n\n\nvar CHOMPING_CLIP = 1;\nvar CHOMPING_STRIP = 2;\nvar CHOMPING_KEEP = 3;\n\n\nvar PATTERN_NON_PRINTABLE = /[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F-\\x84\\x86-\\x9F\\uFFFE\\uFFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\nvar PATTERN_NON_ASCII_LINE_BREAKS = /[\\x85\\u2028\\u2029]/;\nvar PATTERN_FLOW_INDICATORS = /[,\\[\\]\\{\\}]/;\nvar PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\\-]+!)$/i;\nvar PATTERN_TAG_URI = /^(?:!|[^,\\[\\]\\{\\}])(?:%[0-9a-f]{2}|[0-9a-z\\-#;\\/\\?:@&=\\+\\$,_\\.!~\\*'\\(\\)\\[\\]])*$/i;\n\n\nfunction _class(obj) { return Object.prototype.toString.call(obj); }\n\nfunction is_EOL(c) {\n return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);\n}\n\nfunction is_WHITE_SPACE(c) {\n return (c === 0x09/* Tab */) || (c === 0x20/* Space */);\n}\n\nfunction is_WS_OR_EOL(c) {\n return (c === 0x09/* Tab */) ||\n (c === 0x20/* Space */) ||\n (c === 0x0A/* LF */) ||\n (c === 0x0D/* CR */);\n}\n\nfunction is_FLOW_INDICATOR(c) {\n return c === 0x2C/* , */ ||\n c === 0x5B/* [ */ ||\n c === 0x5D/* ] */ ||\n c === 0x7B/* { */ ||\n c === 0x7D/* } */;\n}\n\nfunction fromHexCode(c) {\n var lc;\n\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n /*eslint-disable no-bitwise*/\n lc = c | 0x20;\n\n if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {\n return lc - 0x61 + 10;\n }\n\n return -1;\n}\n\nfunction escapedHexLen(c) {\n if (c === 0x78/* x */) { return 2; }\n if (c === 0x75/* u */) { return 4; }\n if (c === 0x55/* U */) { return 8; }\n return 0;\n}\n\nfunction fromDecimalCode(c) {\n if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {\n return c - 0x30;\n }\n\n return -1;\n}\n\nfunction simpleEscapeSequence(c) {\n /* eslint-disable indent */\n return (c === 0x30/* 0 */) ? '\\x00' :\n (c === 0x61/* a */) ? '\\x07' :\n (c === 0x62/* b */) ? '\\x08' :\n (c === 0x74/* t */) ? '\\x09' :\n (c === 0x09/* Tab */) ? '\\x09' :\n (c === 0x6E/* n */) ? '\\x0A' :\n (c === 0x76/* v */) ? '\\x0B' :\n (c === 0x66/* f */) ? '\\x0C' :\n (c === 0x72/* r */) ? '\\x0D' :\n (c === 0x65/* e */) ? '\\x1B' :\n (c === 0x20/* Space */) ? ' ' :\n (c === 0x22/* \" */) ? '\\x22' :\n (c === 0x2F/* / */) ? '/' :\n (c === 0x5C/* \\ */) ? '\\x5C' :\n (c === 0x4E/* N */) ? '\\x85' :\n (c === 0x5F/* _ */) ? '\\xA0' :\n (c === 0x4C/* L */) ? '\\u2028' :\n (c === 0x50/* P */) ? '\\u2029' : '';\n}\n\nfunction charFromCodepoint(c) {\n if (c <= 0xFFFF) {\n return String.fromCharCode(c);\n }\n // Encode UTF-16 surrogate pair\n // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF\n return String.fromCharCode(\n ((c - 0x010000) >> 10) + 0xD800,\n ((c - 0x010000) & 0x03FF) + 0xDC00\n );\n}\n\nvar simpleEscapeCheck = new Array(256); // integer, for fast access\nvar simpleEscapeMap = new Array(256);\nfor (var i = 0; i < 256; i++) {\n simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;\n simpleEscapeMap[i] = simpleEscapeSequence(i);\n}\n\n\nfunction State(input, options) {\n this.input = input;\n\n this.filename = options['filename'] || null;\n this.schema = options['schema'] || DEFAULT_SCHEMA;\n this.onWarning = options['onWarning'] || null;\n // (Hidden) Remove? makes the loader to expect YAML 1.1 documents\n // if such documents have no explicit %YAML directive\n this.legacy = options['legacy'] || false;\n\n this.json = options['json'] || false;\n this.listener = options['listener'] || null;\n\n this.implicitTypes = this.schema.compiledImplicit;\n this.typeMap = this.schema.compiledTypeMap;\n\n this.length = input.length;\n this.position = 0;\n this.line = 0;\n this.lineStart = 0;\n this.lineIndent = 0;\n\n // position of first leading tab in the current line,\n // used to make sure there are no tabs in the indentation\n this.firstTabInLine = -1;\n\n this.documents = [];\n\n /*\n this.version;\n this.checkLineBreaks;\n this.tagMap;\n this.anchorMap;\n this.tag;\n this.anchor;\n this.kind;\n this.result;*/\n\n}\n\n\nfunction generateError(state, message) {\n var mark = {\n name: state.filename,\n buffer: state.input.slice(0, -1), // omit trailing \\0\n position: state.position,\n line: state.line,\n column: state.position - state.lineStart\n };\n\n mark.snippet = makeSnippet(mark);\n\n return new YAMLException(message, mark);\n}\n\nfunction throwError(state, message) {\n throw generateError(state, message);\n}\n\nfunction throwWarning(state, message) {\n if (state.onWarning) {\n state.onWarning.call(null, generateError(state, message));\n }\n}\n\n\nvar directiveHandlers = {\n\n YAML: function handleYamlDirective(state, name, args) {\n\n var match, major, minor;\n\n if (state.version !== null) {\n throwError(state, 'duplication of %YAML directive');\n }\n\n if (args.length !== 1) {\n throwError(state, 'YAML directive accepts exactly one argument');\n }\n\n match = /^([0-9]+)\\.([0-9]+)$/.exec(args[0]);\n\n if (match === null) {\n throwError(state, 'ill-formed argument of the YAML directive');\n }\n\n major = parseInt(match[1], 10);\n minor = parseInt(match[2], 10);\n\n if (major !== 1) {\n throwError(state, 'unacceptable YAML version of the document');\n }\n\n state.version = args[0];\n state.checkLineBreaks = (minor < 2);\n\n if (minor !== 1 && minor !== 2) {\n throwWarning(state, 'unsupported YAML version of the document');\n }\n },\n\n TAG: function handleTagDirective(state, name, args) {\n\n var handle, prefix;\n\n if (args.length !== 2) {\n throwError(state, 'TAG directive accepts exactly two arguments');\n }\n\n handle = args[0];\n prefix = args[1];\n\n if (!PATTERN_TAG_HANDLE.test(handle)) {\n throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');\n }\n\n if (_hasOwnProperty.call(state.tagMap, handle)) {\n throwError(state, 'there is a previously declared suffix for \"' + handle + '\" tag handle');\n }\n\n if (!PATTERN_TAG_URI.test(prefix)) {\n throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');\n }\n\n try {\n prefix = decodeURIComponent(prefix);\n } catch (err) {\n throwError(state, 'tag prefix is malformed: ' + prefix);\n }\n\n state.tagMap[handle] = prefix;\n }\n};\n\n\nfunction captureSegment(state, start, end, checkJson) {\n var _position, _length, _character, _result;\n\n if (start < end) {\n _result = state.input.slice(start, end);\n\n if (checkJson) {\n for (_position = 0, _length = _result.length; _position < _length; _position += 1) {\n _character = _result.charCodeAt(_position);\n if (!(_character === 0x09 ||\n (0x20 <= _character && _character <= 0x10FFFF))) {\n throwError(state, 'expected valid JSON character');\n }\n }\n } else if (PATTERN_NON_PRINTABLE.test(_result)) {\n throwError(state, 'the stream contains non-printable characters');\n }\n\n state.result += _result;\n }\n}\n\nfunction mergeMappings(state, destination, source, overridableKeys) {\n var sourceKeys, key, index, quantity;\n\n if (!common.isObject(source)) {\n throwError(state, 'cannot merge mappings; the provided source object is unacceptable');\n }\n\n sourceKeys = Object.keys(source);\n\n for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {\n key = sourceKeys[index];\n\n if (!_hasOwnProperty.call(destination, key)) {\n destination[key] = source[key];\n overridableKeys[key] = true;\n }\n }\n}\n\nfunction storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode,\n startLine, startLineStart, startPos) {\n\n var index, quantity;\n\n // The output is a plain object here, so keys can only be strings.\n // We need to convert keyNode to a string, but doing so can hang the process\n // (deeply nested arrays that explode exponentially using aliases).\n if (Array.isArray(keyNode)) {\n keyNode = Array.prototype.slice.call(keyNode);\n\n for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {\n if (Array.isArray(keyNode[index])) {\n throwError(state, 'nested arrays are not supported inside keys');\n }\n\n if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {\n keyNode[index] = '[object Object]';\n }\n }\n }\n\n // Avoid code execution in load() via toString property\n // (still use its own toString for arrays, timestamps,\n // and whatever user schema extensions happen to have @@toStringTag)\n if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {\n keyNode = '[object Object]';\n }\n\n\n keyNode = String(keyNode);\n\n if (_result === null) {\n _result = {};\n }\n\n if (keyTag === 'tag:yaml.org,2002:merge') {\n if (Array.isArray(valueNode)) {\n for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {\n mergeMappings(state, _result, valueNode[index], overridableKeys);\n }\n } else {\n mergeMappings(state, _result, valueNode, overridableKeys);\n }\n } else {\n if (!state.json &&\n !_hasOwnProperty.call(overridableKeys, keyNode) &&\n _hasOwnProperty.call(_result, keyNode)) {\n state.line = startLine || state.line;\n state.lineStart = startLineStart || state.lineStart;\n state.position = startPos || state.position;\n throwError(state, 'duplicated mapping key');\n }\n\n // used for this specific key only because Object.defineProperty is slow\n if (keyNode === '__proto__') {\n Object.defineProperty(_result, keyNode, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: valueNode\n });\n } else {\n _result[keyNode] = valueNode;\n }\n delete overridableKeys[keyNode];\n }\n\n return _result;\n}\n\nfunction readLineBreak(state) {\n var ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x0A/* LF */) {\n state.position++;\n } else if (ch === 0x0D/* CR */) {\n state.position++;\n if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {\n state.position++;\n }\n } else {\n throwError(state, 'a line break is expected');\n }\n\n state.line += 1;\n state.lineStart = state.position;\n state.firstTabInLine = -1;\n}\n\nfunction skipSeparationSpace(state, allowComments, checkIndent) {\n var lineBreaks = 0,\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n if (ch === 0x09/* Tab */ && state.firstTabInLine === -1) {\n state.firstTabInLine = state.position;\n }\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (allowComments && ch === 0x23/* # */) {\n do {\n ch = state.input.charCodeAt(++state.position);\n } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);\n }\n\n if (is_EOL(ch)) {\n readLineBreak(state);\n\n ch = state.input.charCodeAt(state.position);\n lineBreaks++;\n state.lineIndent = 0;\n\n while (ch === 0x20/* Space */) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n } else {\n break;\n }\n }\n\n if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {\n throwWarning(state, 'deficient indentation');\n }\n\n return lineBreaks;\n}\n\nfunction testDocumentSeparator(state) {\n var _position = state.position,\n ch;\n\n ch = state.input.charCodeAt(_position);\n\n // Condition state.position === state.lineStart is tested\n // in parent on each call, for efficiency. No needs to test here again.\n if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&\n ch === state.input.charCodeAt(_position + 1) &&\n ch === state.input.charCodeAt(_position + 2)) {\n\n _position += 3;\n\n ch = state.input.charCodeAt(_position);\n\n if (ch === 0 || is_WS_OR_EOL(ch)) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction writeFoldedLines(state, count) {\n if (count === 1) {\n state.result += ' ';\n } else if (count > 1) {\n state.result += common.repeat('\\n', count - 1);\n }\n}\n\n\nfunction readPlainScalar(state, nodeIndent, withinFlowCollection) {\n var preceding,\n following,\n captureStart,\n captureEnd,\n hasPendingContent,\n _line,\n _lineStart,\n _lineIndent,\n _kind = state.kind,\n _result = state.result,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (is_WS_OR_EOL(ch) ||\n is_FLOW_INDICATOR(ch) ||\n ch === 0x23/* # */ ||\n ch === 0x26/* & */ ||\n ch === 0x2A/* * */ ||\n ch === 0x21/* ! */ ||\n ch === 0x7C/* | */ ||\n ch === 0x3E/* > */ ||\n ch === 0x27/* ' */ ||\n ch === 0x22/* \" */ ||\n ch === 0x25/* % */ ||\n ch === 0x40/* @ */ ||\n ch === 0x60/* ` */) {\n return false;\n }\n\n if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n return false;\n }\n }\n\n state.kind = 'scalar';\n state.result = '';\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n\n while (ch !== 0) {\n if (ch === 0x3A/* : */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following) ||\n withinFlowCollection && is_FLOW_INDICATOR(following)) {\n break;\n }\n\n } else if (ch === 0x23/* # */) {\n preceding = state.input.charCodeAt(state.position - 1);\n\n if (is_WS_OR_EOL(preceding)) {\n break;\n }\n\n } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||\n withinFlowCollection && is_FLOW_INDICATOR(ch)) {\n break;\n\n } else if (is_EOL(ch)) {\n _line = state.line;\n _lineStart = state.lineStart;\n _lineIndent = state.lineIndent;\n skipSeparationSpace(state, false, -1);\n\n if (state.lineIndent >= nodeIndent) {\n hasPendingContent = true;\n ch = state.input.charCodeAt(state.position);\n continue;\n } else {\n state.position = captureEnd;\n state.line = _line;\n state.lineStart = _lineStart;\n state.lineIndent = _lineIndent;\n break;\n }\n }\n\n if (hasPendingContent) {\n captureSegment(state, captureStart, captureEnd, false);\n writeFoldedLines(state, state.line - _line);\n captureStart = captureEnd = state.position;\n hasPendingContent = false;\n }\n\n if (!is_WHITE_SPACE(ch)) {\n captureEnd = state.position + 1;\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, captureEnd, false);\n\n if (state.result) {\n return true;\n }\n\n state.kind = _kind;\n state.result = _result;\n return false;\n}\n\nfunction readSingleQuotedScalar(state, nodeIndent) {\n var ch,\n captureStart, captureEnd;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x27/* ' */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x27/* ' */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x27/* ' */) {\n captureStart = state.position;\n state.position++;\n captureEnd = state.position;\n } else {\n return true;\n }\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a single quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a single quoted scalar');\n}\n\nfunction readDoubleQuotedScalar(state, nodeIndent) {\n var captureStart,\n captureEnd,\n hexLength,\n hexResult,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x22/* \" */) {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n state.position++;\n captureStart = captureEnd = state.position;\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n if (ch === 0x22/* \" */) {\n captureSegment(state, captureStart, state.position, true);\n state.position++;\n return true;\n\n } else if (ch === 0x5C/* \\ */) {\n captureSegment(state, captureStart, state.position, true);\n ch = state.input.charCodeAt(++state.position);\n\n if (is_EOL(ch)) {\n skipSeparationSpace(state, false, nodeIndent);\n\n // TODO: rework to inline fn with no type cast?\n } else if (ch < 256 && simpleEscapeCheck[ch]) {\n state.result += simpleEscapeMap[ch];\n state.position++;\n\n } else if ((tmp = escapedHexLen(ch)) > 0) {\n hexLength = tmp;\n hexResult = 0;\n\n for (; hexLength > 0; hexLength--) {\n ch = state.input.charCodeAt(++state.position);\n\n if ((tmp = fromHexCode(ch)) >= 0) {\n hexResult = (hexResult << 4) + tmp;\n\n } else {\n throwError(state, 'expected hexadecimal character');\n }\n }\n\n state.result += charFromCodepoint(hexResult);\n\n state.position++;\n\n } else {\n throwError(state, 'unknown escape sequence');\n }\n\n captureStart = captureEnd = state.position;\n\n } else if (is_EOL(ch)) {\n captureSegment(state, captureStart, captureEnd, true);\n writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));\n captureStart = captureEnd = state.position;\n\n } else if (state.position === state.lineStart && testDocumentSeparator(state)) {\n throwError(state, 'unexpected end of the document within a double quoted scalar');\n\n } else {\n state.position++;\n captureEnd = state.position;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a double quoted scalar');\n}\n\nfunction readFlowCollection(state, nodeIndent) {\n var readNext = true,\n _line,\n _lineStart,\n _pos,\n _tag = state.tag,\n _result,\n _anchor = state.anchor,\n following,\n terminator,\n isPair,\n isExplicitPair,\n isMapping,\n overridableKeys = Object.create(null),\n keyNode,\n keyTag,\n valueNode,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x5B/* [ */) {\n terminator = 0x5D;/* ] */\n isMapping = false;\n _result = [];\n } else if (ch === 0x7B/* { */) {\n terminator = 0x7D;/* } */\n isMapping = true;\n _result = {};\n } else {\n return false;\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n while (ch !== 0) {\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === terminator) {\n state.position++;\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = isMapping ? 'mapping' : 'sequence';\n state.result = _result;\n return true;\n } else if (!readNext) {\n throwError(state, 'missed comma between flow collection entries');\n } else if (ch === 0x2C/* , */) {\n // \"flow collection entries can never be completely empty\", as per YAML 1.2, section 7.4\n throwError(state, \"expected the node content, but found ','\");\n }\n\n keyTag = keyNode = valueNode = null;\n isPair = isExplicitPair = false;\n\n if (ch === 0x3F/* ? */) {\n following = state.input.charCodeAt(state.position + 1);\n\n if (is_WS_OR_EOL(following)) {\n isPair = isExplicitPair = true;\n state.position++;\n skipSeparationSpace(state, true, nodeIndent);\n }\n }\n\n _line = state.line; // Save the current line.\n _lineStart = state.lineStart;\n _pos = state.position;\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n keyTag = state.tag;\n keyNode = state.result;\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {\n isPair = true;\n ch = state.input.charCodeAt(++state.position);\n skipSeparationSpace(state, true, nodeIndent);\n composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);\n valueNode = state.result;\n }\n\n if (isMapping) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos);\n } else if (isPair) {\n _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode, _line, _lineStart, _pos));\n } else {\n _result.push(keyNode);\n }\n\n skipSeparationSpace(state, true, nodeIndent);\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x2C/* , */) {\n readNext = true;\n ch = state.input.charCodeAt(++state.position);\n } else {\n readNext = false;\n }\n }\n\n throwError(state, 'unexpected end of the stream within a flow collection');\n}\n\nfunction readBlockScalar(state, nodeIndent) {\n var captureStart,\n folding,\n chomping = CHOMPING_CLIP,\n didReadContent = false,\n detectedIndent = false,\n textIndent = nodeIndent,\n emptyLines = 0,\n atMoreIndented = false,\n tmp,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch === 0x7C/* | */) {\n folding = false;\n } else if (ch === 0x3E/* > */) {\n folding = true;\n } else {\n return false;\n }\n\n state.kind = 'scalar';\n state.result = '';\n\n while (ch !== 0) {\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {\n if (CHOMPING_CLIP === chomping) {\n chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;\n } else {\n throwError(state, 'repeat of a chomping mode identifier');\n }\n\n } else if ((tmp = fromDecimalCode(ch)) >= 0) {\n if (tmp === 0) {\n throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');\n } else if (!detectedIndent) {\n textIndent = nodeIndent + tmp - 1;\n detectedIndent = true;\n } else {\n throwError(state, 'repeat of an indentation width identifier');\n }\n\n } else {\n break;\n }\n }\n\n if (is_WHITE_SPACE(ch)) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (is_WHITE_SPACE(ch));\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (!is_EOL(ch) && (ch !== 0));\n }\n }\n\n while (ch !== 0) {\n readLineBreak(state);\n state.lineIndent = 0;\n\n ch = state.input.charCodeAt(state.position);\n\n while ((!detectedIndent || state.lineIndent < textIndent) &&\n (ch === 0x20/* Space */)) {\n state.lineIndent++;\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (!detectedIndent && state.lineIndent > textIndent) {\n textIndent = state.lineIndent;\n }\n\n if (is_EOL(ch)) {\n emptyLines++;\n continue;\n }\n\n // End of the scalar.\n if (state.lineIndent < textIndent) {\n\n // Perform the chomping.\n if (chomping === CHOMPING_KEEP) {\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n } else if (chomping === CHOMPING_CLIP) {\n if (didReadContent) { // i.e. only if the scalar is not empty.\n state.result += '\\n';\n }\n }\n\n // Break this `while` cycle and go to the funciton's epilogue.\n break;\n }\n\n // Folded style: use fancy rules to handle line breaks.\n if (folding) {\n\n // Lines starting with white space characters (more-indented lines) are not folded.\n if (is_WHITE_SPACE(ch)) {\n atMoreIndented = true;\n // except for the first content line (cf. Example 8.1)\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n\n // End of more-indented block.\n } else if (atMoreIndented) {\n atMoreIndented = false;\n state.result += common.repeat('\\n', emptyLines + 1);\n\n // Just one line break - perceive as the same line.\n } else if (emptyLines === 0) {\n if (didReadContent) { // i.e. only if we have already read some scalar content.\n state.result += ' ';\n }\n\n // Several line breaks - perceive as different lines.\n } else {\n state.result += common.repeat('\\n', emptyLines);\n }\n\n // Literal style: just add exact number of line breaks between content lines.\n } else {\n // Keep all line breaks except the header line break.\n state.result += common.repeat('\\n', didReadContent ? 1 + emptyLines : emptyLines);\n }\n\n didReadContent = true;\n detectedIndent = true;\n emptyLines = 0;\n captureStart = state.position;\n\n while (!is_EOL(ch) && (ch !== 0)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n captureSegment(state, captureStart, state.position, false);\n }\n\n return true;\n}\n\nfunction readBlockSequence(state, nodeIndent) {\n var _line,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = [],\n following,\n detected = false,\n ch;\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n if (state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine;\n throwError(state, 'tab characters must not be used in indentation');\n }\n\n if (ch !== 0x2D/* - */) {\n break;\n }\n\n following = state.input.charCodeAt(state.position + 1);\n\n if (!is_WS_OR_EOL(following)) {\n break;\n }\n\n detected = true;\n state.position++;\n\n if (skipSeparationSpace(state, true, -1)) {\n if (state.lineIndent <= nodeIndent) {\n _result.push(null);\n ch = state.input.charCodeAt(state.position);\n continue;\n }\n }\n\n _line = state.line;\n composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);\n _result.push(state.result);\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a sequence entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'sequence';\n state.result = _result;\n return true;\n }\n return false;\n}\n\nfunction readBlockMapping(state, nodeIndent, flowIndent) {\n var following,\n allowCompact,\n _line,\n _keyLine,\n _keyLineStart,\n _keyPos,\n _tag = state.tag,\n _anchor = state.anchor,\n _result = {},\n overridableKeys = Object.create(null),\n keyTag = null,\n keyNode = null,\n valueNode = null,\n atExplicitKey = false,\n detected = false,\n ch;\n\n // there is a leading tab before this token, so it can't be a block sequence/mapping;\n // it can still be flow sequence/mapping or a scalar\n if (state.firstTabInLine !== -1) return false;\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = _result;\n }\n\n ch = state.input.charCodeAt(state.position);\n\n while (ch !== 0) {\n if (!atExplicitKey && state.firstTabInLine !== -1) {\n state.position = state.firstTabInLine;\n throwError(state, 'tab characters must not be used in indentation');\n }\n\n following = state.input.charCodeAt(state.position + 1);\n _line = state.line; // Save the current line.\n\n //\n // Explicit notation case. There are two separate blocks:\n // first for the key (denoted by \"?\") and second for the value (denoted by \":\")\n //\n if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {\n\n if (ch === 0x3F/* ? */) {\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = true;\n allowCompact = true;\n\n } else if (atExplicitKey) {\n // i.e. 0x3A/* : */ === character after the explicit key.\n atExplicitKey = false;\n allowCompact = true;\n\n } else {\n throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');\n }\n\n state.position += 1;\n ch = following;\n\n //\n // Implicit notation case. Flow-style node as the key first, then \":\", and the value.\n //\n } else {\n _keyLine = state.line;\n _keyLineStart = state.lineStart;\n _keyPos = state.position;\n\n if (!composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {\n // Neither implicit nor explicit notation.\n // Reading is done. Go to the epilogue.\n break;\n }\n\n if (state.line === _line) {\n ch = state.input.charCodeAt(state.position);\n\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x3A/* : */) {\n ch = state.input.charCodeAt(++state.position);\n\n if (!is_WS_OR_EOL(ch)) {\n throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');\n }\n\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n detected = true;\n atExplicitKey = false;\n allowCompact = false;\n keyTag = state.tag;\n keyNode = state.result;\n\n } else if (detected) {\n throwError(state, 'can not read an implicit mapping pair; a colon is missed');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n\n } else if (detected) {\n throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');\n\n } else {\n state.tag = _tag;\n state.anchor = _anchor;\n return true; // Keep the result of `composeNode`.\n }\n }\n\n //\n // Common reading code for both explicit and implicit notations.\n //\n if (state.line === _line || state.lineIndent > nodeIndent) {\n if (atExplicitKey) {\n _keyLine = state.line;\n _keyLineStart = state.lineStart;\n _keyPos = state.position;\n }\n\n if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {\n if (atExplicitKey) {\n keyNode = state.result;\n } else {\n valueNode = state.result;\n }\n }\n\n if (!atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _keyLine, _keyLineStart, _keyPos);\n keyTag = keyNode = valueNode = null;\n }\n\n skipSeparationSpace(state, true, -1);\n ch = state.input.charCodeAt(state.position);\n }\n\n if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {\n throwError(state, 'bad indentation of a mapping entry');\n } else if (state.lineIndent < nodeIndent) {\n break;\n }\n }\n\n //\n // Epilogue.\n //\n\n // Special case: last mapping's node contains only the key in explicit notation.\n if (atExplicitKey) {\n storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null, _keyLine, _keyLineStart, _keyPos);\n }\n\n // Expose the resulting mapping.\n if (detected) {\n state.tag = _tag;\n state.anchor = _anchor;\n state.kind = 'mapping';\n state.result = _result;\n }\n\n return detected;\n}\n\nfunction readTagProperty(state) {\n var _position,\n isVerbatim = false,\n isNamed = false,\n tagHandle,\n tagName,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x21/* ! */) return false;\n\n if (state.tag !== null) {\n throwError(state, 'duplication of a tag property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n\n if (ch === 0x3C/* < */) {\n isVerbatim = true;\n ch = state.input.charCodeAt(++state.position);\n\n } else if (ch === 0x21/* ! */) {\n isNamed = true;\n tagHandle = '!!';\n ch = state.input.charCodeAt(++state.position);\n\n } else {\n tagHandle = '!';\n }\n\n _position = state.position;\n\n if (isVerbatim) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && ch !== 0x3E/* > */);\n\n if (state.position < state.length) {\n tagName = state.input.slice(_position, state.position);\n ch = state.input.charCodeAt(++state.position);\n } else {\n throwError(state, 'unexpected end of the stream within a verbatim tag');\n }\n } else {\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n\n if (ch === 0x21/* ! */) {\n if (!isNamed) {\n tagHandle = state.input.slice(_position - 1, state.position + 1);\n\n if (!PATTERN_TAG_HANDLE.test(tagHandle)) {\n throwError(state, 'named tag handle cannot contain such characters');\n }\n\n isNamed = true;\n _position = state.position + 1;\n } else {\n throwError(state, 'tag suffix cannot contain exclamation marks');\n }\n }\n\n ch = state.input.charCodeAt(++state.position);\n }\n\n tagName = state.input.slice(_position, state.position);\n\n if (PATTERN_FLOW_INDICATORS.test(tagName)) {\n throwError(state, 'tag suffix cannot contain flow indicator characters');\n }\n }\n\n if (tagName && !PATTERN_TAG_URI.test(tagName)) {\n throwError(state, 'tag name cannot contain such characters: ' + tagName);\n }\n\n try {\n tagName = decodeURIComponent(tagName);\n } catch (err) {\n throwError(state, 'tag name is malformed: ' + tagName);\n }\n\n if (isVerbatim) {\n state.tag = tagName;\n\n } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {\n state.tag = state.tagMap[tagHandle] + tagName;\n\n } else if (tagHandle === '!') {\n state.tag = '!' + tagName;\n\n } else if (tagHandle === '!!') {\n state.tag = 'tag:yaml.org,2002:' + tagName;\n\n } else {\n throwError(state, 'undeclared tag handle \"' + tagHandle + '\"');\n }\n\n return true;\n}\n\nfunction readAnchorProperty(state) {\n var _position,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x26/* & */) return false;\n\n if (state.anchor !== null) {\n throwError(state, 'duplication of an anchor property');\n }\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an anchor node must contain at least one character');\n }\n\n state.anchor = state.input.slice(_position, state.position);\n return true;\n}\n\nfunction readAlias(state) {\n var _position, alias,\n ch;\n\n ch = state.input.charCodeAt(state.position);\n\n if (ch !== 0x2A/* * */) return false;\n\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (state.position === _position) {\n throwError(state, 'name of an alias node must contain at least one character');\n }\n\n alias = state.input.slice(_position, state.position);\n\n if (!_hasOwnProperty.call(state.anchorMap, alias)) {\n throwError(state, 'unidentified alias \"' + alias + '\"');\n }\n\n state.result = state.anchorMap[alias];\n skipSeparationSpace(state, true, -1);\n return true;\n}\n\nfunction composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {\n var allowBlockStyles,\n allowBlockScalars,\n allowBlockCollections,\n indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n }\n }\n\n if (indentStatus === 1) {\n while (readTagProperty(state) || readAnchorProperty(state)) {\n if (skipSeparationSpace(state, true, -1)) {\n atNewLine = true;\n allowBlockCollections = allowBlockStyles;\n\n if (state.lineIndent > parentIndent) {\n indentStatus = 1;\n } else if (state.lineIndent === parentIndent) {\n indentStatus = 0;\n } else if (state.lineIndent < parentIndent) {\n indentStatus = -1;\n }\n } else {\n allowBlockCollections = false;\n }\n }\n }\n\n if (allowBlockCollections) {\n allowBlockCollections = atNewLine || allowCompact;\n }\n\n if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {\n if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {\n flowIndent = parentIndent;\n } else {\n flowIndent = parentIndent + 1;\n }\n\n blockIndent = state.position - state.lineStart;\n\n if (indentStatus === 1) {\n if (allowBlockCollections &&\n (readBlockSequence(state, blockIndent) ||\n readBlockMapping(state, blockIndent, flowIndent)) ||\n readFlowCollection(state, flowIndent)) {\n hasContent = true;\n } else {\n if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||\n readSingleQuotedScalar(state, flowIndent) ||\n readDoubleQuotedScalar(state, flowIndent)) {\n hasContent = true;\n\n } else if (readAlias(state)) {\n hasContent = true;\n\n if (state.tag !== null || state.anchor !== null) {\n throwError(state, 'alias node should not have any properties');\n }\n\n } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {\n hasContent = true;\n\n if (state.tag === null) {\n state.tag = '?';\n }\n }\n\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n } else if (indentStatus === 0) {\n // Special case: block sequences are allowed to have same indentation level as the parent.\n // http://www.yaml.org/spec/1.2/spec.html#id2799784\n hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);\n }\n }\n\n if (state.tag === null) {\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n\n } else if (state.tag === '?') {\n // Implicit resolving is not allowed for non-scalar types, and '?'\n // non-specific tag is only automatically assigned to plain scalars.\n //\n // We only need to check kind conformity in case user explicitly assigns '?'\n // tag, for example like this: \"! [0]\"\n //\n if (state.result !== null && state.kind !== 'scalar') {\n throwError(state, 'unacceptable node kind for ! tag; it should be \"scalar\", not \"' + state.kind + '\"');\n }\n\n for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {\n type = state.implicitTypes[typeIndex];\n\n if (type.resolve(state.result)) { // `state.result` updated in resolver if matched\n state.result = type.construct(state.result);\n state.tag = type.tag;\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n break;\n }\n }\n } else if (state.tag !== '!') {\n if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {\n type = state.typeMap[state.kind || 'fallback'][state.tag];\n } else {\n // looking for multi type\n type = null;\n typeList = state.typeMap.multi[state.kind || 'fallback'];\n\n for (typeIndex = 0, typeQuantity = typeList.length; typeIndex < typeQuantity; typeIndex += 1) {\n if (state.tag.slice(0, typeList[typeIndex].tag.length) === typeList[typeIndex].tag) {\n type = typeList[typeIndex];\n break;\n }\n }\n }\n\n if (!type) {\n throwError(state, 'unknown tag !<' + state.tag + '>');\n }\n\n if (state.result !== null && type.kind !== state.kind) {\n throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be \"' + type.kind + '\", not \"' + state.kind + '\"');\n }\n\n if (!type.resolve(state.result, state.tag)) { // `state.result` updated in resolver if matched\n throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');\n } else {\n state.result = type.construct(state.result, state.tag);\n if (state.anchor !== null) {\n state.anchorMap[state.anchor] = state.result;\n }\n }\n }\n\n if (state.listener !== null) {\n state.listener('close', state);\n }\n return state.tag !== null || state.anchor !== null || hasContent;\n}\n\nfunction readDocument(state) {\n var documentStart = state.position,\n _position,\n directiveName,\n directiveArgs,\n hasDirectives = false,\n ch;\n\n state.version = null;\n state.checkLineBreaks = state.legacy;\n state.tagMap = Object.create(null);\n state.anchorMap = Object.create(null);\n\n while ((ch = state.input.charCodeAt(state.position)) !== 0) {\n skipSeparationSpace(state, true, -1);\n\n ch = state.input.charCodeAt(state.position);\n\n if (state.lineIndent > 0 || ch !== 0x25/* % */) {\n break;\n }\n\n hasDirectives = true;\n ch = state.input.charCodeAt(++state.position);\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveName = state.input.slice(_position, state.position);\n directiveArgs = [];\n\n if (directiveName.length < 1) {\n throwError(state, 'directive name must not be less than one character in length');\n }\n\n while (ch !== 0) {\n while (is_WHITE_SPACE(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n if (ch === 0x23/* # */) {\n do { ch = state.input.charCodeAt(++state.position); }\n while (ch !== 0 && !is_EOL(ch));\n break;\n }\n\n if (is_EOL(ch)) break;\n\n _position = state.position;\n\n while (ch !== 0 && !is_WS_OR_EOL(ch)) {\n ch = state.input.charCodeAt(++state.position);\n }\n\n directiveArgs.push(state.input.slice(_position, state.position));\n }\n\n if (ch !== 0) readLineBreak(state);\n\n if (_hasOwnProperty.call(directiveHandlers, directiveName)) {\n directiveHandlers[directiveName](state, directiveName, directiveArgs);\n } else {\n throwWarning(state, 'unknown document directive \"' + directiveName + '\"');\n }\n }\n\n skipSeparationSpace(state, true, -1);\n\n if (state.lineIndent === 0 &&\n state.input.charCodeAt(state.position) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&\n state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n\n } else if (hasDirectives) {\n throwError(state, 'directives end mark is expected');\n }\n\n composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);\n skipSeparationSpace(state, true, -1);\n\n if (state.checkLineBreaks &&\n PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {\n throwWarning(state, 'non-ASCII line breaks are interpreted as content');\n }\n\n state.documents.push(state.result);\n\n if (state.position === state.lineStart && testDocumentSeparator(state)) {\n\n if (state.input.charCodeAt(state.position) === 0x2E/* . */) {\n state.position += 3;\n skipSeparationSpace(state, true, -1);\n }\n return;\n }\n\n if (state.position < (state.length - 1)) {\n throwError(state, 'end of the stream or a document separator is expected');\n } else {\n return;\n }\n}\n\n\nfunction loadDocuments(input, options) {\n input = String(input);\n options = options || {};\n\n if (input.length !== 0) {\n\n // Add tailing `\\n` if not exists\n if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&\n input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {\n input += '\\n';\n }\n\n // Strip BOM\n if (input.charCodeAt(0) === 0xFEFF) {\n input = input.slice(1);\n }\n }\n\n var state = new State(input, options);\n\n var nullpos = input.indexOf('\\0');\n\n if (nullpos !== -1) {\n state.position = nullpos;\n throwError(state, 'null byte is not allowed in input');\n }\n\n // Use 0 as string terminator. That significantly simplifies bounds check.\n state.input += '\\0';\n\n while (state.input.charCodeAt(state.position) === 0x20/* Space */) {\n state.lineIndent += 1;\n state.position += 1;\n }\n\n while (state.position < (state.length - 1)) {\n readDocument(state);\n }\n\n return state.documents;\n}\n\n\nfunction loadAll(input, iterator, options) {\n if (iterator !== null && typeof iterator === 'object' && typeof options === 'undefined') {\n options = iterator;\n iterator = null;\n }\n\n var documents = loadDocuments(input, options);\n\n if (typeof iterator !== 'function') {\n return documents;\n }\n\n for (var index = 0, length = documents.length; index < length; index += 1) {\n iterator(documents[index]);\n }\n}\n\n\nfunction load(input, options) {\n var documents = loadDocuments(input, options);\n\n if (documents.length === 0) {\n /*eslint-disable no-undefined*/\n return undefined;\n } else if (documents.length === 1) {\n return documents[0];\n }\n throw new YAMLException('expected a single document in the stream, but found more');\n}\n\n\nmodule.exports.loadAll = loadAll;\nmodule.exports.load = load;\n","'use strict';\n\n/*eslint-disable max-len*/\n\nvar YAMLException = require('./exception');\nvar Type = require('./type');\n\n\nfunction compileList(schema, name) {\n var result = [];\n\n schema[name].forEach(function (currentType) {\n var newIndex = result.length;\n\n result.forEach(function (previousType, previousIndex) {\n if (previousType.tag === currentType.tag &&\n previousType.kind === currentType.kind &&\n previousType.multi === currentType.multi) {\n\n newIndex = previousIndex;\n }\n });\n\n result[newIndex] = currentType;\n });\n\n return result;\n}\n\n\nfunction compileMap(/* lists... */) {\n var result = {\n scalar: {},\n sequence: {},\n mapping: {},\n fallback: {},\n multi: {\n scalar: [],\n sequence: [],\n mapping: [],\n fallback: []\n }\n }, index, length;\n\n function collectType(type) {\n if (type.multi) {\n result.multi[type.kind].push(type);\n result.multi['fallback'].push(type);\n } else {\n result[type.kind][type.tag] = result['fallback'][type.tag] = type;\n }\n }\n\n for (index = 0, length = arguments.length; index < length; index += 1) {\n arguments[index].forEach(collectType);\n }\n return result;\n}\n\n\nfunction Schema(definition) {\n return this.extend(definition);\n}\n\n\nSchema.prototype.extend = function extend(definition) {\n var implicit = [];\n var explicit = [];\n\n if (definition instanceof Type) {\n // Schema.extend(type)\n explicit.push(definition);\n\n } else if (Array.isArray(definition)) {\n // Schema.extend([ type1, type2, ... ])\n explicit = explicit.concat(definition);\n\n } else if (definition && (Array.isArray(definition.implicit) || Array.isArray(definition.explicit))) {\n // Schema.extend({ explicit: [ type1, type2, ... ], implicit: [ type1, type2, ... ] })\n if (definition.implicit) implicit = implicit.concat(definition.implicit);\n if (definition.explicit) explicit = explicit.concat(definition.explicit);\n\n } else {\n throw new YAMLException('Schema.extend argument should be a Type, [ Type ], ' +\n 'or a schema definition ({ implicit: [...], explicit: [...] })');\n }\n\n implicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n\n if (type.loadKind && type.loadKind !== 'scalar') {\n throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');\n }\n\n if (type.multi) {\n throw new YAMLException('There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.');\n }\n });\n\n explicit.forEach(function (type) {\n if (!(type instanceof Type)) {\n throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');\n }\n });\n\n var result = Object.create(Schema.prototype);\n\n result.implicit = (this.implicit || []).concat(implicit);\n result.explicit = (this.explicit || []).concat(explicit);\n\n result.compiledImplicit = compileList(result, 'implicit');\n result.compiledExplicit = compileList(result, 'explicit');\n result.compiledTypeMap = compileMap(result.compiledImplicit, result.compiledExplicit);\n\n return result;\n};\n\n\nmodule.exports = Schema;\n","// Standard YAML's Core schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2804923\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, Core schema has no distinctions from JSON schema is JS-YAML.\n\n\n'use strict';\n\n\nmodule.exports = require('./json');\n","// JS-YAML's default schema for `safeLoad` function.\n// It is not described in the YAML specification.\n//\n// This schema is based on standard YAML's Core schema and includes most of\n// extra types described at YAML tag repository. (http://yaml.org/type/)\n\n\n'use strict';\n\n\nmodule.exports = require('./core').extend({\n implicit: [\n require('../type/timestamp'),\n require('../type/merge')\n ],\n explicit: [\n require('../type/binary'),\n require('../type/omap'),\n require('../type/pairs'),\n require('../type/set')\n ]\n});\n","// Standard YAML's Failsafe schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2802346\n\n\n'use strict';\n\n\nvar Schema = require('../schema');\n\n\nmodule.exports = new Schema({\n explicit: [\n require('../type/str'),\n require('../type/seq'),\n require('../type/map')\n ]\n});\n","// Standard YAML's JSON schema.\n// http://www.yaml.org/spec/1.2/spec.html#id2803231\n//\n// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.\n// So, this schema is not such strict as defined in the YAML specification.\n// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.\n\n\n'use strict';\n\n\nmodule.exports = require('./failsafe').extend({\n implicit: [\n require('../type/null'),\n require('../type/bool'),\n require('../type/int'),\n require('../type/float')\n ]\n});\n","'use strict';\n\n\nvar common = require('./common');\n\n\n// get snippet for a single line, respecting maxLength\nfunction getLine(buffer, lineStart, lineEnd, position, maxLineLength) {\n var head = '';\n var tail = '';\n var maxHalfLength = Math.floor(maxLineLength / 2) - 1;\n\n if (position - lineStart > maxHalfLength) {\n head = ' ... ';\n lineStart = position - maxHalfLength + head.length;\n }\n\n if (lineEnd - position > maxHalfLength) {\n tail = ' ...';\n lineEnd = position + maxHalfLength - tail.length;\n }\n\n return {\n str: head + buffer.slice(lineStart, lineEnd).replace(/\\t/g, '→') + tail,\n pos: position - lineStart + head.length // relative position\n };\n}\n\n\nfunction padStart(string, max) {\n return common.repeat(' ', max - string.length) + string;\n}\n\n\nfunction makeSnippet(mark, options) {\n options = Object.create(options || null);\n\n if (!mark.buffer) return null;\n\n if (!options.maxLength) options.maxLength = 79;\n if (typeof options.indent !== 'number') options.indent = 1;\n if (typeof options.linesBefore !== 'number') options.linesBefore = 3;\n if (typeof options.linesAfter !== 'number') options.linesAfter = 2;\n\n var re = /\\r?\\n|\\r|\\0/g;\n var lineStarts = [ 0 ];\n var lineEnds = [];\n var match;\n var foundLineNo = -1;\n\n while ((match = re.exec(mark.buffer))) {\n lineEnds.push(match.index);\n lineStarts.push(match.index + match[0].length);\n\n if (mark.position <= match.index && foundLineNo < 0) {\n foundLineNo = lineStarts.length - 2;\n }\n }\n\n if (foundLineNo < 0) foundLineNo = lineStarts.length - 1;\n\n var result = '', i, line;\n var lineNoLength = Math.min(mark.line + options.linesAfter, lineEnds.length).toString().length;\n var maxLineLength = options.maxLength - (options.indent + lineNoLength + 3);\n\n for (i = 1; i <= options.linesBefore; i++) {\n if (foundLineNo - i < 0) break;\n line = getLine(\n mark.buffer,\n lineStarts[foundLineNo - i],\n lineEnds[foundLineNo - i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo - i]),\n maxLineLength\n );\n result = common.repeat(' ', options.indent) + padStart((mark.line - i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n' + result;\n }\n\n line = getLine(mark.buffer, lineStarts[foundLineNo], lineEnds[foundLineNo], mark.position, maxLineLength);\n result += common.repeat(' ', options.indent) + padStart((mark.line + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n';\n result += common.repeat('-', options.indent + lineNoLength + 3 + line.pos) + '^' + '\\n';\n\n for (i = 1; i <= options.linesAfter; i++) {\n if (foundLineNo + i >= lineEnds.length) break;\n line = getLine(\n mark.buffer,\n lineStarts[foundLineNo + i],\n lineEnds[foundLineNo + i],\n mark.position - (lineStarts[foundLineNo] - lineStarts[foundLineNo + i]),\n maxLineLength\n );\n result += common.repeat(' ', options.indent) + padStart((mark.line + i + 1).toString(), lineNoLength) +\n ' | ' + line.str + '\\n';\n }\n\n return result.replace(/\\n$/, '');\n}\n\n\nmodule.exports = makeSnippet;\n","'use strict';\n\nvar YAMLException = require('./exception');\n\nvar TYPE_CONSTRUCTOR_OPTIONS = [\n 'kind',\n 'multi',\n 'resolve',\n 'construct',\n 'instanceOf',\n 'predicate',\n 'represent',\n 'representName',\n 'defaultStyle',\n 'styleAliases'\n];\n\nvar YAML_NODE_KINDS = [\n 'scalar',\n 'sequence',\n 'mapping'\n];\n\nfunction compileStyleAliases(map) {\n var result = {};\n\n if (map !== null) {\n Object.keys(map).forEach(function (style) {\n map[style].forEach(function (alias) {\n result[String(alias)] = style;\n });\n });\n }\n\n return result;\n}\n\nfunction Type(tag, options) {\n options = options || {};\n\n Object.keys(options).forEach(function (name) {\n if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {\n throw new YAMLException('Unknown option \"' + name + '\" is met in definition of \"' + tag + '\" YAML type.');\n }\n });\n\n // TODO: Add tag format check.\n this.options = options; // keep original options in case user wants to extend this type later\n this.tag = tag;\n this.kind = options['kind'] || null;\n this.resolve = options['resolve'] || function () { return true; };\n this.construct = options['construct'] || function (data) { return data; };\n this.instanceOf = options['instanceOf'] || null;\n this.predicate = options['predicate'] || null;\n this.represent = options['represent'] || null;\n this.representName = options['representName'] || null;\n this.defaultStyle = options['defaultStyle'] || null;\n this.multi = options['multi'] || false;\n this.styleAliases = compileStyleAliases(options['styleAliases'] || null);\n\n if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {\n throw new YAMLException('Unknown kind \"' + this.kind + '\" is specified for \"' + tag + '\" YAML type.');\n }\n}\n\nmodule.exports = Type;\n","'use strict';\n\n/*eslint-disable no-bitwise*/\n\n\nvar Type = require('../type');\n\n\n// [ 64, 65, 66 ] -> [ padding, CR, LF ]\nvar BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\\n\\r';\n\n\nfunction resolveYamlBinary(data) {\n if (data === null) return false;\n\n var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;\n\n // Convert one by one.\n for (idx = 0; idx < max; idx++) {\n code = map.indexOf(data.charAt(idx));\n\n // Skip CR/LF\n if (code > 64) continue;\n\n // Fail on illegal characters\n if (code < 0) return false;\n\n bitlen += 6;\n }\n\n // If there are any bits left, source was corrupted\n return (bitlen % 8) === 0;\n}\n\nfunction constructYamlBinary(data) {\n var idx, tailbits,\n input = data.replace(/[\\r\\n=]/g, ''), // remove CR/LF & padding to simplify scan\n max = input.length,\n map = BASE64_MAP,\n bits = 0,\n result = [];\n\n // Collect by 6*4 bits (3 bytes)\n\n for (idx = 0; idx < max; idx++) {\n if ((idx % 4 === 0) && idx) {\n result.push((bits >> 16) & 0xFF);\n result.push((bits >> 8) & 0xFF);\n result.push(bits & 0xFF);\n }\n\n bits = (bits << 6) | map.indexOf(input.charAt(idx));\n }\n\n // Dump tail\n\n tailbits = (max % 4) * 6;\n\n if (tailbits === 0) {\n result.push((bits >> 16) & 0xFF);\n result.push((bits >> 8) & 0xFF);\n result.push(bits & 0xFF);\n } else if (tailbits === 18) {\n result.push((bits >> 10) & 0xFF);\n result.push((bits >> 2) & 0xFF);\n } else if (tailbits === 12) {\n result.push((bits >> 4) & 0xFF);\n }\n\n return new Uint8Array(result);\n}\n\nfunction representYamlBinary(object /*, style*/) {\n var result = '', bits = 0, idx, tail,\n max = object.length,\n map = BASE64_MAP;\n\n // Convert every three bytes to 4 ASCII characters.\n\n for (idx = 0; idx < max; idx++) {\n if ((idx % 3 === 0) && idx) {\n result += map[(bits >> 18) & 0x3F];\n result += map[(bits >> 12) & 0x3F];\n result += map[(bits >> 6) & 0x3F];\n result += map[bits & 0x3F];\n }\n\n bits = (bits << 8) + object[idx];\n }\n\n // Dump tail\n\n tail = max % 3;\n\n if (tail === 0) {\n result += map[(bits >> 18) & 0x3F];\n result += map[(bits >> 12) & 0x3F];\n result += map[(bits >> 6) & 0x3F];\n result += map[bits & 0x3F];\n } else if (tail === 2) {\n result += map[(bits >> 10) & 0x3F];\n result += map[(bits >> 4) & 0x3F];\n result += map[(bits << 2) & 0x3F];\n result += map[64];\n } else if (tail === 1) {\n result += map[(bits >> 2) & 0x3F];\n result += map[(bits << 4) & 0x3F];\n result += map[64];\n result += map[64];\n }\n\n return result;\n}\n\nfunction isBinary(obj) {\n return Object.prototype.toString.call(obj) === '[object Uint8Array]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:binary', {\n kind: 'scalar',\n resolve: resolveYamlBinary,\n construct: constructYamlBinary,\n predicate: isBinary,\n represent: representYamlBinary\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlBoolean(data) {\n if (data === null) return false;\n\n var max = data.length;\n\n return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||\n (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));\n}\n\nfunction constructYamlBoolean(data) {\n return data === 'true' ||\n data === 'True' ||\n data === 'TRUE';\n}\n\nfunction isBoolean(object) {\n return Object.prototype.toString.call(object) === '[object Boolean]';\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:bool', {\n kind: 'scalar',\n resolve: resolveYamlBoolean,\n construct: constructYamlBoolean,\n predicate: isBoolean,\n represent: {\n lowercase: function (object) { return object ? 'true' : 'false'; },\n uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },\n camelcase: function (object) { return object ? 'True' : 'False'; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nvar YAML_FLOAT_PATTERN = new RegExp(\n // 2.5e4, 2.5 and integers\n '^(?:[-+]?(?:[0-9][0-9_]*)(?:\\\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +\n // .2e4, .2\n // special case, seems not from spec\n '|\\\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +\n // .inf\n '|[-+]?\\\\.(?:inf|Inf|INF)' +\n // .nan\n '|\\\\.(?:nan|NaN|NAN))$');\n\nfunction resolveYamlFloat(data) {\n if (data === null) return false;\n\n if (!YAML_FLOAT_PATTERN.test(data) ||\n // Quick hack to not allow integers end with `_`\n // Probably should update regexp & check speed\n data[data.length - 1] === '_') {\n return false;\n }\n\n return true;\n}\n\nfunction constructYamlFloat(data) {\n var value, sign;\n\n value = data.replace(/_/g, '').toLowerCase();\n sign = value[0] === '-' ? -1 : 1;\n\n if ('+-'.indexOf(value[0]) >= 0) {\n value = value.slice(1);\n }\n\n if (value === '.inf') {\n return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;\n\n } else if (value === '.nan') {\n return NaN;\n }\n return sign * parseFloat(value, 10);\n}\n\n\nvar SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;\n\nfunction representYamlFloat(object, style) {\n var res;\n\n if (isNaN(object)) {\n switch (style) {\n case 'lowercase': return '.nan';\n case 'uppercase': return '.NAN';\n case 'camelcase': return '.NaN';\n }\n } else if (Number.POSITIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '.inf';\n case 'uppercase': return '.INF';\n case 'camelcase': return '.Inf';\n }\n } else if (Number.NEGATIVE_INFINITY === object) {\n switch (style) {\n case 'lowercase': return '-.inf';\n case 'uppercase': return '-.INF';\n case 'camelcase': return '-.Inf';\n }\n } else if (common.isNegativeZero(object)) {\n return '-0.0';\n }\n\n res = object.toString(10);\n\n // JS stringifier can build scientific format without dots: 5e-100,\n // while YAML requres dot: 5.e-100. Fix it with simple hack\n\n return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;\n}\n\nfunction isFloat(object) {\n return (Object.prototype.toString.call(object) === '[object Number]') &&\n (object % 1 !== 0 || common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:float', {\n kind: 'scalar',\n resolve: resolveYamlFloat,\n construct: constructYamlFloat,\n predicate: isFloat,\n represent: representYamlFloat,\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar common = require('../common');\nvar Type = require('../type');\n\nfunction isHexCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||\n ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||\n ((0x61/* a */ <= c) && (c <= 0x66/* f */));\n}\n\nfunction isOctCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));\n}\n\nfunction isDecCode(c) {\n return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));\n}\n\nfunction resolveYamlInteger(data) {\n if (data === null) return false;\n\n var max = data.length,\n index = 0,\n hasDigits = false,\n ch;\n\n if (!max) return false;\n\n ch = data[index];\n\n // sign\n if (ch === '-' || ch === '+') {\n ch = data[++index];\n }\n\n if (ch === '0') {\n // 0\n if (index + 1 === max) return true;\n ch = data[++index];\n\n // base 2, base 8, base 16\n\n if (ch === 'b') {\n // base 2\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (ch !== '0' && ch !== '1') return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'x') {\n // base 16\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isHexCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n\n\n if (ch === 'o') {\n // base 8\n index++;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isOctCode(data.charCodeAt(index))) return false;\n hasDigits = true;\n }\n return hasDigits && ch !== '_';\n }\n }\n\n // base 10 (except 0)\n\n // value should not start with `_`;\n if (ch === '_') return false;\n\n for (; index < max; index++) {\n ch = data[index];\n if (ch === '_') continue;\n if (!isDecCode(data.charCodeAt(index))) {\n return false;\n }\n hasDigits = true;\n }\n\n // Should have digits and should not end with `_`\n if (!hasDigits || ch === '_') return false;\n\n return true;\n}\n\nfunction constructYamlInteger(data) {\n var value = data, sign = 1, ch;\n\n if (value.indexOf('_') !== -1) {\n value = value.replace(/_/g, '');\n }\n\n ch = value[0];\n\n if (ch === '-' || ch === '+') {\n if (ch === '-') sign = -1;\n value = value.slice(1);\n ch = value[0];\n }\n\n if (value === '0') return 0;\n\n if (ch === '0') {\n if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);\n if (value[1] === 'x') return sign * parseInt(value.slice(2), 16);\n if (value[1] === 'o') return sign * parseInt(value.slice(2), 8);\n }\n\n return sign * parseInt(value, 10);\n}\n\nfunction isInteger(object) {\n return (Object.prototype.toString.call(object)) === '[object Number]' &&\n (object % 1 === 0 && !common.isNegativeZero(object));\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:int', {\n kind: 'scalar',\n resolve: resolveYamlInteger,\n construct: constructYamlInteger,\n predicate: isInteger,\n represent: {\n binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },\n octal: function (obj) { return obj >= 0 ? '0o' + obj.toString(8) : '-0o' + obj.toString(8).slice(1); },\n decimal: function (obj) { return obj.toString(10); },\n /* eslint-disable max-len */\n hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }\n },\n defaultStyle: 'decimal',\n styleAliases: {\n binary: [ 2, 'bin' ],\n octal: [ 8, 'oct' ],\n decimal: [ 10, 'dec' ],\n hexadecimal: [ 16, 'hex' ]\n }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:map', {\n kind: 'mapping',\n construct: function (data) { return data !== null ? data : {}; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlMerge(data) {\n return data === '<<' || data === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:merge', {\n kind: 'scalar',\n resolve: resolveYamlMerge\n});\n","'use strict';\n\nvar Type = require('../type');\n\nfunction resolveYamlNull(data) {\n if (data === null) return true;\n\n var max = data.length;\n\n return (max === 1 && data === '~') ||\n (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));\n}\n\nfunction constructYamlNull() {\n return null;\n}\n\nfunction isNull(object) {\n return object === null;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:null', {\n kind: 'scalar',\n resolve: resolveYamlNull,\n construct: constructYamlNull,\n predicate: isNull,\n represent: {\n canonical: function () { return '~'; },\n lowercase: function () { return 'null'; },\n uppercase: function () { return 'NULL'; },\n camelcase: function () { return 'Null'; },\n empty: function () { return ''; }\n },\n defaultStyle: 'lowercase'\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlOmap(data) {\n if (data === null) return true;\n\n var objectKeys = [], index, length, pair, pairKey, pairHasKey,\n object = data;\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n pairHasKey = false;\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n for (pairKey in pair) {\n if (_hasOwnProperty.call(pair, pairKey)) {\n if (!pairHasKey) pairHasKey = true;\n else return false;\n }\n }\n\n if (!pairHasKey) return false;\n\n if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);\n else return false;\n }\n\n return true;\n}\n\nfunction constructYamlOmap(data) {\n return data !== null ? data : [];\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:omap', {\n kind: 'sequence',\n resolve: resolveYamlOmap,\n construct: constructYamlOmap\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _toString = Object.prototype.toString;\n\nfunction resolveYamlPairs(data) {\n if (data === null) return true;\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n if (_toString.call(pair) !== '[object Object]') return false;\n\n keys = Object.keys(pair);\n\n if (keys.length !== 1) return false;\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return true;\n}\n\nfunction constructYamlPairs(data) {\n if (data === null) return [];\n\n var index, length, pair, keys, result,\n object = data;\n\n result = new Array(object.length);\n\n for (index = 0, length = object.length; index < length; index += 1) {\n pair = object[index];\n\n keys = Object.keys(pair);\n\n result[index] = [ keys[0], pair[keys[0]] ];\n }\n\n return result;\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:pairs', {\n kind: 'sequence',\n resolve: resolveYamlPairs,\n construct: constructYamlPairs\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:seq', {\n kind: 'sequence',\n construct: function (data) { return data !== null ? data : []; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar _hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction resolveYamlSet(data) {\n if (data === null) return true;\n\n var key, object = data;\n\n for (key in object) {\n if (_hasOwnProperty.call(object, key)) {\n if (object[key] !== null) return false;\n }\n }\n\n return true;\n}\n\nfunction constructYamlSet(data) {\n return data !== null ? data : {};\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:set', {\n kind: 'mapping',\n resolve: resolveYamlSet,\n construct: constructYamlSet\n});\n","'use strict';\n\nvar Type = require('../type');\n\nmodule.exports = new Type('tag:yaml.org,2002:str', {\n kind: 'scalar',\n construct: function (data) { return data !== null ? data : ''; }\n});\n","'use strict';\n\nvar Type = require('../type');\n\nvar YAML_DATE_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9])' + // [2] month\n '-([0-9][0-9])$'); // [3] day\n\nvar YAML_TIMESTAMP_REGEXP = new RegExp(\n '^([0-9][0-9][0-9][0-9])' + // [1] year\n '-([0-9][0-9]?)' + // [2] month\n '-([0-9][0-9]?)' + // [3] day\n '(?:[Tt]|[ \\\\t]+)' + // ...\n '([0-9][0-9]?)' + // [4] hour\n ':([0-9][0-9])' + // [5] minute\n ':([0-9][0-9])' + // [6] second\n '(?:\\\\.([0-9]*))?' + // [7] fraction\n '(?:[ \\\\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour\n '(?::([0-9][0-9]))?))?$'); // [11] tz_minute\n\nfunction resolveYamlTimestamp(data) {\n if (data === null) return false;\n if (YAML_DATE_REGEXP.exec(data) !== null) return true;\n if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;\n return false;\n}\n\nfunction constructYamlTimestamp(data) {\n var match, year, month, day, hour, minute, second, fraction = 0,\n delta = null, tz_hour, tz_minute, date;\n\n match = YAML_DATE_REGEXP.exec(data);\n if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);\n\n if (match === null) throw new Error('Date resolve error');\n\n // match: [1] year [2] month [3] day\n\n year = +(match[1]);\n month = +(match[2]) - 1; // JS month starts with 0\n day = +(match[3]);\n\n if (!match[4]) { // no hour\n return new Date(Date.UTC(year, month, day));\n }\n\n // match: [4] hour [5] minute [6] second [7] fraction\n\n hour = +(match[4]);\n minute = +(match[5]);\n second = +(match[6]);\n\n if (match[7]) {\n fraction = match[7].slice(0, 3);\n while (fraction.length < 3) { // milli-seconds\n fraction += '0';\n }\n fraction = +fraction;\n }\n\n // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute\n\n if (match[9]) {\n tz_hour = +(match[10]);\n tz_minute = +(match[11] || 0);\n delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds\n if (match[9] === '-') delta = -delta;\n }\n\n date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));\n\n if (delta) date.setTime(date.getTime() - delta);\n\n return date;\n}\n\nfunction representYamlTimestamp(object /*, style*/) {\n return object.toISOString();\n}\n\nmodule.exports = new Type('tag:yaml.org,2002:timestamp', {\n kind: 'scalar',\n resolve: resolveYamlTimestamp,\n construct: constructYamlTimestamp,\n instanceOf: Date,\n represent: representYamlTimestamp\n});\n","(function(){\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n var inBrowser = typeof navigator !== \"undefined\";\n if(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+this.DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1< 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3; // y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1< 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // Copyright (c) 2005-2009 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Extended JavaScript BN functions, required for RSA private ops.\n\n // Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n // Version 1.2: square() API, isProbablePrime fix\n\n // (public)\n function bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<>24; }\n\n // (public) return value as short (assumes DB>=16)\n function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) alternate constructor\n function bnpFromNumber(a,b,c) {\n if(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1))\t// force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n }\n else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1< 0) {\n if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this[i]&((1<>(p+=this.DB-8);\n }\n else {\n d = (this[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n }\n return r;\n }\n\n function bnEquals(a) { return(this.compareTo(a)==0); }\n function bnMin(a) { return(this.compareTo(a)<0)?this:a; }\n function bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n // (protected) r = this op a (bitwise)\n function bnpBitwiseTo(a,op,r) {\n var i, f, m = Math.min(a.t,this.t);\n for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n if(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n r.t = this.t;\n }\n else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n r.t = a.t;\n }\n r.s = op(this.s,a.s);\n r.clamp();\n }\n\n // (public) this & a\n function op_and(x,y) { return x&y; }\n function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n // (public) this | a\n function op_or(x,y) { return x|y; }\n function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n // (public) this ^ a\n function op_xor(x,y) { return x^y; }\n function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n // (public) this & ~a\n function op_andnot(x,y) { return x&~y; }\n function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n // (public) ~this\n function bnNot() {\n var r = nbi();\n for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n r.t = this.t;\n r.s = ~this.s;\n return r;\n }\n\n // (public) this << n\n function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }\n\n // (public) this >> n\n function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }\n\n // return index of lowest 1-bit in x, x < 2^31\n function lbit(x) {\n if(x == 0) return -1;\n var r = 0;\n if((x&0xffff) == 0) { x >>= 16; r += 16; }\n if((x&0xff) == 0) { x >>= 8; r += 8; }\n if((x&0xf) == 0) { x >>= 4; r += 4; }\n if((x&3) == 0) { x >>= 2; r += 2; }\n if((x&1) == 0) ++r;\n return r;\n }\n\n // (public) returns index of lowest 1-bit (or -1 if none)\n function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }\n\n // return number of 1 bits in x\n function cbit(x) {\n var r = 0;\n while(x != 0) { x &= x-1; ++r; }\n return r;\n }\n\n // (public) return number of set bits\n function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }\n\n // (public) true iff nth bit is set\n function bnTestBit(n) {\n var j = Math.floor(n/this.DB);\n if(j >= this.t) return(this.s!=0);\n return((this[j]&(1<<(n%this.DB)))!=0);\n }\n\n // (protected) this op (1<>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n // (public) this + a\n function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n // (public) this - a\n function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n // (public) this * a\n function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n // (public) this^2\n function bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\n // (public) this / a\n function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n // (public) this % a\n function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n // (public) [this/a,this%a]\n function bnDivideAndRemainder(a) {\n var q = nbi(), r = nbi();\n this.divRemTo(a,q,r);\n return new Array(q,r);\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // A \"null\" reducer\n function NullExp() {}\n function nNop(x) { return x; }\n function nMulTo(x,y,r) { x.multiplyTo(y,r); }\n function nSqrTo(x,r) { x.squareTo(r); }\n\n NullExp.prototype.convert = nNop;\n NullExp.prototype.revert = nNop;\n NullExp.prototype.mulTo = nMulTo;\n NullExp.prototype.sqrTo = nSqrTo;\n\n // (public) this^e\n function bnPow(e) { return this.exp(e,new NullExp()); }\n\n // (protected) r = lower n words of \"this * a\", a.t <= n\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyLowerTo(a,n,r) {\n var i = Math.min(this.t+a.t,n);\n r.s = 0; // assumes a,this >= 0\n r.t = i;\n while(i > 0) r[--i] = 0;\n var j;\n for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n r.clamp();\n }\n\n // (protected) r = \"this * a\" without lower n words, n > 0\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyUpperTo(a,n,r) {\n --n;\n var i = r.t = this.t+a.t-n;\n r.s = 0; // assumes a,this >= 0\n while(--i >= 0) r[i] = 0;\n for(i = Math.max(n-this.t,0); i < a.t; ++i)\n r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n r.clamp();\n r.drShiftTo(1,r);\n }\n\n // Barrett modular reduction\n function Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n }\n\n function barrettConvert(x) {\n if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n else if(x.compareTo(this.m) < 0) return x;\n else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n }\n\n function barrettRevert(x) { return x; }\n\n // x = x mod m (HAC 14.42)\n function barrettReduce(x) {\n x.drShiftTo(this.m.t-1,this.r2);\n if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n x.subTo(this.r2,x);\n while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = x^2 mod m; x != r\n function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = x*y mod m; x,y != r\n function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Barrett.prototype.convert = barrettConvert;\n Barrett.prototype.revert = barrettRevert;\n Barrett.prototype.reduce = barrettReduce;\n Barrett.prototype.mulTo = barrettMulTo;\n Barrett.prototype.sqrTo = barrettSqrTo;\n\n // (public) this^e % m (HAC 14.85)\n function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) {\t// ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1< 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n }\n\n // (protected) this % n, n < 2^26\n function bnpModInt(n) {\n if(n <= 0) return 0;\n var d = this.DV%n, r = (this.s<0)?n-1:0;\n if(this.t > 0)\n if(d == 0) r = this[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n return r;\n }\n\n // (public) 1/this % m (HAC 14.61)\n function bnModInverse(m) {\n var ac = m.isEven();\n if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n var u = m.clone(), v = this.clone();\n var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n while(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n }\n else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n }\n else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n }\n else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n }\n if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if(d.compareTo(m) >= 0) return d.subtract(m);\n if(d.signum() < 0) d.addTo(m,d); else return d;\n if(d.signum() < 0) return d.add(m); else return d;\n }\n\n var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\n var lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n // (public) test primality with certainty >= 1-.5^t\n function bnIsProbablePrime(t) {\n var i, x = this.abs();\n if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x[0] == lowprimes[i]) return true;\n return false;\n }\n if(x.isEven()) return false;\n i = 1;\n while(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n }\n return x.millerRabin(t);\n }\n\n // (protected) true if probably prime (HAC 4.24, Miller-Rabin)\n function bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if(k <= 0) return false;\n var r = n1.shiftRight(k);\n t = (t+1)>>1;\n if(t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n for(var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n }\n return true;\n }\n\n // protected\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.fromNumber = bnpFromNumber;\n BigInteger.prototype.bitwiseTo = bnpBitwiseTo;\n BigInteger.prototype.changeBit = bnpChangeBit;\n BigInteger.prototype.addTo = bnpAddTo;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\n BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\n BigInteger.prototype.modInt = bnpModInt;\n BigInteger.prototype.millerRabin = bnpMillerRabin;\n\n // public\n BigInteger.prototype.clone = bnClone;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.byteValue = bnByteValue;\n BigInteger.prototype.shortValue = bnShortValue;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.toByteArray = bnToByteArray;\n BigInteger.prototype.equals = bnEquals;\n BigInteger.prototype.min = bnMin;\n BigInteger.prototype.max = bnMax;\n BigInteger.prototype.and = bnAnd;\n BigInteger.prototype.or = bnOr;\n BigInteger.prototype.xor = bnXor;\n BigInteger.prototype.andNot = bnAndNot;\n BigInteger.prototype.not = bnNot;\n BigInteger.prototype.shiftLeft = bnShiftLeft;\n BigInteger.prototype.shiftRight = bnShiftRight;\n BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\n BigInteger.prototype.bitCount = bnBitCount;\n BigInteger.prototype.testBit = bnTestBit;\n BigInteger.prototype.setBit = bnSetBit;\n BigInteger.prototype.clearBit = bnClearBit;\n BigInteger.prototype.flipBit = bnFlipBit;\n BigInteger.prototype.add = bnAdd;\n BigInteger.prototype.subtract = bnSubtract;\n BigInteger.prototype.multiply = bnMultiply;\n BigInteger.prototype.divide = bnDivide;\n BigInteger.prototype.remainder = bnRemainder;\n BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\n BigInteger.prototype.modPow = bnModPow;\n BigInteger.prototype.modInverse = bnModInverse;\n BigInteger.prototype.pow = bnPow;\n BigInteger.prototype.gcd = bnGCD;\n BigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n // JSBN-specific extension\n BigInteger.prototype.square = bnSquare;\n\n // Expose the Barrett function\n BigInteger.prototype.Barrett = Barrett\n\n // BigInteger interfaces not implemented in jsbn:\n\n // BigInteger(int signum, byte[] magnitude)\n // double doubleValue()\n // float floatValue()\n // int hashCode()\n // long longValue()\n // static BigInteger valueOf(long val)\n\n\t// Random number generator - requires a PRNG backend, e.g. prng4.js\n\n\t// For best results, put code like\n\t// \n\t// in your main HTML document.\n\n\tvar rng_state;\n\tvar rng_pool;\n\tvar rng_pptr;\n\n\t// Mix in a 32-bit integer into the pool\n\tfunction rng_seed_int(x) {\n\t rng_pool[rng_pptr++] ^= x & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 8) & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 16) & 255;\n\t rng_pool[rng_pptr++] ^= (x >> 24) & 255;\n\t if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;\n\t}\n\n\t// Mix in the current time (w/milliseconds) into the pool\n\tfunction rng_seed_time() {\n\t rng_seed_int(new Date().getTime());\n\t}\n\n\t// Initialize the pool with junk if needed.\n\tif(rng_pool == null) {\n\t rng_pool = new Array();\n\t rng_pptr = 0;\n\t var t;\n\t if(typeof window !== \"undefined\" && window.crypto) {\n\t\tif (window.crypto.getRandomValues) {\n\t\t // Use webcrypto if available\n\t\t var ua = new Uint8Array(32);\n\t\t window.crypto.getRandomValues(ua);\n\t\t for(t = 0; t < 32; ++t)\n\t\t\trng_pool[rng_pptr++] = ua[t];\n\t\t}\n\t\telse if(navigator.appName == \"Netscape\" && navigator.appVersion < \"5\") {\n\t\t // Extract entropy (256 bits) from NS4 RNG if available\n\t\t var z = window.crypto.random(32);\n\t\t for(t = 0; t < z.length; ++t)\n\t\t\trng_pool[rng_pptr++] = z.charCodeAt(t) & 255;\n\t\t}\n\t }\n\t while(rng_pptr < rng_psize) { // extract some randomness from Math.random()\n\t\tt = Math.floor(65536 * Math.random());\n\t\trng_pool[rng_pptr++] = t >>> 8;\n\t\trng_pool[rng_pptr++] = t & 255;\n\t }\n\t rng_pptr = 0;\n\t rng_seed_time();\n\t //rng_seed_int(window.screenX);\n\t //rng_seed_int(window.screenY);\n\t}\n\n\tfunction rng_get_byte() {\n\t if(rng_state == null) {\n\t\trng_seed_time();\n\t\trng_state = prng_newstate();\n\t\trng_state.init(rng_pool);\n\t\tfor(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n\t\t rng_pool[rng_pptr] = 0;\n\t\trng_pptr = 0;\n\t\t//rng_pool = null;\n\t }\n\t // TODO: allow reseeding after first request\n\t return rng_state.next();\n\t}\n\n\tfunction rng_get_bytes(ba) {\n\t var i;\n\t for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n\t}\n\n\tfunction SecureRandom() {}\n\n\tSecureRandom.prototype.nextBytes = rng_get_bytes;\n\n\t// prng4.js - uses Arcfour as a PRNG\n\n\tfunction Arcfour() {\n\t this.i = 0;\n\t this.j = 0;\n\t this.S = new Array();\n\t}\n\n\t// Initialize arcfour context from key, an array of ints, each from [0..255]\n\tfunction ARC4init(key) {\n\t var i, j, t;\n\t for(i = 0; i < 256; ++i)\n\t\tthis.S[i] = i;\n\t j = 0;\n\t for(i = 0; i < 256; ++i) {\n\t\tj = (j + this.S[i] + key[i % key.length]) & 255;\n\t\tt = this.S[i];\n\t\tthis.S[i] = this.S[j];\n\t\tthis.S[j] = t;\n\t }\n\t this.i = 0;\n\t this.j = 0;\n\t}\n\n\tfunction ARC4next() {\n\t var t;\n\t this.i = (this.i + 1) & 255;\n\t this.j = (this.j + this.S[this.i]) & 255;\n\t t = this.S[this.i];\n\t this.S[this.i] = this.S[this.j];\n\t this.S[this.j] = t;\n\t return this.S[(t + this.S[this.i]) & 255];\n\t}\n\n\tArcfour.prototype.init = ARC4init;\n\tArcfour.prototype.next = ARC4next;\n\n\t// Plug in your RNG constructor here\n\tfunction prng_newstate() {\n\t return new Arcfour();\n\t}\n\n\t// Pool size must be a multiple of 4 and greater than 32.\n\t// An array of bytes the size of the pool will be passed to init()\n\tvar rng_psize = 256;\n\n BigInteger.SecureRandom = SecureRandom;\n BigInteger.BigInteger = BigInteger;\n if (typeof exports !== 'undefined') {\n exports = module.exports = BigInteger;\n } else {\n this.BigInteger = BigInteger;\n this.SecureRandom = SecureRandom;\n }\n\n}).call(this);\n","'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i schema.maxItems){\r\n\t\t\t\t\t\taddError(\"There must be a maximum of \" + schema.maxItems + \" in the array\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}else if(schema.properties || schema.additionalProperties){\r\n\t\t\t\t\terrors.concat(checkObj(value, schema.properties, path, schema.additionalProperties));\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){\r\n\t\t\t\t\taddError(\"does not match the regex pattern \" + schema.pattern);\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){\r\n\t\t\t\t\taddError(\"may only be \" + schema.maxLength + \" characters long\");\r\n\t\t\t\t}\r\n\t\t\t\tif(schema.minLength && typeof value == 'string' && value.length < schema.minLength){\r\n\t\t\t\t\taddError(\"must be at least \" + schema.minLength + \" characters long\");\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.minimum !== 'undefined' && typeof value == typeof schema.minimum &&\r\n\t\t\t\t\t\tschema.minimum > value){\r\n\t\t\t\t\taddError(\"must have a minimum value of \" + schema.minimum);\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.maximum !== 'undefined' && typeof value == typeof schema.maximum &&\r\n\t\t\t\t\t\tschema.maximum < value){\r\n\t\t\t\t\taddError(\"must have a maximum value of \" + schema.maximum);\r\n\t\t\t\t}\r\n\t\t\t\tif(schema['enum']){\r\n\t\t\t\t\tvar enumer = schema['enum'];\r\n\t\t\t\t\tl = enumer.length;\r\n\t\t\t\t\tvar found;\r\n\t\t\t\t\tfor(var j = 0; j < l; j++){\r\n\t\t\t\t\t\tif(enumer[j]===value){\r\n\t\t\t\t\t\t\tfound=1;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!found){\r\n\t\t\t\t\t\taddError(\"does not have a value in the enumeration \" + enumer.join(\", \"));\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof schema.maxDecimal == 'number' &&\r\n\t\t\t\t\t(value.toString().match(new RegExp(\"\\\\.[0-9]{\" + (schema.maxDecimal + 1) + \",}\")))){\r\n\t\t\t\t\taddError(\"may only have \" + schema.maxDecimal + \" digits of decimal places\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\t// validate an object against a schema\r\n\tfunction checkObj(instance,objTypeDef,path,additionalProp){\r\n\r\n\t\tif(typeof objTypeDef =='object'){\r\n\t\t\tif(typeof instance != 'object' || instance instanceof Array){\r\n\t\t\t\terrors.push({property:path,message:\"an object is required\"});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(var i in objTypeDef){ \r\n\t\t\t\tif(objTypeDef.hasOwnProperty(i) && i != '__proto__' && i != 'constructor'){\r\n\t\t\t\t\tvar value = instance.hasOwnProperty(i) ? instance[i] : undefined;\r\n\t\t\t\t\t// skip _not_ specified properties\r\n\t\t\t\t\tif (value === undefined && options.existingOnly) continue;\r\n\t\t\t\t\tvar propDef = objTypeDef[i];\r\n\t\t\t\t\t// set default\r\n\t\t\t\t\tif(value === undefined && propDef[\"default\"]){\r\n\t\t\t\t\t\tvalue = instance[i] = propDef[\"default\"];\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(options.coerce && i in instance){\r\n\t\t\t\t\t\tvalue = instance[i] = options.coerce(value, propDef);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcheckProp(value,propDef,path,i);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(i in instance){\r\n\t\t\tif(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){\r\n\t\t\t\tif (options.filter) {\r\n\t\t\t\t\tdelete instance[i];\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t} else {\r\n\t\t\t\t\terrors.push({property:path,message:\"The property \" + i +\r\n\t\t\t\t\t\t\" is not defined in the schema and the schema does not allow additional properties\"});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;\r\n\t\t\tif(requires && !(requires in instance)){\r\n\t\t\t\terrors.push({property:path,message:\"the presence of the property \" + i + \" requires that \" + requires + \" also be present\"});\r\n\t\t\t}\r\n\t\t\tvalue = instance[i];\r\n\t\t\tif(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){\r\n\t\t\t\tif(options.coerce){\r\n\t\t\t\t\tvalue = instance[i] = options.coerce(value, additionalProp);\r\n\t\t\t\t}\r\n\t\t\t\tcheckProp(value,additionalProp,path,i);\r\n\t\t\t}\r\n\t\t\tif(!_changing && value && value.$schema){\r\n\t\t\t\terrors = errors.concat(checkProp(value,value.$schema,path,i));\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn errors;\r\n\t}\r\n\tif(schema){\r\n\t\tcheckProp(instance,schema,'',_changing || '');\r\n\t}\r\n\tif(!_changing && instance && instance.$schema){\r\n\t\tcheckProp(instance,instance.$schema,'','');\r\n\t}\r\n\treturn {valid:!errors.length,errors:errors};\r\n};\r\nexports.mustBeValid = function(result){\r\n\t//\tsummary:\r\n\t//\t\tThis checks to ensure that the result is valid and will throw an appropriate error message if it is not\r\n\t// result: the result returned from checkPropertyChange or validate\r\n\tif(!result.valid){\r\n\t\tthrow new TypeError(result.errors.map(function(error){return \"for property \" + error.property + ': ' + error.message;}).join(\", \\n\"));\r\n\t}\r\n}\r\n\r\nreturn exports;\r\n}));\r\n","exports = module.exports = stringify\nexports.getSerialize = serializer\n\nfunction stringify(obj, replacer, spaces, cycleReplacer) {\n return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)\n}\n\nfunction serializer(replacer, cycleReplacer) {\n var stack = [], keys = []\n\n if (cycleReplacer == null) cycleReplacer = function(key, value) {\n if (stack[0] === value) return \"[Circular ~]\"\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\"\n }\n\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this)\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)\n if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)\n }\n else stack.push(value)\n\n return replacer == null ? value : replacer.call(this, key, value)\n }\n}\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n typeof define === 'function' && define.amd ? define(['exports'], factory) :\n (global = global || self, factory(global.JSONPath = {}));\n}(this, function (exports) { 'use strict';\n\n function _typeof(obj) {\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function (obj) {\n return typeof obj;\n };\n } else {\n _typeof = function (obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n }\n\n function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n }\n\n function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) _setPrototypeOf(subClass, superClass);\n }\n\n function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n }\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n function isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n\n try {\n Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n }\n\n function _construct(Parent, args, Class) {\n if (isNativeReflectConstruct()) {\n _construct = Reflect.construct;\n } else {\n _construct = function _construct(Parent, args, Class) {\n var a = [null];\n a.push.apply(a, args);\n var Constructor = Function.bind.apply(Parent, a);\n var instance = new Constructor();\n if (Class) _setPrototypeOf(instance, Class.prototype);\n return instance;\n };\n }\n\n return _construct.apply(null, arguments);\n }\n\n function _isNativeFunction(fn) {\n return Function.toString.call(fn).indexOf(\"[native code]\") !== -1;\n }\n\n function _wrapNativeSuper(Class) {\n var _cache = typeof Map === \"function\" ? new Map() : undefined;\n\n _wrapNativeSuper = function _wrapNativeSuper(Class) {\n if (Class === null || !_isNativeFunction(Class)) return Class;\n\n if (typeof Class !== \"function\") {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n if (typeof _cache !== \"undefined\") {\n if (_cache.has(Class)) return _cache.get(Class);\n\n _cache.set(Class, Wrapper);\n }\n\n function Wrapper() {\n return _construct(Class, arguments, _getPrototypeOf(this).constructor);\n }\n\n Wrapper.prototype = Object.create(Class.prototype, {\n constructor: {\n value: Wrapper,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n return _setPrototypeOf(Wrapper, Class);\n };\n\n return _wrapNativeSuper(Class);\n }\n\n function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n }\n\n function _possibleConstructorReturn(self, call) {\n if (call && (typeof call === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return _assertThisInitialized(self);\n }\n\n /* eslint-disable no-eval */\n var globalEval = eval; // eslint-disable-next-line import/no-commonjs\n\n var supportsNodeVM = typeof module !== 'undefined' && Boolean(module.exports) && !(typeof navigator !== 'undefined' && navigator.product === 'ReactNative');\n var allowedResultTypes = ['value', 'path', 'pointer', 'parent', 'parentProperty', 'all'];\n var hasOwnProp = Object.prototype.hasOwnProperty;\n /**\n * Copy items out of one array into another.\n * @param {Array} source Array with items to copy\n * @param {Array} target Array to which to copy\n * @param {Function} conditionCb Callback passed the current item; will move\n * item if evaluates to `true`\n * @returns {undefined}\n */\n\n var moveToAnotherArray = function moveToAnotherArray(source, target, conditionCb) {\n var il = source.length;\n\n for (var i = 0; i < il; i++) {\n var item = source[i];\n\n if (conditionCb(item)) {\n target.push(source.splice(i--, 1)[0]);\n }\n }\n };\n\n var vm = supportsNodeVM ? require('vm') : {\n /**\n * @param {string} expr Expression to evaluate\n * @param {Object} context Object whose items will be added to evaluation\n * @returns {*} Result of evaluated code\n */\n runInNewContext: function runInNewContext(expr, context) {\n var keys = Object.keys(context);\n var funcs = [];\n moveToAnotherArray(keys, funcs, function (key) {\n return typeof context[key] === 'function';\n });\n var code = funcs.reduce(function (s, func) {\n var fString = context[func].toString();\n\n if (!/function/.exec(fString)) {\n fString = 'function ' + fString;\n }\n\n return 'var ' + func + '=' + fString + ';' + s;\n }, '') + keys.reduce(function (s, vr) {\n return 'var ' + vr + '=' + JSON.stringify(context[vr]).replace( // http://www.thespanner.co.uk/2011/07/25/the-json-specification-is-now-wrong/\n /\\u2028|\\u2029/g, function (m) {\n return \"\\\\u202\" + (m === \"\\u2028\" ? '8' : '9');\n }) + ';' + s;\n }, expr);\n return globalEval(code);\n }\n };\n /**\n * Copies array and then pushes item into it.\n * @param {Array} arr Array to copy and into which to push\n * @param {*} item Array item to add (to end)\n * @returns {Array} Copy of the original array\n */\n\n function push(arr, item) {\n arr = arr.slice();\n arr.push(item);\n return arr;\n }\n /**\n * Copies array and then unshifts item into it.\n * @param {*} item Array item to add (to beginning)\n * @param {Array} arr Array to copy and into which to unshift\n * @returns {Array} Copy of the original array\n */\n\n\n function unshift(item, arr) {\n arr = arr.slice();\n arr.unshift(item);\n return arr;\n }\n /**\n * Caught when JSONPath is used without `new` but rethrown if with `new`\n * @extends Error\n */\n\n\n var NewError =\n /*#__PURE__*/\n function (_Error) {\n _inherits(NewError, _Error);\n\n /**\n * @param {*} value The evaluated scalar value\n */\n function NewError(value) {\n var _this;\n\n _classCallCheck(this, NewError);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(NewError).call(this, 'JSONPath should not be called with \"new\" (it prevents return of (unwrapped) scalar values)'));\n _this.avoidNew = true;\n _this.value = value;\n _this.name = 'NewError';\n return _this;\n }\n\n return NewError;\n }(_wrapNativeSuper(Error));\n /**\n * @param {Object} [opts] If present, must be an object\n * @param {string} expr JSON path to evaluate\n * @param {JSON} obj JSON object to evaluate against\n * @param {Function} callback Passed 3 arguments: 1) desired payload per `resultType`,\n * 2) `\"value\"|\"property\"`, 3) Full returned object with all payloads\n * @param {Function} otherTypeCallback If `@other()` is at the end of one's query, this\n * will be invoked with the value of the item, its path, its parent, and its parent's\n * property name, and it should return a boolean indicating whether the supplied value\n * belongs to the \"other\" type or not (or it may handle transformations and return `false`).\n * @returns {JSONPath}\n * @class\n */\n\n\n function JSONPath(opts, expr, obj, callback, otherTypeCallback) {\n // eslint-disable-next-line no-restricted-syntax\n if (!(this instanceof JSONPath)) {\n try {\n return new JSONPath(opts, expr, obj, callback, otherTypeCallback);\n } catch (e) {\n if (!e.avoidNew) {\n throw e;\n }\n\n return e.value;\n }\n }\n\n if (typeof opts === 'string') {\n otherTypeCallback = callback;\n callback = obj;\n obj = expr;\n expr = opts;\n opts = {};\n }\n\n opts = opts || {};\n var objArgs = hasOwnProp.call(opts, 'json') && hasOwnProp.call(opts, 'path');\n this.json = opts.json || obj;\n this.path = opts.path || expr;\n this.resultType = opts.resultType && opts.resultType.toLowerCase() || 'value';\n this.flatten = opts.flatten || false;\n this.wrap = hasOwnProp.call(opts, 'wrap') ? opts.wrap : true;\n this.sandbox = opts.sandbox || {};\n this.preventEval = opts.preventEval || false;\n this.parent = opts.parent || null;\n this.parentProperty = opts.parentProperty || null;\n this.callback = opts.callback || callback || null;\n\n this.otherTypeCallback = opts.otherTypeCallback || otherTypeCallback || function () {\n throw new Error('You must supply an otherTypeCallback callback option with the @other() operator.');\n };\n\n if (opts.autostart !== false) {\n var ret = this.evaluate({\n path: objArgs ? opts.path : expr,\n json: objArgs ? opts.json : obj\n });\n\n if (!ret || _typeof(ret) !== 'object') {\n throw new NewError(ret);\n }\n\n return ret;\n }\n } // PUBLIC METHODS\n\n\n JSONPath.prototype.evaluate = function (expr, json, callback, otherTypeCallback) {\n var that = this;\n var currParent = this.parent,\n currParentProperty = this.parentProperty;\n var flatten = this.flatten,\n wrap = this.wrap;\n this.currResultType = this.resultType;\n this.currPreventEval = this.preventEval;\n this.currSandbox = this.sandbox;\n callback = callback || this.callback;\n this.currOtherTypeCallback = otherTypeCallback || this.otherTypeCallback;\n json = json || this.json;\n expr = expr || this.path;\n\n if (expr && _typeof(expr) === 'object') {\n if (!expr.path) {\n throw new Error('You must supply a \"path\" property when providing an object argument to JSONPath.evaluate().');\n }\n\n json = hasOwnProp.call(expr, 'json') ? expr.json : json;\n flatten = hasOwnProp.call(expr, 'flatten') ? expr.flatten : flatten;\n this.currResultType = hasOwnProp.call(expr, 'resultType') ? expr.resultType : this.currResultType;\n this.currSandbox = hasOwnProp.call(expr, 'sandbox') ? expr.sandbox : this.currSandbox;\n wrap = hasOwnProp.call(expr, 'wrap') ? expr.wrap : wrap;\n this.currPreventEval = hasOwnProp.call(expr, 'preventEval') ? expr.preventEval : this.currPreventEval;\n callback = hasOwnProp.call(expr, 'callback') ? expr.callback : callback;\n this.currOtherTypeCallback = hasOwnProp.call(expr, 'otherTypeCallback') ? expr.otherTypeCallback : this.currOtherTypeCallback;\n currParent = hasOwnProp.call(expr, 'parent') ? expr.parent : currParent;\n currParentProperty = hasOwnProp.call(expr, 'parentProperty') ? expr.parentProperty : currParentProperty;\n expr = expr.path;\n }\n\n currParent = currParent || null;\n currParentProperty = currParentProperty || null;\n\n if (Array.isArray(expr)) {\n expr = JSONPath.toPathString(expr);\n }\n\n if (!expr || !json || !allowedResultTypes.includes(this.currResultType)) {\n return undefined;\n }\n\n this._obj = json;\n var exprList = JSONPath.toPathArray(expr);\n\n if (exprList[0] === '$' && exprList.length > 1) {\n exprList.shift();\n }\n\n this._hasParentSelector = null;\n\n var result = this._trace(exprList, json, ['$'], currParent, currParentProperty, callback).filter(function (ea) {\n return ea && !ea.isParentSelector;\n });\n\n if (!result.length) {\n return wrap ? [] : undefined;\n }\n\n if (result.length === 1 && !wrap && !Array.isArray(result[0].value)) {\n return this._getPreferredOutput(result[0]);\n }\n\n return result.reduce(function (rslt, ea) {\n var valOrPath = that._getPreferredOutput(ea);\n\n if (flatten && Array.isArray(valOrPath)) {\n rslt = rslt.concat(valOrPath);\n } else {\n rslt.push(valOrPath);\n }\n\n return rslt;\n }, []);\n }; // PRIVATE METHODS\n\n\n JSONPath.prototype._getPreferredOutput = function (ea) {\n var resultType = this.currResultType;\n\n switch (resultType) {\n default:\n throw new TypeError('Unknown result type');\n\n case 'all':\n ea.pointer = JSONPath.toPointer(ea.path);\n ea.path = typeof ea.path === 'string' ? ea.path : JSONPath.toPathString(ea.path);\n return ea;\n\n case 'value':\n case 'parent':\n case 'parentProperty':\n return ea[resultType];\n\n case 'path':\n return JSONPath.toPathString(ea[resultType]);\n\n case 'pointer':\n return JSONPath.toPointer(ea.path);\n }\n };\n\n JSONPath.prototype._handleCallback = function (fullRetObj, callback, type) {\n if (callback) {\n var preferredOutput = this._getPreferredOutput(fullRetObj);\n\n fullRetObj.path = typeof fullRetObj.path === 'string' ? fullRetObj.path : JSONPath.toPathString(fullRetObj.path); // eslint-disable-next-line callback-return\n\n callback(preferredOutput, type, fullRetObj);\n }\n };\n\n JSONPath.prototype._trace = function (expr, val, path, parent, parentPropName, callback, literalPriority) {\n // No expr to follow? return path and value as the result of this trace branch\n var retObj;\n var that = this;\n\n if (!expr.length) {\n retObj = {\n path: path,\n value: val,\n parent: parent,\n parentProperty: parentPropName\n };\n\n this._handleCallback(retObj, callback, 'value');\n\n return retObj;\n }\n\n var loc = expr[0],\n x = expr.slice(1); // We need to gather the return value of recursive trace calls in order to\n // do the parent sel computation.\n\n var ret = [];\n\n function addRet(elems) {\n if (Array.isArray(elems)) {\n // This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...elems);`\n elems.forEach(function (t) {\n ret.push(t);\n });\n } else {\n ret.push(elems);\n }\n }\n\n if ((typeof loc !== 'string' || literalPriority) && val && hasOwnProp.call(val, loc)) {\n // simple case--directly follow property\n addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback));\n } else if (loc === '*') {\n // all child properties\n // eslint-disable-next-line no-shadow\n this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) {\n addRet(that._trace(unshift(m, x), v, p, par, pr, cb, true));\n });\n } else if (loc === '..') {\n // all descendent parent properties\n addRet(this._trace(x, val, path, parent, parentPropName, callback)); // Check remaining expression with val's immediate children\n // eslint-disable-next-line no-shadow\n\n this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) {\n // We don't join m and x here because we only want parents, not scalar values\n if (_typeof(v[m]) === 'object') {\n // Keep going with recursive descent on val's object children\n addRet(that._trace(unshift(l, x), v[m], push(p, m), v, m, cb));\n }\n }); // The parent sel computation is handled in the frame above using the\n // ancestor object of val\n\n } else if (loc === '^') {\n // This is not a final endpoint, so we do not invoke the callback here\n this._hasParentSelector = true;\n return path.length ? {\n path: path.slice(0, -1),\n expr: x,\n isParentSelector: true\n } : [];\n } else if (loc === '~') {\n // property name\n retObj = {\n path: push(path, loc),\n value: parentPropName,\n parent: parent,\n parentProperty: null\n };\n\n this._handleCallback(retObj, callback, 'property');\n\n return retObj;\n } else if (loc === '$') {\n // root only\n addRet(this._trace(x, val, path, null, null, callback));\n } else if (/^(-?\\d*):(-?\\d*):?(\\d*)$/.test(loc)) {\n // [start:end:step] Python slice syntax\n addRet(this._slice(loc, x, val, path, parent, parentPropName, callback));\n } else if (loc.indexOf('?(') === 0) {\n // [?(expr)] (filtering)\n if (this.currPreventEval) {\n throw new Error('Eval [?(expr)] prevented in JSONPath expression.');\n } // eslint-disable-next-line no-shadow\n\n\n this._walk(loc, x, val, path, parent, parentPropName, callback, function (m, l, x, v, p, par, pr, cb) {\n if (that._eval(l.replace(/^\\?\\((.*?)\\)$/, '$1'), v[m], m, p, par, pr)) {\n addRet(that._trace(unshift(m, x), v, p, par, pr, cb));\n }\n });\n } else if (loc[0] === '(') {\n // [(expr)] (dynamic property/index)\n if (this.currPreventEval) {\n throw new Error('Eval [(expr)] prevented in JSONPath expression.');\n } // As this will resolve to a property name (but we don't know it yet), property and parent information is relative to the parent of the property to which this expression will resolve\n\n\n addRet(this._trace(unshift(this._eval(loc, val, path[path.length - 1], path.slice(0, -1), parent, parentPropName), x), val, path, parent, parentPropName, callback));\n } else if (loc[0] === '@') {\n // value type: @boolean(), etc.\n var addType = false;\n var valueType = loc.slice(1, -2);\n\n switch (valueType) {\n default:\n throw new TypeError('Unknown value type ' + valueType);\n\n case 'scalar':\n if (!val || !['object', 'function'].includes(_typeof(val))) {\n addType = true;\n }\n\n break;\n\n case 'boolean':\n case 'string':\n case 'undefined':\n case 'function':\n if (_typeof(val) === valueType) {\n // eslint-disable-line valid-typeof\n addType = true;\n }\n\n break;\n\n case 'number':\n if (_typeof(val) === valueType && isFinite(val)) {\n // eslint-disable-line valid-typeof\n addType = true;\n }\n\n break;\n\n case 'nonFinite':\n if (typeof val === 'number' && !isFinite(val)) {\n addType = true;\n }\n\n break;\n\n case 'object':\n if (val && _typeof(val) === valueType) {\n // eslint-disable-line valid-typeof\n addType = true;\n }\n\n break;\n\n case 'array':\n if (Array.isArray(val)) {\n addType = true;\n }\n\n break;\n\n case 'other':\n addType = this.currOtherTypeCallback(val, path, parent, parentPropName);\n break;\n\n case 'integer':\n if (val === Number(val) && isFinite(val) && !(val % 1)) {\n addType = true;\n }\n\n break;\n\n case 'null':\n if (val === null) {\n addType = true;\n }\n\n break;\n }\n\n if (addType) {\n retObj = {\n path: path,\n value: val,\n parent: parent,\n parentProperty: parentPropName\n };\n\n this._handleCallback(retObj, callback, 'value');\n\n return retObj;\n }\n } else if (loc[0] === '`' && val && hasOwnProp.call(val, loc.slice(1))) {\n // `-escaped property\n var locProp = loc.slice(1);\n addRet(this._trace(x, val[locProp], push(path, locProp), val, locProp, callback, true));\n } else if (loc.includes(',')) {\n // [name1,name2,...]\n var parts = loc.split(',');\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var part = _step.value;\n addRet(this._trace(unshift(part, x), val, path, parent, parentPropName, callback));\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator[\"return\"] != null) {\n _iterator[\"return\"]();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n } else if (!literalPriority && val && hasOwnProp.call(val, loc)) {\n // simple case--directly follow property\n addRet(this._trace(x, val[loc], push(path, loc), val, loc, callback, true));\n } // We check the resulting values for parent selections. For parent\n // selections we discard the value object and continue the trace with the\n // current val object\n\n\n if (this._hasParentSelector) {\n // eslint-disable-next-line unicorn/no-for-loop\n for (var t = 0; t < ret.length; t++) {\n var rett = ret[t];\n\n if (rett.isParentSelector) {\n var tmp = that._trace(rett.expr, val, rett.path, parent, parentPropName, callback);\n\n if (Array.isArray(tmp)) {\n ret[t] = tmp[0];\n var tl = tmp.length;\n\n for (var tt = 1; tt < tl; tt++) {\n t++;\n ret.splice(t, 0, tmp[tt]);\n }\n } else {\n ret[t] = tmp;\n }\n }\n }\n }\n\n return ret;\n };\n\n JSONPath.prototype._walk = function (loc, expr, val, path, parent, parentPropName, callback, f) {\n if (Array.isArray(val)) {\n var n = val.length;\n\n for (var i = 0; i < n; i++) {\n f(i, loc, expr, val, path, parent, parentPropName, callback);\n }\n } else if (_typeof(val) === 'object') {\n for (var m in val) {\n if (hasOwnProp.call(val, m)) {\n f(m, loc, expr, val, path, parent, parentPropName, callback);\n }\n }\n }\n };\n\n JSONPath.prototype._slice = function (loc, expr, val, path, parent, parentPropName, callback) {\n if (!Array.isArray(val)) {\n return undefined;\n }\n\n var len = val.length,\n parts = loc.split(':'),\n step = parts[2] && parseInt(parts[2]) || 1;\n var start = parts[0] && parseInt(parts[0]) || 0,\n end = parts[1] && parseInt(parts[1]) || len;\n start = start < 0 ? Math.max(0, start + len) : Math.min(len, start);\n end = end < 0 ? Math.max(0, end + len) : Math.min(len, end);\n var ret = [];\n\n for (var i = start; i < end; i += step) {\n var tmp = this._trace(unshift(i, expr), val, path, parent, parentPropName, callback);\n\n if (Array.isArray(tmp)) {\n // This was causing excessive stack size in Node (with or without Babel) against our performance test: `ret.push(...tmp);`\n tmp.forEach(function (t) {\n ret.push(t);\n });\n } else {\n ret.push(tmp);\n }\n }\n\n return ret;\n };\n\n JSONPath.prototype._eval = function (code, _v, _vname, path, parent, parentPropName) {\n if (!this._obj || !_v) {\n return false;\n }\n\n if (code.includes('@parentProperty')) {\n this.currSandbox._$_parentProperty = parentPropName;\n code = code.replace(/@parentProperty/g, '_$_parentProperty');\n }\n\n if (code.includes('@parent')) {\n this.currSandbox._$_parent = parent;\n code = code.replace(/@parent/g, '_$_parent');\n }\n\n if (code.includes('@property')) {\n this.currSandbox._$_property = _vname;\n code = code.replace(/@property/g, '_$_property');\n }\n\n if (code.includes('@path')) {\n this.currSandbox._$_path = JSONPath.toPathString(path.concat([_vname]));\n code = code.replace(/@path/g, '_$_path');\n }\n\n if (code.match(/@([.\\s)[])/)) {\n this.currSandbox._$_v = _v;\n code = code.replace(/@([.\\s)[])/g, '_$_v$1');\n }\n\n try {\n return vm.runInNewContext(code, this.currSandbox);\n } catch (e) {\n // eslint-disable-next-line no-console\n console.log(e);\n throw new Error('jsonPath: ' + e.message + ': ' + code);\n }\n }; // PUBLIC CLASS PROPERTIES AND METHODS\n // Could store the cache object itself\n\n\n JSONPath.cache = {};\n /**\n * @param {string[]} pathArr Array to convert\n * @returns {string} The path string\n */\n\n JSONPath.toPathString = function (pathArr) {\n var x = pathArr,\n n = x.length;\n var p = '$';\n\n for (var i = 1; i < n; i++) {\n if (!/^(~|\\^|@.*?\\(\\))$/.test(x[i])) {\n p += /^[0-9*]+$/.test(x[i]) ? '[' + x[i] + ']' : \"['\" + x[i] + \"']\";\n }\n }\n\n return p;\n };\n /**\n * @param {string} pointer JSON Path\n * @returns {string} JSON Pointer\n */\n\n\n JSONPath.toPointer = function (pointer) {\n var x = pointer,\n n = x.length;\n var p = '';\n\n for (var i = 1; i < n; i++) {\n if (!/^(~|\\^|@.*?\\(\\))$/.test(x[i])) {\n p += '/' + x[i].toString().replace(/~/g, '~0').replace(/\\//g, '~1');\n }\n }\n\n return p;\n };\n /**\n * @param {string} expr Expression to convert\n * @returns {string[]}\n */\n\n\n JSONPath.toPathArray = function (expr) {\n var cache = JSONPath.cache;\n\n if (cache[expr]) {\n return cache[expr].concat();\n }\n\n var subx = [];\n var normalized = expr // Properties\n .replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\\(\\)/g, ';$&;') // Parenthetical evaluations (filtering and otherwise), directly\n // within brackets or single quotes\n .replace(/[['](\\??\\(.*?\\))[\\]']/g, function ($0, $1) {\n return '[#' + (subx.push($1) - 1) + ']';\n }) // Escape periods and tildes within properties\n .replace(/\\['([^'\\]]*)'\\]/g, function ($0, prop) {\n return \"['\" + prop.replace(/\\./g, '%@%').replace(/~/g, '%%@@%%') + \"']\";\n }) // Properties operator\n .replace(/~/g, ';~;') // Split by property boundaries\n .replace(/'?\\.'?(?![^[]*\\])|\\['?/g, ';') // Reinsert periods within properties\n .replace(/%@%/g, '.') // Reinsert tildes within properties\n .replace(/%%@@%%/g, '~') // Parent\n .replace(/(?:;)?(\\^+)(?:;)?/g, function ($0, ups) {\n return ';' + ups.split('').join(';') + ';';\n }) // Descendents\n .replace(/;;;|;;/g, ';..;') // Remove trailing\n .replace(/;$|'?\\]|'$/g, '');\n var exprList = normalized.split(';').map(function (exp) {\n var match = exp.match(/#(\\d+)/);\n return !match || !match[1] ? exp : subx[match[1]];\n });\n cache[expr] = exprList;\n return cache[expr];\n };\n\n exports.JSONPath = JSONPath;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n","/*\n * lib/jsprim.js: utilities for primitive JavaScript types\n */\n\nvar mod_assert = require('assert-plus');\nvar mod_util = require('util');\n\nvar mod_extsprintf = require('extsprintf');\nvar mod_verror = require('verror');\nvar mod_jsonschema = require('json-schema');\n\n/*\n * Public interface\n */\nexports.deepCopy = deepCopy;\nexports.deepEqual = deepEqual;\nexports.isEmpty = isEmpty;\nexports.hasKey = hasKey;\nexports.forEachKey = forEachKey;\nexports.pluck = pluck;\nexports.flattenObject = flattenObject;\nexports.flattenIter = flattenIter;\nexports.validateJsonObject = validateJsonObjectJS;\nexports.validateJsonObjectJS = validateJsonObjectJS;\nexports.randElt = randElt;\nexports.extraProperties = extraProperties;\nexports.mergeObjects = mergeObjects;\n\nexports.startsWith = startsWith;\nexports.endsWith = endsWith;\n\nexports.parseInteger = parseInteger;\n\nexports.iso8601 = iso8601;\nexports.rfc1123 = rfc1123;\nexports.parseDateTime = parseDateTime;\n\nexports.hrtimediff = hrtimeDiff;\nexports.hrtimeDiff = hrtimeDiff;\nexports.hrtimeAccum = hrtimeAccum;\nexports.hrtimeAdd = hrtimeAdd;\nexports.hrtimeNanosec = hrtimeNanosec;\nexports.hrtimeMicrosec = hrtimeMicrosec;\nexports.hrtimeMillisec = hrtimeMillisec;\n\n\n/*\n * Deep copy an acyclic *basic* Javascript object. This only handles basic\n * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects\n * containing these. This does *not* handle instances of other classes.\n */\nfunction deepCopy(obj)\n{\n\tvar ret, key;\n\tvar marker = '__deepCopy';\n\n\tif (obj && obj[marker])\n\t\tthrow (new Error('attempted deep copy of cyclic object'));\n\n\tif (obj && obj.constructor == Object) {\n\t\tret = {};\n\t\tobj[marker] = true;\n\n\t\tfor (key in obj) {\n\t\t\tif (key == marker)\n\t\t\t\tcontinue;\n\n\t\t\tret[key] = deepCopy(obj[key]);\n\t\t}\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\tif (obj && obj.constructor == Array) {\n\t\tret = [];\n\t\tobj[marker] = true;\n\n\t\tfor (key = 0; key < obj.length; key++)\n\t\t\tret.push(deepCopy(obj[key]));\n\n\t\tdelete (obj[marker]);\n\t\treturn (ret);\n\t}\n\n\t/*\n\t * It must be a primitive type -- just return it.\n\t */\n\treturn (obj);\n}\n\nfunction deepEqual(obj1, obj2)\n{\n\tif (typeof (obj1) != typeof (obj2))\n\t\treturn (false);\n\n\tif (obj1 === null || obj2 === null || typeof (obj1) != 'object')\n\t\treturn (obj1 === obj2);\n\n\tif (obj1.constructor != obj2.constructor)\n\t\treturn (false);\n\n\tvar k;\n\tfor (k in obj1) {\n\t\tif (!obj2.hasOwnProperty(k))\n\t\t\treturn (false);\n\n\t\tif (!deepEqual(obj1[k], obj2[k]))\n\t\t\treturn (false);\n\t}\n\n\tfor (k in obj2) {\n\t\tif (!obj1.hasOwnProperty(k))\n\t\t\treturn (false);\n\t}\n\n\treturn (true);\n}\n\nfunction isEmpty(obj)\n{\n\tvar key;\n\tfor (key in obj)\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction hasKey(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (Object.prototype.hasOwnProperty.call(obj, key));\n}\n\nfunction forEachKey(obj, callback)\n{\n\tfor (var key in obj) {\n\t\tif (hasKey(obj, key)) {\n\t\t\tcallback(key, obj[key]);\n\t\t}\n\t}\n}\n\nfunction pluck(obj, key)\n{\n\tmod_assert.equal(typeof (key), 'string');\n\treturn (pluckv(obj, key));\n}\n\nfunction pluckv(obj, key)\n{\n\tif (obj === null || typeof (obj) !== 'object')\n\t\treturn (undefined);\n\n\tif (obj.hasOwnProperty(key))\n\t\treturn (obj[key]);\n\n\tvar i = key.indexOf('.');\n\tif (i == -1)\n\t\treturn (undefined);\n\n\tvar key1 = key.substr(0, i);\n\tif (!obj.hasOwnProperty(key1))\n\t\treturn (undefined);\n\n\treturn (pluckv(obj[key1], key.substr(i + 1)));\n}\n\n/*\n * Invoke callback(row) for each entry in the array that would be returned by\n * flattenObject(data, depth). This is just like flattenObject(data,\n * depth).forEach(callback), except that the intermediate array is never\n * created.\n */\nfunction flattenIter(data, depth, callback)\n{\n\tdoFlattenIter(data, depth, [], callback);\n}\n\nfunction doFlattenIter(data, depth, accum, callback)\n{\n\tvar each;\n\tvar key;\n\n\tif (depth === 0) {\n\t\teach = accum.slice(0);\n\t\teach.push(data);\n\t\tcallback(each);\n\t\treturn;\n\t}\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tfor (key in data) {\n\t\teach = accum.slice(0);\n\t\teach.push(key);\n\t\tdoFlattenIter(data[key], depth - 1, each, callback);\n\t}\n}\n\nfunction flattenObject(data, depth)\n{\n\tif (depth === 0)\n\t\treturn ([ data ]);\n\n\tmod_assert.ok(data !== null);\n\tmod_assert.equal(typeof (data), 'object');\n\tmod_assert.equal(typeof (depth), 'number');\n\tmod_assert.ok(depth >= 0);\n\n\tvar rv = [];\n\tvar key;\n\n\tfor (key in data) {\n\t\tflattenObject(data[key], depth - 1).forEach(function (p) {\n\t\t\trv.push([ key ].concat(p));\n\t\t});\n\t}\n\n\treturn (rv);\n}\n\nfunction startsWith(str, prefix)\n{\n\treturn (str.substr(0, prefix.length) == prefix);\n}\n\nfunction endsWith(str, suffix)\n{\n\treturn (str.substr(\n\t str.length - suffix.length, suffix.length) == suffix);\n}\n\nfunction iso8601(d)\n{\n\tif (typeof (d) == 'number')\n\t\td = new Date(d);\n\tmod_assert.ok(d.constructor === Date);\n\treturn (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ',\n\t d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),\n\t d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),\n\t d.getUTCMilliseconds()));\n}\n\nvar RFC1123_MONTHS = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nvar RFC1123_DAYS = [\n 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\nfunction rfc1123(date) {\n\treturn (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',\n\t RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(),\n\t RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(),\n\t date.getUTCHours(), date.getUTCMinutes(),\n\t date.getUTCSeconds()));\n}\n\n/*\n * Parses a date expressed as a string, as either a number of milliseconds since\n * the epoch or any string format that Date accepts, giving preference to the\n * former where these two sets overlap (e.g., small numbers).\n */\nfunction parseDateTime(str)\n{\n\t/*\n\t * This is irritatingly implicit, but significantly more concise than\n\t * alternatives. The \"+str\" will convert a string containing only a\n\t * number directly to a Number, or NaN for other strings. Thus, if the\n\t * conversion succeeds, we use it (this is the milliseconds-since-epoch\n\t * case). Otherwise, we pass the string directly to the Date\n\t * constructor to parse.\n\t */\n\tvar numeric = +str;\n\tif (!isNaN(numeric)) {\n\t\treturn (new Date(numeric));\n\t} else {\n\t\treturn (new Date(str));\n\t}\n}\n\n\n/*\n * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode\n * the ES6 definitions here, while allowing for them to someday be higher.\n */\nvar MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;\nvar MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;\n\n\n/*\n * Default options for parseInteger().\n */\nvar PI_DEFAULTS = {\n\tbase: 10,\n\tallowSign: true,\n\tallowPrefix: false,\n\tallowTrailing: false,\n\tallowImprecise: false,\n\ttrimWhitespace: false,\n\tleadingZeroIsOctal: false\n};\n\nvar CP_0 = 0x30;\nvar CP_9 = 0x39;\n\nvar CP_A = 0x41;\nvar CP_B = 0x42;\nvar CP_O = 0x4f;\nvar CP_T = 0x54;\nvar CP_X = 0x58;\nvar CP_Z = 0x5a;\n\nvar CP_a = 0x61;\nvar CP_b = 0x62;\nvar CP_o = 0x6f;\nvar CP_t = 0x74;\nvar CP_x = 0x78;\nvar CP_z = 0x7a;\n\nvar PI_CONV_DEC = 0x30;\nvar PI_CONV_UC = 0x37;\nvar PI_CONV_LC = 0x57;\n\n\n/*\n * A stricter version of parseInt() that provides options for changing what\n * is an acceptable string (for example, disallowing trailing characters).\n */\nfunction parseInteger(str, uopts)\n{\n\tmod_assert.string(str, 'str');\n\tmod_assert.optionalObject(uopts, 'options');\n\n\tvar baseOverride = false;\n\tvar options = PI_DEFAULTS;\n\n\tif (uopts) {\n\t\tbaseOverride = hasKey(uopts, 'base');\n\t\toptions = mergeObjects(options, uopts);\n\t\tmod_assert.number(options.base, 'options.base');\n\t\tmod_assert.ok(options.base >= 2, 'options.base >= 2');\n\t\tmod_assert.ok(options.base <= 36, 'options.base <= 36');\n\t\tmod_assert.bool(options.allowSign, 'options.allowSign');\n\t\tmod_assert.bool(options.allowPrefix, 'options.allowPrefix');\n\t\tmod_assert.bool(options.allowTrailing,\n\t\t 'options.allowTrailing');\n\t\tmod_assert.bool(options.allowImprecise,\n\t\t 'options.allowImprecise');\n\t\tmod_assert.bool(options.trimWhitespace,\n\t\t 'options.trimWhitespace');\n\t\tmod_assert.bool(options.leadingZeroIsOctal,\n\t\t 'options.leadingZeroIsOctal');\n\n\t\tif (options.leadingZeroIsOctal) {\n\t\t\tmod_assert.ok(!baseOverride,\n\t\t\t '\"base\" and \"leadingZeroIsOctal\" are ' +\n\t\t\t 'mutually exclusive');\n\t\t}\n\t}\n\n\tvar c;\n\tvar pbase = -1;\n\tvar base = options.base;\n\tvar start;\n\tvar mult = 1;\n\tvar value = 0;\n\tvar idx = 0;\n\tvar len = str.length;\n\n\t/* Trim any whitespace on the left side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check the number for a leading sign. */\n\tif (options.allowSign) {\n\t\tif (str[idx] === '-') {\n\t\t\tidx += 1;\n\t\t\tmult = -1;\n\t\t} else if (str[idx] === '+') {\n\t\t\tidx += 1;\n\t\t}\n\t}\n\n\t/* Parse the base-indicating prefix if there is one. */\n\tif (str[idx] === '0') {\n\t\tif (options.allowPrefix) {\n\t\t\tpbase = prefixToBase(str.charCodeAt(idx + 1));\n\t\t\tif (pbase !== -1 && (!baseOverride || pbase === base)) {\n\t\t\t\tbase = pbase;\n\t\t\t\tidx += 2;\n\t\t\t}\n\t\t}\n\n\t\tif (pbase === -1 && options.leadingZeroIsOctal) {\n\t\t\tbase = 8;\n\t\t}\n\t}\n\n\t/* Parse the actual digits. */\n\tfor (start = idx; idx < len; ++idx) {\n\t\tc = translateDigit(str.charCodeAt(idx));\n\t\tif (c !== -1 && c < base) {\n\t\t\tvalue *= base;\n\t\t\tvalue += c;\n\t\t} else {\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t/* If we didn't parse any digits, we have an invalid number. */\n\tif (start === idx) {\n\t\treturn (new Error('invalid number: ' + JSON.stringify(str)));\n\t}\n\n\t/* Trim any whitespace on the right side. */\n\tif (options.trimWhitespace) {\n\t\twhile (idx < len && isSpace(str.charCodeAt(idx))) {\n\t\t\t++idx;\n\t\t}\n\t}\n\n\t/* Check for trailing characters. */\n\tif (idx < len && !options.allowTrailing) {\n\t\treturn (new Error('trailing characters after number: ' +\n\t\t JSON.stringify(str.slice(idx))));\n\t}\n\n\t/* If our value is 0, we return now, to avoid returning -0. */\n\tif (value === 0) {\n\t\treturn (0);\n\t}\n\n\t/* Calculate our final value. */\n\tvar result = value * mult;\n\n\t/*\n\t * If the string represents a value that cannot be precisely represented\n\t * by JavaScript, then we want to check that:\n\t *\n\t * - We never increased the value past MAX_SAFE_INTEGER\n\t * - We don't make the result negative and below MIN_SAFE_INTEGER\n\t *\n\t * Because we only ever increment the value during parsing, there's no\n\t * chance of moving past MAX_SAFE_INTEGER and then dropping below it\n\t * again, losing precision in the process. This means that we only need\n\t * to do our checks here, at the end.\n\t */\n\tif (!options.allowImprecise &&\n\t (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {\n\t\treturn (new Error('number is outside of the supported range: ' +\n\t\t JSON.stringify(str.slice(start, idx))));\n\t}\n\n\treturn (result);\n}\n\n\n/*\n * Interpret a character code as a base-36 digit.\n */\nfunction translateDigit(d)\n{\n\tif (d >= CP_0 && d <= CP_9) {\n\t\t/* '0' to '9' -> 0 to 9 */\n\t\treturn (d - PI_CONV_DEC);\n\t} else if (d >= CP_A && d <= CP_Z) {\n\t\t/* 'A' - 'Z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_UC);\n\t} else if (d >= CP_a && d <= CP_z) {\n\t\t/* 'a' - 'z' -> 10 to 35 */\n\t\treturn (d - PI_CONV_LC);\n\t} else {\n\t\t/* Invalid character code */\n\t\treturn (-1);\n\t}\n}\n\n\n/*\n * Test if a value matches the ECMAScript definition of trimmable whitespace.\n */\nfunction isSpace(c)\n{\n\treturn (c === 0x20) ||\n\t (c >= 0x0009 && c <= 0x000d) ||\n\t (c === 0x00a0) ||\n\t (c === 0x1680) ||\n\t (c === 0x180e) ||\n\t (c >= 0x2000 && c <= 0x200a) ||\n\t (c === 0x2028) ||\n\t (c === 0x2029) ||\n\t (c === 0x202f) ||\n\t (c === 0x205f) ||\n\t (c === 0x3000) ||\n\t (c === 0xfeff);\n}\n\n\n/*\n * Determine which base a character indicates (e.g., 'x' indicates hex).\n */\nfunction prefixToBase(c)\n{\n\tif (c === CP_b || c === CP_B) {\n\t\t/* 0b/0B (binary) */\n\t\treturn (2);\n\t} else if (c === CP_o || c === CP_O) {\n\t\t/* 0o/0O (octal) */\n\t\treturn (8);\n\t} else if (c === CP_t || c === CP_T) {\n\t\t/* 0t/0T (decimal) */\n\t\treturn (10);\n\t} else if (c === CP_x || c === CP_X) {\n\t\t/* 0x/0X (hexadecimal) */\n\t\treturn (16);\n\t} else {\n\t\t/* Not a meaningful character */\n\t\treturn (-1);\n\t}\n}\n\n\nfunction validateJsonObjectJS(schema, input)\n{\n\tvar report = mod_jsonschema.validate(input, schema);\n\n\tif (report.errors.length === 0)\n\t\treturn (null);\n\n\t/* Currently, we only do anything useful with the first error. */\n\tvar error = report.errors[0];\n\n\t/* The failed property is given by a URI with an irrelevant prefix. */\n\tvar propname = error['property'];\n\tvar reason = error['message'].toLowerCase();\n\tvar i, j;\n\n\t/*\n\t * There's at least one case where the property error message is\n\t * confusing at best. We work around this here.\n\t */\n\tif ((i = reason.indexOf('the property ')) != -1 &&\n\t (j = reason.indexOf(' is not defined in the schema and the ' +\n\t 'schema does not allow additional properties')) != -1) {\n\t\ti += 'the property '.length;\n\t\tif (propname === '')\n\t\t\tpropname = reason.substr(i, j - i);\n\t\telse\n\t\t\tpropname = propname + '.' + reason.substr(i, j - i);\n\n\t\treason = 'unsupported property';\n\t}\n\n\tvar rv = new mod_verror.VError('property \"%s\": %s', propname, reason);\n\trv.jsv_details = error;\n\treturn (rv);\n}\n\nfunction randElt(arr)\n{\n\tmod_assert.ok(Array.isArray(arr) && arr.length > 0,\n\t 'randElt argument must be a non-empty array');\n\n\treturn (arr[Math.floor(Math.random() * arr.length)]);\n}\n\nfunction assertHrtime(a)\n{\n\tmod_assert.ok(a[0] >= 0 && a[1] >= 0,\n\t 'negative numbers not allowed in hrtimes');\n\tmod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow');\n}\n\n/*\n * Compute the time elapsed between hrtime readings A and B, where A is later\n * than B. hrtime readings come from Node's process.hrtime(). There is no\n * defined way to represent negative deltas, so it's illegal to diff B from A\n * where the time denoted by B is later than the time denoted by A. If this\n * becomes valuable, we can define a representation and extend the\n * implementation to support it.\n */\nfunction hrtimeDiff(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\tmod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]),\n\t 'negative differences not allowed');\n\n\tvar rv = [ a[0] - b[0], 0 ];\n\n\tif (a[1] >= b[1]) {\n\t\trv[1] = a[1] - b[1];\n\t} else {\n\t\trv[0]--;\n\t\trv[1] = 1e9 - (b[1] - a[1]);\n\t}\n\n\treturn (rv);\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of nanoseconds.\n */\nfunction hrtimeNanosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e9 + a[1]));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of microseconds.\n */\nfunction hrtimeMicrosec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e6 + a[1] / 1e3));\n}\n\n/*\n * Convert a hrtime reading from the array format returned by Node's\n * process.hrtime() into a scalar number of milliseconds.\n */\nfunction hrtimeMillisec(a)\n{\n\tassertHrtime(a);\n\n\treturn (Math.floor(a[0] * 1e3 + a[1] / 1e6));\n}\n\n/*\n * Add two hrtime readings A and B, overwriting A with the result of the\n * addition. This function is useful for accumulating several hrtime intervals\n * into a counter. Returns A.\n */\nfunction hrtimeAccum(a, b)\n{\n\tassertHrtime(a);\n\tassertHrtime(b);\n\n\t/*\n\t * Accumulate the nanosecond component.\n\t */\n\ta[1] += b[1];\n\tif (a[1] >= 1e9) {\n\t\t/*\n\t\t * The nanosecond component overflowed, so carry to the seconds\n\t\t * field.\n\t\t */\n\t\ta[0]++;\n\t\ta[1] -= 1e9;\n\t}\n\n\t/*\n\t * Accumulate the seconds component.\n\t */\n\ta[0] += b[0];\n\n\treturn (a);\n}\n\n/*\n * Add two hrtime readings A and B, returning the result as a new hrtime array.\n * Does not modify either input argument.\n */\nfunction hrtimeAdd(a, b)\n{\n\tassertHrtime(a);\n\n\tvar rv = [ a[0], a[1] ];\n\n\treturn (hrtimeAccum(rv, b));\n}\n\n\n/*\n * Check an object for unexpected properties. Accepts the object to check, and\n * an array of allowed property names (strings). Returns an array of key names\n * that were found on the object, but did not appear in the list of allowed\n * properties. If no properties were found, the returned array will be of\n * zero length.\n */\nfunction extraProperties(obj, allowed)\n{\n\tmod_assert.ok(typeof (obj) === 'object' && obj !== null,\n\t 'obj argument must be a non-null object');\n\tmod_assert.ok(Array.isArray(allowed),\n\t 'allowed argument must be an array of strings');\n\tfor (var i = 0; i < allowed.length; i++) {\n\t\tmod_assert.ok(typeof (allowed[i]) === 'string',\n\t\t 'allowed argument must be an array of strings');\n\t}\n\n\treturn (Object.keys(obj).filter(function (key) {\n\t\treturn (allowed.indexOf(key) === -1);\n\t}));\n}\n\n/*\n * Given three sets of properties \"provided\" (may be undefined), \"overrides\"\n * (required), and \"defaults\" (may be undefined), construct an object containing\n * the union of these sets with \"overrides\" overriding \"provided\", and\n * \"provided\" overriding \"defaults\". None of the input objects are modified.\n */\nfunction mergeObjects(provided, overrides, defaults)\n{\n\tvar rv, k;\n\n\trv = {};\n\tif (defaults) {\n\t\tfor (k in defaults)\n\t\t\trv[k] = defaults[k];\n\t}\n\n\tif (provided) {\n\t\tfor (k in provided)\n\t\t\trv[k] = provided[k];\n\t}\n\n\tif (overrides) {\n\t\tfor (k in overrides)\n\t\t\trv[k] = overrides[k];\n\t}\n\n\treturn (rv);\n}\n","'use strict';\nmodule.exports = object => {\n\tconst result = {};\n\n\tfor (const [key, value] of Object.entries(object)) {\n\t\tresult[key.toLowerCase()] = value;\n\t}\n\n\treturn result;\n};\n","'use strict'\n\n// A linked list to keep track of recently-used-ness\nconst Yallist = require('yallist')\n\nconst MAX = Symbol('max')\nconst LENGTH = Symbol('length')\nconst LENGTH_CALCULATOR = Symbol('lengthCalculator')\nconst ALLOW_STALE = Symbol('allowStale')\nconst MAX_AGE = Symbol('maxAge')\nconst DISPOSE = Symbol('dispose')\nconst NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet')\nconst LRU_LIST = Symbol('lruList')\nconst CACHE = Symbol('cache')\nconst UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet')\n\nconst naiveLength = () => 1\n\n// lruList is a yallist where the head is the youngest\n// item, and the tail is the oldest. the list contains the Hit\n// objects as the entries.\n// Each Hit object has a reference to its Yallist.Node. This\n// never changes.\n//\n// cache is a Map (or PseudoMap) that matches the keys to\n// the Yallist.Node object.\nclass LRUCache {\n constructor (options) {\n if (typeof options === 'number')\n options = { max: options }\n\n if (!options)\n options = {}\n\n if (options.max && (typeof options.max !== 'number' || options.max < 0))\n throw new TypeError('max must be a non-negative number')\n // Kind of weird to have a default max of Infinity, but oh well.\n const max = this[MAX] = options.max || Infinity\n\n const lc = options.length || naiveLength\n this[LENGTH_CALCULATOR] = (typeof lc !== 'function') ? naiveLength : lc\n this[ALLOW_STALE] = options.stale || false\n if (options.maxAge && typeof options.maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n this[MAX_AGE] = options.maxAge || 0\n this[DISPOSE] = options.dispose\n this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false\n this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false\n this.reset()\n }\n\n // resize the cache when the max changes.\n set max (mL) {\n if (typeof mL !== 'number' || mL < 0)\n throw new TypeError('max must be a non-negative number')\n\n this[MAX] = mL || Infinity\n trim(this)\n }\n get max () {\n return this[MAX]\n }\n\n set allowStale (allowStale) {\n this[ALLOW_STALE] = !!allowStale\n }\n get allowStale () {\n return this[ALLOW_STALE]\n }\n\n set maxAge (mA) {\n if (typeof mA !== 'number')\n throw new TypeError('maxAge must be a non-negative number')\n\n this[MAX_AGE] = mA\n trim(this)\n }\n get maxAge () {\n return this[MAX_AGE]\n }\n\n // resize the cache when the lengthCalculator changes.\n set lengthCalculator (lC) {\n if (typeof lC !== 'function')\n lC = naiveLength\n\n if (lC !== this[LENGTH_CALCULATOR]) {\n this[LENGTH_CALCULATOR] = lC\n this[LENGTH] = 0\n this[LRU_LIST].forEach(hit => {\n hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key)\n this[LENGTH] += hit.length\n })\n }\n trim(this)\n }\n get lengthCalculator () { return this[LENGTH_CALCULATOR] }\n\n get length () { return this[LENGTH] }\n get itemCount () { return this[LRU_LIST].length }\n\n rforEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].tail; walker !== null;) {\n const prev = walker.prev\n forEachStep(this, fn, walker, thisp)\n walker = prev\n }\n }\n\n forEach (fn, thisp) {\n thisp = thisp || this\n for (let walker = this[LRU_LIST].head; walker !== null;) {\n const next = walker.next\n forEachStep(this, fn, walker, thisp)\n walker = next\n }\n }\n\n keys () {\n return this[LRU_LIST].toArray().map(k => k.key)\n }\n\n values () {\n return this[LRU_LIST].toArray().map(k => k.value)\n }\n\n reset () {\n if (this[DISPOSE] &&\n this[LRU_LIST] &&\n this[LRU_LIST].length) {\n this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value))\n }\n\n this[CACHE] = new Map() // hash of items by key\n this[LRU_LIST] = new Yallist() // list of items in order of use recency\n this[LENGTH] = 0 // length of items in the list\n }\n\n dump () {\n return this[LRU_LIST].map(hit =>\n isStale(this, hit) ? false : {\n k: hit.key,\n v: hit.value,\n e: hit.now + (hit.maxAge || 0)\n }).toArray().filter(h => h)\n }\n\n dumpLru () {\n return this[LRU_LIST]\n }\n\n set (key, value, maxAge) {\n maxAge = maxAge || this[MAX_AGE]\n\n if (maxAge && typeof maxAge !== 'number')\n throw new TypeError('maxAge must be a number')\n\n const now = maxAge ? Date.now() : 0\n const len = this[LENGTH_CALCULATOR](value, key)\n\n if (this[CACHE].has(key)) {\n if (len > this[MAX]) {\n del(this, this[CACHE].get(key))\n return false\n }\n\n const node = this[CACHE].get(key)\n const item = node.value\n\n // dispose of the old one before overwriting\n // split out into 2 ifs for better coverage tracking\n if (this[DISPOSE]) {\n if (!this[NO_DISPOSE_ON_SET])\n this[DISPOSE](key, item.value)\n }\n\n item.now = now\n item.maxAge = maxAge\n item.value = value\n this[LENGTH] += len - item.length\n item.length = len\n this.get(key)\n trim(this)\n return true\n }\n\n const hit = new Entry(key, value, len, now, maxAge)\n\n // oversized objects fall out of cache automatically.\n if (hit.length > this[MAX]) {\n if (this[DISPOSE])\n this[DISPOSE](key, value)\n\n return false\n }\n\n this[LENGTH] += hit.length\n this[LRU_LIST].unshift(hit)\n this[CACHE].set(key, this[LRU_LIST].head)\n trim(this)\n return true\n }\n\n has (key) {\n if (!this[CACHE].has(key)) return false\n const hit = this[CACHE].get(key).value\n return !isStale(this, hit)\n }\n\n get (key) {\n return get(this, key, true)\n }\n\n peek (key) {\n return get(this, key, false)\n }\n\n pop () {\n const node = this[LRU_LIST].tail\n if (!node)\n return null\n\n del(this, node)\n return node.value\n }\n\n del (key) {\n del(this, this[CACHE].get(key))\n }\n\n load (arr) {\n // reset the cache\n this.reset()\n\n const now = Date.now()\n // A previous serialized cache has the most recent items first\n for (let l = arr.length - 1; l >= 0; l--) {\n const hit = arr[l]\n const expiresAt = hit.e || 0\n if (expiresAt === 0)\n // the item was created without expiration in a non aged cache\n this.set(hit.k, hit.v)\n else {\n const maxAge = expiresAt - now\n // dont add already expired items\n if (maxAge > 0) {\n this.set(hit.k, hit.v, maxAge)\n }\n }\n }\n }\n\n prune () {\n this[CACHE].forEach((value, key) => get(this, key, false))\n }\n}\n\nconst get = (self, key, doUse) => {\n const node = self[CACHE].get(key)\n if (node) {\n const hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n return undefined\n } else {\n if (doUse) {\n if (self[UPDATE_AGE_ON_GET])\n node.value.now = Date.now()\n self[LRU_LIST].unshiftNode(node)\n }\n }\n return hit.value\n }\n}\n\nconst isStale = (self, hit) => {\n if (!hit || (!hit.maxAge && !self[MAX_AGE]))\n return false\n\n const diff = Date.now() - hit.now\n return hit.maxAge ? diff > hit.maxAge\n : self[MAX_AGE] && (diff > self[MAX_AGE])\n}\n\nconst trim = self => {\n if (self[LENGTH] > self[MAX]) {\n for (let walker = self[LRU_LIST].tail;\n self[LENGTH] > self[MAX] && walker !== null;) {\n // We know that we're about to delete this one, and also\n // what the next least recently used key will be, so just\n // go ahead and set it now.\n const prev = walker.prev\n del(self, walker)\n walker = prev\n }\n }\n}\n\nconst del = (self, node) => {\n if (node) {\n const hit = node.value\n if (self[DISPOSE])\n self[DISPOSE](hit.key, hit.value)\n\n self[LENGTH] -= hit.length\n self[CACHE].delete(hit.key)\n self[LRU_LIST].removeNode(node)\n }\n}\n\nclass Entry {\n constructor (key, value, length, now, maxAge) {\n this.key = key\n this.value = value\n this.length = length\n this.now = now\n this.maxAge = maxAge || 0\n }\n}\n\nconst forEachStep = (self, fn, node, thisp) => {\n let hit = node.value\n if (isStale(self, hit)) {\n del(self, node)\n if (!self[ALLOW_STALE])\n hit = undefined\n }\n if (hit)\n fn.call(thisp, hit.value, hit.key, self)\n}\n\nmodule.exports = LRUCache\n","// ISC @ Julien Fontanet\n\n\"use strict\";\n\n// ===================================================================\n\nvar construct = typeof Reflect !== \"undefined\" ? Reflect.construct : undefined;\nvar defineProperty = Object.defineProperty;\n\n// -------------------------------------------------------------------\n\nvar captureStackTrace = Error.captureStackTrace;\nif (captureStackTrace === undefined) {\n captureStackTrace = function captureStackTrace(error) {\n var container = new Error();\n\n defineProperty(error, \"stack\", {\n configurable: true,\n get: function getStack() {\n var stack = container.stack;\n\n // Replace property with value for faster future accesses.\n defineProperty(this, \"stack\", {\n configurable: true,\n value: stack,\n writable: true,\n });\n\n return stack;\n },\n set: function setStack(stack) {\n defineProperty(error, \"stack\", {\n configurable: true,\n value: stack,\n writable: true,\n });\n },\n });\n };\n}\n\n// -------------------------------------------------------------------\n\nfunction BaseError(message) {\n if (message !== undefined) {\n defineProperty(this, \"message\", {\n configurable: true,\n value: message,\n writable: true,\n });\n }\n\n var cname = this.constructor.name;\n if (cname !== undefined && cname !== this.name) {\n defineProperty(this, \"name\", {\n configurable: true,\n value: cname,\n writable: true,\n });\n }\n\n captureStackTrace(this, this.constructor);\n}\n\nBaseError.prototype = Object.create(Error.prototype, {\n // See: https://github.com/JsCommunity/make-error/issues/4\n constructor: {\n configurable: true,\n value: BaseError,\n writable: true,\n },\n});\n\n// -------------------------------------------------------------------\n\n// Sets the name of a function if possible (depends of the JS engine).\nvar setFunctionName = (function() {\n function setFunctionName(fn, name) {\n return defineProperty(fn, \"name\", {\n configurable: true,\n value: name,\n });\n }\n try {\n var f = function() {};\n setFunctionName(f, \"foo\");\n if (f.name === \"foo\") {\n return setFunctionName;\n }\n } catch (_) {}\n})();\n\n// -------------------------------------------------------------------\n\nfunction makeError(constructor, super_) {\n if (super_ == null || super_ === Error) {\n super_ = BaseError;\n } else if (typeof super_ !== \"function\") {\n throw new TypeError(\"super_ should be a function\");\n }\n\n var name;\n if (typeof constructor === \"string\") {\n name = constructor;\n constructor =\n construct !== undefined\n ? function() {\n return construct(super_, arguments, this.constructor);\n }\n : function() {\n super_.apply(this, arguments);\n };\n\n // If the name can be set, do it once and for all.\n if (setFunctionName !== undefined) {\n setFunctionName(constructor, name);\n name = undefined;\n }\n } else if (typeof constructor !== \"function\") {\n throw new TypeError(\"constructor should be either a string or a function\");\n }\n\n // Also register the super constructor also as `constructor.super_` just\n // like Node's `util.inherits()`.\n //\n // eslint-disable-next-line dot-notation\n constructor.super_ = constructor[\"super\"] = super_;\n\n var properties = {\n constructor: {\n configurable: true,\n value: constructor,\n writable: true,\n },\n };\n\n // If the name could not be set on the constructor, set it on the\n // prototype.\n if (name !== undefined) {\n properties.name = {\n configurable: true,\n value: name,\n writable: true,\n };\n }\n constructor.prototype = Object.create(super_.prototype, properties);\n\n return constructor;\n}\nexports = module.exports = makeError;\nexports.BaseError = BaseError;\n","'use strict';\n\nconst { PassThrough } = require('stream');\n\nmodule.exports = function (/*streams...*/) {\n var sources = []\n var output = new PassThrough({objectMode: true})\n\n output.setMaxListeners(0)\n\n output.add = add\n output.isEmpty = isEmpty\n\n output.on('unpipe', remove)\n\n Array.prototype.slice.call(arguments).forEach(add)\n\n return output\n\n function add (source) {\n if (Array.isArray(source)) {\n source.forEach(add)\n return this\n }\n\n sources.push(source);\n source.once('end', remove.bind(null, source))\n source.once('error', output.emit.bind(output, 'error'))\n source.pipe(output, {end: false})\n return this\n }\n\n function isEmpty () {\n return sources.length == 0;\n }\n\n function remove (source) {\n sources = sources.filter(function (it) { return it !== source })\n if (!sources.length && output.readable) { output.end() }\n }\n}\n","/*!\n * mime-db\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015-2022 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n/**\n * Module exports.\n */\n\nmodule.exports = require('./db.json')\n","/*!\n * mime-types\n * Copyright(c) 2014 Jonathan Ong\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict'\n\n/**\n * Module dependencies.\n * @private\n */\n\nvar db = require('mime-db')\nvar extname = require('path').extname\n\n/**\n * Module variables.\n * @private\n */\n\nvar EXTRACT_TYPE_REGEXP = /^\\s*([^;\\s]*)(?:;|\\s|$)/\nvar TEXT_TYPE_REGEXP = /^text\\//i\n\n/**\n * Module exports.\n * @public\n */\n\nexports.charset = charset\nexports.charsets = { lookup: charset }\nexports.contentType = contentType\nexports.extension = extension\nexports.extensions = Object.create(null)\nexports.lookup = lookup\nexports.types = Object.create(null)\n\n// Populate the extensions/types maps\npopulateMaps(exports.extensions, exports.types)\n\n/**\n * Get the default charset for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction charset (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n var mime = match && db[match[1].toLowerCase()]\n\n if (mime && mime.charset) {\n return mime.charset\n }\n\n // default text/* to utf-8\n if (match && TEXT_TYPE_REGEXP.test(match[1])) {\n return 'UTF-8'\n }\n\n return false\n}\n\n/**\n * Create a full Content-Type header given a MIME type or extension.\n *\n * @param {string} str\n * @return {boolean|string}\n */\n\nfunction contentType (str) {\n // TODO: should this even be in this module?\n if (!str || typeof str !== 'string') {\n return false\n }\n\n var mime = str.indexOf('/') === -1\n ? exports.lookup(str)\n : str\n\n if (!mime) {\n return false\n }\n\n // TODO: use content-type or other module\n if (mime.indexOf('charset') === -1) {\n var charset = exports.charset(mime)\n if (charset) mime += '; charset=' + charset.toLowerCase()\n }\n\n return mime\n}\n\n/**\n * Get the default extension for a MIME type.\n *\n * @param {string} type\n * @return {boolean|string}\n */\n\nfunction extension (type) {\n if (!type || typeof type !== 'string') {\n return false\n }\n\n // TODO: use media-typer\n var match = EXTRACT_TYPE_REGEXP.exec(type)\n\n // get extensions\n var exts = match && exports.extensions[match[1].toLowerCase()]\n\n if (!exts || !exts.length) {\n return false\n }\n\n return exts[0]\n}\n\n/**\n * Lookup the MIME type for a file path/extension.\n *\n * @param {string} path\n * @return {boolean|string}\n */\n\nfunction lookup (path) {\n if (!path || typeof path !== 'string') {\n return false\n }\n\n // get the extension (\"ext\" or \".ext\" or full path)\n var extension = extname('x.' + path)\n .toLowerCase()\n .substr(1)\n\n if (!extension) {\n return false\n }\n\n return exports.types[extension] || false\n}\n\n/**\n * Populate the extensions and types maps.\n * @private\n */\n\nfunction populateMaps (extensions, types) {\n // source preference (least -> most)\n var preference = ['nginx', 'apache', undefined, 'iana']\n\n Object.keys(db).forEach(function forEachMimeType (type) {\n var mime = db[type]\n var exts = mime.extensions\n\n if (!exts || !exts.length) {\n return\n }\n\n // mime -> extensions\n extensions[type] = exts\n\n // extension -> mime\n for (var i = 0; i < exts.length; i++) {\n var extension = exts[i]\n\n if (types[extension]) {\n var from = preference.indexOf(db[types[extension]].source)\n var to = preference.indexOf(mime.source)\n\n if (types[extension] !== 'application/octet-stream' &&\n (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {\n // skip the remapping\n continue\n }\n }\n\n // set the extension -> mime\n types[extension] = type\n }\n })\n}\n","'use strict';\n\nconst mimicFn = (to, from) => {\n\tfor (const prop of Reflect.ownKeys(from)) {\n\t\tObject.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));\n\t}\n\n\treturn to;\n};\n\nmodule.exports = mimicFn;\n// TODO: Remove this for the next major release\nmodule.exports.default = mimicFn;\n","'use strict';\n\n// We define these manually to ensure they're always copied\n// even if they would move up the prototype chain\n// https://nodejs.org/api/http.html#http_class_http_incomingmessage\nconst knownProps = [\n\t'destroy',\n\t'setTimeout',\n\t'socket',\n\t'headers',\n\t'trailers',\n\t'rawHeaders',\n\t'statusCode',\n\t'httpVersion',\n\t'httpVersionMinor',\n\t'httpVersionMajor',\n\t'rawTrailers',\n\t'statusMessage'\n];\n\nmodule.exports = (fromStream, toStream) => {\n\tconst fromProps = new Set(Object.keys(fromStream).concat(knownProps));\n\n\tfor (const prop of fromProps) {\n\t\t// Don't overwrite existing properties\n\t\tif (prop in toStream) {\n\t\t\tcontinue;\n\t\t}\n\n\t\ttoStream[prop] = typeof fromStream[prop] === 'function' ? fromStream[prop].bind(fromStream) : fromStream[prop];\n\t}\n};\n","module.exports = minimatch\nminimatch.Minimatch = Minimatch\n\nvar path = (function () { try { return require('path') } catch (e) {}}()) || {\n sep: '/'\n}\nminimatch.sep = path.sep\n\nvar GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}\nvar expand = require('brace-expansion')\n\nvar plTypes = {\n '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},\n '?': { open: '(?:', close: ')?' },\n '+': { open: '(?:', close: ')+' },\n '*': { open: '(?:', close: ')*' },\n '@': { open: '(?:', close: ')' }\n}\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nvar qmark = '[^/]'\n\n// * => any number of characters\nvar star = qmark + '*?'\n\n// ** when dots are allowed. Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nvar twoStarDot = '(?:(?!(?:\\\\\\/|^)(?:\\\\.{1,2})($|\\\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nvar twoStarNoDot = '(?:(?!(?:\\\\\\/|^)\\\\.).)*?'\n\n// characters that need to be escaped in RegExp.\nvar reSpecials = charSet('().*{}+?[]^$\\\\!')\n\n// \"abc\" -> { a:true, b:true, c:true }\nfunction charSet (s) {\n return s.split('').reduce(function (set, c) {\n set[c] = true\n return set\n }, {})\n}\n\n// normalizes slashes.\nvar slashSplit = /\\/+/\n\nminimatch.filter = filter\nfunction filter (pattern, options) {\n options = options || {}\n return function (p, i, list) {\n return minimatch(p, pattern, options)\n }\n}\n\nfunction ext (a, b) {\n b = b || {}\n var t = {}\n Object.keys(a).forEach(function (k) {\n t[k] = a[k]\n })\n Object.keys(b).forEach(function (k) {\n t[k] = b[k]\n })\n return t\n}\n\nminimatch.defaults = function (def) {\n if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n return minimatch\n }\n\n var orig = minimatch\n\n var m = function minimatch (p, pattern, options) {\n return orig(p, pattern, ext(def, options))\n }\n\n m.Minimatch = function Minimatch (pattern, options) {\n return new orig.Minimatch(pattern, ext(def, options))\n }\n m.Minimatch.defaults = function defaults (options) {\n return orig.defaults(ext(def, options)).Minimatch\n }\n\n m.filter = function filter (pattern, options) {\n return orig.filter(pattern, ext(def, options))\n }\n\n m.defaults = function defaults (options) {\n return orig.defaults(ext(def, options))\n }\n\n m.makeRe = function makeRe (pattern, options) {\n return orig.makeRe(pattern, ext(def, options))\n }\n\n m.braceExpand = function braceExpand (pattern, options) {\n return orig.braceExpand(pattern, ext(def, options))\n }\n\n m.match = function (list, pattern, options) {\n return orig.match(list, pattern, ext(def, options))\n }\n\n return m\n}\n\nMinimatch.defaults = function (def) {\n return minimatch.defaults(def).Minimatch\n}\n\nfunction minimatch (p, pattern, options) {\n assertValidPattern(pattern)\n\n if (!options) options = {}\n\n // shortcut: comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n return false\n }\n\n return new Minimatch(pattern, options).match(p)\n}\n\nfunction Minimatch (pattern, options) {\n if (!(this instanceof Minimatch)) {\n return new Minimatch(pattern, options)\n }\n\n assertValidPattern(pattern)\n\n if (!options) options = {}\n\n pattern = pattern.trim()\n\n // windows support: need to use /, not \\\n if (!options.allowWindowsEscape && path.sep !== '/') {\n pattern = pattern.split(path.sep).join('/')\n }\n\n this.options = options\n this.set = []\n this.pattern = pattern\n this.regexp = null\n this.negate = false\n this.comment = false\n this.empty = false\n this.partial = !!options.partial\n\n // make the set of regexps etc.\n this.make()\n}\n\nMinimatch.prototype.debug = function () {}\n\nMinimatch.prototype.make = make\nfunction make () {\n var pattern = this.pattern\n var options = this.options\n\n // empty patterns and comments match nothing.\n if (!options.nocomment && pattern.charAt(0) === '#') {\n this.comment = true\n return\n }\n if (!pattern) {\n this.empty = true\n return\n }\n\n // step 1: figure out negation, etc.\n this.parseNegate()\n\n // step 2: expand braces\n var set = this.globSet = this.braceExpand()\n\n if (options.debug) this.debug = function debug() { console.error.apply(console, arguments) }\n\n this.debug(this.pattern, set)\n\n // step 3: now we have a set, so turn each one into a series of path-portion\n // matching patterns.\n // These will be regexps, except in the case of \"**\", which is\n // set to the GLOBSTAR object for globstar behavior,\n // and will not contain any / characters\n set = this.globParts = set.map(function (s) {\n return s.split(slashSplit)\n })\n\n this.debug(this.pattern, set)\n\n // glob --> regexps\n set = set.map(function (s, si, set) {\n return s.map(this.parse, this)\n }, this)\n\n this.debug(this.pattern, set)\n\n // filter out everything that didn't compile properly.\n set = set.filter(function (s) {\n return s.indexOf(false) === -1\n })\n\n this.debug(this.pattern, set)\n\n this.set = set\n}\n\nMinimatch.prototype.parseNegate = parseNegate\nfunction parseNegate () {\n var pattern = this.pattern\n var negate = false\n var options = this.options\n var negateOffset = 0\n\n if (options.nonegate) return\n\n for (var i = 0, l = pattern.length\n ; i < l && pattern.charAt(i) === '!'\n ; i++) {\n negate = !negate\n negateOffset++\n }\n\n if (negateOffset) this.pattern = pattern.substr(negateOffset)\n this.negate = negate\n}\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nminimatch.braceExpand = function (pattern, options) {\n return braceExpand(pattern, options)\n}\n\nMinimatch.prototype.braceExpand = braceExpand\n\nfunction braceExpand (pattern, options) {\n if (!options) {\n if (this instanceof Minimatch) {\n options = this.options\n } else {\n options = {}\n }\n }\n\n pattern = typeof pattern === 'undefined'\n ? this.pattern : pattern\n\n assertValidPattern(pattern)\n\n // Thanks to Yeting Li for\n // improving this regexp to avoid a ReDOS vulnerability.\n if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n // shortcut. no need to expand.\n return [pattern]\n }\n\n return expand(pattern)\n}\n\nvar MAX_PATTERN_LENGTH = 1024 * 64\nvar assertValidPattern = function (pattern) {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion. Otherwise, any series\n// of * is equivalent to a single *. Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\nMinimatch.prototype.parse = parse\nvar SUBPARSE = {}\nfunction parse (pattern, isSub) {\n assertValidPattern(pattern)\n\n var options = this.options\n\n // shortcuts\n if (pattern === '**') {\n if (!options.noglobstar)\n return GLOBSTAR\n else\n pattern = '*'\n }\n if (pattern === '') return ''\n\n var re = ''\n var hasMagic = !!options.nocase\n var escaping = false\n // ? => one single character\n var patternListStack = []\n var negativeLists = []\n var stateChar\n var inClass = false\n var reClassStart = -1\n var classStart = -1\n // . and .. never match anything that doesn't start with .,\n // even when options.dot is set.\n var patternStart = pattern.charAt(0) === '.' ? '' // anything\n // not (start or / followed by . or .. followed by / or end)\n : options.dot ? '(?!(?:^|\\\\\\/)\\\\.{1,2}(?:$|\\\\\\/))'\n : '(?!\\\\.)'\n var self = this\n\n function clearStateChar () {\n if (stateChar) {\n // we had some state-tracking character\n // that wasn't consumed by this pass.\n switch (stateChar) {\n case '*':\n re += star\n hasMagic = true\n break\n case '?':\n re += qmark\n hasMagic = true\n break\n default:\n re += '\\\\' + stateChar\n break\n }\n self.debug('clearStateChar %j %j', stateChar, re)\n stateChar = false\n }\n }\n\n for (var i = 0, len = pattern.length, c\n ; (i < len) && (c = pattern.charAt(i))\n ; i++) {\n this.debug('%s\\t%s %s %j', pattern, i, re, c)\n\n // skip over any that are escaped.\n if (escaping && reSpecials[c]) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n switch (c) {\n /* istanbul ignore next */\n case '/': {\n // completely not allowed, even escaped.\n // Should already be path-split by now.\n return false\n }\n\n case '\\\\':\n clearStateChar()\n escaping = true\n continue\n\n // the various stateChar values\n // for the \"extglob\" stuff.\n case '?':\n case '*':\n case '+':\n case '@':\n case '!':\n this.debug('%s\\t%s %s %j <-- stateChar', pattern, i, re, c)\n\n // all of those are literals inside a class, except that\n // the glob [!a] means [^a] in regexp\n if (inClass) {\n this.debug(' in class')\n if (c === '!' && i === classStart + 1) c = '^'\n re += c\n continue\n }\n\n // if we already have a stateChar, then it means\n // that there was something like ** or +? in there.\n // Handle the stateChar, then proceed with this one.\n self.debug('call clearStateChar %j', stateChar)\n clearStateChar()\n stateChar = c\n // if extglob is disabled, then +(asdf|foo) isn't a thing.\n // just clear the statechar *now*, rather than even diving into\n // the patternList stuff.\n if (options.noext) clearStateChar()\n continue\n\n case '(':\n if (inClass) {\n re += '('\n continue\n }\n\n if (!stateChar) {\n re += '\\\\('\n continue\n }\n\n patternListStack.push({\n type: stateChar,\n start: i - 1,\n reStart: re.length,\n open: plTypes[stateChar].open,\n close: plTypes[stateChar].close\n })\n // negation is (?:(?!js)[^/]*)\n re += stateChar === '!' ? '(?:(?!(?:' : '(?:'\n this.debug('plType %j %j', stateChar, re)\n stateChar = false\n continue\n\n case ')':\n if (inClass || !patternListStack.length) {\n re += '\\\\)'\n continue\n }\n\n clearStateChar()\n hasMagic = true\n var pl = patternListStack.pop()\n // negation is (?:(?!js)[^/]*)\n // The others are (?:)\n re += pl.close\n if (pl.type === '!') {\n negativeLists.push(pl)\n }\n pl.reEnd = re.length\n continue\n\n case '|':\n if (inClass || !patternListStack.length || escaping) {\n re += '\\\\|'\n escaping = false\n continue\n }\n\n clearStateChar()\n re += '|'\n continue\n\n // these are mostly the same in regexp and glob\n case '[':\n // swallow any state-tracking char before the [\n clearStateChar()\n\n if (inClass) {\n re += '\\\\' + c\n continue\n }\n\n inClass = true\n classStart = i\n reClassStart = re.length\n re += c\n continue\n\n case ']':\n // a right bracket shall lose its special\n // meaning and represent itself in\n // a bracket expression if it occurs\n // first in the list. -- POSIX.2 2.8.3.2\n if (i === classStart + 1 || !inClass) {\n re += '\\\\' + c\n escaping = false\n continue\n }\n\n // handle the case where we left a class open.\n // \"[z-a]\" is valid, equivalent to \"\\[z-a\\]\"\n // split where the last [ was, make sure we don't have\n // an invalid re. if so, re-walk the contents of the\n // would-be class to re-translate any characters that\n // were passed through as-is\n // TODO: It would probably be faster to determine this\n // without a try/catch and a new RegExp, but it's tricky\n // to do safely. For now, this is safe and works.\n var cs = pattern.substring(classStart + 1, i)\n try {\n RegExp('[' + cs + ']')\n } catch (er) {\n // not a valid class!\n var sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0] + '\\\\]'\n hasMagic = hasMagic || sp[1]\n inClass = false\n continue\n }\n\n // finish up the class.\n hasMagic = true\n inClass = false\n re += c\n continue\n\n default:\n // swallow any state char that wasn't consumed\n clearStateChar()\n\n if (escaping) {\n // no need\n escaping = false\n } else if (reSpecials[c]\n && !(c === '^' && inClass)) {\n re += '\\\\'\n }\n\n re += c\n\n } // switch\n } // for\n\n // handle the case where we left a class open.\n // \"[abc\" is valid, equivalent to \"\\[abc\"\n if (inClass) {\n // split where the last [ was, and escape it\n // this is a huge pita. We now have to re-walk\n // the contents of the would-be class to re-translate\n // any characters that were passed through as-is\n cs = pattern.substr(classStart + 1)\n sp = this.parse(cs, SUBPARSE)\n re = re.substr(0, reClassStart) + '\\\\[' + sp[0]\n hasMagic = hasMagic || sp[1]\n }\n\n // handle the case where we had a +( thing at the *end*\n // of the pattern.\n // each pattern list stack adds 3 chars, and we need to go through\n // and escape any | chars that were passed through as-is for the regexp.\n // Go through and escape them, taking care not to double-escape any\n // | chars that were already escaped.\n for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {\n var tail = re.slice(pl.reStart + pl.open.length)\n this.debug('setting tail', re, pl)\n // maybe some even number of \\, then maybe 1 \\, followed by a |\n tail = tail.replace(/((?:\\\\{2}){0,64})(\\\\?)\\|/g, function (_, $1, $2) {\n if (!$2) {\n // the | isn't already escaped, so escape it.\n $2 = '\\\\'\n }\n\n // need to escape all those slashes *again*, without escaping the\n // one that we need for escaping the | character. As it works out,\n // escaping an even number of slashes can be done by simply repeating\n // it exactly after itself. That's why this trick works.\n //\n // I am sorry that you have to see this.\n return $1 + $1 + $2 + '|'\n })\n\n this.debug('tail=%j\\n %s', tail, tail, pl, re)\n var t = pl.type === '*' ? star\n : pl.type === '?' ? qmark\n : '\\\\' + pl.type\n\n hasMagic = true\n re = re.slice(0, pl.reStart) + t + '\\\\(' + tail\n }\n\n // handle trailing things that only matter at the very end.\n clearStateChar()\n if (escaping) {\n // trailing \\\\\n re += '\\\\\\\\'\n }\n\n // only need to apply the nodot start if the re starts with\n // something that could conceivably capture a dot\n var addPatternStart = false\n switch (re.charAt(0)) {\n case '[': case '.': case '(': addPatternStart = true\n }\n\n // Hack to work around lack of negative lookbehind in JS\n // A pattern like: *.!(x).!(y|z) needs to ensure that a name\n // like 'a.xyz.yz' doesn't match. So, the first negative\n // lookahead, has to look ALL the way ahead, to the end of\n // the pattern.\n for (var n = negativeLists.length - 1; n > -1; n--) {\n var nl = negativeLists[n]\n\n var nlBefore = re.slice(0, nl.reStart)\n var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)\n var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)\n var nlAfter = re.slice(nl.reEnd)\n\n nlLast += nlAfter\n\n // Handle nested stuff like *(*.js|!(*.json)), where open parens\n // mean that we should *not* include the ) in the bit that is considered\n // \"after\" the negated section.\n var openParensBefore = nlBefore.split('(').length - 1\n var cleanAfter = nlAfter\n for (i = 0; i < openParensBefore; i++) {\n cleanAfter = cleanAfter.replace(/\\)[+*?]?/, '')\n }\n nlAfter = cleanAfter\n\n var dollar = ''\n if (nlAfter === '' && isSub !== SUBPARSE) {\n dollar = '$'\n }\n var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast\n re = newRe\n }\n\n // if the re is not \"\" at this point, then we need to make sure\n // it doesn't match against an empty path part.\n // Otherwise a/* will match a/, which it should not.\n if (re !== '' && hasMagic) {\n re = '(?=.)' + re\n }\n\n if (addPatternStart) {\n re = patternStart + re\n }\n\n // parsing just a piece of a larger pattern.\n if (isSub === SUBPARSE) {\n return [re, hasMagic]\n }\n\n // skip the regexp for non-magical patterns\n // unescape anything in it, though, so that it'll be\n // an exact match against a file etc.\n if (!hasMagic) {\n return globUnescape(pattern)\n }\n\n var flags = options.nocase ? 'i' : ''\n try {\n var regExp = new RegExp('^' + re + '$', flags)\n } catch (er) /* istanbul ignore next - should be impossible */ {\n // If it was an invalid regular expression, then it can't match\n // anything. This trick looks for a character after the end of\n // the string, which is of course impossible, except in multi-line\n // mode, but it's not a /m regex.\n return new RegExp('$.')\n }\n\n regExp._glob = pattern\n regExp._src = re\n\n return regExp\n}\n\nminimatch.makeRe = function (pattern, options) {\n return new Minimatch(pattern, options || {}).makeRe()\n}\n\nMinimatch.prototype.makeRe = makeRe\nfunction makeRe () {\n if (this.regexp || this.regexp === false) return this.regexp\n\n // at this point, this.set is a 2d array of partial\n // pattern strings, or \"**\".\n //\n // It's better to use .match(). This function shouldn't\n // be used, really, but it's pretty convenient sometimes,\n // when you just want to work with a regex.\n var set = this.set\n\n if (!set.length) {\n this.regexp = false\n return this.regexp\n }\n var options = this.options\n\n var twoStar = options.noglobstar ? star\n : options.dot ? twoStarDot\n : twoStarNoDot\n var flags = options.nocase ? 'i' : ''\n\n var re = set.map(function (pattern) {\n return pattern.map(function (p) {\n return (p === GLOBSTAR) ? twoStar\n : (typeof p === 'string') ? regExpEscape(p)\n : p._src\n }).join('\\\\\\/')\n }).join('|')\n\n // must match entire pattern\n // ending in a * or ** will make it less strict.\n re = '^(?:' + re + ')$'\n\n // can match anything, as long as it's not this.\n if (this.negate) re = '^(?!' + re + ').*$'\n\n try {\n this.regexp = new RegExp(re, flags)\n } catch (ex) /* istanbul ignore next - should be impossible */ {\n this.regexp = false\n }\n return this.regexp\n}\n\nminimatch.match = function (list, pattern, options) {\n options = options || {}\n var mm = new Minimatch(pattern, options)\n list = list.filter(function (f) {\n return mm.match(f)\n })\n if (mm.options.nonull && !list.length) {\n list.push(pattern)\n }\n return list\n}\n\nMinimatch.prototype.match = function match (f, partial) {\n if (typeof partial === 'undefined') partial = this.partial\n this.debug('match', f, this.pattern)\n // short-circuit in the case of busted things.\n // comments, etc.\n if (this.comment) return false\n if (this.empty) return f === ''\n\n if (f === '/' && partial) return true\n\n var options = this.options\n\n // windows: need to use /, not \\\n if (path.sep !== '/') {\n f = f.split(path.sep).join('/')\n }\n\n // treat the test path as a set of pathparts.\n f = f.split(slashSplit)\n this.debug(this.pattern, 'split', f)\n\n // just ONE of the pattern sets in this.set needs to match\n // in order for it to be valid. If negating, then just one\n // match means that we have failed.\n // Either way, return on the first hit.\n\n var set = this.set\n this.debug(this.pattern, 'set', set)\n\n // Find the basename of the path by looking for the last non-empty segment\n var filename\n var i\n for (i = f.length - 1; i >= 0; i--) {\n filename = f[i]\n if (filename) break\n }\n\n for (i = 0; i < set.length; i++) {\n var pattern = set[i]\n var file = f\n if (options.matchBase && pattern.length === 1) {\n file = [filename]\n }\n var hit = this.matchOne(file, pattern, partial)\n if (hit) {\n if (options.flipNegate) return true\n return !this.negate\n }\n }\n\n // didn't get any hits. this is success if it's a negative\n // pattern, failure otherwise.\n if (options.flipNegate) return false\n return this.negate\n}\n\n// set partial to true to test if, for example,\n// \"/a/b\" matches the start of \"/*/b/*/d\"\n// Partial means, if you run out of file before you run\n// out of pattern, then that's fine, as long as all\n// the parts match.\nMinimatch.prototype.matchOne = function (file, pattern, partial) {\n var options = this.options\n\n this.debug('matchOne',\n { 'this': this, file: file, pattern: pattern })\n\n this.debug('matchOne', file.length, pattern.length)\n\n for (var fi = 0,\n pi = 0,\n fl = file.length,\n pl = pattern.length\n ; (fi < fl) && (pi < pl)\n ; fi++, pi++) {\n this.debug('matchOne loop')\n var p = pattern[pi]\n var f = file[fi]\n\n this.debug(pattern, p, f)\n\n // should be impossible.\n // some invalid regexp stuff in the set.\n /* istanbul ignore if */\n if (p === false) return false\n\n if (p === GLOBSTAR) {\n this.debug('GLOBSTAR', [pattern, p, f])\n\n // \"**\"\n // a/**/b/**/c would match the following:\n // a/b/x/y/z/c\n // a/x/y/z/b/c\n // a/b/x/b/x/c\n // a/b/c\n // To do this, take the rest of the pattern after\n // the **, and see if it would match the file remainder.\n // If so, return success.\n // If not, the ** \"swallows\" a segment, and try again.\n // This is recursively awful.\n //\n // a/**/b/**/c matching a/b/x/y/z/c\n // - a matches a\n // - doublestar\n // - matchOne(b/x/y/z/c, b/**/c)\n // - b matches b\n // - doublestar\n // - matchOne(x/y/z/c, c) -> no\n // - matchOne(y/z/c, c) -> no\n // - matchOne(z/c, c) -> no\n // - matchOne(c, c) yes, hit\n var fr = fi\n var pr = pi + 1\n if (pr === pl) {\n this.debug('** at the end')\n // a ** at the end will just swallow the rest.\n // We have found a match.\n // however, it will not swallow /.x, unless\n // options.dot is set.\n // . and .. are *never* matched by **, for explosively\n // exponential reasons.\n for (; fi < fl; fi++) {\n if (file[fi] === '.' || file[fi] === '..' ||\n (!options.dot && file[fi].charAt(0) === '.')) return false\n }\n return true\n }\n\n // ok, let's see if we can swallow whatever we can.\n while (fr < fl) {\n var swallowee = file[fr]\n\n this.debug('\\nglobstar while', file, fr, pattern, pr, swallowee)\n\n // XXX remove this slice. Just pass the start index.\n if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {\n this.debug('globstar found match!', fr, fl, swallowee)\n // found a match.\n return true\n } else {\n // can't swallow \".\" or \"..\" ever.\n // can only swallow \".foo\" when explicitly asked.\n if (swallowee === '.' || swallowee === '..' ||\n (!options.dot && swallowee.charAt(0) === '.')) {\n this.debug('dot detected!', file, fr, pattern, pr)\n break\n }\n\n // ** swallows a segment, and continue.\n this.debug('globstar swallow a segment, and continue')\n fr++\n }\n }\n\n // no match was found.\n // However, in partial mode, we can't say this is necessarily over.\n // If there's more *pattern* left, then\n /* istanbul ignore if */\n if (partial) {\n // ran out of file\n this.debug('\\n>>> no match, partial?', file, fr, pattern, pr)\n if (fr === fl) return true\n }\n return false\n }\n\n // something other than **\n // non-magic patterns just have to match exactly\n // patterns with magic have been turned into regexps.\n var hit\n if (typeof p === 'string') {\n hit = f === p\n this.debug('string match', p, f, hit)\n } else {\n hit = f.match(p)\n this.debug('pattern match', p, f, hit)\n }\n\n if (!hit) return false\n }\n\n // Note: ending in / means that we'll get a final \"\"\n // at the end of the pattern. This can only match a\n // corresponding \"\" at the end of the file.\n // If the file ends in /, then it can only match a\n // a pattern that ends in /, unless the pattern just\n // doesn't have any more for it. But, a/b/ should *not*\n // match \"a/b/*\", even though \"\" matches against the\n // [^/]*? pattern, except in partial mode, where it might\n // simply not be reached yet.\n // However, a/b/ should still satisfy a/*\n\n // now either we fell off the end of the pattern, or we're done.\n if (fi === fl && pi === pl) {\n // ran out of pattern and filename at the same time.\n // an exact hit!\n return true\n } else if (fi === fl) {\n // ran out of file, but still had pattern left.\n // this is ok if we're doing the match as part of\n // a glob fs traversal.\n return partial\n } else /* istanbul ignore else */ if (pi === pl) {\n // ran out of pattern, still have file left.\n // this is only acceptable if we're on the very last\n // empty segment of a file with a trailing slash.\n // a/* should match a/b/\n return (fi === fl - 1) && (file[fi] === '')\n }\n\n // should be unreachable.\n /* istanbul ignore next */\n throw new Error('wtf?')\n}\n\n// replace stuff like \\* with *\nfunction globUnescape (s) {\n return s.replace(/\\\\(.)/g, '$1')\n}\n\nfunction regExpEscape (s) {\n return s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n}\n","'use strict'\nconst proc = typeof process === 'object' && process ? process : {\n stdout: null,\n stderr: null,\n}\nconst EE = require('events')\nconst Stream = require('stream')\nconst SD = require('string_decoder').StringDecoder\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\nconst DESTROYED = Symbol('destroyed')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\n\nconst defer = fn => Promise.resolve().then(fn)\n\n// TODO remove when Node v8 support drops\nconst doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1'\nconst ASYNCITERATOR = doIter && Symbol.asyncIterator\n || Symbol('asyncIterator not implemented')\nconst ITERATOR = doIter && Symbol.iterator\n || Symbol('iterator not implemented')\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\nconst isEndish = ev =>\n ev === 'end' ||\n ev === 'finish' ||\n ev === 'prefinish'\n\nconst isArrayBuffer = b => b instanceof ArrayBuffer ||\n typeof b === 'object' &&\n b.constructor &&\n b.constructor.name === 'ArrayBuffer' &&\n b.byteLength >= 0\n\nconst isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\nclass Pipe {\n constructor (src, dest, opts) {\n this.src = src\n this.dest = dest\n this.opts = opts\n this.ondrain = () => src[RESUME]()\n dest.on('drain', this.ondrain)\n }\n unpipe () {\n this.dest.removeListener('drain', this.ondrain)\n }\n // istanbul ignore next - only here for the prototype\n proxyErrors () {}\n end () {\n this.unpipe()\n if (this.opts.end)\n this.dest.end()\n }\n}\n\nclass PipeProxyErrors extends Pipe {\n unpipe () {\n this.src.removeListener('error', this.proxyErrors)\n super.unpipe()\n }\n constructor (src, dest, opts) {\n super(src, dest, opts)\n this.proxyErrors = er => dest.emit('error', er)\n src.on('error', this.proxyErrors)\n }\n}\n\nmodule.exports = class Minipass extends Stream {\n constructor (options) {\n super()\n this[FLOWING] = false\n // whether we're explicitly paused\n this[PAUSED] = false\n this.pipes = []\n this.buffer = []\n this[OBJECTMODE] = options && options.objectMode || false\n if (this[OBJECTMODE])\n this[ENCODING] = null\n else\n this[ENCODING] = options && options.encoding || null\n if (this[ENCODING] === 'buffer')\n this[ENCODING] = null\n this[ASYNC] = options && !!options.async || false\n this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null\n this[EOF] = false\n this[EMITTED_END] = false\n this[EMITTING_END] = false\n this[CLOSED] = false\n this[EMITTED_ERROR] = null\n this.writable = true\n this.readable = true\n this[BUFFERLENGTH] = 0\n this[DESTROYED] = false\n }\n\n get bufferLength () { return this[BUFFERLENGTH] }\n\n get encoding () { return this[ENCODING] }\n set encoding (enc) {\n if (this[OBJECTMODE])\n throw new Error('cannot set encoding in objectMode')\n\n if (this[ENCODING] && enc !== this[ENCODING] &&\n (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH]))\n throw new Error('cannot change encoding')\n\n if (this[ENCODING] !== enc) {\n this[DECODER] = enc ? new SD(enc) : null\n if (this.buffer.length)\n this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk))\n }\n\n this[ENCODING] = enc\n }\n\n setEncoding (enc) {\n this.encoding = enc\n }\n\n get objectMode () { return this[OBJECTMODE] }\n set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om }\n\n get ['async'] () { return this[ASYNC] }\n set ['async'] (a) { this[ASYNC] = this[ASYNC] || !!a }\n\n write (chunk, encoding, cb) {\n if (this[EOF])\n throw new Error('write after end')\n\n if (this[DESTROYED]) {\n this.emit('error', Object.assign(\n new Error('Cannot call write after a stream was destroyed'),\n { code: 'ERR_STREAM_DESTROYED' }\n ))\n return true\n }\n\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n\n if (!encoding)\n encoding = 'utf8'\n\n const fn = this[ASYNC] ? defer : f => f()\n\n // convert array buffers and typed array views into buffers\n // at some point in the future, we may want to do the opposite!\n // leave strings and buffers as-is\n // anything else switches us into object mode\n if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n if (isArrayBufferView(chunk))\n chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n else if (isArrayBuffer(chunk))\n chunk = Buffer.from(chunk)\n else if (typeof chunk !== 'string')\n // use the setter so we throw if we have encoding set\n this.objectMode = true\n }\n\n // handle object mode up front, since it's simpler\n // this yields better performance, fewer checks later.\n if (this[OBJECTMODE]) {\n /* istanbul ignore if - maybe impossible? */\n if (this.flowing && this[BUFFERLENGTH] !== 0)\n this[FLUSH](true)\n\n if (this.flowing)\n this.emit('data', chunk)\n else\n this[BUFFERPUSH](chunk)\n\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable')\n\n if (cb)\n fn(cb)\n\n return this.flowing\n }\n\n // at this point the chunk is a buffer or string\n // don't buffer it up or send it to the decoder\n if (!chunk.length) {\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable')\n if (cb)\n fn(cb)\n return this.flowing\n }\n\n // fast-path writing strings of same encoding to a stream with\n // an empty buffer, skipping the buffer/decoder dance\n if (typeof chunk === 'string' &&\n // unless it is a string already ready for us to use\n !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) {\n chunk = Buffer.from(chunk, encoding)\n }\n\n if (Buffer.isBuffer(chunk) && this[ENCODING])\n chunk = this[DECODER].write(chunk)\n\n // Note: flushing CAN potentially switch us into not-flowing mode\n if (this.flowing && this[BUFFERLENGTH] !== 0)\n this[FLUSH](true)\n\n if (this.flowing)\n this.emit('data', chunk)\n else\n this[BUFFERPUSH](chunk)\n\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable')\n\n if (cb)\n fn(cb)\n\n return this.flowing\n }\n\n read (n) {\n if (this[DESTROYED])\n return null\n\n if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) {\n this[MAYBE_EMIT_END]()\n return null\n }\n\n if (this[OBJECTMODE])\n n = null\n\n if (this.buffer.length > 1 && !this[OBJECTMODE]) {\n if (this.encoding)\n this.buffer = [this.buffer.join('')]\n else\n this.buffer = [Buffer.concat(this.buffer, this[BUFFERLENGTH])]\n }\n\n const ret = this[READ](n || null, this.buffer[0])\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [READ] (n, chunk) {\n if (n === chunk.length || n === null)\n this[BUFFERSHIFT]()\n else {\n this.buffer[0] = chunk.slice(n)\n chunk = chunk.slice(0, n)\n this[BUFFERLENGTH] -= n\n }\n\n this.emit('data', chunk)\n\n if (!this.buffer.length && !this[EOF])\n this.emit('drain')\n\n return chunk\n }\n\n end (chunk, encoding, cb) {\n if (typeof chunk === 'function')\n cb = chunk, chunk = null\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n if (chunk)\n this.write(chunk, encoding)\n if (cb)\n this.once('end', cb)\n this[EOF] = true\n this.writable = false\n\n // if we haven't written anything, then go ahead and emit,\n // even if we're not reading.\n // we'll re-emit if a new 'end' listener is added anyway.\n // This makes MP more suitable to write-only use cases.\n if (this.flowing || !this[PAUSED])\n this[MAYBE_EMIT_END]()\n return this\n }\n\n // don't let the internal resume be overwritten\n [RESUME] () {\n if (this[DESTROYED])\n return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this.buffer.length)\n this[FLUSH]()\n else if (this[EOF])\n this[MAYBE_EMIT_END]()\n else\n this.emit('drain')\n }\n\n resume () {\n return this[RESUME]()\n }\n\n pause () {\n this[FLOWING] = false\n this[PAUSED] = true\n }\n\n get destroyed () {\n return this[DESTROYED]\n }\n\n get flowing () {\n return this[FLOWING]\n }\n\n get paused () {\n return this[PAUSED]\n }\n\n [BUFFERPUSH] (chunk) {\n if (this[OBJECTMODE])\n this[BUFFERLENGTH] += 1\n else\n this[BUFFERLENGTH] += chunk.length\n this.buffer.push(chunk)\n }\n\n [BUFFERSHIFT] () {\n if (this.buffer.length) {\n if (this[OBJECTMODE])\n this[BUFFERLENGTH] -= 1\n else\n this[BUFFERLENGTH] -= this.buffer[0].length\n }\n return this.buffer.shift()\n }\n\n [FLUSH] (noDrain) {\n do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()))\n\n if (!noDrain && !this.buffer.length && !this[EOF])\n this.emit('drain')\n }\n\n [FLUSHCHUNK] (chunk) {\n return chunk ? (this.emit('data', chunk), this.flowing) : false\n }\n\n pipe (dest, opts) {\n if (this[DESTROYED])\n return\n\n const ended = this[EMITTED_END]\n opts = opts || {}\n if (dest === proc.stdout || dest === proc.stderr)\n opts.end = false\n else\n opts.end = opts.end !== false\n opts.proxyErrors = !!opts.proxyErrors\n\n // piping an ended stream ends immediately\n if (ended) {\n if (opts.end)\n dest.end()\n } else {\n this.pipes.push(!opts.proxyErrors ? new Pipe(this, dest, opts)\n : new PipeProxyErrors(this, dest, opts))\n if (this[ASYNC])\n defer(() => this[RESUME]())\n else\n this[RESUME]()\n }\n\n return dest\n }\n\n unpipe (dest) {\n const p = this.pipes.find(p => p.dest === dest)\n if (p) {\n this.pipes.splice(this.pipes.indexOf(p), 1)\n p.unpipe()\n }\n }\n\n addListener (ev, fn) {\n return this.on(ev, fn)\n }\n\n on (ev, fn) {\n const ret = super.on(ev, fn)\n if (ev === 'data' && !this.pipes.length && !this.flowing)\n this[RESUME]()\n else if (ev === 'readable' && this[BUFFERLENGTH] !== 0)\n super.emit('readable')\n else if (isEndish(ev) && this[EMITTED_END]) {\n super.emit(ev)\n this.removeAllListeners(ev)\n } else if (ev === 'error' && this[EMITTED_ERROR]) {\n if (this[ASYNC])\n defer(() => fn.call(this, this[EMITTED_ERROR]))\n else\n fn.call(this, this[EMITTED_ERROR])\n }\n return ret\n }\n\n get emittedEnd () {\n return this[EMITTED_END]\n }\n\n [MAYBE_EMIT_END] () {\n if (!this[EMITTING_END] &&\n !this[EMITTED_END] &&\n !this[DESTROYED] &&\n this.buffer.length === 0 &&\n this[EOF]) {\n this[EMITTING_END] = true\n this.emit('end')\n this.emit('prefinish')\n this.emit('finish')\n if (this[CLOSED])\n this.emit('close')\n this[EMITTING_END] = false\n }\n }\n\n emit (ev, data, ...extra) {\n // error and close are only events allowed after calling destroy()\n if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED])\n return\n else if (ev === 'data') {\n return !data ? false\n : this[ASYNC] ? defer(() => this[EMITDATA](data))\n : this[EMITDATA](data)\n } else if (ev === 'end') {\n return this[EMITEND]()\n } else if (ev === 'close') {\n this[CLOSED] = true\n // don't emit close before 'end' and 'finish'\n if (!this[EMITTED_END] && !this[DESTROYED])\n return\n const ret = super.emit('close')\n this.removeAllListeners('close')\n return ret\n } else if (ev === 'error') {\n this[EMITTED_ERROR] = data\n const ret = super.emit('error', data)\n this[MAYBE_EMIT_END]()\n return ret\n } else if (ev === 'resume') {\n const ret = super.emit('resume')\n this[MAYBE_EMIT_END]()\n return ret\n } else if (ev === 'finish' || ev === 'prefinish') {\n const ret = super.emit(ev)\n this.removeAllListeners(ev)\n return ret\n }\n\n // Some other unknown event\n const ret = super.emit(ev, data, ...extra)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [EMITDATA] (data) {\n for (const p of this.pipes) {\n if (p.dest.write(data) === false)\n this.pause()\n }\n const ret = super.emit('data', data)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [EMITEND] () {\n if (this[EMITTED_END])\n return\n\n this[EMITTED_END] = true\n this.readable = false\n if (this[ASYNC])\n defer(() => this[EMITEND2]())\n else\n this[EMITEND2]()\n }\n\n [EMITEND2] () {\n if (this[DECODER]) {\n const data = this[DECODER].end()\n if (data) {\n for (const p of this.pipes) {\n p.dest.write(data)\n }\n super.emit('data', data)\n }\n }\n\n for (const p of this.pipes) {\n p.end()\n }\n const ret = super.emit('end')\n this.removeAllListeners('end')\n return ret\n }\n\n // const all = await stream.collect()\n collect () {\n const buf = []\n if (!this[OBJECTMODE])\n buf.dataLength = 0\n // set the promise first, in case an error is raised\n // by triggering the flow here.\n const p = this.promise()\n this.on('data', c => {\n buf.push(c)\n if (!this[OBJECTMODE])\n buf.dataLength += c.length\n })\n return p.then(() => buf)\n }\n\n // const data = await stream.concat()\n concat () {\n return this[OBJECTMODE]\n ? Promise.reject(new Error('cannot concat in objectMode'))\n : this.collect().then(buf =>\n this[OBJECTMODE]\n ? Promise.reject(new Error('cannot concat in objectMode'))\n : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength))\n }\n\n // stream.promise().then(() => done, er => emitted error)\n promise () {\n return new Promise((resolve, reject) => {\n this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n this.on('error', er => reject(er))\n this.on('end', () => resolve())\n })\n }\n\n // for await (let chunk of stream)\n [ASYNCITERATOR] () {\n const next = () => {\n const res = this.read()\n if (res !== null)\n return Promise.resolve({ done: false, value: res })\n\n if (this[EOF])\n return Promise.resolve({ done: true })\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return { next }\n }\n\n // for (let chunk of stream)\n [ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }\n\n destroy (er) {\n if (this[DESTROYED]) {\n if (er)\n this.emit('error', er)\n else\n this.emit(DESTROYED)\n return this\n }\n\n this[DESTROYED] = true\n\n // throw away all buffered data, it's never coming out\n this.buffer.length = 0\n this[BUFFERLENGTH] = 0\n\n if (typeof this.close === 'function' && !this[CLOSED])\n this.close()\n\n if (er)\n this.emit('error', er)\n else // if no error to emit, still reject pending promises\n this.emit(DESTROYED)\n\n return this\n }\n\n static isStream (s) {\n return !!s && (s instanceof Minipass || s instanceof Stream ||\n s instanceof EE && (\n typeof s.pipe === 'function' || // readable\n (typeof s.write === 'function' && typeof s.end === 'function') // writable\n ))\n }\n}\n","// Update with any zlib constants that are added or changed in the future.\n// Node v6 didn't export this, so we just hard code the version and rely\n// on all the other hard-coded values from zlib v4736. When node v6\n// support drops, we can just export the realZlibConstants object.\nconst realZlibConstants = require('zlib').constants ||\n /* istanbul ignore next */ { ZLIB_VERNUM: 4736 }\n\nmodule.exports = Object.freeze(Object.assign(Object.create(null), {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n Z_VERSION_ERROR: -6,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n DEFLATE: 1,\n INFLATE: 2,\n GZIP: 3,\n GUNZIP: 4,\n DEFLATERAW: 5,\n INFLATERAW: 6,\n UNZIP: 7,\n BROTLI_DECODE: 8,\n BROTLI_ENCODE: 9,\n Z_MIN_WINDOWBITS: 8,\n Z_MAX_WINDOWBITS: 15,\n Z_DEFAULT_WINDOWBITS: 15,\n Z_MIN_CHUNK: 64,\n Z_MAX_CHUNK: Infinity,\n Z_DEFAULT_CHUNK: 16384,\n Z_MIN_MEMLEVEL: 1,\n Z_MAX_MEMLEVEL: 9,\n Z_DEFAULT_MEMLEVEL: 8,\n Z_MIN_LEVEL: -1,\n Z_MAX_LEVEL: 9,\n Z_DEFAULT_LEVEL: -1,\n BROTLI_OPERATION_PROCESS: 0,\n BROTLI_OPERATION_FLUSH: 1,\n BROTLI_OPERATION_FINISH: 2,\n BROTLI_OPERATION_EMIT_METADATA: 3,\n BROTLI_MODE_GENERIC: 0,\n BROTLI_MODE_TEXT: 1,\n BROTLI_MODE_FONT: 2,\n BROTLI_DEFAULT_MODE: 0,\n BROTLI_MIN_QUALITY: 0,\n BROTLI_MAX_QUALITY: 11,\n BROTLI_DEFAULT_QUALITY: 11,\n BROTLI_MIN_WINDOW_BITS: 10,\n BROTLI_MAX_WINDOW_BITS: 24,\n BROTLI_LARGE_MAX_WINDOW_BITS: 30,\n BROTLI_DEFAULT_WINDOW: 22,\n BROTLI_MIN_INPUT_BLOCK_BITS: 16,\n BROTLI_MAX_INPUT_BLOCK_BITS: 24,\n BROTLI_PARAM_MODE: 0,\n BROTLI_PARAM_QUALITY: 1,\n BROTLI_PARAM_LGWIN: 2,\n BROTLI_PARAM_LGBLOCK: 3,\n BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4,\n BROTLI_PARAM_SIZE_HINT: 5,\n BROTLI_PARAM_LARGE_WINDOW: 6,\n BROTLI_PARAM_NPOSTFIX: 7,\n BROTLI_PARAM_NDIRECT: 8,\n BROTLI_DECODER_RESULT_ERROR: 0,\n BROTLI_DECODER_RESULT_SUCCESS: 1,\n BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2,\n BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3,\n BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0,\n BROTLI_DECODER_PARAM_LARGE_WINDOW: 1,\n BROTLI_DECODER_NO_ERROR: 0,\n BROTLI_DECODER_SUCCESS: 1,\n BROTLI_DECODER_NEEDS_MORE_INPUT: 2,\n BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3,\n BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1,\n BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2,\n BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3,\n BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4,\n BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5,\n BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6,\n BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7,\n BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8,\n BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9,\n BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10,\n BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11,\n BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12,\n BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13,\n BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14,\n BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15,\n BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16,\n BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19,\n BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20,\n BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21,\n BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22,\n BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25,\n BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26,\n BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27,\n BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30,\n BROTLI_DECODER_ERROR_UNREACHABLE: -31,\n}, realZlibConstants))\n","'use strict'\n\nconst assert = require('assert')\nconst Buffer = require('buffer').Buffer\nconst realZlib = require('zlib')\n\nconst constants = exports.constants = require('./constants.js')\nconst Minipass = require('minipass')\n\nconst OriginalBufferConcat = Buffer.concat\n\nconst _superWrite = Symbol('_superWrite')\nclass ZlibError extends Error {\n constructor (err) {\n super('zlib: ' + err.message)\n this.code = err.code\n this.errno = err.errno\n /* istanbul ignore if */\n if (!this.code)\n this.code = 'ZLIB_ERROR'\n\n this.message = 'zlib: ' + err.message\n Error.captureStackTrace(this, this.constructor)\n }\n\n get name () {\n return 'ZlibError'\n }\n}\n\n// the Zlib class they all inherit from\n// This thing manages the queue of requests, and returns\n// true or false if there is anything in the queue when\n// you call the .write() method.\nconst _opts = Symbol('opts')\nconst _flushFlag = Symbol('flushFlag')\nconst _finishFlushFlag = Symbol('finishFlushFlag')\nconst _fullFlushFlag = Symbol('fullFlushFlag')\nconst _handle = Symbol('handle')\nconst _onError = Symbol('onError')\nconst _sawError = Symbol('sawError')\nconst _level = Symbol('level')\nconst _strategy = Symbol('strategy')\nconst _ended = Symbol('ended')\nconst _defaultFullFlush = Symbol('_defaultFullFlush')\n\nclass ZlibBase extends Minipass {\n constructor (opts, mode) {\n if (!opts || typeof opts !== 'object')\n throw new TypeError('invalid options for ZlibBase constructor')\n\n super(opts)\n this[_sawError] = false\n this[_ended] = false\n this[_opts] = opts\n\n this[_flushFlag] = opts.flush\n this[_finishFlushFlag] = opts.finishFlush\n // this will throw if any options are invalid for the class selected\n try {\n this[_handle] = new realZlib[mode](opts)\n } catch (er) {\n // make sure that all errors get decorated properly\n throw new ZlibError(er)\n }\n\n this[_onError] = (err) => {\n // no sense raising multiple errors, since we abort on the first one.\n if (this[_sawError])\n return\n\n this[_sawError] = true\n\n // there is no way to cleanly recover.\n // continuing only obscures problems.\n this.close()\n this.emit('error', err)\n }\n\n this[_handle].on('error', er => this[_onError](new ZlibError(er)))\n this.once('end', () => this.close)\n }\n\n close () {\n if (this[_handle]) {\n this[_handle].close()\n this[_handle] = null\n this.emit('close')\n }\n }\n\n reset () {\n if (!this[_sawError]) {\n assert(this[_handle], 'zlib binding closed')\n return this[_handle].reset()\n }\n }\n\n flush (flushFlag) {\n if (this.ended)\n return\n\n if (typeof flushFlag !== 'number')\n flushFlag = this[_fullFlushFlag]\n this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag }))\n }\n\n end (chunk, encoding, cb) {\n if (chunk)\n this.write(chunk, encoding)\n this.flush(this[_finishFlushFlag])\n this[_ended] = true\n return super.end(null, null, cb)\n }\n\n get ended () {\n return this[_ended]\n }\n\n write (chunk, encoding, cb) {\n // process the chunk using the sync process\n // then super.write() all the outputted chunks\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n\n if (typeof chunk === 'string')\n chunk = Buffer.from(chunk, encoding)\n\n if (this[_sawError])\n return\n assert(this[_handle], 'zlib binding closed')\n\n // _processChunk tries to .close() the native handle after it's done, so we\n // intercept that by temporarily making it a no-op.\n const nativeHandle = this[_handle]._handle\n const originalNativeClose = nativeHandle.close\n nativeHandle.close = () => {}\n const originalClose = this[_handle].close\n this[_handle].close = () => {}\n // It also calls `Buffer.concat()` at the end, which may be convenient\n // for some, but which we are not interested in as it slows us down.\n Buffer.concat = (args) => args\n let result\n try {\n const flushFlag = typeof chunk[_flushFlag] === 'number'\n ? chunk[_flushFlag] : this[_flushFlag]\n result = this[_handle]._processChunk(chunk, flushFlag)\n // if we don't throw, reset it back how it was\n Buffer.concat = OriginalBufferConcat\n } catch (err) {\n // or if we do, put Buffer.concat() back before we emit error\n // Error events call into user code, which may call Buffer.concat()\n Buffer.concat = OriginalBufferConcat\n this[_onError](new ZlibError(err))\n } finally {\n if (this[_handle]) {\n // Core zlib resets `_handle` to null after attempting to close the\n // native handle. Our no-op handler prevented actual closure, but we\n // need to restore the `._handle` property.\n this[_handle]._handle = nativeHandle\n nativeHandle.close = originalNativeClose\n this[_handle].close = originalClose\n // `_processChunk()` adds an 'error' listener. If we don't remove it\n // after each call, these handlers start piling up.\n this[_handle].removeAllListeners('error')\n // make sure OUR error listener is still attached tho\n }\n }\n\n if (this[_handle])\n this[_handle].on('error', er => this[_onError](new ZlibError(er)))\n\n let writeReturn\n if (result) {\n if (Array.isArray(result) && result.length > 0) {\n // The first buffer is always `handle._outBuffer`, which would be\n // re-used for later invocations; so, we always have to copy that one.\n writeReturn = this[_superWrite](Buffer.from(result[0]))\n for (let i = 1; i < result.length; i++) {\n writeReturn = this[_superWrite](result[i])\n }\n } else {\n writeReturn = this[_superWrite](Buffer.from(result))\n }\n }\n\n if (cb)\n cb()\n return writeReturn\n }\n\n [_superWrite] (data) {\n return super.write(data)\n }\n}\n\nclass Zlib extends ZlibBase {\n constructor (opts, mode) {\n opts = opts || {}\n\n opts.flush = opts.flush || constants.Z_NO_FLUSH\n opts.finishFlush = opts.finishFlush || constants.Z_FINISH\n super(opts, mode)\n\n this[_fullFlushFlag] = constants.Z_FULL_FLUSH\n this[_level] = opts.level\n this[_strategy] = opts.strategy\n }\n\n params (level, strategy) {\n if (this[_sawError])\n return\n\n if (!this[_handle])\n throw new Error('cannot switch params when binding is closed')\n\n // no way to test this without also not supporting params at all\n /* istanbul ignore if */\n if (!this[_handle].params)\n throw new Error('not supported in this implementation')\n\n if (this[_level] !== level || this[_strategy] !== strategy) {\n this.flush(constants.Z_SYNC_FLUSH)\n assert(this[_handle], 'zlib binding closed')\n // .params() calls .flush(), but the latter is always async in the\n // core zlib. We override .flush() temporarily to intercept that and\n // flush synchronously.\n const origFlush = this[_handle].flush\n this[_handle].flush = (flushFlag, cb) => {\n this.flush(flushFlag)\n cb()\n }\n try {\n this[_handle].params(level, strategy)\n } finally {\n this[_handle].flush = origFlush\n }\n /* istanbul ignore else */\n if (this[_handle]) {\n this[_level] = level\n this[_strategy] = strategy\n }\n }\n }\n}\n\n// minimal 2-byte header\nclass Deflate extends Zlib {\n constructor (opts) {\n super(opts, 'Deflate')\n }\n}\n\nclass Inflate extends Zlib {\n constructor (opts) {\n super(opts, 'Inflate')\n }\n}\n\n// gzip - bigger header, same deflate compression\nconst _portable = Symbol('_portable')\nclass Gzip extends Zlib {\n constructor (opts) {\n super(opts, 'Gzip')\n this[_portable] = opts && !!opts.portable\n }\n\n [_superWrite] (data) {\n if (!this[_portable])\n return super[_superWrite](data)\n\n // we'll always get the header emitted in one first chunk\n // overwrite the OS indicator byte with 0xFF\n this[_portable] = false\n data[9] = 255\n return super[_superWrite](data)\n }\n}\n\nclass Gunzip extends Zlib {\n constructor (opts) {\n super(opts, 'Gunzip')\n }\n}\n\n// raw - no header\nclass DeflateRaw extends Zlib {\n constructor (opts) {\n super(opts, 'DeflateRaw')\n }\n}\n\nclass InflateRaw extends Zlib {\n constructor (opts) {\n super(opts, 'InflateRaw')\n }\n}\n\n// auto-detect header.\nclass Unzip extends Zlib {\n constructor (opts) {\n super(opts, 'Unzip')\n }\n}\n\nclass Brotli extends ZlibBase {\n constructor (opts, mode) {\n opts = opts || {}\n\n opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS\n opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH\n\n super(opts, mode)\n\n this[_fullFlushFlag] = constants.BROTLI_OPERATION_FLUSH\n }\n}\n\nclass BrotliCompress extends Brotli {\n constructor (opts) {\n super(opts, 'BrotliCompress')\n }\n}\n\nclass BrotliDecompress extends Brotli {\n constructor (opts) {\n super(opts, 'BrotliDecompress')\n }\n}\n\nexports.Deflate = Deflate\nexports.Inflate = Inflate\nexports.Gzip = Gzip\nexports.Gunzip = Gunzip\nexports.DeflateRaw = DeflateRaw\nexports.InflateRaw = InflateRaw\nexports.Unzip = Unzip\n/* istanbul ignore else */\nif (typeof realZlib.BrotliCompress === 'function') {\n exports.BrotliCompress = BrotliCompress\n exports.BrotliDecompress = BrotliDecompress\n} else {\n exports.BrotliCompress = exports.BrotliDecompress = class {\n constructor () {\n throw new Error('Brotli is not supported in this version of Node.js')\n }\n }\n}\n","const optsArg = require('./lib/opts-arg.js')\nconst pathArg = require('./lib/path-arg.js')\n\nconst {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js')\nconst {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js')\nconst {useNative, useNativeSync} = require('./lib/use-native.js')\n\n\nconst mkdirp = (path, opts) => {\n path = pathArg(path)\n opts = optsArg(opts)\n return useNative(opts)\n ? mkdirpNative(path, opts)\n : mkdirpManual(path, opts)\n}\n\nconst mkdirpSync = (path, opts) => {\n path = pathArg(path)\n opts = optsArg(opts)\n return useNativeSync(opts)\n ? mkdirpNativeSync(path, opts)\n : mkdirpManualSync(path, opts)\n}\n\nmkdirp.sync = mkdirpSync\nmkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts))\nmkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts))\nmkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts))\nmkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts))\n\nmodule.exports = mkdirp\n","const {dirname} = require('path')\n\nconst findMade = (opts, parent, path = undefined) => {\n // we never want the 'made' return value to be a root directory\n if (path === parent)\n return Promise.resolve()\n\n return opts.statAsync(parent).then(\n st => st.isDirectory() ? path : undefined, // will fail later\n er => er.code === 'ENOENT'\n ? findMade(opts, dirname(parent), parent)\n : undefined\n )\n}\n\nconst findMadeSync = (opts, parent, path = undefined) => {\n if (path === parent)\n return undefined\n\n try {\n return opts.statSync(parent).isDirectory() ? path : undefined\n } catch (er) {\n return er.code === 'ENOENT'\n ? findMadeSync(opts, dirname(parent), parent)\n : undefined\n }\n}\n\nmodule.exports = {findMade, findMadeSync}\n","const {dirname} = require('path')\n\nconst mkdirpManual = (path, opts, made) => {\n opts.recursive = false\n const parent = dirname(path)\n if (parent === path) {\n return opts.mkdirAsync(path, opts).catch(er => {\n // swallowed by recursive implementation on posix systems\n // any other error is a failure\n if (er.code !== 'EISDIR')\n throw er\n })\n }\n\n return opts.mkdirAsync(path, opts).then(() => made || path, er => {\n if (er.code === 'ENOENT')\n return mkdirpManual(parent, opts)\n .then(made => mkdirpManual(path, opts, made))\n if (er.code !== 'EEXIST' && er.code !== 'EROFS')\n throw er\n return opts.statAsync(path).then(st => {\n if (st.isDirectory())\n return made\n else\n throw er\n }, () => { throw er })\n })\n}\n\nconst mkdirpManualSync = (path, opts, made) => {\n const parent = dirname(path)\n opts.recursive = false\n\n if (parent === path) {\n try {\n return opts.mkdirSync(path, opts)\n } catch (er) {\n // swallowed by recursive implementation on posix systems\n // any other error is a failure\n if (er.code !== 'EISDIR')\n throw er\n else\n return\n }\n }\n\n try {\n opts.mkdirSync(path, opts)\n return made || path\n } catch (er) {\n if (er.code === 'ENOENT')\n return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made))\n if (er.code !== 'EEXIST' && er.code !== 'EROFS')\n throw er\n try {\n if (!opts.statSync(path).isDirectory())\n throw er\n } catch (_) {\n throw er\n }\n }\n}\n\nmodule.exports = {mkdirpManual, mkdirpManualSync}\n","const {dirname} = require('path')\nconst {findMade, findMadeSync} = require('./find-made.js')\nconst {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js')\n\nconst mkdirpNative = (path, opts) => {\n opts.recursive = true\n const parent = dirname(path)\n if (parent === path)\n return opts.mkdirAsync(path, opts)\n\n return findMade(opts, path).then(made =>\n opts.mkdirAsync(path, opts).then(() => made)\n .catch(er => {\n if (er.code === 'ENOENT')\n return mkdirpManual(path, opts)\n else\n throw er\n }))\n}\n\nconst mkdirpNativeSync = (path, opts) => {\n opts.recursive = true\n const parent = dirname(path)\n if (parent === path)\n return opts.mkdirSync(path, opts)\n\n const made = findMadeSync(opts, path)\n try {\n opts.mkdirSync(path, opts)\n return made\n } catch (er) {\n if (er.code === 'ENOENT')\n return mkdirpManualSync(path, opts)\n else\n throw er\n }\n}\n\nmodule.exports = {mkdirpNative, mkdirpNativeSync}\n","const { promisify } = require('util')\nconst fs = require('fs')\nconst optsArg = opts => {\n if (!opts)\n opts = { mode: 0o777, fs }\n else if (typeof opts === 'object')\n opts = { mode: 0o777, fs, ...opts }\n else if (typeof opts === 'number')\n opts = { mode: opts, fs }\n else if (typeof opts === 'string')\n opts = { mode: parseInt(opts, 8), fs }\n else\n throw new TypeError('invalid options argument')\n\n opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir\n opts.mkdirAsync = promisify(opts.mkdir)\n opts.stat = opts.stat || opts.fs.stat || fs.stat\n opts.statAsync = promisify(opts.stat)\n opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync\n opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync\n return opts\n}\nmodule.exports = optsArg\n","const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform\nconst { resolve, parse } = require('path')\nconst pathArg = path => {\n if (/\\0/.test(path)) {\n // simulate same failure that node raises\n throw Object.assign(\n new TypeError('path must be a string without null bytes'),\n {\n path,\n code: 'ERR_INVALID_ARG_VALUE',\n }\n )\n }\n\n path = resolve(path)\n if (platform === 'win32') {\n const badWinChars = /[*|\"<>?:]/\n const {root} = parse(path)\n if (badWinChars.test(path.substr(root.length))) {\n throw Object.assign(new Error('Illegal characters in path.'), {\n path,\n code: 'EINVAL',\n })\n }\n }\n\n return path\n}\nmodule.exports = pathArg\n","const fs = require('fs')\n\nconst version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version\nconst versArr = version.replace(/^v/, '').split('.')\nconst hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12\n\nconst useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir\nconst useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync\n\nmodule.exports = {useNative, useNativeSync}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }\n\nvar Stream = _interopDefault(require('stream'));\nvar http = _interopDefault(require('http'));\nvar Url = _interopDefault(require('url'));\nvar whatwgUrl = _interopDefault(require('whatwg-url'));\nvar https = _interopDefault(require('https'));\nvar zlib = _interopDefault(require('zlib'));\n\n// Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js\n\n// fix for \"Readable\" isn't a named export issue\nconst Readable = Stream.Readable;\n\nconst BUFFER = Symbol('buffer');\nconst TYPE = Symbol('type');\n\nclass Blob {\n\tconstructor() {\n\t\tthis[TYPE] = '';\n\n\t\tconst blobParts = arguments[0];\n\t\tconst options = arguments[1];\n\n\t\tconst buffers = [];\n\t\tlet size = 0;\n\n\t\tif (blobParts) {\n\t\t\tconst a = blobParts;\n\t\t\tconst length = Number(a.length);\n\t\t\tfor (let i = 0; i < length; i++) {\n\t\t\t\tconst element = a[i];\n\t\t\t\tlet buffer;\n\t\t\t\tif (element instanceof Buffer) {\n\t\t\t\t\tbuffer = element;\n\t\t\t\t} else if (ArrayBuffer.isView(element)) {\n\t\t\t\t\tbuffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);\n\t\t\t\t} else if (element instanceof ArrayBuffer) {\n\t\t\t\t\tbuffer = Buffer.from(element);\n\t\t\t\t} else if (element instanceof Blob) {\n\t\t\t\t\tbuffer = element[BUFFER];\n\t\t\t\t} else {\n\t\t\t\t\tbuffer = Buffer.from(typeof element === 'string' ? element : String(element));\n\t\t\t\t}\n\t\t\t\tsize += buffer.length;\n\t\t\t\tbuffers.push(buffer);\n\t\t\t}\n\t\t}\n\n\t\tthis[BUFFER] = Buffer.concat(buffers);\n\n\t\tlet type = options && options.type !== undefined && String(options.type).toLowerCase();\n\t\tif (type && !/[^\\u0020-\\u007E]/.test(type)) {\n\t\t\tthis[TYPE] = type;\n\t\t}\n\t}\n\tget size() {\n\t\treturn this[BUFFER].length;\n\t}\n\tget type() {\n\t\treturn this[TYPE];\n\t}\n\ttext() {\n\t\treturn Promise.resolve(this[BUFFER].toString());\n\t}\n\tarrayBuffer() {\n\t\tconst buf = this[BUFFER];\n\t\tconst ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\treturn Promise.resolve(ab);\n\t}\n\tstream() {\n\t\tconst readable = new Readable();\n\t\treadable._read = function () {};\n\t\treadable.push(this[BUFFER]);\n\t\treadable.push(null);\n\t\treturn readable;\n\t}\n\ttoString() {\n\t\treturn '[object Blob]';\n\t}\n\tslice() {\n\t\tconst size = this.size;\n\n\t\tconst start = arguments[0];\n\t\tconst end = arguments[1];\n\t\tlet relativeStart, relativeEnd;\n\t\tif (start === undefined) {\n\t\t\trelativeStart = 0;\n\t\t} else if (start < 0) {\n\t\t\trelativeStart = Math.max(size + start, 0);\n\t\t} else {\n\t\t\trelativeStart = Math.min(start, size);\n\t\t}\n\t\tif (end === undefined) {\n\t\t\trelativeEnd = size;\n\t\t} else if (end < 0) {\n\t\t\trelativeEnd = Math.max(size + end, 0);\n\t\t} else {\n\t\t\trelativeEnd = Math.min(end, size);\n\t\t}\n\t\tconst span = Math.max(relativeEnd - relativeStart, 0);\n\n\t\tconst buffer = this[BUFFER];\n\t\tconst slicedBuffer = buffer.slice(relativeStart, relativeStart + span);\n\t\tconst blob = new Blob([], { type: arguments[2] });\n\t\tblob[BUFFER] = slicedBuffer;\n\t\treturn blob;\n\t}\n}\n\nObject.defineProperties(Blob.prototype, {\n\tsize: { enumerable: true },\n\ttype: { enumerable: true },\n\tslice: { enumerable: true }\n});\n\nObject.defineProperty(Blob.prototype, Symbol.toStringTag, {\n\tvalue: 'Blob',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * fetch-error.js\n *\n * FetchError interface for operational errors\n */\n\n/**\n * Create FetchError instance\n *\n * @param String message Error message for human\n * @param String type Error type for machine\n * @param String systemError For Node.js system error\n * @return FetchError\n */\nfunction FetchError(message, type, systemError) {\n Error.call(this, message);\n\n this.message = message;\n this.type = type;\n\n // when err.type is `system`, err.code contains system error code\n if (systemError) {\n this.code = this.errno = systemError.code;\n }\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nFetchError.prototype = Object.create(Error.prototype);\nFetchError.prototype.constructor = FetchError;\nFetchError.prototype.name = 'FetchError';\n\nlet convert;\ntry {\n\tconvert = require('encoding').convert;\n} catch (e) {}\n\nconst INTERNALS = Symbol('Body internals');\n\n// fix an issue where \"PassThrough\" isn't a named export for node <10\nconst PassThrough = Stream.PassThrough;\n\n/**\n * Body mixin\n *\n * Ref: https://fetch.spec.whatwg.org/#body\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nfunction Body(body) {\n\tvar _this = this;\n\n\tvar _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n\t _ref$size = _ref.size;\n\n\tlet size = _ref$size === undefined ? 0 : _ref$size;\n\tvar _ref$timeout = _ref.timeout;\n\tlet timeout = _ref$timeout === undefined ? 0 : _ref$timeout;\n\n\tif (body == null) {\n\t\t// body is undefined or null\n\t\tbody = null;\n\t} else if (isURLSearchParams(body)) {\n\t\t// body is a URLSearchParams\n\t\tbody = Buffer.from(body.toString());\n\t} else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {\n\t\t// body is ArrayBuffer\n\t\tbody = Buffer.from(body);\n\t} else if (ArrayBuffer.isView(body)) {\n\t\t// body is ArrayBufferView\n\t\tbody = Buffer.from(body.buffer, body.byteOffset, body.byteLength);\n\t} else if (body instanceof Stream) ; else {\n\t\t// none of the above\n\t\t// coerce to string then buffer\n\t\tbody = Buffer.from(String(body));\n\t}\n\tthis[INTERNALS] = {\n\t\tbody,\n\t\tdisturbed: false,\n\t\terror: null\n\t};\n\tthis.size = size;\n\tthis.timeout = timeout;\n\n\tif (body instanceof Stream) {\n\t\tbody.on('error', function (err) {\n\t\t\tconst error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);\n\t\t\t_this[INTERNALS].error = error;\n\t\t});\n\t}\n}\n\nBody.prototype = {\n\tget body() {\n\t\treturn this[INTERNALS].body;\n\t},\n\n\tget bodyUsed() {\n\t\treturn this[INTERNALS].disturbed;\n\t},\n\n\t/**\n * Decode response as ArrayBuffer\n *\n * @return Promise\n */\n\tarrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t},\n\n\t/**\n * Return raw response as Blob\n *\n * @return Promise\n */\n\tblob() {\n\t\tlet ct = this.headers && this.headers.get('content-type') || '';\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn Object.assign(\n\t\t\t// Prevent copying\n\t\t\tnew Blob([], {\n\t\t\t\ttype: ct.toLowerCase()\n\t\t\t}), {\n\t\t\t\t[BUFFER]: buf\n\t\t\t});\n\t\t});\n\t},\n\n\t/**\n * Decode response as json\n *\n * @return Promise\n */\n\tjson() {\n\t\tvar _this2 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\ttry {\n\t\t\t\treturn JSON.parse(buffer.toString());\n\t\t\t} catch (err) {\n\t\t\t\treturn Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));\n\t\t\t}\n\t\t});\n\t},\n\n\t/**\n * Decode response as text\n *\n * @return Promise\n */\n\ttext() {\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn buffer.toString();\n\t\t});\n\t},\n\n\t/**\n * Decode response as buffer (non-spec api)\n *\n * @return Promise\n */\n\tbuffer() {\n\t\treturn consumeBody.call(this);\n\t},\n\n\t/**\n * Decode response as text, while automatically detecting the encoding and\n * trying to decode to UTF-8 (non-spec api)\n *\n * @return Promise\n */\n\ttextConverted() {\n\t\tvar _this3 = this;\n\n\t\treturn consumeBody.call(this).then(function (buffer) {\n\t\t\treturn convertBody(buffer, _this3.headers);\n\t\t});\n\t}\n};\n\n// In browsers, all properties are enumerable.\nObject.defineProperties(Body.prototype, {\n\tbody: { enumerable: true },\n\tbodyUsed: { enumerable: true },\n\tarrayBuffer: { enumerable: true },\n\tblob: { enumerable: true },\n\tjson: { enumerable: true },\n\ttext: { enumerable: true }\n});\n\nBody.mixIn = function (proto) {\n\tfor (const name of Object.getOwnPropertyNames(Body.prototype)) {\n\t\t// istanbul ignore else: future proof\n\t\tif (!(name in proto)) {\n\t\t\tconst desc = Object.getOwnPropertyDescriptor(Body.prototype, name);\n\t\t\tObject.defineProperty(proto, name, desc);\n\t\t}\n\t}\n};\n\n/**\n * Consume and convert an entire Body to a Buffer.\n *\n * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body\n *\n * @return Promise\n */\nfunction consumeBody() {\n\tvar _this4 = this;\n\n\tif (this[INTERNALS].disturbed) {\n\t\treturn Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));\n\t}\n\n\tthis[INTERNALS].disturbed = true;\n\n\tif (this[INTERNALS].error) {\n\t\treturn Body.Promise.reject(this[INTERNALS].error);\n\t}\n\n\tlet body = this.body;\n\n\t// body is null\n\tif (body === null) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is blob\n\tif (isBlob(body)) {\n\t\tbody = body.stream();\n\t}\n\n\t// body is buffer\n\tif (Buffer.isBuffer(body)) {\n\t\treturn Body.Promise.resolve(body);\n\t}\n\n\t// istanbul ignore if: should never happen\n\tif (!(body instanceof Stream)) {\n\t\treturn Body.Promise.resolve(Buffer.alloc(0));\n\t}\n\n\t// body is stream\n\t// get ready to actually consume the body\n\tlet accum = [];\n\tlet accumBytes = 0;\n\tlet abort = false;\n\n\treturn new Body.Promise(function (resolve, reject) {\n\t\tlet resTimeout;\n\n\t\t// allow timeout on slow response body\n\t\tif (_this4.timeout) {\n\t\t\tresTimeout = setTimeout(function () {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));\n\t\t\t}, _this4.timeout);\n\t\t}\n\n\t\t// handle stream errors\n\t\tbody.on('error', function (err) {\n\t\t\tif (err.name === 'AbortError') {\n\t\t\t\t// if the request was aborted, reject with this Error\n\t\t\t\tabort = true;\n\t\t\t\treject(err);\n\t\t\t} else {\n\t\t\t\t// other errors, such as incorrect content-encoding\n\t\t\t\treject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\n\t\tbody.on('data', function (chunk) {\n\t\t\tif (abort || chunk === null) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (_this4.size && accumBytes + chunk.length > _this4.size) {\n\t\t\t\tabort = true;\n\t\t\t\treject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\taccumBytes += chunk.length;\n\t\t\taccum.push(chunk);\n\t\t});\n\n\t\tbody.on('end', function () {\n\t\t\tif (abort) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tclearTimeout(resTimeout);\n\n\t\t\ttry {\n\t\t\t\tresolve(Buffer.concat(accum, accumBytes));\n\t\t\t} catch (err) {\n\t\t\t\t// handle streams that have accumulated too much data (issue #414)\n\t\t\t\treject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));\n\t\t\t}\n\t\t});\n\t});\n}\n\n/**\n * Detect buffer encoding and convert to target encoding\n * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding\n *\n * @param Buffer buffer Incoming buffer\n * @param String encoding Target encoding\n * @return String\n */\nfunction convertBody(buffer, headers) {\n\tif (typeof convert !== 'function') {\n\t\tthrow new Error('The package `encoding` must be installed to use the textConverted() function');\n\t}\n\n\tconst ct = headers.get('content-type');\n\tlet charset = 'utf-8';\n\tlet res, str;\n\n\t// header\n\tif (ct) {\n\t\tres = /charset=([^;]*)/i.exec(ct);\n\t}\n\n\t// no charset in content type, peek at response body for at most 1024 bytes\n\tstr = buffer.slice(0, 1024).toString();\n\n\t// html5\n\tif (!res && str) {\n\t\tres = / 0 && arguments[0] !== undefined ? arguments[0] : undefined;\n\n\t\tthis[MAP] = Object.create(null);\n\n\t\tif (init instanceof Headers) {\n\t\t\tconst rawHeaders = init.raw();\n\t\t\tconst headerNames = Object.keys(rawHeaders);\n\n\t\t\tfor (const headerName of headerNames) {\n\t\t\t\tfor (const value of rawHeaders[headerName]) {\n\t\t\t\t\tthis.append(headerName, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}\n\n\t\t// We don't worry about converting prop to ByteString here as append()\n\t\t// will handle it.\n\t\tif (init == null) ; else if (typeof init === 'object') {\n\t\t\tconst method = init[Symbol.iterator];\n\t\t\tif (method != null) {\n\t\t\t\tif (typeof method !== 'function') {\n\t\t\t\t\tthrow new TypeError('Header pairs must be iterable');\n\t\t\t\t}\n\n\t\t\t\t// sequence>\n\t\t\t\t// Note: per spec we have to first exhaust the lists then process them\n\t\t\t\tconst pairs = [];\n\t\t\t\tfor (const pair of init) {\n\t\t\t\t\tif (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be iterable');\n\t\t\t\t\t}\n\t\t\t\t\tpairs.push(Array.from(pair));\n\t\t\t\t}\n\n\t\t\t\tfor (const pair of pairs) {\n\t\t\t\t\tif (pair.length !== 2) {\n\t\t\t\t\t\tthrow new TypeError('Each header pair must be a name/value tuple');\n\t\t\t\t\t}\n\t\t\t\t\tthis.append(pair[0], pair[1]);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// record\n\t\t\t\tfor (const key of Object.keys(init)) {\n\t\t\t\t\tconst value = init[key];\n\t\t\t\t\tthis.append(key, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new TypeError('Provided initializer must be an object');\n\t\t}\n\t}\n\n\t/**\n * Return combined header value given name\n *\n * @param String name Header name\n * @return Mixed\n */\n\tget(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key === undefined) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn this[MAP][key].join(', ');\n\t}\n\n\t/**\n * Iterate over all headers\n *\n * @param Function callback Executed for each item with parameters (value, name, thisArg)\n * @param Boolean thisArg `this` context for callback function\n * @return Void\n */\n\tforEach(callback) {\n\t\tlet thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;\n\n\t\tlet pairs = getHeaders(this);\n\t\tlet i = 0;\n\t\twhile (i < pairs.length) {\n\t\t\tvar _pairs$i = pairs[i];\n\t\t\tconst name = _pairs$i[0],\n\t\t\t value = _pairs$i[1];\n\n\t\t\tcallback.call(thisArg, value, name, this);\n\t\t\tpairs = getHeaders(this);\n\t\t\ti++;\n\t\t}\n\t}\n\n\t/**\n * Overwrite header values given name\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tset(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tthis[MAP][key !== undefined ? key : name] = [value];\n\t}\n\n\t/**\n * Append a value onto existing header\n *\n * @param String name Header name\n * @param String value Header value\n * @return Void\n */\n\tappend(name, value) {\n\t\tname = `${name}`;\n\t\tvalue = `${value}`;\n\t\tvalidateName(name);\n\t\tvalidateValue(value);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tthis[MAP][key].push(value);\n\t\t} else {\n\t\t\tthis[MAP][name] = [value];\n\t\t}\n\t}\n\n\t/**\n * Check for header name existence\n *\n * @param String name Header name\n * @return Boolean\n */\n\thas(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\treturn find(this[MAP], name) !== undefined;\n\t}\n\n\t/**\n * Delete all header values given name\n *\n * @param String name Header name\n * @return Void\n */\n\tdelete(name) {\n\t\tname = `${name}`;\n\t\tvalidateName(name);\n\t\tconst key = find(this[MAP], name);\n\t\tif (key !== undefined) {\n\t\t\tdelete this[MAP][key];\n\t\t}\n\t}\n\n\t/**\n * Return raw headers (non-spec api)\n *\n * @return Object\n */\n\traw() {\n\t\treturn this[MAP];\n\t}\n\n\t/**\n * Get an iterator on keys.\n *\n * @return Iterator\n */\n\tkeys() {\n\t\treturn createHeadersIterator(this, 'key');\n\t}\n\n\t/**\n * Get an iterator on values.\n *\n * @return Iterator\n */\n\tvalues() {\n\t\treturn createHeadersIterator(this, 'value');\n\t}\n\n\t/**\n * Get an iterator on entries.\n *\n * This is the default iterator of the Headers object.\n *\n * @return Iterator\n */\n\t[Symbol.iterator]() {\n\t\treturn createHeadersIterator(this, 'key+value');\n\t}\n}\nHeaders.prototype.entries = Headers.prototype[Symbol.iterator];\n\nObject.defineProperty(Headers.prototype, Symbol.toStringTag, {\n\tvalue: 'Headers',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Headers.prototype, {\n\tget: { enumerable: true },\n\tforEach: { enumerable: true },\n\tset: { enumerable: true },\n\tappend: { enumerable: true },\n\thas: { enumerable: true },\n\tdelete: { enumerable: true },\n\tkeys: { enumerable: true },\n\tvalues: { enumerable: true },\n\tentries: { enumerable: true }\n});\n\nfunction getHeaders(headers) {\n\tlet kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';\n\n\tconst keys = Object.keys(headers[MAP]).sort();\n\treturn keys.map(kind === 'key' ? function (k) {\n\t\treturn k.toLowerCase();\n\t} : kind === 'value' ? function (k) {\n\t\treturn headers[MAP][k].join(', ');\n\t} : function (k) {\n\t\treturn [k.toLowerCase(), headers[MAP][k].join(', ')];\n\t});\n}\n\nconst INTERNAL = Symbol('internal');\n\nfunction createHeadersIterator(target, kind) {\n\tconst iterator = Object.create(HeadersIteratorPrototype);\n\titerator[INTERNAL] = {\n\t\ttarget,\n\t\tkind,\n\t\tindex: 0\n\t};\n\treturn iterator;\n}\n\nconst HeadersIteratorPrototype = Object.setPrototypeOf({\n\tnext() {\n\t\t// istanbul ignore if\n\t\tif (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {\n\t\t\tthrow new TypeError('Value of `this` is not a HeadersIterator');\n\t\t}\n\n\t\tvar _INTERNAL = this[INTERNAL];\n\t\tconst target = _INTERNAL.target,\n\t\t kind = _INTERNAL.kind,\n\t\t index = _INTERNAL.index;\n\n\t\tconst values = getHeaders(target, kind);\n\t\tconst len = values.length;\n\t\tif (index >= len) {\n\t\t\treturn {\n\t\t\t\tvalue: undefined,\n\t\t\t\tdone: true\n\t\t\t};\n\t\t}\n\n\t\tthis[INTERNAL].index = index + 1;\n\n\t\treturn {\n\t\t\tvalue: values[index],\n\t\t\tdone: false\n\t\t};\n\t}\n}, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));\n\nObject.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {\n\tvalue: 'HeadersIterator',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\n/**\n * Export the Headers object in a form that Node.js can consume.\n *\n * @param Headers headers\n * @return Object\n */\nfunction exportNodeCompatibleHeaders(headers) {\n\tconst obj = Object.assign({ __proto__: null }, headers[MAP]);\n\n\t// http.request() only supports string as Host header. This hack makes\n\t// specifying custom Host header possible.\n\tconst hostHeaderKey = find(headers[MAP], 'Host');\n\tif (hostHeaderKey !== undefined) {\n\t\tobj[hostHeaderKey] = obj[hostHeaderKey][0];\n\t}\n\n\treturn obj;\n}\n\n/**\n * Create a Headers object from an object of headers, ignoring those that do\n * not conform to HTTP grammar productions.\n *\n * @param Object obj Object of headers\n * @return Headers\n */\nfunction createHeadersLenient(obj) {\n\tconst headers = new Headers();\n\tfor (const name of Object.keys(obj)) {\n\t\tif (invalidTokenRegex.test(name)) {\n\t\t\tcontinue;\n\t\t}\n\t\tif (Array.isArray(obj[name])) {\n\t\t\tfor (const val of obj[name]) {\n\t\t\t\tif (invalidHeaderCharRegex.test(val)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (headers[MAP][name] === undefined) {\n\t\t\t\t\theaders[MAP][name] = [val];\n\t\t\t\t} else {\n\t\t\t\t\theaders[MAP][name].push(val);\n\t\t\t\t}\n\t\t\t}\n\t\t} else if (!invalidHeaderCharRegex.test(obj[name])) {\n\t\t\theaders[MAP][name] = [obj[name]];\n\t\t}\n\t}\n\treturn headers;\n}\n\nconst INTERNALS$1 = Symbol('Response internals');\n\n// fix an issue where \"STATUS_CODES\" aren't a named export for node <10\nconst STATUS_CODES = http.STATUS_CODES;\n\n/**\n * Response class\n *\n * @param Stream body Readable stream\n * @param Object opts Response options\n * @return Void\n */\nclass Response {\n\tconstructor() {\n\t\tlet body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n\t\tlet opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tBody.call(this, body, opts);\n\n\t\tconst status = opts.status || 200;\n\t\tconst headers = new Headers(opts.headers);\n\n\t\tif (body != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(body);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tthis[INTERNALS$1] = {\n\t\t\turl: opts.url,\n\t\t\tstatus,\n\t\t\tstatusText: opts.statusText || STATUS_CODES[status],\n\t\t\theaders,\n\t\t\tcounter: opts.counter\n\t\t};\n\t}\n\n\tget url() {\n\t\treturn this[INTERNALS$1].url || '';\n\t}\n\n\tget status() {\n\t\treturn this[INTERNALS$1].status;\n\t}\n\n\t/**\n * Convenience property representing if the request ended normally\n */\n\tget ok() {\n\t\treturn this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;\n\t}\n\n\tget redirected() {\n\t\treturn this[INTERNALS$1].counter > 0;\n\t}\n\n\tget statusText() {\n\t\treturn this[INTERNALS$1].statusText;\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$1].headers;\n\t}\n\n\t/**\n * Clone this response\n *\n * @return Response\n */\n\tclone() {\n\t\treturn new Response(clone(this), {\n\t\t\turl: this.url,\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t\theaders: this.headers,\n\t\t\tok: this.ok,\n\t\t\tredirected: this.redirected\n\t\t});\n\t}\n}\n\nBody.mixIn(Response.prototype);\n\nObject.defineProperties(Response.prototype, {\n\turl: { enumerable: true },\n\tstatus: { enumerable: true },\n\tok: { enumerable: true },\n\tredirected: { enumerable: true },\n\tstatusText: { enumerable: true },\n\theaders: { enumerable: true },\n\tclone: { enumerable: true }\n});\n\nObject.defineProperty(Response.prototype, Symbol.toStringTag, {\n\tvalue: 'Response',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nconst INTERNALS$2 = Symbol('Request internals');\nconst URL = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"format\", \"parse\" aren't a named export for node <10\nconst parse_url = Url.parse;\nconst format_url = Url.format;\n\n/**\n * Wrapper around `new URL` to handle arbitrary URLs\n *\n * @param {string} urlStr\n * @return {void}\n */\nfunction parseURL(urlStr) {\n\t/*\n \tCheck whether the URL is absolute or not\n \t\tScheme: https://tools.ietf.org/html/rfc3986#section-3.1\n \tAbsolute URL: https://tools.ietf.org/html/rfc3986#section-4.3\n */\n\tif (/^[a-zA-Z][a-zA-Z\\d+\\-.]*:/.exec(urlStr)) {\n\t\turlStr = new URL(urlStr).toString();\n\t}\n\n\t// Fallback to old implementation for arbitrary URLs\n\treturn parse_url(urlStr);\n}\n\nconst streamDestructionSupported = 'destroy' in Stream.Readable.prototype;\n\n/**\n * Check if a value is an instance of Request.\n *\n * @param Mixed input\n * @return Boolean\n */\nfunction isRequest(input) {\n\treturn typeof input === 'object' && typeof input[INTERNALS$2] === 'object';\n}\n\nfunction isAbortSignal(signal) {\n\tconst proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);\n\treturn !!(proto && proto.constructor.name === 'AbortSignal');\n}\n\n/**\n * Request class\n *\n * @param Mixed input Url or Request instance\n * @param Object init Custom options\n * @return Void\n */\nclass Request {\n\tconstructor(input) {\n\t\tlet init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n\t\tlet parsedURL;\n\n\t\t// normalize input\n\t\tif (!isRequest(input)) {\n\t\t\tif (input && input.href) {\n\t\t\t\t// in order to support Node.js' Url objects; though WHATWG's URL objects\n\t\t\t\t// will fall into this branch also (since their `toString()` will return\n\t\t\t\t// `href` property anyway)\n\t\t\t\tparsedURL = parseURL(input.href);\n\t\t\t} else {\n\t\t\t\t// coerce input to a string before attempting to parse\n\t\t\t\tparsedURL = parseURL(`${input}`);\n\t\t\t}\n\t\t\tinput = {};\n\t\t} else {\n\t\t\tparsedURL = parseURL(input.url);\n\t\t}\n\n\t\tlet method = init.method || input.method || 'GET';\n\t\tmethod = method.toUpperCase();\n\n\t\tif ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {\n\t\t\tthrow new TypeError('Request with GET/HEAD method cannot have body');\n\t\t}\n\n\t\tlet inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;\n\n\t\tBody.call(this, inputBody, {\n\t\t\ttimeout: init.timeout || input.timeout || 0,\n\t\t\tsize: init.size || input.size || 0\n\t\t});\n\n\t\tconst headers = new Headers(init.headers || input.headers || {});\n\n\t\tif (inputBody != null && !headers.has('Content-Type')) {\n\t\t\tconst contentType = extractContentType(inputBody);\n\t\t\tif (contentType) {\n\t\t\t\theaders.append('Content-Type', contentType);\n\t\t\t}\n\t\t}\n\n\t\tlet signal = isRequest(input) ? input.signal : null;\n\t\tif ('signal' in init) signal = init.signal;\n\n\t\tif (signal != null && !isAbortSignal(signal)) {\n\t\t\tthrow new TypeError('Expected signal to be an instanceof AbortSignal');\n\t\t}\n\n\t\tthis[INTERNALS$2] = {\n\t\t\tmethod,\n\t\t\tredirect: init.redirect || input.redirect || 'follow',\n\t\t\theaders,\n\t\t\tparsedURL,\n\t\t\tsignal\n\t\t};\n\n\t\t// node-fetch-only options\n\t\tthis.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;\n\t\tthis.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;\n\t\tthis.counter = init.counter || input.counter || 0;\n\t\tthis.agent = init.agent || input.agent;\n\t}\n\n\tget method() {\n\t\treturn this[INTERNALS$2].method;\n\t}\n\n\tget url() {\n\t\treturn format_url(this[INTERNALS$2].parsedURL);\n\t}\n\n\tget headers() {\n\t\treturn this[INTERNALS$2].headers;\n\t}\n\n\tget redirect() {\n\t\treturn this[INTERNALS$2].redirect;\n\t}\n\n\tget signal() {\n\t\treturn this[INTERNALS$2].signal;\n\t}\n\n\t/**\n * Clone this request\n *\n * @return Request\n */\n\tclone() {\n\t\treturn new Request(this);\n\t}\n}\n\nBody.mixIn(Request.prototype);\n\nObject.defineProperty(Request.prototype, Symbol.toStringTag, {\n\tvalue: 'Request',\n\twritable: false,\n\tenumerable: false,\n\tconfigurable: true\n});\n\nObject.defineProperties(Request.prototype, {\n\tmethod: { enumerable: true },\n\turl: { enumerable: true },\n\theaders: { enumerable: true },\n\tredirect: { enumerable: true },\n\tclone: { enumerable: true },\n\tsignal: { enumerable: true }\n});\n\n/**\n * Convert a Request to Node.js http request options.\n *\n * @param Request A Request instance\n * @return Object The options object to be passed to http.request\n */\nfunction getNodeRequestOptions(request) {\n\tconst parsedURL = request[INTERNALS$2].parsedURL;\n\tconst headers = new Headers(request[INTERNALS$2].headers);\n\n\t// fetch step 1.3\n\tif (!headers.has('Accept')) {\n\t\theaders.set('Accept', '*/*');\n\t}\n\n\t// Basic fetch\n\tif (!parsedURL.protocol || !parsedURL.hostname) {\n\t\tthrow new TypeError('Only absolute URLs are supported');\n\t}\n\n\tif (!/^https?:$/.test(parsedURL.protocol)) {\n\t\tthrow new TypeError('Only HTTP(S) protocols are supported');\n\t}\n\n\tif (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {\n\t\tthrow new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');\n\t}\n\n\t// HTTP-network-or-cache fetch steps 2.4-2.7\n\tlet contentLengthValue = null;\n\tif (request.body == null && /^(POST|PUT)$/i.test(request.method)) {\n\t\tcontentLengthValue = '0';\n\t}\n\tif (request.body != null) {\n\t\tconst totalBytes = getTotalBytes(request);\n\t\tif (typeof totalBytes === 'number') {\n\t\t\tcontentLengthValue = String(totalBytes);\n\t\t}\n\t}\n\tif (contentLengthValue) {\n\t\theaders.set('Content-Length', contentLengthValue);\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.11\n\tif (!headers.has('User-Agent')) {\n\t\theaders.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');\n\t}\n\n\t// HTTP-network-or-cache fetch step 2.15\n\tif (request.compress && !headers.has('Accept-Encoding')) {\n\t\theaders.set('Accept-Encoding', 'gzip,deflate');\n\t}\n\n\tlet agent = request.agent;\n\tif (typeof agent === 'function') {\n\t\tagent = agent(parsedURL);\n\t}\n\n\tif (!headers.has('Connection') && !agent) {\n\t\theaders.set('Connection', 'close');\n\t}\n\n\t// HTTP-network fetch step 4.2\n\t// chunked encoding is handled by Node.js\n\n\treturn Object.assign({}, parsedURL, {\n\t\tmethod: request.method,\n\t\theaders: exportNodeCompatibleHeaders(headers),\n\t\tagent\n\t});\n}\n\n/**\n * abort-error.js\n *\n * AbortError interface for cancelled requests\n */\n\n/**\n * Create AbortError instance\n *\n * @param String message Error message for human\n * @return AbortError\n */\nfunction AbortError(message) {\n Error.call(this, message);\n\n this.type = 'aborted';\n this.message = message;\n\n // hide custom error implementation details from end-users\n Error.captureStackTrace(this, this.constructor);\n}\n\nAbortError.prototype = Object.create(Error.prototype);\nAbortError.prototype.constructor = AbortError;\nAbortError.prototype.name = 'AbortError';\n\nconst URL$1 = Url.URL || whatwgUrl.URL;\n\n// fix an issue where \"PassThrough\", \"resolve\" aren't a named export for node <10\nconst PassThrough$1 = Stream.PassThrough;\n\nconst isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {\n\tconst orig = new URL$1(original).hostname;\n\tconst dest = new URL$1(destination).hostname;\n\n\treturn orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);\n};\n\n/**\n * isSameProtocol reports whether the two provided URLs use the same protocol.\n *\n * Both domains must already be in canonical form.\n * @param {string|URL} original\n * @param {string|URL} destination\n */\nconst isSameProtocol = function isSameProtocol(destination, original) {\n\tconst orig = new URL$1(original).protocol;\n\tconst dest = new URL$1(destination).protocol;\n\n\treturn orig === dest;\n};\n\n/**\n * Fetch function\n *\n * @param Mixed url Absolute url or Request instance\n * @param Object opts Fetch options\n * @return Promise\n */\nfunction fetch(url, opts) {\n\n\t// allow custom promise\n\tif (!fetch.Promise) {\n\t\tthrow new Error('native promise missing, set fetch.Promise to your favorite alternative');\n\t}\n\n\tBody.Promise = fetch.Promise;\n\n\t// wrap http.request into fetch\n\treturn new fetch.Promise(function (resolve, reject) {\n\t\t// build request object\n\t\tconst request = new Request(url, opts);\n\t\tconst options = getNodeRequestOptions(request);\n\n\t\tconst send = (options.protocol === 'https:' ? https : http).request;\n\t\tconst signal = request.signal;\n\n\t\tlet response = null;\n\n\t\tconst abort = function abort() {\n\t\t\tlet error = new AbortError('The user aborted a request.');\n\t\t\treject(error);\n\t\t\tif (request.body && request.body instanceof Stream.Readable) {\n\t\t\t\tdestroyStream(request.body, error);\n\t\t\t}\n\t\t\tif (!response || !response.body) return;\n\t\t\tresponse.body.emit('error', error);\n\t\t};\n\n\t\tif (signal && signal.aborted) {\n\t\t\tabort();\n\t\t\treturn;\n\t\t}\n\n\t\tconst abortAndFinalize = function abortAndFinalize() {\n\t\t\tabort();\n\t\t\tfinalize();\n\t\t};\n\n\t\t// send request\n\t\tconst req = send(options);\n\t\tlet reqTimeout;\n\n\t\tif (signal) {\n\t\t\tsignal.addEventListener('abort', abortAndFinalize);\n\t\t}\n\n\t\tfunction finalize() {\n\t\t\treq.abort();\n\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\tclearTimeout(reqTimeout);\n\t\t}\n\n\t\tif (request.timeout) {\n\t\t\treq.once('socket', function (socket) {\n\t\t\t\treqTimeout = setTimeout(function () {\n\t\t\t\t\treject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));\n\t\t\t\t\tfinalize();\n\t\t\t\t}, request.timeout);\n\t\t\t});\n\t\t}\n\n\t\treq.on('error', function (err) {\n\t\t\treject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));\n\n\t\t\tif (response && response.body) {\n\t\t\t\tdestroyStream(response.body, err);\n\t\t\t}\n\n\t\t\tfinalize();\n\t\t});\n\n\t\tfixResponseChunkedTransferBadEnding(req, function (err) {\n\t\t\tif (signal && signal.aborted) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (response && response.body) {\n\t\t\t\tdestroyStream(response.body, err);\n\t\t\t}\n\t\t});\n\n\t\t/* c8 ignore next 18 */\n\t\tif (parseInt(process.version.substring(1)) < 14) {\n\t\t\t// Before Node.js 14, pipeline() does not fully support async iterators and does not always\n\t\t\t// properly handle when the socket close/end events are out of order.\n\t\t\treq.on('socket', function (s) {\n\t\t\t\ts.addListener('close', function (hadError) {\n\t\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\t\tconst hasDataListener = s.listenerCount('data') > 0;\n\n\t\t\t\t\t// if end happened before close but the socket didn't emit an error, do it now\n\t\t\t\t\tif (response && hasDataListener && !hadError && !(signal && signal.aborted)) {\n\t\t\t\t\t\tconst err = new Error('Premature close');\n\t\t\t\t\t\terr.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\t\tresponse.body.emit('error', err);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\treq.on('response', function (res) {\n\t\t\tclearTimeout(reqTimeout);\n\n\t\t\tconst headers = createHeadersLenient(res.headers);\n\n\t\t\t// HTTP fetch step 5\n\t\t\tif (fetch.isRedirect(res.statusCode)) {\n\t\t\t\t// HTTP fetch step 5.2\n\t\t\t\tconst location = headers.get('Location');\n\n\t\t\t\t// HTTP fetch step 5.3\n\t\t\t\tlet locationURL = null;\n\t\t\t\ttry {\n\t\t\t\t\tlocationURL = location === null ? null : new URL$1(location, request.url).toString();\n\t\t\t\t} catch (err) {\n\t\t\t\t\t// error here can only be invalid URL in Location: header\n\t\t\t\t\t// do not throw when options.redirect == manual\n\t\t\t\t\t// let the user extract the errorneous redirect URL\n\t\t\t\t\tif (request.redirect !== 'manual') {\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// HTTP fetch step 5.5\n\t\t\t\tswitch (request.redirect) {\n\t\t\t\t\tcase 'error':\n\t\t\t\t\t\treject(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${request.url}`, 'no-redirect'));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t\tcase 'manual':\n\t\t\t\t\t\t// node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.\n\t\t\t\t\t\tif (locationURL !== null) {\n\t\t\t\t\t\t\t// handle corrupted header\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\theaders.set('Location', locationURL);\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t// istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request\n\t\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'follow':\n\t\t\t\t\t\t// HTTP-redirect fetch step 2\n\t\t\t\t\t\tif (locationURL === null) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 5\n\t\t\t\t\t\tif (request.counter >= request.follow) {\n\t\t\t\t\t\t\treject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 6 (counter increment)\n\t\t\t\t\t\t// Create a new Request object.\n\t\t\t\t\t\tconst requestOpts = {\n\t\t\t\t\t\t\theaders: new Headers(request.headers),\n\t\t\t\t\t\t\tfollow: request.follow,\n\t\t\t\t\t\t\tcounter: request.counter + 1,\n\t\t\t\t\t\t\tagent: request.agent,\n\t\t\t\t\t\t\tcompress: request.compress,\n\t\t\t\t\t\t\tmethod: request.method,\n\t\t\t\t\t\t\tbody: request.body,\n\t\t\t\t\t\t\tsignal: request.signal,\n\t\t\t\t\t\t\ttimeout: request.timeout,\n\t\t\t\t\t\t\tsize: request.size\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tif (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {\n\t\t\t\t\t\t\tfor (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {\n\t\t\t\t\t\t\t\trequestOpts.headers.delete(name);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 9\n\t\t\t\t\t\tif (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {\n\t\t\t\t\t\t\treject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));\n\t\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 11\n\t\t\t\t\t\tif (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {\n\t\t\t\t\t\t\trequestOpts.method = 'GET';\n\t\t\t\t\t\t\trequestOpts.body = undefined;\n\t\t\t\t\t\t\trequestOpts.headers.delete('content-length');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// HTTP-redirect fetch step 15\n\t\t\t\t\t\tresolve(fetch(new Request(locationURL, requestOpts)));\n\t\t\t\t\t\tfinalize();\n\t\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// prepare response\n\t\t\tres.once('end', function () {\n\t\t\t\tif (signal) signal.removeEventListener('abort', abortAndFinalize);\n\t\t\t});\n\t\t\tlet body = res.pipe(new PassThrough$1());\n\n\t\t\tconst response_options = {\n\t\t\t\turl: request.url,\n\t\t\t\tstatus: res.statusCode,\n\t\t\t\tstatusText: res.statusMessage,\n\t\t\t\theaders: headers,\n\t\t\t\tsize: request.size,\n\t\t\t\ttimeout: request.timeout,\n\t\t\t\tcounter: request.counter\n\t\t\t};\n\n\t\t\t// HTTP-network fetch step 12.1.1.3\n\t\t\tconst codings = headers.get('Content-Encoding');\n\n\t\t\t// HTTP-network fetch step 12.1.1.4: handle content codings\n\n\t\t\t// in following scenarios we ignore compression support\n\t\t\t// 1. compression support is disabled\n\t\t\t// 2. HEAD request\n\t\t\t// 3. no Content-Encoding header\n\t\t\t// 4. no content response (204)\n\t\t\t// 5. content not modified response (304)\n\t\t\tif (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// For Node v6+\n\t\t\t// Be less strict when decoding compressed responses, since sometimes\n\t\t\t// servers send slightly invalid responses that are still accepted\n\t\t\t// by common browsers.\n\t\t\t// Always using Z_SYNC_FLUSH is what cURL does.\n\t\t\tconst zlibOptions = {\n\t\t\t\tflush: zlib.Z_SYNC_FLUSH,\n\t\t\t\tfinishFlush: zlib.Z_SYNC_FLUSH\n\t\t\t};\n\n\t\t\t// for gzip\n\t\t\tif (codings == 'gzip' || codings == 'x-gzip') {\n\t\t\t\tbody = body.pipe(zlib.createGunzip(zlibOptions));\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for deflate\n\t\t\tif (codings == 'deflate' || codings == 'x-deflate') {\n\t\t\t\t// handle the infamous raw deflate response from old servers\n\t\t\t\t// a hack for old IIS and Apache servers\n\t\t\t\tconst raw = res.pipe(new PassThrough$1());\n\t\t\t\traw.once('data', function (chunk) {\n\t\t\t\t\t// see http://stackoverflow.com/questions/37519828\n\t\t\t\t\tif ((chunk[0] & 0x0F) === 0x08) {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflate());\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbody = body.pipe(zlib.createInflateRaw());\n\t\t\t\t\t}\n\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\tresolve(response);\n\t\t\t\t});\n\t\t\t\traw.on('end', function () {\n\t\t\t\t\t// some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.\n\t\t\t\t\tif (!response) {\n\t\t\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\t\t\tresolve(response);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// for br\n\t\t\tif (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {\n\t\t\t\tbody = body.pipe(zlib.createBrotliDecompress());\n\t\t\t\tresponse = new Response(body, response_options);\n\t\t\t\tresolve(response);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// otherwise, use response as-is\n\t\t\tresponse = new Response(body, response_options);\n\t\t\tresolve(response);\n\t\t});\n\n\t\twriteToStream(req, request);\n\t});\n}\nfunction fixResponseChunkedTransferBadEnding(request, errorCallback) {\n\tlet socket;\n\n\trequest.on('socket', function (s) {\n\t\tsocket = s;\n\t});\n\n\trequest.on('response', function (response) {\n\t\tconst headers = response.headers;\n\n\t\tif (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {\n\t\t\tresponse.once('close', function (hadError) {\n\t\t\t\t// tests for socket presence, as in some situations the\n\t\t\t\t// the 'socket' event is not triggered for the request\n\t\t\t\t// (happens in deno), avoids `TypeError`\n\t\t\t\t// if a data listener is still present we didn't end cleanly\n\t\t\t\tconst hasDataListener = socket && socket.listenerCount('data') > 0;\n\n\t\t\t\tif (hasDataListener && !hadError) {\n\t\t\t\t\tconst err = new Error('Premature close');\n\t\t\t\t\terr.code = 'ERR_STREAM_PREMATURE_CLOSE';\n\t\t\t\t\terrorCallback(err);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t});\n}\n\nfunction destroyStream(stream, err) {\n\tif (stream.destroy) {\n\t\tstream.destroy(err);\n\t} else {\n\t\t// node < 8\n\t\tstream.emit('error', err);\n\t\tstream.end();\n\t}\n}\n\n/**\n * Redirect code matching\n *\n * @param Number code Status code\n * @return Boolean\n */\nfetch.isRedirect = function (code) {\n\treturn code === 301 || code === 302 || code === 303 || code === 307 || code === 308;\n};\n\n// expose Promise\nfetch.Promise = global.Promise;\n\nmodule.exports = exports = fetch;\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.default = exports;\nexports.Headers = Headers;\nexports.Request = Request;\nexports.Response = Response;\nexports.FetchError = FetchError;\n","\"use strict\";\n\nvar punycode = require(\"punycode\");\nvar mappingTable = require(\"./lib/mappingTable.json\");\n\nvar PROCESSING_OPTIONS = {\n TRANSITIONAL: 0,\n NONTRANSITIONAL: 1\n};\n\nfunction normalize(str) { // fix bug in v8\n return str.split('\\u0000').map(function (s) { return s.normalize('NFC'); }).join('\\u0000');\n}\n\nfunction findStatus(val) {\n var start = 0;\n var end = mappingTable.length - 1;\n\n while (start <= end) {\n var mid = Math.floor((start + end) / 2);\n\n var target = mappingTable[mid];\n if (target[0][0] <= val && target[0][1] >= val) {\n return target;\n } else if (target[0][0] > val) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n\n return null;\n}\n\nvar regexAstralSymbols = /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g;\n\nfunction countSymbols(string) {\n return string\n // replace every surrogate pair with a BMP symbol\n .replace(regexAstralSymbols, '_')\n // then get the length\n .length;\n}\n\nfunction mapChars(domain_name, useSTD3, processing_option) {\n var hasError = false;\n var processed = \"\";\n\n var len = countSymbols(domain_name);\n for (var i = 0; i < len; ++i) {\n var codePoint = domain_name.codePointAt(i);\n var status = findStatus(codePoint);\n\n switch (status[1]) {\n case \"disallowed\":\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n break;\n case \"ignored\":\n break;\n case \"mapped\":\n processed += String.fromCodePoint.apply(String, status[2]);\n break;\n case \"deviation\":\n if (processing_option === PROCESSING_OPTIONS.TRANSITIONAL) {\n processed += String.fromCodePoint.apply(String, status[2]);\n } else {\n processed += String.fromCodePoint(codePoint);\n }\n break;\n case \"valid\":\n processed += String.fromCodePoint(codePoint);\n break;\n case \"disallowed_STD3_mapped\":\n if (useSTD3) {\n hasError = true;\n processed += String.fromCodePoint(codePoint);\n } else {\n processed += String.fromCodePoint.apply(String, status[2]);\n }\n break;\n case \"disallowed_STD3_valid\":\n if (useSTD3) {\n hasError = true;\n }\n\n processed += String.fromCodePoint(codePoint);\n break;\n }\n }\n\n return {\n string: processed,\n error: hasError\n };\n}\n\nvar combiningMarksRegex = /[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u08E4-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C00-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C81-\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D01-\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B4-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1AB0-\\u1ABE\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAD\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2-\\u1CF4\\u1CF8\\u1CF9\\u1DC0-\\u1DF5\\u1DFC-\\u1DFF\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA674-\\uA67D\\uA69F\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uA9E5\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B-\\uAA7D\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uAAEB-\\uAAEF\\uAAF5\\uAAF6\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE2D]|\\uD800[\\uDDFD\\uDEE0\\uDF76-\\uDF7A]|\\uD802[\\uDE01-\\uDE03\\uDE05\\uDE06\\uDE0C-\\uDE0F\\uDE38-\\uDE3A\\uDE3F\\uDEE5\\uDEE6]|\\uD804[\\uDC00-\\uDC02\\uDC38-\\uDC46\\uDC7F-\\uDC82\\uDCB0-\\uDCBA\\uDD00-\\uDD02\\uDD27-\\uDD34\\uDD73\\uDD80-\\uDD82\\uDDB3-\\uDDC0\\uDE2C-\\uDE37\\uDEDF-\\uDEEA\\uDF01-\\uDF03\\uDF3C\\uDF3E-\\uDF44\\uDF47\\uDF48\\uDF4B-\\uDF4D\\uDF57\\uDF62\\uDF63\\uDF66-\\uDF6C\\uDF70-\\uDF74]|\\uD805[\\uDCB0-\\uDCC3\\uDDAF-\\uDDB5\\uDDB8-\\uDDC0\\uDE30-\\uDE40\\uDEAB-\\uDEB7]|\\uD81A[\\uDEF0-\\uDEF4\\uDF30-\\uDF36]|\\uD81B[\\uDF51-\\uDF7E\\uDF8F-\\uDF92]|\\uD82F[\\uDC9D\\uDC9E]|\\uD834[\\uDD65-\\uDD69\\uDD6D-\\uDD72\\uDD7B-\\uDD82\\uDD85-\\uDD8B\\uDDAA-\\uDDAD\\uDE42-\\uDE44]|\\uD83A[\\uDCD0-\\uDCD6]|\\uDB40[\\uDD00-\\uDDEF]/;\n\nfunction validateLabel(label, processing_option) {\n if (label.substr(0, 4) === \"xn--\") {\n label = punycode.toUnicode(label);\n processing_option = PROCESSING_OPTIONS.NONTRANSITIONAL;\n }\n\n var error = false;\n\n if (normalize(label) !== label ||\n (label[3] === \"-\" && label[4] === \"-\") ||\n label[0] === \"-\" || label[label.length - 1] === \"-\" ||\n label.indexOf(\".\") !== -1 ||\n label.search(combiningMarksRegex) === 0) {\n error = true;\n }\n\n var len = countSymbols(label);\n for (var i = 0; i < len; ++i) {\n var status = findStatus(label.codePointAt(i));\n if ((processing === PROCESSING_OPTIONS.TRANSITIONAL && status[1] !== \"valid\") ||\n (processing === PROCESSING_OPTIONS.NONTRANSITIONAL &&\n status[1] !== \"valid\" && status[1] !== \"deviation\")) {\n error = true;\n break;\n }\n }\n\n return {\n label: label,\n error: error\n };\n}\n\nfunction processing(domain_name, useSTD3, processing_option) {\n var result = mapChars(domain_name, useSTD3, processing_option);\n result.string = normalize(result.string);\n\n var labels = result.string.split(\".\");\n for (var i = 0; i < labels.length; ++i) {\n try {\n var validation = validateLabel(labels[i]);\n labels[i] = validation.label;\n result.error = result.error || validation.error;\n } catch(e) {\n result.error = true;\n }\n }\n\n return {\n string: labels.join(\".\"),\n error: result.error\n };\n}\n\nmodule.exports.toASCII = function(domain_name, useSTD3, processing_option, verifyDnsLength) {\n var result = processing(domain_name, useSTD3, processing_option);\n var labels = result.string.split(\".\");\n labels = labels.map(function(l) {\n try {\n return punycode.toASCII(l);\n } catch(e) {\n result.error = true;\n return l;\n }\n });\n\n if (verifyDnsLength) {\n var total = labels.slice(0, labels.length - 1).join(\".\").length;\n if (total.length > 253 || total.length === 0) {\n result.error = true;\n }\n\n for (var i=0; i < labels.length; ++i) {\n if (labels.length > 63 || labels.length === 0) {\n result.error = true;\n break;\n }\n }\n }\n\n if (result.error) return null;\n return labels.join(\".\");\n};\n\nmodule.exports.toUnicode = function(domain_name, useSTD3) {\n var result = processing(domain_name, useSTD3, PROCESSING_OPTIONS.NONTRANSITIONAL);\n\n return {\n domain: result.string,\n error: result.error\n };\n};\n\nmodule.exports.PROCESSING_OPTIONS = PROCESSING_OPTIONS;\n","\"use strict\";\n\nvar conversions = {};\nmodule.exports = conversions;\n\nfunction sign(x) {\n return x < 0 ? -1 : 1;\n}\n\nfunction evenRound(x) {\n // Round x to the nearest integer, choosing the even integer if it lies halfway between two.\n if ((x % 1) === 0.5 && (x & 1) === 0) { // [even number].5; round down (i.e. floor)\n return Math.floor(x);\n } else {\n return Math.round(x);\n }\n}\n\nfunction createNumberConversion(bitLength, typeOpts) {\n if (!typeOpts.unsigned) {\n --bitLength;\n }\n const lowerBound = typeOpts.unsigned ? 0 : -Math.pow(2, bitLength);\n const upperBound = Math.pow(2, bitLength) - 1;\n\n const moduloVal = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength) : Math.pow(2, bitLength);\n const moduloBound = typeOpts.moduloBitLength ? Math.pow(2, typeOpts.moduloBitLength - 1) : Math.pow(2, bitLength - 1);\n\n return function(V, opts) {\n if (!opts) opts = {};\n\n let x = +V;\n\n if (opts.enforceRange) {\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite number\");\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n if (x < lowerBound || x > upperBound) {\n throw new TypeError(\"Argument is not in byte range\");\n }\n\n return x;\n }\n\n if (!isNaN(x) && opts.clamp) {\n x = evenRound(x);\n\n if (x < lowerBound) x = lowerBound;\n if (x > upperBound) x = upperBound;\n return x;\n }\n\n if (!Number.isFinite(x) || x === 0) {\n return 0;\n }\n\n x = sign(x) * Math.floor(Math.abs(x));\n x = x % moduloVal;\n\n if (!typeOpts.unsigned && x >= moduloBound) {\n return x - moduloVal;\n } else if (typeOpts.unsigned) {\n if (x < 0) {\n x += moduloVal;\n } else if (x === -0) { // don't return negative zero\n return 0;\n }\n }\n\n return x;\n }\n}\n\nconversions[\"void\"] = function () {\n return undefined;\n};\n\nconversions[\"boolean\"] = function (val) {\n return !!val;\n};\n\nconversions[\"byte\"] = createNumberConversion(8, { unsigned: false });\nconversions[\"octet\"] = createNumberConversion(8, { unsigned: true });\n\nconversions[\"short\"] = createNumberConversion(16, { unsigned: false });\nconversions[\"unsigned short\"] = createNumberConversion(16, { unsigned: true });\n\nconversions[\"long\"] = createNumberConversion(32, { unsigned: false });\nconversions[\"unsigned long\"] = createNumberConversion(32, { unsigned: true });\n\nconversions[\"long long\"] = createNumberConversion(32, { unsigned: false, moduloBitLength: 64 });\nconversions[\"unsigned long long\"] = createNumberConversion(32, { unsigned: true, moduloBitLength: 64 });\n\nconversions[\"double\"] = function (V) {\n const x = +V;\n\n if (!Number.isFinite(x)) {\n throw new TypeError(\"Argument is not a finite floating-point value\");\n }\n\n return x;\n};\n\nconversions[\"unrestricted double\"] = function (V) {\n const x = +V;\n\n if (isNaN(x)) {\n throw new TypeError(\"Argument is NaN\");\n }\n\n return x;\n};\n\n// not quite valid, but good enough for JS\nconversions[\"float\"] = conversions[\"double\"];\nconversions[\"unrestricted float\"] = conversions[\"unrestricted double\"];\n\nconversions[\"DOMString\"] = function (V, opts) {\n if (!opts) opts = {};\n\n if (opts.treatNullAsEmptyString && V === null) {\n return \"\";\n }\n\n return String(V);\n};\n\nconversions[\"ByteString\"] = function (V, opts) {\n const x = String(V);\n let c = undefined;\n for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) {\n if (c > 255) {\n throw new TypeError(\"Argument is not a valid bytestring\");\n }\n }\n\n return x;\n};\n\nconversions[\"USVString\"] = function (V) {\n const S = String(V);\n const n = S.length;\n const U = [];\n for (let i = 0; i < n; ++i) {\n const c = S.charCodeAt(i);\n if (c < 0xD800 || c > 0xDFFF) {\n U.push(String.fromCodePoint(c));\n } else if (0xDC00 <= c && c <= 0xDFFF) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n if (i === n - 1) {\n U.push(String.fromCodePoint(0xFFFD));\n } else {\n const d = S.charCodeAt(i + 1);\n if (0xDC00 <= d && d <= 0xDFFF) {\n const a = c & 0x3FF;\n const b = d & 0x3FF;\n U.push(String.fromCodePoint((2 << 15) + (2 << 9) * a + b));\n ++i;\n } else {\n U.push(String.fromCodePoint(0xFFFD));\n }\n }\n }\n }\n\n return U.join('');\n};\n\nconversions[\"Date\"] = function (V, opts) {\n if (!(V instanceof Date)) {\n throw new TypeError(\"Argument is not a Date object\");\n }\n if (isNaN(V)) {\n return undefined;\n }\n\n return V;\n};\n\nconversions[\"RegExp\"] = function (V, opts) {\n if (!(V instanceof RegExp)) {\n V = new RegExp(V);\n }\n\n return V;\n};\n","\"use strict\";\nconst usm = require(\"./url-state-machine\");\n\nexports.implementation = class URLImpl {\n constructor(constructorArgs) {\n const url = constructorArgs[0];\n const base = constructorArgs[1];\n\n let parsedBase = null;\n if (base !== undefined) {\n parsedBase = usm.basicURLParse(base);\n if (parsedBase === \"failure\") {\n throw new TypeError(\"Invalid base URL\");\n }\n }\n\n const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n\n // TODO: query stuff\n }\n\n get href() {\n return usm.serializeURL(this._url);\n }\n\n set href(v) {\n const parsedURL = usm.basicURLParse(v);\n if (parsedURL === \"failure\") {\n throw new TypeError(\"Invalid URL\");\n }\n\n this._url = parsedURL;\n }\n\n get origin() {\n return usm.serializeURLOrigin(this._url);\n }\n\n get protocol() {\n return this._url.scheme + \":\";\n }\n\n set protocol(v) {\n usm.basicURLParse(v + \":\", { url: this._url, stateOverride: \"scheme start\" });\n }\n\n get username() {\n return this._url.username;\n }\n\n set username(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setTheUsername(this._url, v);\n }\n\n get password() {\n return this._url.password;\n }\n\n set password(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n usm.setThePassword(this._url, v);\n }\n\n get host() {\n const url = this._url;\n\n if (url.host === null) {\n return \"\";\n }\n\n if (url.port === null) {\n return usm.serializeHost(url.host);\n }\n\n return usm.serializeHost(url.host) + \":\" + usm.serializeInteger(url.port);\n }\n\n set host(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"host\" });\n }\n\n get hostname() {\n if (this._url.host === null) {\n return \"\";\n }\n\n return usm.serializeHost(this._url.host);\n }\n\n set hostname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n usm.basicURLParse(v, { url: this._url, stateOverride: \"hostname\" });\n }\n\n get port() {\n if (this._url.port === null) {\n return \"\";\n }\n\n return usm.serializeInteger(this._url.port);\n }\n\n set port(v) {\n if (usm.cannotHaveAUsernamePasswordPort(this._url)) {\n return;\n }\n\n if (v === \"\") {\n this._url.port = null;\n } else {\n usm.basicURLParse(v, { url: this._url, stateOverride: \"port\" });\n }\n }\n\n get pathname() {\n if (this._url.cannotBeABaseURL) {\n return this._url.path[0];\n }\n\n if (this._url.path.length === 0) {\n return \"\";\n }\n\n return \"/\" + this._url.path.join(\"/\");\n }\n\n set pathname(v) {\n if (this._url.cannotBeABaseURL) {\n return;\n }\n\n this._url.path = [];\n usm.basicURLParse(v, { url: this._url, stateOverride: \"path start\" });\n }\n\n get search() {\n if (this._url.query === null || this._url.query === \"\") {\n return \"\";\n }\n\n return \"?\" + this._url.query;\n }\n\n set search(v) {\n // TODO: query stuff\n\n const url = this._url;\n\n if (v === \"\") {\n url.query = null;\n return;\n }\n\n const input = v[0] === \"?\" ? v.substring(1) : v;\n url.query = \"\";\n usm.basicURLParse(input, { url, stateOverride: \"query\" });\n }\n\n get hash() {\n if (this._url.fragment === null || this._url.fragment === \"\") {\n return \"\";\n }\n\n return \"#\" + this._url.fragment;\n }\n\n set hash(v) {\n if (v === \"\") {\n this._url.fragment = null;\n return;\n }\n\n const input = v[0] === \"#\" ? v.substring(1) : v;\n this._url.fragment = \"\";\n usm.basicURLParse(input, { url: this._url, stateOverride: \"fragment\" });\n }\n\n toJSON() {\n return this.href;\n }\n};\n","\"use strict\";\n\nconst conversions = require(\"webidl-conversions\");\nconst utils = require(\"./utils.js\");\nconst Impl = require(\".//URL-impl.js\");\n\nconst impl = utils.implSymbol;\n\nfunction URL(url) {\n if (!this || this[impl] || !(this instanceof URL)) {\n throw new TypeError(\"Failed to construct 'URL': Please use the 'new' operator, this DOM object constructor cannot be called as a function.\");\n }\n if (arguments.length < 1) {\n throw new TypeError(\"Failed to construct 'URL': 1 argument required, but only \" + arguments.length + \" present.\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 2; ++i) {\n args[i] = arguments[i];\n }\n args[0] = conversions[\"USVString\"](args[0]);\n if (args[1] !== undefined) {\n args[1] = conversions[\"USVString\"](args[1]);\n }\n\n module.exports.setup(this, args);\n}\n\nURL.prototype.toJSON = function toJSON() {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n const args = [];\n for (let i = 0; i < arguments.length && i < 0; ++i) {\n args[i] = arguments[i];\n }\n return this[impl].toJSON.apply(this[impl], args);\n};\nObject.defineProperty(URL.prototype, \"href\", {\n get() {\n return this[impl].href;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].href = V;\n },\n enumerable: true,\n configurable: true\n});\n\nURL.prototype.toString = function () {\n if (!this || !module.exports.is(this)) {\n throw new TypeError(\"Illegal invocation\");\n }\n return this.href;\n};\n\nObject.defineProperty(URL.prototype, \"origin\", {\n get() {\n return this[impl].origin;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"protocol\", {\n get() {\n return this[impl].protocol;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].protocol = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"username\", {\n get() {\n return this[impl].username;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].username = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"password\", {\n get() {\n return this[impl].password;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].password = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"host\", {\n get() {\n return this[impl].host;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].host = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hostname\", {\n get() {\n return this[impl].hostname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hostname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"port\", {\n get() {\n return this[impl].port;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].port = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"pathname\", {\n get() {\n return this[impl].pathname;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].pathname = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"search\", {\n get() {\n return this[impl].search;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].search = V;\n },\n enumerable: true,\n configurable: true\n});\n\nObject.defineProperty(URL.prototype, \"hash\", {\n get() {\n return this[impl].hash;\n },\n set(V) {\n V = conversions[\"USVString\"](V);\n this[impl].hash = V;\n },\n enumerable: true,\n configurable: true\n});\n\n\nmodule.exports = {\n is(obj) {\n return !!obj && obj[impl] instanceof Impl.implementation;\n },\n create(constructorArgs, privateData) {\n let obj = Object.create(URL.prototype);\n this.setup(obj, constructorArgs, privateData);\n return obj;\n },\n setup(obj, constructorArgs, privateData) {\n if (!privateData) privateData = {};\n privateData.wrapper = obj;\n\n obj[impl] = new Impl.implementation(constructorArgs, privateData);\n obj[impl][utils.wrapperSymbol] = obj;\n },\n interface: URL,\n expose: {\n Window: { URL: URL },\n Worker: { URL: URL }\n }\n};\n\n","\"use strict\";\n\nexports.URL = require(\"./URL\").interface;\nexports.serializeURL = require(\"./url-state-machine\").serializeURL;\nexports.serializeURLOrigin = require(\"./url-state-machine\").serializeURLOrigin;\nexports.basicURLParse = require(\"./url-state-machine\").basicURLParse;\nexports.setTheUsername = require(\"./url-state-machine\").setTheUsername;\nexports.setThePassword = require(\"./url-state-machine\").setThePassword;\nexports.serializeHost = require(\"./url-state-machine\").serializeHost;\nexports.serializeInteger = require(\"./url-state-machine\").serializeInteger;\nexports.parseURL = require(\"./url-state-machine\").parseURL;\n","\"use strict\";\r\nconst punycode = require(\"punycode\");\r\nconst tr46 = require(\"tr46\");\r\n\r\nconst specialSchemes = {\r\n ftp: 21,\r\n file: null,\r\n gopher: 70,\r\n http: 80,\r\n https: 443,\r\n ws: 80,\r\n wss: 443\r\n};\r\n\r\nconst failure = Symbol(\"failure\");\r\n\r\nfunction countSymbols(str) {\r\n return punycode.ucs2.decode(str).length;\r\n}\r\n\r\nfunction at(input, idx) {\r\n const c = input[idx];\r\n return isNaN(c) ? undefined : String.fromCodePoint(c);\r\n}\r\n\r\nfunction isASCIIDigit(c) {\r\n return c >= 0x30 && c <= 0x39;\r\n}\r\n\r\nfunction isASCIIAlpha(c) {\r\n return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);\r\n}\r\n\r\nfunction isASCIIAlphanumeric(c) {\r\n return isASCIIAlpha(c) || isASCIIDigit(c);\r\n}\r\n\r\nfunction isASCIIHex(c) {\r\n return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66);\r\n}\r\n\r\nfunction isSingleDot(buffer) {\r\n return buffer === \".\" || buffer.toLowerCase() === \"%2e\";\r\n}\r\n\r\nfunction isDoubleDot(buffer) {\r\n buffer = buffer.toLowerCase();\r\n return buffer === \"..\" || buffer === \"%2e.\" || buffer === \".%2e\" || buffer === \"%2e%2e\";\r\n}\r\n\r\nfunction isWindowsDriveLetterCodePoints(cp1, cp2) {\r\n return isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124);\r\n}\r\n\r\nfunction isWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && (string[1] === \":\" || string[1] === \"|\");\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetterString(string) {\r\n return string.length === 2 && isASCIIAlpha(string.codePointAt(0)) && string[1] === \":\";\r\n}\r\n\r\nfunction containsForbiddenHostCodePoint(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|%|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction containsForbiddenHostCodePointExcludingPercent(string) {\r\n return string.search(/\\u0000|\\u0009|\\u000A|\\u000D|\\u0020|#|\\/|:|\\?|@|\\[|\\\\|\\]/) !== -1;\r\n}\r\n\r\nfunction isSpecialScheme(scheme) {\r\n return specialSchemes[scheme] !== undefined;\r\n}\r\n\r\nfunction isSpecial(url) {\r\n return isSpecialScheme(url.scheme);\r\n}\r\n\r\nfunction defaultPort(scheme) {\r\n return specialSchemes[scheme];\r\n}\r\n\r\nfunction percentEncode(c) {\r\n let hex = c.toString(16).toUpperCase();\r\n if (hex.length === 1) {\r\n hex = \"0\" + hex;\r\n }\r\n\r\n return \"%\" + hex;\r\n}\r\n\r\nfunction utf8PercentEncode(c) {\r\n const buf = new Buffer(c);\r\n\r\n let str = \"\";\r\n\r\n for (let i = 0; i < buf.length; ++i) {\r\n str += percentEncode(buf[i]);\r\n }\r\n\r\n return str;\r\n}\r\n\r\nfunction utf8PercentDecode(str) {\r\n const input = new Buffer(str);\r\n const output = [];\r\n for (let i = 0; i < input.length; ++i) {\r\n if (input[i] !== 37) {\r\n output.push(input[i]);\r\n } else if (input[i] === 37 && isASCIIHex(input[i + 1]) && isASCIIHex(input[i + 2])) {\r\n output.push(parseInt(input.slice(i + 1, i + 3).toString(), 16));\r\n i += 2;\r\n } else {\r\n output.push(input[i]);\r\n }\r\n }\r\n return new Buffer(output).toString();\r\n}\r\n\r\nfunction isC0ControlPercentEncode(c) {\r\n return c <= 0x1F || c > 0x7E;\r\n}\r\n\r\nconst extraPathPercentEncodeSet = new Set([32, 34, 35, 60, 62, 63, 96, 123, 125]);\r\nfunction isPathPercentEncode(c) {\r\n return isC0ControlPercentEncode(c) || extraPathPercentEncodeSet.has(c);\r\n}\r\n\r\nconst extraUserinfoPercentEncodeSet =\r\n new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]);\r\nfunction isUserinfoPercentEncode(c) {\r\n return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c);\r\n}\r\n\r\nfunction percentEncodeChar(c, encodeSetPredicate) {\r\n const cStr = String.fromCodePoint(c);\r\n\r\n if (encodeSetPredicate(c)) {\r\n return utf8PercentEncode(cStr);\r\n }\r\n\r\n return cStr;\r\n}\r\n\r\nfunction parseIPv4Number(input) {\r\n let R = 10;\r\n\r\n if (input.length >= 2 && input.charAt(0) === \"0\" && input.charAt(1).toLowerCase() === \"x\") {\r\n input = input.substring(2);\r\n R = 16;\r\n } else if (input.length >= 2 && input.charAt(0) === \"0\") {\r\n input = input.substring(1);\r\n R = 8;\r\n }\r\n\r\n if (input === \"\") {\r\n return 0;\r\n }\r\n\r\n const regex = R === 10 ? /[^0-9]/ : (R === 16 ? /[^0-9A-Fa-f]/ : /[^0-7]/);\r\n if (regex.test(input)) {\r\n return failure;\r\n }\r\n\r\n return parseInt(input, R);\r\n}\r\n\r\nfunction parseIPv4(input) {\r\n const parts = input.split(\".\");\r\n if (parts[parts.length - 1] === \"\") {\r\n if (parts.length > 1) {\r\n parts.pop();\r\n }\r\n }\r\n\r\n if (parts.length > 4) {\r\n return input;\r\n }\r\n\r\n const numbers = [];\r\n for (const part of parts) {\r\n if (part === \"\") {\r\n return input;\r\n }\r\n const n = parseIPv4Number(part);\r\n if (n === failure) {\r\n return input;\r\n }\r\n\r\n numbers.push(n);\r\n }\r\n\r\n for (let i = 0; i < numbers.length - 1; ++i) {\r\n if (numbers[i] > 255) {\r\n return failure;\r\n }\r\n }\r\n if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) {\r\n return failure;\r\n }\r\n\r\n let ipv4 = numbers.pop();\r\n let counter = 0;\r\n\r\n for (const n of numbers) {\r\n ipv4 += n * Math.pow(256, 3 - counter);\r\n ++counter;\r\n }\r\n\r\n return ipv4;\r\n}\r\n\r\nfunction serializeIPv4(address) {\r\n let output = \"\";\r\n let n = address;\r\n\r\n for (let i = 1; i <= 4; ++i) {\r\n output = String(n % 256) + output;\r\n if (i !== 4) {\r\n output = \".\" + output;\r\n }\r\n n = Math.floor(n / 256);\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseIPv6(input) {\r\n const address = [0, 0, 0, 0, 0, 0, 0, 0];\r\n let pieceIndex = 0;\r\n let compress = null;\r\n let pointer = 0;\r\n\r\n input = punycode.ucs2.decode(input);\r\n\r\n if (input[pointer] === 58) {\r\n if (input[pointer + 1] !== 58) {\r\n return failure;\r\n }\r\n\r\n pointer += 2;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n }\r\n\r\n while (pointer < input.length) {\r\n if (pieceIndex === 8) {\r\n return failure;\r\n }\r\n\r\n if (input[pointer] === 58) {\r\n if (compress !== null) {\r\n return failure;\r\n }\r\n ++pointer;\r\n ++pieceIndex;\r\n compress = pieceIndex;\r\n continue;\r\n }\r\n\r\n let value = 0;\r\n let length = 0;\r\n\r\n while (length < 4 && isASCIIHex(input[pointer])) {\r\n value = value * 0x10 + parseInt(at(input, pointer), 16);\r\n ++pointer;\r\n ++length;\r\n }\r\n\r\n if (input[pointer] === 46) {\r\n if (length === 0) {\r\n return failure;\r\n }\r\n\r\n pointer -= length;\r\n\r\n if (pieceIndex > 6) {\r\n return failure;\r\n }\r\n\r\n let numbersSeen = 0;\r\n\r\n while (input[pointer] !== undefined) {\r\n let ipv4Piece = null;\r\n\r\n if (numbersSeen > 0) {\r\n if (input[pointer] === 46 && numbersSeen < 4) {\r\n ++pointer;\r\n } else {\r\n return failure;\r\n }\r\n }\r\n\r\n if (!isASCIIDigit(input[pointer])) {\r\n return failure;\r\n }\r\n\r\n while (isASCIIDigit(input[pointer])) {\r\n const number = parseInt(at(input, pointer));\r\n if (ipv4Piece === null) {\r\n ipv4Piece = number;\r\n } else if (ipv4Piece === 0) {\r\n return failure;\r\n } else {\r\n ipv4Piece = ipv4Piece * 10 + number;\r\n }\r\n if (ipv4Piece > 255) {\r\n return failure;\r\n }\r\n ++pointer;\r\n }\r\n\r\n address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece;\r\n\r\n ++numbersSeen;\r\n\r\n if (numbersSeen === 2 || numbersSeen === 4) {\r\n ++pieceIndex;\r\n }\r\n }\r\n\r\n if (numbersSeen !== 4) {\r\n return failure;\r\n }\r\n\r\n break;\r\n } else if (input[pointer] === 58) {\r\n ++pointer;\r\n if (input[pointer] === undefined) {\r\n return failure;\r\n }\r\n } else if (input[pointer] !== undefined) {\r\n return failure;\r\n }\r\n\r\n address[pieceIndex] = value;\r\n ++pieceIndex;\r\n }\r\n\r\n if (compress !== null) {\r\n let swaps = pieceIndex - compress;\r\n pieceIndex = 7;\r\n while (pieceIndex !== 0 && swaps > 0) {\r\n const temp = address[compress + swaps - 1];\r\n address[compress + swaps - 1] = address[pieceIndex];\r\n address[pieceIndex] = temp;\r\n --pieceIndex;\r\n --swaps;\r\n }\r\n } else if (compress === null && pieceIndex !== 8) {\r\n return failure;\r\n }\r\n\r\n return address;\r\n}\r\n\r\nfunction serializeIPv6(address) {\r\n let output = \"\";\r\n const seqResult = findLongestZeroSequence(address);\r\n const compress = seqResult.idx;\r\n let ignore0 = false;\r\n\r\n for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {\r\n if (ignore0 && address[pieceIndex] === 0) {\r\n continue;\r\n } else if (ignore0) {\r\n ignore0 = false;\r\n }\r\n\r\n if (compress === pieceIndex) {\r\n const separator = pieceIndex === 0 ? \"::\" : \":\";\r\n output += separator;\r\n ignore0 = true;\r\n continue;\r\n }\r\n\r\n output += address[pieceIndex].toString(16);\r\n\r\n if (pieceIndex !== 7) {\r\n output += \":\";\r\n }\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction parseHost(input, isSpecialArg) {\r\n if (input[0] === \"[\") {\r\n if (input[input.length - 1] !== \"]\") {\r\n return failure;\r\n }\r\n\r\n return parseIPv6(input.substring(1, input.length - 1));\r\n }\r\n\r\n if (!isSpecialArg) {\r\n return parseOpaqueHost(input);\r\n }\r\n\r\n const domain = utf8PercentDecode(input);\r\n const asciiDomain = tr46.toASCII(domain, false, tr46.PROCESSING_OPTIONS.NONTRANSITIONAL, false);\r\n if (asciiDomain === null) {\r\n return failure;\r\n }\r\n\r\n if (containsForbiddenHostCodePoint(asciiDomain)) {\r\n return failure;\r\n }\r\n\r\n const ipv4Host = parseIPv4(asciiDomain);\r\n if (typeof ipv4Host === \"number\" || ipv4Host === failure) {\r\n return ipv4Host;\r\n }\r\n\r\n return asciiDomain;\r\n}\r\n\r\nfunction parseOpaqueHost(input) {\r\n if (containsForbiddenHostCodePointExcludingPercent(input)) {\r\n return failure;\r\n }\r\n\r\n let output = \"\";\r\n const decoded = punycode.ucs2.decode(input);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n output += percentEncodeChar(decoded[i], isC0ControlPercentEncode);\r\n }\r\n return output;\r\n}\r\n\r\nfunction findLongestZeroSequence(arr) {\r\n let maxIdx = null;\r\n let maxLen = 1; // only find elements > 1\r\n let currStart = null;\r\n let currLen = 0;\r\n\r\n for (let i = 0; i < arr.length; ++i) {\r\n if (arr[i] !== 0) {\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n currStart = null;\r\n currLen = 0;\r\n } else {\r\n if (currStart === null) {\r\n currStart = i;\r\n }\r\n ++currLen;\r\n }\r\n }\r\n\r\n // if trailing zeros\r\n if (currLen > maxLen) {\r\n maxIdx = currStart;\r\n maxLen = currLen;\r\n }\r\n\r\n return {\r\n idx: maxIdx,\r\n len: maxLen\r\n };\r\n}\r\n\r\nfunction serializeHost(host) {\r\n if (typeof host === \"number\") {\r\n return serializeIPv4(host);\r\n }\r\n\r\n // IPv6 serializer\r\n if (host instanceof Array) {\r\n return \"[\" + serializeIPv6(host) + \"]\";\r\n }\r\n\r\n return host;\r\n}\r\n\r\nfunction trimControlChars(url) {\r\n return url.replace(/^[\\u0000-\\u001F\\u0020]+|[\\u0000-\\u001F\\u0020]+$/g, \"\");\r\n}\r\n\r\nfunction trimTabAndNewline(url) {\r\n return url.replace(/\\u0009|\\u000A|\\u000D/g, \"\");\r\n}\r\n\r\nfunction shortenPath(url) {\r\n const path = url.path;\r\n if (path.length === 0) {\r\n return;\r\n }\r\n if (url.scheme === \"file\" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) {\r\n return;\r\n }\r\n\r\n path.pop();\r\n}\r\n\r\nfunction includesCredentials(url) {\r\n return url.username !== \"\" || url.password !== \"\";\r\n}\r\n\r\nfunction cannotHaveAUsernamePasswordPort(url) {\r\n return url.host === null || url.host === \"\" || url.cannotBeABaseURL || url.scheme === \"file\";\r\n}\r\n\r\nfunction isNormalizedWindowsDriveLetter(string) {\r\n return /^[A-Za-z]:$/.test(string);\r\n}\r\n\r\nfunction URLStateMachine(input, base, encodingOverride, url, stateOverride) {\r\n this.pointer = 0;\r\n this.input = input;\r\n this.base = base || null;\r\n this.encodingOverride = encodingOverride || \"utf-8\";\r\n this.stateOverride = stateOverride;\r\n this.url = url;\r\n this.failure = false;\r\n this.parseError = false;\r\n\r\n if (!this.url) {\r\n this.url = {\r\n scheme: \"\",\r\n username: \"\",\r\n password: \"\",\r\n host: null,\r\n port: null,\r\n path: [],\r\n query: null,\r\n fragment: null,\r\n\r\n cannotBeABaseURL: false\r\n };\r\n\r\n const res = trimControlChars(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n }\r\n\r\n const res = trimTabAndNewline(this.input);\r\n if (res !== this.input) {\r\n this.parseError = true;\r\n }\r\n this.input = res;\r\n\r\n this.state = stateOverride || \"scheme start\";\r\n\r\n this.buffer = \"\";\r\n this.atFlag = false;\r\n this.arrFlag = false;\r\n this.passwordTokenSeenFlag = false;\r\n\r\n this.input = punycode.ucs2.decode(this.input);\r\n\r\n for (; this.pointer <= this.input.length; ++this.pointer) {\r\n const c = this.input[this.pointer];\r\n const cStr = isNaN(c) ? undefined : String.fromCodePoint(c);\r\n\r\n // exec state machine\r\n const ret = this[\"parse \" + this.state](c, cStr);\r\n if (!ret) {\r\n break; // terminate algorithm\r\n } else if (ret === failure) {\r\n this.failure = true;\r\n break;\r\n }\r\n }\r\n}\r\n\r\nURLStateMachine.prototype[\"parse scheme start\"] = function parseSchemeStart(c, cStr) {\r\n if (isASCIIAlpha(c)) {\r\n this.buffer += cStr.toLowerCase();\r\n this.state = \"scheme\";\r\n } else if (!this.stateOverride) {\r\n this.state = \"no scheme\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse scheme\"] = function parseScheme(c, cStr) {\r\n if (isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) {\r\n this.buffer += cStr.toLowerCase();\r\n } else if (c === 58) {\r\n if (this.stateOverride) {\r\n if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) {\r\n return false;\r\n }\r\n\r\n if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === \"file\") {\r\n return false;\r\n }\r\n\r\n if (this.url.scheme === \"file\" && (this.url.host === \"\" || this.url.host === null)) {\r\n return false;\r\n }\r\n }\r\n this.url.scheme = this.buffer;\r\n this.buffer = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n if (this.url.scheme === \"file\") {\r\n if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file\";\r\n } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) {\r\n this.state = \"special relative or authority\";\r\n } else if (isSpecial(this.url)) {\r\n this.state = \"special authority slashes\";\r\n } else if (this.input[this.pointer + 1] === 47) {\r\n this.state = \"path or authority\";\r\n ++this.pointer;\r\n } else {\r\n this.url.cannotBeABaseURL = true;\r\n this.url.path.push(\"\");\r\n this.state = \"cannot-be-a-base-URL path\";\r\n }\r\n } else if (!this.stateOverride) {\r\n this.buffer = \"\";\r\n this.state = \"no scheme\";\r\n this.pointer = -1;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse no scheme\"] = function parseNoScheme(c) {\r\n if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) {\r\n return failure;\r\n } else if (this.base.cannotBeABaseURL && c === 35) {\r\n this.url.scheme = this.base.scheme;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.url.cannotBeABaseURL = true;\r\n this.state = \"fragment\";\r\n } else if (this.base.scheme === \"file\") {\r\n this.state = \"file\";\r\n --this.pointer;\r\n } else {\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special relative or authority\"] = function parseSpecialRelativeOrAuthority(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"relative\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path or authority\"] = function parsePathOrAuthority(c) {\r\n if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative\"] = function parseRelative(c) {\r\n this.url.scheme = this.base.scheme;\r\n if (isNaN(c)) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 47) {\r\n this.state = \"relative slash\";\r\n } else if (c === 63) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n this.state = \"relative slash\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.url.path = this.base.path.slice(0, this.base.path.length - 1);\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse relative slash\"] = function parseRelativeSlash(c) {\r\n if (isSpecial(this.url) && (c === 47 || c === 92)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"special authority ignore slashes\";\r\n } else if (c === 47) {\r\n this.state = \"authority\";\r\n } else {\r\n this.url.username = this.base.username;\r\n this.url.password = this.base.password;\r\n this.url.host = this.base.host;\r\n this.url.port = this.base.port;\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority slashes\"] = function parseSpecialAuthoritySlashes(c) {\r\n if (c === 47 && this.input[this.pointer + 1] === 47) {\r\n this.state = \"special authority ignore slashes\";\r\n ++this.pointer;\r\n } else {\r\n this.parseError = true;\r\n this.state = \"special authority ignore slashes\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse special authority ignore slashes\"] = function parseSpecialAuthorityIgnoreSlashes(c) {\r\n if (c !== 47 && c !== 92) {\r\n this.state = \"authority\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse authority\"] = function parseAuthority(c, cStr) {\r\n if (c === 64) {\r\n this.parseError = true;\r\n if (this.atFlag) {\r\n this.buffer = \"%40\" + this.buffer;\r\n }\r\n this.atFlag = true;\r\n\r\n // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars\r\n const len = countSymbols(this.buffer);\r\n for (let pointer = 0; pointer < len; ++pointer) {\r\n const codePoint = this.buffer.codePointAt(pointer);\r\n\r\n if (codePoint === 58 && !this.passwordTokenSeenFlag) {\r\n this.passwordTokenSeenFlag = true;\r\n continue;\r\n }\r\n const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode);\r\n if (this.passwordTokenSeenFlag) {\r\n this.url.password += encodedCodePoints;\r\n } else {\r\n this.url.username += encodedCodePoints;\r\n }\r\n }\r\n this.buffer = \"\";\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n if (this.atFlag && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.pointer -= countSymbols(this.buffer) + 1;\r\n this.buffer = \"\";\r\n this.state = \"host\";\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse hostname\"] =\r\nURLStateMachine.prototype[\"parse host\"] = function parseHostName(c, cStr) {\r\n if (this.stateOverride && this.url.scheme === \"file\") {\r\n --this.pointer;\r\n this.state = \"file host\";\r\n } else if (c === 58 && !this.arrFlag) {\r\n if (this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"port\";\r\n if (this.stateOverride === \"hostname\") {\r\n return false;\r\n }\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92)) {\r\n --this.pointer;\r\n if (isSpecial(this.url) && this.buffer === \"\") {\r\n this.parseError = true;\r\n return failure;\r\n } else if (this.stateOverride && this.buffer === \"\" &&\r\n (includesCredentials(this.url) || this.url.port !== null)) {\r\n this.parseError = true;\r\n return false;\r\n }\r\n\r\n const host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n\r\n this.url.host = host;\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n } else {\r\n if (c === 91) {\r\n this.arrFlag = true;\r\n } else if (c === 93) {\r\n this.arrFlag = false;\r\n }\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse port\"] = function parsePort(c, cStr) {\r\n if (isASCIIDigit(c)) {\r\n this.buffer += cStr;\r\n } else if (isNaN(c) || c === 47 || c === 63 || c === 35 ||\r\n (isSpecial(this.url) && c === 92) ||\r\n this.stateOverride) {\r\n if (this.buffer !== \"\") {\r\n const port = parseInt(this.buffer);\r\n if (port > Math.pow(2, 16) - 1) {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n this.url.port = port === defaultPort(this.url.scheme) ? null : port;\r\n this.buffer = \"\";\r\n }\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n --this.pointer;\r\n } else {\r\n this.parseError = true;\r\n return failure;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nconst fileOtherwiseCodePoints = new Set([47, 92, 63, 35]);\r\n\r\nURLStateMachine.prototype[\"parse file\"] = function parseFile(c) {\r\n this.url.scheme = \"file\";\r\n\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file slash\";\r\n } else if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNaN(c)) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n } else if (c === 63) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n this.url.query = this.base.query;\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n if (this.input.length - this.pointer - 1 === 0 || // remaining consists of 0 code points\r\n !isWindowsDriveLetterCodePoints(c, this.input[this.pointer + 1]) ||\r\n (this.input.length - this.pointer - 1 >= 2 && // remaining has at least 2 code points\r\n !fileOtherwiseCodePoints.has(this.input[this.pointer + 2]))) {\r\n this.url.host = this.base.host;\r\n this.url.path = this.base.path.slice();\r\n shortenPath(this.url);\r\n } else {\r\n this.parseError = true;\r\n }\r\n\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n } else {\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file slash\"] = function parseFileSlash(c) {\r\n if (c === 47 || c === 92) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"file host\";\r\n } else {\r\n if (this.base !== null && this.base.scheme === \"file\") {\r\n if (isNormalizedWindowsDriveLetterString(this.base.path[0])) {\r\n this.url.path.push(this.base.path[0]);\r\n } else {\r\n this.url.host = this.base.host;\r\n }\r\n }\r\n this.state = \"path\";\r\n --this.pointer;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse file host\"] = function parseFileHost(c, cStr) {\r\n if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) {\r\n --this.pointer;\r\n if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) {\r\n this.parseError = true;\r\n this.state = \"path\";\r\n } else if (this.buffer === \"\") {\r\n this.url.host = \"\";\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n this.state = \"path start\";\r\n } else {\r\n let host = parseHost(this.buffer, isSpecial(this.url));\r\n if (host === failure) {\r\n return failure;\r\n }\r\n if (host === \"localhost\") {\r\n host = \"\";\r\n }\r\n this.url.host = host;\r\n\r\n if (this.stateOverride) {\r\n return false;\r\n }\r\n\r\n this.buffer = \"\";\r\n this.state = \"path start\";\r\n }\r\n } else {\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path start\"] = function parsePathStart(c) {\r\n if (isSpecial(this.url)) {\r\n if (c === 92) {\r\n this.parseError = true;\r\n }\r\n this.state = \"path\";\r\n\r\n if (c !== 47 && c !== 92) {\r\n --this.pointer;\r\n }\r\n } else if (!this.stateOverride && c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (!this.stateOverride && c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else if (c !== undefined) {\r\n this.state = \"path\";\r\n if (c !== 47) {\r\n --this.pointer;\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse path\"] = function parsePath(c) {\r\n if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) ||\r\n (!this.stateOverride && (c === 63 || c === 35))) {\r\n if (isSpecial(this.url) && c === 92) {\r\n this.parseError = true;\r\n }\r\n\r\n if (isDoubleDot(this.buffer)) {\r\n shortenPath(this.url);\r\n if (c !== 47 && !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n }\r\n } else if (isSingleDot(this.buffer) && c !== 47 &&\r\n !(isSpecial(this.url) && c === 92)) {\r\n this.url.path.push(\"\");\r\n } else if (!isSingleDot(this.buffer)) {\r\n if (this.url.scheme === \"file\" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) {\r\n if (this.url.host !== \"\" && this.url.host !== null) {\r\n this.parseError = true;\r\n this.url.host = \"\";\r\n }\r\n this.buffer = this.buffer[0] + \":\";\r\n }\r\n this.url.path.push(this.buffer);\r\n }\r\n this.buffer = \"\";\r\n if (this.url.scheme === \"file\" && (c === undefined || c === 63 || c === 35)) {\r\n while (this.url.path.length > 1 && this.url.path[0] === \"\") {\r\n this.parseError = true;\r\n this.url.path.shift();\r\n }\r\n }\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n }\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += percentEncodeChar(c, isPathPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse cannot-be-a-base-URL path\"] = function parseCannotBeABaseURLPath(c) {\r\n if (c === 63) {\r\n this.url.query = \"\";\r\n this.state = \"query\";\r\n } else if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n } else {\r\n // TODO: Add: not a URL code point\r\n if (!isNaN(c) && c !== 37) {\r\n this.parseError = true;\r\n }\r\n\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n if (!isNaN(c)) {\r\n this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse query\"] = function parseQuery(c, cStr) {\r\n if (isNaN(c) || (!this.stateOverride && c === 35)) {\r\n if (!isSpecial(this.url) || this.url.scheme === \"ws\" || this.url.scheme === \"wss\") {\r\n this.encodingOverride = \"utf-8\";\r\n }\r\n\r\n const buffer = new Buffer(this.buffer); // TODO: Use encoding override instead\r\n for (let i = 0; i < buffer.length; ++i) {\r\n if (buffer[i] < 0x21 || buffer[i] > 0x7E || buffer[i] === 0x22 || buffer[i] === 0x23 ||\r\n buffer[i] === 0x3C || buffer[i] === 0x3E) {\r\n this.url.query += percentEncode(buffer[i]);\r\n } else {\r\n this.url.query += String.fromCodePoint(buffer[i]);\r\n }\r\n }\r\n\r\n this.buffer = \"\";\r\n if (c === 35) {\r\n this.url.fragment = \"\";\r\n this.state = \"fragment\";\r\n }\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.buffer += cStr;\r\n }\r\n\r\n return true;\r\n};\r\n\r\nURLStateMachine.prototype[\"parse fragment\"] = function parseFragment(c) {\r\n if (isNaN(c)) { // do nothing\r\n } else if (c === 0x0) {\r\n this.parseError = true;\r\n } else {\r\n // TODO: If c is not a URL code point and not \"%\", parse error.\r\n if (c === 37 &&\r\n (!isASCIIHex(this.input[this.pointer + 1]) ||\r\n !isASCIIHex(this.input[this.pointer + 2]))) {\r\n this.parseError = true;\r\n }\r\n\r\n this.url.fragment += percentEncodeChar(c, isC0ControlPercentEncode);\r\n }\r\n\r\n return true;\r\n};\r\n\r\nfunction serializeURL(url, excludeFragment) {\r\n let output = url.scheme + \":\";\r\n if (url.host !== null) {\r\n output += \"//\";\r\n\r\n if (url.username !== \"\" || url.password !== \"\") {\r\n output += url.username;\r\n if (url.password !== \"\") {\r\n output += \":\" + url.password;\r\n }\r\n output += \"@\";\r\n }\r\n\r\n output += serializeHost(url.host);\r\n\r\n if (url.port !== null) {\r\n output += \":\" + url.port;\r\n }\r\n } else if (url.host === null && url.scheme === \"file\") {\r\n output += \"//\";\r\n }\r\n\r\n if (url.cannotBeABaseURL) {\r\n output += url.path[0];\r\n } else {\r\n for (const string of url.path) {\r\n output += \"/\" + string;\r\n }\r\n }\r\n\r\n if (url.query !== null) {\r\n output += \"?\" + url.query;\r\n }\r\n\r\n if (!excludeFragment && url.fragment !== null) {\r\n output += \"#\" + url.fragment;\r\n }\r\n\r\n return output;\r\n}\r\n\r\nfunction serializeOrigin(tuple) {\r\n let result = tuple.scheme + \"://\";\r\n result += serializeHost(tuple.host);\r\n\r\n if (tuple.port !== null) {\r\n result += \":\" + tuple.port;\r\n }\r\n\r\n return result;\r\n}\r\n\r\nmodule.exports.serializeURL = serializeURL;\r\n\r\nmodule.exports.serializeURLOrigin = function (url) {\r\n // https://url.spec.whatwg.org/#concept-url-origin\r\n switch (url.scheme) {\r\n case \"blob\":\r\n try {\r\n return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0]));\r\n } catch (e) {\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n case \"ftp\":\r\n case \"gopher\":\r\n case \"http\":\r\n case \"https\":\r\n case \"ws\":\r\n case \"wss\":\r\n return serializeOrigin({\r\n scheme: url.scheme,\r\n host: url.host,\r\n port: url.port\r\n });\r\n case \"file\":\r\n // spec says \"exercise to the reader\", chrome says \"file://\"\r\n return \"file://\";\r\n default:\r\n // serializing an opaque origin returns \"null\"\r\n return \"null\";\r\n }\r\n};\r\n\r\nmodule.exports.basicURLParse = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride);\r\n if (usm.failure) {\r\n return \"failure\";\r\n }\r\n\r\n return usm.url;\r\n};\r\n\r\nmodule.exports.setTheUsername = function (url, username) {\r\n url.username = \"\";\r\n const decoded = punycode.ucs2.decode(username);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.setThePassword = function (url, password) {\r\n url.password = \"\";\r\n const decoded = punycode.ucs2.decode(password);\r\n for (let i = 0; i < decoded.length; ++i) {\r\n url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode);\r\n }\r\n};\r\n\r\nmodule.exports.serializeHost = serializeHost;\r\n\r\nmodule.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;\r\n\r\nmodule.exports.serializeInteger = function (integer) {\r\n return String(integer);\r\n};\r\n\r\nmodule.exports.parseURL = function (input, options) {\r\n if (options === undefined) {\r\n options = {};\r\n }\r\n\r\n // We don't handle blobs, so this just delegates:\r\n return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride });\r\n};\r\n","\"use strict\";\n\nmodule.exports.mixin = function mixin(target, source) {\n const keys = Object.getOwnPropertyNames(source);\n for (let i = 0; i < keys.length; ++i) {\n Object.defineProperty(target, keys[i], Object.getOwnPropertyDescriptor(source, keys[i]));\n }\n};\n\nmodule.exports.wrapperSymbol = Symbol(\"wrapper\");\nmodule.exports.implSymbol = Symbol(\"impl\");\n\nmodule.exports.wrapperForImpl = function (impl) {\n return impl[module.exports.wrapperSymbol];\n};\n\nmodule.exports.implForWrapper = function (wrapper) {\n return wrapper[module.exports.implSymbol];\n};\n\n","'use strict';\nconst path = require('path');\nconst pathKey = require('path-key');\n\nconst npmRunPath = options => {\n\toptions = {\n\t\tcwd: process.cwd(),\n\t\tpath: process.env[pathKey()],\n\t\texecPath: process.execPath,\n\t\t...options\n\t};\n\n\tlet previous;\n\tlet cwdPath = path.resolve(options.cwd);\n\tconst result = [];\n\n\twhile (previous !== cwdPath) {\n\t\tresult.push(path.join(cwdPath, 'node_modules/.bin'));\n\t\tprevious = cwdPath;\n\t\tcwdPath = path.resolve(cwdPath, '..');\n\t}\n\n\t// Ensure the running `node` binary is used\n\tconst execPathDir = path.resolve(options.cwd, options.execPath, '..');\n\tresult.push(execPathDir);\n\n\treturn result.concat(options.path).join(path.delimiter);\n};\n\nmodule.exports = npmRunPath;\n// TODO: Remove this for the next major release\nmodule.exports.default = npmRunPath;\n\nmodule.exports.env = options => {\n\toptions = {\n\t\tenv: process.env,\n\t\t...options\n\t};\n\n\tconst env = {...options.env};\n\tconst path = pathKey({env});\n\n\toptions.path = env[path];\n\tenv[path] = module.exports(options);\n\n\treturn env;\n};\n","var crypto = require('crypto')\n\nfunction sha (key, body, algorithm) {\n return crypto.createHmac(algorithm, key).update(body).digest('base64')\n}\n\nfunction rsa (key, body) {\n return crypto.createSign('RSA-SHA1').update(body).sign(key, 'base64')\n}\n\nfunction rfc3986 (str) {\n return encodeURIComponent(str)\n .replace(/!/g,'%21')\n .replace(/\\*/g,'%2A')\n .replace(/\\(/g,'%28')\n .replace(/\\)/g,'%29')\n .replace(/'/g,'%27')\n}\n\n// Maps object to bi-dimensional array\n// Converts { foo: 'A', bar: [ 'b', 'B' ]} to\n// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]\nfunction map (obj) {\n var key, val, arr = []\n for (key in obj) {\n val = obj[key]\n if (Array.isArray(val))\n for (var i = 0; i < val.length; i++)\n arr.push([key, val[i]])\n else if (typeof val === 'object')\n for (var prop in val)\n arr.push([key + '[' + prop + ']', val[prop]])\n else\n arr.push([key, val])\n }\n return arr\n}\n\n// Compare function for sort\nfunction compare (a, b) {\n return a > b ? 1 : a < b ? -1 : 0\n}\n\nfunction generateBase (httpMethod, base_uri, params) {\n // adapted from https://dev.twitter.com/docs/auth/oauth and \n // https://dev.twitter.com/docs/auth/creating-signature\n\n // Parameter normalization\n // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2\n var normalized = map(params)\n // 1. First, the name and value of each parameter are encoded\n .map(function (p) {\n return [ rfc3986(p[0]), rfc3986(p[1] || '') ]\n })\n // 2. The parameters are sorted by name, using ascending byte value\n // ordering. If two or more parameters share the same name, they\n // are sorted by their value.\n .sort(function (a, b) {\n return compare(a[0], b[0]) || compare(a[1], b[1])\n })\n // 3. The name of each parameter is concatenated to its corresponding\n // value using an \"=\" character (ASCII code 61) as a separator, even\n // if the value is empty.\n .map(function (p) { return p.join('=') })\n // 4. The sorted name/value pairs are concatenated together into a\n // single string by using an \"&\" character (ASCII code 38) as\n // separator.\n .join('&')\n\n var base = [\n rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),\n rfc3986(base_uri),\n rfc3986(normalized)\n ].join('&')\n\n return base\n}\n\nfunction hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return sha(key, base, 'sha1')\n}\n\nfunction hmacsign256 (httpMethod, base_uri, params, consumer_secret, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return sha(key, base, 'sha256')\n}\n\nfunction rsasign (httpMethod, base_uri, params, private_key, token_secret) {\n var base = generateBase(httpMethod, base_uri, params)\n var key = private_key || ''\n\n return rsa(key, base)\n}\n\nfunction plaintext (consumer_secret, token_secret) {\n var key = [\n consumer_secret || '',\n token_secret || ''\n ].map(rfc3986).join('&')\n\n return key\n}\n\nfunction sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {\n var method\n var skipArgs = 1\n\n switch (signMethod) {\n case 'RSA-SHA1':\n method = rsasign\n break\n case 'HMAC-SHA1':\n method = hmacsign\n break\n case 'HMAC-SHA256':\n method = hmacsign256\n break\n case 'PLAINTEXT':\n method = plaintext\n skipArgs = 4\n break\n default:\n throw new Error('Signature method not supported: ' + signMethod)\n }\n\n return method.apply(null, [].slice.call(arguments, skipArgs))\n}\n\nexports.hmacsign = hmacsign\nexports.hmacsign256 = hmacsign256\nexports.rsasign = rsasign\nexports.plaintext = plaintext\nexports.sign = sign\nexports.rfc3986 = rfc3986\nexports.generateBase = generateBase","'use strict';\n\nvar crypto = require('crypto');\n\n/**\n * Exported function\n *\n * Options:\n *\n * - `algorithm` hash algo to be used by this instance: *'sha1', 'md5'\n * - `excludeValues` {true|*false} hash object keys, values ignored\n * - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64'\n * - `ignoreUnknown` {true|*false} ignore unknown object types\n * - `replacer` optional function that replaces values before hashing\n * - `respectFunctionProperties` {*true|false} consider function properties when hashing\n * - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing\n * - `respectType` {*true|false} Respect special properties (prototype, constructor)\n * when hashing to distinguish between types\n * - `unorderedArrays` {true|*false} Sort all arrays before hashing\n * - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing\n * * = default\n *\n * @param {object} object value to hash\n * @param {object} options hashing options\n * @return {string} hash value\n * @api public\n */\nexports = module.exports = objectHash;\n\nfunction objectHash(object, options){\n options = applyDefaults(object, options);\n\n return hash(object, options);\n}\n\n/**\n * Exported sugar methods\n *\n * @param {object} object value to hash\n * @return {string} hash value\n * @api public\n */\nexports.sha1 = function(object){\n return objectHash(object);\n};\nexports.keys = function(object){\n return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'});\n};\nexports.MD5 = function(object){\n return objectHash(object, {algorithm: 'md5', encoding: 'hex'});\n};\nexports.keysMD5 = function(object){\n return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true});\n};\n\n// Internals\nvar hashes = crypto.getHashes ? crypto.getHashes().slice() : ['sha1', 'md5'];\nhashes.push('passthrough');\nvar encodings = ['buffer', 'hex', 'binary', 'base64'];\n\nfunction applyDefaults(object, sourceOptions){\n sourceOptions = sourceOptions || {};\n\n // create a copy rather than mutating\n var options = {};\n options.algorithm = sourceOptions.algorithm || 'sha1';\n options.encoding = sourceOptions.encoding || 'hex';\n options.excludeValues = sourceOptions.excludeValues ? true : false;\n options.algorithm = options.algorithm.toLowerCase();\n options.encoding = options.encoding.toLowerCase();\n options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false\n options.respectType = sourceOptions.respectType === false ? false : true; // default to true\n options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;\n options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;\n options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false\n options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false\n options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true\n options.replacer = sourceOptions.replacer || undefined;\n options.excludeKeys = sourceOptions.excludeKeys || undefined;\n\n if(typeof object === 'undefined') {\n throw new Error('Object argument required.');\n }\n\n // if there is a case-insensitive match in the hashes list, accept it\n // (i.e. SHA256 for sha256)\n for (var i = 0; i < hashes.length; ++i) {\n if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) {\n options.algorithm = hashes[i];\n }\n }\n\n if(hashes.indexOf(options.algorithm) === -1){\n throw new Error('Algorithm \"' + options.algorithm + '\" not supported. ' +\n 'supported values: ' + hashes.join(', '));\n }\n\n if(encodings.indexOf(options.encoding) === -1 &&\n options.algorithm !== 'passthrough'){\n throw new Error('Encoding \"' + options.encoding + '\" not supported. ' +\n 'supported values: ' + encodings.join(', '));\n }\n\n return options;\n}\n\n/** Check if the given function is a native function */\nfunction isNativeFunction(f) {\n if ((typeof f) !== 'function') {\n return false;\n }\n var exp = /^function\\s+\\w*\\s*\\(\\s*\\)\\s*{\\s+\\[native code\\]\\s+}$/i;\n return exp.exec(Function.prototype.toString.call(f)) != null;\n}\n\nfunction hash(object, options) {\n var hashingStream;\n\n if (options.algorithm !== 'passthrough') {\n hashingStream = crypto.createHash(options.algorithm);\n } else {\n hashingStream = new PassThrough();\n }\n\n if (typeof hashingStream.write === 'undefined') {\n hashingStream.write = hashingStream.update;\n hashingStream.end = hashingStream.update;\n }\n\n var hasher = typeHasher(options, hashingStream);\n hasher.dispatch(object);\n if (!hashingStream.update) {\n hashingStream.end('');\n }\n\n if (hashingStream.digest) {\n return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding);\n }\n\n var buf = hashingStream.read();\n if (options.encoding === 'buffer') {\n return buf;\n }\n\n return buf.toString(options.encoding);\n}\n\n/**\n * Expose streaming API\n *\n * @param {object} object Value to serialize\n * @param {object} options Options, as for hash()\n * @param {object} stream A stream to write the serializiation to\n * @api public\n */\nexports.writeToStream = function(object, options, stream) {\n if (typeof stream === 'undefined') {\n stream = options;\n options = {};\n }\n\n options = applyDefaults(object, options);\n\n return typeHasher(options, stream).dispatch(object);\n};\n\nfunction typeHasher(options, writeTo, context){\n context = context || [];\n var write = function(str) {\n if (writeTo.update) {\n return writeTo.update(str, 'utf8');\n } else {\n return writeTo.write(str, 'utf8');\n }\n };\n\n return {\n dispatch: function(value){\n if (options.replacer) {\n value = options.replacer(value);\n }\n\n var type = typeof value;\n if (value === null) {\n type = 'null';\n }\n\n //console.log(\"[DEBUG] Dispatch: \", value, \"->\", type, \" -> \", \"_\" + type);\n\n return this['_' + type](value);\n },\n _object: function(object) {\n var pattern = (/\\[object (.*)\\]/i);\n var objString = Object.prototype.toString.call(object);\n var objType = pattern.exec(objString);\n if (!objType) { // object type did not match [object ...]\n objType = 'unknown:[' + objString + ']';\n } else {\n objType = objType[1]; // take only the class name\n }\n\n objType = objType.toLowerCase();\n\n var objectNumber = null;\n\n if ((objectNumber = context.indexOf(object)) >= 0) {\n return this.dispatch('[CIRCULAR:' + objectNumber + ']');\n } else {\n context.push(object);\n }\n\n if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) {\n write('buffer:');\n return write(object);\n }\n\n if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') {\n if(this['_' + objType]) {\n this['_' + objType](object);\n } else if (options.ignoreUnknown) {\n return write('[' + objType + ']');\n } else {\n throw new Error('Unknown object type \"' + objType + '\"');\n }\n }else{\n var keys = Object.keys(object);\n if (options.unorderedObjects) {\n keys = keys.sort();\n }\n // Make sure to incorporate special properties, so\n // Types with different prototypes will produce\n // a different hash and objects derived from\n // different functions (`new Foo`, `new Bar`) will\n // produce different hashes.\n // We never do this for native functions since some\n // seem to break because of that.\n if (options.respectType !== false && !isNativeFunction(object)) {\n keys.splice(0, 0, 'prototype', '__proto__', 'constructor');\n }\n\n if (options.excludeKeys) {\n keys = keys.filter(function(key) { return !options.excludeKeys(key); });\n }\n\n write('object:' + keys.length + ':');\n var self = this;\n return keys.forEach(function(key){\n self.dispatch(key);\n write(':');\n if(!options.excludeValues) {\n self.dispatch(object[key]);\n }\n write(',');\n });\n }\n },\n _array: function(arr, unordered){\n unordered = typeof unordered !== 'undefined' ? unordered :\n options.unorderedArrays !== false; // default to options.unorderedArrays\n\n var self = this;\n write('array:' + arr.length + ':');\n if (!unordered || arr.length <= 1) {\n return arr.forEach(function(entry) {\n return self.dispatch(entry);\n });\n }\n\n // the unordered case is a little more complicated:\n // since there is no canonical ordering on objects,\n // i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false,\n // we first serialize each entry using a PassThrough stream\n // before sorting.\n // also: we can’t use the same context array for all entries\n // since the order of hashing should *not* matter. instead,\n // we keep track of the additions to a copy of the context array\n // and add all of them to the global context array when we’re done\n var contextAdditions = [];\n var entries = arr.map(function(entry) {\n var strm = new PassThrough();\n var localContext = context.slice(); // make copy\n var hasher = typeHasher(options, strm, localContext);\n hasher.dispatch(entry);\n // take only what was added to localContext and append it to contextAdditions\n contextAdditions = contextAdditions.concat(localContext.slice(context.length));\n return strm.read().toString();\n });\n context = context.concat(contextAdditions);\n entries.sort();\n return this._array(entries, false);\n },\n _date: function(date){\n return write('date:' + date.toJSON());\n },\n _symbol: function(sym){\n return write('symbol:' + sym.toString());\n },\n _error: function(err){\n return write('error:' + err.toString());\n },\n _boolean: function(bool){\n return write('bool:' + bool.toString());\n },\n _string: function(string){\n write('string:' + string.length + ':');\n write(string.toString());\n },\n _function: function(fn){\n write('fn:');\n if (isNativeFunction(fn)) {\n this.dispatch('[native]');\n } else {\n this.dispatch(fn.toString());\n }\n\n if (options.respectFunctionNames !== false) {\n // Make sure we can still distinguish native functions\n // by their name, otherwise String and Function will\n // have the same hash\n this.dispatch(\"function-name:\" + String(fn.name));\n }\n\n if (options.respectFunctionProperties) {\n this._object(fn);\n }\n },\n _number: function(number){\n return write('number:' + number.toString());\n },\n _xml: function(xml){\n return write('xml:' + xml.toString());\n },\n _null: function() {\n return write('Null');\n },\n _undefined: function() {\n return write('Undefined');\n },\n _regexp: function(regex){\n return write('regex:' + regex.toString());\n },\n _uint8array: function(arr){\n write('uint8array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint8clampedarray: function(arr){\n write('uint8clampedarray:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int8array: function(arr){\n write('uint8array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint16array: function(arr){\n write('uint16array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int16array: function(arr){\n write('uint16array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _uint32array: function(arr){\n write('uint32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _int32array: function(arr){\n write('uint32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _float32array: function(arr){\n write('float32array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _float64array: function(arr){\n write('float64array:');\n return this.dispatch(Array.prototype.slice.call(arr));\n },\n _arraybuffer: function(arr){\n write('arraybuffer:');\n return this.dispatch(new Uint8Array(arr));\n },\n _url: function(url) {\n return write('url:' + url.toString(), 'utf8');\n },\n _map: function(map) {\n write('map:');\n var arr = Array.from(map);\n return this._array(arr, options.unorderedSets !== false);\n },\n _set: function(set) {\n write('set:');\n var arr = Array.from(set);\n return this._array(arr, options.unorderedSets !== false);\n },\n _file: function(file) {\n write('file:');\n return this.dispatch([file.name, file.size, file.type, file.lastModfied]);\n },\n _blob: function() {\n if (options.ignoreUnknown) {\n return write('[blob]');\n }\n\n throw Error('Hashing Blob objects is currently not supported\\n' +\n '(see https://github.com/puleos/object-hash/issues/26)\\n' +\n 'Use \"options.replacer\" or \"options.ignoreUnknown\"\\n');\n },\n _domwindow: function() { return write('domwindow'); },\n _bigint: function(number){\n return write('bigint:' + number.toString());\n },\n /* Node.js standard native objects */\n _process: function() { return write('process'); },\n _timer: function() { return write('timer'); },\n _pipe: function() { return write('pipe'); },\n _tcp: function() { return write('tcp'); },\n _udp: function() { return write('udp'); },\n _tty: function() { return write('tty'); },\n _statwatcher: function() { return write('statwatcher'); },\n _securecontext: function() { return write('securecontext'); },\n _connection: function() { return write('connection'); },\n _zlib: function() { return write('zlib'); },\n _context: function() { return write('context'); },\n _nodescript: function() { return write('nodescript'); },\n _httpparser: function() { return write('httpparser'); },\n _dataview: function() { return write('dataview'); },\n _signal: function() { return write('signal'); },\n _fsevent: function() { return write('fsevent'); },\n _tlswrap: function() { return write('tlswrap'); },\n };\n}\n\n// Mini-implementation of stream.PassThrough\n// We are far from having need for the full implementation, and we can\n// make assumptions like \"many writes, then only one final read\"\n// and we can ignore encoding specifics\nfunction PassThrough() {\n return {\n buf: '',\n\n write: function(b) {\n this.buf += b;\n },\n\n end: function(b) {\n this.buf += b;\n },\n\n read: function() {\n return this.buf;\n }\n };\n}\n","const { strict: assert } = require('assert');\nconst { createHash } = require('crypto');\nconst { format } = require('util');\n\nconst shake256 = require('./shake256');\n\nlet encode;\nif (Buffer.isEncoding('base64url')) {\n encode = (input) => input.toString('base64url');\n} else {\n const fromBase64 = (base64) => base64.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n encode = (input) => fromBase64(input.toString('base64'));\n}\n\n/** SPECIFICATION\n * Its (_hash) value is the base64url encoding of the left-most half of the hash of the octets of\n * the ASCII representation of the token value, where the hash algorithm used is the hash algorithm\n * used in the alg Header Parameter of the ID Token's JOSE Header. For instance, if the alg is\n * RS256, hash the token value with SHA-256, then take the left-most 128 bits and base64url encode\n * them. The _hash value is a case sensitive string.\n */\n\n/**\n * @name getHash\n * @api private\n *\n * returns the sha length based off the JOSE alg heade value, defaults to sha256\n *\n * @param token {String} token value to generate the hash from\n * @param alg {String} ID Token JOSE header alg value (i.e. RS256, HS384, ES512, PS256)\n * @param [crv] {String} For EdDSA the curve decides what hash algorithm is used. Required for EdDSA\n */\nfunction getHash(alg, crv) {\n switch (alg) {\n case 'HS256':\n case 'RS256':\n case 'PS256':\n case 'ES256':\n case 'ES256K':\n return createHash('sha256');\n\n case 'HS384':\n case 'RS384':\n case 'PS384':\n case 'ES384':\n return createHash('sha384');\n\n case 'HS512':\n case 'RS512':\n case 'PS512':\n case 'ES512':\n return createHash('sha512');\n\n case 'EdDSA':\n switch (crv) {\n case 'Ed25519':\n return createHash('sha512');\n case 'Ed448':\n if (!shake256) {\n throw new TypeError('Ed448 *_hash calculation is not supported in your Node.js runtime version');\n }\n\n return createHash('shake256', { outputLength: 114 });\n default:\n throw new TypeError('unrecognized or invalid EdDSA curve provided');\n }\n\n default:\n throw new TypeError('unrecognized or invalid JWS algorithm provided');\n }\n}\n\nfunction generate(token, alg, crv) {\n const digest = getHash(alg, crv).update(token).digest();\n return encode(digest.slice(0, digest.length / 2));\n}\n\nfunction validate(names, actual, source, alg, crv) {\n if (typeof names.claim !== 'string' || !names.claim) {\n throw new TypeError('names.claim must be a non-empty string');\n }\n\n if (typeof names.source !== 'string' || !names.source) {\n throw new TypeError('names.source must be a non-empty string');\n }\n\n assert(typeof actual === 'string' && actual, `${names.claim} must be a non-empty string`);\n assert(typeof source === 'string' && source, `${names.source} must be a non-empty string`);\n\n let expected;\n let msg;\n try {\n expected = generate(source, alg, crv);\n } catch (err) {\n msg = format('%s could not be validated (%s)', names.claim, err.message);\n }\n\n msg = msg || format('%s mismatch, expected %s, got: %s', names.claim, expected, actual);\n\n assert.equal(expected, actual, msg);\n}\n\nmodule.exports = {\n validate,\n generate,\n};\n","const crypto = require('crypto');\n\nconst [major, minor] = process.version.substring(1).split('.').map((x) => parseInt(x, 10));\nconst xofOutputLength = major > 12 || (major === 12 && minor >= 8);\nconst shake256 = xofOutputLength && crypto.getHashes().includes('shake256');\n\nmodule.exports = shake256;\n","var wrappy = require('wrappy')\nmodule.exports = wrappy(once)\nmodule.exports.strict = wrappy(onceStrict)\n\nonce.proto = once(function () {\n Object.defineProperty(Function.prototype, 'once', {\n value: function () {\n return once(this)\n },\n configurable: true\n })\n\n Object.defineProperty(Function.prototype, 'onceStrict', {\n value: function () {\n return onceStrict(this)\n },\n configurable: true\n })\n})\n\nfunction once (fn) {\n var f = function () {\n if (f.called) return f.value\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n f.called = false\n return f\n}\n\nfunction onceStrict (fn) {\n var f = function () {\n if (f.called)\n throw new Error(f.onceError)\n f.called = true\n return f.value = fn.apply(this, arguments)\n }\n var name = fn.name || 'Function wrapped with `once`'\n f.onceError = name + \" shouldn't be called more than once\"\n f.called = false\n return f\n}\n","'use strict';\nconst mimicFn = require('mimic-fn');\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = null;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFn(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nmodule.exports = onetime;\n// TODO: Remove this for the next major release\nmodule.exports.default = onetime;\n\nmodule.exports.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n","'use strict';\n\nclass CancelError extends Error {\n\tconstructor(reason) {\n\t\tsuper(reason || 'Promise was canceled');\n\t\tthis.name = 'CancelError';\n\t}\n\n\tget isCanceled() {\n\t\treturn true;\n\t}\n}\n\nclass PCancelable {\n\tstatic fn(userFn) {\n\t\treturn (...arguments_) => {\n\t\t\treturn new PCancelable((resolve, reject, onCancel) => {\n\t\t\t\targuments_.push(onCancel);\n\t\t\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\t\t\tuserFn(...arguments_).then(resolve, reject);\n\t\t\t});\n\t\t};\n\t}\n\n\tconstructor(executor) {\n\t\tthis._cancelHandlers = [];\n\t\tthis._isPending = true;\n\t\tthis._isCanceled = false;\n\t\tthis._rejectOnCancel = true;\n\n\t\tthis._promise = new Promise((resolve, reject) => {\n\t\t\tthis._reject = reject;\n\n\t\t\tconst onResolve = value => {\n\t\t\t\tif (!this._isCanceled || !onCancel.shouldReject) {\n\t\t\t\t\tthis._isPending = false;\n\t\t\t\t\tresolve(value);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tconst onReject = error => {\n\t\t\t\tthis._isPending = false;\n\t\t\t\treject(error);\n\t\t\t};\n\n\t\t\tconst onCancel = handler => {\n\t\t\t\tif (!this._isPending) {\n\t\t\t\t\tthrow new Error('The `onCancel` handler was attached after the promise settled.');\n\t\t\t\t}\n\n\t\t\t\tthis._cancelHandlers.push(handler);\n\t\t\t};\n\n\t\t\tObject.defineProperties(onCancel, {\n\t\t\t\tshouldReject: {\n\t\t\t\t\tget: () => this._rejectOnCancel,\n\t\t\t\t\tset: boolean => {\n\t\t\t\t\t\tthis._rejectOnCancel = boolean;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn executor(onResolve, onReject, onCancel);\n\t\t});\n\t}\n\n\tthen(onFulfilled, onRejected) {\n\t\t// eslint-disable-next-line promise/prefer-await-to-then\n\t\treturn this._promise.then(onFulfilled, onRejected);\n\t}\n\n\tcatch(onRejected) {\n\t\treturn this._promise.catch(onRejected);\n\t}\n\n\tfinally(onFinally) {\n\t\treturn this._promise.finally(onFinally);\n\t}\n\n\tcancel(reason) {\n\t\tif (!this._isPending || this._isCanceled) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._isCanceled = true;\n\n\t\tif (this._cancelHandlers.length > 0) {\n\t\t\ttry {\n\t\t\t\tfor (const handler of this._cancelHandlers) {\n\t\t\t\t\thandler();\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\tthis._reject(error);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (this._rejectOnCancel) {\n\t\t\tthis._reject(new CancelError(reason));\n\t\t}\n\t}\n\n\tget isCanceled() {\n\t\treturn this._isCanceled;\n\t}\n}\n\nObject.setPrototypeOf(PCancelable.prototype, Promise.prototype);\n\nmodule.exports = PCancelable;\nmodule.exports.CancelError = CancelError;\n","'use strict';\n\nfunction posix(path) {\n\treturn path.charAt(0) === '/';\n}\n\nfunction win32(path) {\n\t// https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56\n\tvar splitDeviceRe = /^([a-zA-Z]:|[\\\\\\/]{2}[^\\\\\\/]+[\\\\\\/]+[^\\\\\\/]+)?([\\\\\\/])?([\\s\\S]*?)$/;\n\tvar result = splitDeviceRe.exec(path);\n\tvar device = result[1] || '';\n\tvar isUnc = Boolean(device && device.charAt(1) !== ':');\n\n\t// UNC paths are always absolute\n\treturn Boolean(result[2] || isUnc);\n}\n\nmodule.exports = process.platform === 'win32' ? win32 : posix;\nmodule.exports.posix = posix;\nmodule.exports.win32 = win32;\n","'use strict';\n\nconst pathKey = (options = {}) => {\n\tconst environment = options.env || process.env;\n\tconst platform = options.platform || process.platform;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n};\n\nmodule.exports = pathKey;\n// TODO: Remove this for the next major release\nmodule.exports.default = pathKey;\n","// Generated by CoffeeScript 1.12.2\n(function() {\n var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;\n\n if ((typeof performance !== \"undefined\" && performance !== null) && performance.now) {\n module.exports = function() {\n return performance.now();\n };\n } else if ((typeof process !== \"undefined\" && process !== null) && process.hrtime) {\n module.exports = function() {\n return (getNanoSeconds() - nodeLoadTime) / 1e6;\n };\n hrtime = process.hrtime;\n getNanoSeconds = function() {\n var hr;\n hr = hrtime();\n return hr[0] * 1e9 + hr[1];\n };\n moduleLoadTime = getNanoSeconds();\n upTime = process.uptime() * 1e9;\n nodeLoadTime = moduleLoadTime - upTime;\n } else if (Date.now) {\n module.exports = function() {\n return Date.now() - loadTime;\n };\n loadTime = Date.now();\n } else {\n module.exports = function() {\n return new Date().getTime() - loadTime;\n };\n loadTime = new Date().getTime();\n }\n\n}).call(this);\n\n//# sourceMappingURL=performance-now.js.map\n","/*eslint no-var:0, prefer-arrow-callback: 0, object-shorthand: 0 */\n'use strict';\n\n\nvar Punycode = require('punycode');\n\n\nvar internals = {};\n\n\n//\n// Read rules from file.\n//\ninternals.rules = require('./data/rules.json').map(function (rule) {\n\n return {\n rule: rule,\n suffix: rule.replace(/^(\\*\\.|\\!)/, ''),\n punySuffix: -1,\n wildcard: rule.charAt(0) === '*',\n exception: rule.charAt(0) === '!'\n };\n});\n\n\n//\n// Check is given string ends with `suffix`.\n//\ninternals.endsWith = function (str, suffix) {\n\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n};\n\n\n//\n// Find rule for a given domain.\n//\ninternals.findRule = function (domain) {\n\n var punyDomain = Punycode.toASCII(domain);\n return internals.rules.reduce(function (memo, rule) {\n\n if (rule.punySuffix === -1){\n rule.punySuffix = Punycode.toASCII(rule.suffix);\n }\n if (!internals.endsWith(punyDomain, '.' + rule.punySuffix) && punyDomain !== rule.punySuffix) {\n return memo;\n }\n // This has been commented out as it never seems to run. This is because\n // sub tlds always appear after their parents and we never find a shorter\n // match.\n //if (memo) {\n // var memoSuffix = Punycode.toASCII(memo.suffix);\n // if (memoSuffix.length >= punySuffix.length) {\n // return memo;\n // }\n //}\n return rule;\n }, null);\n};\n\n\n//\n// Error codes and messages.\n//\nexports.errorCodes = {\n DOMAIN_TOO_SHORT: 'Domain name too short.',\n DOMAIN_TOO_LONG: 'Domain name too long. It should be no more than 255 chars.',\n LABEL_STARTS_WITH_DASH: 'Domain name label can not start with a dash.',\n LABEL_ENDS_WITH_DASH: 'Domain name label can not end with a dash.',\n LABEL_TOO_LONG: 'Domain name label should be at most 63 chars long.',\n LABEL_TOO_SHORT: 'Domain name label should be at least 1 character long.',\n LABEL_INVALID_CHARS: 'Domain name label can only contain alphanumeric characters or dashes.'\n};\n\n\n//\n// Validate domain name and throw if not valid.\n//\n// From wikipedia:\n//\n// Hostnames are composed of series of labels concatenated with dots, as are all\n// domain names. Each label must be between 1 and 63 characters long, and the\n// entire hostname (including the delimiting dots) has a maximum of 255 chars.\n//\n// Allowed chars:\n//\n// * `a-z`\n// * `0-9`\n// * `-` but not as a starting or ending character\n// * `.` as a separator for the textual portions of a domain name\n//\n// * http://en.wikipedia.org/wiki/Domain_name\n// * http://en.wikipedia.org/wiki/Hostname\n//\ninternals.validate = function (input) {\n\n // Before we can validate we need to take care of IDNs with unicode chars.\n var ascii = Punycode.toASCII(input);\n\n if (ascii.length < 1) {\n return 'DOMAIN_TOO_SHORT';\n }\n if (ascii.length > 255) {\n return 'DOMAIN_TOO_LONG';\n }\n\n // Check each part's length and allowed chars.\n var labels = ascii.split('.');\n var label;\n\n for (var i = 0; i < labels.length; ++i) {\n label = labels[i];\n if (!label.length) {\n return 'LABEL_TOO_SHORT';\n }\n if (label.length > 63) {\n return 'LABEL_TOO_LONG';\n }\n if (label.charAt(0) === '-') {\n return 'LABEL_STARTS_WITH_DASH';\n }\n if (label.charAt(label.length - 1) === '-') {\n return 'LABEL_ENDS_WITH_DASH';\n }\n if (!/^[a-z0-9\\-]+$/.test(label)) {\n return 'LABEL_INVALID_CHARS';\n }\n }\n};\n\n\n//\n// Public API\n//\n\n\n//\n// Parse domain.\n//\nexports.parse = function (input) {\n\n if (typeof input !== 'string') {\n throw new TypeError('Domain name must be a string.');\n }\n\n // Force domain to lowercase.\n var domain = input.slice(0).toLowerCase();\n\n // Handle FQDN.\n // TODO: Simply remove trailing dot?\n if (domain.charAt(domain.length - 1) === '.') {\n domain = domain.slice(0, domain.length - 1);\n }\n\n // Validate and sanitise input.\n var error = internals.validate(domain);\n if (error) {\n return {\n input: input,\n error: {\n message: exports.errorCodes[error],\n code: error\n }\n };\n }\n\n var parsed = {\n input: input,\n tld: null,\n sld: null,\n domain: null,\n subdomain: null,\n listed: false\n };\n\n var domainParts = domain.split('.');\n\n // Non-Internet TLD\n if (domainParts[domainParts.length - 1] === 'local') {\n return parsed;\n }\n\n var handlePunycode = function () {\n\n if (!/xn--/.test(domain)) {\n return parsed;\n }\n if (parsed.domain) {\n parsed.domain = Punycode.toASCII(parsed.domain);\n }\n if (parsed.subdomain) {\n parsed.subdomain = Punycode.toASCII(parsed.subdomain);\n }\n return parsed;\n };\n\n var rule = internals.findRule(domain);\n\n // Unlisted tld.\n if (!rule) {\n if (domainParts.length < 2) {\n return parsed;\n }\n parsed.tld = domainParts.pop();\n parsed.sld = domainParts.pop();\n parsed.domain = [parsed.sld, parsed.tld].join('.');\n if (domainParts.length) {\n parsed.subdomain = domainParts.pop();\n }\n return handlePunycode();\n }\n\n // At this point we know the public suffix is listed.\n parsed.listed = true;\n\n var tldParts = rule.suffix.split('.');\n var privateParts = domainParts.slice(0, domainParts.length - tldParts.length);\n\n if (rule.exception) {\n privateParts.push(tldParts.shift());\n }\n\n parsed.tld = tldParts.join('.');\n\n if (!privateParts.length) {\n return handlePunycode();\n }\n\n if (rule.wildcard) {\n tldParts.unshift(privateParts.pop());\n parsed.tld = tldParts.join('.');\n }\n\n if (!privateParts.length) {\n return handlePunycode();\n }\n\n parsed.sld = privateParts.pop();\n parsed.domain = [parsed.sld, parsed.tld].join('.');\n\n if (privateParts.length) {\n parsed.subdomain = privateParts.join('.');\n }\n\n return handlePunycode();\n};\n\n\n//\n// Get domain.\n//\nexports.get = function (domain) {\n\n if (!domain) {\n return null;\n }\n return exports.parse(domain).domain || null;\n};\n\n\n//\n// Check whether domain belongs to a known public suffix.\n//\nexports.isValid = function (domain) {\n\n var parsed = exports.parse(domain);\n return Boolean(parsed.domain && parsed.listed);\n};\n","var once = require('once')\nvar eos = require('end-of-stream')\nvar fs = require('fs') // we only need fs to get the ReadStream and WriteStream prototypes\n\nvar noop = function () {}\nvar ancient = /^v?\\.0/.test(process.version)\n\nvar isFn = function (fn) {\n return typeof fn === 'function'\n}\n\nvar isFS = function (stream) {\n if (!ancient) return false // newer node version do not need to care about fs is a special way\n if (!fs) return false // browser\n return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)\n}\n\nvar isRequest = function (stream) {\n return stream.setHeader && isFn(stream.abort)\n}\n\nvar destroyer = function (stream, reading, writing, callback) {\n callback = once(callback)\n\n var closed = false\n stream.on('close', function () {\n closed = true\n })\n\n eos(stream, {readable: reading, writable: writing}, function (err) {\n if (err) return callback(err)\n closed = true\n callback()\n })\n\n var destroyed = false\n return function (err) {\n if (closed) return\n if (destroyed) return\n destroyed = true\n\n if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks\n if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want\n\n if (isFn(stream.destroy)) return stream.destroy()\n\n callback(err || new Error('stream was destroyed'))\n }\n}\n\nvar call = function (fn) {\n fn()\n}\n\nvar pipe = function (from, to) {\n return from.pipe(to)\n}\n\nvar pump = function () {\n var streams = Array.prototype.slice.call(arguments)\n var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop\n\n if (Array.isArray(streams[0])) streams = streams[0]\n if (streams.length < 2) throw new Error('pump requires two streams per minimum')\n\n var error\n var destroys = streams.map(function (stream, i) {\n var reading = i < streams.length - 1\n var writing = i > 0\n return destroyer(stream, reading, writing, function (err) {\n if (!error) error = err\n if (err) destroys.forEach(call)\n if (reading) return\n destroys.forEach(call)\n callback(error)\n })\n })\n\n return streams.reduce(pipe)\n}\n\nmodule.exports = pump\n","'use strict';\n\nclass QuickLRU {\n\tconstructor(options = {}) {\n\t\tif (!(options.maxSize && options.maxSize > 0)) {\n\t\t\tthrow new TypeError('`maxSize` must be a number greater than 0');\n\t\t}\n\n\t\tthis.maxSize = options.maxSize;\n\t\tthis.onEviction = options.onEviction;\n\t\tthis.cache = new Map();\n\t\tthis.oldCache = new Map();\n\t\tthis._size = 0;\n\t}\n\n\t_set(key, value) {\n\t\tthis.cache.set(key, value);\n\t\tthis._size++;\n\n\t\tif (this._size >= this.maxSize) {\n\t\t\tthis._size = 0;\n\n\t\t\tif (typeof this.onEviction === 'function') {\n\t\t\t\tfor (const [key, value] of this.oldCache.entries()) {\n\t\t\t\t\tthis.onEviction(key, value);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.oldCache = this.cache;\n\t\t\tthis.cache = new Map();\n\t\t}\n\t}\n\n\tget(key) {\n\t\tif (this.cache.has(key)) {\n\t\t\treturn this.cache.get(key);\n\t\t}\n\n\t\tif (this.oldCache.has(key)) {\n\t\t\tconst value = this.oldCache.get(key);\n\t\t\tthis.oldCache.delete(key);\n\t\t\tthis._set(key, value);\n\t\t\treturn value;\n\t\t}\n\t}\n\n\tset(key, value) {\n\t\tif (this.cache.has(key)) {\n\t\t\tthis.cache.set(key, value);\n\t\t} else {\n\t\t\tthis._set(key, value);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\thas(key) {\n\t\treturn this.cache.has(key) || this.oldCache.has(key);\n\t}\n\n\tpeek(key) {\n\t\tif (this.cache.has(key)) {\n\t\t\treturn this.cache.get(key);\n\t\t}\n\n\t\tif (this.oldCache.has(key)) {\n\t\t\treturn this.oldCache.get(key);\n\t\t}\n\t}\n\n\tdelete(key) {\n\t\tconst deleted = this.cache.delete(key);\n\t\tif (deleted) {\n\t\t\tthis._size--;\n\t\t}\n\n\t\treturn this.oldCache.delete(key) || deleted;\n\t}\n\n\tclear() {\n\t\tthis.cache.clear();\n\t\tthis.oldCache.clear();\n\t\tthis._size = 0;\n\t}\n\n\t* keys() {\n\t\tfor (const [key] of this) {\n\t\t\tyield key;\n\t\t}\n\t}\n\n\t* values() {\n\t\tfor (const [, value] of this) {\n\t\t\tyield value;\n\t\t}\n\t}\n\n\t* [Symbol.iterator]() {\n\t\tfor (const item of this.cache) {\n\t\t\tyield item;\n\t\t}\n\n\t\tfor (const item of this.oldCache) {\n\t\t\tconst [key] = item;\n\t\t\tif (!this.cache.has(key)) {\n\t\t\t\tyield item;\n\t\t\t}\n\t\t}\n\t}\n\n\tget size() {\n\t\tlet oldCacheSize = 0;\n\t\tfor (const key of this.oldCache.keys()) {\n\t\t\tif (!this.cache.has(key)) {\n\t\t\t\toldCacheSize++;\n\t\t\t}\n\t\t}\n\n\t\treturn Math.min(this._size + oldCacheSize, this.maxSize);\n\t}\n}\n\nmodule.exports = QuickLRU;\n","/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n(function (Reflect) {\n // Metadata Proposal\n // https://rbuckton.github.io/reflect-metadata/\n (function (factory) {\n var root = typeof global === \"object\" ? global :\n typeof self === \"object\" ? self :\n typeof this === \"object\" ? this :\n Function(\"return this;\")();\n var exporter = makeExporter(Reflect);\n if (typeof root.Reflect === \"undefined\") {\n root.Reflect = Reflect;\n }\n else {\n exporter = makeExporter(root.Reflect, exporter);\n }\n factory(exporter);\n function makeExporter(target, previous) {\n return function (key, value) {\n if (typeof target[key] !== \"function\") {\n Object.defineProperty(target, key, { configurable: true, writable: true, value: value });\n }\n if (previous)\n previous(key, value);\n };\n }\n })(function (exporter) {\n var hasOwn = Object.prototype.hasOwnProperty;\n // feature test for Symbol support\n var supportsSymbol = typeof Symbol === \"function\";\n var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : \"@@toPrimitive\";\n var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : \"@@iterator\";\n var supportsCreate = typeof Object.create === \"function\"; // feature test for Object.create support\n var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support\n var downLevel = !supportsCreate && !supportsProto;\n var HashMap = {\n // create an object in dictionary mode (a.k.a. \"slow\" mode in v8)\n create: supportsCreate\n ? function () { return MakeDictionary(Object.create(null)); }\n : supportsProto\n ? function () { return MakeDictionary({ __proto__: null }); }\n : function () { return MakeDictionary({}); },\n has: downLevel\n ? function (map, key) { return hasOwn.call(map, key); }\n : function (map, key) { return key in map; },\n get: downLevel\n ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }\n : function (map, key) { return map[key]; },\n };\n // Load global or shim versions of Map, Set, and WeakMap\n var functionPrototype = Object.getPrototypeOf(Function);\n var usePolyfill = typeof process === \"object\" && process.env && process.env[\"REFLECT_METADATA_USE_MAP_POLYFILL\"] === \"true\";\n var _Map = !usePolyfill && typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n var _Set = !usePolyfill && typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n var _WeakMap = !usePolyfill && typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill();\n // [[Metadata]] internal slot\n // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n var Metadata = new _WeakMap();\n /**\n * Applies a set of decorators to a property of a target object.\n * @param decorators An array of decorators.\n * @param target The target object.\n * @param propertyKey (Optional) The property key to decorate.\n * @param attributes (Optional) The property descriptor for the target key.\n * @remarks Decorators are applied in reverse order.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Example = Reflect.decorate(decoratorsArray, Example);\n *\n * // property (on constructor)\n * Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Object.defineProperty(Example, \"staticMethod\",\n * Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n * Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n *\n * // method (on prototype)\n * Object.defineProperty(Example.prototype, \"method\",\n * Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n * Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n *\n */\n function decorate(decorators, target, propertyKey, attributes) {\n if (!IsUndefined(propertyKey)) {\n if (!IsArray(decorators))\n throw new TypeError();\n if (!IsObject(target))\n throw new TypeError();\n if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))\n throw new TypeError();\n if (IsNull(attributes))\n attributes = undefined;\n propertyKey = ToPropertyKey(propertyKey);\n return DecorateProperty(decorators, target, propertyKey, attributes);\n }\n else {\n if (!IsArray(decorators))\n throw new TypeError();\n if (!IsConstructor(target))\n throw new TypeError();\n return DecorateConstructor(decorators, target);\n }\n }\n exporter(\"decorate\", decorate);\n // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n /**\n * A default metadata decorator factory that can be used on a class, class member, or parameter.\n * @param metadataKey The key for the metadata entry.\n * @param metadataValue The value for the metadata entry.\n * @returns A decorator function.\n * @remarks\n * If `metadataKey` is already defined for the target and target key, the\n * metadataValue for that key will be overwritten.\n * @example\n *\n * // constructor\n * @Reflect.metadata(key, value)\n * class Example {\n * }\n *\n * // property (on constructor, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticProperty;\n * }\n *\n * // property (on prototype, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * property;\n * }\n *\n * // method (on constructor)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticMethod() { }\n * }\n *\n * // method (on prototype)\n * class Example {\n * @Reflect.metadata(key, value)\n * method() { }\n * }\n *\n */\n function metadata(metadataKey, metadataValue) {\n function decorator(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))\n throw new TypeError();\n OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n return decorator;\n }\n exporter(\"metadata\", metadata);\n /**\n * Define a unique metadata entry on the target.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param metadataValue A value that contains attached metadata.\n * @param target The target object on which to define metadata.\n * @param propertyKey (Optional) The property key for the target.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Reflect.defineMetadata(\"custom:annotation\", options, Example);\n *\n * // property (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n *\n * // method (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n *\n * // decorator factory as metadata-producing annotation.\n * function MyAnnotation(options): Decorator {\n * return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n * }\n *\n */\n function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n exporter(\"defineMetadata\", defineMetadata);\n /**\n * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function hasMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"hasMetadata\", hasMetadata);\n /**\n * Gets a value indicating whether the target object has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function hasOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"hasOwnMetadata\", hasOwnMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function getMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"getMetadata\", getMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function getOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"getOwnMetadata\", getOwnMetadata);\n /**\n * Gets the metadata keys defined on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n *\n */\n function getMetadataKeys(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryMetadataKeys(target, propertyKey);\n }\n exporter(\"getMetadataKeys\", getMetadataKeys);\n /**\n * Gets the unique metadata keys defined on the target object.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n *\n */\n function getOwnMetadataKeys(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryOwnMetadataKeys(target, propertyKey);\n }\n exporter(\"getOwnMetadataKeys\", getOwnMetadataKeys);\n /**\n * Deletes the metadata entry from the target object with the provided key.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function deleteMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return false;\n if (!metadataMap.delete(metadataKey))\n return false;\n if (metadataMap.size > 0)\n return true;\n var targetMetadata = Metadata.get(target);\n targetMetadata.delete(propertyKey);\n if (targetMetadata.size > 0)\n return true;\n Metadata.delete(target);\n return true;\n }\n exporter(\"deleteMetadata\", deleteMetadata);\n function DecorateConstructor(decorators, target) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target);\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsConstructor(decorated))\n throw new TypeError();\n target = decorated;\n }\n }\n return target;\n }\n function DecorateProperty(decorators, target, propertyKey, descriptor) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target, propertyKey, descriptor);\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsObject(decorated))\n throw new TypeError();\n descriptor = decorated;\n }\n }\n return descriptor;\n }\n function GetOrCreateMetadataMap(O, P, Create) {\n var targetMetadata = Metadata.get(O);\n if (IsUndefined(targetMetadata)) {\n if (!Create)\n return undefined;\n targetMetadata = new _Map();\n Metadata.set(O, targetMetadata);\n }\n var metadataMap = targetMetadata.get(P);\n if (IsUndefined(metadataMap)) {\n if (!Create)\n return undefined;\n metadataMap = new _Map();\n targetMetadata.set(P, metadataMap);\n }\n return metadataMap;\n }\n // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n function OrdinaryHasMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn)\n return true;\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent))\n return OrdinaryHasMetadata(MetadataKey, parent, P);\n return false;\n }\n // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return false;\n return ToBoolean(metadataMap.has(MetadataKey));\n }\n // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n function OrdinaryGetMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn)\n return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent))\n return OrdinaryGetMetadata(MetadataKey, parent, P);\n return undefined;\n }\n // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return undefined;\n return metadataMap.get(MetadataKey);\n }\n // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);\n metadataMap.set(MetadataKey, MetadataValue);\n }\n // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n function OrdinaryMetadataKeys(O, P) {\n var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (parent === null)\n return ownKeys;\n var parentKeys = OrdinaryMetadataKeys(parent, P);\n if (parentKeys.length <= 0)\n return ownKeys;\n if (ownKeys.length <= 0)\n return parentKeys;\n var set = new _Set();\n var keys = [];\n for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n var key = ownKeys_1[_i];\n var hasKey = set.has(key);\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n var key = parentKeys_1[_a];\n var hasKey = set.has(key);\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n return keys;\n }\n // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n function OrdinaryOwnMetadataKeys(O, P) {\n var keys = [];\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return keys;\n var keysObj = metadataMap.keys();\n var iterator = GetIterator(keysObj);\n var k = 0;\n while (true) {\n var next = IteratorStep(iterator);\n if (!next) {\n keys.length = k;\n return keys;\n }\n var nextValue = IteratorValue(next);\n try {\n keys[k] = nextValue;\n }\n catch (e) {\n try {\n IteratorClose(iterator);\n }\n finally {\n throw e;\n }\n }\n k++;\n }\n }\n // 6 ECMAScript Data Typ0es and Values\n // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }\n // 6.1.1 The Undefined Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n function IsUndefined(x) {\n return x === undefined;\n }\n // 6.1.2 The Null Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n function IsNull(x) {\n return x === null;\n }\n // 6.1.5 The Symbol Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n function IsSymbol(x) {\n return typeof x === \"symbol\";\n }\n // 6.1.7 The Object Type\n // https://tc39.github.io/ecma262/#sec-object-type\n function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }\n // 7.1 Type Conversion\n // https://tc39.github.io/ecma262/#sec-type-conversion\n // 7.1.1 ToPrimitive(input [, PreferredType])\n // https://tc39.github.io/ecma262/#sec-toprimitive\n function ToPrimitive(input, PreferredType) {\n switch (Type(input)) {\n case 0 /* Undefined */: return input;\n case 1 /* Null */: return input;\n case 2 /* Boolean */: return input;\n case 3 /* String */: return input;\n case 4 /* Symbol */: return input;\n case 5 /* Number */: return input;\n }\n var hint = PreferredType === 3 /* String */ ? \"string\" : PreferredType === 5 /* Number */ ? \"number\" : \"default\";\n var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n if (exoticToPrim !== undefined) {\n var result = exoticToPrim.call(input, hint);\n if (IsObject(result))\n throw new TypeError();\n return result;\n }\n return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n }\n // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n function OrdinaryToPrimitive(O, hint) {\n if (hint === \"string\") {\n var toString_1 = O.toString;\n if (IsCallable(toString_1)) {\n var result = toString_1.call(O);\n if (!IsObject(result))\n return result;\n }\n var valueOf = O.valueOf;\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result))\n return result;\n }\n }\n else {\n var valueOf = O.valueOf;\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result))\n return result;\n }\n var toString_2 = O.toString;\n if (IsCallable(toString_2)) {\n var result = toString_2.call(O);\n if (!IsObject(result))\n return result;\n }\n }\n throw new TypeError();\n }\n // 7.1.2 ToBoolean(argument)\n // https://tc39.github.io/ecma262/2016/#sec-toboolean\n function ToBoolean(argument) {\n return !!argument;\n }\n // 7.1.12 ToString(argument)\n // https://tc39.github.io/ecma262/#sec-tostring\n function ToString(argument) {\n return \"\" + argument;\n }\n // 7.1.14 ToPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-topropertykey\n function ToPropertyKey(argument) {\n var key = ToPrimitive(argument, 3 /* String */);\n if (IsSymbol(key))\n return key;\n return ToString(key);\n }\n // 7.2 Testing and Comparison Operations\n // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n // 7.2.2 IsArray(argument)\n // https://tc39.github.io/ecma262/#sec-isarray\n function IsArray(argument) {\n return Array.isArray\n ? Array.isArray(argument)\n : argument instanceof Object\n ? argument instanceof Array\n : Object.prototype.toString.call(argument) === \"[object Array]\";\n }\n // 7.2.3 IsCallable(argument)\n // https://tc39.github.io/ecma262/#sec-iscallable\n function IsCallable(argument) {\n // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n return typeof argument === \"function\";\n }\n // 7.2.4 IsConstructor(argument)\n // https://tc39.github.io/ecma262/#sec-isconstructor\n function IsConstructor(argument) {\n // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n return typeof argument === \"function\";\n }\n // 7.2.7 IsPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-ispropertykey\n function IsPropertyKey(argument) {\n switch (Type(argument)) {\n case 3 /* String */: return true;\n case 4 /* Symbol */: return true;\n default: return false;\n }\n }\n // 7.3 Operations on Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-objects\n // 7.3.9 GetMethod(V, P)\n // https://tc39.github.io/ecma262/#sec-getmethod\n function GetMethod(V, P) {\n var func = V[P];\n if (func === undefined || func === null)\n return undefined;\n if (!IsCallable(func))\n throw new TypeError();\n return func;\n }\n // 7.4 Operations on Iterator Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n function GetIterator(obj) {\n var method = GetMethod(obj, iteratorSymbol);\n if (!IsCallable(method))\n throw new TypeError(); // from Call\n var iterator = method.call(obj);\n if (!IsObject(iterator))\n throw new TypeError();\n return iterator;\n }\n // 7.4.4 IteratorValue(iterResult)\n // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n function IteratorValue(iterResult) {\n return iterResult.value;\n }\n // 7.4.5 IteratorStep(iterator)\n // https://tc39.github.io/ecma262/#sec-iteratorstep\n function IteratorStep(iterator) {\n var result = iterator.next();\n return result.done ? false : result;\n }\n // 7.4.6 IteratorClose(iterator, completion)\n // https://tc39.github.io/ecma262/#sec-iteratorclose\n function IteratorClose(iterator) {\n var f = iterator[\"return\"];\n if (f)\n f.call(iterator);\n }\n // 9.1 Ordinary Object Internal Methods and Internal Slots\n // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }\n // naive Map shim\n function CreateMapPolyfill() {\n var cacheSentinel = {};\n var arraySentinel = [];\n var MapIterator = /** @class */ (function () {\n function MapIterator(keys, values, selector) {\n this._index = 0;\n this._keys = keys;\n this._values = values;\n this._selector = selector;\n }\n MapIterator.prototype[\"@@iterator\"] = function () { return this; };\n MapIterator.prototype[iteratorSymbol] = function () { return this; };\n MapIterator.prototype.next = function () {\n var index = this._index;\n if (index >= 0 && index < this._keys.length) {\n var result = this._selector(this._keys[index], this._values[index]);\n if (index + 1 >= this._keys.length) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n else {\n this._index++;\n }\n return { value: result, done: false };\n }\n return { value: undefined, done: true };\n };\n MapIterator.prototype.throw = function (error) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n throw error;\n };\n MapIterator.prototype.return = function (value) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n return { value: value, done: true };\n };\n return MapIterator;\n }());\n return /** @class */ (function () {\n function Map() {\n this._keys = [];\n this._values = [];\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n Object.defineProperty(Map.prototype, \"size\", {\n get: function () { return this._keys.length; },\n enumerable: true,\n configurable: true\n });\n Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };\n Map.prototype.get = function (key) {\n var index = this._find(key, /*insert*/ false);\n return index >= 0 ? this._values[index] : undefined;\n };\n Map.prototype.set = function (key, value) {\n var index = this._find(key, /*insert*/ true);\n this._values[index] = value;\n return this;\n };\n Map.prototype.delete = function (key) {\n var index = this._find(key, /*insert*/ false);\n if (index >= 0) {\n var size = this._keys.length;\n for (var i = index + 1; i < size; i++) {\n this._keys[i - 1] = this._keys[i];\n this._values[i - 1] = this._values[i];\n }\n this._keys.length--;\n this._values.length--;\n if (key === this._cacheKey) {\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n return true;\n }\n return false;\n };\n Map.prototype.clear = function () {\n this._keys.length = 0;\n this._values.length = 0;\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n };\n Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };\n Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };\n Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };\n Map.prototype[\"@@iterator\"] = function () { return this.entries(); };\n Map.prototype[iteratorSymbol] = function () { return this.entries(); };\n Map.prototype._find = function (key, insert) {\n if (this._cacheKey !== key) {\n this._cacheIndex = this._keys.indexOf(this._cacheKey = key);\n }\n if (this._cacheIndex < 0 && insert) {\n this._cacheIndex = this._keys.length;\n this._keys.push(key);\n this._values.push(undefined);\n }\n return this._cacheIndex;\n };\n return Map;\n }());\n function getKey(key, _) {\n return key;\n }\n function getValue(_, value) {\n return value;\n }\n function getEntry(key, value) {\n return [key, value];\n }\n }\n // naive Set shim\n function CreateSetPolyfill() {\n return /** @class */ (function () {\n function Set() {\n this._map = new _Map();\n }\n Object.defineProperty(Set.prototype, \"size\", {\n get: function () { return this._map.size; },\n enumerable: true,\n configurable: true\n });\n Set.prototype.has = function (value) { return this._map.has(value); };\n Set.prototype.add = function (value) { return this._map.set(value, value), this; };\n Set.prototype.delete = function (value) { return this._map.delete(value); };\n Set.prototype.clear = function () { this._map.clear(); };\n Set.prototype.keys = function () { return this._map.keys(); };\n Set.prototype.values = function () { return this._map.values(); };\n Set.prototype.entries = function () { return this._map.entries(); };\n Set.prototype[\"@@iterator\"] = function () { return this.keys(); };\n Set.prototype[iteratorSymbol] = function () { return this.keys(); };\n return Set;\n }());\n }\n // naive WeakMap shim\n function CreateWeakMapPolyfill() {\n var UUID_SIZE = 16;\n var keys = HashMap.create();\n var rootKey = CreateUniqueKey();\n return /** @class */ (function () {\n function WeakMap() {\n this._key = CreateUniqueKey();\n }\n WeakMap.prototype.has = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? HashMap.has(table, this._key) : false;\n };\n WeakMap.prototype.get = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? HashMap.get(table, this._key) : undefined;\n };\n WeakMap.prototype.set = function (target, value) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ true);\n table[this._key] = value;\n return this;\n };\n WeakMap.prototype.delete = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? delete table[this._key] : false;\n };\n WeakMap.prototype.clear = function () {\n // NOTE: not a real clear, just makes the previous data unreachable\n this._key = CreateUniqueKey();\n };\n return WeakMap;\n }());\n function CreateUniqueKey() {\n var key;\n do\n key = \"@@WeakMap@@\" + CreateUUID();\n while (HashMap.has(keys, key));\n keys[key] = true;\n return key;\n }\n function GetOrCreateWeakMapTable(target, create) {\n if (!hasOwn.call(target, rootKey)) {\n if (!create)\n return undefined;\n Object.defineProperty(target, rootKey, { value: HashMap.create() });\n }\n return target[rootKey];\n }\n function FillRandomBytes(buffer, size) {\n for (var i = 0; i < size; ++i)\n buffer[i] = Math.random() * 0xff | 0;\n return buffer;\n }\n function GenRandomBytes(size) {\n if (typeof Uint8Array === \"function\") {\n if (typeof crypto !== \"undefined\")\n return crypto.getRandomValues(new Uint8Array(size));\n if (typeof msCrypto !== \"undefined\")\n return msCrypto.getRandomValues(new Uint8Array(size));\n return FillRandomBytes(new Uint8Array(size), size);\n }\n return FillRandomBytes(new Array(size), size);\n }\n function CreateUUID() {\n var data = GenRandomBytes(UUID_SIZE);\n // mark as random - RFC 4122 § 4.4\n data[6] = data[6] & 0x4f | 0x40;\n data[8] = data[8] & 0xbf | 0x80;\n var result = \"\";\n for (var offset = 0; offset < UUID_SIZE; ++offset) {\n var byte = data[offset];\n if (offset === 4 || offset === 6 || offset === 8)\n result += \"-\";\n if (byte < 16)\n result += \"0\";\n result += byte.toString(16).toLowerCase();\n }\n return result;\n }\n }\n // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n function MakeDictionary(obj) {\n obj.__ = undefined;\n delete obj.__;\n return obj;\n }\n });\n})(Reflect || (Reflect = {}));\n","// Copyright 2010-2012 Mikeal Rogers\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n'use strict'\n\nvar extend = require('extend')\nvar cookies = require('./lib/cookies')\nvar helpers = require('./lib/helpers')\n\nvar paramsHaveRequestBody = helpers.paramsHaveRequestBody\n\n// organize params for patch, post, put, head, del\nfunction initParams (uri, options, callback) {\n if (typeof options === 'function') {\n callback = options\n }\n\n var params = {}\n if (options !== null && typeof options === 'object') {\n extend(params, options, {uri: uri})\n } else if (typeof uri === 'string') {\n extend(params, {uri: uri})\n } else {\n extend(params, uri)\n }\n\n params.callback = callback || params.callback\n return params\n}\n\nfunction request (uri, options, callback) {\n if (typeof uri === 'undefined') {\n throw new Error('undefined is not a valid uri or options object.')\n }\n\n var params = initParams(uri, options, callback)\n\n if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {\n throw new Error('HTTP HEAD requests MUST NOT include a request body.')\n }\n\n return new request.Request(params)\n}\n\nfunction verbFunc (verb) {\n var method = verb.toUpperCase()\n return function (uri, options, callback) {\n var params = initParams(uri, options, callback)\n params.method = method\n return request(params, params.callback)\n }\n}\n\n// define like this to please codeintel/intellisense IDEs\nrequest.get = verbFunc('get')\nrequest.head = verbFunc('head')\nrequest.options = verbFunc('options')\nrequest.post = verbFunc('post')\nrequest.put = verbFunc('put')\nrequest.patch = verbFunc('patch')\nrequest.del = verbFunc('delete')\nrequest['delete'] = verbFunc('delete')\n\nrequest.jar = function (store) {\n return cookies.jar(store)\n}\n\nrequest.cookie = function (str) {\n return cookies.parse(str)\n}\n\nfunction wrapRequestMethod (method, options, requester, verb) {\n return function (uri, opts, callback) {\n var params = initParams(uri, opts, callback)\n\n var target = {}\n extend(true, target, options, params)\n\n target.pool = params.pool || options.pool\n\n if (verb) {\n target.method = verb.toUpperCase()\n }\n\n if (typeof requester === 'function') {\n method = requester\n }\n\n return method(target, target.callback)\n }\n}\n\nrequest.defaults = function (options, requester) {\n var self = this\n\n options = options || {}\n\n if (typeof options === 'function') {\n requester = options\n options = {}\n }\n\n var defaults = wrapRequestMethod(self, options, requester)\n\n var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']\n verbs.forEach(function (verb) {\n defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)\n })\n\n defaults.cookie = wrapRequestMethod(self.cookie, options, requester)\n defaults.jar = self.jar\n defaults.defaults = self.defaults\n return defaults\n}\n\nrequest.forever = function (agentOptions, optionsArg) {\n var options = {}\n if (optionsArg) {\n extend(options, optionsArg)\n }\n if (agentOptions) {\n options.agentOptions = agentOptions\n }\n\n options.forever = true\n return request.defaults(options)\n}\n\n// Exports\n\nmodule.exports = request\nrequest.Request = require('./request')\nrequest.initParams = initParams\n\n// Backwards compatibility for request.debug\nObject.defineProperty(request, 'debug', {\n enumerable: true,\n get: function () {\n return request.Request.debug\n },\n set: function (debug) {\n request.Request.debug = debug\n }\n})\n","'use strict'\n\nvar caseless = require('caseless')\nvar uuid = require('uuid/v4')\nvar helpers = require('./helpers')\n\nvar md5 = helpers.md5\nvar toBase64 = helpers.toBase64\n\nfunction Auth (request) {\n // define all public properties here\n this.request = request\n this.hasAuth = false\n this.sentAuth = false\n this.bearerToken = null\n this.user = null\n this.pass = null\n}\n\nAuth.prototype.basic = function (user, pass, sendImmediately) {\n var self = this\n if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {\n self.request.emit('error', new Error('auth() received invalid user or password'))\n }\n self.user = user\n self.pass = pass\n self.hasAuth = true\n var header = user + ':' + (pass || '')\n if (sendImmediately || typeof sendImmediately === 'undefined') {\n var authHeader = 'Basic ' + toBase64(header)\n self.sentAuth = true\n return authHeader\n }\n}\n\nAuth.prototype.bearer = function (bearer, sendImmediately) {\n var self = this\n self.bearerToken = bearer\n self.hasAuth = true\n if (sendImmediately || typeof sendImmediately === 'undefined') {\n if (typeof bearer === 'function') {\n bearer = bearer()\n }\n var authHeader = 'Bearer ' + (bearer || '')\n self.sentAuth = true\n return authHeader\n }\n}\n\nAuth.prototype.digest = function (method, path, authHeader) {\n // TODO: More complete implementation of RFC 2617.\n // - handle challenge.domain\n // - support qop=\"auth-int\" only\n // - handle Authentication-Info (not necessarily?)\n // - check challenge.stale (not necessarily?)\n // - increase nc (not necessarily?)\n // For reference:\n // http://tools.ietf.org/html/rfc2617#section-3\n // https://github.com/bagder/curl/blob/master/lib/http_digest.c\n\n var self = this\n\n var challenge = {}\n var re = /([a-z0-9_-]+)=(?:\"([^\"]+)\"|([a-z0-9_-]+))/gi\n while (true) {\n var match = re.exec(authHeader)\n if (!match) {\n break\n }\n challenge[match[1]] = match[2] || match[3]\n }\n\n /**\n * RFC 2617: handle both MD5 and MD5-sess algorithms.\n *\n * If the algorithm directive's value is \"MD5\" or unspecified, then HA1 is\n * HA1=MD5(username:realm:password)\n * If the algorithm directive's value is \"MD5-sess\", then HA1 is\n * HA1=MD5(MD5(username:realm:password):nonce:cnonce)\n */\n var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {\n var ha1 = md5(user + ':' + realm + ':' + pass)\n if (algorithm && algorithm.toLowerCase() === 'md5-sess') {\n return md5(ha1 + ':' + nonce + ':' + cnonce)\n } else {\n return ha1\n }\n }\n\n var qop = /(^|,)\\s*auth\\s*($|,)/.test(challenge.qop) && 'auth'\n var nc = qop && '00000001'\n var cnonce = qop && uuid().replace(/-/g, '')\n var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)\n var ha2 = md5(method + ':' + path)\n var digestResponse = qop\n ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)\n : md5(ha1 + ':' + challenge.nonce + ':' + ha2)\n var authValues = {\n username: self.user,\n realm: challenge.realm,\n nonce: challenge.nonce,\n uri: path,\n qop: qop,\n response: digestResponse,\n nc: nc,\n cnonce: cnonce,\n algorithm: challenge.algorithm,\n opaque: challenge.opaque\n }\n\n authHeader = []\n for (var k in authValues) {\n if (authValues[k]) {\n if (k === 'qop' || k === 'nc' || k === 'algorithm') {\n authHeader.push(k + '=' + authValues[k])\n } else {\n authHeader.push(k + '=\"' + authValues[k] + '\"')\n }\n }\n }\n authHeader = 'Digest ' + authHeader.join(', ')\n self.sentAuth = true\n return authHeader\n}\n\nAuth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {\n var self = this\n var request = self.request\n\n var authHeader\n if (bearer === undefined && user === undefined) {\n self.request.emit('error', new Error('no auth mechanism defined'))\n } else if (bearer !== undefined) {\n authHeader = self.bearer(bearer, sendImmediately)\n } else {\n authHeader = self.basic(user, pass, sendImmediately)\n }\n if (authHeader) {\n request.setHeader('authorization', authHeader)\n }\n}\n\nAuth.prototype.onResponse = function (response) {\n var self = this\n var request = self.request\n\n if (!self.hasAuth || self.sentAuth) { return null }\n\n var c = caseless(response.headers)\n\n var authHeader = c.get('www-authenticate')\n var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()\n request.debug('reauth', authVerb)\n\n switch (authVerb) {\n case 'basic':\n return self.basic(self.user, self.pass, true)\n\n case 'bearer':\n return self.bearer(self.bearerToken, true)\n\n case 'digest':\n return self.digest(request.method, request.path, authHeader)\n }\n}\n\nexports.Auth = Auth\n","'use strict'\n\nvar tough = require('tough-cookie')\n\nvar Cookie = tough.Cookie\nvar CookieJar = tough.CookieJar\n\nexports.parse = function (str) {\n if (str && str.uri) {\n str = str.uri\n }\n if (typeof str !== 'string') {\n throw new Error('The cookie function only accepts STRING as param')\n }\n return Cookie.parse(str, {loose: true})\n}\n\n// Adapt the sometimes-Async api of tough.CookieJar to our requirements\nfunction RequestJar (store) {\n var self = this\n self._jar = new CookieJar(store, {looseMode: true})\n}\nRequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {\n var self = this\n return self._jar.setCookieSync(cookieOrStr, uri, options || {})\n}\nRequestJar.prototype.getCookieString = function (uri) {\n var self = this\n return self._jar.getCookieStringSync(uri)\n}\nRequestJar.prototype.getCookies = function (uri) {\n var self = this\n return self._jar.getCookiesSync(uri)\n}\n\nexports.jar = function (store) {\n return new RequestJar(store)\n}\n","'use strict'\n\nfunction formatHostname (hostname) {\n // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'\n return hostname.replace(/^\\.*/, '.').toLowerCase()\n}\n\nfunction parseNoProxyZone (zone) {\n zone = zone.trim().toLowerCase()\n\n var zoneParts = zone.split(':', 2)\n var zoneHost = formatHostname(zoneParts[0])\n var zonePort = zoneParts[1]\n var hasPort = zone.indexOf(':') > -1\n\n return {hostname: zoneHost, port: zonePort, hasPort: hasPort}\n}\n\nfunction uriInNoProxy (uri, noProxy) {\n var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')\n var hostname = formatHostname(uri.hostname)\n var noProxyList = noProxy.split(',')\n\n // iterate through the noProxyList until it finds a match.\n return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {\n var isMatchedAt = hostname.indexOf(noProxyZone.hostname)\n var hostnameMatched = (\n isMatchedAt > -1 &&\n (isMatchedAt === hostname.length - noProxyZone.hostname.length)\n )\n\n if (noProxyZone.hasPort) {\n return (port === noProxyZone.port) && hostnameMatched\n }\n\n return hostnameMatched\n })\n}\n\nfunction getProxyFromURI (uri) {\n // Decide the proper request proxy to use based on the request URI object and the\n // environmental variables (NO_PROXY, HTTP_PROXY, etc.)\n // respect NO_PROXY environment variables (see: https://lynx.invisible-island.net/lynx2.8.7/breakout/lynx_help/keystrokes/environments.html)\n\n var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''\n\n // if the noProxy is a wildcard then return null\n\n if (noProxy === '*') {\n return null\n }\n\n // if the noProxy is not empty and the uri is found return null\n\n if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {\n return null\n }\n\n // Check for HTTP or HTTPS Proxy in environment Else default to null\n\n if (uri.protocol === 'http:') {\n return process.env.HTTP_PROXY ||\n process.env.http_proxy || null\n }\n\n if (uri.protocol === 'https:') {\n return process.env.HTTPS_PROXY ||\n process.env.https_proxy ||\n process.env.HTTP_PROXY ||\n process.env.http_proxy || null\n }\n\n // if none of that works, return null\n // (What uri protocol are you using then?)\n\n return null\n}\n\nmodule.exports = getProxyFromURI\n","'use strict'\n\nvar fs = require('fs')\nvar qs = require('querystring')\nvar validate = require('har-validator')\nvar extend = require('extend')\n\nfunction Har (request) {\n this.request = request\n}\n\nHar.prototype.reducer = function (obj, pair) {\n // new property ?\n if (obj[pair.name] === undefined) {\n obj[pair.name] = pair.value\n return obj\n }\n\n // existing? convert to array\n var arr = [\n obj[pair.name],\n pair.value\n ]\n\n obj[pair.name] = arr\n\n return obj\n}\n\nHar.prototype.prep = function (data) {\n // construct utility properties\n data.queryObj = {}\n data.headersObj = {}\n data.postData.jsonObj = false\n data.postData.paramsObj = false\n\n // construct query objects\n if (data.queryString && data.queryString.length) {\n data.queryObj = data.queryString.reduce(this.reducer, {})\n }\n\n // construct headers objects\n if (data.headers && data.headers.length) {\n // loweCase header keys\n data.headersObj = data.headers.reduceRight(function (headers, header) {\n headers[header.name] = header.value\n return headers\n }, {})\n }\n\n // construct Cookie header\n if (data.cookies && data.cookies.length) {\n var cookies = data.cookies.map(function (cookie) {\n return cookie.name + '=' + cookie.value\n })\n\n if (cookies.length) {\n data.headersObj.cookie = cookies.join('; ')\n }\n }\n\n // prep body\n function some (arr) {\n return arr.some(function (type) {\n return data.postData.mimeType.indexOf(type) === 0\n })\n }\n\n if (some([\n 'multipart/mixed',\n 'multipart/related',\n 'multipart/form-data',\n 'multipart/alternative'])) {\n // reset values\n data.postData.mimeType = 'multipart/form-data'\n } else if (some([\n 'application/x-www-form-urlencoded'])) {\n if (!data.postData.params) {\n data.postData.text = ''\n } else {\n data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})\n\n // always overwrite\n data.postData.text = qs.stringify(data.postData.paramsObj)\n }\n } else if (some([\n 'text/json',\n 'text/x-json',\n 'application/json',\n 'application/x-json'])) {\n data.postData.mimeType = 'application/json'\n\n if (data.postData.text) {\n try {\n data.postData.jsonObj = JSON.parse(data.postData.text)\n } catch (e) {\n this.request.debug(e)\n\n // force back to text/plain\n data.postData.mimeType = 'text/plain'\n }\n }\n }\n\n return data\n}\n\nHar.prototype.options = function (options) {\n // skip if no har property defined\n if (!options.har) {\n return options\n }\n\n var har = {}\n extend(har, options.har)\n\n // only process the first entry\n if (har.log && har.log.entries) {\n har = har.log.entries[0]\n }\n\n // add optional properties to make validation successful\n har.url = har.url || options.url || options.uri || options.baseUrl || '/'\n har.httpVersion = har.httpVersion || 'HTTP/1.1'\n har.queryString = har.queryString || []\n har.headers = har.headers || []\n har.cookies = har.cookies || []\n har.postData = har.postData || {}\n har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'\n\n har.bodySize = 0\n har.headersSize = 0\n har.postData.size = 0\n\n if (!validate.request(har)) {\n return options\n }\n\n // clean up and get some utility properties\n var req = this.prep(har)\n\n // construct new options\n if (req.url) {\n options.url = req.url\n }\n\n if (req.method) {\n options.method = req.method\n }\n\n if (Object.keys(req.queryObj).length) {\n options.qs = req.queryObj\n }\n\n if (Object.keys(req.headersObj).length) {\n options.headers = req.headersObj\n }\n\n function test (type) {\n return req.postData.mimeType.indexOf(type) === 0\n }\n if (test('application/x-www-form-urlencoded')) {\n options.form = req.postData.paramsObj\n } else if (test('application/json')) {\n if (req.postData.jsonObj) {\n options.body = req.postData.jsonObj\n options.json = true\n }\n } else if (test('multipart/form-data')) {\n options.formData = {}\n\n req.postData.params.forEach(function (param) {\n var attachment = {}\n\n if (!param.fileName && !param.contentType) {\n options.formData[param.name] = param.value\n return\n }\n\n // attempt to read from disk!\n if (param.fileName && !param.value) {\n attachment.value = fs.createReadStream(param.fileName)\n } else if (param.value) {\n attachment.value = param.value\n }\n\n if (param.fileName) {\n attachment.options = {\n filename: param.fileName,\n contentType: param.contentType ? param.contentType : null\n }\n }\n\n options.formData[param.name] = attachment\n })\n } else {\n if (req.postData.text) {\n options.body = req.postData.text\n }\n }\n\n return options\n}\n\nexports.Har = Har\n","'use strict'\n\nvar crypto = require('crypto')\n\nfunction randomString (size) {\n var bits = (size + 1) * 6\n var buffer = crypto.randomBytes(Math.ceil(bits / 8))\n var string = buffer.toString('base64').replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '')\n return string.slice(0, size)\n}\n\nfunction calculatePayloadHash (payload, algorithm, contentType) {\n var hash = crypto.createHash(algorithm)\n hash.update('hawk.1.payload\\n')\n hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\\n')\n hash.update(payload || '')\n hash.update('\\n')\n return hash.digest('base64')\n}\n\nexports.calculateMac = function (credentials, opts) {\n var normalized = 'hawk.1.header\\n' +\n opts.ts + '\\n' +\n opts.nonce + '\\n' +\n (opts.method || '').toUpperCase() + '\\n' +\n opts.resource + '\\n' +\n opts.host.toLowerCase() + '\\n' +\n opts.port + '\\n' +\n (opts.hash || '') + '\\n'\n\n if (opts.ext) {\n normalized = normalized + opts.ext.replace('\\\\', '\\\\\\\\').replace('\\n', '\\\\n')\n }\n\n normalized = normalized + '\\n'\n\n if (opts.app) {\n normalized = normalized + opts.app + '\\n' + (opts.dlg || '') + '\\n'\n }\n\n var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized)\n var digest = hmac.digest('base64')\n return digest\n}\n\nexports.header = function (uri, method, opts) {\n var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000)\n var credentials = opts.credentials\n if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {\n return ''\n }\n\n if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) {\n return ''\n }\n\n var artifacts = {\n ts: timestamp,\n nonce: opts.nonce || randomString(6),\n method: method,\n resource: uri.pathname + (uri.search || ''),\n host: uri.hostname,\n port: uri.port || (uri.protocol === 'http:' ? 80 : 443),\n hash: opts.hash,\n ext: opts.ext,\n app: opts.app,\n dlg: opts.dlg\n }\n\n if (!artifacts.hash && (opts.payload || opts.payload === '')) {\n artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType)\n }\n\n var mac = exports.calculateMac(credentials, artifacts)\n\n var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''\n var header = 'Hawk id=\"' + credentials.id +\n '\", ts=\"' + artifacts.ts +\n '\", nonce=\"' + artifacts.nonce +\n (artifacts.hash ? '\", hash=\"' + artifacts.hash : '') +\n (hasExt ? '\", ext=\"' + artifacts.ext.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"') : '') +\n '\", mac=\"' + mac + '\"'\n\n if (artifacts.app) {\n header = header + ', app=\"' + artifacts.app + (artifacts.dlg ? '\", dlg=\"' + artifacts.dlg : '') + '\"'\n }\n\n return header\n}\n","'use strict'\n\nvar jsonSafeStringify = require('json-stringify-safe')\nvar crypto = require('crypto')\nvar Buffer = require('safe-buffer').Buffer\n\nvar defer = typeof setImmediate === 'undefined'\n ? process.nextTick\n : setImmediate\n\nfunction paramsHaveRequestBody (params) {\n return (\n params.body ||\n params.requestBodyStream ||\n (params.json && typeof params.json !== 'boolean') ||\n params.multipart\n )\n}\n\nfunction safeStringify (obj, replacer) {\n var ret\n try {\n ret = JSON.stringify(obj, replacer)\n } catch (e) {\n ret = jsonSafeStringify(obj, replacer)\n }\n return ret\n}\n\nfunction md5 (str) {\n return crypto.createHash('md5').update(str).digest('hex')\n}\n\nfunction isReadStream (rs) {\n return rs.readable && rs.path && rs.mode\n}\n\nfunction toBase64 (str) {\n return Buffer.from(str || '', 'utf8').toString('base64')\n}\n\nfunction copy (obj) {\n var o = {}\n Object.keys(obj).forEach(function (i) {\n o[i] = obj[i]\n })\n return o\n}\n\nfunction version () {\n var numbers = process.version.replace('v', '').split('.')\n return {\n major: parseInt(numbers[0], 10),\n minor: parseInt(numbers[1], 10),\n patch: parseInt(numbers[2], 10)\n }\n}\n\nexports.paramsHaveRequestBody = paramsHaveRequestBody\nexports.safeStringify = safeStringify\nexports.md5 = md5\nexports.isReadStream = isReadStream\nexports.toBase64 = toBase64\nexports.copy = copy\nexports.version = version\nexports.defer = defer\n","'use strict'\n\nvar uuid = require('uuid/v4')\nvar CombinedStream = require('combined-stream')\nvar isstream = require('isstream')\nvar Buffer = require('safe-buffer').Buffer\n\nfunction Multipart (request) {\n this.request = request\n this.boundary = uuid()\n this.chunked = false\n this.body = null\n}\n\nMultipart.prototype.isChunked = function (options) {\n var self = this\n var chunked = false\n var parts = options.data || options\n\n if (!parts.forEach) {\n self.request.emit('error', new Error('Argument error, options.multipart.'))\n }\n\n if (options.chunked !== undefined) {\n chunked = options.chunked\n }\n\n if (self.request.getHeader('transfer-encoding') === 'chunked') {\n chunked = true\n }\n\n if (!chunked) {\n parts.forEach(function (part) {\n if (typeof part.body === 'undefined') {\n self.request.emit('error', new Error('Body attribute missing in multipart.'))\n }\n if (isstream(part.body)) {\n chunked = true\n }\n })\n }\n\n return chunked\n}\n\nMultipart.prototype.setHeaders = function (chunked) {\n var self = this\n\n if (chunked && !self.request.hasHeader('transfer-encoding')) {\n self.request.setHeader('transfer-encoding', 'chunked')\n }\n\n var header = self.request.getHeader('content-type')\n\n if (!header || header.indexOf('multipart') === -1) {\n self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)\n } else {\n if (header.indexOf('boundary') !== -1) {\n self.boundary = header.replace(/.*boundary=([^\\s;]+).*/, '$1')\n } else {\n self.request.setHeader('content-type', header + '; boundary=' + self.boundary)\n }\n }\n}\n\nMultipart.prototype.build = function (parts, chunked) {\n var self = this\n var body = chunked ? new CombinedStream() : []\n\n function add (part) {\n if (typeof part === 'number') {\n part = part.toString()\n }\n return chunked ? body.append(part) : body.push(Buffer.from(part))\n }\n\n if (self.request.preambleCRLF) {\n add('\\r\\n')\n }\n\n parts.forEach(function (part) {\n var preamble = '--' + self.boundary + '\\r\\n'\n Object.keys(part).forEach(function (key) {\n if (key === 'body') { return }\n preamble += key + ': ' + part[key] + '\\r\\n'\n })\n preamble += '\\r\\n'\n add(preamble)\n add(part.body)\n add('\\r\\n')\n })\n add('--' + self.boundary + '--')\n\n if (self.request.postambleCRLF) {\n add('\\r\\n')\n }\n\n return body\n}\n\nMultipart.prototype.onRequest = function (options) {\n var self = this\n\n var chunked = self.isChunked(options)\n var parts = options.data || options\n\n self.setHeaders(chunked)\n self.chunked = chunked\n self.body = self.build(parts, chunked)\n}\n\nexports.Multipart = Multipart\n","'use strict'\n\nvar url = require('url')\nvar qs = require('qs')\nvar caseless = require('caseless')\nvar uuid = require('uuid/v4')\nvar oauth = require('oauth-sign')\nvar crypto = require('crypto')\nvar Buffer = require('safe-buffer').Buffer\n\nfunction OAuth (request) {\n this.request = request\n this.params = null\n}\n\nOAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {\n var oa = {}\n for (var i in _oauth) {\n oa['oauth_' + i] = _oauth[i]\n }\n if (!oa.oauth_version) {\n oa.oauth_version = '1.0'\n }\n if (!oa.oauth_timestamp) {\n oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()\n }\n if (!oa.oauth_nonce) {\n oa.oauth_nonce = uuid().replace(/-/g, '')\n }\n if (!oa.oauth_signature_method) {\n oa.oauth_signature_method = 'HMAC-SHA1'\n }\n\n var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase\n delete oa.oauth_consumer_secret\n delete oa.oauth_private_key\n\n var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase\n delete oa.oauth_token_secret\n\n var realm = oa.oauth_realm\n delete oa.oauth_realm\n delete oa.oauth_transport_method\n\n var baseurl = uri.protocol + '//' + uri.host + uri.pathname\n var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))\n\n oa.oauth_signature = oauth.sign(\n oa.oauth_signature_method,\n method,\n baseurl,\n params,\n consumer_secret_or_private_key, // eslint-disable-line camelcase\n token_secret // eslint-disable-line camelcase\n )\n\n if (realm) {\n oa.realm = realm\n }\n\n return oa\n}\n\nOAuth.prototype.buildBodyHash = function (_oauth, body) {\n if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {\n this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +\n ' signature_method not supported with body_hash signing.'))\n }\n\n var shasum = crypto.createHash('sha1')\n shasum.update(body || '')\n var sha1 = shasum.digest('hex')\n\n return Buffer.from(sha1, 'hex').toString('base64')\n}\n\nOAuth.prototype.concatParams = function (oa, sep, wrap) {\n wrap = wrap || ''\n\n var params = Object.keys(oa).filter(function (i) {\n return i !== 'realm' && i !== 'oauth_signature'\n }).sort()\n\n if (oa.realm) {\n params.splice(0, 0, 'realm')\n }\n params.push('oauth_signature')\n\n return params.map(function (i) {\n return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap\n }).join(sep)\n}\n\nOAuth.prototype.onRequest = function (_oauth) {\n var self = this\n self.params = _oauth\n\n var uri = self.request.uri || {}\n var method = self.request.method || ''\n var headers = caseless(self.request.headers)\n var body = self.request.body || ''\n var qsLib = self.request.qsLib || qs\n\n var form\n var query\n var contentType = headers.get('content-type') || ''\n var formContentType = 'application/x-www-form-urlencoded'\n var transport = _oauth.transport_method || 'header'\n\n if (contentType.slice(0, formContentType.length) === formContentType) {\n contentType = formContentType\n form = body\n }\n if (uri.query) {\n query = uri.query\n }\n if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {\n self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +\n 'and content-type ' + formContentType))\n }\n\n if (!form && typeof _oauth.body_hash === 'boolean') {\n _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString())\n }\n\n var oa = self.buildParams(_oauth, uri, method, query, form, qsLib)\n\n switch (transport) {\n case 'header':\n self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '\"'))\n break\n\n case 'query':\n var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')\n self.request.uri = url.parse(href)\n self.request.path = self.request.uri.path\n break\n\n case 'body':\n self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&')\n break\n\n default:\n self.request.emit('error', new Error('oauth: transport_method invalid'))\n }\n}\n\nexports.OAuth = OAuth\n","'use strict'\n\nvar qs = require('qs')\nvar querystring = require('querystring')\n\nfunction Querystring (request) {\n this.request = request\n this.lib = null\n this.useQuerystring = null\n this.parseOptions = null\n this.stringifyOptions = null\n}\n\nQuerystring.prototype.init = function (options) {\n if (this.lib) { return }\n\n this.useQuerystring = options.useQuerystring\n this.lib = (this.useQuerystring ? querystring : qs)\n\n this.parseOptions = options.qsParseOptions || {}\n this.stringifyOptions = options.qsStringifyOptions || {}\n}\n\nQuerystring.prototype.stringify = function (obj) {\n return (this.useQuerystring)\n ? this.rfc3986(this.lib.stringify(obj,\n this.stringifyOptions.sep || null,\n this.stringifyOptions.eq || null,\n this.stringifyOptions))\n : this.lib.stringify(obj, this.stringifyOptions)\n}\n\nQuerystring.prototype.parse = function (str) {\n return (this.useQuerystring)\n ? this.lib.parse(str,\n this.parseOptions.sep || null,\n this.parseOptions.eq || null,\n this.parseOptions)\n : this.lib.parse(str, this.parseOptions)\n}\n\nQuerystring.prototype.rfc3986 = function (str) {\n return str.replace(/[!'()*]/g, function (c) {\n return '%' + c.charCodeAt(0).toString(16).toUpperCase()\n })\n}\n\nQuerystring.prototype.unescape = querystring.unescape\n\nexports.Querystring = Querystring\n","'use strict'\n\nvar url = require('url')\nvar isUrl = /^https?:/\n\nfunction Redirect (request) {\n this.request = request\n this.followRedirect = true\n this.followRedirects = true\n this.followAllRedirects = false\n this.followOriginalHttpMethod = false\n this.allowRedirect = function () { return true }\n this.maxRedirects = 10\n this.redirects = []\n this.redirectsFollowed = 0\n this.removeRefererHeader = false\n}\n\nRedirect.prototype.onRequest = function (options) {\n var self = this\n\n if (options.maxRedirects !== undefined) {\n self.maxRedirects = options.maxRedirects\n }\n if (typeof options.followRedirect === 'function') {\n self.allowRedirect = options.followRedirect\n }\n if (options.followRedirect !== undefined) {\n self.followRedirects = !!options.followRedirect\n }\n if (options.followAllRedirects !== undefined) {\n self.followAllRedirects = options.followAllRedirects\n }\n if (self.followRedirects || self.followAllRedirects) {\n self.redirects = self.redirects || []\n }\n if (options.removeRefererHeader !== undefined) {\n self.removeRefererHeader = options.removeRefererHeader\n }\n if (options.followOriginalHttpMethod !== undefined) {\n self.followOriginalHttpMethod = options.followOriginalHttpMethod\n }\n}\n\nRedirect.prototype.redirectTo = function (response) {\n var self = this\n var request = self.request\n\n var redirectTo = null\n if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {\n var location = response.caseless.get('location')\n request.debug('redirect', location)\n\n if (self.followAllRedirects) {\n redirectTo = location\n } else if (self.followRedirects) {\n switch (request.method) {\n case 'PATCH':\n case 'PUT':\n case 'POST':\n case 'DELETE':\n // Do not follow redirects\n break\n default:\n redirectTo = location\n break\n }\n }\n } else if (response.statusCode === 401) {\n var authHeader = request._auth.onResponse(response)\n if (authHeader) {\n request.setHeader('authorization', authHeader)\n redirectTo = request.uri\n }\n }\n return redirectTo\n}\n\nRedirect.prototype.onResponse = function (response) {\n var self = this\n var request = self.request\n\n var redirectTo = self.redirectTo(response)\n if (!redirectTo || !self.allowRedirect.call(request, response)) {\n return false\n }\n\n request.debug('redirect to', redirectTo)\n\n // ignore any potential response body. it cannot possibly be useful\n // to us at this point.\n // response.resume should be defined, but check anyway before calling. Workaround for browserify.\n if (response.resume) {\n response.resume()\n }\n\n if (self.redirectsFollowed >= self.maxRedirects) {\n request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))\n return false\n }\n self.redirectsFollowed += 1\n\n if (!isUrl.test(redirectTo)) {\n redirectTo = url.resolve(request.uri.href, redirectTo)\n }\n\n var uriPrev = request.uri\n request.uri = url.parse(redirectTo)\n\n // handle the case where we change protocol from https to http or vice versa\n if (request.uri.protocol !== uriPrev.protocol) {\n delete request.agent\n }\n\n self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })\n\n if (self.followAllRedirects && request.method !== 'HEAD' &&\n response.statusCode !== 401 && response.statusCode !== 307) {\n request.method = self.followOriginalHttpMethod ? request.method : 'GET'\n }\n // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215\n delete request.src\n delete request.req\n delete request._started\n if (response.statusCode !== 401 && response.statusCode !== 307) {\n // Remove parameters from the previous response, unless this is the second request\n // for a server that requires digest authentication.\n delete request.body\n delete request._form\n if (request.headers) {\n request.removeHeader('host')\n request.removeHeader('content-type')\n request.removeHeader('content-length')\n if (request.uri.hostname !== request.originalHost.split(':')[0]) {\n // Remove authorization if changing hostnames (but not if just\n // changing ports or protocols). This matches the behavior of curl:\n // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710\n request.removeHeader('authorization')\n }\n }\n }\n\n if (!self.removeRefererHeader) {\n request.setHeader('referer', uriPrev.href)\n }\n\n request.emit('redirect')\n\n request.init()\n\n return true\n}\n\nexports.Redirect = Redirect\n","'use strict'\n\nvar url = require('url')\nvar tunnel = require('tunnel-agent')\n\nvar defaultProxyHeaderWhiteList = [\n 'accept',\n 'accept-charset',\n 'accept-encoding',\n 'accept-language',\n 'accept-ranges',\n 'cache-control',\n 'content-encoding',\n 'content-language',\n 'content-location',\n 'content-md5',\n 'content-range',\n 'content-type',\n 'connection',\n 'date',\n 'expect',\n 'max-forwards',\n 'pragma',\n 'referer',\n 'te',\n 'user-agent',\n 'via'\n]\n\nvar defaultProxyHeaderExclusiveList = [\n 'proxy-authorization'\n]\n\nfunction constructProxyHost (uriObject) {\n var port = uriObject.port\n var protocol = uriObject.protocol\n var proxyHost = uriObject.hostname + ':'\n\n if (port) {\n proxyHost += port\n } else if (protocol === 'https:') {\n proxyHost += '443'\n } else {\n proxyHost += '80'\n }\n\n return proxyHost\n}\n\nfunction constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {\n var whiteList = proxyHeaderWhiteList\n .reduce(function (set, header) {\n set[header.toLowerCase()] = true\n return set\n }, {})\n\n return Object.keys(headers)\n .filter(function (header) {\n return whiteList[header.toLowerCase()]\n })\n .reduce(function (set, header) {\n set[header] = headers[header]\n return set\n }, {})\n}\n\nfunction constructTunnelOptions (request, proxyHeaders) {\n var proxy = request.proxy\n\n var tunnelOptions = {\n proxy: {\n host: proxy.hostname,\n port: +proxy.port,\n proxyAuth: proxy.auth,\n headers: proxyHeaders\n },\n headers: request.headers,\n ca: request.ca,\n cert: request.cert,\n key: request.key,\n passphrase: request.passphrase,\n pfx: request.pfx,\n ciphers: request.ciphers,\n rejectUnauthorized: request.rejectUnauthorized,\n secureOptions: request.secureOptions,\n secureProtocol: request.secureProtocol\n }\n\n return tunnelOptions\n}\n\nfunction constructTunnelFnName (uri, proxy) {\n var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')\n var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')\n return [uriProtocol, proxyProtocol].join('Over')\n}\n\nfunction getTunnelFn (request) {\n var uri = request.uri\n var proxy = request.proxy\n var tunnelFnName = constructTunnelFnName(uri, proxy)\n return tunnel[tunnelFnName]\n}\n\nfunction Tunnel (request) {\n this.request = request\n this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList\n this.proxyHeaderExclusiveList = []\n if (typeof request.tunnel !== 'undefined') {\n this.tunnelOverride = request.tunnel\n }\n}\n\nTunnel.prototype.isEnabled = function () {\n var self = this\n var request = self.request\n // Tunnel HTTPS by default. Allow the user to override this setting.\n\n // If self.tunnelOverride is set (the user specified a value), use it.\n if (typeof self.tunnelOverride !== 'undefined') {\n return self.tunnelOverride\n }\n\n // If the destination is HTTPS, tunnel.\n if (request.uri.protocol === 'https:') {\n return true\n }\n\n // Otherwise, do not use tunnel.\n return false\n}\n\nTunnel.prototype.setup = function (options) {\n var self = this\n var request = self.request\n\n options = options || {}\n\n if (typeof request.proxy === 'string') {\n request.proxy = url.parse(request.proxy)\n }\n\n if (!request.proxy || !request.tunnel) {\n return false\n }\n\n // Setup Proxy Header Exclusive List and White List\n if (options.proxyHeaderWhiteList) {\n self.proxyHeaderWhiteList = options.proxyHeaderWhiteList\n }\n if (options.proxyHeaderExclusiveList) {\n self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList\n }\n\n var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)\n var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)\n\n // Setup Proxy Headers and Proxy Headers Host\n // Only send the Proxy White Listed Header names\n var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)\n proxyHeaders.host = constructProxyHost(request.uri)\n\n proxyHeaderExclusiveList.forEach(request.removeHeader, request)\n\n // Set Agent from Tunnel Data\n var tunnelFn = getTunnelFn(request)\n var tunnelOptions = constructTunnelOptions(request, proxyHeaders)\n request.agent = tunnelFn(tunnelOptions)\n\n return true\n}\n\nTunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList\nTunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList\nexports.Tunnel = Tunnel\n","var CombinedStream = require('combined-stream');\nvar util = require('util');\nvar path = require('path');\nvar http = require('http');\nvar https = require('https');\nvar parseUrl = require('url').parse;\nvar fs = require('fs');\nvar mime = require('mime-types');\nvar asynckit = require('asynckit');\nvar populate = require('./populate.js');\n\n// Public API\nmodule.exports = FormData;\n\n// make it a Stream\nutil.inherits(FormData, CombinedStream);\n\n/**\n * Create readable \"multipart/form-data\" streams.\n * Can be used to submit forms\n * and file uploads to other web applications.\n *\n * @constructor\n * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream\n */\nfunction FormData(options) {\n if (!(this instanceof FormData)) {\n return new FormData();\n }\n\n this._overheadLength = 0;\n this._valueLength = 0;\n this._valuesToMeasure = [];\n\n CombinedStream.call(this);\n\n options = options || {};\n for (var option in options) {\n this[option] = options[option];\n }\n}\n\nFormData.LINE_BREAK = '\\r\\n';\nFormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';\n\nFormData.prototype.append = function(field, value, options) {\n\n options = options || {};\n\n // allow filename as single option\n if (typeof options == 'string') {\n options = {filename: options};\n }\n\n var append = CombinedStream.prototype.append.bind(this);\n\n // all that streamy business can't handle numbers\n if (typeof value == 'number') {\n value = '' + value;\n }\n\n // https://github.com/felixge/node-form-data/issues/38\n if (util.isArray(value)) {\n // Please convert your array into string\n // the way web server expects it\n this._error(new Error('Arrays are not supported.'));\n return;\n }\n\n var header = this._multiPartHeader(field, value, options);\n var footer = this._multiPartFooter();\n\n append(header);\n append(value);\n append(footer);\n\n // pass along options.knownLength\n this._trackLength(header, value, options);\n};\n\nFormData.prototype._trackLength = function(header, value, options) {\n var valueLength = 0;\n\n // used w/ getLengthSync(), when length is known.\n // e.g. for streaming directly from a remote server,\n // w/ a known file a size, and not wanting to wait for\n // incoming file to finish to get its size.\n if (options.knownLength != null) {\n valueLength += +options.knownLength;\n } else if (Buffer.isBuffer(value)) {\n valueLength = value.length;\n } else if (typeof value === 'string') {\n valueLength = Buffer.byteLength(value);\n }\n\n this._valueLength += valueLength;\n\n // @check why add CRLF? does this account for custom/multiple CRLFs?\n this._overheadLength +=\n Buffer.byteLength(header) +\n FormData.LINE_BREAK.length;\n\n // empty or either doesn't have path or not an http response\n if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {\n return;\n }\n\n // no need to bother with the length\n if (!options.knownLength) {\n this._valuesToMeasure.push(value);\n }\n};\n\nFormData.prototype._lengthRetriever = function(value, callback) {\n\n if (value.hasOwnProperty('fd')) {\n\n // take read range into a account\n // `end` = Infinity –> read file till the end\n //\n // TODO: Looks like there is bug in Node fs.createReadStream\n // it doesn't respect `end` options without `start` options\n // Fix it when node fixes it.\n // https://github.com/joyent/node/issues/7819\n if (value.end != undefined && value.end != Infinity && value.start != undefined) {\n\n // when end specified\n // no need to calculate range\n // inclusive, starts with 0\n callback(null, value.end + 1 - (value.start ? value.start : 0));\n\n // not that fast snoopy\n } else {\n // still need to fetch file size from fs\n fs.stat(value.path, function(err, stat) {\n\n var fileSize;\n\n if (err) {\n callback(err);\n return;\n }\n\n // update final size based on the range options\n fileSize = stat.size - (value.start ? value.start : 0);\n callback(null, fileSize);\n });\n }\n\n // or http response\n } else if (value.hasOwnProperty('httpVersion')) {\n callback(null, +value.headers['content-length']);\n\n // or request stream http://github.com/mikeal/request\n } else if (value.hasOwnProperty('httpModule')) {\n // wait till response come back\n value.on('response', function(response) {\n value.pause();\n callback(null, +response.headers['content-length']);\n });\n value.resume();\n\n // something else\n } else {\n callback('Unknown stream');\n }\n};\n\nFormData.prototype._multiPartHeader = function(field, value, options) {\n // custom header specified (as string)?\n // it becomes responsible for boundary\n // (e.g. to handle extra CRLFs on .NET servers)\n if (typeof options.header == 'string') {\n return options.header;\n }\n\n var contentDisposition = this._getContentDisposition(value, options);\n var contentType = this._getContentType(value, options);\n\n var contents = '';\n var headers = {\n // add custom disposition as third element or keep it two elements if not\n 'Content-Disposition': ['form-data', 'name=\"' + field + '\"'].concat(contentDisposition || []),\n // if no content type. allow it to be empty array\n 'Content-Type': [].concat(contentType || [])\n };\n\n // allow custom headers.\n if (typeof options.header == 'object') {\n populate(headers, options.header);\n }\n\n var header;\n for (var prop in headers) {\n if (!headers.hasOwnProperty(prop)) continue;\n header = headers[prop];\n\n // skip nullish headers.\n if (header == null) {\n continue;\n }\n\n // convert all headers to arrays.\n if (!Array.isArray(header)) {\n header = [header];\n }\n\n // add non-empty headers.\n if (header.length) {\n contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;\n }\n }\n\n return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;\n};\n\nFormData.prototype._getContentDisposition = function(value, options) {\n\n var filename\n , contentDisposition\n ;\n\n if (typeof options.filepath === 'string') {\n // custom filepath for relative paths\n filename = path.normalize(options.filepath).replace(/\\\\/g, '/');\n } else if (options.filename || value.name || value.path) {\n // custom filename take precedence\n // formidable and the browser add a name property\n // fs- and request- streams have path property\n filename = path.basename(options.filename || value.name || value.path);\n } else if (value.readable && value.hasOwnProperty('httpVersion')) {\n // or try http response\n filename = path.basename(value.client._httpMessage.path);\n }\n\n if (filename) {\n contentDisposition = 'filename=\"' + filename + '\"';\n }\n\n return contentDisposition;\n};\n\nFormData.prototype._getContentType = function(value, options) {\n\n // use custom content-type above all\n var contentType = options.contentType;\n\n // or try `name` from formidable, browser\n if (!contentType && value.name) {\n contentType = mime.lookup(value.name);\n }\n\n // or try `path` from fs-, request- streams\n if (!contentType && value.path) {\n contentType = mime.lookup(value.path);\n }\n\n // or if it's http-reponse\n if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {\n contentType = value.headers['content-type'];\n }\n\n // or guess it from the filepath or filename\n if (!contentType && (options.filepath || options.filename)) {\n contentType = mime.lookup(options.filepath || options.filename);\n }\n\n // fallback to the default content type if `value` is not simple value\n if (!contentType && typeof value == 'object') {\n contentType = FormData.DEFAULT_CONTENT_TYPE;\n }\n\n return contentType;\n};\n\nFormData.prototype._multiPartFooter = function() {\n return function(next) {\n var footer = FormData.LINE_BREAK;\n\n var lastPart = (this._streams.length === 0);\n if (lastPart) {\n footer += this._lastBoundary();\n }\n\n next(footer);\n }.bind(this);\n};\n\nFormData.prototype._lastBoundary = function() {\n return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;\n};\n\nFormData.prototype.getHeaders = function(userHeaders) {\n var header;\n var formHeaders = {\n 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()\n };\n\n for (header in userHeaders) {\n if (userHeaders.hasOwnProperty(header)) {\n formHeaders[header.toLowerCase()] = userHeaders[header];\n }\n }\n\n return formHeaders;\n};\n\nFormData.prototype.getBoundary = function() {\n if (!this._boundary) {\n this._generateBoundary();\n }\n\n return this._boundary;\n};\n\nFormData.prototype._generateBoundary = function() {\n // This generates a 50 character boundary similar to those used by Firefox.\n // They are optimized for boyer-moore parsing.\n var boundary = '--------------------------';\n for (var i = 0; i < 24; i++) {\n boundary += Math.floor(Math.random() * 10).toString(16);\n }\n\n this._boundary = boundary;\n};\n\n// Note: getLengthSync DOESN'T calculate streams length\n// As workaround one can calculate file size manually\n// and add it as knownLength option\nFormData.prototype.getLengthSync = function() {\n var knownLength = this._overheadLength + this._valueLength;\n\n // Don't get confused, there are 3 \"internal\" streams for each keyval pair\n // so it basically checks if there is any value added to the form\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n // https://github.com/form-data/form-data/issues/40\n if (!this.hasKnownLength()) {\n // Some async length retrievers are present\n // therefore synchronous length calculation is false.\n // Please use getLength(callback) to get proper length\n this._error(new Error('Cannot calculate proper length in synchronous way.'));\n }\n\n return knownLength;\n};\n\n// Public API to check if length of added values is known\n// https://github.com/form-data/form-data/issues/196\n// https://github.com/form-data/form-data/issues/262\nFormData.prototype.hasKnownLength = function() {\n var hasKnownLength = true;\n\n if (this._valuesToMeasure.length) {\n hasKnownLength = false;\n }\n\n return hasKnownLength;\n};\n\nFormData.prototype.getLength = function(cb) {\n var knownLength = this._overheadLength + this._valueLength;\n\n if (this._streams.length) {\n knownLength += this._lastBoundary().length;\n }\n\n if (!this._valuesToMeasure.length) {\n process.nextTick(cb.bind(this, null, knownLength));\n return;\n }\n\n asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {\n if (err) {\n cb(err);\n return;\n }\n\n values.forEach(function(length) {\n knownLength += length;\n });\n\n cb(null, knownLength);\n });\n};\n\nFormData.prototype.submit = function(params, cb) {\n var request\n , options\n , defaults = {method: 'post'}\n ;\n\n // parse provided url if it's string\n // or treat it as options object\n if (typeof params == 'string') {\n\n params = parseUrl(params);\n options = populate({\n port: params.port,\n path: params.pathname,\n host: params.hostname,\n protocol: params.protocol\n }, defaults);\n\n // use custom params\n } else {\n\n options = populate(params, defaults);\n // if no port provided use default one\n if (!options.port) {\n options.port = options.protocol == 'https:' ? 443 : 80;\n }\n }\n\n // put that good code in getHeaders to some use\n options.headers = this.getHeaders(params.headers);\n\n // https if specified, fallback to http in any other case\n if (options.protocol == 'https:') {\n request = https.request(options);\n } else {\n request = http.request(options);\n }\n\n // get content length and fire away\n this.getLength(function(err, length) {\n if (err) {\n this._error(err);\n return;\n }\n\n // add content length\n request.setHeader('Content-Length', length);\n\n this.pipe(request);\n if (cb) {\n request.on('error', cb);\n request.on('response', cb.bind(this, null));\n }\n }.bind(this));\n\n return request;\n};\n\nFormData.prototype._error = function(err) {\n if (!this.error) {\n this.error = err;\n this.pause();\n this.emit('error', err);\n }\n};\n\nFormData.prototype.toString = function () {\n return '[object FormData]';\n};\n","// populates missing values\nmodule.exports = function(dst, src) {\n\n Object.keys(src).forEach(function(prop)\n {\n dst[prop] = dst[prop] || src[prop];\n });\n\n return dst;\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nmodule.exports = {\n 'default': 'RFC3986',\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar defaults = {\n allowDots: false,\n allowPrototypes: false,\n arrayLimit: 20,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n parameterLimit: 1000,\n plainObjects: false,\n strictNullHandling: false\n};\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = {};\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n\n for (var i = 0; i < parts.length; ++i) {\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key, val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder);\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder);\n val = options.decoder(part.slice(pos + 1), defaults.decoder);\n }\n if (has.call(obj, key)) {\n obj[key] = [].concat(obj[key]).concat(val);\n } else {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options) {\n var leaf = val;\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = [].concat(leaf);\n } else {\n obj = options.plainObjects ? Object.create(null) : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var index = parseInt(cleanRoot, 10);\n if (!options.parseArrays && cleanRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== cleanRoot\n && String(index) === cleanRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (cleanRoot !== '__proto__') {\n obj[cleanRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys\n // that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while ((segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, just add whatever is left\n\n if (segment) {\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options);\n};\n\nmodule.exports = function (str, opts) {\n var options = opts ? utils.assign({}, opts) : {};\n\n if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;\n options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;\n options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;\n options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;\n options.parseArrays = options.parseArrays !== false;\n options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;\n options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;\n options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;\n options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;\n options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;\n options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? Object.create(null) : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? Object.create(null) : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options);\n obj = utils.merge(obj, newObj, options);\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar utils = require('./utils');\nvar formats = require('./formats');\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaults = {\n delimiter: '&',\n encode: true,\n encoder: utils.encode,\n encodeValuesOnly: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n) {\n var obj = object;\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;\n }\n\n obj = '';\n }\n\n if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n\n if (isArray(obj)) {\n pushToArray(values, stringify(\n obj[key],\n generateArrayPrefix(prefix, key),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n } else {\n pushToArray(values, stringify(\n obj[key],\n prefix + (allowDots ? '.' + key : '[' + key + ']'),\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n }\n }\n\n return values;\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = opts ? utils.assign({}, opts) : {};\n\n if (options.encoder !== null && typeof options.encoder !== 'undefined' && typeof options.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;\n var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;\n var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;\n var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;\n var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;\n var sort = typeof options.sort === 'function' ? options.sort : null;\n var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;\n var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;\n var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;\n if (typeof options.format === 'undefined') {\n options.format = formats['default'];\n } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n var formatter = formats.formatters[options.format];\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var arrayFormat;\n if (options.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = options.arrayFormat;\n } else if ('indices' in options) {\n arrayFormat = options.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = 'indices';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (sort) {\n objKeys.sort(sort);\n }\n\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n\n if (skipNulls && obj[key] === null) {\n continue;\n }\n pushToArray(keys, stringify(\n obj[key],\n key,\n generateArrayPrefix,\n strictNullHandling,\n skipNulls,\n encode ? encoder : null,\n filter,\n sort,\n allowDots,\n serializeDate,\n formatter,\n encodeValuesOnly\n ));\n }\n\n var joined = keys.join(delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar has = Object.prototype.hasOwnProperty;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n var obj;\n\n while (queue.length) {\n var item = queue.pop();\n obj = item.obj[item.prop];\n\n if (Array.isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n\n return obj;\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? Object.create(null) : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object') {\n if (Array.isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if ((options && (options.plainObjects || options.allowPrototypes)) || !has.call(Object.prototype, source)) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (Array.isArray(target) && !Array.isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (Array.isArray(target) && Array.isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str) {\n try {\n return decodeURIComponent(str.replace(/\\+/g, ' '));\n } catch (e) {\n return str;\n }\n};\n\nvar encode = function encode(str) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = typeof str === 'string' ? str : String(str);\n\n var out = '';\n for (var i = 0; i < string.length; ++i) {\n var c = string.charCodeAt(i);\n\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n ) {\n out += string.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n out = out + hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));\n /* eslint operator-linebreak: [2, \"before\"] */\n out += hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n return compactQueue(queue);\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (obj === null || typeof obj === 'undefined') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n merge: merge\n};\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","// Unique ID creation requires a high quality random # generator. In node.js\n// this is pretty straight-forward - we use the crypto API.\n\nvar crypto = require('crypto');\n\nmodule.exports = function nodeRNG() {\n return crypto.randomBytes(16);\n};\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","'use strict'\n\nvar http = require('http')\nvar https = require('https')\nvar url = require('url')\nvar util = require('util')\nvar stream = require('stream')\nvar zlib = require('zlib')\nvar aws2 = require('aws-sign2')\nvar aws4 = require('aws4')\nvar httpSignature = require('http-signature')\nvar mime = require('mime-types')\nvar caseless = require('caseless')\nvar ForeverAgent = require('forever-agent')\nvar FormData = require('form-data')\nvar extend = require('extend')\nvar isstream = require('isstream')\nvar isTypedArray = require('is-typedarray').strict\nvar helpers = require('./lib/helpers')\nvar cookies = require('./lib/cookies')\nvar getProxyFromURI = require('./lib/getProxyFromURI')\nvar Querystring = require('./lib/querystring').Querystring\nvar Har = require('./lib/har').Har\nvar Auth = require('./lib/auth').Auth\nvar OAuth = require('./lib/oauth').OAuth\nvar hawk = require('./lib/hawk')\nvar Multipart = require('./lib/multipart').Multipart\nvar Redirect = require('./lib/redirect').Redirect\nvar Tunnel = require('./lib/tunnel').Tunnel\nvar now = require('performance-now')\nvar Buffer = require('safe-buffer').Buffer\n\nvar safeStringify = helpers.safeStringify\nvar isReadStream = helpers.isReadStream\nvar toBase64 = helpers.toBase64\nvar defer = helpers.defer\nvar copy = helpers.copy\nvar version = helpers.version\nvar globalCookieJar = cookies.jar()\n\nvar globalPool = {}\n\nfunction filterForNonReserved (reserved, options) {\n // Filter out properties that are not reserved.\n // Reserved values are passed in at call site.\n\n var object = {}\n for (var i in options) {\n var notReserved = (reserved.indexOf(i) === -1)\n if (notReserved) {\n object[i] = options[i]\n }\n }\n return object\n}\n\nfunction filterOutReservedFunctions (reserved, options) {\n // Filter out properties that are functions and are reserved.\n // Reserved values are passed in at call site.\n\n var object = {}\n for (var i in options) {\n var isReserved = !(reserved.indexOf(i) === -1)\n var isFunction = (typeof options[i] === 'function')\n if (!(isReserved && isFunction)) {\n object[i] = options[i]\n }\n }\n return object\n}\n\n// Return a simpler request object to allow serialization\nfunction requestToJSON () {\n var self = this\n return {\n uri: self.uri,\n method: self.method,\n headers: self.headers\n }\n}\n\n// Return a simpler response object to allow serialization\nfunction responseToJSON () {\n var self = this\n return {\n statusCode: self.statusCode,\n body: self.body,\n headers: self.headers,\n request: requestToJSON.call(self.request)\n }\n}\n\nfunction Request (options) {\n // if given the method property in options, set property explicitMethod to true\n\n // extend the Request instance with any non-reserved properties\n // remove any reserved functions from the options object\n // set Request instance to be readable and writable\n // call init\n\n var self = this\n\n // start with HAR, then override with additional options\n if (options.har) {\n self._har = new Har(self)\n options = self._har.options(options)\n }\n\n stream.Stream.call(self)\n var reserved = Object.keys(Request.prototype)\n var nonReserved = filterForNonReserved(reserved, options)\n\n extend(self, nonReserved)\n options = filterOutReservedFunctions(reserved, options)\n\n self.readable = true\n self.writable = true\n if (options.method) {\n self.explicitMethod = true\n }\n self._qs = new Querystring(self)\n self._auth = new Auth(self)\n self._oauth = new OAuth(self)\n self._multipart = new Multipart(self)\n self._redirect = new Redirect(self)\n self._tunnel = new Tunnel(self)\n self.init(options)\n}\n\nutil.inherits(Request, stream.Stream)\n\n// Debugging\nRequest.debug = process.env.NODE_DEBUG && /\\brequest\\b/.test(process.env.NODE_DEBUG)\nfunction debug () {\n if (Request.debug) {\n console.error('REQUEST %s', util.format.apply(util, arguments))\n }\n}\nRequest.prototype.debug = debug\n\nRequest.prototype.init = function (options) {\n // init() contains all the code to setup the request object.\n // the actual outgoing request is not started until start() is called\n // this function is called from both the constructor and on redirect.\n var self = this\n if (!options) {\n options = {}\n }\n self.headers = self.headers ? copy(self.headers) : {}\n\n // Delete headers with value undefined since they break\n // ClientRequest.OutgoingMessage.setHeader in node 0.12\n for (var headerName in self.headers) {\n if (typeof self.headers[headerName] === 'undefined') {\n delete self.headers[headerName]\n }\n }\n\n caseless.httpify(self, self.headers)\n\n if (!self.method) {\n self.method = options.method || 'GET'\n }\n if (!self.localAddress) {\n self.localAddress = options.localAddress\n }\n\n self._qs.init(options)\n\n debug(options)\n if (!self.pool && self.pool !== false) {\n self.pool = globalPool\n }\n self.dests = self.dests || []\n self.__isRequestRequest = true\n\n // Protect against double callback\n if (!self._callback && self.callback) {\n self._callback = self.callback\n self.callback = function () {\n if (self._callbackCalled) {\n return // Print a warning maybe?\n }\n self._callbackCalled = true\n self._callback.apply(self, arguments)\n }\n self.on('error', self.callback.bind())\n self.on('complete', self.callback.bind(self, null))\n }\n\n // People use this property instead all the time, so support it\n if (!self.uri && self.url) {\n self.uri = self.url\n delete self.url\n }\n\n // If there's a baseUrl, then use it as the base URL (i.e. uri must be\n // specified as a relative path and is appended to baseUrl).\n if (self.baseUrl) {\n if (typeof self.baseUrl !== 'string') {\n return self.emit('error', new Error('options.baseUrl must be a string'))\n }\n\n if (typeof self.uri !== 'string') {\n return self.emit('error', new Error('options.uri must be a string when using options.baseUrl'))\n }\n\n if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) {\n return self.emit('error', new Error('options.uri must be a path when using options.baseUrl'))\n }\n\n // Handle all cases to make sure that there's only one slash between\n // baseUrl and uri.\n var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1\n var uriStartsWithSlash = self.uri.indexOf('/') === 0\n\n if (baseUrlEndsWithSlash && uriStartsWithSlash) {\n self.uri = self.baseUrl + self.uri.slice(1)\n } else if (baseUrlEndsWithSlash || uriStartsWithSlash) {\n self.uri = self.baseUrl + self.uri\n } else if (self.uri === '') {\n self.uri = self.baseUrl\n } else {\n self.uri = self.baseUrl + '/' + self.uri\n }\n delete self.baseUrl\n }\n\n // A URI is needed by this point, emit error if we haven't been able to get one\n if (!self.uri) {\n return self.emit('error', new Error('options.uri is a required argument'))\n }\n\n // If a string URI/URL was given, parse it into a URL object\n if (typeof self.uri === 'string') {\n self.uri = url.parse(self.uri)\n }\n\n // Some URL objects are not from a URL parsed string and need href added\n if (!self.uri.href) {\n self.uri.href = url.format(self.uri)\n }\n\n // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme\n if (self.uri.protocol === 'unix:') {\n return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`'))\n }\n\n // Support Unix Sockets\n if (self.uri.host === 'unix') {\n self.enableUnixSocket()\n }\n\n if (self.strictSSL === false) {\n self.rejectUnauthorized = false\n }\n\n if (!self.uri.pathname) { self.uri.pathname = '/' }\n\n if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) {\n // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar\n // Detect and reject it as soon as possible\n var faultyUri = url.format(self.uri)\n var message = 'Invalid URI \"' + faultyUri + '\"'\n if (Object.keys(options).length === 0) {\n // No option ? This can be the sign of a redirect\n // As this is a case where the user cannot do anything (they didn't call request directly with this URL)\n // they should be warned that it can be caused by a redirection (can save some hair)\n message += '. This can be caused by a crappy redirection.'\n }\n // This error was fatal\n self.abort()\n return self.emit('error', new Error(message))\n }\n\n if (!self.hasOwnProperty('proxy')) {\n self.proxy = getProxyFromURI(self.uri)\n }\n\n self.tunnel = self._tunnel.isEnabled()\n if (self.proxy) {\n self._tunnel.setup(options)\n }\n\n self._redirect.onRequest(options)\n\n self.setHost = false\n if (!self.hasHeader('host')) {\n var hostHeaderName = self.originalHostHeaderName || 'host'\n self.setHeader(hostHeaderName, self.uri.host)\n // Drop :port suffix from Host header if known protocol.\n if (self.uri.port) {\n if ((self.uri.port === '80' && self.uri.protocol === 'http:') ||\n (self.uri.port === '443' && self.uri.protocol === 'https:')) {\n self.setHeader(hostHeaderName, self.uri.hostname)\n }\n }\n self.setHost = true\n }\n\n self.jar(self._jar || options.jar)\n\n if (!self.uri.port) {\n if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 }\n }\n\n if (self.proxy && !self.tunnel) {\n self.port = self.proxy.port\n self.host = self.proxy.hostname\n } else {\n self.port = self.uri.port\n self.host = self.uri.hostname\n }\n\n if (options.form) {\n self.form(options.form)\n }\n\n if (options.formData) {\n var formData = options.formData\n var requestForm = self.form()\n var appendFormValue = function (key, value) {\n if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) {\n requestForm.append(key, value.value, value.options)\n } else {\n requestForm.append(key, value)\n }\n }\n for (var formKey in formData) {\n if (formData.hasOwnProperty(formKey)) {\n var formValue = formData[formKey]\n if (formValue instanceof Array) {\n for (var j = 0; j < formValue.length; j++) {\n appendFormValue(formKey, formValue[j])\n }\n } else {\n appendFormValue(formKey, formValue)\n }\n }\n }\n }\n\n if (options.qs) {\n self.qs(options.qs)\n }\n\n if (self.uri.path) {\n self.path = self.uri.path\n } else {\n self.path = self.uri.pathname + (self.uri.search || '')\n }\n\n if (self.path.length === 0) {\n self.path = '/'\n }\n\n // Auth must happen last in case signing is dependent on other headers\n if (options.aws) {\n self.aws(options.aws)\n }\n\n if (options.hawk) {\n self.hawk(options.hawk)\n }\n\n if (options.httpSignature) {\n self.httpSignature(options.httpSignature)\n }\n\n if (options.auth) {\n if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) {\n options.auth.user = options.auth.username\n }\n if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) {\n options.auth.pass = options.auth.password\n }\n\n self.auth(\n options.auth.user,\n options.auth.pass,\n options.auth.sendImmediately,\n options.auth.bearer\n )\n }\n\n if (self.gzip && !self.hasHeader('accept-encoding')) {\n self.setHeader('accept-encoding', 'gzip, deflate')\n }\n\n if (self.uri.auth && !self.hasHeader('authorization')) {\n var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) })\n self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true)\n }\n\n if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) {\n var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) })\n var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':'))\n self.setHeader('proxy-authorization', authHeader)\n }\n\n if (self.proxy && !self.tunnel) {\n self.path = (self.uri.protocol + '//' + self.uri.host + self.path)\n }\n\n if (options.json) {\n self.json(options.json)\n }\n if (options.multipart) {\n self.multipart(options.multipart)\n }\n\n if (options.time) {\n self.timing = true\n\n // NOTE: elapsedTime is deprecated in favor of .timings\n self.elapsedTime = self.elapsedTime || 0\n }\n\n function setContentLength () {\n if (isTypedArray(self.body)) {\n self.body = Buffer.from(self.body)\n }\n\n if (!self.hasHeader('content-length')) {\n var length\n if (typeof self.body === 'string') {\n length = Buffer.byteLength(self.body)\n } else if (Array.isArray(self.body)) {\n length = self.body.reduce(function (a, b) { return a + b.length }, 0)\n } else {\n length = self.body.length\n }\n\n if (length) {\n self.setHeader('content-length', length)\n } else {\n self.emit('error', new Error('Argument error, options.body.'))\n }\n }\n }\n if (self.body && !isstream(self.body)) {\n setContentLength()\n }\n\n if (options.oauth) {\n self.oauth(options.oauth)\n } else if (self._oauth.params && self.hasHeader('authorization')) {\n self.oauth(self._oauth.params)\n }\n\n var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol\n var defaultModules = {'http:': http, 'https:': https}\n var httpModules = self.httpModules || {}\n\n self.httpModule = httpModules[protocol] || defaultModules[protocol]\n\n if (!self.httpModule) {\n return self.emit('error', new Error('Invalid protocol: ' + protocol))\n }\n\n if (options.ca) {\n self.ca = options.ca\n }\n\n if (!self.agent) {\n if (options.agentOptions) {\n self.agentOptions = options.agentOptions\n }\n\n if (options.agentClass) {\n self.agentClass = options.agentClass\n } else if (options.forever) {\n var v = version()\n // use ForeverAgent in node 0.10- only\n if (v.major === 0 && v.minor <= 10) {\n self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL\n } else {\n self.agentClass = self.httpModule.Agent\n self.agentOptions = self.agentOptions || {}\n self.agentOptions.keepAlive = true\n }\n } else {\n self.agentClass = self.httpModule.Agent\n }\n }\n\n if (self.pool === false) {\n self.agent = false\n } else {\n self.agent = self.agent || self.getNewAgent()\n }\n\n self.on('pipe', function (src) {\n if (self.ntick && self._started) {\n self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.'))\n }\n self.src = src\n if (isReadStream(src)) {\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', mime.lookup(src.path))\n }\n } else {\n if (src.headers) {\n for (var i in src.headers) {\n if (!self.hasHeader(i)) {\n self.setHeader(i, src.headers[i])\n }\n }\n }\n if (self._json && !self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n if (src.method && !self.explicitMethod) {\n self.method = src.method\n }\n }\n\n // self.on('pipe', function () {\n // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')\n // })\n })\n\n defer(function () {\n if (self._aborted) {\n return\n }\n\n var end = function () {\n if (self._form) {\n if (!self._auth.hasAuth) {\n self._form.pipe(self)\n } else if (self._auth.hasAuth && self._auth.sentAuth) {\n self._form.pipe(self)\n }\n }\n if (self._multipart && self._multipart.chunked) {\n self._multipart.body.pipe(self)\n }\n if (self.body) {\n if (isstream(self.body)) {\n self.body.pipe(self)\n } else {\n setContentLength()\n if (Array.isArray(self.body)) {\n self.body.forEach(function (part) {\n self.write(part)\n })\n } else {\n self.write(self.body)\n }\n self.end()\n }\n } else if (self.requestBodyStream) {\n console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')\n self.requestBodyStream.pipe(self)\n } else if (!self.src) {\n if (self._auth.hasAuth && !self._auth.sentAuth) {\n self.end()\n return\n }\n if (self.method !== 'GET' && typeof self.method !== 'undefined') {\n self.setHeader('content-length', 0)\n }\n self.end()\n }\n }\n\n if (self._form && !self.hasHeader('content-length')) {\n // Before ending the request, we had to compute the length of the whole form, asyncly\n self.setHeader(self._form.getHeaders(), true)\n self._form.getLength(function (err, length) {\n if (!err && !isNaN(length)) {\n self.setHeader('content-length', length)\n }\n end()\n })\n } else {\n end()\n }\n\n self.ntick = true\n })\n}\n\nRequest.prototype.getNewAgent = function () {\n var self = this\n var Agent = self.agentClass\n var options = {}\n if (self.agentOptions) {\n for (var i in self.agentOptions) {\n options[i] = self.agentOptions[i]\n }\n }\n if (self.ca) {\n options.ca = self.ca\n }\n if (self.ciphers) {\n options.ciphers = self.ciphers\n }\n if (self.secureProtocol) {\n options.secureProtocol = self.secureProtocol\n }\n if (self.secureOptions) {\n options.secureOptions = self.secureOptions\n }\n if (typeof self.rejectUnauthorized !== 'undefined') {\n options.rejectUnauthorized = self.rejectUnauthorized\n }\n\n if (self.cert && self.key) {\n options.key = self.key\n options.cert = self.cert\n }\n\n if (self.pfx) {\n options.pfx = self.pfx\n }\n\n if (self.passphrase) {\n options.passphrase = self.passphrase\n }\n\n var poolKey = ''\n\n // different types of agents are in different pools\n if (Agent !== self.httpModule.Agent) {\n poolKey += Agent.name\n }\n\n // ca option is only relevant if proxy or destination are https\n var proxy = self.proxy\n if (typeof proxy === 'string') {\n proxy = url.parse(proxy)\n }\n var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'\n\n if (isHttps) {\n if (options.ca) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.ca\n }\n\n if (typeof options.rejectUnauthorized !== 'undefined') {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.rejectUnauthorized\n }\n\n if (options.cert) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.cert.toString('ascii') + options.key.toString('ascii')\n }\n\n if (options.pfx) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.pfx.toString('ascii')\n }\n\n if (options.ciphers) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.ciphers\n }\n\n if (options.secureProtocol) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.secureProtocol\n }\n\n if (options.secureOptions) {\n if (poolKey) {\n poolKey += ':'\n }\n poolKey += options.secureOptions\n }\n }\n\n if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) {\n // not doing anything special. Use the globalAgent\n return self.httpModule.globalAgent\n }\n\n // we're using a stored agent. Make sure it's protocol-specific\n poolKey = self.uri.protocol + poolKey\n\n // generate a new agent for this setting if none yet exists\n if (!self.pool[poolKey]) {\n self.pool[poolKey] = new Agent(options)\n // properly set maxSockets on new agents\n if (self.pool.maxSockets) {\n self.pool[poolKey].maxSockets = self.pool.maxSockets\n }\n }\n\n return self.pool[poolKey]\n}\n\nRequest.prototype.start = function () {\n // start() is called once we are ready to send the outgoing HTTP request.\n // this is usually called on the first write(), end() or on nextTick()\n var self = this\n\n if (self.timing) {\n // All timings will be relative to this request's startTime. In order to do this,\n // we need to capture the wall-clock start time (via Date), immediately followed\n // by the high-resolution timer (via now()). While these two won't be set\n // at the _exact_ same time, they should be close enough to be able to calculate\n // high-resolution, monotonically non-decreasing timestamps relative to startTime.\n var startTime = new Date().getTime()\n var startTimeNow = now()\n }\n\n if (self._aborted) {\n return\n }\n\n self._started = true\n self.method = self.method || 'GET'\n self.href = self.uri.href\n\n if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) {\n self.setHeader('content-length', self.src.stat.size)\n }\n if (self._aws) {\n self.aws(self._aws, true)\n }\n\n // We have a method named auth, which is completely different from the http.request\n // auth option. If we don't remove it, we're gonna have a bad time.\n var reqOptions = copy(self)\n delete reqOptions.auth\n\n debug('make request', self.uri.href)\n\n // node v6.8.0 now supports a `timeout` value in `http.request()`, but we\n // should delete it for now since we handle timeouts manually for better\n // consistency with node versions before v6.8.0\n delete reqOptions.timeout\n\n try {\n self.req = self.httpModule.request(reqOptions)\n } catch (err) {\n self.emit('error', err)\n return\n }\n\n if (self.timing) {\n self.startTime = startTime\n self.startTimeNow = startTimeNow\n\n // Timing values will all be relative to startTime (by comparing to startTimeNow\n // so we have an accurate clock)\n self.timings = {}\n }\n\n var timeout\n if (self.timeout && !self.timeoutTimer) {\n if (self.timeout < 0) {\n timeout = 0\n } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) {\n timeout = self.timeout\n }\n }\n\n self.req.on('response', self.onRequestResponse.bind(self))\n self.req.on('error', self.onRequestError.bind(self))\n self.req.on('drain', function () {\n self.emit('drain')\n })\n\n self.req.on('socket', function (socket) {\n // `._connecting` was the old property which was made public in node v6.1.0\n var isConnecting = socket._connecting || socket.connecting\n if (self.timing) {\n self.timings.socket = now() - self.startTimeNow\n\n if (isConnecting) {\n var onLookupTiming = function () {\n self.timings.lookup = now() - self.startTimeNow\n }\n\n var onConnectTiming = function () {\n self.timings.connect = now() - self.startTimeNow\n }\n\n socket.once('lookup', onLookupTiming)\n socket.once('connect', onConnectTiming)\n\n // clean up timing event listeners if needed on error\n self.req.once('error', function () {\n socket.removeListener('lookup', onLookupTiming)\n socket.removeListener('connect', onConnectTiming)\n })\n }\n }\n\n var setReqTimeout = function () {\n // This timeout sets the amount of time to wait *between* bytes sent\n // from the server once connected.\n //\n // In particular, it's useful for erroring if the server fails to send\n // data halfway through streaming a response.\n self.req.setTimeout(timeout, function () {\n if (self.req) {\n self.abort()\n var e = new Error('ESOCKETTIMEDOUT')\n e.code = 'ESOCKETTIMEDOUT'\n e.connect = false\n self.emit('error', e)\n }\n })\n }\n if (timeout !== undefined) {\n // Only start the connection timer if we're actually connecting a new\n // socket, otherwise if we're already connected (because this is a\n // keep-alive connection) do not bother. This is important since we won't\n // get a 'connect' event for an already connected socket.\n if (isConnecting) {\n var onReqSockConnect = function () {\n socket.removeListener('connect', onReqSockConnect)\n self.clearTimeout()\n setReqTimeout()\n }\n\n socket.on('connect', onReqSockConnect)\n\n self.req.on('error', function (err) { // eslint-disable-line handle-callback-err\n socket.removeListener('connect', onReqSockConnect)\n })\n\n // Set a timeout in memory - this block will throw if the server takes more\n // than `timeout` to write the HTTP status and headers (corresponding to\n // the on('response') event on the client). NB: this measures wall-clock\n // time, not the time between bytes sent by the server.\n self.timeoutTimer = setTimeout(function () {\n socket.removeListener('connect', onReqSockConnect)\n self.abort()\n var e = new Error('ETIMEDOUT')\n e.code = 'ETIMEDOUT'\n e.connect = true\n self.emit('error', e)\n }, timeout)\n } else {\n // We're already connected\n setReqTimeout()\n }\n }\n self.emit('socket', socket)\n })\n\n self.emit('request', self.req)\n}\n\nRequest.prototype.onRequestError = function (error) {\n var self = this\n if (self._aborted) {\n return\n }\n if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' &&\n self.agent.addRequestNoreuse) {\n self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }\n self.start()\n self.req.end()\n return\n }\n self.clearTimeout()\n self.emit('error', error)\n}\n\nRequest.prototype.onRequestResponse = function (response) {\n var self = this\n\n if (self.timing) {\n self.timings.response = now() - self.startTimeNow\n }\n\n debug('onRequestResponse', self.uri.href, response.statusCode, response.headers)\n response.on('end', function () {\n if (self.timing) {\n self.timings.end = now() - self.startTimeNow\n response.timingStart = self.startTime\n\n // fill in the blanks for any periods that didn't trigger, such as\n // no lookup or connect due to keep alive\n if (!self.timings.socket) {\n self.timings.socket = 0\n }\n if (!self.timings.lookup) {\n self.timings.lookup = self.timings.socket\n }\n if (!self.timings.connect) {\n self.timings.connect = self.timings.lookup\n }\n if (!self.timings.response) {\n self.timings.response = self.timings.connect\n }\n\n debug('elapsed time', self.timings.end)\n\n // elapsedTime includes all redirects\n self.elapsedTime += Math.round(self.timings.end)\n\n // NOTE: elapsedTime is deprecated in favor of .timings\n response.elapsedTime = self.elapsedTime\n\n // timings is just for the final fetch\n response.timings = self.timings\n\n // pre-calculate phase timings as well\n response.timingPhases = {\n wait: self.timings.socket,\n dns: self.timings.lookup - self.timings.socket,\n tcp: self.timings.connect - self.timings.lookup,\n firstByte: self.timings.response - self.timings.connect,\n download: self.timings.end - self.timings.response,\n total: self.timings.end\n }\n }\n debug('response end', self.uri.href, response.statusCode, response.headers)\n })\n\n if (self._aborted) {\n debug('aborted', self.uri.href)\n response.resume()\n return\n }\n\n self.response = response\n response.request = self\n response.toJSON = responseToJSON\n\n // XXX This is different on 0.10, because SSL is strict by default\n if (self.httpModule === https &&\n self.strictSSL && (!response.hasOwnProperty('socket') ||\n !response.socket.authorized)) {\n debug('strict ssl error', self.uri.href)\n var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL'\n self.emit('error', new Error('SSL Error: ' + sslErr))\n return\n }\n\n // Save the original host before any redirect (if it changes, we need to\n // remove any authorization headers). Also remember the case of the header\n // name because lots of broken servers expect Host instead of host and we\n // want the caller to be able to specify this.\n self.originalHost = self.getHeader('host')\n if (!self.originalHostHeaderName) {\n self.originalHostHeaderName = self.hasHeader('host')\n }\n if (self.setHost) {\n self.removeHeader('host')\n }\n self.clearTimeout()\n\n var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar\n var addCookie = function (cookie) {\n // set the cookie if it's domain in the href's domain.\n try {\n targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true})\n } catch (e) {\n self.emit('error', e)\n }\n }\n\n response.caseless = caseless(response.headers)\n\n if (response.caseless.has('set-cookie') && (!self._disableCookies)) {\n var headerName = response.caseless.has('set-cookie')\n if (Array.isArray(response.headers[headerName])) {\n response.headers[headerName].forEach(addCookie)\n } else {\n addCookie(response.headers[headerName])\n }\n }\n\n if (self._redirect.onResponse(response)) {\n return // Ignore the rest of the response\n } else {\n // Be a good stream and emit end when the response is finished.\n // Hack to emit end on close because of a core bug that never fires end\n response.on('close', function () {\n if (!self._ended) {\n self.response.emit('end')\n }\n })\n\n response.once('end', function () {\n self._ended = true\n })\n\n var noBody = function (code) {\n return (\n self.method === 'HEAD' ||\n // Informational\n (code >= 100 && code < 200) ||\n // No Content\n code === 204 ||\n // Not Modified\n code === 304\n )\n }\n\n var responseContent\n if (self.gzip && !noBody(response.statusCode)) {\n var contentEncoding = response.headers['content-encoding'] || 'identity'\n contentEncoding = contentEncoding.trim().toLowerCase()\n\n // Be more lenient with decoding compressed responses, since (very rarely)\n // servers send slightly invalid gzip responses that are still accepted\n // by common browsers.\n // Always using Z_SYNC_FLUSH is what cURL does.\n var zlibOptions = {\n flush: zlib.Z_SYNC_FLUSH,\n finishFlush: zlib.Z_SYNC_FLUSH\n }\n\n if (contentEncoding === 'gzip') {\n responseContent = zlib.createGunzip(zlibOptions)\n response.pipe(responseContent)\n } else if (contentEncoding === 'deflate') {\n responseContent = zlib.createInflate(zlibOptions)\n response.pipe(responseContent)\n } else {\n // Since previous versions didn't check for Content-Encoding header,\n // ignore any invalid values to preserve backwards-compatibility\n if (contentEncoding !== 'identity') {\n debug('ignoring unrecognized Content-Encoding ' + contentEncoding)\n }\n responseContent = response\n }\n } else {\n responseContent = response\n }\n\n if (self.encoding) {\n if (self.dests.length !== 0) {\n console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')\n } else {\n responseContent.setEncoding(self.encoding)\n }\n }\n\n if (self._paused) {\n responseContent.pause()\n }\n\n self.responseContent = responseContent\n\n self.emit('response', response)\n\n self.dests.forEach(function (dest) {\n self.pipeDest(dest)\n })\n\n responseContent.on('data', function (chunk) {\n if (self.timing && !self.responseStarted) {\n self.responseStartTime = (new Date()).getTime()\n\n // NOTE: responseStartTime is deprecated in favor of .timings\n response.responseStartTime = self.responseStartTime\n }\n self._destdata = true\n self.emit('data', chunk)\n })\n responseContent.once('end', function (chunk) {\n self.emit('end', chunk)\n })\n responseContent.on('error', function (error) {\n self.emit('error', error)\n })\n responseContent.on('close', function () { self.emit('close') })\n\n if (self.callback) {\n self.readResponseBody(response)\n } else { // if no callback\n self.on('end', function () {\n if (self._aborted) {\n debug('aborted', self.uri.href)\n return\n }\n self.emit('complete', response)\n })\n }\n }\n debug('finish init function', self.uri.href)\n}\n\nRequest.prototype.readResponseBody = function (response) {\n var self = this\n debug(\"reading response's body\")\n var buffers = []\n var bufferLength = 0\n var strings = []\n\n self.on('data', function (chunk) {\n if (!Buffer.isBuffer(chunk)) {\n strings.push(chunk)\n } else if (chunk.length) {\n bufferLength += chunk.length\n buffers.push(chunk)\n }\n })\n self.on('end', function () {\n debug('end event', self.uri.href)\n if (self._aborted) {\n debug('aborted', self.uri.href)\n // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request.\n // This can lead to leaky behavior if the user retains a reference to the request object.\n buffers = []\n bufferLength = 0\n return\n }\n\n if (bufferLength) {\n debug('has body', self.uri.href, bufferLength)\n response.body = Buffer.concat(buffers, bufferLength)\n if (self.encoding !== null) {\n response.body = response.body.toString(self.encoding)\n }\n // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request.\n // This can lead to leaky behavior if the user retains a reference to the request object.\n buffers = []\n bufferLength = 0\n } else if (strings.length) {\n // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.\n // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().\n if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\\uFEFF') {\n strings[0] = strings[0].substring(1)\n }\n response.body = strings.join('')\n }\n\n if (self._json) {\n try {\n response.body = JSON.parse(response.body, self._jsonReviver)\n } catch (e) {\n debug('invalid JSON received', self.uri.href)\n }\n }\n debug('emitting complete', self.uri.href)\n if (typeof response.body === 'undefined' && !self._json) {\n response.body = self.encoding === null ? Buffer.alloc(0) : ''\n }\n self.emit('complete', response, response.body)\n })\n}\n\nRequest.prototype.abort = function () {\n var self = this\n self._aborted = true\n\n if (self.req) {\n self.req.abort()\n } else if (self.response) {\n self.response.destroy()\n }\n\n self.clearTimeout()\n self.emit('abort')\n}\n\nRequest.prototype.pipeDest = function (dest) {\n var self = this\n var response = self.response\n // Called after the response is received\n if (dest.headers && !dest.headersSent) {\n if (response.caseless.has('content-type')) {\n var ctname = response.caseless.has('content-type')\n if (dest.setHeader) {\n dest.setHeader(ctname, response.headers[ctname])\n } else {\n dest.headers[ctname] = response.headers[ctname]\n }\n }\n\n if (response.caseless.has('content-length')) {\n var clname = response.caseless.has('content-length')\n if (dest.setHeader) {\n dest.setHeader(clname, response.headers[clname])\n } else {\n dest.headers[clname] = response.headers[clname]\n }\n }\n }\n if (dest.setHeader && !dest.headersSent) {\n for (var i in response.headers) {\n // If the response content is being decoded, the Content-Encoding header\n // of the response doesn't represent the piped content, so don't pass it.\n if (!self.gzip || i !== 'content-encoding') {\n dest.setHeader(i, response.headers[i])\n }\n }\n dest.statusCode = response.statusCode\n }\n if (self.pipefilter) {\n self.pipefilter(response, dest)\n }\n}\n\nRequest.prototype.qs = function (q, clobber) {\n var self = this\n var base\n if (!clobber && self.uri.query) {\n base = self._qs.parse(self.uri.query)\n } else {\n base = {}\n }\n\n for (var i in q) {\n base[i] = q[i]\n }\n\n var qs = self._qs.stringify(base)\n\n if (qs === '') {\n return self\n }\n\n self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs)\n self.url = self.uri\n self.path = self.uri.path\n\n if (self.uri.host === 'unix') {\n self.enableUnixSocket()\n }\n\n return self\n}\nRequest.prototype.form = function (form) {\n var self = this\n if (form) {\n if (!/^application\\/x-www-form-urlencoded\\b/.test(self.getHeader('content-type'))) {\n self.setHeader('content-type', 'application/x-www-form-urlencoded')\n }\n self.body = (typeof form === 'string')\n ? self._qs.rfc3986(form.toString('utf8'))\n : self._qs.stringify(form).toString('utf8')\n return self\n }\n // create form-data object\n self._form = new FormData()\n self._form.on('error', function (err) {\n err.message = 'form-data: ' + err.message\n self.emit('error', err)\n self.abort()\n })\n return self._form\n}\nRequest.prototype.multipart = function (multipart) {\n var self = this\n\n self._multipart.onRequest(multipart)\n\n if (!self._multipart.chunked) {\n self.body = self._multipart.body\n }\n\n return self\n}\nRequest.prototype.json = function (val) {\n var self = this\n\n if (!self.hasHeader('accept')) {\n self.setHeader('accept', 'application/json')\n }\n\n if (typeof self.jsonReplacer === 'function') {\n self._jsonReplacer = self.jsonReplacer\n }\n\n self._json = true\n if (typeof val === 'boolean') {\n if (self.body !== undefined) {\n if (!/^application\\/x-www-form-urlencoded\\b/.test(self.getHeader('content-type'))) {\n self.body = safeStringify(self.body, self._jsonReplacer)\n } else {\n self.body = self._qs.rfc3986(self.body)\n }\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n }\n } else {\n self.body = safeStringify(val, self._jsonReplacer)\n if (!self.hasHeader('content-type')) {\n self.setHeader('content-type', 'application/json')\n }\n }\n\n if (typeof self.jsonReviver === 'function') {\n self._jsonReviver = self.jsonReviver\n }\n\n return self\n}\nRequest.prototype.getHeader = function (name, headers) {\n var self = this\n var result, re, match\n if (!headers) {\n headers = self.headers\n }\n Object.keys(headers).forEach(function (key) {\n if (key.length !== name.length) {\n return\n }\n re = new RegExp(name, 'i')\n match = key.match(re)\n if (match) {\n result = headers[key]\n }\n })\n return result\n}\nRequest.prototype.enableUnixSocket = function () {\n // Get the socket & request paths from the URL\n var unixParts = this.uri.path.split(':')\n var host = unixParts[0]\n var path = unixParts[1]\n // Apply unix properties to request\n this.socketPath = host\n this.uri.pathname = path\n this.uri.path = path\n this.uri.host = host\n this.uri.hostname = host\n this.uri.isUnix = true\n}\n\nRequest.prototype.auth = function (user, pass, sendImmediately, bearer) {\n var self = this\n\n self._auth.onRequest(user, pass, sendImmediately, bearer)\n\n return self\n}\nRequest.prototype.aws = function (opts, now) {\n var self = this\n\n if (!now) {\n self._aws = opts\n return self\n }\n\n if (opts.sign_version === 4 || opts.sign_version === '4') {\n // use aws4\n var options = {\n host: self.uri.host,\n path: self.uri.path,\n method: self.method,\n headers: self.headers,\n body: self.body\n }\n if (opts.service) {\n options.service = opts.service\n }\n var signRes = aws4.sign(options, {\n accessKeyId: opts.key,\n secretAccessKey: opts.secret,\n sessionToken: opts.session\n })\n self.setHeader('authorization', signRes.headers.Authorization)\n self.setHeader('x-amz-date', signRes.headers['X-Amz-Date'])\n if (signRes.headers['X-Amz-Security-Token']) {\n self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token'])\n }\n } else {\n // default: use aws-sign2\n var date = new Date()\n self.setHeader('date', date.toUTCString())\n var auth = {\n key: opts.key,\n secret: opts.secret,\n verb: self.method.toUpperCase(),\n date: date,\n contentType: self.getHeader('content-type') || '',\n md5: self.getHeader('content-md5') || '',\n amazonHeaders: aws2.canonicalizeHeaders(self.headers)\n }\n var path = self.uri.path\n if (opts.bucket && path) {\n auth.resource = '/' + opts.bucket + path\n } else if (opts.bucket && !path) {\n auth.resource = '/' + opts.bucket\n } else if (!opts.bucket && path) {\n auth.resource = path\n } else if (!opts.bucket && !path) {\n auth.resource = '/'\n }\n auth.resource = aws2.canonicalizeResource(auth.resource)\n self.setHeader('authorization', aws2.authorization(auth))\n }\n\n return self\n}\nRequest.prototype.httpSignature = function (opts) {\n var self = this\n httpSignature.signRequest({\n getHeader: function (header) {\n return self.getHeader(header, self.headers)\n },\n setHeader: function (header, value) {\n self.setHeader(header, value)\n },\n method: self.method,\n path: self.path\n }, opts)\n debug('httpSignature authorization', self.getHeader('authorization'))\n\n return self\n}\nRequest.prototype.hawk = function (opts) {\n var self = this\n self.setHeader('Authorization', hawk.header(self.uri, self.method, opts))\n}\nRequest.prototype.oauth = function (_oauth) {\n var self = this\n\n self._oauth.onRequest(_oauth)\n\n return self\n}\n\nRequest.prototype.jar = function (jar) {\n var self = this\n var cookies\n\n if (self._redirect.redirectsFollowed === 0) {\n self.originalCookieHeader = self.getHeader('cookie')\n }\n\n if (!jar) {\n // disable cookies\n cookies = false\n self._disableCookies = true\n } else {\n var targetCookieJar = jar.getCookieString ? jar : globalCookieJar\n var urihref = self.uri.href\n // fetch cookie in the Specified host\n if (targetCookieJar) {\n cookies = targetCookieJar.getCookieString(urihref)\n }\n }\n\n // if need cookie and cookie is not empty\n if (cookies && cookies.length) {\n if (self.originalCookieHeader) {\n // Don't overwrite existing Cookie header\n self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies)\n } else {\n self.setHeader('cookie', cookies)\n }\n }\n self._jar = jar\n return self\n}\n\n// Stream API\nRequest.prototype.pipe = function (dest, opts) {\n var self = this\n\n if (self.response) {\n if (self._destdata) {\n self.emit('error', new Error('You cannot pipe after data has been emitted from the response.'))\n } else if (self._ended) {\n self.emit('error', new Error('You cannot pipe after the response has been ended.'))\n } else {\n stream.Stream.prototype.pipe.call(self, dest, opts)\n self.pipeDest(dest)\n return dest\n }\n } else {\n self.dests.push(dest)\n stream.Stream.prototype.pipe.call(self, dest, opts)\n return dest\n }\n}\nRequest.prototype.write = function () {\n var self = this\n if (self._aborted) { return }\n\n if (!self._started) {\n self.start()\n }\n if (self.req) {\n return self.req.write.apply(self.req, arguments)\n }\n}\nRequest.prototype.end = function (chunk) {\n var self = this\n if (self._aborted) { return }\n\n if (chunk) {\n self.write(chunk)\n }\n if (!self._started) {\n self.start()\n }\n if (self.req) {\n self.req.end()\n }\n}\nRequest.prototype.pause = function () {\n var self = this\n if (!self.responseContent) {\n self._paused = true\n } else {\n self.responseContent.pause.apply(self.responseContent, arguments)\n }\n}\nRequest.prototype.resume = function () {\n var self = this\n if (!self.responseContent) {\n self._paused = false\n } else {\n self.responseContent.resume.apply(self.responseContent, arguments)\n }\n}\nRequest.prototype.destroy = function () {\n var self = this\n this.clearTimeout()\n if (!self._ended) {\n self.end()\n } else if (self.response) {\n self.response.destroy()\n }\n}\n\nRequest.prototype.clearTimeout = function () {\n if (this.timeoutTimer) {\n clearTimeout(this.timeoutTimer)\n this.timeoutTimer = null\n }\n}\n\nRequest.defaultProxyHeaderWhiteList =\n Tunnel.defaultProxyHeaderWhiteList.slice()\n\nRequest.defaultProxyHeaderExclusiveList =\n Tunnel.defaultProxyHeaderExclusiveList.slice()\n\n// Exports\n\nRequest.prototype.toJSON = requestToJSON\nmodule.exports = Request\n","'use strict';\nconst tls = require('tls');\n\nmodule.exports = (options = {}, connect = tls.connect) => new Promise((resolve, reject) => {\n\tlet timeout = false;\n\n\tlet socket;\n\n\tconst callback = async () => {\n\t\tawait socketPromise;\n\n\t\tsocket.off('timeout', onTimeout);\n\t\tsocket.off('error', reject);\n\n\t\tif (options.resolveSocket) {\n\t\t\tresolve({alpnProtocol: socket.alpnProtocol, socket, timeout});\n\n\t\t\tif (timeout) {\n\t\t\t\tawait Promise.resolve();\n\t\t\t\tsocket.emit('timeout');\n\t\t\t}\n\t\t} else {\n\t\t\tsocket.destroy();\n\t\t\tresolve({alpnProtocol: socket.alpnProtocol, timeout});\n\t\t}\n\t};\n\n\tconst onTimeout = async () => {\n\t\ttimeout = true;\n\t\tcallback();\n\t};\n\n\tconst socketPromise = (async () => {\n\t\ttry {\n\t\t\tsocket = await connect(options, callback);\n\n\t\t\tsocket.on('error', reject);\n\t\t\tsocket.once('timeout', onTimeout);\n\t\t} catch (error) {\n\t\t\treject(error);\n\t\t}\n\t})();\n});\n","'use strict';\n\nconst Readable = require('stream').Readable;\nconst lowercaseKeys = require('lowercase-keys');\n\nclass Response extends Readable {\n\tconstructor(statusCode, headers, body, url) {\n\t\tif (typeof statusCode !== 'number') {\n\t\t\tthrow new TypeError('Argument `statusCode` should be a number');\n\t\t}\n\t\tif (typeof headers !== 'object') {\n\t\t\tthrow new TypeError('Argument `headers` should be an object');\n\t\t}\n\t\tif (!(body instanceof Buffer)) {\n\t\t\tthrow new TypeError('Argument `body` should be a buffer');\n\t\t}\n\t\tif (typeof url !== 'string') {\n\t\t\tthrow new TypeError('Argument `url` should be a string');\n\t\t}\n\n\t\tsuper();\n\t\tthis.statusCode = statusCode;\n\t\tthis.headers = lowercaseKeys(headers);\n\t\tthis.body = body;\n\t\tthis.url = url;\n\t}\n\n\t_read() {\n\t\tthis.push(this.body);\n\t\tthis.push(null);\n\t}\n}\n\nmodule.exports = Response;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/* eslint-disable @typescript-eslint/strict-boolean-expressions */\nfunction parse(string, encoding, opts) {\n var _opts$out;\n\n if (opts === void 0) {\n opts = {};\n }\n\n // Build the character lookup table:\n if (!encoding.codes) {\n encoding.codes = {};\n\n for (var i = 0; i < encoding.chars.length; ++i) {\n encoding.codes[encoding.chars[i]] = i;\n }\n } // The string must have a whole number of bytes:\n\n\n if (!opts.loose && string.length * encoding.bits & 7) {\n throw new SyntaxError('Invalid padding');\n } // Count the padding bytes:\n\n\n var end = string.length;\n\n while (string[end - 1] === '=') {\n --end; // If we get a whole number of bytes, there is too much padding:\n\n if (!opts.loose && !((string.length - end) * encoding.bits & 7)) {\n throw new SyntaxError('Invalid padding');\n }\n } // Allocate the output:\n\n\n var out = new ((_opts$out = opts.out) != null ? _opts$out : Uint8Array)(end * encoding.bits / 8 | 0); // Parse the data:\n\n var bits = 0; // Number of bits currently in the buffer\n\n var buffer = 0; // Bits waiting to be written out, MSB first\n\n var written = 0; // Next byte to write\n\n for (var _i = 0; _i < end; ++_i) {\n // Read one character from the string:\n var value = encoding.codes[string[_i]];\n\n if (value === undefined) {\n throw new SyntaxError('Invalid character ' + string[_i]);\n } // Append the bits to the buffer:\n\n\n buffer = buffer << encoding.bits | value;\n bits += encoding.bits; // Write out some bits if the buffer has a byte's worth:\n\n if (bits >= 8) {\n bits -= 8;\n out[written++] = 0xff & buffer >> bits;\n }\n } // Verify that we have received just enough bits:\n\n\n if (bits >= encoding.bits || 0xff & buffer << 8 - bits) {\n throw new SyntaxError('Unexpected end of data');\n }\n\n return out;\n}\nfunction stringify(data, encoding, opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n var _opts = opts,\n _opts$pad = _opts.pad,\n pad = _opts$pad === void 0 ? true : _opts$pad;\n var mask = (1 << encoding.bits) - 1;\n var out = '';\n var bits = 0; // Number of bits currently in the buffer\n\n var buffer = 0; // Bits waiting to be written out, MSB first\n\n for (var i = 0; i < data.length; ++i) {\n // Slurp data into the buffer:\n buffer = buffer << 8 | 0xff & data[i];\n bits += 8; // Write out as much as we can:\n\n while (bits > encoding.bits) {\n bits -= encoding.bits;\n out += encoding.chars[mask & buffer >> bits];\n }\n } // Partial character:\n\n\n if (bits) {\n out += encoding.chars[mask & buffer << encoding.bits - bits];\n } // Add padding characters until we hit a byte boundary:\n\n\n if (pad) {\n while (out.length * encoding.bits & 7) {\n out += '=';\n }\n }\n\n return out;\n}\n\n/* eslint-disable @typescript-eslint/strict-boolean-expressions */\nvar base16Encoding = {\n chars: '0123456789ABCDEF',\n bits: 4\n};\nvar base32Encoding = {\n chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567',\n bits: 5\n};\nvar base32HexEncoding = {\n chars: '0123456789ABCDEFGHIJKLMNOPQRSTUV',\n bits: 5\n};\nvar base64Encoding = {\n chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n bits: 6\n};\nvar base64UrlEncoding = {\n chars: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_',\n bits: 6\n};\nvar base16 = {\n parse: function parse$1(string, opts) {\n return parse(string.toUpperCase(), base16Encoding, opts);\n },\n stringify: function stringify$1(data, opts) {\n return stringify(data, base16Encoding, opts);\n }\n};\nvar base32 = {\n parse: function parse$1(string, opts) {\n if (opts === void 0) {\n opts = {};\n }\n\n return parse(opts.loose ? string.toUpperCase().replace(/0/g, 'O').replace(/1/g, 'L').replace(/8/g, 'B') : string, base32Encoding, opts);\n },\n stringify: function stringify$1(data, opts) {\n return stringify(data, base32Encoding, opts);\n }\n};\nvar base32hex = {\n parse: function parse$1(string, opts) {\n return parse(string, base32HexEncoding, opts);\n },\n stringify: function stringify$1(data, opts) {\n return stringify(data, base32HexEncoding, opts);\n }\n};\nvar base64 = {\n parse: function parse$1(string, opts) {\n return parse(string, base64Encoding, opts);\n },\n stringify: function stringify$1(data, opts) {\n return stringify(data, base64Encoding, opts);\n }\n};\nvar base64url = {\n parse: function parse$1(string, opts) {\n return parse(string, base64UrlEncoding, opts);\n },\n stringify: function stringify$1(data, opts) {\n return stringify(data, base64UrlEncoding, opts);\n }\n};\nvar codec = {\n parse: parse,\n stringify: stringify\n};\n\nexports.base16 = base16;\nexports.base32 = base32;\nexports.base32hex = base32hex;\nexports.base64 = base64;\nexports.base64url = base64url;\nexports.codec = codec;\n","const assert = require(\"assert\")\nconst path = require(\"path\")\nconst fs = require(\"fs\")\nlet glob = undefined\ntry {\n glob = require(\"glob\")\n} catch (_err) {\n // treat glob as optional.\n}\n\nconst defaultGlobOpts = {\n nosort: true,\n silent: true\n}\n\n// for EMFILE handling\nlet timeout = 0\n\nconst isWindows = (process.platform === \"win32\")\n\nconst defaults = options => {\n const methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(m => {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n options.emfileWait = options.emfileWait || 1000\n if (options.glob === false) {\n options.disableGlob = true\n }\n if (options.disableGlob !== true && glob === undefined) {\n throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')\n }\n options.disableGlob = options.disableGlob || false\n options.glob = options.glob || defaultGlobOpts\n}\n\nconst rimraf = (p, options, cb) => {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.equal(typeof p, 'string', 'rimraf: path should be a string')\n assert.equal(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.equal(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n let busyTries = 0\n let errState = null\n let n = 0\n\n const next = (er) => {\n errState = errState || er\n if (--n === 0)\n cb(errState)\n }\n\n const afterGlob = (er, results) => {\n if (er)\n return cb(er)\n\n n = results.length\n if (n === 0)\n return cb()\n\n results.forEach(p => {\n const CB = (er) => {\n if (er) {\n if ((er.code === \"EBUSY\" || er.code === \"ENOTEMPTY\" || er.code === \"EPERM\") &&\n busyTries < options.maxBusyTries) {\n busyTries ++\n // try again, with the same exact callback as this one.\n return setTimeout(() => rimraf_(p, options, CB), busyTries * 100)\n }\n\n // this one won't happen if graceful-fs is used.\n if (er.code === \"EMFILE\" && timeout < options.emfileWait) {\n return setTimeout(() => rimraf_(p, options, CB), timeout ++)\n }\n\n // already gone\n if (er.code === \"ENOENT\") er = null\n }\n\n timeout = 0\n next(er)\n }\n rimraf_(p, options, CB)\n })\n }\n\n if (options.disableGlob || !glob.hasMagic(p))\n return afterGlob(null, [p])\n\n options.lstat(p, (er, stat) => {\n if (!er)\n return afterGlob(null, [p])\n\n glob(p, options.glob, afterGlob)\n })\n\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nconst rimraf_ = (p, options, cb) => {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, (er, st) => {\n if (er && er.code === \"ENOENT\")\n return cb(null)\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === \"EPERM\" && isWindows)\n fixWinEPERM(p, options, er, cb)\n\n if (st && st.isDirectory())\n return rmdir(p, options, er, cb)\n\n options.unlink(p, er => {\n if (er) {\n if (er.code === \"ENOENT\")\n return cb(null)\n if (er.code === \"EPERM\")\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n if (er.code === \"EISDIR\")\n return rmdir(p, options, er, cb)\n }\n return cb(er)\n })\n })\n}\n\nconst fixWinEPERM = (p, options, er, cb) => {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.chmod(p, 0o666, er2 => {\n if (er2)\n cb(er2.code === \"ENOENT\" ? null : er)\n else\n options.stat(p, (er3, stats) => {\n if (er3)\n cb(er3.code === \"ENOENT\" ? null : er)\n else if (stats.isDirectory())\n rmdir(p, options, er, cb)\n else\n options.unlink(p, cb)\n })\n })\n}\n\nconst fixWinEPERMSync = (p, options, er) => {\n assert(p)\n assert(options)\n\n try {\n options.chmodSync(p, 0o666)\n } catch (er2) {\n if (er2.code === \"ENOENT\")\n return\n else\n throw er\n }\n\n let stats\n try {\n stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === \"ENOENT\")\n return\n else\n throw er\n }\n\n if (stats.isDirectory())\n rmdirSync(p, options, er)\n else\n options.unlinkSync(p)\n}\n\nconst rmdir = (p, options, originalEr, cb) => {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, er => {\n if (er && (er.code === \"ENOTEMPTY\" || er.code === \"EEXIST\" || er.code === \"EPERM\"))\n rmkids(p, options, cb)\n else if (er && er.code === \"ENOTDIR\")\n cb(originalEr)\n else\n cb(er)\n })\n}\n\nconst rmkids = (p, options, cb) => {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, (er, files) => {\n if (er)\n return cb(er)\n let n = files.length\n if (n === 0)\n return options.rmdir(p, cb)\n let errState\n files.forEach(f => {\n rimraf(path.join(p, f), options, er => {\n if (errState)\n return\n if (er)\n return cb(errState = er)\n if (--n === 0)\n options.rmdir(p, cb)\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nconst rimrafSync = (p, options) => {\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.equal(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.equal(typeof options, 'object', 'rimraf: options should be object')\n\n let results\n\n if (options.disableGlob || !glob.hasMagic(p)) {\n results = [p]\n } else {\n try {\n options.lstatSync(p)\n results = [p]\n } catch (er) {\n results = glob.sync(p, options.glob)\n }\n }\n\n if (!results.length)\n return\n\n for (let i = 0; i < results.length; i++) {\n const p = results[i]\n\n let st\n try {\n st = options.lstatSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === \"EPERM\" && isWindows)\n fixWinEPERMSync(p, options, er)\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory())\n rmdirSync(p, options, null)\n else\n options.unlinkSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n if (er.code === \"EPERM\")\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n if (er.code !== \"EISDIR\")\n throw er\n\n rmdirSync(p, options, er)\n }\n }\n}\n\nconst rmdirSync = (p, options, originalEr) => {\n assert(p)\n assert(options)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === \"ENOENT\")\n return\n if (er.code === \"ENOTDIR\")\n throw originalEr\n if (er.code === \"ENOTEMPTY\" || er.code === \"EEXIST\" || er.code === \"EPERM\")\n rmkidsSync(p, options)\n }\n}\n\nconst rmkidsSync = (p, options) => {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))\n\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n const retries = isWindows ? 100 : 1\n let i = 0\n do {\n let threw = true\n try {\n const ret = options.rmdirSync(p, options)\n threw = false\n return ret\n } finally {\n if (++i < retries && threw)\n continue\n }\n } while (true)\n}\n\nmodule.exports = rimraf\nrimraf.sync = rimrafSync\n","/*! safe-buffer. MIT License. Feross Aboukhadijeh */\n/* eslint-disable node/no-deprecated-api */\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\n// alternative to using Object.keys for old browsers\nfunction copyProps (src, dst) {\n for (var key in src) {\n dst[key] = src[key]\n }\n}\nif (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {\n module.exports = buffer\n} else {\n // Copy properties from require('buffer')\n copyProps(buffer, exports)\n exports.Buffer = SafeBuffer\n}\n\nfunction SafeBuffer (arg, encodingOrOffset, length) {\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.prototype = Object.create(Buffer.prototype)\n\n// Copy static methods from Buffer\ncopyProps(Buffer, SafeBuffer)\n\nSafeBuffer.from = function (arg, encodingOrOffset, length) {\n if (typeof arg === 'number') {\n throw new TypeError('Argument must not be a number')\n }\n return Buffer(arg, encodingOrOffset, length)\n}\n\nSafeBuffer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n var buf = Buffer(size)\n if (fill !== undefined) {\n if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n } else {\n buf.fill(0)\n }\n return buf\n}\n\nSafeBuffer.allocUnsafe = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return Buffer(size)\n}\n\nSafeBuffer.allocUnsafeSlow = function (size) {\n if (typeof size !== 'number') {\n throw new TypeError('Argument must be a number')\n }\n return buffer.SlowBuffer(size)\n}\n","/* eslint-disable node/no-deprecated-api */\n\n'use strict'\n\nvar buffer = require('buffer')\nvar Buffer = buffer.Buffer\n\nvar safer = {}\n\nvar key\n\nfor (key in buffer) {\n if (!buffer.hasOwnProperty(key)) continue\n if (key === 'SlowBuffer' || key === 'Buffer') continue\n safer[key] = buffer[key]\n}\n\nvar Safer = safer.Buffer = {}\nfor (key in Buffer) {\n if (!Buffer.hasOwnProperty(key)) continue\n if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue\n Safer[key] = Buffer[key]\n}\n\nsafer.Buffer.prototype = Buffer.prototype\n\nif (!Safer.from || Safer.from === Uint8Array.from) {\n Safer.from = function (value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('The \"value\" argument must not be of type number. Received type ' + typeof value)\n }\n if (value && typeof value.length === 'undefined') {\n throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)\n }\n return Buffer(value, encodingOrOffset, length)\n }\n}\n\nif (!Safer.alloc) {\n Safer.alloc = function (size, fill, encoding) {\n if (typeof size !== 'number') {\n throw new TypeError('The \"size\" argument must be of type number. Received type ' + typeof size)\n }\n if (size < 0 || size >= 2 * (1 << 30)) {\n throw new RangeError('The value \"' + size + '\" is invalid for option \"size\"')\n }\n var buf = Buffer(size)\n if (!fill || fill.length === 0) {\n buf.fill(0)\n } else if (typeof encoding === 'string') {\n buf.fill(fill, encoding)\n } else {\n buf.fill(fill)\n }\n return buf\n }\n}\n\nif (!safer.kStringMaxLength) {\n try {\n safer.kStringMaxLength = process.binding('buffer').kStringMaxLength\n } catch (e) {\n // we can't determine kStringMaxLength in environments where process.binding\n // is unsupported, so let's not set it\n }\n}\n\nif (!safer.constants) {\n safer.constants = {\n MAX_LENGTH: safer.kMaxLength\n }\n if (safer.kStringMaxLength) {\n safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength\n }\n}\n\nmodule.exports = safer\n","const ANY = Symbol('SemVer ANY')\n// hoisted class for cyclic dependency\nclass Comparator {\n static get ANY () {\n return ANY\n }\n\n constructor (comp, options) {\n options = parseOptions(options)\n\n if (comp instanceof Comparator) {\n if (comp.loose === !!options.loose) {\n return comp\n } else {\n comp = comp.value\n }\n }\n\n comp = comp.trim().split(/\\s+/).join(' ')\n debug('comparator', comp, options)\n this.options = options\n this.loose = !!options.loose\n this.parse(comp)\n\n if (this.semver === ANY) {\n this.value = ''\n } else {\n this.value = this.operator + this.semver.version\n }\n\n debug('comp', this)\n }\n\n parse (comp) {\n const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]\n const m = comp.match(r)\n\n if (!m) {\n throw new TypeError(`Invalid comparator: ${comp}`)\n }\n\n this.operator = m[1] !== undefined ? m[1] : ''\n if (this.operator === '=') {\n this.operator = ''\n }\n\n // if it literally is just '>' or '' then allow anything.\n if (!m[2]) {\n this.semver = ANY\n } else {\n this.semver = new SemVer(m[2], this.options.loose)\n }\n }\n\n toString () {\n return this.value\n }\n\n test (version) {\n debug('Comparator.test', version, this.options.loose)\n\n if (this.semver === ANY || version === ANY) {\n return true\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n return cmp(version, this.operator, this.semver, this.options)\n }\n\n intersects (comp, options) {\n if (!(comp instanceof Comparator)) {\n throw new TypeError('a Comparator is required')\n }\n\n if (this.operator === '') {\n if (this.value === '') {\n return true\n }\n return new Range(comp.value, options).test(this.value)\n } else if (comp.operator === '') {\n if (comp.value === '') {\n return true\n }\n return new Range(this.value, options).test(comp.semver)\n }\n\n options = parseOptions(options)\n\n // Special cases where nothing can possibly be lower\n if (options.includePrerelease &&\n (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {\n return false\n }\n if (!options.includePrerelease &&\n (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {\n return false\n }\n\n // Same direction increasing (> or >=)\n if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {\n return true\n }\n // Same direction decreasing (< or <=)\n if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {\n return true\n }\n // same SemVer and both sides are inclusive (<= or >=)\n if (\n (this.semver.version === comp.semver.version) &&\n this.operator.includes('=') && comp.operator.includes('=')) {\n return true\n }\n // opposite directions less than\n if (cmp(this.semver, '<', comp.semver, options) &&\n this.operator.startsWith('>') && comp.operator.startsWith('<')) {\n return true\n }\n // opposite directions greater than\n if (cmp(this.semver, '>', comp.semver, options) &&\n this.operator.startsWith('<') && comp.operator.startsWith('>')) {\n return true\n }\n return false\n }\n}\n\nmodule.exports = Comparator\n\nconst parseOptions = require('../internal/parse-options')\nconst { safeRe: re, t } = require('../internal/re')\nconst cmp = require('../functions/cmp')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst Range = require('./range')\n","// hoisted class for cyclic dependency\nclass Range {\n constructor (range, options) {\n options = parseOptions(options)\n\n if (range instanceof Range) {\n if (\n range.loose === !!options.loose &&\n range.includePrerelease === !!options.includePrerelease\n ) {\n return range\n } else {\n return new Range(range.raw, options)\n }\n }\n\n if (range instanceof Comparator) {\n // just put it in the set and return\n this.raw = range.value\n this.set = [[range]]\n this.format()\n return this\n }\n\n this.options = options\n this.loose = !!options.loose\n this.includePrerelease = !!options.includePrerelease\n\n // First reduce all whitespace as much as possible so we do not have to rely\n // on potentially slow regexes like \\s*. This is then stored and used for\n // future error messages as well.\n this.raw = range\n .trim()\n .split(/\\s+/)\n .join(' ')\n\n // First, split on ||\n this.set = this.raw\n .split('||')\n // map the range to a 2d array of comparators\n .map(r => this.parseRange(r.trim()))\n // throw out any comparator lists that are empty\n // this generally means that it was not a valid range, which is allowed\n // in loose mode, but will still throw if the WHOLE range is invalid.\n .filter(c => c.length)\n\n if (!this.set.length) {\n throw new TypeError(`Invalid SemVer Range: ${this.raw}`)\n }\n\n // if we have any that are not the null set, throw out null sets.\n if (this.set.length > 1) {\n // keep the first one, in case they're all null sets\n const first = this.set[0]\n this.set = this.set.filter(c => !isNullSet(c[0]))\n if (this.set.length === 0) {\n this.set = [first]\n } else if (this.set.length > 1) {\n // if we have any that are *, then the range is just *\n for (const c of this.set) {\n if (c.length === 1 && isAny(c[0])) {\n this.set = [c]\n break\n }\n }\n }\n }\n\n this.format()\n }\n\n format () {\n this.range = this.set\n .map((comps) => comps.join(' ').trim())\n .join('||')\n .trim()\n return this.range\n }\n\n toString () {\n return this.range\n }\n\n parseRange (range) {\n // memoize range parsing for performance.\n // this is a very hot path, and fully deterministic.\n const memoOpts =\n (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |\n (this.options.loose && FLAG_LOOSE)\n const memoKey = memoOpts + ':' + range\n const cached = cache.get(memoKey)\n if (cached) {\n return cached\n }\n\n const loose = this.options.loose\n // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`\n const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]\n range = range.replace(hr, hyphenReplace(this.options.includePrerelease))\n debug('hyphen replace', range)\n\n // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`\n range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)\n debug('comparator trim', range)\n\n // `~ 1.2.3` => `~1.2.3`\n range = range.replace(re[t.TILDETRIM], tildeTrimReplace)\n debug('tilde trim', range)\n\n // `^ 1.2.3` => `^1.2.3`\n range = range.replace(re[t.CARETTRIM], caretTrimReplace)\n debug('caret trim', range)\n\n // At this point, the range is completely trimmed and\n // ready to be split into comparators.\n\n let rangeList = range\n .split(' ')\n .map(comp => parseComparator(comp, this.options))\n .join(' ')\n .split(/\\s+/)\n // >=0.0.0 is equivalent to *\n .map(comp => replaceGTE0(comp, this.options))\n\n if (loose) {\n // in loose mode, throw out any that are not valid comparators\n rangeList = rangeList.filter(comp => {\n debug('loose invalid filter', comp, this.options)\n return !!comp.match(re[t.COMPARATORLOOSE])\n })\n }\n debug('range list', rangeList)\n\n // if any comparators are the null set, then replace with JUST null set\n // if more than one comparator, remove any * comparators\n // also, don't include the same comparator more than once\n const rangeMap = new Map()\n const comparators = rangeList.map(comp => new Comparator(comp, this.options))\n for (const comp of comparators) {\n if (isNullSet(comp)) {\n return [comp]\n }\n rangeMap.set(comp.value, comp)\n }\n if (rangeMap.size > 1 && rangeMap.has('')) {\n rangeMap.delete('')\n }\n\n const result = [...rangeMap.values()]\n cache.set(memoKey, result)\n return result\n }\n\n intersects (range, options) {\n if (!(range instanceof Range)) {\n throw new TypeError('a Range is required')\n }\n\n return this.set.some((thisComparators) => {\n return (\n isSatisfiable(thisComparators, options) &&\n range.set.some((rangeComparators) => {\n return (\n isSatisfiable(rangeComparators, options) &&\n thisComparators.every((thisComparator) => {\n return rangeComparators.every((rangeComparator) => {\n return thisComparator.intersects(rangeComparator, options)\n })\n })\n )\n })\n )\n })\n }\n\n // if ANY of the sets match ALL of its comparators, then pass\n test (version) {\n if (!version) {\n return false\n }\n\n if (typeof version === 'string') {\n try {\n version = new SemVer(version, this.options)\n } catch (er) {\n return false\n }\n }\n\n for (let i = 0; i < this.set.length; i++) {\n if (testSet(this.set[i], version, this.options)) {\n return true\n }\n }\n return false\n }\n}\n\nmodule.exports = Range\n\nconst LRU = require('lru-cache')\nconst cache = new LRU({ max: 1000 })\n\nconst parseOptions = require('../internal/parse-options')\nconst Comparator = require('./comparator')\nconst debug = require('../internal/debug')\nconst SemVer = require('./semver')\nconst {\n safeRe: re,\n t,\n comparatorTrimReplace,\n tildeTrimReplace,\n caretTrimReplace,\n} = require('../internal/re')\nconst { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')\n\nconst isNullSet = c => c.value === '<0.0.0-0'\nconst isAny = c => c.value === ''\n\n// take a set of comparators and determine whether there\n// exists a version which can satisfy it\nconst isSatisfiable = (comparators, options) => {\n let result = true\n const remainingComparators = comparators.slice()\n let testComparator = remainingComparators.pop()\n\n while (result && remainingComparators.length) {\n result = remainingComparators.every((otherComparator) => {\n return testComparator.intersects(otherComparator, options)\n })\n\n testComparator = remainingComparators.pop()\n }\n\n return result\n}\n\n// comprised of xranges, tildes, stars, and gtlt's at this point.\n// already replaced the hyphen ranges\n// turn into a set of JUST comparators.\nconst parseComparator = (comp, options) => {\n debug('comp', comp, options)\n comp = replaceCarets(comp, options)\n debug('caret', comp)\n comp = replaceTildes(comp, options)\n debug('tildes', comp)\n comp = replaceXRanges(comp, options)\n debug('xrange', comp)\n comp = replaceStars(comp, options)\n debug('stars', comp)\n return comp\n}\n\nconst isX = id => !id || id.toLowerCase() === 'x' || id === '*'\n\n// ~, ~> --> * (any, kinda silly)\n// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0\n// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0\n// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0\n// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0\n// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0\n// ~0.0.1 --> >=0.0.1 <0.1.0-0\nconst replaceTildes = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceTilde(c, options))\n .join(' ')\n}\n\nconst replaceTilde = (comp, options) => {\n const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('tilde', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0 <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n // ~1.2 == >=1.2.0 <1.3.0-0\n ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`\n } else if (pr) {\n debug('replaceTilde pr', pr)\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n } else {\n // ~1.2.3 == >=1.2.3 <1.3.0-0\n ret = `>=${M}.${m}.${p\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('tilde return', ret)\n return ret\n })\n}\n\n// ^ --> * (any, kinda silly)\n// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0\n// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0\n// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0\n// ^1.2.3 --> >=1.2.3 <2.0.0-0\n// ^1.2.0 --> >=1.2.0 <2.0.0-0\n// ^0.0.1 --> >=0.0.1 <0.0.2-0\n// ^0.1.0 --> >=0.1.0 <0.2.0-0\nconst replaceCarets = (comp, options) => {\n return comp\n .trim()\n .split(/\\s+/)\n .map((c) => replaceCaret(c, options))\n .join(' ')\n}\n\nconst replaceCaret = (comp, options) => {\n debug('caret', comp, options)\n const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]\n const z = options.includePrerelease ? '-0' : ''\n return comp.replace(r, (_, M, m, p, pr) => {\n debug('caret', comp, _, M, m, p, pr)\n let ret\n\n if (isX(M)) {\n ret = ''\n } else if (isX(m)) {\n ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`\n } else if (isX(p)) {\n if (M === '0') {\n ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`\n } else {\n ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`\n }\n } else if (pr) {\n debug('replaceCaret pr', pr)\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p}-${pr\n } <${+M + 1}.0.0-0`\n }\n } else {\n debug('no pr')\n if (M === '0') {\n if (m === '0') {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${m}.${+p + 1}-0`\n } else {\n ret = `>=${M}.${m}.${p\n }${z} <${M}.${+m + 1}.0-0`\n }\n } else {\n ret = `>=${M}.${m}.${p\n } <${+M + 1}.0.0-0`\n }\n }\n\n debug('caret return', ret)\n return ret\n })\n}\n\nconst replaceXRanges = (comp, options) => {\n debug('replaceXRanges', comp, options)\n return comp\n .split(/\\s+/)\n .map((c) => replaceXRange(c, options))\n .join(' ')\n}\n\nconst replaceXRange = (comp, options) => {\n comp = comp.trim()\n const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]\n return comp.replace(r, (ret, gtlt, M, m, p, pr) => {\n debug('xRange', comp, ret, gtlt, M, m, p, pr)\n const xM = isX(M)\n const xm = xM || isX(m)\n const xp = xm || isX(p)\n const anyX = xp\n\n if (gtlt === '=' && anyX) {\n gtlt = ''\n }\n\n // if we're including prereleases in the match, then we need\n // to fix this to -0, the lowest possible prerelease value\n pr = options.includePrerelease ? '-0' : ''\n\n if (xM) {\n if (gtlt === '>' || gtlt === '<') {\n // nothing is allowed\n ret = '<0.0.0-0'\n } else {\n // nothing is forbidden\n ret = '*'\n }\n } else if (gtlt && anyX) {\n // we know patch is an x, because we have any x at all.\n // replace X with 0\n if (xm) {\n m = 0\n }\n p = 0\n\n if (gtlt === '>') {\n // >1 => >=2.0.0\n // >1.2 => >=1.3.0\n gtlt = '>='\n if (xm) {\n M = +M + 1\n m = 0\n p = 0\n } else {\n m = +m + 1\n p = 0\n }\n } else if (gtlt === '<=') {\n // <=0.7.x is actually <0.8.0, since any 0.7.x should\n // pass. Similarly, <=7.x is actually <8.0.0, etc.\n gtlt = '<'\n if (xm) {\n M = +M + 1\n } else {\n m = +m + 1\n }\n }\n\n if (gtlt === '<') {\n pr = '-0'\n }\n\n ret = `${gtlt + M}.${m}.${p}${pr}`\n } else if (xm) {\n ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`\n } else if (xp) {\n ret = `>=${M}.${m}.0${pr\n } <${M}.${+m + 1}.0-0`\n }\n\n debug('xRange return', ret)\n\n return ret\n })\n}\n\n// Because * is AND-ed with everything else in the comparator,\n// and '' means \"any version\", just remove the *s entirely.\nconst replaceStars = (comp, options) => {\n debug('replaceStars', comp, options)\n // Looseness is ignored here. star is always as loose as it gets!\n return comp\n .trim()\n .replace(re[t.STAR], '')\n}\n\nconst replaceGTE0 = (comp, options) => {\n debug('replaceGTE0', comp, options)\n return comp\n .trim()\n .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')\n}\n\n// This function is passed to string.replace(re[t.HYPHENRANGE])\n// M, m, patch, prerelease, build\n// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5\n// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do\n// 1.2 - 3.4 => >=1.2.0 <3.5.0-0\nconst hyphenReplace = incPr => ($0,\n from, fM, fm, fp, fpr, fb,\n to, tM, tm, tp, tpr, tb) => {\n if (isX(fM)) {\n from = ''\n } else if (isX(fm)) {\n from = `>=${fM}.0.0${incPr ? '-0' : ''}`\n } else if (isX(fp)) {\n from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`\n } else if (fpr) {\n from = `>=${from}`\n } else {\n from = `>=${from}${incPr ? '-0' : ''}`\n }\n\n if (isX(tM)) {\n to = ''\n } else if (isX(tm)) {\n to = `<${+tM + 1}.0.0-0`\n } else if (isX(tp)) {\n to = `<${tM}.${+tm + 1}.0-0`\n } else if (tpr) {\n to = `<=${tM}.${tm}.${tp}-${tpr}`\n } else if (incPr) {\n to = `<${tM}.${tm}.${+tp + 1}-0`\n } else {\n to = `<=${to}`\n }\n\n return `${from} ${to}`.trim()\n}\n\nconst testSet = (set, version, options) => {\n for (let i = 0; i < set.length; i++) {\n if (!set[i].test(version)) {\n return false\n }\n }\n\n if (version.prerelease.length && !options.includePrerelease) {\n // Find the set of versions that are allowed to have prereleases\n // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0\n // That should allow `1.2.3-pr.2` to pass.\n // However, `1.2.4-alpha.notready` should NOT be allowed,\n // even though it's within the range set by the comparators.\n for (let i = 0; i < set.length; i++) {\n debug(set[i].semver)\n if (set[i].semver === Comparator.ANY) {\n continue\n }\n\n if (set[i].semver.prerelease.length > 0) {\n const allowed = set[i].semver\n if (allowed.major === version.major &&\n allowed.minor === version.minor &&\n allowed.patch === version.patch) {\n return true\n }\n }\n }\n\n // Version has a -pre, but it's not one of the ones we like.\n return false\n }\n\n return true\n}\n","const debug = require('../internal/debug')\nconst { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst parseOptions = require('../internal/parse-options')\nconst { compareIdentifiers } = require('../internal/identifiers')\nclass SemVer {\n constructor (version, options) {\n options = parseOptions(options)\n\n if (version instanceof SemVer) {\n if (version.loose === !!options.loose &&\n version.includePrerelease === !!options.includePrerelease) {\n return version\n } else {\n version = version.version\n }\n } else if (typeof version !== 'string') {\n throw new TypeError(`Invalid version. Must be a string. Got type \"${typeof version}\".`)\n }\n\n if (version.length > MAX_LENGTH) {\n throw new TypeError(\n `version is longer than ${MAX_LENGTH} characters`\n )\n }\n\n debug('SemVer', version, options)\n this.options = options\n this.loose = !!options.loose\n // this isn't actually relevant for versions, but keep it so that we\n // don't run into trouble passing this.options around.\n this.includePrerelease = !!options.includePrerelease\n\n const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])\n\n if (!m) {\n throw new TypeError(`Invalid Version: ${version}`)\n }\n\n this.raw = version\n\n // these are actually numbers\n this.major = +m[1]\n this.minor = +m[2]\n this.patch = +m[3]\n\n if (this.major > MAX_SAFE_INTEGER || this.major < 0) {\n throw new TypeError('Invalid major version')\n }\n\n if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {\n throw new TypeError('Invalid minor version')\n }\n\n if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {\n throw new TypeError('Invalid patch version')\n }\n\n // numberify any prerelease numeric ids\n if (!m[4]) {\n this.prerelease = []\n } else {\n this.prerelease = m[4].split('.').map((id) => {\n if (/^[0-9]+$/.test(id)) {\n const num = +id\n if (num >= 0 && num < MAX_SAFE_INTEGER) {\n return num\n }\n }\n return id\n })\n }\n\n this.build = m[5] ? m[5].split('.') : []\n this.format()\n }\n\n format () {\n this.version = `${this.major}.${this.minor}.${this.patch}`\n if (this.prerelease.length) {\n this.version += `-${this.prerelease.join('.')}`\n }\n return this.version\n }\n\n toString () {\n return this.version\n }\n\n compare (other) {\n debug('SemVer.compare', this.version, this.options, other)\n if (!(other instanceof SemVer)) {\n if (typeof other === 'string' && other === this.version) {\n return 0\n }\n other = new SemVer(other, this.options)\n }\n\n if (other.version === this.version) {\n return 0\n }\n\n return this.compareMain(other) || this.comparePre(other)\n }\n\n compareMain (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n return (\n compareIdentifiers(this.major, other.major) ||\n compareIdentifiers(this.minor, other.minor) ||\n compareIdentifiers(this.patch, other.patch)\n )\n }\n\n comparePre (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n // NOT having a prerelease is > having one\n if (this.prerelease.length && !other.prerelease.length) {\n return -1\n } else if (!this.prerelease.length && other.prerelease.length) {\n return 1\n } else if (!this.prerelease.length && !other.prerelease.length) {\n return 0\n }\n\n let i = 0\n do {\n const a = this.prerelease[i]\n const b = other.prerelease[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n compareBuild (other) {\n if (!(other instanceof SemVer)) {\n other = new SemVer(other, this.options)\n }\n\n let i = 0\n do {\n const a = this.build[i]\n const b = other.build[i]\n debug('prerelease compare', i, a, b)\n if (a === undefined && b === undefined) {\n return 0\n } else if (b === undefined) {\n return 1\n } else if (a === undefined) {\n return -1\n } else if (a === b) {\n continue\n } else {\n return compareIdentifiers(a, b)\n }\n } while (++i)\n }\n\n // preminor will bump the version up to the next minor release, and immediately\n // down to pre-release. premajor and prepatch work the same way.\n inc (release, identifier, identifierBase) {\n switch (release) {\n case 'premajor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor = 0\n this.major++\n this.inc('pre', identifier, identifierBase)\n break\n case 'preminor':\n this.prerelease.length = 0\n this.patch = 0\n this.minor++\n this.inc('pre', identifier, identifierBase)\n break\n case 'prepatch':\n // If this is already a prerelease, it will bump to the next version\n // drop any prereleases that might already exist, since they are not\n // relevant at this point.\n this.prerelease.length = 0\n this.inc('patch', identifier, identifierBase)\n this.inc('pre', identifier, identifierBase)\n break\n // If the input is a non-prerelease version, this acts the same as\n // prepatch.\n case 'prerelease':\n if (this.prerelease.length === 0) {\n this.inc('patch', identifier, identifierBase)\n }\n this.inc('pre', identifier, identifierBase)\n break\n\n case 'major':\n // If this is a pre-major version, bump up to the same major version.\n // Otherwise increment major.\n // 1.0.0-5 bumps to 1.0.0\n // 1.1.0 bumps to 2.0.0\n if (\n this.minor !== 0 ||\n this.patch !== 0 ||\n this.prerelease.length === 0\n ) {\n this.major++\n }\n this.minor = 0\n this.patch = 0\n this.prerelease = []\n break\n case 'minor':\n // If this is a pre-minor version, bump up to the same minor version.\n // Otherwise increment minor.\n // 1.2.0-5 bumps to 1.2.0\n // 1.2.1 bumps to 1.3.0\n if (this.patch !== 0 || this.prerelease.length === 0) {\n this.minor++\n }\n this.patch = 0\n this.prerelease = []\n break\n case 'patch':\n // If this is not a pre-release version, it will increment the patch.\n // If it is a pre-release it will bump up to the same patch version.\n // 1.2.0-5 patches to 1.2.0\n // 1.2.0 patches to 1.2.1\n if (this.prerelease.length === 0) {\n this.patch++\n }\n this.prerelease = []\n break\n // This probably shouldn't be used publicly.\n // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.\n case 'pre': {\n const base = Number(identifierBase) ? 1 : 0\n\n if (!identifier && identifierBase === false) {\n throw new Error('invalid increment argument: identifier is empty')\n }\n\n if (this.prerelease.length === 0) {\n this.prerelease = [base]\n } else {\n let i = this.prerelease.length\n while (--i >= 0) {\n if (typeof this.prerelease[i] === 'number') {\n this.prerelease[i]++\n i = -2\n }\n }\n if (i === -1) {\n // didn't increment anything\n if (identifier === this.prerelease.join('.') && identifierBase === false) {\n throw new Error('invalid increment argument: identifier already exists')\n }\n this.prerelease.push(base)\n }\n }\n if (identifier) {\n // 1.2.0-beta.1 bumps to 1.2.0-beta.2,\n // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0\n let prerelease = [identifier, base]\n if (identifierBase === false) {\n prerelease = [identifier]\n }\n if (compareIdentifiers(this.prerelease[0], identifier) === 0) {\n if (isNaN(this.prerelease[1])) {\n this.prerelease = prerelease\n }\n } else {\n this.prerelease = prerelease\n }\n }\n break\n }\n default:\n throw new Error(`invalid increment argument: ${release}`)\n }\n this.raw = this.format()\n if (this.build.length) {\n this.raw += `+${this.build.join('.')}`\n }\n return this\n }\n}\n\nmodule.exports = SemVer\n","const parse = require('./parse')\nconst clean = (version, options) => {\n const s = parse(version.trim().replace(/^[=v]+/, ''), options)\n return s ? s.version : null\n}\nmodule.exports = clean\n","const eq = require('./eq')\nconst neq = require('./neq')\nconst gt = require('./gt')\nconst gte = require('./gte')\nconst lt = require('./lt')\nconst lte = require('./lte')\n\nconst cmp = (a, op, b, loose) => {\n switch (op) {\n case '===':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a === b\n\n case '!==':\n if (typeof a === 'object') {\n a = a.version\n }\n if (typeof b === 'object') {\n b = b.version\n }\n return a !== b\n\n case '':\n case '=':\n case '==':\n return eq(a, b, loose)\n\n case '!=':\n return neq(a, b, loose)\n\n case '>':\n return gt(a, b, loose)\n\n case '>=':\n return gte(a, b, loose)\n\n case '<':\n return lt(a, b, loose)\n\n case '<=':\n return lte(a, b, loose)\n\n default:\n throw new TypeError(`Invalid operator: ${op}`)\n }\n}\nmodule.exports = cmp\n","const SemVer = require('../classes/semver')\nconst parse = require('./parse')\nconst { safeRe: re, t } = require('../internal/re')\n\nconst coerce = (version, options) => {\n if (version instanceof SemVer) {\n return version\n }\n\n if (typeof version === 'number') {\n version = String(version)\n }\n\n if (typeof version !== 'string') {\n return null\n }\n\n options = options || {}\n\n let match = null\n if (!options.rtl) {\n match = version.match(re[t.COERCE])\n } else {\n // Find the right-most coercible string that does not share\n // a terminus with a more left-ward coercible string.\n // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'\n //\n // Walk through the string checking with a /g regexp\n // Manually set the index so as to pick up overlapping matches.\n // Stop when we get a match that ends at the string end, since no\n // coercible string can be more right-ward without the same terminus.\n let next\n while ((next = re[t.COERCERTL].exec(version)) &&\n (!match || match.index + match[0].length !== version.length)\n ) {\n if (!match ||\n next.index + next[0].length !== match.index + match[0].length) {\n match = next\n }\n re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length\n }\n // leave it in a clean state\n re[t.COERCERTL].lastIndex = -1\n }\n\n if (match === null) {\n return null\n }\n\n return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)\n}\nmodule.exports = coerce\n","const SemVer = require('../classes/semver')\nconst compareBuild = (a, b, loose) => {\n const versionA = new SemVer(a, loose)\n const versionB = new SemVer(b, loose)\n return versionA.compare(versionB) || versionA.compareBuild(versionB)\n}\nmodule.exports = compareBuild\n","const compare = require('./compare')\nconst compareLoose = (a, b) => compare(a, b, true)\nmodule.exports = compareLoose\n","const SemVer = require('../classes/semver')\nconst compare = (a, b, loose) =>\n new SemVer(a, loose).compare(new SemVer(b, loose))\n\nmodule.exports = compare\n","const parse = require('./parse.js')\n\nconst diff = (version1, version2) => {\n const v1 = parse(version1, null, true)\n const v2 = parse(version2, null, true)\n const comparison = v1.compare(v2)\n\n if (comparison === 0) {\n return null\n }\n\n const v1Higher = comparison > 0\n const highVersion = v1Higher ? v1 : v2\n const lowVersion = v1Higher ? v2 : v1\n const highHasPre = !!highVersion.prerelease.length\n const lowHasPre = !!lowVersion.prerelease.length\n\n if (lowHasPre && !highHasPre) {\n // Going from prerelease -> no prerelease requires some special casing\n\n // If the low version has only a major, then it will always be a major\n // Some examples:\n // 1.0.0-1 -> 1.0.0\n // 1.0.0-1 -> 1.1.1\n // 1.0.0-1 -> 2.0.0\n if (!lowVersion.patch && !lowVersion.minor) {\n return 'major'\n }\n\n // Otherwise it can be determined by checking the high version\n\n if (highVersion.patch) {\n // anything higher than a patch bump would result in the wrong version\n return 'patch'\n }\n\n if (highVersion.minor) {\n // anything higher than a minor bump would result in the wrong version\n return 'minor'\n }\n\n // bumping major/minor/patch all have same result\n return 'major'\n }\n\n // add the `pre` prefix if we are going to a prerelease version\n const prefix = highHasPre ? 'pre' : ''\n\n if (v1.major !== v2.major) {\n return prefix + 'major'\n }\n\n if (v1.minor !== v2.minor) {\n return prefix + 'minor'\n }\n\n if (v1.patch !== v2.patch) {\n return prefix + 'patch'\n }\n\n // high and low are preleases\n return 'prerelease'\n}\n\nmodule.exports = diff\n","const compare = require('./compare')\nconst eq = (a, b, loose) => compare(a, b, loose) === 0\nmodule.exports = eq\n","const compare = require('./compare')\nconst gt = (a, b, loose) => compare(a, b, loose) > 0\nmodule.exports = gt\n","const compare = require('./compare')\nconst gte = (a, b, loose) => compare(a, b, loose) >= 0\nmodule.exports = gte\n","const SemVer = require('../classes/semver')\n\nconst inc = (version, release, options, identifier, identifierBase) => {\n if (typeof (options) === 'string') {\n identifierBase = identifier\n identifier = options\n options = undefined\n }\n\n try {\n return new SemVer(\n version instanceof SemVer ? version.version : version,\n options\n ).inc(release, identifier, identifierBase).version\n } catch (er) {\n return null\n }\n}\nmodule.exports = inc\n","const compare = require('./compare')\nconst lt = (a, b, loose) => compare(a, b, loose) < 0\nmodule.exports = lt\n","const compare = require('./compare')\nconst lte = (a, b, loose) => compare(a, b, loose) <= 0\nmodule.exports = lte\n","const SemVer = require('../classes/semver')\nconst major = (a, loose) => new SemVer(a, loose).major\nmodule.exports = major\n","const SemVer = require('../classes/semver')\nconst minor = (a, loose) => new SemVer(a, loose).minor\nmodule.exports = minor\n","const compare = require('./compare')\nconst neq = (a, b, loose) => compare(a, b, loose) !== 0\nmodule.exports = neq\n","const SemVer = require('../classes/semver')\nconst parse = (version, options, throwErrors = false) => {\n if (version instanceof SemVer) {\n return version\n }\n try {\n return new SemVer(version, options)\n } catch (er) {\n if (!throwErrors) {\n return null\n }\n throw er\n }\n}\n\nmodule.exports = parse\n","const SemVer = require('../classes/semver')\nconst patch = (a, loose) => new SemVer(a, loose).patch\nmodule.exports = patch\n","const parse = require('./parse')\nconst prerelease = (version, options) => {\n const parsed = parse(version, options)\n return (parsed && parsed.prerelease.length) ? parsed.prerelease : null\n}\nmodule.exports = prerelease\n","const compare = require('./compare')\nconst rcompare = (a, b, loose) => compare(b, a, loose)\nmodule.exports = rcompare\n","const compareBuild = require('./compare-build')\nconst rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))\nmodule.exports = rsort\n","const Range = require('../classes/range')\nconst satisfies = (version, range, options) => {\n try {\n range = new Range(range, options)\n } catch (er) {\n return false\n }\n return range.test(version)\n}\nmodule.exports = satisfies\n","const compareBuild = require('./compare-build')\nconst sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))\nmodule.exports = sort\n","const parse = require('./parse')\nconst valid = (version, options) => {\n const v = parse(version, options)\n return v ? v.version : null\n}\nmodule.exports = valid\n","// just pre-load all the stuff that index.js lazily exports\nconst internalRe = require('./internal/re')\nconst constants = require('./internal/constants')\nconst SemVer = require('./classes/semver')\nconst identifiers = require('./internal/identifiers')\nconst parse = require('./functions/parse')\nconst valid = require('./functions/valid')\nconst clean = require('./functions/clean')\nconst inc = require('./functions/inc')\nconst diff = require('./functions/diff')\nconst major = require('./functions/major')\nconst minor = require('./functions/minor')\nconst patch = require('./functions/patch')\nconst prerelease = require('./functions/prerelease')\nconst compare = require('./functions/compare')\nconst rcompare = require('./functions/rcompare')\nconst compareLoose = require('./functions/compare-loose')\nconst compareBuild = require('./functions/compare-build')\nconst sort = require('./functions/sort')\nconst rsort = require('./functions/rsort')\nconst gt = require('./functions/gt')\nconst lt = require('./functions/lt')\nconst eq = require('./functions/eq')\nconst neq = require('./functions/neq')\nconst gte = require('./functions/gte')\nconst lte = require('./functions/lte')\nconst cmp = require('./functions/cmp')\nconst coerce = require('./functions/coerce')\nconst Comparator = require('./classes/comparator')\nconst Range = require('./classes/range')\nconst satisfies = require('./functions/satisfies')\nconst toComparators = require('./ranges/to-comparators')\nconst maxSatisfying = require('./ranges/max-satisfying')\nconst minSatisfying = require('./ranges/min-satisfying')\nconst minVersion = require('./ranges/min-version')\nconst validRange = require('./ranges/valid')\nconst outside = require('./ranges/outside')\nconst gtr = require('./ranges/gtr')\nconst ltr = require('./ranges/ltr')\nconst intersects = require('./ranges/intersects')\nconst simplifyRange = require('./ranges/simplify')\nconst subset = require('./ranges/subset')\nmodule.exports = {\n parse,\n valid,\n clean,\n inc,\n diff,\n major,\n minor,\n patch,\n prerelease,\n compare,\n rcompare,\n compareLoose,\n compareBuild,\n sort,\n rsort,\n gt,\n lt,\n eq,\n neq,\n gte,\n lte,\n cmp,\n coerce,\n Comparator,\n Range,\n satisfies,\n toComparators,\n maxSatisfying,\n minSatisfying,\n minVersion,\n validRange,\n outside,\n gtr,\n ltr,\n intersects,\n simplifyRange,\n subset,\n SemVer,\n re: internalRe.re,\n src: internalRe.src,\n tokens: internalRe.t,\n SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,\n RELEASE_TYPES: constants.RELEASE_TYPES,\n compareIdentifiers: identifiers.compareIdentifiers,\n rcompareIdentifiers: identifiers.rcompareIdentifiers,\n}\n","// Note: this is the semver.org version of the spec that it implements\n// Not necessarily the package version of this code.\nconst SEMVER_SPEC_VERSION = '2.0.0'\n\nconst MAX_LENGTH = 256\nconst MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||\n/* istanbul ignore next */ 9007199254740991\n\n// Max safe segment length for coercion.\nconst MAX_SAFE_COMPONENT_LENGTH = 16\n\n// Max safe length for a build identifier. The max length minus 6 characters for\n// the shortest version with a build 0.0.0+BUILD.\nconst MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6\n\nconst RELEASE_TYPES = [\n 'major',\n 'premajor',\n 'minor',\n 'preminor',\n 'patch',\n 'prepatch',\n 'prerelease',\n]\n\nmodule.exports = {\n MAX_LENGTH,\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_SAFE_INTEGER,\n RELEASE_TYPES,\n SEMVER_SPEC_VERSION,\n FLAG_INCLUDE_PRERELEASE: 0b001,\n FLAG_LOOSE: 0b010,\n}\n","const debug = (\n typeof process === 'object' &&\n process.env &&\n process.env.NODE_DEBUG &&\n /\\bsemver\\b/i.test(process.env.NODE_DEBUG)\n) ? (...args) => console.error('SEMVER', ...args)\n : () => {}\n\nmodule.exports = debug\n","const numeric = /^[0-9]+$/\nconst compareIdentifiers = (a, b) => {\n const anum = numeric.test(a)\n const bnum = numeric.test(b)\n\n if (anum && bnum) {\n a = +a\n b = +b\n }\n\n return a === b ? 0\n : (anum && !bnum) ? -1\n : (bnum && !anum) ? 1\n : a < b ? -1\n : 1\n}\n\nconst rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)\n\nmodule.exports = {\n compareIdentifiers,\n rcompareIdentifiers,\n}\n","// parse out just the options we care about\nconst looseOption = Object.freeze({ loose: true })\nconst emptyOpts = Object.freeze({ })\nconst parseOptions = options => {\n if (!options) {\n return emptyOpts\n }\n\n if (typeof options !== 'object') {\n return looseOption\n }\n\n return options\n}\nmodule.exports = parseOptions\n","const {\n MAX_SAFE_COMPONENT_LENGTH,\n MAX_SAFE_BUILD_LENGTH,\n MAX_LENGTH,\n} = require('./constants')\nconst debug = require('./debug')\nexports = module.exports = {}\n\n// The actual regexps go on exports.re\nconst re = exports.re = []\nconst safeRe = exports.safeRe = []\nconst src = exports.src = []\nconst t = exports.t = {}\nlet R = 0\n\nconst LETTERDASHNUMBER = '[a-zA-Z0-9-]'\n\n// Replace some greedy regex tokens to prevent regex dos issues. These regex are\n// used internally via the safeRe object since all inputs in this library get\n// normalized first to trim and collapse all extra whitespace. The original\n// regexes are exported for userland consumption and lower level usage. A\n// future breaking change could export the safer regex only with a note that\n// all input should have extra whitespace removed.\nconst safeRegexReplacements = [\n ['\\\\s', 1],\n ['\\\\d', MAX_LENGTH],\n [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],\n]\n\nconst makeSafeRegex = (value) => {\n for (const [token, max] of safeRegexReplacements) {\n value = value\n .split(`${token}*`).join(`${token}{0,${max}}`)\n .split(`${token}+`).join(`${token}{1,${max}}`)\n }\n return value\n}\n\nconst createToken = (name, value, isGlobal) => {\n const safe = makeSafeRegex(value)\n const index = R++\n debug(name, index, value)\n t[name] = index\n src[index] = value\n re[index] = new RegExp(value, isGlobal ? 'g' : undefined)\n safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)\n}\n\n// The following Regular Expressions can be used for tokenizing,\n// validating, and parsing SemVer version strings.\n\n// ## Numeric Identifier\n// A single `0`, or a non-zero digit followed by zero or more digits.\n\ncreateToken('NUMERICIDENTIFIER', '0|[1-9]\\\\d*')\ncreateToken('NUMERICIDENTIFIERLOOSE', '\\\\d+')\n\n// ## Non-numeric Identifier\n// Zero or more digits, followed by a letter or hyphen, and then zero or\n// more letters, digits, or hyphens.\n\ncreateToken('NONNUMERICIDENTIFIER', `\\\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)\n\n// ## Main Version\n// Three dot-separated numeric identifiers.\n\ncreateToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIER]})`)\n\ncreateToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})\\\\.` +\n `(${src[t.NUMERICIDENTIFIERLOOSE]})`)\n\n// ## Pre-release Version Identifier\n// A numeric identifier, or a non-numeric identifier.\n\ncreateToken('PRERELEASEIDENTIFIER', `(?:${src[t.NUMERICIDENTIFIER]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\ncreateToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NUMERICIDENTIFIERLOOSE]\n}|${src[t.NONNUMERICIDENTIFIER]})`)\n\n// ## Pre-release Version\n// Hyphen, followed by one or more dot-separated pre-release version\n// identifiers.\n\ncreateToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIER]})*))`)\n\ncreateToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]\n}(?:\\\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)\n\n// ## Build Metadata Identifier\n// Any combination of digits, letters, or hyphens.\n\ncreateToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)\n\n// ## Build Metadata\n// Plus sign, followed by one or more period-separated build metadata\n// identifiers.\n\ncreateToken('BUILD', `(?:\\\\+(${src[t.BUILDIDENTIFIER]\n}(?:\\\\.${src[t.BUILDIDENTIFIER]})*))`)\n\n// ## Full Version String\n// A main version, followed optionally by a pre-release version and\n// build metadata.\n\n// Note that the only major, minor, patch, and pre-release sections of\n// the version string are capturing groups. The build metadata is not a\n// capturing group, because it should not ever be used in version\n// comparison.\n\ncreateToken('FULLPLAIN', `v?${src[t.MAINVERSION]\n}${src[t.PRERELEASE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('FULL', `^${src[t.FULLPLAIN]}$`)\n\n// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.\n// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty\n// common in the npm registry.\ncreateToken('LOOSEPLAIN', `[v=\\\\s]*${src[t.MAINVERSIONLOOSE]\n}${src[t.PRERELEASELOOSE]}?${\n src[t.BUILD]}?`)\n\ncreateToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)\n\ncreateToken('GTLT', '((?:<|>)?=?)')\n\n// Something like \"2.*\" or \"1.2.x\".\n// Note that \"x.x\" is a valid xRange identifer, meaning \"any version\"\n// Only the first item is strictly required.\ncreateToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\\\*`)\ncreateToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\\\*`)\n\ncreateToken('XRANGEPLAIN', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIER]})` +\n `(?:${src[t.PRERELEASE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGEPLAINLOOSE', `[v=\\\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:\\\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +\n `(?:${src[t.PRERELEASELOOSE]})?${\n src[t.BUILD]}?` +\n `)?)?`)\n\ncreateToken('XRANGE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAIN]}$`)\ncreateToken('XRANGELOOSE', `^${src[t.GTLT]}\\\\s*${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Coercion.\n// Extract anything that could conceivably be a part of a valid semver\ncreateToken('COERCE', `${'(^|[^\\\\d])' +\n '(\\\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:\\\\.(\\\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +\n `(?:$|[^\\\\d])`)\ncreateToken('COERCERTL', src[t.COERCE], true)\n\n// Tilde ranges.\n// Meaning is \"reasonably at or greater than\"\ncreateToken('LONETILDE', '(?:~>?)')\n\ncreateToken('TILDETRIM', `(\\\\s*)${src[t.LONETILDE]}\\\\s+`, true)\nexports.tildeTrimReplace = '$1~'\n\ncreateToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// Caret ranges.\n// Meaning is \"at least and backwards compatible with\"\ncreateToken('LONECARET', '(?:\\\\^)')\n\ncreateToken('CARETTRIM', `(\\\\s*)${src[t.LONECARET]}\\\\s+`, true)\nexports.caretTrimReplace = '$1^'\n\ncreateToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)\ncreateToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)\n\n// A simple gt/lt/eq thing, or just \"\" to indicate \"any version\"\ncreateToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\\\s*(${src[t.LOOSEPLAIN]})$|^$`)\ncreateToken('COMPARATOR', `^${src[t.GTLT]}\\\\s*(${src[t.FULLPLAIN]})$|^$`)\n\n// An expression to strip any whitespace between the gtlt and the thing\n// it modifies, so that `> 1.2.3` ==> `>1.2.3`\ncreateToken('COMPARATORTRIM', `(\\\\s*)${src[t.GTLT]\n}\\\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)\nexports.comparatorTrimReplace = '$1$2$3'\n\n// Something like `1.2.3 - 1.2.4`\n// Note that these all use the loose form, because they'll be\n// checked against either the strict or loose comparator form\n// later.\ncreateToken('HYPHENRANGE', `^\\\\s*(${src[t.XRANGEPLAIN]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAIN]})` +\n `\\\\s*$`)\n\ncreateToken('HYPHENRANGELOOSE', `^\\\\s*(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s+-\\\\s+` +\n `(${src[t.XRANGEPLAINLOOSE]})` +\n `\\\\s*$`)\n\n// Star ranges basically just allow anything at all.\ncreateToken('STAR', '(<|>)?=?\\\\s*\\\\*')\n// >=0.0.0 is like a star\ncreateToken('GTE0', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0\\\\s*$')\ncreateToken('GTE0PRE', '^\\\\s*>=\\\\s*0\\\\.0\\\\.0-0\\\\s*$')\n","// Determine if version is greater than all the versions possible in the range.\nconst outside = require('./outside')\nconst gtr = (version, range, options) => outside(version, range, '>', options)\nmodule.exports = gtr\n","const Range = require('../classes/range')\nconst intersects = (r1, r2, options) => {\n r1 = new Range(r1, options)\n r2 = new Range(r2, options)\n return r1.intersects(r2, options)\n}\nmodule.exports = intersects\n","const outside = require('./outside')\n// Determine if version is less than all the versions possible in the range\nconst ltr = (version, range, options) => outside(version, range, '<', options)\nmodule.exports = ltr\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\n\nconst maxSatisfying = (versions, range, options) => {\n let max = null\n let maxSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!max || maxSV.compare(v) === -1) {\n // compare(max, v, true)\n max = v\n maxSV = new SemVer(max, options)\n }\n }\n })\n return max\n}\nmodule.exports = maxSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst minSatisfying = (versions, range, options) => {\n let min = null\n let minSV = null\n let rangeObj = null\n try {\n rangeObj = new Range(range, options)\n } catch (er) {\n return null\n }\n versions.forEach((v) => {\n if (rangeObj.test(v)) {\n // satisfies(v, range, options)\n if (!min || minSV.compare(v) === 1) {\n // compare(min, v, true)\n min = v\n minSV = new SemVer(min, options)\n }\n }\n })\n return min\n}\nmodule.exports = minSatisfying\n","const SemVer = require('../classes/semver')\nconst Range = require('../classes/range')\nconst gt = require('../functions/gt')\n\nconst minVersion = (range, loose) => {\n range = new Range(range, loose)\n\n let minver = new SemVer('0.0.0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = new SemVer('0.0.0-0')\n if (range.test(minver)) {\n return minver\n }\n\n minver = null\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let setMin = null\n comparators.forEach((comparator) => {\n // Clone to avoid manipulating the comparator's semver object.\n const compver = new SemVer(comparator.semver.version)\n switch (comparator.operator) {\n case '>':\n if (compver.prerelease.length === 0) {\n compver.patch++\n } else {\n compver.prerelease.push(0)\n }\n compver.raw = compver.format()\n /* fallthrough */\n case '':\n case '>=':\n if (!setMin || gt(compver, setMin)) {\n setMin = compver\n }\n break\n case '<':\n case '<=':\n /* Ignore maximum versions */\n break\n /* istanbul ignore next */\n default:\n throw new Error(`Unexpected operation: ${comparator.operator}`)\n }\n })\n if (setMin && (!minver || gt(minver, setMin))) {\n minver = setMin\n }\n }\n\n if (minver && range.test(minver)) {\n return minver\n }\n\n return null\n}\nmodule.exports = minVersion\n","const SemVer = require('../classes/semver')\nconst Comparator = require('../classes/comparator')\nconst { ANY } = Comparator\nconst Range = require('../classes/range')\nconst satisfies = require('../functions/satisfies')\nconst gt = require('../functions/gt')\nconst lt = require('../functions/lt')\nconst lte = require('../functions/lte')\nconst gte = require('../functions/gte')\n\nconst outside = (version, range, hilo, options) => {\n version = new SemVer(version, options)\n range = new Range(range, options)\n\n let gtfn, ltefn, ltfn, comp, ecomp\n switch (hilo) {\n case '>':\n gtfn = gt\n ltefn = lte\n ltfn = lt\n comp = '>'\n ecomp = '>='\n break\n case '<':\n gtfn = lt\n ltefn = gte\n ltfn = gt\n comp = '<'\n ecomp = '<='\n break\n default:\n throw new TypeError('Must provide a hilo val of \"<\" or \">\"')\n }\n\n // If it satisfies the range it is not outside\n if (satisfies(version, range, options)) {\n return false\n }\n\n // From now on, variable terms are as if we're in \"gtr\" mode.\n // but note that everything is flipped for the \"ltr\" function.\n\n for (let i = 0; i < range.set.length; ++i) {\n const comparators = range.set[i]\n\n let high = null\n let low = null\n\n comparators.forEach((comparator) => {\n if (comparator.semver === ANY) {\n comparator = new Comparator('>=0.0.0')\n }\n high = high || comparator\n low = low || comparator\n if (gtfn(comparator.semver, high.semver, options)) {\n high = comparator\n } else if (ltfn(comparator.semver, low.semver, options)) {\n low = comparator\n }\n })\n\n // If the edge version comparator has a operator then our version\n // isn't outside it\n if (high.operator === comp || high.operator === ecomp) {\n return false\n }\n\n // If the lowest version comparator has an operator and our version\n // is less than it then it isn't higher than the range\n if ((!low.operator || low.operator === comp) &&\n ltefn(version, low.semver)) {\n return false\n } else if (low.operator === ecomp && ltfn(version, low.semver)) {\n return false\n }\n }\n return true\n}\n\nmodule.exports = outside\n","// given a set of versions and a range, create a \"simplified\" range\n// that includes the same versions that the original range does\n// If the original range is shorter than the simplified one, return that.\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\nmodule.exports = (versions, range, options) => {\n const set = []\n let first = null\n let prev = null\n const v = versions.sort((a, b) => compare(a, b, options))\n for (const version of v) {\n const included = satisfies(version, range, options)\n if (included) {\n prev = version\n if (!first) {\n first = version\n }\n } else {\n if (prev) {\n set.push([first, prev])\n }\n prev = null\n first = null\n }\n }\n if (first) {\n set.push([first, null])\n }\n\n const ranges = []\n for (const [min, max] of set) {\n if (min === max) {\n ranges.push(min)\n } else if (!max && min === v[0]) {\n ranges.push('*')\n } else if (!max) {\n ranges.push(`>=${min}`)\n } else if (min === v[0]) {\n ranges.push(`<=${max}`)\n } else {\n ranges.push(`${min} - ${max}`)\n }\n }\n const simplified = ranges.join(' || ')\n const original = typeof range.raw === 'string' ? range.raw : String(range)\n return simplified.length < original.length ? simplified : range\n}\n","const Range = require('../classes/range.js')\nconst Comparator = require('../classes/comparator.js')\nconst { ANY } = Comparator\nconst satisfies = require('../functions/satisfies.js')\nconst compare = require('../functions/compare.js')\n\n// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:\n// - Every simple range `r1, r2, ...` is a null set, OR\n// - Every simple range `r1, r2, ...` which is not a null set is a subset of\n// some `R1, R2, ...`\n//\n// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:\n// - If c is only the ANY comparator\n// - If C is only the ANY comparator, return true\n// - Else if in prerelease mode, return false\n// - else replace c with `[>=0.0.0]`\n// - If C is only the ANY comparator\n// - if in prerelease mode, return true\n// - else replace C with `[>=0.0.0]`\n// - Let EQ be the set of = comparators in c\n// - If EQ is more than one, return true (null set)\n// - Let GT be the highest > or >= comparator in c\n// - Let LT be the lowest < or <= comparator in c\n// - If GT and LT, and GT.semver > LT.semver, return true (null set)\n// - If any C is a = range, and GT or LT are set, return false\n// - If EQ\n// - If GT, and EQ does not satisfy GT, return true (null set)\n// - If LT, and EQ does not satisfy LT, return true (null set)\n// - If EQ satisfies every C, return true\n// - Else return false\n// - If GT\n// - If GT.semver is lower than any > or >= comp in C, return false\n// - If GT is >=, and GT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the GT.semver tuple, return false\n// - If LT\n// - If LT.semver is greater than any < or <= comp in C, return false\n// - If LT is <=, and LT.semver does not satisfy every C, return false\n// - If GT.semver has a prerelease, and not in prerelease mode\n// - If no C has a prerelease and the LT.semver tuple, return false\n// - Else return true\n\nconst subset = (sub, dom, options = {}) => {\n if (sub === dom) {\n return true\n }\n\n sub = new Range(sub, options)\n dom = new Range(dom, options)\n let sawNonNull = false\n\n OUTER: for (const simpleSub of sub.set) {\n for (const simpleDom of dom.set) {\n const isSub = simpleSubset(simpleSub, simpleDom, options)\n sawNonNull = sawNonNull || isSub !== null\n if (isSub) {\n continue OUTER\n }\n }\n // the null set is a subset of everything, but null simple ranges in\n // a complex range should be ignored. so if we saw a non-null range,\n // then we know this isn't a subset, but if EVERY simple range was null,\n // then it is a subset.\n if (sawNonNull) {\n return false\n }\n }\n return true\n}\n\nconst minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]\nconst minimumVersion = [new Comparator('>=0.0.0')]\n\nconst simpleSubset = (sub, dom, options) => {\n if (sub === dom) {\n return true\n }\n\n if (sub.length === 1 && sub[0].semver === ANY) {\n if (dom.length === 1 && dom[0].semver === ANY) {\n return true\n } else if (options.includePrerelease) {\n sub = minimumVersionWithPreRelease\n } else {\n sub = minimumVersion\n }\n }\n\n if (dom.length === 1 && dom[0].semver === ANY) {\n if (options.includePrerelease) {\n return true\n } else {\n dom = minimumVersion\n }\n }\n\n const eqSet = new Set()\n let gt, lt\n for (const c of sub) {\n if (c.operator === '>' || c.operator === '>=') {\n gt = higherGT(gt, c, options)\n } else if (c.operator === '<' || c.operator === '<=') {\n lt = lowerLT(lt, c, options)\n } else {\n eqSet.add(c.semver)\n }\n }\n\n if (eqSet.size > 1) {\n return null\n }\n\n let gtltComp\n if (gt && lt) {\n gtltComp = compare(gt.semver, lt.semver, options)\n if (gtltComp > 0) {\n return null\n } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {\n return null\n }\n }\n\n // will iterate one or zero times\n for (const eq of eqSet) {\n if (gt && !satisfies(eq, String(gt), options)) {\n return null\n }\n\n if (lt && !satisfies(eq, String(lt), options)) {\n return null\n }\n\n for (const c of dom) {\n if (!satisfies(eq, String(c), options)) {\n return false\n }\n }\n\n return true\n }\n\n let higher, lower\n let hasDomLT, hasDomGT\n // if the subset has a prerelease, we need a comparator in the superset\n // with the same tuple and a prerelease, or it's not a subset\n let needDomLTPre = lt &&\n !options.includePrerelease &&\n lt.semver.prerelease.length ? lt.semver : false\n let needDomGTPre = gt &&\n !options.includePrerelease &&\n gt.semver.prerelease.length ? gt.semver : false\n // exception: <1.2.3-0 is the same as <1.2.3\n if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&\n lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {\n needDomLTPre = false\n }\n\n for (const c of dom) {\n hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='\n hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='\n if (gt) {\n if (needDomGTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomGTPre.major &&\n c.semver.minor === needDomGTPre.minor &&\n c.semver.patch === needDomGTPre.patch) {\n needDomGTPre = false\n }\n }\n if (c.operator === '>' || c.operator === '>=') {\n higher = higherGT(gt, c, options)\n if (higher === c && higher !== gt) {\n return false\n }\n } else if (gt.operator === '>=' && !satisfies(gt.semver, String(c), options)) {\n return false\n }\n }\n if (lt) {\n if (needDomLTPre) {\n if (c.semver.prerelease && c.semver.prerelease.length &&\n c.semver.major === needDomLTPre.major &&\n c.semver.minor === needDomLTPre.minor &&\n c.semver.patch === needDomLTPre.patch) {\n needDomLTPre = false\n }\n }\n if (c.operator === '<' || c.operator === '<=') {\n lower = lowerLT(lt, c, options)\n if (lower === c && lower !== lt) {\n return false\n }\n } else if (lt.operator === '<=' && !satisfies(lt.semver, String(c), options)) {\n return false\n }\n }\n if (!c.operator && (lt || gt) && gtltComp !== 0) {\n return false\n }\n }\n\n // if there was a < or >, and nothing in the dom, then must be false\n // UNLESS it was limited by another range in the other direction.\n // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0\n if (gt && hasDomLT && !lt && gtltComp !== 0) {\n return false\n }\n\n if (lt && hasDomGT && !gt && gtltComp !== 0) {\n return false\n }\n\n // we needed a prerelease range in a specific tuple, but didn't get one\n // then this isn't a subset. eg >=1.2.3-pre is not a subset of >=1.0.0,\n // because it includes prereleases in the 1.2.3 tuple\n if (needDomGTPre || needDomLTPre) {\n return false\n }\n\n return true\n}\n\n// >=1.2.3 is lower than >1.2.3\nconst higherGT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp > 0 ? a\n : comp < 0 ? b\n : b.operator === '>' && a.operator === '>=' ? b\n : a\n}\n\n// <=1.2.3 is higher than <1.2.3\nconst lowerLT = (a, b, options) => {\n if (!a) {\n return b\n }\n const comp = compare(a.semver, b.semver, options)\n return comp < 0 ? a\n : comp > 0 ? b\n : b.operator === '<' && a.operator === '<=' ? b\n : a\n}\n\nmodule.exports = subset\n","const Range = require('../classes/range')\n\n// Mostly just for testing and legacy API reasons\nconst toComparators = (range, options) =>\n new Range(range, options).set\n .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))\n\nmodule.exports = toComparators\n","const Range = require('../classes/range')\nconst validRange = (range, options) => {\n try {\n // Return '*' instead of '' so that truthiness works.\n // This will throw if it's invalid anyway\n return new Range(range, options).range || '*'\n } catch (er) {\n return null\n }\n}\nmodule.exports = validRange\n","'use strict';\nconst shebangRegex = require('shebang-regex');\n\nmodule.exports = (string = '') => {\n\tconst match = string.match(shebangRegex);\n\n\tif (!match) {\n\t\treturn null;\n\t}\n\n\tconst [path, argument] = match[0].replace(/#! ?/, '').split(' ');\n\tconst binary = path.split('/').pop();\n\n\tif (binary === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${binary} ${argument}` : binary;\n};\n","'use strict';\nmodule.exports = /^#!(.*)/;\n","module.exports = [\n 'cat',\n 'cd',\n 'chmod',\n 'cp',\n 'dirs',\n 'echo',\n 'exec',\n 'find',\n 'grep',\n 'head',\n 'ln',\n 'ls',\n 'mkdir',\n 'mv',\n 'pwd',\n 'rm',\n 'sed',\n 'set',\n 'sort',\n 'tail',\n 'tempdir',\n 'test',\n 'to',\n 'toEnd',\n 'touch',\n 'uniq',\n 'which',\n];\n",null,"var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('cat', _cat, {\n canReceivePipe: true,\n cmdOptions: {\n 'n': 'number',\n },\n});\n\n//@\n//@ ### cat([options,] file [, file ...])\n//@ ### cat([options,] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-n`: number all output lines\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var str = cat('file*.txt');\n//@ var str = cat('file1', 'file2');\n//@ var str = cat(['file1', 'file2']); // same as above\n//@ ```\n//@\n//@ Returns a string containing the given file, or a concatenated string\n//@ containing the files if more than one file is given (a new line character is\n//@ introduced between each file).\nfunction _cat(options, files) {\n var cat = common.readFromPipe();\n\n if (!files && !cat) common.error('no paths given');\n\n files = [].slice.call(arguments, 1);\n\n files.forEach(function (file) {\n if (!fs.existsSync(file)) {\n common.error('no such file or directory: ' + file);\n } else if (common.statFollowLinks(file).isDirectory()) {\n common.error(file + ': Is a directory');\n }\n\n cat += fs.readFileSync(file, 'utf8');\n });\n\n if (options.number) {\n cat = addNumbers(cat);\n }\n\n return cat;\n}\nmodule.exports = _cat;\n\nfunction addNumbers(cat) {\n var lines = cat.split('\\n');\n var lastLine = lines.pop();\n\n lines = lines.map(function (line, i) {\n return numberedLine(i + 1, line);\n });\n\n if (lastLine.length) {\n lastLine = numberedLine(lines.length + 1, lastLine);\n }\n lines.push(lastLine);\n\n return lines.join('\\n');\n}\n\nfunction numberedLine(n, line) {\n // GNU cat use six pad start number + tab. See http://lingrok.org/xref/coreutils/src/cat.c#57\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/padStart\n var number = (' ' + n).slice(-6) + '\\t';\n return number + line;\n}\n","var os = require('os');\nvar common = require('./common');\n\ncommon.register('cd', _cd, {});\n\n//@\n//@ ### cd([dir])\n//@\n//@ Changes to directory `dir` for the duration of the script. Changes to home\n//@ directory if no argument is supplied.\nfunction _cd(options, dir) {\n if (!dir) dir = os.homedir();\n\n if (dir === '-') {\n if (!process.env.OLDPWD) {\n common.error('could not find previous directory');\n } else {\n dir = process.env.OLDPWD;\n }\n }\n\n try {\n var curDir = process.cwd();\n process.chdir(dir);\n process.env.OLDPWD = curDir;\n } catch (e) {\n // something went wrong, let's figure out the error\n var err;\n try {\n common.statFollowLinks(dir); // if this succeeds, it must be some sort of file\n err = 'not a directory: ' + dir;\n } catch (e2) {\n err = 'no such file or directory: ' + dir;\n }\n if (err) common.error(err);\n }\n return '';\n}\nmodule.exports = _cd;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\nvar PERMS = (function (base) {\n return {\n OTHER_EXEC: base.EXEC,\n OTHER_WRITE: base.WRITE,\n OTHER_READ: base.READ,\n\n GROUP_EXEC: base.EXEC << 3,\n GROUP_WRITE: base.WRITE << 3,\n GROUP_READ: base.READ << 3,\n\n OWNER_EXEC: base.EXEC << 6,\n OWNER_WRITE: base.WRITE << 6,\n OWNER_READ: base.READ << 6,\n\n // Literal octal numbers are apparently not allowed in \"strict\" javascript.\n STICKY: parseInt('01000', 8),\n SETGID: parseInt('02000', 8),\n SETUID: parseInt('04000', 8),\n\n TYPE_MASK: parseInt('0770000', 8),\n };\n}({\n EXEC: 1,\n WRITE: 2,\n READ: 4,\n}));\n\ncommon.register('chmod', _chmod, {\n});\n\n//@\n//@ ### chmod([options,] octal_mode || octal_string, file)\n//@ ### chmod([options,] symbolic_mode, file)\n//@\n//@ Available options:\n//@\n//@ + `-v`: output a diagnostic for every file processed//@\n//@ + `-c`: like verbose, but report only when a change is made//@\n//@ + `-R`: change files and directories recursively//@\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ chmod(755, '/Users/brandon');\n//@ chmod('755', '/Users/brandon'); // same as above\n//@ chmod('u+x', '/Users/brandon');\n//@ chmod('-R', 'a-w', '/Users/brandon');\n//@ ```\n//@\n//@ Alters the permissions of a file or directory by either specifying the\n//@ absolute permissions in octal form or expressing the changes in symbols.\n//@ This command tries to mimic the POSIX behavior as much as possible.\n//@ Notable exceptions:\n//@\n//@ + In symbolic modes, `a-r` and `-r` are identical. No consideration is\n//@ given to the `umask`.\n//@ + There is no \"quiet\" option, since default behavior is to run silent.\nfunction _chmod(options, mode, filePattern) {\n if (!filePattern) {\n if (options.length > 0 && options.charAt(0) === '-') {\n // Special case where the specified file permissions started with - to subtract perms, which\n // get picked up by the option parser as command flags.\n // If we are down by one argument and options starts with -, shift everything over.\n [].unshift.call(arguments, '');\n } else {\n common.error('You must specify a file.');\n }\n }\n\n options = common.parseOptions(options, {\n 'R': 'recursive',\n 'c': 'changes',\n 'v': 'verbose',\n });\n\n filePattern = [].slice.call(arguments, 2);\n\n var files;\n\n // TODO: replace this with a call to common.expand()\n if (options.recursive) {\n files = [];\n filePattern.forEach(function addFile(expandedFile) {\n var stat = common.statNoFollowLinks(expandedFile);\n\n if (!stat.isSymbolicLink()) {\n files.push(expandedFile);\n\n if (stat.isDirectory()) { // intentionally does not follow symlinks.\n fs.readdirSync(expandedFile).forEach(function (child) {\n addFile(expandedFile + '/' + child);\n });\n }\n }\n });\n } else {\n files = filePattern;\n }\n\n files.forEach(function innerChmod(file) {\n file = path.resolve(file);\n if (!fs.existsSync(file)) {\n common.error('File not found: ' + file);\n }\n\n // When recursing, don't follow symlinks.\n if (options.recursive && common.statNoFollowLinks(file).isSymbolicLink()) {\n return;\n }\n\n var stat = common.statFollowLinks(file);\n var isDir = stat.isDirectory();\n var perms = stat.mode;\n var type = perms & PERMS.TYPE_MASK;\n\n var newPerms = perms;\n\n if (isNaN(parseInt(mode, 8))) {\n // parse options\n mode.split(',').forEach(function (symbolicMode) {\n var pattern = /([ugoa]*)([=\\+-])([rwxXst]*)/i;\n var matches = pattern.exec(symbolicMode);\n\n if (matches) {\n var applyTo = matches[1];\n var operator = matches[2];\n var change = matches[3];\n\n var changeOwner = applyTo.indexOf('u') !== -1 || applyTo === 'a' || applyTo === '';\n var changeGroup = applyTo.indexOf('g') !== -1 || applyTo === 'a' || applyTo === '';\n var changeOther = applyTo.indexOf('o') !== -1 || applyTo === 'a' || applyTo === '';\n\n var changeRead = change.indexOf('r') !== -1;\n var changeWrite = change.indexOf('w') !== -1;\n var changeExec = change.indexOf('x') !== -1;\n var changeExecDir = change.indexOf('X') !== -1;\n var changeSticky = change.indexOf('t') !== -1;\n var changeSetuid = change.indexOf('s') !== -1;\n\n if (changeExecDir && isDir) {\n changeExec = true;\n }\n\n var mask = 0;\n if (changeOwner) {\n mask |= (changeRead ? PERMS.OWNER_READ : 0) + (changeWrite ? PERMS.OWNER_WRITE : 0) + (changeExec ? PERMS.OWNER_EXEC : 0) + (changeSetuid ? PERMS.SETUID : 0);\n }\n if (changeGroup) {\n mask |= (changeRead ? PERMS.GROUP_READ : 0) + (changeWrite ? PERMS.GROUP_WRITE : 0) + (changeExec ? PERMS.GROUP_EXEC : 0) + (changeSetuid ? PERMS.SETGID : 0);\n }\n if (changeOther) {\n mask |= (changeRead ? PERMS.OTHER_READ : 0) + (changeWrite ? PERMS.OTHER_WRITE : 0) + (changeExec ? PERMS.OTHER_EXEC : 0);\n }\n\n // Sticky bit is special - it's not tied to user, group or other.\n if (changeSticky) {\n mask |= PERMS.STICKY;\n }\n\n switch (operator) {\n case '+':\n newPerms |= mask;\n break;\n\n case '-':\n newPerms &= ~mask;\n break;\n\n case '=':\n newPerms = type + mask;\n\n // According to POSIX, when using = to explicitly set the\n // permissions, setuid and setgid can never be cleared.\n if (common.statFollowLinks(file).isDirectory()) {\n newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms;\n }\n break;\n default:\n common.error('Could not recognize operator: `' + operator + '`');\n }\n\n if (options.verbose) {\n console.log(file + ' -> ' + newPerms.toString(8));\n }\n\n if (perms !== newPerms) {\n if (!options.verbose && options.changes) {\n console.log(file + ' -> ' + newPerms.toString(8));\n }\n fs.chmodSync(file, newPerms);\n perms = newPerms; // for the next round of changes!\n }\n } else {\n common.error('Invalid symbolic mode change: ' + symbolicMode);\n }\n });\n } else {\n // they gave us a full number\n newPerms = type + parseInt(mode, 8);\n\n // POSIX rules are that setuid and setgid can only be added using numeric\n // form, but not cleared.\n if (common.statFollowLinks(file).isDirectory()) {\n newPerms |= (PERMS.SETUID + PERMS.SETGID) & perms;\n }\n\n fs.chmodSync(file, newPerms);\n }\n });\n return '';\n}\nmodule.exports = _chmod;\n","// Ignore warning about 'new String()'\n/* eslint no-new-wrappers: 0 */\n'use strict';\n\nvar os = require('os');\nvar fs = require('fs');\nvar glob = require('glob');\nvar shell = require('..');\n\nvar shellMethods = Object.create(shell);\n\nexports.extend = Object.assign;\n\n// Check if we're running under electron\nvar isElectron = Boolean(process.versions.electron);\n\n// Module globals (assume no execPath by default)\nvar DEFAULT_CONFIG = {\n fatal: false,\n globOptions: {},\n maxdepth: 255,\n noglob: false,\n silent: false,\n verbose: false,\n execPath: null,\n bufLength: 64 * 1024, // 64KB\n};\n\nvar config = {\n reset: function () {\n Object.assign(this, DEFAULT_CONFIG);\n if (!isElectron) {\n this.execPath = process.execPath;\n }\n },\n resetForTesting: function () {\n this.reset();\n this.silent = true;\n },\n};\n\nconfig.reset();\nexports.config = config;\n\n// Note: commands should generally consider these as read-only values.\nvar state = {\n error: null,\n errorCode: 0,\n currentCmd: 'shell.js',\n};\nexports.state = state;\n\ndelete process.env.OLDPWD; // initially, there's no previous directory\n\n// Reliably test if something is any sort of javascript object\nfunction isObject(a) {\n return typeof a === 'object' && a !== null;\n}\nexports.isObject = isObject;\n\nfunction log() {\n /* istanbul ignore next */\n if (!config.silent) {\n console.error.apply(console, arguments);\n }\n}\nexports.log = log;\n\n// Converts strings to be equivalent across all platforms. Primarily responsible\n// for making sure we use '/' instead of '\\' as path separators, but this may be\n// expanded in the future if necessary\nfunction convertErrorOutput(msg) {\n if (typeof msg !== 'string') {\n throw new TypeError('input must be a string');\n }\n return msg.replace(/\\\\/g, '/');\n}\nexports.convertErrorOutput = convertErrorOutput;\n\n// Shows error message. Throws if config.fatal is true\nfunction error(msg, _code, options) {\n // Validate input\n if (typeof msg !== 'string') throw new Error('msg must be a string');\n\n var DEFAULT_OPTIONS = {\n continue: false,\n code: 1,\n prefix: state.currentCmd + ': ',\n silent: false,\n };\n\n if (typeof _code === 'number' && isObject(options)) {\n options.code = _code;\n } else if (isObject(_code)) { // no 'code'\n options = _code;\n } else if (typeof _code === 'number') { // no 'options'\n options = { code: _code };\n } else if (typeof _code !== 'number') { // only 'msg'\n options = {};\n }\n options = Object.assign({}, DEFAULT_OPTIONS, options);\n\n if (!state.errorCode) state.errorCode = options.code;\n\n var logEntry = convertErrorOutput(options.prefix + msg);\n state.error = state.error ? state.error + '\\n' : '';\n state.error += logEntry;\n\n // Throw an error, or log the entry\n if (config.fatal) throw new Error(logEntry);\n if (msg.length > 0 && !options.silent) log(logEntry);\n\n if (!options.continue) {\n throw {\n msg: 'earlyExit',\n retValue: (new ShellString('', state.error, state.errorCode)),\n };\n }\n}\nexports.error = error;\n\n//@\n//@ ### ShellString(str)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var foo = ShellString('hello world');\n//@ ```\n//@\n//@ Turns a regular string into a string-like object similar to what each\n//@ command returns. This has special methods, like `.to()` and `.toEnd()`.\nfunction ShellString(stdout, stderr, code) {\n var that;\n if (stdout instanceof Array) {\n that = stdout;\n that.stdout = stdout.join('\\n');\n if (stdout.length > 0) that.stdout += '\\n';\n } else {\n that = new String(stdout);\n that.stdout = stdout;\n }\n that.stderr = stderr;\n that.code = code;\n // A list of all commands that can appear on the right-hand side of a pipe\n // (populated by calls to common.wrap())\n pipeMethods.forEach(function (cmd) {\n that[cmd] = shellMethods[cmd].bind(that);\n });\n return that;\n}\n\nexports.ShellString = ShellString;\n\n// Returns {'alice': true, 'bob': false} when passed a string and dictionary as follows:\n// parseOptions('-a', {'a':'alice', 'b':'bob'});\n// Returns {'reference': 'string-value', 'bob': false} when passed two dictionaries of the form:\n// parseOptions({'-r': 'string-value'}, {'r':'reference', 'b':'bob'});\n// Throws an error when passed a string that does not start with '-':\n// parseOptions('a', {'a':'alice'}); // throws\nfunction parseOptions(opt, map, errorOptions) {\n // Validate input\n if (typeof opt !== 'string' && !isObject(opt)) {\n throw new Error('options must be strings or key-value pairs');\n } else if (!isObject(map)) {\n throw new Error('parseOptions() internal error: map must be an object');\n } else if (errorOptions && !isObject(errorOptions)) {\n throw new Error('parseOptions() internal error: errorOptions must be object');\n }\n\n if (opt === '--') {\n // This means there are no options.\n return {};\n }\n\n // All options are false by default\n var options = {};\n Object.keys(map).forEach(function (letter) {\n var optName = map[letter];\n if (optName[0] !== '!') {\n options[optName] = false;\n }\n });\n\n if (opt === '') return options; // defaults\n\n if (typeof opt === 'string') {\n if (opt[0] !== '-') {\n throw new Error(\"Options string must start with a '-'\");\n }\n\n // e.g. chars = ['R', 'f']\n var chars = opt.slice(1).split('');\n\n chars.forEach(function (c) {\n if (c in map) {\n var optionName = map[c];\n if (optionName[0] === '!') {\n options[optionName.slice(1)] = false;\n } else {\n options[optionName] = true;\n }\n } else {\n error('option not recognized: ' + c, errorOptions || {});\n }\n });\n } else { // opt is an Object\n Object.keys(opt).forEach(function (key) {\n // key is a string of the form '-r', '-d', etc.\n var c = key[1];\n if (c in map) {\n var optionName = map[c];\n options[optionName] = opt[key]; // assign the given value\n } else {\n error('option not recognized: ' + c, errorOptions || {});\n }\n });\n }\n return options;\n}\nexports.parseOptions = parseOptions;\n\n// Expands wildcards with matching (ie. existing) file names.\n// For example:\n// expand(['file*.js']) = ['file1.js', 'file2.js', ...]\n// (if the files 'file1.js', 'file2.js', etc, exist in the current dir)\nfunction expand(list) {\n if (!Array.isArray(list)) {\n throw new TypeError('must be an array');\n }\n var expanded = [];\n list.forEach(function (listEl) {\n // Don't expand non-strings\n if (typeof listEl !== 'string') {\n expanded.push(listEl);\n } else {\n var ret;\n try {\n ret = glob.sync(listEl, config.globOptions);\n // if nothing matched, interpret the string literally\n ret = ret.length > 0 ? ret : [listEl];\n } catch (e) {\n // if glob fails, interpret the string literally\n ret = [listEl];\n }\n expanded = expanded.concat(ret);\n }\n });\n return expanded;\n}\nexports.expand = expand;\n\n// Normalizes Buffer creation, using Buffer.alloc if possible.\n// Also provides a good default buffer length for most use cases.\nvar buffer = typeof Buffer.alloc === 'function' ?\n function (len) {\n return Buffer.alloc(len || config.bufLength);\n } :\n function (len) {\n return new Buffer(len || config.bufLength);\n };\nexports.buffer = buffer;\n\n// Normalizes _unlinkSync() across platforms to match Unix behavior, i.e.\n// file can be unlinked even if it's read-only, see https://github.com/joyent/node/issues/3006\nfunction unlinkSync(file) {\n try {\n fs.unlinkSync(file);\n } catch (e) {\n // Try to override file permission\n /* istanbul ignore next */\n if (e.code === 'EPERM') {\n fs.chmodSync(file, '0666');\n fs.unlinkSync(file);\n } else {\n throw e;\n }\n }\n}\nexports.unlinkSync = unlinkSync;\n\n// wrappers around common.statFollowLinks and common.statNoFollowLinks that clarify intent\n// and improve readability\nfunction statFollowLinks() {\n return fs.statSync.apply(fs, arguments);\n}\nexports.statFollowLinks = statFollowLinks;\n\nfunction statNoFollowLinks() {\n return fs.lstatSync.apply(fs, arguments);\n}\nexports.statNoFollowLinks = statNoFollowLinks;\n\n// e.g. 'shelljs_a5f185d0443ca...'\nfunction randomFileName() {\n function randomHash(count) {\n if (count === 1) {\n return parseInt(16 * Math.random(), 10).toString(16);\n }\n var hash = '';\n for (var i = 0; i < count; i++) {\n hash += randomHash(1);\n }\n return hash;\n }\n\n return 'shelljs_' + randomHash(20);\n}\nexports.randomFileName = randomFileName;\n\n// Common wrapper for all Unix-like commands that performs glob expansion,\n// command-logging, and other nice things\nfunction wrap(cmd, fn, options) {\n options = options || {};\n return function () {\n var retValue = null;\n\n state.currentCmd = cmd;\n state.error = null;\n state.errorCode = 0;\n\n try {\n var args = [].slice.call(arguments, 0);\n\n // Log the command to stderr, if appropriate\n if (config.verbose) {\n console.error.apply(console, [cmd].concat(args));\n }\n\n // If this is coming from a pipe, let's set the pipedValue (otherwise, set\n // it to the empty string)\n state.pipedValue = (this && typeof this.stdout === 'string') ? this.stdout : '';\n\n if (options.unix === false) { // this branch is for exec()\n retValue = fn.apply(this, args);\n } else { // and this branch is for everything else\n if (isObject(args[0]) && args[0].constructor.name === 'Object') {\n // a no-op, allowing the syntax `touch({'-r': file}, ...)`\n } else if (args.length === 0 || typeof args[0] !== 'string' || args[0].length <= 1 || args[0][0] !== '-') {\n args.unshift(''); // only add dummy option if '-option' not already present\n }\n\n // flatten out arrays that are arguments, to make the syntax:\n // `cp([file1, file2, file3], dest);`\n // equivalent to:\n // `cp(file1, file2, file3, dest);`\n args = args.reduce(function (accum, cur) {\n if (Array.isArray(cur)) {\n return accum.concat(cur);\n }\n accum.push(cur);\n return accum;\n }, []);\n\n // Convert ShellStrings (basically just String objects) to regular strings\n args = args.map(function (arg) {\n if (isObject(arg) && arg.constructor.name === 'String') {\n return arg.toString();\n }\n return arg;\n });\n\n // Expand the '~' if appropriate\n var homeDir = os.homedir();\n args = args.map(function (arg) {\n if (typeof arg === 'string' && arg.slice(0, 2) === '~/' || arg === '~') {\n return arg.replace(/^~/, homeDir);\n }\n return arg;\n });\n\n // Perform glob-expansion on all arguments after globStart, but preserve\n // the arguments before it (like regexes for sed and grep)\n if (!config.noglob && options.allowGlobbing === true) {\n args = args.slice(0, options.globStart).concat(expand(args.slice(options.globStart)));\n }\n\n try {\n // parse options if options are provided\n if (isObject(options.cmdOptions)) {\n args[0] = parseOptions(args[0], options.cmdOptions);\n }\n\n retValue = fn.apply(this, args);\n } catch (e) {\n /* istanbul ignore else */\n if (e.msg === 'earlyExit') {\n retValue = e.retValue;\n } else {\n throw e; // this is probably a bug that should be thrown up the call stack\n }\n }\n }\n } catch (e) {\n /* istanbul ignore next */\n if (!state.error) {\n // If state.error hasn't been set it's an error thrown by Node, not us - probably a bug...\n e.name = 'ShellJSInternalError';\n throw e;\n }\n if (config.fatal) throw e;\n }\n\n if (options.wrapOutput &&\n (typeof retValue === 'string' || Array.isArray(retValue))) {\n retValue = new ShellString(retValue, state.error, state.errorCode);\n }\n\n state.currentCmd = 'shell.js';\n return retValue;\n };\n} // wrap\nexports.wrap = wrap;\n\n// This returns all the input that is piped into the current command (or the\n// empty string, if this isn't on the right-hand side of a pipe\nfunction _readFromPipe() {\n return state.pipedValue;\n}\nexports.readFromPipe = _readFromPipe;\n\nvar DEFAULT_WRAP_OPTIONS = {\n allowGlobbing: true,\n canReceivePipe: false,\n cmdOptions: null,\n globStart: 1,\n pipeOnly: false,\n wrapOutput: true,\n unix: true,\n};\n\n// This is populated during plugin registration\nvar pipeMethods = [];\n\n// Register a new ShellJS command\nfunction _register(name, implementation, wrapOptions) {\n wrapOptions = wrapOptions || {};\n\n // Validate options\n Object.keys(wrapOptions).forEach(function (option) {\n if (!DEFAULT_WRAP_OPTIONS.hasOwnProperty(option)) {\n throw new Error(\"Unknown option '\" + option + \"'\");\n }\n if (typeof wrapOptions[option] !== typeof DEFAULT_WRAP_OPTIONS[option]) {\n throw new TypeError(\"Unsupported type '\" + typeof wrapOptions[option] +\n \"' for option '\" + option + \"'\");\n }\n });\n\n // If an option isn't specified, use the default\n wrapOptions = Object.assign({}, DEFAULT_WRAP_OPTIONS, wrapOptions);\n\n if (shell.hasOwnProperty(name)) {\n throw new Error('Command `' + name + '` already exists');\n }\n\n if (wrapOptions.pipeOnly) {\n wrapOptions.canReceivePipe = true;\n shellMethods[name] = wrap(name, implementation, wrapOptions);\n } else {\n shell[name] = wrap(name, implementation, wrapOptions);\n }\n\n if (wrapOptions.canReceivePipe) {\n pipeMethods.push(name);\n }\n}\nexports.register = _register;\n","var fs = require('fs');\nvar path = require('path');\nvar common = require('./common');\n\ncommon.register('cp', _cp, {\n cmdOptions: {\n 'f': '!no_force',\n 'n': 'no_force',\n 'u': 'update',\n 'R': 'recursive',\n 'r': 'recursive',\n 'L': 'followsymlink',\n 'P': 'noFollowsymlink',\n },\n wrapOutput: false,\n});\n\n// Buffered file copy, synchronous\n// (Using readFileSync() + writeFileSync() could easily cause a memory overflow\n// with large files)\nfunction copyFileSync(srcFile, destFile, options) {\n if (!fs.existsSync(srcFile)) {\n common.error('copyFileSync: no such file or directory: ' + srcFile);\n }\n\n var isWindows = process.platform === 'win32';\n\n // Check the mtimes of the files if the '-u' flag is provided\n try {\n if (options.update && common.statFollowLinks(srcFile).mtime < fs.statSync(destFile).mtime) {\n return;\n }\n } catch (e) {\n // If we're here, destFile probably doesn't exist, so just do a normal copy\n }\n\n if (common.statNoFollowLinks(srcFile).isSymbolicLink() && !options.followsymlink) {\n try {\n common.statNoFollowLinks(destFile);\n common.unlinkSync(destFile); // re-link it\n } catch (e) {\n // it doesn't exist, so no work needs to be done\n }\n\n var symlinkFull = fs.readlinkSync(srcFile);\n fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null);\n } else {\n var buf = common.buffer();\n var bufLength = buf.length;\n var bytesRead = bufLength;\n var pos = 0;\n var fdr = null;\n var fdw = null;\n\n try {\n fdr = fs.openSync(srcFile, 'r');\n } catch (e) {\n /* istanbul ignore next */\n common.error('copyFileSync: could not read src file (' + srcFile + ')');\n }\n\n try {\n fdw = fs.openSync(destFile, 'w');\n } catch (e) {\n /* istanbul ignore next */\n common.error('copyFileSync: could not write to dest file (code=' + e.code + '):' + destFile);\n }\n\n while (bytesRead === bufLength) {\n bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos);\n fs.writeSync(fdw, buf, 0, bytesRead);\n pos += bytesRead;\n }\n\n fs.closeSync(fdr);\n fs.closeSync(fdw);\n\n fs.chmodSync(destFile, common.statFollowLinks(srcFile).mode);\n }\n}\n\n// Recursively copies 'sourceDir' into 'destDir'\n// Adapted from https://github.com/ryanmcgrath/wrench-js\n//\n// Copyright (c) 2010 Ryan McGrath\n// Copyright (c) 2012 Artur Adib\n//\n// Licensed under the MIT License\n// http://www.opensource.org/licenses/mit-license.php\nfunction cpdirSyncRecursive(sourceDir, destDir, currentDepth, opts) {\n if (!opts) opts = {};\n\n // Ensure there is not a run away recursive copy\n if (currentDepth >= common.config.maxdepth) return;\n currentDepth++;\n\n var isWindows = process.platform === 'win32';\n\n // Create the directory where all our junk is moving to; read the mode of the\n // source directory and mirror it\n try {\n fs.mkdirSync(destDir);\n } catch (e) {\n // if the directory already exists, that's okay\n if (e.code !== 'EEXIST') throw e;\n }\n\n var files = fs.readdirSync(sourceDir);\n\n for (var i = 0; i < files.length; i++) {\n var srcFile = sourceDir + '/' + files[i];\n var destFile = destDir + '/' + files[i];\n var srcFileStat = common.statNoFollowLinks(srcFile);\n\n var symlinkFull;\n if (opts.followsymlink) {\n if (cpcheckcycle(sourceDir, srcFile)) {\n // Cycle link found.\n console.error('Cycle link found.');\n symlinkFull = fs.readlinkSync(srcFile);\n fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null);\n continue;\n }\n }\n if (srcFileStat.isDirectory()) {\n /* recursion this thing right on back. */\n cpdirSyncRecursive(srcFile, destFile, currentDepth, opts);\n } else if (srcFileStat.isSymbolicLink() && !opts.followsymlink) {\n symlinkFull = fs.readlinkSync(srcFile);\n try {\n common.statNoFollowLinks(destFile);\n common.unlinkSync(destFile); // re-link it\n } catch (e) {\n // it doesn't exist, so no work needs to be done\n }\n fs.symlinkSync(symlinkFull, destFile, isWindows ? 'junction' : null);\n } else if (srcFileStat.isSymbolicLink() && opts.followsymlink) {\n srcFileStat = common.statFollowLinks(srcFile);\n if (srcFileStat.isDirectory()) {\n cpdirSyncRecursive(srcFile, destFile, currentDepth, opts);\n } else {\n copyFileSync(srcFile, destFile, opts);\n }\n } else {\n /* At this point, we've hit a file actually worth copying... so copy it on over. */\n if (fs.existsSync(destFile) && opts.no_force) {\n common.log('skipping existing file: ' + files[i]);\n } else {\n copyFileSync(srcFile, destFile, opts);\n }\n }\n } // for files\n\n // finally change the mode for the newly created directory (otherwise, we\n // couldn't add files to a read-only directory).\n var checkDir = common.statFollowLinks(sourceDir);\n fs.chmodSync(destDir, checkDir.mode);\n} // cpdirSyncRecursive\n\n// Checks if cureent file was created recently\nfunction checkRecentCreated(sources, index) {\n var lookedSource = sources[index];\n return sources.slice(0, index).some(function (src) {\n return path.basename(src) === path.basename(lookedSource);\n });\n}\n\nfunction cpcheckcycle(sourceDir, srcFile) {\n var srcFileStat = common.statNoFollowLinks(srcFile);\n if (srcFileStat.isSymbolicLink()) {\n // Do cycle check. For example:\n // $ mkdir -p 1/2/3/4\n // $ cd 1/2/3/4\n // $ ln -s ../../3 link\n // $ cd ../../../..\n // $ cp -RL 1 copy\n var cyclecheck = common.statFollowLinks(srcFile);\n if (cyclecheck.isDirectory()) {\n var sourcerealpath = fs.realpathSync(sourceDir);\n var symlinkrealpath = fs.realpathSync(srcFile);\n var re = new RegExp(symlinkrealpath);\n if (re.test(sourcerealpath)) {\n return true;\n }\n }\n }\n return false;\n}\n\n//@\n//@ ### cp([options,] source [, source ...], dest)\n//@ ### cp([options,] source_array, dest)\n//@\n//@ Available options:\n//@\n//@ + `-f`: force (default behavior)\n//@ + `-n`: no-clobber\n//@ + `-u`: only copy if `source` is newer than `dest`\n//@ + `-r`, `-R`: recursive\n//@ + `-L`: follow symlinks\n//@ + `-P`: don't follow symlinks\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ cp('file1', 'dir1');\n//@ cp('-R', 'path/to/dir/', '~/newCopy/');\n//@ cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp');\n//@ cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above\n//@ ```\n//@\n//@ Copies files.\nfunction _cp(options, sources, dest) {\n // If we're missing -R, it actually implies -L (unless -P is explicit)\n if (options.followsymlink) {\n options.noFollowsymlink = false;\n }\n if (!options.recursive && !options.noFollowsymlink) {\n options.followsymlink = true;\n }\n\n // Get sources, dest\n if (arguments.length < 3) {\n common.error('missing and/or ');\n } else {\n sources = [].slice.call(arguments, 1, arguments.length - 1);\n dest = arguments[arguments.length - 1];\n }\n\n var destExists = fs.existsSync(dest);\n var destStat = destExists && common.statFollowLinks(dest);\n\n // Dest is not existing dir, but multiple sources given\n if ((!destExists || !destStat.isDirectory()) && sources.length > 1) {\n common.error('dest is not a directory (too many sources)');\n }\n\n // Dest is an existing file, but -n is given\n if (destExists && destStat.isFile() && options.no_force) {\n return new common.ShellString('', '', 0);\n }\n\n sources.forEach(function (src, srcIndex) {\n if (!fs.existsSync(src)) {\n if (src === '') src = \"''\"; // if src was empty string, display empty string\n common.error('no such file or directory: ' + src, { continue: true });\n return; // skip file\n }\n var srcStat = common.statFollowLinks(src);\n if (!options.noFollowsymlink && srcStat.isDirectory()) {\n if (!options.recursive) {\n // Non-Recursive\n common.error(\"omitting directory '\" + src + \"'\", { continue: true });\n } else {\n // Recursive\n // 'cp /a/source dest' should create 'source' in 'dest'\n var newDest = (destStat && destStat.isDirectory()) ?\n path.join(dest, path.basename(src)) :\n dest;\n\n try {\n common.statFollowLinks(path.dirname(dest));\n cpdirSyncRecursive(src, newDest, 0, { no_force: options.no_force, followsymlink: options.followsymlink });\n } catch (e) {\n /* istanbul ignore next */\n common.error(\"cannot create directory '\" + dest + \"': No such file or directory\");\n }\n }\n } else {\n // If here, src is a file\n\n // When copying to '/path/dir':\n // thisDest = '/path/dir/file1'\n var thisDest = dest;\n if (destStat && destStat.isDirectory()) {\n thisDest = path.normalize(dest + '/' + path.basename(src));\n }\n\n var thisDestExists = fs.existsSync(thisDest);\n if (thisDestExists && checkRecentCreated(sources, srcIndex)) {\n // cannot overwrite file created recently in current execution, but we want to continue copying other files\n if (!options.no_force) {\n common.error(\"will not overwrite just-created '\" + thisDest + \"' with '\" + src + \"'\", { continue: true });\n }\n return;\n }\n\n if (thisDestExists && options.no_force) {\n return; // skip file\n }\n\n if (path.relative(src, thisDest) === '') {\n // a file cannot be copied to itself, but we want to continue copying other files\n common.error(\"'\" + thisDest + \"' and '\" + src + \"' are the same file\", { continue: true });\n return;\n }\n\n copyFileSync(src, thisDest, options);\n }\n }); // forEach(src)\n\n return new common.ShellString('', common.state.error, common.state.errorCode);\n}\nmodule.exports = _cp;\n","var common = require('./common');\nvar _cd = require('./cd');\nvar path = require('path');\n\ncommon.register('dirs', _dirs, {\n wrapOutput: false,\n});\ncommon.register('pushd', _pushd, {\n wrapOutput: false,\n});\ncommon.register('popd', _popd, {\n wrapOutput: false,\n});\n\n// Pushd/popd/dirs internals\nvar _dirStack = [];\n\nfunction _isStackIndex(index) {\n return (/^[\\-+]\\d+$/).test(index);\n}\n\nfunction _parseStackIndex(index) {\n if (_isStackIndex(index)) {\n if (Math.abs(index) < _dirStack.length + 1) { // +1 for pwd\n return (/^-/).test(index) ? Number(index) - 1 : Number(index);\n }\n common.error(index + ': directory stack index out of range');\n } else {\n common.error(index + ': invalid number');\n }\n}\n\nfunction _actualDirStack() {\n return [process.cwd()].concat(_dirStack);\n}\n\n//@\n//@ ### pushd([options,] [dir | '-N' | '+N'])\n//@\n//@ Available options:\n//@\n//@ + `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated.\n//@ + `-q`: Supresses output to the console.\n//@\n//@ Arguments:\n//@\n//@ + `dir`: Sets the current working directory to the top of the stack, then executes the equivalent of `cd dir`.\n//@ + `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.\n//@ + `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ // process.cwd() === '/usr'\n//@ pushd('/etc'); // Returns /etc /usr\n//@ pushd('+1'); // Returns /usr /etc\n//@ ```\n//@\n//@ Save the current directory on the top of the directory stack and then `cd` to `dir`. With no arguments, `pushd` exchanges the top two directories. Returns an array of paths in the stack.\nfunction _pushd(options, dir) {\n if (_isStackIndex(options)) {\n dir = options;\n options = '';\n }\n\n options = common.parseOptions(options, {\n 'n': 'no-cd',\n 'q': 'quiet',\n });\n\n var dirs = _actualDirStack();\n\n if (dir === '+0') {\n return dirs; // +0 is a noop\n } else if (!dir) {\n if (dirs.length > 1) {\n dirs = dirs.splice(1, 1).concat(dirs);\n } else {\n return common.error('no other directory');\n }\n } else if (_isStackIndex(dir)) {\n var n = _parseStackIndex(dir);\n dirs = dirs.slice(n).concat(dirs.slice(0, n));\n } else {\n if (options['no-cd']) {\n dirs.splice(1, 0, dir);\n } else {\n dirs.unshift(dir);\n }\n }\n\n if (options['no-cd']) {\n dirs = dirs.slice(1);\n } else {\n dir = path.resolve(dirs.shift());\n _cd('', dir);\n }\n\n _dirStack = dirs;\n return _dirs(options.quiet ? '-q' : '');\n}\nexports.pushd = _pushd;\n\n//@\n//@\n//@ ### popd([options,] ['-N' | '+N'])\n//@\n//@ Available options:\n//@\n//@ + `-n`: Suppress the normal directory change when removing directories from the stack, so that only the stack is manipulated.\n//@ + `-q`: Supresses output to the console.\n//@\n//@ Arguments:\n//@\n//@ + `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.\n//@ + `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ echo(process.cwd()); // '/usr'\n//@ pushd('/etc'); // '/etc /usr'\n//@ echo(process.cwd()); // '/etc'\n//@ popd(); // '/usr'\n//@ echo(process.cwd()); // '/usr'\n//@ ```\n//@\n//@ When no arguments are given, `popd` removes the top directory from the stack and performs a `cd` to the new top directory. The elements are numbered from 0, starting at the first directory listed with dirs (i.e., `popd` is equivalent to `popd +0`). Returns an array of paths in the stack.\nfunction _popd(options, index) {\n if (_isStackIndex(options)) {\n index = options;\n options = '';\n }\n\n options = common.parseOptions(options, {\n 'n': 'no-cd',\n 'q': 'quiet',\n });\n\n if (!_dirStack.length) {\n return common.error('directory stack empty');\n }\n\n index = _parseStackIndex(index || '+0');\n\n if (options['no-cd'] || index > 0 || _dirStack.length + index === 0) {\n index = index > 0 ? index - 1 : index;\n _dirStack.splice(index, 1);\n } else {\n var dir = path.resolve(_dirStack.shift());\n _cd('', dir);\n }\n\n return _dirs(options.quiet ? '-q' : '');\n}\nexports.popd = _popd;\n\n//@\n//@\n//@ ### dirs([options | '+N' | '-N'])\n//@\n//@ Available options:\n//@\n//@ + `-c`: Clears the directory stack by deleting all of the elements.\n//@ + `-q`: Supresses output to the console.\n//@\n//@ Arguments:\n//@\n//@ + `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.\n//@ + `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.\n//@\n//@ Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if `+N` or `-N` was specified.\n//@\n//@ See also: `pushd`, `popd`\nfunction _dirs(options, index) {\n if (_isStackIndex(options)) {\n index = options;\n options = '';\n }\n\n options = common.parseOptions(options, {\n 'c': 'clear',\n 'q': 'quiet',\n });\n\n if (options.clear) {\n _dirStack = [];\n return _dirStack;\n }\n\n var stack = _actualDirStack();\n\n if (index) {\n index = _parseStackIndex(index);\n\n if (index < 0) {\n index = stack.length + index;\n }\n\n if (!options.quiet) {\n common.log(stack[index]);\n }\n return stack[index];\n }\n\n if (!options.quiet) {\n common.log(stack.join(' '));\n }\n\n return stack;\n}\nexports.dirs = _dirs;\n","var format = require('util').format;\n\nvar common = require('./common');\n\ncommon.register('echo', _echo, {\n allowGlobbing: false,\n});\n\n//@\n//@ ### echo([options,] string [, string ...])\n//@\n//@ Available options:\n//@\n//@ + `-e`: interpret backslash escapes (default)\n//@ + `-n`: remove trailing newline from output\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ echo('hello world');\n//@ var str = echo('hello world');\n//@ echo('-n', 'no newline at end');\n//@ ```\n//@\n//@ Prints `string` to stdout, and returns string with additional utility methods\n//@ like `.to()`.\nfunction _echo(opts) {\n // allow strings starting with '-', see issue #20\n var messages = [].slice.call(arguments, opts ? 0 : 1);\n var options = {};\n\n // If the first argument starts with '-', parse it as options string.\n // If parseOptions throws, it wasn't an options string.\n try {\n options = common.parseOptions(messages[0], {\n 'e': 'escapes',\n 'n': 'no_newline',\n }, {\n silent: true,\n });\n\n // Allow null to be echoed\n if (messages[0]) {\n messages.shift();\n }\n } catch (_) {\n // Clear out error if an error occurred\n common.state.error = null;\n }\n\n var output = format.apply(null, messages);\n\n // Add newline if -n is not passed.\n if (!options.no_newline) {\n output += '\\n';\n }\n\n process.stdout.write(output);\n\n return output;\n}\n\nmodule.exports = _echo;\n","var common = require('./common');\n\n//@\n//@ ### error()\n//@\n//@ Tests if error occurred in the last command. Returns a truthy value if an\n//@ error returned, or a falsy value otherwise.\n//@\n//@ **Note**: do not rely on the\n//@ return value to be an error message. If you need the last error message, use\n//@ the `.stderr` attribute from the last command's return value instead.\nfunction error() {\n return common.state.error;\n}\nmodule.exports = error;\n",null,null,"var path = require('path');\nvar common = require('./common');\nvar _ls = require('./ls');\n\ncommon.register('find', _find, {});\n\n//@\n//@ ### find(path [, path ...])\n//@ ### find(path_array)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ find('src', 'lib');\n//@ find(['src', 'lib']); // same as above\n//@ find('.').filter(function(file) { return file.match(/\\.js$/); });\n//@ ```\n//@\n//@ Returns array of all files (however deep) in the given paths.\n//@\n//@ The main difference from `ls('-R', path)` is that the resulting file names\n//@ include the base directories (e.g., `lib/resources/file1` instead of just `file1`).\nfunction _find(options, paths) {\n if (!paths) {\n common.error('no path specified');\n } else if (typeof paths === 'string') {\n paths = [].slice.call(arguments, 1);\n }\n\n var list = [];\n\n function pushFile(file) {\n if (process.platform === 'win32') {\n file = file.replace(/\\\\/g, '/');\n }\n list.push(file);\n }\n\n // why not simply do `ls('-R', paths)`? because the output wouldn't give the base dirs\n // to get the base dir in the output, we need instead `ls('-R', 'dir/*')` for every directory\n\n paths.forEach(function (file) {\n var stat;\n try {\n stat = common.statFollowLinks(file);\n } catch (e) {\n common.error('no such file or directory: ' + file);\n }\n\n pushFile(file);\n\n if (stat.isDirectory()) {\n _ls({ recursive: true, all: true }, file).forEach(function (subfile) {\n pushFile(path.join(file, subfile));\n });\n }\n });\n\n return list;\n}\nmodule.exports = _find;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('grep', _grep, {\n globStart: 2, // don't glob-expand the regex\n canReceivePipe: true,\n cmdOptions: {\n 'v': 'inverse',\n 'l': 'nameOnly',\n 'i': 'ignoreCase',\n },\n});\n\n//@\n//@ ### grep([options,] regex_filter, file [, file ...])\n//@ ### grep([options,] regex_filter, file_array)\n//@\n//@ Available options:\n//@\n//@ + `-v`: Invert `regex_filter` (only print non-matching lines).\n//@ + `-l`: Print only filenames of matching files.\n//@ + `-i`: Ignore case.\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ grep('-v', 'GLOBAL_VARIABLE', '*.js');\n//@ grep('GLOBAL_VARIABLE', '*.js');\n//@ ```\n//@\n//@ Reads input string from given files and returns a string containing all lines of the\n//@ file that match the given `regex_filter`.\nfunction _grep(options, regex, files) {\n // Check if this is coming from a pipe\n var pipe = common.readFromPipe();\n\n if (!files && !pipe) common.error('no paths given', 2);\n\n files = [].slice.call(arguments, 2);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var grep = [];\n if (options.ignoreCase) {\n regex = new RegExp(regex, 'i');\n }\n files.forEach(function (file) {\n if (!fs.existsSync(file) && file !== '-') {\n common.error('no such file or directory: ' + file, 2, { continue: true });\n return;\n }\n\n var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');\n if (options.nameOnly) {\n if (contents.match(regex)) {\n grep.push(file);\n }\n } else {\n var lines = contents.split('\\n');\n lines.forEach(function (line) {\n var matched = line.match(regex);\n if ((options.inverse && !matched) || (!options.inverse && matched)) {\n grep.push(line);\n }\n });\n }\n });\n\n return grep.join('\\n') + '\\n';\n}\nmodule.exports = _grep;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('head', _head, {\n canReceivePipe: true,\n cmdOptions: {\n 'n': 'numLines',\n },\n});\n\n// Reads |numLines| lines or the entire file, whichever is less.\nfunction readSomeLines(file, numLines) {\n var buf = common.buffer();\n var bufLength = buf.length;\n var bytesRead = bufLength;\n var pos = 0;\n\n var fdr = fs.openSync(file, 'r');\n var numLinesRead = 0;\n var ret = '';\n while (bytesRead === bufLength && numLinesRead < numLines) {\n bytesRead = fs.readSync(fdr, buf, 0, bufLength, pos);\n var bufStr = buf.toString('utf8', 0, bytesRead);\n numLinesRead += bufStr.split('\\n').length - 1;\n ret += bufStr;\n pos += bytesRead;\n }\n\n fs.closeSync(fdr);\n return ret;\n}\n\n//@\n//@ ### head([{'-n': \\},] file [, file ...])\n//@ ### head([{'-n': \\},] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-n `: Show the first `` lines of the files\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var str = head({'-n': 1}, 'file*.txt');\n//@ var str = head('file1', 'file2');\n//@ var str = head(['file1', 'file2']); // same as above\n//@ ```\n//@\n//@ Read the start of a file.\nfunction _head(options, files) {\n var head = [];\n var pipe = common.readFromPipe();\n\n if (!files && !pipe) common.error('no paths given');\n\n var idx = 1;\n if (options.numLines === true) {\n idx = 2;\n options.numLines = Number(arguments[1]);\n } else if (options.numLines === false) {\n options.numLines = 10;\n }\n files = [].slice.call(arguments, idx);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var shouldAppendNewline = false;\n files.forEach(function (file) {\n if (file !== '-') {\n if (!fs.existsSync(file)) {\n common.error('no such file or directory: ' + file, { continue: true });\n return;\n } else if (common.statFollowLinks(file).isDirectory()) {\n common.error(\"error reading '\" + file + \"': Is a directory\", {\n continue: true,\n });\n return;\n }\n }\n\n var contents;\n if (file === '-') {\n contents = pipe;\n } else if (options.numLines < 0) {\n contents = fs.readFileSync(file, 'utf8');\n } else {\n contents = readSomeLines(file, options.numLines);\n }\n\n var lines = contents.split('\\n');\n var hasTrailingNewline = (lines[lines.length - 1] === '');\n if (hasTrailingNewline) {\n lines.pop();\n }\n shouldAppendNewline = (hasTrailingNewline || options.numLines < lines.length);\n\n head = head.concat(lines.slice(0, options.numLines));\n });\n\n if (shouldAppendNewline) {\n head.push(''); // to add a trailing newline once we join\n }\n return head.join('\\n');\n}\nmodule.exports = _head;\n","var fs = require('fs');\nvar path = require('path');\nvar common = require('./common');\n\ncommon.register('ln', _ln, {\n cmdOptions: {\n 's': 'symlink',\n 'f': 'force',\n },\n});\n\n//@\n//@ ### ln([options,] source, dest)\n//@\n//@ Available options:\n//@\n//@ + `-s`: symlink\n//@ + `-f`: force\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ ln('file', 'newlink');\n//@ ln('-sf', 'file', 'existing');\n//@ ```\n//@\n//@ Links `source` to `dest`. Use `-f` to force the link, should `dest` already exist.\nfunction _ln(options, source, dest) {\n if (!source || !dest) {\n common.error('Missing and/or ');\n }\n\n source = String(source);\n var sourcePath = path.normalize(source).replace(RegExp(path.sep + '$'), '');\n var isAbsolute = (path.resolve(source) === sourcePath);\n dest = path.resolve(process.cwd(), String(dest));\n\n if (fs.existsSync(dest)) {\n if (!options.force) {\n common.error('Destination file exists', { continue: true });\n }\n\n fs.unlinkSync(dest);\n }\n\n if (options.symlink) {\n var isWindows = process.platform === 'win32';\n var linkType = isWindows ? 'file' : null;\n var resolvedSourcePath = isAbsolute ? sourcePath : path.resolve(process.cwd(), path.dirname(dest), source);\n if (!fs.existsSync(resolvedSourcePath)) {\n common.error('Source file does not exist', { continue: true });\n } else if (isWindows && common.statFollowLinks(resolvedSourcePath).isDirectory()) {\n linkType = 'junction';\n }\n\n try {\n fs.symlinkSync(linkType === 'junction' ? resolvedSourcePath : source, dest, linkType);\n } catch (err) {\n common.error(err.message);\n }\n } else {\n if (!fs.existsSync(source)) {\n common.error('Source file does not exist', { continue: true });\n }\n try {\n fs.linkSync(source, dest);\n } catch (err) {\n common.error(err.message);\n }\n }\n return '';\n}\nmodule.exports = _ln;\n","var path = require('path');\nvar fs = require('fs');\nvar common = require('./common');\nvar glob = require('glob');\n\nvar globPatternRecursive = path.sep + '**';\n\ncommon.register('ls', _ls, {\n cmdOptions: {\n 'R': 'recursive',\n 'A': 'all',\n 'L': 'link',\n 'a': 'all_deprecated',\n 'd': 'directory',\n 'l': 'long',\n },\n});\n\n//@\n//@ ### ls([options,] [path, ...])\n//@ ### ls([options,] path_array)\n//@\n//@ Available options:\n//@\n//@ + `-R`: recursive\n//@ + `-A`: all files (include files beginning with `.`, except for `.` and `..`)\n//@ + `-L`: follow symlinks\n//@ + `-d`: list directories themselves, not their contents\n//@ + `-l`: list objects representing each file, each with fields containing `ls\n//@ -l` output fields. See\n//@ [`fs.Stats`](https://nodejs.org/api/fs.html#fs_class_fs_stats)\n//@ for more info\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ ls('projs/*.js');\n//@ ls('-R', '/users/me', '/tmp');\n//@ ls('-R', ['/users/me', '/tmp']); // same as above\n//@ ls('-l', 'file.txt'); // { name: 'file.txt', mode: 33188, nlink: 1, ...}\n//@ ```\n//@\n//@ Returns array of files in the given `path`, or files in\n//@ the current directory if no `path` is provided.\nfunction _ls(options, paths) {\n if (options.all_deprecated) {\n // We won't support the -a option as it's hard to image why it's useful\n // (it includes '.' and '..' in addition to '.*' files)\n // For backwards compatibility we'll dump a deprecated message and proceed as before\n common.log('ls: Option -a is deprecated. Use -A instead');\n options.all = true;\n }\n\n if (!paths) {\n paths = ['.'];\n } else {\n paths = [].slice.call(arguments, 1);\n }\n\n var list = [];\n\n function pushFile(abs, relName, stat) {\n if (process.platform === 'win32') {\n relName = relName.replace(/\\\\/g, '/');\n }\n if (options.long) {\n stat = stat || (options.link ? common.statFollowLinks(abs) : common.statNoFollowLinks(abs));\n list.push(addLsAttributes(relName, stat));\n } else {\n // list.push(path.relative(rel || '.', file));\n list.push(relName);\n }\n }\n\n paths.forEach(function (p) {\n var stat;\n\n try {\n stat = options.link ? common.statFollowLinks(p) : common.statNoFollowLinks(p);\n // follow links to directories by default\n if (stat.isSymbolicLink()) {\n /* istanbul ignore next */\n // workaround for https://github.com/shelljs/shelljs/issues/795\n // codecov seems to have a bug that miscalculate this block as uncovered.\n // but according to nyc report this block does get covered.\n try {\n var _stat = common.statFollowLinks(p);\n if (_stat.isDirectory()) {\n stat = _stat;\n }\n } catch (_) {} // bad symlink, treat it like a file\n }\n } catch (e) {\n common.error('no such file or directory: ' + p, 2, { continue: true });\n return;\n }\n\n // If the stat succeeded\n if (stat.isDirectory() && !options.directory) {\n if (options.recursive) {\n // use glob, because it's simple\n glob.sync(p + globPatternRecursive, { dot: options.all, follow: options.link })\n .forEach(function (item) {\n // Glob pattern returns the directory itself and needs to be filtered out.\n if (path.relative(p, item)) {\n pushFile(item, path.relative(p, item));\n }\n });\n } else if (options.all) {\n // use fs.readdirSync, because it's fast\n fs.readdirSync(p).forEach(function (item) {\n pushFile(path.join(p, item), item);\n });\n } else {\n // use fs.readdirSync and then filter out secret files\n fs.readdirSync(p).forEach(function (item) {\n if (item[0] !== '.') {\n pushFile(path.join(p, item), item);\n }\n });\n }\n } else {\n pushFile(p, p, stat);\n }\n });\n\n // Add methods, to make this more compatible with ShellStrings\n return list;\n}\n\nfunction addLsAttributes(pathName, stats) {\n // Note: this object will contain more information than .toString() returns\n stats.name = pathName;\n stats.toString = function () {\n // Return a string resembling unix's `ls -l` format\n return [this.mode, this.nlink, this.uid, this.gid, this.size, this.mtime, this.name].join(' ');\n };\n return stats;\n}\n\nmodule.exports = _ls;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\ncommon.register('mkdir', _mkdir, {\n cmdOptions: {\n 'p': 'fullpath',\n },\n});\n\n// Recursively creates `dir`\nfunction mkdirSyncRecursive(dir) {\n var baseDir = path.dirname(dir);\n\n // Prevents some potential problems arising from malformed UNCs or\n // insufficient permissions.\n /* istanbul ignore next */\n if (baseDir === dir) {\n common.error('dirname() failed: [' + dir + ']');\n }\n\n // Base dir exists, no recursion necessary\n if (fs.existsSync(baseDir)) {\n fs.mkdirSync(dir, parseInt('0777', 8));\n return;\n }\n\n // Base dir does not exist, go recursive\n mkdirSyncRecursive(baseDir);\n\n // Base dir created, can create dir\n fs.mkdirSync(dir, parseInt('0777', 8));\n}\n\n//@\n//@ ### mkdir([options,] dir [, dir ...])\n//@ ### mkdir([options,] dir_array)\n//@\n//@ Available options:\n//@\n//@ + `-p`: full path (and create intermediate directories, if necessary)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g');\n//@ mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above\n//@ ```\n//@\n//@ Creates directories.\nfunction _mkdir(options, dirs) {\n if (!dirs) common.error('no paths given');\n\n if (typeof dirs === 'string') {\n dirs = [].slice.call(arguments, 1);\n }\n // if it's array leave it as it is\n\n dirs.forEach(function (dir) {\n try {\n var stat = common.statNoFollowLinks(dir);\n if (!options.fullpath) {\n common.error('path already exists: ' + dir, { continue: true });\n } else if (stat.isFile()) {\n common.error('cannot create directory ' + dir + ': File exists', { continue: true });\n }\n return; // skip dir\n } catch (e) {\n // do nothing\n }\n\n // Base dir does not exist, and no -p option given\n var baseDir = path.dirname(dir);\n if (!fs.existsSync(baseDir) && !options.fullpath) {\n common.error('no such file or directory: ' + baseDir, { continue: true });\n return; // skip dir\n }\n\n try {\n if (options.fullpath) {\n mkdirSyncRecursive(path.resolve(dir));\n } else {\n fs.mkdirSync(dir, parseInt('0777', 8));\n }\n } catch (e) {\n var reason;\n if (e.code === 'EACCES') {\n reason = 'Permission denied';\n } else if (e.code === 'ENOTDIR' || e.code === 'ENOENT') {\n reason = 'Not a directory';\n } else {\n /* istanbul ignore next */\n throw e;\n }\n common.error('cannot create directory ' + dir + ': ' + reason, { continue: true });\n }\n });\n return '';\n} // mkdir\nmodule.exports = _mkdir;\n","var fs = require('fs');\nvar path = require('path');\nvar common = require('./common');\nvar cp = require('./cp');\nvar rm = require('./rm');\n\ncommon.register('mv', _mv, {\n cmdOptions: {\n 'f': '!no_force',\n 'n': 'no_force',\n },\n});\n\n// Checks if cureent file was created recently\nfunction checkRecentCreated(sources, index) {\n var lookedSource = sources[index];\n return sources.slice(0, index).some(function (src) {\n return path.basename(src) === path.basename(lookedSource);\n });\n}\n\n//@\n//@ ### mv([options ,] source [, source ...], dest')\n//@ ### mv([options ,] source_array, dest')\n//@\n//@ Available options:\n//@\n//@ + `-f`: force (default behavior)\n//@ + `-n`: no-clobber\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ mv('-n', 'file', 'dir/');\n//@ mv('file1', 'file2', 'dir/');\n//@ mv(['file1', 'file2'], 'dir/'); // same as above\n//@ ```\n//@\n//@ Moves `source` file(s) to `dest`.\nfunction _mv(options, sources, dest) {\n // Get sources, dest\n if (arguments.length < 3) {\n common.error('missing and/or ');\n } else if (arguments.length > 3) {\n sources = [].slice.call(arguments, 1, arguments.length - 1);\n dest = arguments[arguments.length - 1];\n } else if (typeof sources === 'string') {\n sources = [sources];\n } else {\n // TODO(nate): figure out if we actually need this line\n common.error('invalid arguments');\n }\n\n var exists = fs.existsSync(dest);\n var stats = exists && common.statFollowLinks(dest);\n\n // Dest is not existing dir, but multiple sources given\n if ((!exists || !stats.isDirectory()) && sources.length > 1) {\n common.error('dest is not a directory (too many sources)');\n }\n\n // Dest is an existing file, but no -f given\n if (exists && stats.isFile() && options.no_force) {\n common.error('dest file already exists: ' + dest);\n }\n\n sources.forEach(function (src, srcIndex) {\n if (!fs.existsSync(src)) {\n common.error('no such file or directory: ' + src, { continue: true });\n return; // skip file\n }\n\n // If here, src exists\n\n // When copying to '/path/dir':\n // thisDest = '/path/dir/file1'\n var thisDest = dest;\n if (fs.existsSync(dest) && common.statFollowLinks(dest).isDirectory()) {\n thisDest = path.normalize(dest + '/' + path.basename(src));\n }\n\n var thisDestExists = fs.existsSync(thisDest);\n\n if (thisDestExists && checkRecentCreated(sources, srcIndex)) {\n // cannot overwrite file created recently in current execution, but we want to continue copying other files\n if (!options.no_force) {\n common.error(\"will not overwrite just-created '\" + thisDest + \"' with '\" + src + \"'\", { continue: true });\n }\n return;\n }\n\n if (fs.existsSync(thisDest) && options.no_force) {\n common.error('dest file already exists: ' + thisDest, { continue: true });\n return; // skip file\n }\n\n if (path.resolve(src) === path.dirname(path.resolve(thisDest))) {\n common.error('cannot move to self: ' + src, { continue: true });\n return; // skip file\n }\n\n try {\n fs.renameSync(src, thisDest);\n } catch (e) {\n /* istanbul ignore next */\n if (e.code === 'EXDEV') {\n // If we're trying to `mv` to an external partition, we'll actually need\n // to perform a copy and then clean up the original file. If either the\n // copy or the rm fails with an exception, we should allow this\n // exception to pass up to the top level.\n cp('-r', src, thisDest);\n rm('-rf', src);\n }\n }\n }); // forEach(src)\n return '';\n} // mv\nmodule.exports = _mv;\n","// see dirs.js\n","// see dirs.js\n","var path = require('path');\nvar common = require('./common');\n\ncommon.register('pwd', _pwd, {\n allowGlobbing: false,\n});\n\n//@\n//@ ### pwd()\n//@\n//@ Returns the current directory.\nfunction _pwd() {\n var pwd = path.resolve(process.cwd());\n return pwd;\n}\nmodule.exports = _pwd;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('rm', _rm, {\n cmdOptions: {\n 'f': 'force',\n 'r': 'recursive',\n 'R': 'recursive',\n },\n});\n\n// Recursively removes 'dir'\n// Adapted from https://github.com/ryanmcgrath/wrench-js\n//\n// Copyright (c) 2010 Ryan McGrath\n// Copyright (c) 2012 Artur Adib\n//\n// Licensed under the MIT License\n// http://www.opensource.org/licenses/mit-license.php\nfunction rmdirSyncRecursive(dir, force, fromSymlink) {\n var files;\n\n files = fs.readdirSync(dir);\n\n // Loop through and delete everything in the sub-tree after checking it\n for (var i = 0; i < files.length; i++) {\n var file = dir + '/' + files[i];\n var currFile = common.statNoFollowLinks(file);\n\n if (currFile.isDirectory()) { // Recursive function back to the beginning\n rmdirSyncRecursive(file, force);\n } else { // Assume it's a file - perhaps a try/catch belongs here?\n if (force || isWriteable(file)) {\n try {\n common.unlinkSync(file);\n } catch (e) {\n /* istanbul ignore next */\n common.error('could not remove file (code ' + e.code + '): ' + file, {\n continue: true,\n });\n }\n }\n }\n }\n\n // if was directory was referenced through a symbolic link,\n // the contents should be removed, but not the directory itself\n if (fromSymlink) return;\n\n // Now that we know everything in the sub-tree has been deleted, we can delete the main directory.\n // Huzzah for the shopkeep.\n\n var result;\n try {\n // Retry on windows, sometimes it takes a little time before all the files in the directory are gone\n var start = Date.now();\n\n // TODO: replace this with a finite loop\n for (;;) {\n try {\n result = fs.rmdirSync(dir);\n if (fs.existsSync(dir)) throw { code: 'EAGAIN' };\n break;\n } catch (er) {\n /* istanbul ignore next */\n // In addition to error codes, also check if the directory still exists and loop again if true\n if (process.platform === 'win32' && (er.code === 'ENOTEMPTY' || er.code === 'EBUSY' || er.code === 'EPERM' || er.code === 'EAGAIN')) {\n if (Date.now() - start > 1000) throw er;\n } else if (er.code === 'ENOENT') {\n // Directory did not exist, deletion was successful\n break;\n } else {\n throw er;\n }\n }\n }\n } catch (e) {\n common.error('could not remove directory (code ' + e.code + '): ' + dir, { continue: true });\n }\n\n return result;\n} // rmdirSyncRecursive\n\n// Hack to determine if file has write permissions for current user\n// Avoids having to check user, group, etc, but it's probably slow\nfunction isWriteable(file) {\n var writePermission = true;\n try {\n var __fd = fs.openSync(file, 'a');\n fs.closeSync(__fd);\n } catch (e) {\n writePermission = false;\n }\n\n return writePermission;\n}\n\nfunction handleFile(file, options) {\n if (options.force || isWriteable(file)) {\n // -f was passed, or file is writable, so it can be removed\n common.unlinkSync(file);\n } else {\n common.error('permission denied: ' + file, { continue: true });\n }\n}\n\nfunction handleDirectory(file, options) {\n if (options.recursive) {\n // -r was passed, so directory can be removed\n rmdirSyncRecursive(file, options.force);\n } else {\n common.error('path is a directory', { continue: true });\n }\n}\n\nfunction handleSymbolicLink(file, options) {\n var stats;\n try {\n stats = common.statFollowLinks(file);\n } catch (e) {\n // symlink is broken, so remove the symlink itself\n common.unlinkSync(file);\n return;\n }\n\n if (stats.isFile()) {\n common.unlinkSync(file);\n } else if (stats.isDirectory()) {\n if (file[file.length - 1] === '/') {\n // trailing separator, so remove the contents, not the link\n if (options.recursive) {\n // -r was passed, so directory can be removed\n var fromSymlink = true;\n rmdirSyncRecursive(file, options.force, fromSymlink);\n } else {\n common.error('path is a directory', { continue: true });\n }\n } else {\n // no trailing separator, so remove the link\n common.unlinkSync(file);\n }\n }\n}\n\nfunction handleFIFO(file) {\n common.unlinkSync(file);\n}\n\n//@\n//@ ### rm([options,] file [, file ...])\n//@ ### rm([options,] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-f`: force\n//@ + `-r, -R`: recursive\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ rm('-rf', '/tmp/*');\n//@ rm('some_file.txt', 'another_file.txt');\n//@ rm(['some_file.txt', 'another_file.txt']); // same as above\n//@ ```\n//@\n//@ Removes files.\nfunction _rm(options, files) {\n if (!files) common.error('no paths given');\n\n // Convert to array\n files = [].slice.call(arguments, 1);\n\n files.forEach(function (file) {\n var lstats;\n try {\n var filepath = (file[file.length - 1] === '/')\n ? file.slice(0, -1) // remove the '/' so lstatSync can detect symlinks\n : file;\n lstats = common.statNoFollowLinks(filepath); // test for existence\n } catch (e) {\n // Path does not exist, no force flag given\n if (!options.force) {\n common.error('no such file or directory: ' + file, { continue: true });\n }\n return; // skip file\n }\n\n // If here, path exists\n if (lstats.isFile()) {\n handleFile(file, options);\n } else if (lstats.isDirectory()) {\n handleDirectory(file, options);\n } else if (lstats.isSymbolicLink()) {\n handleSymbolicLink(file, options);\n } else if (lstats.isFIFO()) {\n handleFIFO(file);\n }\n }); // forEach(file)\n return '';\n} // rm\nmodule.exports = _rm;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('sed', _sed, {\n globStart: 3, // don't glob-expand regexes\n canReceivePipe: true,\n cmdOptions: {\n 'i': 'inplace',\n },\n});\n\n//@\n//@ ### sed([options,] search_regex, replacement, file [, file ...])\n//@ ### sed([options,] search_regex, replacement, file_array)\n//@\n//@ Available options:\n//@\n//@ + `-i`: Replace contents of `file` in-place. _Note that no backups will be created!_\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');\n//@ sed(/.*DELETE_THIS_LINE.*\\n/, '', 'source.js');\n//@ ```\n//@\n//@ Reads an input string from `file`s, and performs a JavaScript `replace()` on the input\n//@ using the given `search_regex` and `replacement` string or function. Returns the new string after replacement.\n//@\n//@ Note:\n//@\n//@ Like unix `sed`, ShellJS `sed` supports capture groups. Capture groups are specified\n//@ using the `$n` syntax:\n//@\n//@ ```javascript\n//@ sed(/(\\w+)\\s(\\w+)/, '$2, $1', 'file.txt');\n//@ ```\nfunction _sed(options, regex, replacement, files) {\n // Check if this is coming from a pipe\n var pipe = common.readFromPipe();\n\n if (typeof replacement !== 'string' && typeof replacement !== 'function') {\n if (typeof replacement === 'number') {\n replacement = replacement.toString(); // fallback\n } else {\n common.error('invalid replacement string');\n }\n }\n\n // Convert all search strings to RegExp\n if (typeof regex === 'string') {\n regex = RegExp(regex);\n }\n\n if (!files && !pipe) {\n common.error('no files given');\n }\n\n files = [].slice.call(arguments, 3);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var sed = [];\n files.forEach(function (file) {\n if (!fs.existsSync(file) && file !== '-') {\n common.error('no such file or directory: ' + file, 2, { continue: true });\n return;\n }\n\n var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');\n var lines = contents.split('\\n');\n var result = lines.map(function (line) {\n return line.replace(regex, replacement);\n }).join('\\n');\n\n sed.push(result);\n\n if (options.inplace) {\n fs.writeFileSync(file, result, 'utf8');\n }\n });\n\n return sed.join('\\n');\n}\nmodule.exports = _sed;\n","var common = require('./common');\n\ncommon.register('set', _set, {\n allowGlobbing: false,\n wrapOutput: false,\n});\n\n//@\n//@ ### set(options)\n//@\n//@ Available options:\n//@\n//@ + `+/-e`: exit upon error (`config.fatal`)\n//@ + `+/-v`: verbose: show all commands (`config.verbose`)\n//@ + `+/-f`: disable filename expansion (globbing)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ set('-e'); // exit upon first error\n//@ set('+e'); // this undoes a \"set('-e')\"\n//@ ```\n//@\n//@ Sets global configuration variables.\nfunction _set(options) {\n if (!options) {\n var args = [].slice.call(arguments, 0);\n if (args.length < 2) common.error('must provide an argument');\n options = args[1];\n }\n var negate = (options[0] === '+');\n if (negate) {\n options = '-' + options.slice(1); // parseOptions needs a '-' prefix\n }\n options = common.parseOptions(options, {\n 'e': 'fatal',\n 'v': 'verbose',\n 'f': 'noglob',\n });\n\n if (negate) {\n Object.keys(options).forEach(function (key) {\n options[key] = !options[key];\n });\n }\n\n Object.keys(options).forEach(function (key) {\n // Only change the global config if `negate` is false and the option is true\n // or if `negate` is true and the option is false (aka negate !== option)\n if (negate !== options[key]) {\n common.config[key] = options[key];\n }\n });\n return;\n}\nmodule.exports = _set;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('sort', _sort, {\n canReceivePipe: true,\n cmdOptions: {\n 'r': 'reverse',\n 'n': 'numerical',\n },\n});\n\n// parse out the number prefix of a line\nfunction parseNumber(str) {\n var match = str.match(/^\\s*(\\d*)\\s*(.*)$/);\n return { num: Number(match[1]), value: match[2] };\n}\n\n// compare two strings case-insensitively, but examine case for strings that are\n// case-insensitive equivalent\nfunction unixCmp(a, b) {\n var aLower = a.toLowerCase();\n var bLower = b.toLowerCase();\n return (aLower === bLower ?\n -1 * a.localeCompare(b) : // unix sort treats case opposite how javascript does\n aLower.localeCompare(bLower));\n}\n\n// compare two strings in the fashion that unix sort's -n option works\nfunction numericalCmp(a, b) {\n var objA = parseNumber(a);\n var objB = parseNumber(b);\n if (objA.hasOwnProperty('num') && objB.hasOwnProperty('num')) {\n return ((objA.num !== objB.num) ?\n (objA.num - objB.num) :\n unixCmp(objA.value, objB.value));\n } else {\n return unixCmp(objA.value, objB.value);\n }\n}\n\n//@\n//@ ### sort([options,] file [, file ...])\n//@ ### sort([options,] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-r`: Reverse the results\n//@ + `-n`: Compare according to numerical value\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ sort('foo.txt', 'bar.txt');\n//@ sort('-r', 'foo.txt');\n//@ ```\n//@\n//@ Return the contents of the `file`s, sorted line-by-line. Sorting multiple\n//@ files mixes their content (just as unix `sort` does).\nfunction _sort(options, files) {\n // Check if this is coming from a pipe\n var pipe = common.readFromPipe();\n\n if (!files && !pipe) common.error('no files given');\n\n files = [].slice.call(arguments, 1);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var lines = files.reduce(function (accum, file) {\n if (file !== '-') {\n if (!fs.existsSync(file)) {\n common.error('no such file or directory: ' + file, { continue: true });\n return accum;\n } else if (common.statFollowLinks(file).isDirectory()) {\n common.error('read failed: ' + file + ': Is a directory', {\n continue: true,\n });\n return accum;\n }\n }\n\n var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');\n return accum.concat(contents.trimRight().split('\\n'));\n }, []);\n\n var sorted = lines.sort(options.numerical ? numericalCmp : unixCmp);\n\n if (options.reverse) {\n sorted = sorted.reverse();\n }\n\n return sorted.join('\\n') + '\\n';\n}\n\nmodule.exports = _sort;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('tail', _tail, {\n canReceivePipe: true,\n cmdOptions: {\n 'n': 'numLines',\n },\n});\n\n//@\n//@ ### tail([{'-n': \\},] file [, file ...])\n//@ ### tail([{'-n': \\},] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-n `: Show the last `` lines of `file`s\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var str = tail({'-n': 1}, 'file*.txt');\n//@ var str = tail('file1', 'file2');\n//@ var str = tail(['file1', 'file2']); // same as above\n//@ ```\n//@\n//@ Read the end of a `file`.\nfunction _tail(options, files) {\n var tail = [];\n var pipe = common.readFromPipe();\n\n if (!files && !pipe) common.error('no paths given');\n\n var idx = 1;\n if (options.numLines === true) {\n idx = 2;\n options.numLines = Number(arguments[1]);\n } else if (options.numLines === false) {\n options.numLines = 10;\n }\n options.numLines = -1 * Math.abs(options.numLines);\n files = [].slice.call(arguments, idx);\n\n if (pipe) {\n files.unshift('-');\n }\n\n var shouldAppendNewline = false;\n files.forEach(function (file) {\n if (file !== '-') {\n if (!fs.existsSync(file)) {\n common.error('no such file or directory: ' + file, { continue: true });\n return;\n } else if (common.statFollowLinks(file).isDirectory()) {\n common.error(\"error reading '\" + file + \"': Is a directory\", {\n continue: true,\n });\n return;\n }\n }\n\n var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8');\n\n var lines = contents.split('\\n');\n if (lines[lines.length - 1] === '') {\n lines.pop();\n shouldAppendNewline = true;\n } else {\n shouldAppendNewline = false;\n }\n\n tail = tail.concat(lines.slice(options.numLines));\n });\n\n if (shouldAppendNewline) {\n tail.push(''); // to add a trailing newline once we join\n }\n return tail.join('\\n');\n}\nmodule.exports = _tail;\n","var common = require('./common');\nvar os = require('os');\nvar fs = require('fs');\n\ncommon.register('tempdir', _tempDir, {\n allowGlobbing: false,\n wrapOutput: false,\n});\n\n// Returns false if 'dir' is not a writeable directory, 'dir' otherwise\nfunction writeableDir(dir) {\n if (!dir || !fs.existsSync(dir)) return false;\n\n if (!common.statFollowLinks(dir).isDirectory()) return false;\n\n var testFile = dir + '/' + common.randomFileName();\n try {\n fs.writeFileSync(testFile, ' ');\n common.unlinkSync(testFile);\n return dir;\n } catch (e) {\n /* istanbul ignore next */\n return false;\n }\n}\n\n// Variable to cache the tempdir value for successive lookups.\nvar cachedTempDir;\n\n//@\n//@ ### tempdir()\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var tmp = tempdir(); // \"/tmp\" for most *nix platforms\n//@ ```\n//@\n//@ Searches and returns string containing a writeable, platform-dependent temporary directory.\n//@ Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir).\nfunction _tempDir() {\n if (cachedTempDir) return cachedTempDir;\n\n cachedTempDir = writeableDir(os.tmpdir()) ||\n writeableDir(process.env.TMPDIR) ||\n writeableDir(process.env.TEMP) ||\n writeableDir(process.env.TMP) ||\n writeableDir(process.env.Wimp$ScrapDir) || // RiscOS\n writeableDir('C:\\\\TEMP') || // Windows\n writeableDir('C:\\\\TMP') || // Windows\n writeableDir('\\\\TEMP') || // Windows\n writeableDir('\\\\TMP') || // Windows\n writeableDir('/tmp') ||\n writeableDir('/var/tmp') ||\n writeableDir('/usr/tmp') ||\n writeableDir('.'); // last resort\n\n return cachedTempDir;\n}\n\n// Indicates if the tempdir value is currently cached. This is exposed for tests\n// only. The return value should only be tested for truthiness.\nfunction isCached() {\n return cachedTempDir;\n}\n\n// Clears the cached tempDir value, if one is cached. This is exposed for tests\n// only.\nfunction clearCache() {\n cachedTempDir = undefined;\n}\n\nmodule.exports.tempDir = _tempDir;\nmodule.exports.isCached = isCached;\nmodule.exports.clearCache = clearCache;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('test', _test, {\n cmdOptions: {\n 'b': 'block',\n 'c': 'character',\n 'd': 'directory',\n 'e': 'exists',\n 'f': 'file',\n 'L': 'link',\n 'p': 'pipe',\n 'S': 'socket',\n },\n wrapOutput: false,\n allowGlobbing: false,\n});\n\n\n//@\n//@ ### test(expression)\n//@\n//@ Available expression primaries:\n//@\n//@ + `'-b', 'path'`: true if path is a block device\n//@ + `'-c', 'path'`: true if path is a character device\n//@ + `'-d', 'path'`: true if path is a directory\n//@ + `'-e', 'path'`: true if path exists\n//@ + `'-f', 'path'`: true if path is a regular file\n//@ + `'-L', 'path'`: true if path is a symbolic link\n//@ + `'-p', 'path'`: true if path is a pipe (FIFO)\n//@ + `'-S', 'path'`: true if path is a socket\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ if (test('-d', path)) { /* do something with dir */ };\n//@ if (!test('-f', path)) continue; // skip if it's a regular file\n//@ ```\n//@\n//@ Evaluates `expression` using the available primaries and returns corresponding value.\nfunction _test(options, path) {\n if (!path) common.error('no path given');\n\n var canInterpret = false;\n Object.keys(options).forEach(function (key) {\n if (options[key] === true) {\n canInterpret = true;\n }\n });\n\n if (!canInterpret) common.error('could not interpret expression');\n\n if (options.link) {\n try {\n return common.statNoFollowLinks(path).isSymbolicLink();\n } catch (e) {\n return false;\n }\n }\n\n if (!fs.existsSync(path)) return false;\n\n if (options.exists) return true;\n\n var stats = common.statFollowLinks(path);\n\n if (options.block) return stats.isBlockDevice();\n\n if (options.character) return stats.isCharacterDevice();\n\n if (options.directory) return stats.isDirectory();\n\n if (options.file) return stats.isFile();\n\n /* istanbul ignore next */\n if (options.pipe) return stats.isFIFO();\n\n /* istanbul ignore next */\n if (options.socket) return stats.isSocket();\n\n /* istanbul ignore next */\n return false; // fallback\n} // test\nmodule.exports = _test;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\ncommon.register('to', _to, {\n pipeOnly: true,\n wrapOutput: false,\n});\n\n//@\n//@ ### ShellString.prototype.to(file)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ cat('input.txt').to('output.txt');\n//@ ```\n//@\n//@ Analogous to the redirection operator `>` in Unix, but works with\n//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.). _Like Unix\n//@ redirections, `to()` will overwrite any existing file!_\nfunction _to(options, file) {\n if (!file) common.error('wrong arguments');\n\n if (!fs.existsSync(path.dirname(file))) {\n common.error('no such file or directory: ' + path.dirname(file));\n }\n\n try {\n fs.writeFileSync(file, this.stdout || this.toString(), 'utf8');\n return this;\n } catch (e) {\n /* istanbul ignore next */\n common.error('could not write to file (code ' + e.code + '): ' + file, { continue: true });\n }\n}\nmodule.exports = _to;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\ncommon.register('toEnd', _toEnd, {\n pipeOnly: true,\n wrapOutput: false,\n});\n\n//@\n//@ ### ShellString.prototype.toEnd(file)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ cat('input.txt').toEnd('output.txt');\n//@ ```\n//@\n//@ Analogous to the redirect-and-append operator `>>` in Unix, but works with\n//@ `ShellStrings` (such as those returned by `cat`, `grep`, etc.).\nfunction _toEnd(options, file) {\n if (!file) common.error('wrong arguments');\n\n if (!fs.existsSync(path.dirname(file))) {\n common.error('no such file or directory: ' + path.dirname(file));\n }\n\n try {\n fs.appendFileSync(file, this.stdout || this.toString(), 'utf8');\n return this;\n } catch (e) {\n /* istanbul ignore next */\n common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true });\n }\n}\nmodule.exports = _toEnd;\n","var common = require('./common');\nvar fs = require('fs');\n\ncommon.register('touch', _touch, {\n cmdOptions: {\n 'a': 'atime_only',\n 'c': 'no_create',\n 'd': 'date',\n 'm': 'mtime_only',\n 'r': 'reference',\n },\n});\n\n//@\n//@ ### touch([options,] file [, file ...])\n//@ ### touch([options,] file_array)\n//@\n//@ Available options:\n//@\n//@ + `-a`: Change only the access time\n//@ + `-c`: Do not create any files\n//@ + `-m`: Change only the modification time\n//@ + `-d DATE`: Parse `DATE` and use it instead of current time\n//@ + `-r FILE`: Use `FILE`'s times instead of current time\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ touch('source.js');\n//@ touch('-c', '/path/to/some/dir/source.js');\n//@ touch({ '-r': FILE }, '/path/to/some/dir/source.js');\n//@ ```\n//@\n//@ Update the access and modification times of each `FILE` to the current time.\n//@ A `FILE` argument that does not exist is created empty, unless `-c` is supplied.\n//@ This is a partial implementation of [`touch(1)`](http://linux.die.net/man/1/touch).\nfunction _touch(opts, files) {\n if (!files) {\n common.error('no files given');\n } else if (typeof files === 'string') {\n files = [].slice.call(arguments, 1);\n } else {\n common.error('file arg should be a string file path or an Array of string file paths');\n }\n\n files.forEach(function (f) {\n touchFile(opts, f);\n });\n return '';\n}\n\nfunction touchFile(opts, file) {\n var stat = tryStatFile(file);\n\n if (stat && stat.isDirectory()) {\n // don't error just exit\n return;\n }\n\n // if the file doesn't already exist and the user has specified --no-create then\n // this script is finished\n if (!stat && opts.no_create) {\n return;\n }\n\n // open the file and then close it. this will create it if it doesn't exist but will\n // not truncate the file\n fs.closeSync(fs.openSync(file, 'a'));\n\n //\n // Set timestamps\n //\n\n // setup some defaults\n var now = new Date();\n var mtime = opts.date || now;\n var atime = opts.date || now;\n\n // use reference file\n if (opts.reference) {\n var refStat = tryStatFile(opts.reference);\n if (!refStat) {\n common.error('failed to get attributess of ' + opts.reference);\n }\n mtime = refStat.mtime;\n atime = refStat.atime;\n } else if (opts.date) {\n mtime = opts.date;\n atime = opts.date;\n }\n\n if (opts.atime_only && opts.mtime_only) {\n // keep the new values of mtime and atime like GNU\n } else if (opts.atime_only) {\n mtime = stat.mtime;\n } else if (opts.mtime_only) {\n atime = stat.atime;\n }\n\n fs.utimesSync(file, atime, mtime);\n}\n\nmodule.exports = _touch;\n\nfunction tryStatFile(filePath) {\n try {\n return common.statFollowLinks(filePath);\n } catch (e) {\n return null;\n }\n}\n","var common = require('./common');\nvar fs = require('fs');\n\n// add c spaces to the left of str\nfunction lpad(c, str) {\n var res = '' + str;\n if (res.length < c) {\n res = Array((c - res.length) + 1).join(' ') + res;\n }\n return res;\n}\n\ncommon.register('uniq', _uniq, {\n canReceivePipe: true,\n cmdOptions: {\n 'i': 'ignoreCase',\n 'c': 'count',\n 'd': 'duplicates',\n },\n});\n\n//@\n//@ ### uniq([options,] [input, [output]])\n//@\n//@ Available options:\n//@\n//@ + `-i`: Ignore case while comparing\n//@ + `-c`: Prefix lines by the number of occurrences\n//@ + `-d`: Only print duplicate lines, one for each group of identical lines\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ uniq('foo.txt');\n//@ uniq('-i', 'foo.txt');\n//@ uniq('-cd', 'foo.txt', 'bar.txt');\n//@ ```\n//@\n//@ Filter adjacent matching lines from `input`.\nfunction _uniq(options, input, output) {\n // Check if this is coming from a pipe\n var pipe = common.readFromPipe();\n\n if (!pipe) {\n if (!input) common.error('no input given');\n\n if (!fs.existsSync(input)) {\n common.error(input + ': No such file or directory');\n } else if (common.statFollowLinks(input).isDirectory()) {\n common.error(\"error reading '\" + input + \"'\");\n }\n }\n if (output && fs.existsSync(output) && common.statFollowLinks(output).isDirectory()) {\n common.error(output + ': Is a directory');\n }\n\n var lines = (input ? fs.readFileSync(input, 'utf8') : pipe).\n trimRight().\n split('\\n');\n\n var compare = function (a, b) {\n return options.ignoreCase ?\n a.toLocaleLowerCase().localeCompare(b.toLocaleLowerCase()) :\n a.localeCompare(b);\n };\n var uniqed = lines.reduceRight(function (res, e) {\n // Perform uniq -c on the input\n if (res.length === 0) {\n return [{ count: 1, ln: e }];\n } else if (compare(res[0].ln, e) === 0) {\n return [{ count: res[0].count + 1, ln: e }].concat(res.slice(1));\n } else {\n return [{ count: 1, ln: e }].concat(res);\n }\n }, []).filter(function (obj) {\n // Do we want only duplicated objects?\n return options.duplicates ? obj.count > 1 : true;\n }).map(function (obj) {\n // Are we tracking the counts of each line?\n return (options.count ? (lpad(7, obj.count) + ' ') : '') + obj.ln;\n }).join('\\n') + '\\n';\n\n if (output) {\n (new common.ShellString(uniqed)).to(output);\n // if uniq writes to output, nothing is passed to the next command in the pipeline (if any)\n return '';\n } else {\n return uniqed;\n }\n}\n\nmodule.exports = _uniq;\n","var common = require('./common');\nvar fs = require('fs');\nvar path = require('path');\n\ncommon.register('which', _which, {\n allowGlobbing: false,\n cmdOptions: {\n 'a': 'all',\n },\n});\n\n// XP's system default value for `PATHEXT` system variable, just in case it's not\n// set on Windows.\nvar XP_DEFAULT_PATHEXT = '.com;.exe;.bat;.cmd;.vbs;.vbe;.js;.jse;.wsf;.wsh';\n\n// For earlier versions of NodeJS that doesn't have a list of constants (< v6)\nvar FILE_EXECUTABLE_MODE = 1;\n\nfunction isWindowsPlatform() {\n return process.platform === 'win32';\n}\n\n// Cross-platform method for splitting environment `PATH` variables\nfunction splitPath(p) {\n return p ? p.split(path.delimiter) : [];\n}\n\n// Tests are running all cases for this func but it stays uncovered by codecov due to unknown reason\n/* istanbul ignore next */\nfunction isExecutable(pathName) {\n try {\n // TODO(node-support): replace with fs.constants.X_OK once remove support for node < v6\n fs.accessSync(pathName, FILE_EXECUTABLE_MODE);\n } catch (err) {\n return false;\n }\n return true;\n}\n\nfunction checkPath(pathName) {\n return fs.existsSync(pathName) && !common.statFollowLinks(pathName).isDirectory()\n && (isWindowsPlatform() || isExecutable(pathName));\n}\n\n//@\n//@ ### which(command)\n//@\n//@ Examples:\n//@\n//@ ```javascript\n//@ var nodeExec = which('node');\n//@ ```\n//@\n//@ Searches for `command` in the system's `PATH`. On Windows, this uses the\n//@ `PATHEXT` variable to append the extension if it's not already executable.\n//@ Returns string containing the absolute path to `command`.\nfunction _which(options, cmd) {\n if (!cmd) common.error('must specify command');\n\n var isWindows = isWindowsPlatform();\n var pathArray = splitPath(process.env.PATH);\n\n var queryMatches = [];\n\n // No relative/absolute paths provided?\n if (cmd.indexOf('/') === -1) {\n // Assume that there are no extensions to append to queries (this is the\n // case for unix)\n var pathExtArray = [''];\n if (isWindows) {\n // In case the PATHEXT variable is somehow not set (e.g.\n // child_process.spawn with an empty environment), use the XP default.\n var pathExtEnv = process.env.PATHEXT || XP_DEFAULT_PATHEXT;\n pathExtArray = splitPath(pathExtEnv.toUpperCase());\n }\n\n // Search for command in PATH\n for (var k = 0; k < pathArray.length; k++) {\n // already found it\n if (queryMatches.length > 0 && !options.all) break;\n\n var attempt = path.resolve(pathArray[k], cmd);\n\n if (isWindows) {\n attempt = attempt.toUpperCase();\n }\n\n var match = attempt.match(/\\.[^<>:\"/\\|?*.]+$/);\n if (match && pathExtArray.indexOf(match[0]) >= 0) { // this is Windows-only\n // The user typed a query with the file extension, like\n // `which('node.exe')`\n if (checkPath(attempt)) {\n queryMatches.push(attempt);\n break;\n }\n } else { // All-platforms\n // Cycle through the PATHEXT array, and check each extension\n // Note: the array is always [''] on Unix\n for (var i = 0; i < pathExtArray.length; i++) {\n var ext = pathExtArray[i];\n var newAttempt = attempt + ext;\n if (checkPath(newAttempt)) {\n queryMatches.push(newAttempt);\n break;\n }\n }\n }\n }\n } else if (checkPath(cmd)) { // a valid absolute or relative path\n queryMatches.push(path.resolve(cmd));\n }\n\n if (queryMatches.length > 0) {\n return options.all ? queryMatches : queryMatches[0];\n }\n return options.all ? [] : null;\n}\nmodule.exports = _which;\n","// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nvar process = global.process\n\nconst processOk = function (process) {\n return process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n}\n\n// some kind of non-node environment, just no-op\n/* istanbul ignore if */\nif (!processOk(process)) {\n module.exports = function () {\n return function () {}\n }\n} else {\n var assert = require('assert')\n var signals = require('./signals.js')\n var isWin = /^win/i.test(process.platform)\n\n var EE = require('events')\n /* istanbul ignore if */\n if (typeof EE !== 'function') {\n EE = EE.EventEmitter\n }\n\n var emitter\n if (process.__signal_exit_emitter__) {\n emitter = process.__signal_exit_emitter__\n } else {\n emitter = process.__signal_exit_emitter__ = new EE()\n emitter.count = 0\n emitter.emitted = {}\n }\n\n // Because this emitter is a global, we have to check to see if a\n // previous version of this library failed to enable infinite listeners.\n // I know what you're about to say. But literally everything about\n // signal-exit is a compromise with evil. Get used to it.\n if (!emitter.infinite) {\n emitter.setMaxListeners(Infinity)\n emitter.infinite = true\n }\n\n module.exports = function (cb, opts) {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return function () {}\n }\n assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')\n\n if (loaded === false) {\n load()\n }\n\n var ev = 'exit'\n if (opts && opts.alwaysLast) {\n ev = 'afterexit'\n }\n\n var remove = function () {\n emitter.removeListener(ev, cb)\n if (emitter.listeners('exit').length === 0 &&\n emitter.listeners('afterexit').length === 0) {\n unload()\n }\n }\n emitter.on(ev, cb)\n\n return remove\n }\n\n var unload = function unload () {\n if (!loaded || !processOk(global.process)) {\n return\n }\n loaded = false\n\n signals.forEach(function (sig) {\n try {\n process.removeListener(sig, sigListeners[sig])\n } catch (er) {}\n })\n process.emit = originalProcessEmit\n process.reallyExit = originalProcessReallyExit\n emitter.count -= 1\n }\n module.exports.unload = unload\n\n var emit = function emit (event, code, signal) {\n /* istanbul ignore if */\n if (emitter.emitted[event]) {\n return\n }\n emitter.emitted[event] = true\n emitter.emit(event, code, signal)\n }\n\n // { : , ... }\n var sigListeners = {}\n signals.forEach(function (sig) {\n sigListeners[sig] = function listener () {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return\n }\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n var listeners = process.listeners(sig)\n if (listeners.length === emitter.count) {\n unload()\n emit('exit', null, sig)\n /* istanbul ignore next */\n emit('afterexit', null, sig)\n /* istanbul ignore next */\n if (isWin && sig === 'SIGHUP') {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n sig = 'SIGINT'\n }\n /* istanbul ignore next */\n process.kill(process.pid, sig)\n }\n }\n })\n\n module.exports.signals = function () {\n return signals\n }\n\n var loaded = false\n\n var load = function load () {\n if (loaded || !processOk(global.process)) {\n return\n }\n loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n emitter.count += 1\n\n signals = signals.filter(function (sig) {\n try {\n process.on(sig, sigListeners[sig])\n return true\n } catch (er) {\n return false\n }\n })\n\n process.emit = processEmit\n process.reallyExit = processReallyExit\n }\n module.exports.load = load\n\n var originalProcessReallyExit = process.reallyExit\n var processReallyExit = function processReallyExit (code) {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return\n }\n process.exitCode = code || /* istanbul ignore next */ 0\n emit('exit', process.exitCode, null)\n /* istanbul ignore next */\n emit('afterexit', process.exitCode, null)\n /* istanbul ignore next */\n originalProcessReallyExit.call(process, process.exitCode)\n }\n\n var originalProcessEmit = process.emit\n var processEmit = function processEmit (ev, arg) {\n if (ev === 'exit' && processOk(global.process)) {\n /* istanbul ignore else */\n if (arg !== undefined) {\n process.exitCode = arg\n }\n var ret = originalProcessEmit.apply(this, arguments)\n /* istanbul ignore next */\n emit('exit', process.exitCode, null)\n /* istanbul ignore next */\n emit('afterexit', process.exitCode, null)\n /* istanbul ignore next */\n return ret\n } else {\n return originalProcessEmit.apply(this, arguments)\n }\n }\n}\n","// This is not the set of all possible signals.\n//\n// It IS, however, the set of all signals that trigger\n// an exit on either Linux or BSD systems. Linux is a\n// superset of the signal names supported on BSD, and\n// the unknown signals just fail to register, so we can\n// catch that easily enough.\n//\n// Don't bother with SIGKILL. It's uncatchable, which\n// means that we can't fire any callbacks anyway.\n//\n// If a user does happen to register a handler on a non-\n// fatal signal like SIGWINCH or something, and then\n// exit, it'll end up firing `process.emit('exit')`, so\n// the handler will be fired anyway.\n//\n// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n// artificially, inherently leave the process in a\n// state from which it is not safe to try and enter JS\n// listeners.\nmodule.exports = [\n 'SIGABRT',\n 'SIGALRM',\n 'SIGHUP',\n 'SIGINT',\n 'SIGTERM'\n]\n\nif (process.platform !== 'win32') {\n module.exports.push(\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n module.exports.push(\n 'SIGIO',\n 'SIGPOLL',\n 'SIGPWR',\n 'SIGSTKFLT',\n 'SIGUNUSED'\n )\n}\n","// Copyright 2015 Joyent, Inc.\n\nvar Buffer = require('safer-buffer').Buffer;\n\nvar algInfo = {\n\t'dsa': {\n\t\tparts: ['p', 'q', 'g', 'y'],\n\t\tsizePart: 'p'\n\t},\n\t'rsa': {\n\t\tparts: ['e', 'n'],\n\t\tsizePart: 'n'\n\t},\n\t'ecdsa': {\n\t\tparts: ['curve', 'Q'],\n\t\tsizePart: 'Q'\n\t},\n\t'ed25519': {\n\t\tparts: ['A'],\n\t\tsizePart: 'A'\n\t}\n};\nalgInfo['curve25519'] = algInfo['ed25519'];\n\nvar algPrivInfo = {\n\t'dsa': {\n\t\tparts: ['p', 'q', 'g', 'y', 'x']\n\t},\n\t'rsa': {\n\t\tparts: ['n', 'e', 'd', 'iqmp', 'p', 'q']\n\t},\n\t'ecdsa': {\n\t\tparts: ['curve', 'Q', 'd']\n\t},\n\t'ed25519': {\n\t\tparts: ['A', 'k']\n\t}\n};\nalgPrivInfo['curve25519'] = algPrivInfo['ed25519'];\n\nvar hashAlgs = {\n\t'md5': true,\n\t'sha1': true,\n\t'sha256': true,\n\t'sha384': true,\n\t'sha512': true\n};\n\n/*\n * Taken from\n * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf\n */\nvar curves = {\n\t'nistp256': {\n\t\tsize: 256,\n\t\tpkcs8oid: '1.2.840.10045.3.1.7',\n\t\tp: Buffer.from(('00' +\n\t\t 'ffffffff 00000001 00000000 00000000' +\n\t\t '00000000 ffffffff ffffffff ffffffff').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('00' +\n\t\t 'FFFFFFFF 00000001 00000000 00000000' +\n\t\t '00000000 FFFFFFFF FFFFFFFF FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from((\n\t\t '5ac635d8 aa3a93e7 b3ebbd55 769886bc' +\n\t\t '651d06b0 cc53b0f6 3bce3c3e 27d2604b').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'c49d3608 86e70493 6a6678e1 139d26b7' +\n\t\t '819f7e90').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('00' +\n\t\t 'ffffffff 00000000 ffffffff ffffffff' +\n\t\t 'bce6faad a7179e84 f3b9cac2 fc632551').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t '6b17d1f2 e12c4247 f8bce6e5 63a440f2' +\n\t\t '77037d81 2deb33a0 f4a13945 d898c296' +\n\t\t '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' +\n\t\t '2bce3357 6b315ece cbb64068 37bf51f5').\n\t\t replace(/ /g, ''), 'hex')\n\t},\n\t'nistp384': {\n\t\tsize: 384,\n\t\tpkcs8oid: '1.3.132.0.34',\n\t\tp: Buffer.from(('00' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff fffffffe' +\n\t\t 'ffffffff 00000000 00000000 ffffffff').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('00' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' +\n\t\t 'FFFFFFFF 00000000 00000000 FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from((\n\t\t 'b3312fa7 e23ee7e4 988e056b e3f82d19' +\n\t\t '181d9c6e fe814112 0314088f 5013875a' +\n\t\t 'c656398d 8a2ed19d 2a85c8ed d3ec2aef').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'a335926a a319a27a 1d00896a 6773a482' +\n\t\t '7acdac73').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('00' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff c7634d81 f4372ddf' +\n\t\t '581a0db2 48b0a77a ecec196a ccc52973').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t 'aa87ca22 be8b0537 8eb1c71e f320ad74' +\n\t\t '6e1d3b62 8ba79b98 59f741e0 82542a38' +\n\t\t '5502f25d bf55296c 3a545e38 72760ab7' +\n\t\t '3617de4a 96262c6f 5d9e98bf 9292dc29' +\n\t\t 'f8f41dbd 289a147c e9da3113 b5f0b8c0' +\n\t\t '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f').\n\t\t replace(/ /g, ''), 'hex')\n\t},\n\t'nistp521': {\n\t\tsize: 521,\n\t\tpkcs8oid: '1.3.132.0.35',\n\t\tp: Buffer.from((\n\t\t '01ffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffff').replace(/ /g, ''), 'hex'),\n\t\ta: Buffer.from(('01FF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +\n\t\t 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tb: Buffer.from(('51' +\n\t\t '953eb961 8e1c9a1f 929a21a0 b68540ee' +\n\t\t 'a2da725b 99b315f3 b8b48991 8ef109e1' +\n\t\t '56193951 ec7e937b 1652c0bd 3bb1bf07' +\n\t\t '3573df88 3d2c34f1 ef451fd4 6b503f00').\n\t\t replace(/ /g, ''), 'hex'),\n\t\ts: Buffer.from(('00' +\n\t\t 'd09e8800 291cb853 96cc6717 393284aa' +\n\t\t 'a0da64ba').replace(/ /g, ''), 'hex'),\n\t\tn: Buffer.from(('01ff' +\n\t\t 'ffffffff ffffffff ffffffff ffffffff' +\n\t\t 'ffffffff ffffffff ffffffff fffffffa' +\n\t\t '51868783 bf2f966b 7fcc0148 f709a5d0' +\n\t\t '3bb5c9b8 899c47ae bb6fb71e 91386409').\n\t\t replace(/ /g, ''), 'hex'),\n\t\tG: Buffer.from(('04' +\n\t\t '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' +\n\t\t '9c648139 053fb521 f828af60 6b4d3dba' +\n\t\t 'a14b5e77 efe75928 fe1dc127 a2ffa8de' +\n\t\t '3348b3c1 856a429b f97e7e31 c2e5bd66' +\n\t\t '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' +\n\t\t '98f54449 579b4468 17afbd17 273e662c' +\n\t\t '97ee7299 5ef42640 c550b901 3fad0761' +\n\t\t '353c7086 a272c240 88be9476 9fd16650').\n\t\t replace(/ /g, ''), 'hex')\n\t}\n};\n\nmodule.exports = {\n\tinfo: algInfo,\n\tprivInfo: algPrivInfo,\n\thashAlgs: hashAlgs,\n\tcurves: curves\n};\n","// Copyright 2016 Joyent, Inc.\n\nmodule.exports = Certificate;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar errs = require('./errors');\nvar util = require('util');\nvar utils = require('./utils');\nvar Key = require('./key');\nvar PrivateKey = require('./private-key');\nvar Identity = require('./identity');\n\nvar formats = {};\nformats['openssh'] = require('./formats/openssh-cert');\nformats['x509'] = require('./formats/x509');\nformats['pem'] = require('./formats/x509-pem');\n\nvar CertificateParseError = errs.CertificateParseError;\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\n\nfunction Certificate(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.subjects, 'options.subjects');\n\tutils.assertCompatible(opts.subjects[0], Identity, [1, 0],\n\t 'options.subjects');\n\tutils.assertCompatible(opts.subjectKey, Key, [1, 0],\n\t 'options.subjectKey');\n\tutils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer');\n\tif (opts.issuerKey !== undefined) {\n\t\tutils.assertCompatible(opts.issuerKey, Key, [1, 0],\n\t\t 'options.issuerKey');\n\t}\n\tassert.object(opts.signatures, 'options.signatures');\n\tassert.buffer(opts.serial, 'options.serial');\n\tassert.date(opts.validFrom, 'options.validFrom');\n\tassert.date(opts.validUntil, 'optons.validUntil');\n\n\tassert.optionalArrayOfString(opts.purposes, 'options.purposes');\n\n\tthis._hashCache = {};\n\n\tthis.subjects = opts.subjects;\n\tthis.issuer = opts.issuer;\n\tthis.subjectKey = opts.subjectKey;\n\tthis.issuerKey = opts.issuerKey;\n\tthis.signatures = opts.signatures;\n\tthis.serial = opts.serial;\n\tthis.validFrom = opts.validFrom;\n\tthis.validUntil = opts.validUntil;\n\tthis.purposes = opts.purposes;\n}\n\nCertificate.formats = formats;\n\nCertificate.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'x509';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\treturn (formats[format].write(this, options));\n};\n\nCertificate.prototype.toString = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'pem';\n\treturn (this.toBuffer(format, options).toString());\n};\n\nCertificate.prototype.fingerprint = function (algo) {\n\tif (algo === undefined)\n\t\talgo = 'sha256';\n\tassert.string(algo, 'algorithm');\n\tvar opts = {\n\t\ttype: 'certificate',\n\t\thash: this.hash(algo),\n\t\talgorithm: algo\n\t};\n\treturn (new Fingerprint(opts));\n};\n\nCertificate.prototype.hash = function (algo) {\n\tassert.string(algo, 'algorithm');\n\talgo = algo.toLowerCase();\n\tif (algs.hashAlgs[algo] === undefined)\n\t\tthrow (new InvalidAlgorithmError(algo));\n\n\tif (this._hashCache[algo])\n\t\treturn (this._hashCache[algo]);\n\n\tvar hash = crypto.createHash(algo).\n\t update(this.toBuffer('x509')).digest();\n\tthis._hashCache[algo] = hash;\n\treturn (hash);\n};\n\nCertificate.prototype.isExpired = function (when) {\n\tif (when === undefined)\n\t\twhen = new Date();\n\treturn (!((when.getTime() >= this.validFrom.getTime()) &&\n\t\t(when.getTime() < this.validUntil.getTime())));\n};\n\nCertificate.prototype.isSignedBy = function (issuerCert) {\n\tutils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer');\n\n\tif (!this.issuer.equals(issuerCert.subjects[0]))\n\t\treturn (false);\n\tif (this.issuer.purposes && this.issuer.purposes.length > 0 &&\n\t this.issuer.purposes.indexOf('ca') === -1) {\n\t\treturn (false);\n\t}\n\n\treturn (this.isSignedByKey(issuerCert.subjectKey));\n};\n\nCertificate.prototype.getExtension = function (keyOrOid) {\n\tassert.string(keyOrOid, 'keyOrOid');\n\tvar ext = this.getExtensions().filter(function (maybeExt) {\n\t\tif (maybeExt.format === 'x509')\n\t\t\treturn (maybeExt.oid === keyOrOid);\n\t\tif (maybeExt.format === 'openssh')\n\t\t\treturn (maybeExt.name === keyOrOid);\n\t\treturn (false);\n\t})[0];\n\treturn (ext);\n};\n\nCertificate.prototype.getExtensions = function () {\n\tvar exts = [];\n\tvar x509 = this.signatures.x509;\n\tif (x509 && x509.extras && x509.extras.exts) {\n\t\tx509.extras.exts.forEach(function (ext) {\n\t\t\text.format = 'x509';\n\t\t\texts.push(ext);\n\t\t});\n\t}\n\tvar openssh = this.signatures.openssh;\n\tif (openssh && openssh.exts) {\n\t\topenssh.exts.forEach(function (ext) {\n\t\t\text.format = 'openssh';\n\t\t\texts.push(ext);\n\t\t});\n\t}\n\treturn (exts);\n};\n\nCertificate.prototype.isSignedByKey = function (issuerKey) {\n\tutils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey');\n\n\tif (this.issuerKey !== undefined) {\n\t\treturn (this.issuerKey.\n\t\t fingerprint('sha512').matches(issuerKey));\n\t}\n\n\tvar fmt = Object.keys(this.signatures)[0];\n\tvar valid = formats[fmt].verify(this, issuerKey);\n\tif (valid)\n\t\tthis.issuerKey = issuerKey;\n\treturn (valid);\n};\n\nCertificate.prototype.signWith = function (key) {\n\tutils.assertCompatible(key, PrivateKey, [1, 2], 'key');\n\tvar fmts = Object.keys(formats);\n\tvar didOne = false;\n\tfor (var i = 0; i < fmts.length; ++i) {\n\t\tif (fmts[i] !== 'pem') {\n\t\t\tvar ret = formats[fmts[i]].sign(this, key);\n\t\t\tif (ret === true)\n\t\t\t\tdidOne = true;\n\t\t}\n\t}\n\tif (!didOne) {\n\t\tthrow (new Error('Failed to sign the certificate for any ' +\n\t\t 'available certificate formats'));\n\t}\n};\n\nCertificate.createSelfSigned = function (subjectOrSubjects, key, options) {\n\tvar subjects;\n\tif (Array.isArray(subjectOrSubjects))\n\t\tsubjects = subjectOrSubjects;\n\telse\n\t\tsubjects = [subjectOrSubjects];\n\n\tassert.arrayOfObject(subjects);\n\tsubjects.forEach(function (subject) {\n\t\tutils.assertCompatible(subject, Identity, [1, 0], 'subject');\n\t});\n\n\tutils.assertCompatible(key, PrivateKey, [1, 2], 'private key');\n\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalObject(options.validFrom, 'options.validFrom');\n\tassert.optionalObject(options.validUntil, 'options.validUntil');\n\tvar validFrom = options.validFrom;\n\tvar validUntil = options.validUntil;\n\tif (validFrom === undefined)\n\t\tvalidFrom = new Date();\n\tif (validUntil === undefined) {\n\t\tassert.optionalNumber(options.lifetime, 'options.lifetime');\n\t\tvar lifetime = options.lifetime;\n\t\tif (lifetime === undefined)\n\t\t\tlifetime = 10*365*24*3600;\n\t\tvalidUntil = new Date();\n\t\tvalidUntil.setTime(validUntil.getTime() + lifetime*1000);\n\t}\n\tassert.optionalBuffer(options.serial, 'options.serial');\n\tvar serial = options.serial;\n\tif (serial === undefined)\n\t\tserial = Buffer.from('0000000000000001', 'hex');\n\n\tvar purposes = options.purposes;\n\tif (purposes === undefined)\n\t\tpurposes = [];\n\n\tif (purposes.indexOf('signature') === -1)\n\t\tpurposes.push('signature');\n\n\t/* Self-signed certs are always CAs. */\n\tif (purposes.indexOf('ca') === -1)\n\t\tpurposes.push('ca');\n\tif (purposes.indexOf('crl') === -1)\n\t\tpurposes.push('crl');\n\n\t/*\n\t * If we weren't explicitly given any other purposes, do the sensible\n\t * thing and add some basic ones depending on the subject type.\n\t */\n\tif (purposes.length <= 3) {\n\t\tvar hostSubjects = subjects.filter(function (subject) {\n\t\t\treturn (subject.type === 'host');\n\t\t});\n\t\tvar userSubjects = subjects.filter(function (subject) {\n\t\t\treturn (subject.type === 'user');\n\t\t});\n\t\tif (hostSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('serverAuth') === -1)\n\t\t\t\tpurposes.push('serverAuth');\n\t\t}\n\t\tif (userSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('clientAuth') === -1)\n\t\t\t\tpurposes.push('clientAuth');\n\t\t}\n\t\tif (userSubjects.length > 0 || hostSubjects.length > 0) {\n\t\t\tif (purposes.indexOf('keyAgreement') === -1)\n\t\t\t\tpurposes.push('keyAgreement');\n\t\t\tif (key.type === 'rsa' &&\n\t\t\t purposes.indexOf('encryption') === -1)\n\t\t\t\tpurposes.push('encryption');\n\t\t}\n\t}\n\n\tvar cert = new Certificate({\n\t\tsubjects: subjects,\n\t\tissuer: subjects[0],\n\t\tsubjectKey: key.toPublic(),\n\t\tissuerKey: key.toPublic(),\n\t\tsignatures: {},\n\t\tserial: serial,\n\t\tvalidFrom: validFrom,\n\t\tvalidUntil: validUntil,\n\t\tpurposes: purposes\n\t});\n\tcert.signWith(key);\n\n\treturn (cert);\n};\n\nCertificate.create =\n function (subjectOrSubjects, key, issuer, issuerKey, options) {\n\tvar subjects;\n\tif (Array.isArray(subjectOrSubjects))\n\t\tsubjects = subjectOrSubjects;\n\telse\n\t\tsubjects = [subjectOrSubjects];\n\n\tassert.arrayOfObject(subjects);\n\tsubjects.forEach(function (subject) {\n\t\tutils.assertCompatible(subject, Identity, [1, 0], 'subject');\n\t});\n\n\tutils.assertCompatible(key, Key, [1, 0], 'key');\n\tif (PrivateKey.isPrivateKey(key))\n\t\tkey = key.toPublic();\n\tutils.assertCompatible(issuer, Identity, [1, 0], 'issuer');\n\tutils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key');\n\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalObject(options.validFrom, 'options.validFrom');\n\tassert.optionalObject(options.validUntil, 'options.validUntil');\n\tvar validFrom = options.validFrom;\n\tvar validUntil = options.validUntil;\n\tif (validFrom === undefined)\n\t\tvalidFrom = new Date();\n\tif (validUntil === undefined) {\n\t\tassert.optionalNumber(options.lifetime, 'options.lifetime');\n\t\tvar lifetime = options.lifetime;\n\t\tif (lifetime === undefined)\n\t\t\tlifetime = 10*365*24*3600;\n\t\tvalidUntil = new Date();\n\t\tvalidUntil.setTime(validUntil.getTime() + lifetime*1000);\n\t}\n\tassert.optionalBuffer(options.serial, 'options.serial');\n\tvar serial = options.serial;\n\tif (serial === undefined)\n\t\tserial = Buffer.from('0000000000000001', 'hex');\n\n\tvar purposes = options.purposes;\n\tif (purposes === undefined)\n\t\tpurposes = [];\n\n\tif (purposes.indexOf('signature') === -1)\n\t\tpurposes.push('signature');\n\n\tif (options.ca === true) {\n\t\tif (purposes.indexOf('ca') === -1)\n\t\t\tpurposes.push('ca');\n\t\tif (purposes.indexOf('crl') === -1)\n\t\t\tpurposes.push('crl');\n\t}\n\n\tvar hostSubjects = subjects.filter(function (subject) {\n\t\treturn (subject.type === 'host');\n\t});\n\tvar userSubjects = subjects.filter(function (subject) {\n\t\treturn (subject.type === 'user');\n\t});\n\tif (hostSubjects.length > 0) {\n\t\tif (purposes.indexOf('serverAuth') === -1)\n\t\t\tpurposes.push('serverAuth');\n\t}\n\tif (userSubjects.length > 0) {\n\t\tif (purposes.indexOf('clientAuth') === -1)\n\t\t\tpurposes.push('clientAuth');\n\t}\n\tif (userSubjects.length > 0 || hostSubjects.length > 0) {\n\t\tif (purposes.indexOf('keyAgreement') === -1)\n\t\t\tpurposes.push('keyAgreement');\n\t\tif (key.type === 'rsa' &&\n\t\t purposes.indexOf('encryption') === -1)\n\t\t\tpurposes.push('encryption');\n\t}\n\n\tvar cert = new Certificate({\n\t\tsubjects: subjects,\n\t\tissuer: issuer,\n\t\tsubjectKey: key,\n\t\tissuerKey: issuerKey.toPublic(),\n\t\tsignatures: {},\n\t\tserial: serial,\n\t\tvalidFrom: validFrom,\n\t\tvalidUntil: validUntil,\n\t\tpurposes: purposes\n\t});\n\tcert.signWith(issuerKey);\n\n\treturn (cert);\n};\n\nCertificate.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\treturn (k);\n\t} catch (e) {\n\t\tthrow (new CertificateParseError(options.filename, format, e));\n\t}\n};\n\nCertificate.isCertificate = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Certificate, ver));\n};\n\n/*\n * API versions for Certificate:\n * [1,0] -- initial ver\n * [1,1] -- openssh format now unpacks extensions\n */\nCertificate.prototype._sshpkApiVersion = [1, 1];\n\nCertificate._oldVersionDetect = function (obj) {\n\treturn ([1, 0]);\n};\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tDiffieHellman: DiffieHellman,\n\tgenerateECDSA: generateECDSA,\n\tgenerateED25519: generateED25519\n};\n\nvar assert = require('assert-plus');\nvar crypto = require('crypto');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar utils = require('./utils');\nvar nacl = require('tweetnacl');\n\nvar Key = require('./key');\nvar PrivateKey = require('./private-key');\n\nvar CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined);\n\nvar ecdh = require('ecc-jsbn');\nvar ec = require('ecc-jsbn/lib/ec');\nvar jsbn = require('jsbn').BigInteger;\n\nfunction DiffieHellman(key) {\n\tutils.assertCompatible(key, Key, [1, 4], 'key');\n\tthis._isPriv = PrivateKey.isPrivateKey(key, [1, 3]);\n\tthis._algo = key.type;\n\tthis._curve = key.curve;\n\tthis._key = key;\n\tif (key.type === 'dsa') {\n\t\tif (!CRYPTO_HAVE_ECDH) {\n\t\t\tthrow (new Error('Due to bugs in the node 0.10 ' +\n\t\t\t 'crypto API, node 0.12.x or later is required ' +\n\t\t\t 'to use DH'));\n\t\t}\n\t\tthis._dh = crypto.createDiffieHellman(\n\t\t key.part.p.data, undefined,\n\t\t key.part.g.data, undefined);\n\t\tthis._p = key.part.p;\n\t\tthis._g = key.part.g;\n\t\tif (this._isPriv)\n\t\t\tthis._dh.setPrivateKey(key.part.x.data);\n\t\tthis._dh.setPublicKey(key.part.y.data);\n\n\t} else if (key.type === 'ecdsa') {\n\t\tif (!CRYPTO_HAVE_ECDH) {\n\t\t\tthis._ecParams = new X9ECParameters(this._curve);\n\n\t\t\tif (this._isPriv) {\n\t\t\t\tthis._priv = new ECPrivate(\n\t\t\t\t this._ecParams, key.part.d.data);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tvar curve = {\n\t\t\t'nistp256': 'prime256v1',\n\t\t\t'nistp384': 'secp384r1',\n\t\t\t'nistp521': 'secp521r1'\n\t\t}[key.curve];\n\t\tthis._dh = crypto.createECDH(curve);\n\t\tif (typeof (this._dh) !== 'object' ||\n\t\t typeof (this._dh.setPrivateKey) !== 'function') {\n\t\t\tCRYPTO_HAVE_ECDH = false;\n\t\t\tDiffieHellman.call(this, key);\n\t\t\treturn;\n\t\t}\n\t\tif (this._isPriv)\n\t\t\tthis._dh.setPrivateKey(key.part.d.data);\n\t\tthis._dh.setPublicKey(key.part.Q.data);\n\n\t} else if (key.type === 'curve25519') {\n\t\tif (this._isPriv) {\n\t\t\tutils.assertCompatible(key, PrivateKey, [1, 5], 'key');\n\t\t\tthis._priv = key.part.k.data;\n\t\t}\n\n\t} else {\n\t\tthrow (new Error('DH not supported for ' + key.type + ' keys'));\n\t}\n}\n\nDiffieHellman.prototype.getPublicKey = function () {\n\tif (this._isPriv)\n\t\treturn (this._key.toPublic());\n\treturn (this._key);\n};\n\nDiffieHellman.prototype.getPrivateKey = function () {\n\tif (this._isPriv)\n\t\treturn (this._key);\n\telse\n\t\treturn (undefined);\n};\nDiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey;\n\nDiffieHellman.prototype._keyCheck = function (pk, isPub) {\n\tassert.object(pk, 'key');\n\tif (!isPub)\n\t\tutils.assertCompatible(pk, PrivateKey, [1, 3], 'key');\n\tutils.assertCompatible(pk, Key, [1, 4], 'key');\n\n\tif (pk.type !== this._algo) {\n\t\tthrow (new Error('A ' + pk.type + ' key cannot be used in ' +\n\t\t this._algo + ' Diffie-Hellman'));\n\t}\n\n\tif (pk.curve !== this._curve) {\n\t\tthrow (new Error('A key from the ' + pk.curve + ' curve ' +\n\t\t 'cannot be used with a ' + this._curve +\n\t\t ' Diffie-Hellman'));\n\t}\n\n\tif (pk.type === 'dsa') {\n\t\tassert.deepEqual(pk.part.p, this._p,\n\t\t 'DSA key prime does not match');\n\t\tassert.deepEqual(pk.part.g, this._g,\n\t\t 'DSA key generator does not match');\n\t}\n};\n\nDiffieHellman.prototype.setKey = function (pk) {\n\tthis._keyCheck(pk);\n\n\tif (pk.type === 'dsa') {\n\t\tthis._dh.setPrivateKey(pk.part.x.data);\n\t\tthis._dh.setPublicKey(pk.part.y.data);\n\n\t} else if (pk.type === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\tthis._dh.setPrivateKey(pk.part.d.data);\n\t\t\tthis._dh.setPublicKey(pk.part.Q.data);\n\t\t} else {\n\t\t\tthis._priv = new ECPrivate(\n\t\t\t this._ecParams, pk.part.d.data);\n\t\t}\n\n\t} else if (pk.type === 'curve25519') {\n\t\tvar k = pk.part.k;\n\t\tif (!pk.part.k)\n\t\t\tk = pk.part.r;\n\t\tthis._priv = k.data;\n\t\tif (this._priv[0] === 0x00)\n\t\t\tthis._priv = this._priv.slice(1);\n\t\tthis._priv = this._priv.slice(0, 32);\n\t}\n\tthis._key = pk;\n\tthis._isPriv = true;\n};\nDiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey;\n\nDiffieHellman.prototype.computeSecret = function (otherpk) {\n\tthis._keyCheck(otherpk, true);\n\tif (!this._isPriv)\n\t\tthrow (new Error('DH exchange has not been initialized with ' +\n\t\t 'a private key yet'));\n\n\tvar pub;\n\tif (this._algo === 'dsa') {\n\t\treturn (this._dh.computeSecret(\n\t\t otherpk.part.y.data));\n\n\t} else if (this._algo === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\treturn (this._dh.computeSecret(\n\t\t\t otherpk.part.Q.data));\n\t\t} else {\n\t\t\tpub = new ECPublic(\n\t\t\t this._ecParams, otherpk.part.Q.data);\n\t\t\treturn (this._priv.deriveSharedSecret(pub));\n\t\t}\n\n\t} else if (this._algo === 'curve25519') {\n\t\tpub = otherpk.part.A.data;\n\t\twhile (pub[0] === 0x00 && pub.length > 32)\n\t\t\tpub = pub.slice(1);\n\t\tvar priv = this._priv;\n\t\tassert.strictEqual(pub.length, 32);\n\t\tassert.strictEqual(priv.length, 32);\n\n\t\tvar secret = nacl.box.before(new Uint8Array(pub),\n\t\t new Uint8Array(priv));\n\n\t\treturn (Buffer.from(secret));\n\t}\n\n\tthrow (new Error('Invalid algorithm: ' + this._algo));\n};\n\nDiffieHellman.prototype.generateKey = function () {\n\tvar parts = [];\n\tvar priv, pub;\n\tif (this._algo === 'dsa') {\n\t\tthis._dh.generateKeys();\n\n\t\tparts.push({name: 'p', data: this._p.data});\n\t\tparts.push({name: 'q', data: this._key.part.q.data});\n\t\tparts.push({name: 'g', data: this._g.data});\n\t\tparts.push({name: 'y', data: this._dh.getPublicKey()});\n\t\tparts.push({name: 'x', data: this._dh.getPrivateKey()});\n\t\tthis._key = new PrivateKey({\n\t\t\ttype: 'dsa',\n\t\t\tparts: parts\n\t\t});\n\t\tthis._isPriv = true;\n\t\treturn (this._key);\n\n\t} else if (this._algo === 'ecdsa') {\n\t\tif (CRYPTO_HAVE_ECDH) {\n\t\t\tthis._dh.generateKeys();\n\n\t\t\tparts.push({name: 'curve',\n\t\t\t data: Buffer.from(this._curve)});\n\t\t\tparts.push({name: 'Q', data: this._dh.getPublicKey()});\n\t\t\tparts.push({name: 'd', data: this._dh.getPrivateKey()});\n\t\t\tthis._key = new PrivateKey({\n\t\t\t\ttype: 'ecdsa',\n\t\t\t\tcurve: this._curve,\n\t\t\t\tparts: parts\n\t\t\t});\n\t\t\tthis._isPriv = true;\n\t\t\treturn (this._key);\n\n\t\t} else {\n\t\t\tvar n = this._ecParams.getN();\n\t\t\tvar r = new jsbn(crypto.randomBytes(n.bitLength()));\n\t\t\tvar n1 = n.subtract(jsbn.ONE);\n\t\t\tpriv = r.mod(n1).add(jsbn.ONE);\n\t\t\tpub = this._ecParams.getG().multiply(priv);\n\n\t\t\tpriv = Buffer.from(priv.toByteArray());\n\t\t\tpub = Buffer.from(this._ecParams.getCurve().\n\t\t\t encodePointHex(pub), 'hex');\n\n\t\t\tthis._priv = new ECPrivate(this._ecParams, priv);\n\n\t\t\tparts.push({name: 'curve',\n\t\t\t data: Buffer.from(this._curve)});\n\t\t\tparts.push({name: 'Q', data: pub});\n\t\t\tparts.push({name: 'd', data: priv});\n\n\t\t\tthis._key = new PrivateKey({\n\t\t\t\ttype: 'ecdsa',\n\t\t\t\tcurve: this._curve,\n\t\t\t\tparts: parts\n\t\t\t});\n\t\t\tthis._isPriv = true;\n\t\t\treturn (this._key);\n\t\t}\n\n\t} else if (this._algo === 'curve25519') {\n\t\tvar pair = nacl.box.keyPair();\n\t\tpriv = Buffer.from(pair.secretKey);\n\t\tpub = Buffer.from(pair.publicKey);\n\t\tpriv = Buffer.concat([priv, pub]);\n\t\tassert.strictEqual(priv.length, 64);\n\t\tassert.strictEqual(pub.length, 32);\n\n\t\tparts.push({name: 'A', data: pub});\n\t\tparts.push({name: 'k', data: priv});\n\t\tthis._key = new PrivateKey({\n\t\t\ttype: 'curve25519',\n\t\t\tparts: parts\n\t\t});\n\t\tthis._isPriv = true;\n\t\treturn (this._key);\n\t}\n\n\tthrow (new Error('Invalid algorithm: ' + this._algo));\n};\nDiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey;\n\n/* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */\n\nfunction X9ECParameters(name) {\n\tvar params = algs.curves[name];\n\tassert.object(params);\n\n\tvar p = new jsbn(params.p);\n\tvar a = new jsbn(params.a);\n\tvar b = new jsbn(params.b);\n\tvar n = new jsbn(params.n);\n\tvar h = jsbn.ONE;\n\tvar curve = new ec.ECCurveFp(p, a, b);\n\tvar G = curve.decodePointHex(params.G.toString('hex'));\n\n\tthis.curve = curve;\n\tthis.g = G;\n\tthis.n = n;\n\tthis.h = h;\n}\nX9ECParameters.prototype.getCurve = function () { return (this.curve); };\nX9ECParameters.prototype.getG = function () { return (this.g); };\nX9ECParameters.prototype.getN = function () { return (this.n); };\nX9ECParameters.prototype.getH = function () { return (this.h); };\n\nfunction ECPublic(params, buffer) {\n\tthis._params = params;\n\tif (buffer[0] === 0x00)\n\t\tbuffer = buffer.slice(1);\n\tthis._pub = params.getCurve().decodePointHex(buffer.toString('hex'));\n}\n\nfunction ECPrivate(params, buffer) {\n\tthis._params = params;\n\tthis._priv = new jsbn(utils.mpNormalize(buffer));\n}\nECPrivate.prototype.deriveSharedSecret = function (pubKey) {\n\tassert.ok(pubKey instanceof ECPublic);\n\tvar S = pubKey._pub.multiply(this._priv);\n\treturn (Buffer.from(S.getX().toBigInteger().toByteArray()));\n};\n\nfunction generateED25519() {\n\tvar pair = nacl.sign.keyPair();\n\tvar priv = Buffer.from(pair.secretKey);\n\tvar pub = Buffer.from(pair.publicKey);\n\tassert.strictEqual(priv.length, 64);\n\tassert.strictEqual(pub.length, 32);\n\n\tvar parts = [];\n\tparts.push({name: 'A', data: pub});\n\tparts.push({name: 'k', data: priv.slice(0, 32)});\n\tvar key = new PrivateKey({\n\t\ttype: 'ed25519',\n\t\tparts: parts\n\t});\n\treturn (key);\n}\n\n/* Generates a new ECDSA private key on a given curve. */\nfunction generateECDSA(curve) {\n\tvar parts = [];\n\tvar key;\n\n\tif (CRYPTO_HAVE_ECDH) {\n\t\t/*\n\t\t * Node crypto doesn't expose key generation directly, but the\n\t\t * ECDH instances can generate keys. It turns out this just\n\t\t * calls into the OpenSSL generic key generator, and we can\n\t\t * read its output happily without doing an actual DH. So we\n\t\t * use that here.\n\t\t */\n\t\tvar osCurve = {\n\t\t\t'nistp256': 'prime256v1',\n\t\t\t'nistp384': 'secp384r1',\n\t\t\t'nistp521': 'secp521r1'\n\t\t}[curve];\n\n\t\tvar dh = crypto.createECDH(osCurve);\n\t\tdh.generateKeys();\n\n\t\tparts.push({name: 'curve',\n\t\t data: Buffer.from(curve)});\n\t\tparts.push({name: 'Q', data: dh.getPublicKey()});\n\t\tparts.push({name: 'd', data: dh.getPrivateKey()});\n\n\t\tkey = new PrivateKey({\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tparts: parts\n\t\t});\n\t\treturn (key);\n\t} else {\n\n\t\tvar ecParams = new X9ECParameters(curve);\n\n\t\t/* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */\n\t\tvar n = ecParams.getN();\n\t\t/*\n\t\t * The crypto.randomBytes() function can only give us whole\n\t\t * bytes, so taking a nod from X9.62, we round up.\n\t\t */\n\t\tvar cByteLen = Math.ceil((n.bitLength() + 64) / 8);\n\t\tvar c = new jsbn(crypto.randomBytes(cByteLen));\n\n\t\tvar n1 = n.subtract(jsbn.ONE);\n\t\tvar priv = c.mod(n1).add(jsbn.ONE);\n\t\tvar pub = ecParams.getG().multiply(priv);\n\n\t\tpriv = Buffer.from(priv.toByteArray());\n\t\tpub = Buffer.from(ecParams.getCurve().\n\t\t encodePointHex(pub), 'hex');\n\n\t\tparts.push({name: 'curve', data: Buffer.from(curve)});\n\t\tparts.push({name: 'Q', data: pub});\n\t\tparts.push({name: 'd', data: priv});\n\n\t\tkey = new PrivateKey({\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tparts: parts\n\t\t});\n\t\treturn (key);\n\t}\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tVerifier: Verifier,\n\tSigner: Signer\n};\n\nvar nacl = require('tweetnacl');\nvar stream = require('stream');\nvar util = require('util');\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar Signature = require('./signature');\n\nfunction Verifier(key, hashAlgo) {\n\tif (hashAlgo.toLowerCase() !== 'sha512')\n\t\tthrow (new Error('ED25519 only supports the use of ' +\n\t\t 'SHA-512 hashes'));\n\n\tthis.key = key;\n\tthis.chunks = [];\n\n\tstream.Writable.call(this, {});\n}\nutil.inherits(Verifier, stream.Writable);\n\nVerifier.prototype._write = function (chunk, enc, cb) {\n\tthis.chunks.push(chunk);\n\tcb();\n};\n\nVerifier.prototype.update = function (chunk) {\n\tif (typeof (chunk) === 'string')\n\t\tchunk = Buffer.from(chunk, 'binary');\n\tthis.chunks.push(chunk);\n};\n\nVerifier.prototype.verify = function (signature, fmt) {\n\tvar sig;\n\tif (Signature.isSignature(signature, [2, 0])) {\n\t\tif (signature.type !== 'ed25519')\n\t\t\treturn (false);\n\t\tsig = signature.toBuffer('raw');\n\n\t} else if (typeof (signature) === 'string') {\n\t\tsig = Buffer.from(signature, 'base64');\n\n\t} else if (Signature.isSignature(signature, [1, 0])) {\n\t\tthrow (new Error('signature was created by too old ' +\n\t\t 'a version of sshpk and cannot be verified'));\n\t}\n\n\tassert.buffer(sig);\n\treturn (nacl.sign.detached.verify(\n\t new Uint8Array(Buffer.concat(this.chunks)),\n\t new Uint8Array(sig),\n\t new Uint8Array(this.key.part.A.data)));\n};\n\nfunction Signer(key, hashAlgo) {\n\tif (hashAlgo.toLowerCase() !== 'sha512')\n\t\tthrow (new Error('ED25519 only supports the use of ' +\n\t\t 'SHA-512 hashes'));\n\n\tthis.key = key;\n\tthis.chunks = [];\n\n\tstream.Writable.call(this, {});\n}\nutil.inherits(Signer, stream.Writable);\n\nSigner.prototype._write = function (chunk, enc, cb) {\n\tthis.chunks.push(chunk);\n\tcb();\n};\n\nSigner.prototype.update = function (chunk) {\n\tif (typeof (chunk) === 'string')\n\t\tchunk = Buffer.from(chunk, 'binary');\n\tthis.chunks.push(chunk);\n};\n\nSigner.prototype.sign = function () {\n\tvar sig = nacl.sign.detached(\n\t new Uint8Array(Buffer.concat(this.chunks)),\n\t new Uint8Array(Buffer.concat([\n\t\tthis.key.part.k.data, this.key.part.A.data])));\n\tvar sigBuf = Buffer.from(sig);\n\tvar sigObj = Signature.parse(sigBuf, 'ed25519', 'raw');\n\tsigObj.hashAlgorithm = 'sha512';\n\treturn (sigObj);\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar assert = require('assert-plus');\nvar util = require('util');\n\nfunction FingerprintFormatError(fp, format) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, FingerprintFormatError);\n\tthis.name = 'FingerprintFormatError';\n\tthis.fingerprint = fp;\n\tthis.format = format;\n\tthis.message = 'Fingerprint format is not supported, or is invalid: ';\n\tif (fp !== undefined)\n\t\tthis.message += ' fingerprint = ' + fp;\n\tif (format !== undefined)\n\t\tthis.message += ' format = ' + format;\n}\nutil.inherits(FingerprintFormatError, Error);\n\nfunction InvalidAlgorithmError(alg) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, InvalidAlgorithmError);\n\tthis.name = 'InvalidAlgorithmError';\n\tthis.algorithm = alg;\n\tthis.message = 'Algorithm \"' + alg + '\" is not supported';\n}\nutil.inherits(InvalidAlgorithmError, Error);\n\nfunction KeyParseError(name, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, KeyParseError);\n\tthis.name = 'KeyParseError';\n\tthis.format = format;\n\tthis.keyName = name;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse ' + name + ' as a valid ' + format +\n\t ' format key: ' + innerErr.message;\n}\nutil.inherits(KeyParseError, Error);\n\nfunction SignatureParseError(type, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, SignatureParseError);\n\tthis.name = 'SignatureParseError';\n\tthis.type = type;\n\tthis.format = format;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse the given data as a ' + type +\n\t ' signature in ' + format + ' format: ' + innerErr.message;\n}\nutil.inherits(SignatureParseError, Error);\n\nfunction CertificateParseError(name, format, innerErr) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, CertificateParseError);\n\tthis.name = 'CertificateParseError';\n\tthis.format = format;\n\tthis.certName = name;\n\tthis.innerErr = innerErr;\n\tthis.message = 'Failed to parse ' + name + ' as a valid ' + format +\n\t ' format certificate: ' + innerErr.message;\n}\nutil.inherits(CertificateParseError, Error);\n\nfunction KeyEncryptedError(name, format) {\n\tif (Error.captureStackTrace)\n\t\tError.captureStackTrace(this, KeyEncryptedError);\n\tthis.name = 'KeyEncryptedError';\n\tthis.format = format;\n\tthis.keyName = name;\n\tthis.message = 'The ' + format + ' format key ' + name + ' is ' +\n\t 'encrypted (password-protected), and no passphrase was ' +\n\t 'provided in `options`';\n}\nutil.inherits(KeyEncryptedError, Error);\n\nmodule.exports = {\n\tFingerprintFormatError: FingerprintFormatError,\n\tInvalidAlgorithmError: InvalidAlgorithmError,\n\tKeyParseError: KeyParseError,\n\tSignatureParseError: SignatureParseError,\n\tKeyEncryptedError: KeyEncryptedError,\n\tCertificateParseError: CertificateParseError\n};\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = Fingerprint;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar errs = require('./errors');\nvar Key = require('./key');\nvar PrivateKey = require('./private-key');\nvar Certificate = require('./certificate');\nvar utils = require('./utils');\n\nvar FingerprintFormatError = errs.FingerprintFormatError;\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\n\nfunction Fingerprint(opts) {\n\tassert.object(opts, 'options');\n\tassert.string(opts.type, 'options.type');\n\tassert.buffer(opts.hash, 'options.hash');\n\tassert.string(opts.algorithm, 'options.algorithm');\n\n\tthis.algorithm = opts.algorithm.toLowerCase();\n\tif (algs.hashAlgs[this.algorithm] !== true)\n\t\tthrow (new InvalidAlgorithmError(this.algorithm));\n\n\tthis.hash = opts.hash;\n\tthis.type = opts.type;\n\tthis.hashType = opts.hashType;\n}\n\nFingerprint.prototype.toString = function (format) {\n\tif (format === undefined) {\n\t\tif (this.algorithm === 'md5' || this.hashType === 'spki')\n\t\t\tformat = 'hex';\n\t\telse\n\t\t\tformat = 'base64';\n\t}\n\tassert.string(format);\n\n\tswitch (format) {\n\tcase 'hex':\n\t\tif (this.hashType === 'spki')\n\t\t\treturn (this.hash.toString('hex'));\n\t\treturn (addColons(this.hash.toString('hex')));\n\tcase 'base64':\n\t\tif (this.hashType === 'spki')\n\t\t\treturn (this.hash.toString('base64'));\n\t\treturn (sshBase64Format(this.algorithm,\n\t\t this.hash.toString('base64')));\n\tdefault:\n\t\tthrow (new FingerprintFormatError(undefined, format));\n\t}\n};\n\nFingerprint.prototype.matches = function (other) {\n\tassert.object(other, 'key or certificate');\n\tif (this.type === 'key' && this.hashType !== 'ssh') {\n\t\tutils.assertCompatible(other, Key, [1, 7], 'key with spki');\n\t\tif (PrivateKey.isPrivateKey(other)) {\n\t\t\tutils.assertCompatible(other, PrivateKey, [1, 6],\n\t\t\t 'privatekey with spki support');\n\t\t}\n\t} else if (this.type === 'key') {\n\t\tutils.assertCompatible(other, Key, [1, 0], 'key');\n\t} else {\n\t\tutils.assertCompatible(other, Certificate, [1, 0],\n\t\t 'certificate');\n\t}\n\n\tvar theirHash = other.hash(this.algorithm, this.hashType);\n\tvar theirHash2 = crypto.createHash(this.algorithm).\n\t update(theirHash).digest('base64');\n\n\tif (this.hash2 === undefined)\n\t\tthis.hash2 = crypto.createHash(this.algorithm).\n\t\t update(this.hash).digest('base64');\n\n\treturn (this.hash2 === theirHash2);\n};\n\n/*JSSTYLED*/\nvar base64RE = /^[A-Za-z0-9+\\/=]+$/;\n/*JSSTYLED*/\nvar hexRE = /^[a-fA-F0-9]+$/;\n\nFingerprint.parse = function (fp, options) {\n\tassert.string(fp, 'fingerprint');\n\n\tvar alg, hash, enAlgs;\n\tif (Array.isArray(options)) {\n\t\tenAlgs = options;\n\t\toptions = {};\n\t}\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tif (options.enAlgs !== undefined)\n\t\tenAlgs = options.enAlgs;\n\tif (options.algorithms !== undefined)\n\t\tenAlgs = options.algorithms;\n\tassert.optionalArrayOfString(enAlgs, 'algorithms');\n\n\tvar hashType = 'ssh';\n\tif (options.hashType !== undefined)\n\t\thashType = options.hashType;\n\tassert.string(hashType, 'options.hashType');\n\n\tvar parts = fp.split(':');\n\tif (parts.length == 2) {\n\t\talg = parts[0].toLowerCase();\n\t\tif (!base64RE.test(parts[1]))\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\ttry {\n\t\t\thash = Buffer.from(parts[1], 'base64');\n\t\t} catch (e) {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\t} else if (parts.length > 2) {\n\t\talg = 'md5';\n\t\tif (parts[0].toLowerCase() === 'md5')\n\t\t\tparts = parts.slice(1);\n\t\tparts = parts.map(function (p) {\n\t\t\twhile (p.length < 2)\n\t\t\t\tp = '0' + p;\n\t\t\tif (p.length > 2)\n\t\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t\treturn (p);\n\t\t});\n\t\tparts = parts.join('');\n\t\tif (!hexRE.test(parts) || parts.length % 2 !== 0)\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\ttry {\n\t\t\thash = Buffer.from(parts, 'hex');\n\t\t} catch (e) {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\t} else {\n\t\tif (hexRE.test(fp)) {\n\t\t\thash = Buffer.from(fp, 'hex');\n\t\t} else if (base64RE.test(fp)) {\n\t\t\thash = Buffer.from(fp, 'base64');\n\t\t} else {\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\n\t\tswitch (hash.length) {\n\t\tcase 32:\n\t\t\talg = 'sha256';\n\t\t\tbreak;\n\t\tcase 16:\n\t\t\talg = 'md5';\n\t\t\tbreak;\n\t\tcase 20:\n\t\t\talg = 'sha1';\n\t\t\tbreak;\n\t\tcase 64:\n\t\t\talg = 'sha512';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new FingerprintFormatError(fp));\n\t\t}\n\n\t\t/* Plain hex/base64: guess it's probably SPKI unless told. */\n\t\tif (options.hashType === undefined)\n\t\t\thashType = 'spki';\n\t}\n\n\tif (alg === undefined)\n\t\tthrow (new FingerprintFormatError(fp));\n\n\tif (algs.hashAlgs[alg] === undefined)\n\t\tthrow (new InvalidAlgorithmError(alg));\n\n\tif (enAlgs !== undefined) {\n\t\tenAlgs = enAlgs.map(function (a) { return a.toLowerCase(); });\n\t\tif (enAlgs.indexOf(alg) === -1)\n\t\t\tthrow (new InvalidAlgorithmError(alg));\n\t}\n\n\treturn (new Fingerprint({\n\t\talgorithm: alg,\n\t\thash: hash,\n\t\ttype: options.type || 'key',\n\t\thashType: hashType\n\t}));\n};\n\nfunction addColons(s) {\n\t/*JSSTYLED*/\n\treturn (s.replace(/(.{2})(?=.)/g, '$1:'));\n}\n\nfunction base64Strip(s) {\n\t/*JSSTYLED*/\n\treturn (s.replace(/=*$/, ''));\n}\n\nfunction sshBase64Format(alg, h) {\n\treturn (alg.toUpperCase() + ':' + base64Strip(h));\n}\n\nFingerprint.isFingerprint = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Fingerprint, ver));\n};\n\n/*\n * API versions for Fingerprint:\n * [1,0] -- initial ver\n * [1,1] -- first tagged ver\n * [1,2] -- hashType and spki support\n */\nFingerprint.prototype._sshpkApiVersion = [1, 2];\n\nFingerprint._oldVersionDetect = function (obj) {\n\tassert.func(obj.toString);\n\tassert.func(obj.matches);\n\treturn ([1, 0]);\n};\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\n\nvar pem = require('./pem');\nvar ssh = require('./ssh');\nvar rfc4253 = require('./rfc4253');\nvar dnssec = require('./dnssec');\nvar putty = require('./putty');\n\nvar DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1';\n\nfunction read(buf, options) {\n\tif (typeof (buf) === 'string') {\n\t\tif (buf.trim().match(/^[-]+[ ]*BEGIN/))\n\t\t\treturn (pem.read(buf, options));\n\t\tif (buf.match(/^\\s*ssh-[a-z]/))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (buf.match(/^\\s*ecdsa-/))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (buf.match(/^putty-user-key-file-2:/i))\n\t\t\treturn (putty.read(buf, options));\n\t\tif (findDNSSECHeader(buf))\n\t\t\treturn (dnssec.read(buf, options));\n\t\tbuf = Buffer.from(buf, 'binary');\n\t} else {\n\t\tassert.buffer(buf);\n\t\tif (findPEMHeader(buf))\n\t\t\treturn (pem.read(buf, options));\n\t\tif (findSSHHeader(buf))\n\t\t\treturn (ssh.read(buf, options));\n\t\tif (findPuTTYHeader(buf))\n\t\t\treturn (putty.read(buf, options));\n\t\tif (findDNSSECHeader(buf))\n\t\t\treturn (dnssec.read(buf, options));\n\t}\n\tif (buf.readUInt32BE(0) < buf.length)\n\t\treturn (rfc4253.read(buf, options));\n\tthrow (new Error('Failed to auto-detect format of key'));\n}\n\nfunction findPuTTYHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9))\n\t\t++offset;\n\tif (offset + 22 <= buf.length &&\n\t buf.slice(offset, offset + 22).toString('ascii').toLowerCase() ===\n\t 'putty-user-key-file-2:')\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction findSSHHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9))\n\t\t++offset;\n\tif (offset + 4 <= buf.length &&\n\t buf.slice(offset, offset + 4).toString('ascii') === 'ssh-')\n\t\treturn (true);\n\tif (offset + 6 <= buf.length &&\n\t buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-')\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction findPEMHeader(buf) {\n\tvar offset = 0;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32 || buf[offset] === 10))\n\t\t++offset;\n\tif (buf[offset] !== 45)\n\t\treturn (false);\n\twhile (offset < buf.length &&\n\t (buf[offset] === 45))\n\t\t++offset;\n\twhile (offset < buf.length &&\n\t (buf[offset] === 32))\n\t\t++offset;\n\tif (offset + 5 > buf.length ||\n\t buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN')\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction findDNSSECHeader(buf) {\n\t// private case first\n\tif (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length)\n\t\treturn (false);\n\tvar headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length);\n\tif (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX)\n\t\treturn (true);\n\n\t// public-key RFC3110 ?\n\t// 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...'\n\t// skip any comment-lines\n\tif (typeof (buf) !== 'string') {\n\t\tbuf = buf.toString('ascii');\n\t}\n\tvar lines = buf.split('\\n');\n\tvar line = 0;\n\t/* JSSTYLED */\n\twhile (lines[line].match(/^\\;/))\n\t\tline++;\n\tif (lines[line].toString('ascii').match(/\\. IN KEY /))\n\t\treturn (true);\n\tif (lines[line].toString('ascii').match(/\\. IN DNSKEY /))\n\t\treturn (true);\n\treturn (false);\n}\n\nfunction write(key, options) {\n\tthrow (new Error('\"auto\" format cannot be used for writing'));\n}\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar utils = require('../utils');\nvar SSHBuffer = require('../ssh-buffer');\nvar Dhe = require('../dhe');\n\nvar supportedAlgos = {\n\t'rsa-sha1' : 5,\n\t'rsa-sha256' : 8,\n\t'rsa-sha512' : 10,\n\t'ecdsa-p256-sha256' : 13,\n\t'ecdsa-p384-sha384' : 14\n\t/*\n\t * ed25519 is hypothetically supported with id 15\n\t * but the common tools available don't appear to be\n\t * capable of generating/using ed25519 keys\n\t */\n};\n\nvar supportedAlgosById = {};\nObject.keys(supportedAlgos).forEach(function (k) {\n\tsupportedAlgosById[supportedAlgos[k]] = k.toUpperCase();\n});\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\tvar lines = buf.split('\\n');\n\tif (lines[0].match(/^Private-key-format\\: v1/)) {\n\t\tvar algElems = lines[1].split(' ');\n\t\tvar algoNum = parseInt(algElems[1], 10);\n\t\tvar algoName = algElems[2];\n\t\tif (!supportedAlgosById[algoNum])\n\t\t\tthrow (new Error('Unsupported algorithm: ' + algoName));\n\t\treturn (readDNSSECPrivateKey(algoNum, lines.slice(2)));\n\t}\n\n\t// skip any comment-lines\n\tvar line = 0;\n\t/* JSSTYLED */\n\twhile (lines[line].match(/^\\;/))\n\t\tline++;\n\t// we should now have *one single* line left with our KEY on it.\n\tif ((lines[line].match(/\\. IN KEY /) ||\n\t lines[line].match(/\\. IN DNSKEY /)) && lines[line+1].length === 0) {\n\t\treturn (readRFC3110(lines[line]));\n\t}\n\tthrow (new Error('Cannot parse dnssec key'));\n}\n\nfunction readRFC3110(keyString) {\n\tvar elems = keyString.split(' ');\n\t//unused var flags = parseInt(elems[3], 10);\n\t//unused var protocol = parseInt(elems[4], 10);\n\tvar algorithm = parseInt(elems[5], 10);\n\tif (!supportedAlgosById[algorithm])\n\t\tthrow (new Error('Unsupported algorithm: ' + algorithm));\n\tvar base64key = elems.slice(6, elems.length).join();\n\tvar keyBuffer = Buffer.from(base64key, 'base64');\n\tif (supportedAlgosById[algorithm].match(/^RSA-/)) {\n\t\t// join the rest of the body into a single base64-blob\n\t\tvar publicExponentLen = keyBuffer.readUInt8(0);\n\t\tif (publicExponentLen != 3 && publicExponentLen != 1)\n\t\t\tthrow (new Error('Cannot parse dnssec key: ' +\n\t\t\t 'unsupported exponent length'));\n\n\t\tvar publicExponent = keyBuffer.slice(1, publicExponentLen+1);\n\t\tpublicExponent = utils.mpNormalize(publicExponent);\n\t\tvar modulus = keyBuffer.slice(1+publicExponentLen);\n\t\tmodulus = utils.mpNormalize(modulus);\n\t\t// now, make the key\n\t\tvar rsaKey = {\n\t\t\ttype: 'rsa',\n\t\t\tparts: []\n\t\t};\n\t\trsaKey.parts.push({ name: 'e', data: publicExponent});\n\t\trsaKey.parts.push({ name: 'n', data: modulus});\n\t\treturn (new Key(rsaKey));\n\t}\n\tif (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' ||\n\t supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') {\n\t\tvar curve = 'nistp384';\n\t\tvar size = 384;\n\t\tif (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) {\n\t\t\tcurve = 'nistp256';\n\t\t\tsize = 256;\n\t\t}\n\n\t\tvar ecdsaKey = {\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tsize: size,\n\t\t\tparts: [\n\t\t\t\t{name: 'curve', data: Buffer.from(curve) },\n\t\t\t\t{name: 'Q', data: utils.ecNormalize(keyBuffer) }\n\t\t\t]\n\t\t};\n\t\treturn (new Key(ecdsaKey));\n\t}\n\tthrow (new Error('Unsupported algorithm: ' +\n\t supportedAlgosById[algorithm]));\n}\n\nfunction elementToBuf(e) {\n\treturn (Buffer.from(e.split(' ')[1], 'base64'));\n}\n\nfunction readDNSSECRSAPrivateKey(elements) {\n\tvar rsaParams = {};\n\telements.forEach(function (element) {\n\t\tif (element.split(' ')[0] === 'Modulus:')\n\t\t\trsaParams['n'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'PublicExponent:')\n\t\t\trsaParams['e'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'PrivateExponent:')\n\t\t\trsaParams['d'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Prime1:')\n\t\t\trsaParams['p'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Prime2:')\n\t\t\trsaParams['q'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Exponent1:')\n\t\t\trsaParams['dmodp'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Exponent2:')\n\t\t\trsaParams['dmodq'] = elementToBuf(element);\n\t\telse if (element.split(' ')[0] === 'Coefficient:')\n\t\t\trsaParams['iqmp'] = elementToBuf(element);\n\t});\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'e', data: utils.mpNormalize(rsaParams['e'])},\n\t\t\t{ name: 'n', data: utils.mpNormalize(rsaParams['n'])},\n\t\t\t{ name: 'd', data: utils.mpNormalize(rsaParams['d'])},\n\t\t\t{ name: 'p', data: utils.mpNormalize(rsaParams['p'])},\n\t\t\t{ name: 'q', data: utils.mpNormalize(rsaParams['q'])},\n\t\t\t{ name: 'dmodp',\n\t\t\t data: utils.mpNormalize(rsaParams['dmodp'])},\n\t\t\t{ name: 'dmodq',\n\t\t\t data: utils.mpNormalize(rsaParams['dmodq'])},\n\t\t\t{ name: 'iqmp',\n\t\t\t data: utils.mpNormalize(rsaParams['iqmp'])}\n\t\t]\n\t};\n\treturn (new PrivateKey(key));\n}\n\nfunction readDNSSECPrivateKey(alg, elements) {\n\tif (supportedAlgosById[alg].match(/^RSA-/)) {\n\t\treturn (readDNSSECRSAPrivateKey(elements));\n\t}\n\tif (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' ||\n\t supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {\n\t\tvar d = Buffer.from(elements[0].split(' ')[1], 'base64');\n\t\tvar curve = 'nistp384';\n\t\tvar size = 384;\n\t\tif (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {\n\t\t\tcurve = 'nistp256';\n\t\t\tsize = 256;\n\t\t}\n\t\t// DNSSEC generates the public-key on the fly (go calculate it)\n\t\tvar publicKey = utils.publicFromPrivateECDSA(curve, d);\n\t\tvar Q = publicKey.part['Q'].data;\n\t\tvar ecdsaKey = {\n\t\t\ttype: 'ecdsa',\n\t\t\tcurve: curve,\n\t\t\tsize: size,\n\t\t\tparts: [\n\t\t\t\t{name: 'curve', data: Buffer.from(curve) },\n\t\t\t\t{name: 'd', data: d },\n\t\t\t\t{name: 'Q', data: Q }\n\t\t\t]\n\t\t};\n\t\treturn (new PrivateKey(ecdsaKey));\n\t}\n\tthrow (new Error('Unsupported algorithm: ' + supportedAlgosById[alg]));\n}\n\nfunction dnssecTimestamp(date) {\n\tvar year = date.getFullYear() + ''; //stringify\n\tvar month = (date.getMonth() + 1);\n\tvar timestampStr = year + month + date.getUTCDate();\n\ttimestampStr += '' + date.getUTCHours() + date.getUTCMinutes();\n\ttimestampStr += date.getUTCSeconds();\n\treturn (timestampStr);\n}\n\nfunction rsaAlgFromOptions(opts) {\n\tif (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1')\n\t\treturn ('5 (RSASHA1)');\n\telse if (opts.hashAlgo === 'sha256')\n\t\treturn ('8 (RSASHA256)');\n\telse if (opts.hashAlgo === 'sha512')\n\t\treturn ('10 (RSASHA512)');\n\telse\n\t\tthrow (new Error('Unknown or unsupported hash: ' +\n\t\t opts.hashAlgo));\n}\n\nfunction writeRSA(key, options) {\n\t// if we're missing parts, add them.\n\tif (!key.part.dmodp || !key.part.dmodq) {\n\t\tutils.addRSAMissing(key);\n\t}\n\n\tvar out = '';\n\tout += 'Private-key-format: v1.3\\n';\n\tout += 'Algorithm: ' + rsaAlgFromOptions(options) + '\\n';\n\tvar n = utils.mpDenormalize(key.part['n'].data);\n\tout += 'Modulus: ' + n.toString('base64') + '\\n';\n\tvar e = utils.mpDenormalize(key.part['e'].data);\n\tout += 'PublicExponent: ' + e.toString('base64') + '\\n';\n\tvar d = utils.mpDenormalize(key.part['d'].data);\n\tout += 'PrivateExponent: ' + d.toString('base64') + '\\n';\n\tvar p = utils.mpDenormalize(key.part['p'].data);\n\tout += 'Prime1: ' + p.toString('base64') + '\\n';\n\tvar q = utils.mpDenormalize(key.part['q'].data);\n\tout += 'Prime2: ' + q.toString('base64') + '\\n';\n\tvar dmodp = utils.mpDenormalize(key.part['dmodp'].data);\n\tout += 'Exponent1: ' + dmodp.toString('base64') + '\\n';\n\tvar dmodq = utils.mpDenormalize(key.part['dmodq'].data);\n\tout += 'Exponent2: ' + dmodq.toString('base64') + '\\n';\n\tvar iqmp = utils.mpDenormalize(key.part['iqmp'].data);\n\tout += 'Coefficient: ' + iqmp.toString('base64') + '\\n';\n\t// Assume that we're valid as-of now\n\tvar timestamp = new Date();\n\tout += 'Created: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Publish: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Activate: ' + dnssecTimestamp(timestamp) + '\\n';\n\treturn (Buffer.from(out, 'ascii'));\n}\n\nfunction writeECDSA(key, options) {\n\tvar out = '';\n\tout += 'Private-key-format: v1.3\\n';\n\n\tif (key.curve === 'nistp256') {\n\t\tout += 'Algorithm: 13 (ECDSAP256SHA256)\\n';\n\t} else if (key.curve === 'nistp384') {\n\t\tout += 'Algorithm: 14 (ECDSAP384SHA384)\\n';\n\t} else {\n\t\tthrow (new Error('Unsupported curve'));\n\t}\n\tvar base64Key = key.part['d'].data.toString('base64');\n\tout += 'PrivateKey: ' + base64Key + '\\n';\n\n\t// Assume that we're valid as-of now\n\tvar timestamp = new Date();\n\tout += 'Created: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Publish: ' + dnssecTimestamp(timestamp) + '\\n';\n\tout += 'Activate: ' + dnssecTimestamp(timestamp) + '\\n';\n\n\treturn (Buffer.from(out, 'ascii'));\n}\n\nfunction write(key, options) {\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tif (key.type === 'rsa') {\n\t\t\treturn (writeRSA(key, options));\n\t\t} else if (key.type === 'ecdsa') {\n\t\t\treturn (writeECDSA(key, options));\n\t\t} else {\n\t\t\tthrow (new Error('Unsupported algorithm: ' + key.type));\n\t\t}\n\t} else if (Key.isKey(key)) {\n\t\t/*\n\t\t * RFC3110 requires a keyname, and a keytype, which we\n\t\t * don't really have a mechanism for specifying such\n\t\t * additional metadata.\n\t\t */\n\t\tthrow (new Error('Format \"dnssec\" only supports ' +\n\t\t 'writing private keys'));\n\t} else {\n\t\tthrow (new Error('key is not a Key or PrivateKey'));\n\t}\n}\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\tverify: verify,\n\tsign: sign,\n\tsignAsync: signAsync,\n\twrite: write,\n\n\t/* Internal private API */\n\tfromBuffer: fromBuffer,\n\ttoBuffer: toBuffer\n};\n\nvar assert = require('assert-plus');\nvar SSHBuffer = require('../ssh-buffer');\nvar crypto = require('crypto');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar Identity = require('../identity');\nvar rfc4253 = require('./rfc4253');\nvar Signature = require('../signature');\nvar utils = require('../utils');\nvar Certificate = require('../certificate');\n\nfunction verify(cert, key) {\n\t/*\n\t * We always give an issuerKey, so if our verify() is being called then\n\t * there was no signature. Return false.\n\t */\n\treturn (false);\n}\n\nvar TYPES = {\n\t'user': 1,\n\t'host': 2\n};\nObject.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; });\n\nvar ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;\n\nfunction read(buf, options) {\n\tif (Buffer.isBuffer(buf))\n\t\tbuf = buf.toString('ascii');\n\tvar parts = buf.trim().split(/[ \\t\\n]+/g);\n\tif (parts.length < 2 || parts.length > 3)\n\t\tthrow (new Error('Not a valid SSH certificate line'));\n\n\tvar algo = parts[0];\n\tvar data = parts[1];\n\n\tdata = Buffer.from(data, 'base64');\n\treturn (fromBuffer(data, algo));\n}\n\nfunction fromBuffer(data, algo, partial) {\n\tvar sshbuf = new SSHBuffer({ buffer: data });\n\tvar innerAlgo = sshbuf.readString();\n\tif (algo !== undefined && innerAlgo !== algo)\n\t\tthrow (new Error('SSH certificate algorithm mismatch'));\n\tif (algo === undefined)\n\t\talgo = innerAlgo;\n\n\tvar cert = {};\n\tcert.signatures = {};\n\tcert.signatures.openssh = {};\n\n\tcert.signatures.openssh.nonce = sshbuf.readBuffer();\n\n\tvar key = {};\n\tvar parts = (key.parts = []);\n\tkey.type = getAlg(algo);\n\n\tvar partCount = algs.info[key.type].parts.length;\n\twhile (parts.length < partCount)\n\t\tparts.push(sshbuf.readPart());\n\tassert.ok(parts.length >= 1, 'key must have at least one part');\n\n\tvar algInfo = algs.info[key.type];\n\tif (key.type === 'ecdsa') {\n\t\tvar res = ECDSA_ALGO.exec(algo);\n\t\tassert.ok(res !== null);\n\t\tassert.strictEqual(res[1], parts[0].data.toString());\n\t}\n\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tparts[i].name = algInfo.parts[i];\n\t\tif (parts[i].name !== 'curve' &&\n\t\t algInfo.normalize !== false) {\n\t\t\tvar p = parts[i];\n\t\t\tp.data = utils.mpNormalize(p.data);\n\t\t}\n\t}\n\n\tcert.subjectKey = new Key(key);\n\n\tcert.serial = sshbuf.readInt64();\n\n\tvar type = TYPES[sshbuf.readInt()];\n\tassert.string(type, 'valid cert type');\n\n\tcert.signatures.openssh.keyId = sshbuf.readString();\n\n\tvar principals = [];\n\tvar pbuf = sshbuf.readBuffer();\n\tvar psshbuf = new SSHBuffer({ buffer: pbuf });\n\twhile (!psshbuf.atEnd())\n\t\tprincipals.push(psshbuf.readString());\n\tif (principals.length === 0)\n\t\tprincipals = ['*'];\n\n\tcert.subjects = principals.map(function (pr) {\n\t\tif (type === 'user')\n\t\t\treturn (Identity.forUser(pr));\n\t\telse if (type === 'host')\n\t\t\treturn (Identity.forHost(pr));\n\t\tthrow (new Error('Unknown identity type ' + type));\n\t});\n\n\tcert.validFrom = int64ToDate(sshbuf.readInt64());\n\tcert.validUntil = int64ToDate(sshbuf.readInt64());\n\n\tvar exts = [];\n\tvar extbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() });\n\tvar ext;\n\twhile (!extbuf.atEnd()) {\n\t\text = { critical: true };\n\t\text.name = extbuf.readString();\n\t\text.data = extbuf.readBuffer();\n\t\texts.push(ext);\n\t}\n\textbuf = new SSHBuffer({ buffer: sshbuf.readBuffer() });\n\twhile (!extbuf.atEnd()) {\n\t\text = { critical: false };\n\t\text.name = extbuf.readString();\n\t\text.data = extbuf.readBuffer();\n\t\texts.push(ext);\n\t}\n\tcert.signatures.openssh.exts = exts;\n\n\t/* reserved */\n\tsshbuf.readBuffer();\n\n\tvar signingKeyBuf = sshbuf.readBuffer();\n\tcert.issuerKey = rfc4253.read(signingKeyBuf);\n\n\t/*\n\t * OpenSSH certs don't give the identity of the issuer, just their\n\t * public key. So, we use an Identity that matches anything. The\n\t * isSignedBy() function will later tell you if the key matches.\n\t */\n\tcert.issuer = Identity.forHost('**');\n\n\tvar sigBuf = sshbuf.readBuffer();\n\tcert.signatures.openssh.signature =\n\t Signature.parse(sigBuf, cert.issuerKey.type, 'ssh');\n\n\tif (partial !== undefined) {\n\t\tpartial.remainder = sshbuf.remainder();\n\t\tpartial.consumed = sshbuf._offset;\n\t}\n\n\treturn (new Certificate(cert));\n}\n\nfunction int64ToDate(buf) {\n\tvar i = buf.readUInt32BE(0) * 4294967296;\n\ti += buf.readUInt32BE(4);\n\tvar d = new Date();\n\td.setTime(i * 1000);\n\td.sourceInt64 = buf;\n\treturn (d);\n}\n\nfunction dateToInt64(date) {\n\tif (date.sourceInt64 !== undefined)\n\t\treturn (date.sourceInt64);\n\tvar i = Math.round(date.getTime() / 1000);\n\tvar upper = Math.floor(i / 4294967296);\n\tvar lower = Math.floor(i % 4294967296);\n\tvar buf = Buffer.alloc(8);\n\tbuf.writeUInt32BE(upper, 0);\n\tbuf.writeUInt32BE(lower, 4);\n\treturn (buf);\n}\n\nfunction sign(cert, key) {\n\tif (cert.signatures.openssh === undefined)\n\t\tcert.signatures.openssh = {};\n\ttry {\n\t\tvar blob = toBuffer(cert, true);\n\t} catch (e) {\n\t\tdelete (cert.signatures.openssh);\n\t\treturn (false);\n\t}\n\tvar sig = cert.signatures.openssh;\n\tvar hashAlgo = undefined;\n\tif (key.type === 'rsa' || key.type === 'dsa')\n\t\thashAlgo = 'sha1';\n\tvar signer = key.createSign(hashAlgo);\n\tsigner.write(blob);\n\tsig.signature = signer.sign();\n\treturn (true);\n}\n\nfunction signAsync(cert, signer, done) {\n\tif (cert.signatures.openssh === undefined)\n\t\tcert.signatures.openssh = {};\n\ttry {\n\t\tvar blob = toBuffer(cert, true);\n\t} catch (e) {\n\t\tdelete (cert.signatures.openssh);\n\t\tdone(e);\n\t\treturn;\n\t}\n\tvar sig = cert.signatures.openssh;\n\n\tsigner(blob, function (err, signature) {\n\t\tif (err) {\n\t\t\tdone(err);\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\t/*\n\t\t\t * This will throw if the signature isn't of a\n\t\t\t * type/algo that can be used for SSH.\n\t\t\t */\n\t\t\tsignature.toBuffer('ssh');\n\t\t} catch (e) {\n\t\t\tdone(e);\n\t\t\treturn;\n\t\t}\n\t\tsig.signature = signature;\n\t\tdone();\n\t});\n}\n\nfunction write(cert, options) {\n\tif (options === undefined)\n\t\toptions = {};\n\n\tvar blob = toBuffer(cert);\n\tvar out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64');\n\tif (options.comment)\n\t\tout = out + ' ' + options.comment;\n\treturn (out);\n}\n\n\nfunction toBuffer(cert, noSig) {\n\tassert.object(cert.signatures.openssh, 'signature for openssh format');\n\tvar sig = cert.signatures.openssh;\n\n\tif (sig.nonce === undefined)\n\t\tsig.nonce = crypto.randomBytes(16);\n\tvar buf = new SSHBuffer({});\n\tbuf.writeString(getCertType(cert.subjectKey));\n\tbuf.writeBuffer(sig.nonce);\n\n\tvar key = cert.subjectKey;\n\tvar algInfo = algs.info[key.type];\n\talgInfo.parts.forEach(function (part) {\n\t\tbuf.writePart(key.part[part]);\n\t});\n\n\tbuf.writeInt64(cert.serial);\n\n\tvar type = cert.subjects[0].type;\n\tassert.notStrictEqual(type, 'unknown');\n\tcert.subjects.forEach(function (id) {\n\t\tassert.strictEqual(id.type, type);\n\t});\n\ttype = TYPES[type];\n\tbuf.writeInt(type);\n\n\tif (sig.keyId === undefined) {\n\t\tsig.keyId = cert.subjects[0].type + '_' +\n\t\t (cert.subjects[0].uid || cert.subjects[0].hostname);\n\t}\n\tbuf.writeString(sig.keyId);\n\n\tvar sub = new SSHBuffer({});\n\tcert.subjects.forEach(function (id) {\n\t\tif (type === TYPES.host)\n\t\t\tsub.writeString(id.hostname);\n\t\telse if (type === TYPES.user)\n\t\t\tsub.writeString(id.uid);\n\t});\n\tbuf.writeBuffer(sub.toBuffer());\n\n\tbuf.writeInt64(dateToInt64(cert.validFrom));\n\tbuf.writeInt64(dateToInt64(cert.validUntil));\n\n\tvar exts = sig.exts;\n\tif (exts === undefined)\n\t\texts = [];\n\n\tvar extbuf = new SSHBuffer({});\n\texts.forEach(function (ext) {\n\t\tif (ext.critical !== true)\n\t\t\treturn;\n\t\textbuf.writeString(ext.name);\n\t\textbuf.writeBuffer(ext.data);\n\t});\n\tbuf.writeBuffer(extbuf.toBuffer());\n\n\textbuf = new SSHBuffer({});\n\texts.forEach(function (ext) {\n\t\tif (ext.critical === true)\n\t\t\treturn;\n\t\textbuf.writeString(ext.name);\n\t\textbuf.writeBuffer(ext.data);\n\t});\n\tbuf.writeBuffer(extbuf.toBuffer());\n\n\t/* reserved */\n\tbuf.writeBuffer(Buffer.alloc(0));\n\n\tsub = rfc4253.write(cert.issuerKey);\n\tbuf.writeBuffer(sub);\n\n\tif (!noSig)\n\t\tbuf.writeBuffer(sig.signature.toBuffer('ssh'));\n\n\treturn (buf.toBuffer());\n}\n\nfunction getAlg(certType) {\n\tif (certType === 'ssh-rsa-cert-v01@openssh.com')\n\t\treturn ('rsa');\n\tif (certType === 'ssh-dss-cert-v01@openssh.com')\n\t\treturn ('dsa');\n\tif (certType.match(ECDSA_ALGO))\n\t\treturn ('ecdsa');\n\tif (certType === 'ssh-ed25519-cert-v01@openssh.com')\n\t\treturn ('ed25519');\n\tthrow (new Error('Unsupported cert type ' + certType));\n}\n\nfunction getCertType(key) {\n\tif (key.type === 'rsa')\n\t\treturn ('ssh-rsa-cert-v01@openssh.com');\n\tif (key.type === 'dsa')\n\t\treturn ('ssh-dss-cert-v01@openssh.com');\n\tif (key.type === 'ecdsa')\n\t\treturn ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com');\n\tif (key.type === 'ed25519')\n\t\treturn ('ssh-ed25519-cert-v01@openssh.com');\n\tthrow (new Error('Unsupported key type ' + key.type));\n}\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar crypto = require('crypto');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\n\nvar pkcs1 = require('./pkcs1');\nvar pkcs8 = require('./pkcs8');\nvar sshpriv = require('./ssh-private');\nvar rfc4253 = require('./rfc4253');\n\nvar errors = require('../errors');\n\nvar OID_PBES2 = '1.2.840.113549.1.5.13';\nvar OID_PBKDF2 = '1.2.840.113549.1.5.12';\n\nvar OID_TO_CIPHER = {\n\t'1.2.840.113549.3.7': '3des-cbc',\n\t'2.16.840.1.101.3.4.1.2': 'aes128-cbc',\n\t'2.16.840.1.101.3.4.1.42': 'aes256-cbc'\n};\nvar CIPHER_TO_OID = {};\nObject.keys(OID_TO_CIPHER).forEach(function (k) {\n\tCIPHER_TO_OID[OID_TO_CIPHER[k]] = k;\n});\n\nvar OID_TO_HASH = {\n\t'1.2.840.113549.2.7': 'sha1',\n\t'1.2.840.113549.2.9': 'sha256',\n\t'1.2.840.113549.2.11': 'sha512'\n};\nvar HASH_TO_OID = {};\nObject.keys(OID_TO_HASH).forEach(function (k) {\n\tHASH_TO_OID[OID_TO_HASH[k]] = k;\n});\n\n/*\n * For reading we support both PKCS#1 and PKCS#8. If we find a private key,\n * we just take the public component of it and use that.\n */\nfunction read(buf, options, forceType) {\n\tvar input = buf;\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar lines = buf.trim().split(/[\\r\\n]+/g);\n\n\tvar m;\n\tvar si = -1;\n\twhile (!m && si < lines.length) {\n\t\tm = lines[++si].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);\n\t}\n\tassert.ok(m, 'invalid PEM header');\n\n\tvar m2;\n\tvar ei = lines.length;\n\twhile (!m2 && ei > 0) {\n\t\tm2 = lines[--ei].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);\n\t}\n\tassert.ok(m2, 'invalid PEM footer');\n\n\t/* Begin and end banners must match key type */\n\tassert.equal(m[2], m2[2]);\n\tvar type = m[2].toLowerCase();\n\n\tvar alg;\n\tif (m[1]) {\n\t\t/* They also must match algorithms, if given */\n\t\tassert.equal(m[1], m2[1], 'PEM header and footer mismatch');\n\t\talg = m[1].trim();\n\t}\n\n\tlines = lines.slice(si, ei + 1);\n\n\tvar headers = {};\n\twhile (true) {\n\t\tlines = lines.slice(1);\n\t\tm = lines[0].match(/*JSSTYLED*/\n\t\t /^([A-Za-z0-9-]+): (.+)$/);\n\t\tif (!m)\n\t\t\tbreak;\n\t\theaders[m[1].toLowerCase()] = m[2];\n\t}\n\n\t/* Chop off the first and last lines */\n\tlines = lines.slice(0, -1).join('');\n\tbuf = Buffer.from(lines, 'base64');\n\n\tvar cipher, key, iv;\n\tif (headers['proc-type']) {\n\t\tvar parts = headers['proc-type'].split(',');\n\t\tif (parts[0] === '4' && parts[1] === 'ENCRYPTED') {\n\t\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\t\toptions.passphrase = Buffer.from(\n\t\t\t\t options.passphrase, 'utf-8');\n\t\t\t}\n\t\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t\t options.filename, 'PEM'));\n\t\t\t} else {\n\t\t\t\tparts = headers['dek-info'].split(',');\n\t\t\t\tassert.ok(parts.length === 2);\n\t\t\t\tcipher = parts[0].toLowerCase();\n\t\t\t\tiv = Buffer.from(parts[1], 'hex');\n\t\t\t\tkey = utils.opensslKeyDeriv(cipher, iv,\n\t\t\t\t options.passphrase, 1).key;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (alg && alg.toLowerCase() === 'encrypted') {\n\t\tvar eder = new asn1.BerReader(buf);\n\t\tvar pbesEnd;\n\t\teder.readSequence();\n\n\t\teder.readSequence();\n\t\tpbesEnd = eder.offset + eder.length;\n\n\t\tvar method = eder.readOID();\n\t\tif (method !== OID_PBES2) {\n\t\t\tthrow (new Error('Unsupported PEM/PKCS8 encryption ' +\n\t\t\t 'scheme: ' + method));\n\t\t}\n\n\t\teder.readSequence();\t/* PBES2-params */\n\n\t\teder.readSequence();\t/* keyDerivationFunc */\n\t\tvar kdfEnd = eder.offset + eder.length;\n\t\tvar kdfOid = eder.readOID();\n\t\tif (kdfOid !== OID_PBKDF2)\n\t\t\tthrow (new Error('Unsupported PBES2 KDF: ' + kdfOid));\n\t\teder.readSequence();\n\t\tvar salt = eder.readString(asn1.Ber.OctetString, true);\n\t\tvar iterations = eder.readInt();\n\t\tvar hashAlg = 'sha1';\n\t\tif (eder.offset < kdfEnd) {\n\t\t\teder.readSequence();\n\t\t\tvar hashAlgOid = eder.readOID();\n\t\t\thashAlg = OID_TO_HASH[hashAlgOid];\n\t\t\tif (hashAlg === undefined) {\n\t\t\t\tthrow (new Error('Unsupported PBKDF2 hash: ' +\n\t\t\t\t hashAlgOid));\n\t\t\t}\n\t\t}\n\t\teder._offset = kdfEnd;\n\n\t\teder.readSequence();\t/* encryptionScheme */\n\t\tvar cipherOid = eder.readOID();\n\t\tcipher = OID_TO_CIPHER[cipherOid];\n\t\tif (cipher === undefined) {\n\t\t\tthrow (new Error('Unsupported PBES2 cipher: ' +\n\t\t\t cipherOid));\n\t\t}\n\t\tiv = eder.readString(asn1.Ber.OctetString, true);\n\n\t\teder._offset = pbesEnd;\n\t\tbuf = eder.readString(asn1.Ber.OctetString, true);\n\n\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\toptions.passphrase = Buffer.from(\n\t\t\t options.passphrase, 'utf-8');\n\t\t}\n\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t options.filename, 'PEM'));\n\t\t}\n\n\t\tvar cinfo = utils.opensshCipherInfo(cipher);\n\n\t\tcipher = cinfo.opensslName;\n\t\tkey = utils.pbkdf2(hashAlg, salt, iterations, cinfo.keySize,\n\t\t options.passphrase);\n\t\talg = undefined;\n\t}\n\n\tif (cipher && key && iv) {\n\t\tvar cipherStream = crypto.createDecipheriv(cipher, key, iv);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tif (e.toString().indexOf('bad decrypt') !== -1) {\n\t\t\t\tthrow (new Error('Incorrect passphrase ' +\n\t\t\t\t 'supplied, could not decrypt key'));\n\t\t\t}\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(buf);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tbuf = Buffer.concat(chunks);\n\t}\n\n\t/* The new OpenSSH internal format abuses PEM headers */\n\tif (alg && alg.toLowerCase() === 'openssh')\n\t\treturn (sshpriv.readSSHPrivate(type, buf, options));\n\tif (alg && alg.toLowerCase() === 'ssh2')\n\t\treturn (rfc4253.readType(type, buf, options));\n\n\tvar der = new asn1.BerReader(buf);\n\tder.originalInput = input;\n\n\t/*\n\t * All of the PEM file types start with a sequence tag, so chop it\n\t * off here\n\t */\n\tder.readSequence();\n\n\t/* PKCS#1 type keys name an algorithm in the banner explicitly */\n\tif (alg) {\n\t\tif (forceType)\n\t\t\tassert.strictEqual(forceType, 'pkcs1');\n\t\treturn (pkcs1.readPkcs1(alg, type, der));\n\t} else {\n\t\tif (forceType)\n\t\t\tassert.strictEqual(forceType, 'pkcs8');\n\t\treturn (pkcs8.readPkcs8(alg, type, der));\n\t}\n}\n\nfunction write(key, options, type) {\n\tassert.object(key);\n\n\tvar alg = {\n\t 'ecdsa': 'EC',\n\t 'rsa': 'RSA',\n\t 'dsa': 'DSA',\n\t 'ed25519': 'EdDSA'\n\t}[key.type];\n\tvar header;\n\n\tvar der = new asn1.BerWriter();\n\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tif (type && type === 'pkcs8') {\n\t\t\theader = 'PRIVATE KEY';\n\t\t\tpkcs8.writePkcs8(der, key);\n\t\t} else {\n\t\t\tif (type)\n\t\t\t\tassert.strictEqual(type, 'pkcs1');\n\t\t\theader = alg + ' PRIVATE KEY';\n\t\t\tpkcs1.writePkcs1(der, key);\n\t\t}\n\n\t} else if (Key.isKey(key)) {\n\t\tif (type && type === 'pkcs1') {\n\t\t\theader = alg + ' PUBLIC KEY';\n\t\t\tpkcs1.writePkcs1(der, key);\n\t\t} else {\n\t\t\tif (type)\n\t\t\t\tassert.strictEqual(type, 'pkcs8');\n\t\t\theader = 'PUBLIC KEY';\n\t\t\tpkcs8.writePkcs8(der, key);\n\t\t}\n\n\t} else {\n\t\tthrow (new Error('key is not a Key or PrivateKey'));\n\t}\n\n\tvar tmp = der.buffer.toString('base64');\n\tvar len = tmp.length + (tmp.length / 64) +\n\t 18 + 16 + header.length*2 + 10;\n\tvar buf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 64;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadPkcs1: readPkcs1,\n\twrite: write,\n\twritePkcs1: writePkcs1\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\n\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\n\nvar pkcs8 = require('./pkcs8');\nvar readECDSACurve = pkcs8.readECDSACurve;\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options, 'pkcs1'));\n}\n\nfunction write(key, options) {\n\treturn (pem.write(key, options, 'pkcs1'));\n}\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction readPkcs1(alg, type, der) {\n\tswitch (alg) {\n\tcase 'RSA':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs1RSAPublic(der));\n\t\telse if (type === 'private')\n\t\t\treturn (readPkcs1RSAPrivate(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'DSA':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs1DSAPublic(der));\n\t\telse if (type === 'private')\n\t\t\treturn (readPkcs1DSAPrivate(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'EC':\n\tcase 'ECDSA':\n\t\tif (type === 'private')\n\t\t\treturn (readPkcs1ECDSAPrivate(der));\n\t\telse if (type === 'public')\n\t\t\treturn (readPkcs1ECDSAPublic(der));\n\t\tthrow (new Error('Unknown key type: ' + type));\n\tcase 'EDDSA':\n\tcase 'EdDSA':\n\t\tif (type === 'private')\n\t\t\treturn (readPkcs1EdDSAPrivate(der));\n\t\tthrow (new Error(type + ' keys not supported with EdDSA'));\n\tdefault:\n\t\tthrow (new Error('Unknown key algo: ' + alg));\n\t}\n}\n\nfunction readPkcs1RSAPublic(der) {\n\t// modulus and exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'exponent');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'n', data: n }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1RSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version[0], 0);\n\n\t// modulus then public exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'public exponent');\n\tvar d = readMPInt(der, 'private exponent');\n\tvar p = readMPInt(der, 'prime1');\n\tvar q = readMPInt(der, 'prime2');\n\tvar dmodp = readMPInt(der, 'exponent1');\n\tvar dmodq = readMPInt(der, 'exponent2');\n\tvar iqmp = readMPInt(der, 'iqmp');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'n', data: n },\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'd', data: d },\n\t\t\t{ name: 'iqmp', data: iqmp },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'dmodp', data: dmodp },\n\t\t\t{ name: 'dmodq', data: dmodq }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1DSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 0);\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\tvar y = readMPInt(der, 'y');\n\tvar x = readMPInt(der, 'x');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'x', data: x }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1EdDSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 1);\n\n\t// private key\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\n\tder.readSequence(0xa0);\n\tvar oid = der.readOID();\n\tassert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier');\n\n\tder.readSequence(0xa1);\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: k }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs1DSAPublic(der) {\n\tvar y = readMPInt(der, 'y');\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1ECDSAPublic(der) {\n\tder.readSequence();\n\n\tvar oid = der.readOID();\n\tassert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey');\n\n\tvar curveOid = der.readOID();\n\n\tvar curve;\n\tvar curves = Object.keys(algs.curves);\n\tfor (var j = 0; j < curves.length; ++j) {\n\t\tvar c = curves[j];\n\t\tvar cd = algs.curves[c];\n\t\tif (cd.pkcs8oid === curveOid) {\n\t\t\tcurve = c;\n\t\t\tbreak;\n\t\t}\n\t}\n\tassert.string(curve, 'a known ECDSA named curve');\n\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curve) },\n\t\t\t{ name: 'Q', data: Q }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs1ECDSAPrivate(der) {\n\tvar version = readMPInt(der, 'version');\n\tassert.strictEqual(version.readUInt8(0), 1);\n\n\t// private key\n\tvar d = der.readString(asn1.Ber.OctetString, true);\n\n\tder.readSequence(0xa0);\n\tvar curve = readECDSACurve(der);\n\tassert.string(curve, 'a known elliptic curve');\n\n\tder.readSequence(0xa1);\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curve) },\n\t\t\t{ name: 'Q', data: Q },\n\t\t\t{ name: 'd', data: d }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction writePkcs1(der, key) {\n\tder.startSequence();\n\n\tswitch (key.type) {\n\tcase 'rsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1RSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1RSAPublic(der, key);\n\t\tbreak;\n\tcase 'dsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1DSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1DSAPublic(der, key);\n\t\tbreak;\n\tcase 'ecdsa':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1ECDSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1ECDSAPublic(der, key);\n\t\tbreak;\n\tcase 'ed25519':\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs1EdDSAPrivate(der, key);\n\t\telse\n\t\t\twritePkcs1EdDSAPublic(der, key);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unknown key algo: ' + key.type));\n\t}\n\n\tder.endSequence();\n}\n\nfunction writePkcs1RSAPublic(der, key) {\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1RSAPrivate(der, key) {\n\tvar ver = Buffer.from([0]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.d.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tif (!key.part.dmodp || !key.part.dmodq)\n\t\tutils.addRSAMissing(key);\n\tder.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1DSAPrivate(der, key) {\n\tvar ver = Buffer.from([0]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.x.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1DSAPublic(der, key) {\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n}\n\nfunction writePkcs1ECDSAPublic(der, key) {\n\tder.startSequence();\n\n\tder.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */\n\tvar curve = key.part.curve.data.toString();\n\tvar curveOid = algs.curves[curve].pkcs8oid;\n\tassert.string(curveOid, 'a known ECDSA named curve');\n\tder.writeOID(curveOid);\n\n\tder.endSequence();\n\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n}\n\nfunction writePkcs1ECDSAPrivate(der, key) {\n\tvar ver = Buffer.from([1]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.d.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa0);\n\tvar curve = key.part.curve.data.toString();\n\tvar curveOid = algs.curves[curve].pkcs8oid;\n\tassert.string(curveOid, 'a known ECDSA named curve');\n\tder.writeOID(curveOid);\n\tder.endSequence();\n\n\tder.startSequence(0xa1);\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n\tder.endSequence();\n}\n\nfunction writePkcs1EdDSAPrivate(der, key) {\n\tvar ver = Buffer.from([1]);\n\tder.writeBuffer(ver, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.k.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa0);\n\tder.writeOID('1.3.101.112');\n\tder.endSequence();\n\n\tder.startSequence(0xa1);\n\tutils.writeBitString(der, key.part.A.data);\n\tder.endSequence();\n}\n\nfunction writePkcs1EdDSAPublic(der, key) {\n\tthrow (new Error('Public keys are not supported for EdDSA PKCS#1'));\n}\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadPkcs8: readPkcs8,\n\twrite: write,\n\twritePkcs8: writePkcs8,\n\tpkcs8ToBuffer: pkcs8ToBuffer,\n\n\treadECDSACurve: readECDSACurve,\n\twriteECDSACurve: writeECDSACurve\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options, 'pkcs8'));\n}\n\nfunction write(key, options) {\n\treturn (pem.write(key, options, 'pkcs8'));\n}\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction readPkcs8(alg, type, der) {\n\t/* Private keys in pkcs#8 format have a weird extra int */\n\tif (der.peek() === asn1.Ber.Integer) {\n\t\tassert.strictEqual(type, 'private',\n\t\t 'unexpected Integer at start of public key');\n\t\tder.readString(asn1.Ber.Integer, true);\n\t}\n\n\tder.readSequence();\n\tvar next = der.offset + der.length;\n\n\tvar oid = der.readOID();\n\tswitch (oid) {\n\tcase '1.2.840.113549.1.1.1':\n\t\tder._offset = next;\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8RSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8RSAPrivate(der));\n\tcase '1.2.840.10040.4.1':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8DSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8DSAPrivate(der));\n\tcase '1.2.840.10045.2.1':\n\t\tif (type === 'public')\n\t\t\treturn (readPkcs8ECDSAPublic(der));\n\t\telse\n\t\t\treturn (readPkcs8ECDSAPrivate(der));\n\tcase '1.3.101.112':\n\t\tif (type === 'public') {\n\t\t\treturn (readPkcs8EdDSAPublic(der));\n\t\t} else {\n\t\t\treturn (readPkcs8EdDSAPrivate(der));\n\t\t}\n\tcase '1.3.101.110':\n\t\tif (type === 'public') {\n\t\t\treturn (readPkcs8X25519Public(der));\n\t\t} else {\n\t\t\treturn (readPkcs8X25519Private(der));\n\t\t}\n\tdefault:\n\t\tthrow (new Error('Unknown key type OID ' + oid));\n\t}\n}\n\nfunction readPkcs8RSAPublic(der) {\n\t// bit string sequence\n\tder.readSequence(asn1.Ber.BitString);\n\tder.readByte();\n\tder.readSequence();\n\n\t// modulus\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'exponent');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tsource: der.originalInput,\n\t\tparts: [\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'n', data: n }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8RSAPrivate(der) {\n\tder.readSequence(asn1.Ber.OctetString);\n\tder.readSequence();\n\n\tvar ver = readMPInt(der, 'version');\n\tassert.equal(ver[0], 0x0, 'unknown RSA private key version');\n\n\t// modulus then public exponent\n\tvar n = readMPInt(der, 'modulus');\n\tvar e = readMPInt(der, 'public exponent');\n\tvar d = readMPInt(der, 'private exponent');\n\tvar p = readMPInt(der, 'prime1');\n\tvar q = readMPInt(der, 'prime2');\n\tvar dmodp = readMPInt(der, 'exponent1');\n\tvar dmodq = readMPInt(der, 'exponent2');\n\tvar iqmp = readMPInt(der, 'iqmp');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'rsa',\n\t\tparts: [\n\t\t\t{ name: 'n', data: n },\n\t\t\t{ name: 'e', data: e },\n\t\t\t{ name: 'd', data: d },\n\t\t\t{ name: 'iqmp', data: iqmp },\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'dmodp', data: dmodp },\n\t\t\t{ name: 'dmodq', data: dmodq }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8DSAPublic(der) {\n\tder.readSequence();\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\t// bit string sequence\n\tder.readSequence(asn1.Ber.BitString);\n\tder.readByte();\n\n\tvar y = readMPInt(der, 'y');\n\n\t// now, make the key\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8DSAPrivate(der) {\n\tder.readSequence();\n\n\tvar p = readMPInt(der, 'p');\n\tvar q = readMPInt(der, 'q');\n\tvar g = readMPInt(der, 'g');\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar x = readMPInt(der, 'x');\n\n\t/* The pkcs#8 format does not include the public key */\n\tvar y = utils.calculateDSAPublic(g, p, x);\n\n\tvar key = {\n\t\ttype: 'dsa',\n\t\tparts: [\n\t\t\t{ name: 'p', data: p },\n\t\t\t{ name: 'q', data: q },\n\t\t\t{ name: 'g', data: g },\n\t\t\t{ name: 'y', data: y },\n\t\t\t{ name: 'x', data: x }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readECDSACurve(der) {\n\tvar curveName, curveNames;\n\tvar j, c, cd;\n\n\tif (der.peek() === asn1.Ber.OID) {\n\t\tvar oid = der.readOID();\n\n\t\tcurveNames = Object.keys(algs.curves);\n\t\tfor (j = 0; j < curveNames.length; ++j) {\n\t\t\tc = curveNames[j];\n\t\t\tcd = algs.curves[c];\n\t\t\tif (cd.pkcs8oid === oid) {\n\t\t\t\tcurveName = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t} else {\n\t\t// ECParameters sequence\n\t\tder.readSequence();\n\t\tvar version = der.readString(asn1.Ber.Integer, true);\n\t\tassert.strictEqual(version[0], 1, 'ECDSA key not version 1');\n\n\t\tvar curve = {};\n\n\t\t// FieldID sequence\n\t\tder.readSequence();\n\t\tvar fieldTypeOid = der.readOID();\n\t\tassert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1',\n\t\t 'ECDSA key is not from a prime-field');\n\t\tvar p = curve.p = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\t/*\n\t\t * p always starts with a 1 bit, so count the zeros to get its\n\t\t * real size.\n\t\t */\n\t\tcurve.size = p.length * 8 - utils.countZeros(p);\n\n\t\t// Curve sequence\n\t\tder.readSequence();\n\t\tcurve.a = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.OctetString, true));\n\t\tcurve.b = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.OctetString, true));\n\t\tif (der.peek() === asn1.Ber.BitString)\n\t\t\tcurve.s = der.readString(asn1.Ber.BitString, true);\n\n\t\t// Combined Gx and Gy\n\t\tcurve.G = der.readString(asn1.Ber.OctetString, true);\n\t\tassert.strictEqual(curve.G[0], 0x4,\n\t\t 'uncompressed G is required');\n\n\t\tcurve.n = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\tcurve.h = utils.mpNormalize(\n\t\t der.readString(asn1.Ber.Integer, true));\n\t\tassert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' +\n\t\t 'required');\n\n\t\tcurveNames = Object.keys(algs.curves);\n\t\tvar ks = Object.keys(curve);\n\t\tfor (j = 0; j < curveNames.length; ++j) {\n\t\t\tc = curveNames[j];\n\t\t\tcd = algs.curves[c];\n\t\t\tvar equal = true;\n\t\t\tfor (var i = 0; i < ks.length; ++i) {\n\t\t\t\tvar k = ks[i];\n\t\t\t\tif (cd[k] === undefined)\n\t\t\t\t\tcontinue;\n\t\t\t\tif (typeof (cd[k]) === 'object' &&\n\t\t\t\t cd[k].equals !== undefined) {\n\t\t\t\t\tif (!cd[k].equals(curve[k])) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else if (Buffer.isBuffer(cd[k])) {\n\t\t\t\t\tif (cd[k].toString('binary')\n\t\t\t\t\t !== curve[k].toString('binary')) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (cd[k] !== curve[k]) {\n\t\t\t\t\t\tequal = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (equal) {\n\t\t\t\tcurveName = c;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn (curveName);\n}\n\nfunction readPkcs8ECDSAPrivate(der) {\n\tvar curveName = readECDSACurve(der);\n\tassert.string(curveName, 'a known elliptic curve');\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tder.readSequence();\n\n\tvar version = readMPInt(der, 'version');\n\tassert.equal(version[0], 1, 'unknown version of ECDSA key');\n\n\tvar d = der.readString(asn1.Ber.OctetString, true);\n\tvar Q;\n\n\tif (der.peek() == 0xa0) {\n\t\tder.readSequence(0xa0);\n\t\tder._offset += der.length;\n\t}\n\tif (der.peek() == 0xa1) {\n\t\tder.readSequence(0xa1);\n\t\tQ = der.readString(asn1.Ber.BitString, true);\n\t\tQ = utils.ecNormalize(Q);\n\t}\n\n\tif (Q === undefined) {\n\t\tvar pub = utils.publicFromPrivateECDSA(curveName, d);\n\t\tQ = pub.part.Q.data;\n\t}\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curveName) },\n\t\t\t{ name: 'Q', data: Q },\n\t\t\t{ name: 'd', data: d }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8ECDSAPublic(der) {\n\tvar curveName = readECDSACurve(der);\n\tassert.string(curveName, 'a known elliptic curve');\n\n\tvar Q = der.readString(asn1.Ber.BitString, true);\n\tQ = utils.ecNormalize(Q);\n\n\tvar key = {\n\t\ttype: 'ecdsa',\n\t\tparts: [\n\t\t\t{ name: 'curve', data: Buffer.from(curveName) },\n\t\t\t{ name: 'Q', data: Q }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8EdDSAPublic(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8X25519Public(der) {\n\tvar A = utils.readBitString(der);\n\n\tvar key = {\n\t\ttype: 'curve25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) }\n\t\t]\n\t};\n\n\treturn (new Key(key));\n}\n\nfunction readPkcs8EdDSAPrivate(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\tk = utils.zeroPadToLength(k, 32);\n\n\tvar A;\n\tif (der.peek() === asn1.Ber.BitString) {\n\t\tA = utils.readBitString(der);\n\t\tA = utils.zeroPadToLength(A, 32);\n\t} else {\n\t\tA = utils.calculateED25519Public(k);\n\t}\n\n\tvar key = {\n\t\ttype: 'ed25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: utils.zeroPadToLength(k, 32) }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction readPkcs8X25519Private(der) {\n\tif (der.peek() === 0x00)\n\t\tder.readByte();\n\n\tder.readSequence(asn1.Ber.OctetString);\n\tvar k = der.readString(asn1.Ber.OctetString, true);\n\tk = utils.zeroPadToLength(k, 32);\n\n\tvar A = utils.calculateX25519Public(k);\n\n\tvar key = {\n\t\ttype: 'curve25519',\n\t\tparts: [\n\t\t\t{ name: 'A', data: utils.zeroPadToLength(A, 32) },\n\t\t\t{ name: 'k', data: utils.zeroPadToLength(k, 32) }\n\t\t]\n\t};\n\n\treturn (new PrivateKey(key));\n}\n\nfunction pkcs8ToBuffer(key) {\n\tvar der = new asn1.BerWriter();\n\twritePkcs8(der, key);\n\treturn (der.buffer);\n}\n\nfunction writePkcs8(der, key) {\n\tder.startSequence();\n\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tvar sillyInt = Buffer.from([0]);\n\t\tder.writeBuffer(sillyInt, asn1.Ber.Integer);\n\t}\n\n\tder.startSequence();\n\tswitch (key.type) {\n\tcase 'rsa':\n\t\tder.writeOID('1.2.840.113549.1.1.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8RSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8RSAPublic(key, der);\n\t\tbreak;\n\tcase 'dsa':\n\t\tder.writeOID('1.2.840.10040.4.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8DSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8DSAPublic(key, der);\n\t\tbreak;\n\tcase 'ecdsa':\n\t\tder.writeOID('1.2.840.10045.2.1');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\twritePkcs8ECDSAPrivate(key, der);\n\t\telse\n\t\t\twritePkcs8ECDSAPublic(key, der);\n\t\tbreak;\n\tcase 'ed25519':\n\t\tder.writeOID('1.3.101.112');\n\t\tif (PrivateKey.isPrivateKey(key))\n\t\t\tthrow (new Error('Ed25519 private keys in pkcs8 ' +\n\t\t\t 'format are not supported'));\n\t\twritePkcs8EdDSAPublic(key, der);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unsupported key type: ' + key.type));\n\t}\n\n\tder.endSequence();\n}\n\nfunction writePkcs8RSAPrivate(key, der) {\n\tder.writeNull();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.startSequence();\n\n\tvar version = Buffer.from([0]);\n\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.d.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tif (!key.part.dmodp || !key.part.dmodq)\n\t\tutils.addRSAMissing(key);\n\tder.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);\n\n\tder.endSequence();\n\tder.endSequence();\n}\n\nfunction writePkcs8RSAPublic(key, der) {\n\tder.writeNull();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.BitString);\n\tder.writeByte(0x00);\n\n\tder.startSequence();\n\tder.writeBuffer(key.part.n.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.e.data, asn1.Ber.Integer);\n\tder.endSequence();\n\n\tder.endSequence();\n}\n\nfunction writePkcs8DSAPrivate(key, der) {\n\tder.startSequence();\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.endSequence();\n\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.writeBuffer(key.part.x.data, asn1.Ber.Integer);\n\tder.endSequence();\n}\n\nfunction writePkcs8DSAPublic(key, der) {\n\tder.startSequence();\n\tder.writeBuffer(key.part.p.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.q.data, asn1.Ber.Integer);\n\tder.writeBuffer(key.part.g.data, asn1.Ber.Integer);\n\tder.endSequence();\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.BitString);\n\tder.writeByte(0x00);\n\tder.writeBuffer(key.part.y.data, asn1.Ber.Integer);\n\tder.endSequence();\n}\n\nfunction writeECDSACurve(key, der) {\n\tvar curve = algs.curves[key.curve];\n\tif (curve.pkcs8oid) {\n\t\t/* This one has a name in pkcs#8, so just write the oid */\n\t\tder.writeOID(curve.pkcs8oid);\n\n\t} else {\n\t\t// ECParameters sequence\n\t\tder.startSequence();\n\n\t\tvar version = Buffer.from([1]);\n\t\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\t\t// FieldID sequence\n\t\tder.startSequence();\n\t\tder.writeOID('1.2.840.10045.1.1'); // prime-field\n\t\tder.writeBuffer(curve.p, asn1.Ber.Integer);\n\t\tder.endSequence();\n\n\t\t// Curve sequence\n\t\tder.startSequence();\n\t\tvar a = curve.p;\n\t\tif (a[0] === 0x0)\n\t\t\ta = a.slice(1);\n\t\tder.writeBuffer(a, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.b, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.s, asn1.Ber.BitString);\n\t\tder.endSequence();\n\n\t\tder.writeBuffer(curve.G, asn1.Ber.OctetString);\n\t\tder.writeBuffer(curve.n, asn1.Ber.Integer);\n\t\tvar h = curve.h;\n\t\tif (!h) {\n\t\t\th = Buffer.from([1]);\n\t\t}\n\t\tder.writeBuffer(h, asn1.Ber.Integer);\n\n\t\t// ECParameters\n\t\tder.endSequence();\n\t}\n}\n\nfunction writePkcs8ECDSAPublic(key, der) {\n\twriteECDSACurve(key, der);\n\tder.endSequence();\n\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n}\n\nfunction writePkcs8ECDSAPrivate(key, der) {\n\twriteECDSACurve(key, der);\n\tder.endSequence();\n\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.startSequence();\n\n\tvar version = Buffer.from([1]);\n\tder.writeBuffer(version, asn1.Ber.Integer);\n\n\tder.writeBuffer(key.part.d.data, asn1.Ber.OctetString);\n\n\tder.startSequence(0xa1);\n\tvar Q = utils.ecNormalize(key.part.Q.data, true);\n\tder.writeBuffer(Q, asn1.Ber.BitString);\n\tder.endSequence();\n\n\tder.endSequence();\n\tder.endSequence();\n}\n\nfunction writePkcs8EdDSAPublic(key, der) {\n\tder.endSequence();\n\n\tutils.writeBitString(der, key.part.A.data);\n}\n\nfunction writePkcs8EdDSAPrivate(key, der) {\n\tder.endSequence();\n\n\tvar k = utils.mpNormalize(key.part.k.data, true);\n\tder.startSequence(asn1.Ber.OctetString);\n\tder.writeBuffer(k, asn1.Ber.OctetString);\n\tder.endSequence();\n}\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar rfc4253 = require('./rfc4253');\nvar Key = require('../key');\nvar SSHBuffer = require('../ssh-buffer');\nvar crypto = require('crypto');\nvar PrivateKey = require('../private-key');\n\nvar errors = require('../errors');\n\n// https://tartarus.org/~simon/putty-prerel-snapshots/htmldoc/AppendixC.html\nfunction read(buf, options) {\n\tvar lines = buf.toString('ascii').split(/[\\r\\n]+/);\n\tvar found = false;\n\tvar parts;\n\tvar si = 0;\n\tvar formatVersion;\n\twhile (si < lines.length) {\n\t\tparts = splitHeader(lines[si++]);\n\t\tif (parts) {\n\t\t\tformatVersion = {\n\t\t\t\t'putty-user-key-file-2': 2,\n\t\t\t\t'putty-user-key-file-3': 3\n\t\t\t}[parts[0].toLowerCase()];\n\t\t\tif (formatVersion) {\n\t\t\t\tfound = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\tif (!found) {\n\t\tthrow (new Error('No PuTTY format first line found'));\n\t}\n\tvar alg = parts[1];\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'encryption');\n\tvar encryption = parts[1];\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'comment');\n\tvar comment = parts[1];\n\n\tparts = splitHeader(lines[si++]);\n\tassert.equal(parts[0].toLowerCase(), 'public-lines');\n\tvar publicLines = parseInt(parts[1], 10);\n\tif (!isFinite(publicLines) || publicLines < 0 ||\n\t publicLines > lines.length) {\n\t\tthrow (new Error('Invalid public-lines count'));\n\t}\n\n\tvar publicBuf = Buffer.from(\n\t lines.slice(si, si + publicLines).join(''), 'base64');\n\tvar keyType = rfc4253.algToKeyType(alg);\n\tvar key = rfc4253.read(publicBuf);\n\tif (key.type !== keyType) {\n\t\tthrow (new Error('Outer key algorithm mismatch'));\n\t}\n\n\tsi += publicLines;\n\tif (lines[si]) {\n\t\tparts = splitHeader(lines[si++]);\n\t\tassert.equal(parts[0].toLowerCase(), 'private-lines');\n\t\tvar privateLines = parseInt(parts[1], 10);\n\t\tif (!isFinite(privateLines) || privateLines < 0 ||\n\t\t privateLines > lines.length) {\n\t\t\tthrow (new Error('Invalid private-lines count'));\n\t\t}\n\n\t\tvar privateBuf = Buffer.from(\n\t\t\tlines.slice(si, si + privateLines).join(''), 'base64');\n\n\t\tif (encryption !== 'none' && formatVersion === 3) {\n\t\t\tthrow new Error('Encrypted keys arenot supported for' +\n\t\t\t' PuTTY format version 3');\n\t\t}\n\n\t\tif (encryption === 'aes256-cbc') {\n\t\t\tif (!options.passphrase) {\n\t\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t\t\toptions.filename, 'PEM'));\n\t\t\t}\n\n\t\t\tvar iv = Buffer.alloc(16, 0);\n\t\t\tvar decipher = crypto.createDecipheriv(\n\t\t\t\t'aes-256-cbc',\n\t\t\t\tderivePPK2EncryptionKey(options.passphrase),\n\t\t\t\tiv);\n\t\t\tdecipher.setAutoPadding(false);\n\t\t\tprivateBuf = Buffer.concat([\n\t\t\t\tdecipher.update(privateBuf), decipher.final()]);\n\t\t}\n\n\t\tkey = new PrivateKey(key);\n\t\tif (key.type !== keyType) {\n\t\t\tthrow (new Error('Outer key algorithm mismatch'));\n\t\t}\n\n\t\tvar sshbuf = new SSHBuffer({buffer: privateBuf});\n\t\tvar privateKeyParts;\n\t\tif (alg === 'ssh-dss') {\n\t\t\tprivateKeyParts = [ {\n\t\t\t\tname: 'x',\n\t\t\t\tdata: sshbuf.readBuffer()\n\t\t\t}];\n\t\t} else if (alg === 'ssh-rsa') {\n\t\t\tprivateKeyParts = [\n\t\t\t\t{ name: 'd', data: sshbuf.readBuffer() },\n\t\t\t\t{ name: 'p', data: sshbuf.readBuffer() },\n\t\t\t\t{ name: 'q', data: sshbuf.readBuffer() },\n\t\t\t\t{ name: 'iqmp', data: sshbuf.readBuffer() }\n\t\t\t];\n\t\t} else if (alg.match(/^ecdsa-sha2-nistp/)) {\n\t\t\tprivateKeyParts = [ {\n\t\t\t\tname: 'd', data: sshbuf.readBuffer()\n\t\t\t} ];\n\t\t} else if (alg === 'ssh-ed25519') {\n\t\t\tprivateKeyParts = [ {\n\t\t\t\tname: 'k', data: sshbuf.readBuffer()\n\t\t\t} ];\n\t\t} else {\n\t\t\tthrow new Error('Unsupported PPK key type: ' + alg);\n\t\t}\n\n\t\tkey = new PrivateKey({\n\t\t\ttype: key.type,\n\t\t\tparts: key.parts.concat(privateKeyParts)\n\t\t});\n\t}\n\n\tkey.comment = comment;\n\treturn (key);\n}\n\nfunction derivePPK2EncryptionKey(passphrase) {\n\tvar hash1 = crypto.createHash('sha1').update(Buffer.concat([\n\t\tBuffer.from([0, 0, 0, 0]),\n\t\tBuffer.from(passphrase)\n\t])).digest();\n\tvar hash2 = crypto.createHash('sha1').update(Buffer.concat([\n\t\tBuffer.from([0, 0, 0, 1]),\n\t\tBuffer.from(passphrase)\n\t])).digest();\n\treturn (Buffer.concat([hash1, hash2]).slice(0, 32));\n}\n\nfunction splitHeader(line) {\n\tvar idx = line.indexOf(':');\n\tif (idx === -1)\n\t\treturn (null);\n\tvar header = line.slice(0, idx);\n\t++idx;\n\twhile (line[idx] === ' ')\n\t\t++idx;\n\tvar rest = line.slice(idx);\n\treturn ([header, rest]);\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\tif (!Key.isKey(key))\n\t\tthrow (new Error('Must be a public key'));\n\n\tvar alg = rfc4253.keyTypeToAlg(key);\n\tvar buf = rfc4253.write(key);\n\tvar comment = key.comment || '';\n\n\tvar b64 = buf.toString('base64');\n\tvar lines = wrap(b64, 64);\n\n\tlines.unshift('Public-Lines: ' + lines.length);\n\tlines.unshift('Comment: ' + comment);\n\tlines.unshift('Encryption: none');\n\tlines.unshift('PuTTY-User-Key-File-2: ' + alg);\n\n\treturn (Buffer.from(lines.join('\\n') + '\\n'));\n}\n\nfunction wrap(txt, len) {\n\tvar lines = [];\n\tvar pos = 0;\n\twhile (pos < txt.length) {\n\t\tlines.push(txt.slice(pos, pos + 64));\n\t\tpos += 64;\n\t}\n\treturn (lines);\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read.bind(undefined, false, undefined),\n\treadType: read.bind(undefined, false),\n\twrite: write,\n\t/* semi-private api, used by sshpk-agent */\n\treadPartial: read.bind(undefined, true),\n\n\t/* shared with ssh format */\n\treadInternal: read,\n\tkeyTypeToAlg: keyTypeToAlg,\n\talgToKeyType: algToKeyType\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar SSHBuffer = require('../ssh-buffer');\n\nfunction algToKeyType(alg) {\n\tassert.string(alg);\n\tif (alg === 'ssh-dss')\n\t\treturn ('dsa');\n\telse if (alg === 'ssh-rsa')\n\t\treturn ('rsa');\n\telse if (alg === 'ssh-ed25519')\n\t\treturn ('ed25519');\n\telse if (alg === 'ssh-curve25519')\n\t\treturn ('curve25519');\n\telse if (alg.match(/^ecdsa-sha2-/))\n\t\treturn ('ecdsa');\n\telse\n\t\tthrow (new Error('Unknown algorithm ' + alg));\n}\n\nfunction keyTypeToAlg(key) {\n\tassert.object(key);\n\tif (key.type === 'dsa')\n\t\treturn ('ssh-dss');\n\telse if (key.type === 'rsa')\n\t\treturn ('ssh-rsa');\n\telse if (key.type === 'ed25519')\n\t\treturn ('ssh-ed25519');\n\telse if (key.type === 'curve25519')\n\t\treturn ('ssh-curve25519');\n\telse if (key.type === 'ecdsa')\n\t\treturn ('ecdsa-sha2-' + key.part.curve.data.toString());\n\telse\n\t\tthrow (new Error('Unknown key type ' + key.type));\n}\n\nfunction read(partial, type, buf, options) {\n\tif (typeof (buf) === 'string')\n\t\tbuf = Buffer.from(buf);\n\tassert.buffer(buf, 'buf');\n\n\tvar key = {};\n\n\tvar parts = key.parts = [];\n\tvar sshbuf = new SSHBuffer({buffer: buf});\n\n\tvar alg = sshbuf.readString();\n\tassert.ok(!sshbuf.atEnd(), 'key must have at least one part');\n\n\tkey.type = algToKeyType(alg);\n\n\tvar partCount = algs.info[key.type].parts.length;\n\tif (type && type === 'private')\n\t\tpartCount = algs.privInfo[key.type].parts.length;\n\n\twhile (!sshbuf.atEnd() && parts.length < partCount)\n\t\tparts.push(sshbuf.readPart());\n\twhile (!partial && !sshbuf.atEnd())\n\t\tparts.push(sshbuf.readPart());\n\n\tassert.ok(parts.length >= 1,\n\t 'key must have at least one part');\n\tassert.ok(partial || sshbuf.atEnd(),\n\t 'leftover bytes at end of key');\n\n\tvar Constructor = Key;\n\tvar algInfo = algs.info[key.type];\n\tif (type === 'private' || algInfo.parts.length !== parts.length) {\n\t\talgInfo = algs.privInfo[key.type];\n\t\tConstructor = PrivateKey;\n\t}\n\tassert.strictEqual(algInfo.parts.length, parts.length);\n\n\tif (key.type === 'ecdsa') {\n\t\tvar res = /^ecdsa-sha2-(.+)$/.exec(alg);\n\t\tassert.ok(res !== null);\n\t\tassert.strictEqual(res[1], parts[0].data.toString());\n\t}\n\n\tvar normalized = true;\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tvar p = parts[i];\n\t\tp.name = algInfo.parts[i];\n\t\t/*\n\t\t * OpenSSH stores ed25519 \"private\" keys as seed + public key\n\t\t * concat'd together (k followed by A). We want to keep them\n\t\t * separate for other formats that don't do this.\n\t\t */\n\t\tif (key.type === 'ed25519' && p.name === 'k')\n\t\t\tp.data = p.data.slice(0, 32);\n\n\t\tif (p.name !== 'curve' && algInfo.normalize !== false) {\n\t\t\tvar nd;\n\t\t\tif (key.type === 'ed25519') {\n\t\t\t\tnd = utils.zeroPadToLength(p.data, 32);\n\t\t\t} else {\n\t\t\t\tnd = utils.mpNormalize(p.data);\n\t\t\t}\n\t\t\tif (nd.toString('binary') !==\n\t\t\t p.data.toString('binary')) {\n\t\t\t\tp.data = nd;\n\t\t\t\tnormalized = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (normalized)\n\t\tkey._rfc4253Cache = sshbuf.toBuffer();\n\n\tif (partial && typeof (partial) === 'object') {\n\t\tpartial.remainder = sshbuf.remainder();\n\t\tpartial.consumed = sshbuf._offset;\n\t}\n\n\treturn (new Constructor(key));\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\n\tvar alg = keyTypeToAlg(key);\n\tvar i;\n\n\tvar algInfo = algs.info[key.type];\n\tif (PrivateKey.isPrivateKey(key))\n\t\talgInfo = algs.privInfo[key.type];\n\tvar parts = algInfo.parts;\n\n\tvar buf = new SSHBuffer({});\n\n\tbuf.writeString(alg);\n\n\tfor (i = 0; i < parts.length; ++i) {\n\t\tvar data = key.part[parts[i]].data;\n\t\tif (algInfo.normalize !== false) {\n\t\t\tif (key.type === 'ed25519')\n\t\t\t\tdata = utils.zeroPadToLength(data, 32);\n\t\t\telse\n\t\t\t\tdata = utils.mpNormalize(data);\n\t\t}\n\t\tif (key.type === 'ed25519' && parts[i] === 'k')\n\t\t\tdata = Buffer.concat([data, key.part.A.data]);\n\t\tbuf.writeBuffer(data);\n\t}\n\n\treturn (buf.toBuffer());\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\treadSSHPrivate: readSSHPrivate,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar crypto = require('crypto');\n\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\nvar rfc4253 = require('./rfc4253');\nvar SSHBuffer = require('../ssh-buffer');\nvar errors = require('../errors');\n\nvar bcrypt;\n\nfunction read(buf, options) {\n\treturn (pem.read(buf, options));\n}\n\nvar MAGIC = 'openssh-key-v1';\n\nfunction readSSHPrivate(type, buf, options) {\n\tbuf = new SSHBuffer({buffer: buf});\n\n\tvar magic = buf.readCString();\n\tassert.strictEqual(magic, MAGIC, 'bad magic string');\n\n\tvar cipher = buf.readString();\n\tvar kdf = buf.readString();\n\tvar kdfOpts = buf.readBuffer();\n\n\tvar nkeys = buf.readInt();\n\tif (nkeys !== 1) {\n\t\tthrow (new Error('OpenSSH-format key file contains ' +\n\t\t 'multiple keys: this is unsupported.'));\n\t}\n\n\tvar pubKey = buf.readBuffer();\n\n\tif (type === 'public') {\n\t\tassert.ok(buf.atEnd(), 'excess bytes left after key');\n\t\treturn (rfc4253.read(pubKey));\n\t}\n\n\tvar privKeyBlob = buf.readBuffer();\n\tassert.ok(buf.atEnd(), 'excess bytes left after key');\n\n\tvar kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts });\n\tswitch (kdf) {\n\tcase 'none':\n\t\tif (cipher !== 'none') {\n\t\t\tthrow (new Error('OpenSSH-format key uses KDF \"none\" ' +\n\t\t\t 'but specifies a cipher other than \"none\"'));\n\t\t}\n\t\tbreak;\n\tcase 'bcrypt':\n\t\tvar salt = kdfOptsBuf.readBuffer();\n\t\tvar rounds = kdfOptsBuf.readInt();\n\t\tvar cinf = utils.opensshCipherInfo(cipher);\n\t\tif (bcrypt === undefined) {\n\t\t\tbcrypt = require('bcrypt-pbkdf');\n\t\t}\n\n\t\tif (typeof (options.passphrase) === 'string') {\n\t\t\toptions.passphrase = Buffer.from(options.passphrase,\n\t\t\t 'utf-8');\n\t\t}\n\t\tif (!Buffer.isBuffer(options.passphrase)) {\n\t\t\tthrow (new errors.KeyEncryptedError(\n\t\t\t options.filename, 'OpenSSH'));\n\t\t}\n\n\t\tvar pass = new Uint8Array(options.passphrase);\n\t\tvar salti = new Uint8Array(salt);\n\t\t/* Use the pbkdf to derive both the key and the IV. */\n\t\tvar out = new Uint8Array(cinf.keySize + cinf.blockSize);\n\t\tvar res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,\n\t\t out, out.length, rounds);\n\t\tif (res !== 0) {\n\t\t\tthrow (new Error('bcrypt_pbkdf function returned ' +\n\t\t\t 'failure, parameters invalid'));\n\t\t}\n\t\tout = Buffer.from(out);\n\t\tvar ckey = out.slice(0, cinf.keySize);\n\t\tvar iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);\n\t\tvar cipherStream = crypto.createDecipheriv(cinf.opensslName,\n\t\t ckey, iv);\n\t\tcipherStream.setAutoPadding(false);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tif (e.toString().indexOf('bad decrypt') !== -1) {\n\t\t\t\tthrow (new Error('Incorrect passphrase ' +\n\t\t\t\t 'supplied, could not decrypt key'));\n\t\t\t}\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(privKeyBlob);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tprivKeyBlob = Buffer.concat(chunks);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error(\n\t\t 'OpenSSH-format key uses unknown KDF \"' + kdf + '\"'));\n\t}\n\n\tbuf = new SSHBuffer({buffer: privKeyBlob});\n\n\tvar checkInt1 = buf.readInt();\n\tvar checkInt2 = buf.readInt();\n\tif (checkInt1 !== checkInt2) {\n\t\tthrow (new Error('Incorrect passphrase supplied, could not ' +\n\t\t 'decrypt key'));\n\t}\n\n\tvar ret = {};\n\tvar key = rfc4253.readInternal(ret, 'private', buf.remainder());\n\n\tbuf.skip(ret.consumed);\n\n\tvar comment = buf.readString();\n\tkey.comment = comment;\n\n\treturn (key);\n}\n\nfunction write(key, options) {\n\tvar pubKey;\n\tif (PrivateKey.isPrivateKey(key))\n\t\tpubKey = key.toPublic();\n\telse\n\t\tpubKey = key;\n\n\tvar cipher = 'none';\n\tvar kdf = 'none';\n\tvar kdfopts = Buffer.alloc(0);\n\tvar cinf = { blockSize: 8 };\n\tvar passphrase;\n\tif (options !== undefined) {\n\t\tpassphrase = options.passphrase;\n\t\tif (typeof (passphrase) === 'string')\n\t\t\tpassphrase = Buffer.from(passphrase, 'utf-8');\n\t\tif (passphrase !== undefined) {\n\t\t\tassert.buffer(passphrase, 'options.passphrase');\n\t\t\tassert.optionalString(options.cipher, 'options.cipher');\n\t\t\tcipher = options.cipher;\n\t\t\tif (cipher === undefined)\n\t\t\t\tcipher = 'aes128-ctr';\n\t\t\tcinf = utils.opensshCipherInfo(cipher);\n\t\t\tkdf = 'bcrypt';\n\t\t}\n\t}\n\n\tvar privBuf;\n\tif (PrivateKey.isPrivateKey(key)) {\n\t\tprivBuf = new SSHBuffer({});\n\t\tvar checkInt = crypto.randomBytes(4).readUInt32BE(0);\n\t\tprivBuf.writeInt(checkInt);\n\t\tprivBuf.writeInt(checkInt);\n\t\tprivBuf.write(key.toBuffer('rfc4253'));\n\t\tprivBuf.writeString(key.comment || '');\n\n\t\tvar n = 1;\n\t\twhile (privBuf._offset % cinf.blockSize !== 0)\n\t\t\tprivBuf.writeChar(n++);\n\t\tprivBuf = privBuf.toBuffer();\n\t}\n\n\tswitch (kdf) {\n\tcase 'none':\n\t\tbreak;\n\tcase 'bcrypt':\n\t\tvar salt = crypto.randomBytes(16);\n\t\tvar rounds = 16;\n\t\tvar kdfssh = new SSHBuffer({});\n\t\tkdfssh.writeBuffer(salt);\n\t\tkdfssh.writeInt(rounds);\n\t\tkdfopts = kdfssh.toBuffer();\n\n\t\tif (bcrypt === undefined) {\n\t\t\tbcrypt = require('bcrypt-pbkdf');\n\t\t}\n\t\tvar pass = new Uint8Array(passphrase);\n\t\tvar salti = new Uint8Array(salt);\n\t\t/* Use the pbkdf to derive both the key and the IV. */\n\t\tvar out = new Uint8Array(cinf.keySize + cinf.blockSize);\n\t\tvar res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,\n\t\t out, out.length, rounds);\n\t\tif (res !== 0) {\n\t\t\tthrow (new Error('bcrypt_pbkdf function returned ' +\n\t\t\t 'failure, parameters invalid'));\n\t\t}\n\t\tout = Buffer.from(out);\n\t\tvar ckey = out.slice(0, cinf.keySize);\n\t\tvar iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);\n\n\t\tvar cipherStream = crypto.createCipheriv(cinf.opensslName,\n\t\t ckey, iv);\n\t\tcipherStream.setAutoPadding(false);\n\t\tvar chunk, chunks = [];\n\t\tcipherStream.once('error', function (e) {\n\t\t\tthrow (e);\n\t\t});\n\t\tcipherStream.write(privBuf);\n\t\tcipherStream.end();\n\t\twhile ((chunk = cipherStream.read()) !== null)\n\t\t\tchunks.push(chunk);\n\t\tprivBuf = Buffer.concat(chunks);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error('Unsupported kdf ' + kdf));\n\t}\n\n\tvar buf = new SSHBuffer({});\n\n\tbuf.writeCString(MAGIC);\n\tbuf.writeString(cipher);\t/* cipher */\n\tbuf.writeString(kdf);\t\t/* kdf */\n\tbuf.writeBuffer(kdfopts);\t/* kdfoptions */\n\n\tbuf.writeInt(1);\t\t/* nkeys */\n\tbuf.writeBuffer(pubKey.toBuffer('rfc4253'));\n\n\tif (privBuf)\n\t\tbuf.writeBuffer(privBuf);\n\n\tbuf = buf.toBuffer();\n\n\tvar header;\n\tif (PrivateKey.isPrivateKey(key))\n\t\theader = 'OPENSSH PRIVATE KEY';\n\telse\n\t\theader = 'OPENSSH PUBLIC KEY';\n\n\tvar tmp = buf.toString('base64');\n\tvar len = tmp.length + (tmp.length / 70) +\n\t 18 + 16 + header.length*2 + 10;\n\tbuf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 70;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar rfc4253 = require('./rfc4253');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\n\nvar sshpriv = require('./ssh-private');\n\n/*JSSTYLED*/\nvar SSHKEY_RE = /^([a-z0-9-]+)[ \\t]+([a-zA-Z0-9+\\/]+[=]*)([ \\t]+([^ \\t][^\\n]*[\\n]*)?)?$/;\n/*JSSTYLED*/\nvar SSHKEY_RE2 = /^([a-z0-9-]+)[ \\t\\n]+([a-zA-Z0-9+\\/][a-zA-Z0-9+\\/ \\t\\n=]*)([^a-zA-Z0-9+\\/ \\t\\n=].*)?$/;\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar trimmed = buf.trim().replace(/[\\\\\\r]/g, '');\n\tvar m = trimmed.match(SSHKEY_RE);\n\tif (!m)\n\t\tm = trimmed.match(SSHKEY_RE2);\n\tassert.ok(m, 'key must match regex');\n\n\tvar type = rfc4253.algToKeyType(m[1]);\n\tvar kbuf = Buffer.from(m[2], 'base64');\n\n\t/*\n\t * This is a bit tricky. If we managed to parse the key and locate the\n\t * key comment with the regex, then do a non-partial read and assert\n\t * that we have consumed all bytes. If we couldn't locate the key\n\t * comment, though, there may be whitespace shenanigans going on that\n\t * have conjoined the comment to the rest of the key. We do a partial\n\t * read in this case to try to make the best out of a sorry situation.\n\t */\n\tvar key;\n\tvar ret = {};\n\tif (m[4]) {\n\t\ttry {\n\t\t\tkey = rfc4253.read(kbuf);\n\n\t\t} catch (e) {\n\t\t\tm = trimmed.match(SSHKEY_RE2);\n\t\t\tassert.ok(m, 'key must match regex');\n\t\t\tkbuf = Buffer.from(m[2], 'base64');\n\t\t\tkey = rfc4253.readInternal(ret, 'public', kbuf);\n\t\t}\n\t} else {\n\t\tkey = rfc4253.readInternal(ret, 'public', kbuf);\n\t}\n\n\tassert.strictEqual(type, key.type);\n\n\tif (m[4] && m[4].length > 0) {\n\t\tkey.comment = m[4];\n\n\t} else if (ret.consumed) {\n\t\t/*\n\t\t * Now the magic: trying to recover the key comment when it's\n\t\t * gotten conjoined to the key or otherwise shenanigan'd.\n\t\t *\n\t\t * Work out how much base64 we used, then drop all non-base64\n\t\t * chars from the beginning up to this point in the the string.\n\t\t * Then offset in this and try to make up for missing = chars.\n\t\t */\n\t\tvar data = m[2] + (m[3] ? m[3] : '');\n\t\tvar realOffset = Math.ceil(ret.consumed / 3) * 4;\n\t\tdata = data.slice(0, realOffset - 2). /*JSSTYLED*/\n\t\t replace(/[^a-zA-Z0-9+\\/=]/g, '') +\n\t\t data.slice(realOffset - 2);\n\n\t\tvar padding = ret.consumed % 3;\n\t\tif (padding > 0 &&\n\t\t data.slice(realOffset - 1, realOffset) !== '=')\n\t\t\trealOffset--;\n\t\twhile (data.slice(realOffset, realOffset + 1) === '=')\n\t\t\trealOffset++;\n\n\t\t/* Finally, grab what we think is the comment & clean it up. */\n\t\tvar trailer = data.slice(realOffset);\n\t\ttrailer = trailer.replace(/[\\r\\n]/g, ' ').\n\t\t replace(/^\\s+/, '');\n\t\tif (trailer.match(/^[a-zA-Z0-9]/))\n\t\t\tkey.comment = trailer;\n\t}\n\n\treturn (key);\n}\n\nfunction write(key, options) {\n\tassert.object(key);\n\tif (!Key.isKey(key))\n\t\tthrow (new Error('Must be a public key'));\n\n\tvar parts = [];\n\tvar alg = rfc4253.keyTypeToAlg(key);\n\tparts.push(alg);\n\n\tvar buf = rfc4253.write(key);\n\tparts.push(buf.toString('base64'));\n\n\tif (key.comment)\n\t\tparts.push(key.comment);\n\n\treturn (Buffer.from(parts.join(' ')));\n}\n","// Copyright 2016 Joyent, Inc.\n\nvar x509 = require('./x509');\n\nmodule.exports = {\n\tread: read,\n\tverify: x509.verify,\n\tsign: x509.sign,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\nvar Identity = require('../identity');\nvar Signature = require('../signature');\nvar Certificate = require('../certificate');\n\nfunction read(buf, options) {\n\tif (typeof (buf) !== 'string') {\n\t\tassert.buffer(buf, 'buf');\n\t\tbuf = buf.toString('ascii');\n\t}\n\n\tvar lines = buf.trim().split(/[\\r\\n]+/g);\n\n\tvar m;\n\tvar si = -1;\n\twhile (!m && si < lines.length) {\n\t\tm = lines[++si].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/);\n\t}\n\tassert.ok(m, 'invalid PEM header');\n\n\tvar m2;\n\tvar ei = lines.length;\n\twhile (!m2 && ei > 0) {\n\t\tm2 = lines[--ei].match(/*JSSTYLED*/\n\t\t /[-]+[ ]*END CERTIFICATE[ ]*[-]+/);\n\t}\n\tassert.ok(m2, 'invalid PEM footer');\n\n\tlines = lines.slice(si, ei + 1);\n\n\tvar headers = {};\n\twhile (true) {\n\t\tlines = lines.slice(1);\n\t\tm = lines[0].match(/*JSSTYLED*/\n\t\t /^([A-Za-z0-9-]+): (.+)$/);\n\t\tif (!m)\n\t\t\tbreak;\n\t\theaders[m[1].toLowerCase()] = m[2];\n\t}\n\n\t/* Chop off the first and last lines */\n\tlines = lines.slice(0, -1).join('');\n\tbuf = Buffer.from(lines, 'base64');\n\n\treturn (x509.read(buf, options));\n}\n\nfunction write(cert, options) {\n\tvar dbuf = x509.write(cert, options);\n\n\tvar header = 'CERTIFICATE';\n\tvar tmp = dbuf.toString('base64');\n\tvar len = tmp.length + (tmp.length / 64) +\n\t 18 + 16 + header.length*2 + 10;\n\tvar buf = Buffer.alloc(len);\n\tvar o = 0;\n\to += buf.write('-----BEGIN ' + header + '-----\\n', o);\n\tfor (var i = 0; i < tmp.length; ) {\n\t\tvar limit = i + 64;\n\t\tif (limit > tmp.length)\n\t\t\tlimit = tmp.length;\n\t\to += buf.write(tmp.slice(i, limit), o);\n\t\tbuf[o++] = 10;\n\t\ti = limit;\n\t}\n\to += buf.write('-----END ' + header + '-----\\n', o);\n\n\treturn (buf.slice(0, o));\n}\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = {\n\tread: read,\n\tverify: verify,\n\tsign: sign,\n\tsignAsync: signAsync,\n\twrite: write\n};\n\nvar assert = require('assert-plus');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('../algs');\nvar utils = require('../utils');\nvar Key = require('../key');\nvar PrivateKey = require('../private-key');\nvar pem = require('./pem');\nvar Identity = require('../identity');\nvar Signature = require('../signature');\nvar Certificate = require('../certificate');\nvar pkcs8 = require('./pkcs8');\n\n/*\n * This file is based on RFC5280 (X.509).\n */\n\n/* Helper to read in a single mpint */\nfunction readMPInt(der, nm) {\n\tassert.strictEqual(der.peek(), asn1.Ber.Integer,\n\t nm + ' is not an Integer');\n\treturn (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));\n}\n\nfunction verify(cert, key) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tvar algParts = sig.algo.split('-');\n\tif (algParts[0] !== key.type)\n\t\treturn (false);\n\n\tvar blob = sig.cache;\n\tif (blob === undefined) {\n\t\tvar der = new asn1.BerWriter();\n\t\twriteTBSCert(cert, der);\n\t\tblob = der.buffer;\n\t}\n\n\tvar verifier = key.createVerify(algParts[1]);\n\tverifier.write(blob);\n\treturn (verifier.verify(sig.signature));\n}\n\nfunction Local(i) {\n\treturn (asn1.Ber.Context | asn1.Ber.Constructor | i);\n}\n\nfunction Context(i) {\n\treturn (asn1.Ber.Context | i);\n}\n\nvar SIGN_ALGS = {\n\t'rsa-md5': '1.2.840.113549.1.1.4',\n\t'rsa-sha1': '1.2.840.113549.1.1.5',\n\t'rsa-sha256': '1.2.840.113549.1.1.11',\n\t'rsa-sha384': '1.2.840.113549.1.1.12',\n\t'rsa-sha512': '1.2.840.113549.1.1.13',\n\t'dsa-sha1': '1.2.840.10040.4.3',\n\t'dsa-sha256': '2.16.840.1.101.3.4.3.2',\n\t'ecdsa-sha1': '1.2.840.10045.4.1',\n\t'ecdsa-sha256': '1.2.840.10045.4.3.2',\n\t'ecdsa-sha384': '1.2.840.10045.4.3.3',\n\t'ecdsa-sha512': '1.2.840.10045.4.3.4',\n\t'ed25519-sha512': '1.3.101.112'\n};\nObject.keys(SIGN_ALGS).forEach(function (k) {\n\tSIGN_ALGS[SIGN_ALGS[k]] = k;\n});\nSIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5';\nSIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1';\n\nvar EXTS = {\n\t'issuerKeyId': '2.5.29.35',\n\t'altName': '2.5.29.17',\n\t'basicConstraints': '2.5.29.19',\n\t'keyUsage': '2.5.29.15',\n\t'extKeyUsage': '2.5.29.37'\n};\n\nfunction read(buf, options) {\n\tif (typeof (buf) === 'string') {\n\t\tbuf = Buffer.from(buf, 'binary');\n\t}\n\tassert.buffer(buf, 'buf');\n\n\tvar der = new asn1.BerReader(buf);\n\n\tder.readSequence();\n\tif (Math.abs(der.length - der.remain) > 1) {\n\t\tthrow (new Error('DER sequence does not contain whole byte ' +\n\t\t 'stream'));\n\t}\n\n\tvar tbsStart = der.offset;\n\tder.readSequence();\n\tvar sigOffset = der.offset + der.length;\n\tvar tbsEnd = sigOffset;\n\n\tif (der.peek() === Local(0)) {\n\t\tder.readSequence(Local(0));\n\t\tvar version = der.readInt();\n\t\tassert.ok(version <= 3,\n\t\t 'only x.509 versions up to v3 supported');\n\t}\n\n\tvar cert = {};\n\tcert.signatures = {};\n\tvar sig = (cert.signatures.x509 = {});\n\tsig.extras = {};\n\n\tcert.serial = readMPInt(der, 'serial');\n\n\tder.readSequence();\n\tvar after = der.offset + der.length;\n\tvar certAlgOid = der.readOID();\n\tvar certAlg = SIGN_ALGS[certAlgOid];\n\tif (certAlg === undefined)\n\t\tthrow (new Error('unknown signature algorithm ' + certAlgOid));\n\n\tder._offset = after;\n\tcert.issuer = Identity.parseAsn1(der);\n\n\tder.readSequence();\n\tcert.validFrom = readDate(der);\n\tcert.validUntil = readDate(der);\n\n\tcert.subjects = [Identity.parseAsn1(der)];\n\n\tder.readSequence();\n\tafter = der.offset + der.length;\n\tcert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der);\n\tder._offset = after;\n\n\t/* issuerUniqueID */\n\tif (der.peek() === Local(1)) {\n\t\tder.readSequence(Local(1));\n\t\tsig.extras.issuerUniqueID =\n\t\t buf.slice(der.offset, der.offset + der.length);\n\t\tder._offset += der.length;\n\t}\n\n\t/* subjectUniqueID */\n\tif (der.peek() === Local(2)) {\n\t\tder.readSequence(Local(2));\n\t\tsig.extras.subjectUniqueID =\n\t\t buf.slice(der.offset, der.offset + der.length);\n\t\tder._offset += der.length;\n\t}\n\n\t/* extensions */\n\tif (der.peek() === Local(3)) {\n\t\tder.readSequence(Local(3));\n\t\tvar extEnd = der.offset + der.length;\n\t\tder.readSequence();\n\n\t\twhile (der.offset < extEnd)\n\t\t\treadExtension(cert, buf, der);\n\n\t\tassert.strictEqual(der.offset, extEnd);\n\t}\n\n\tassert.strictEqual(der.offset, sigOffset);\n\n\tder.readSequence();\n\tafter = der.offset + der.length;\n\tvar sigAlgOid = der.readOID();\n\tvar sigAlg = SIGN_ALGS[sigAlgOid];\n\tif (sigAlg === undefined)\n\t\tthrow (new Error('unknown signature algorithm ' + sigAlgOid));\n\tder._offset = after;\n\n\tvar sigData = der.readString(asn1.Ber.BitString, true);\n\tif (sigData[0] === 0)\n\t\tsigData = sigData.slice(1);\n\tvar algParts = sigAlg.split('-');\n\n\tsig.signature = Signature.parse(sigData, algParts[0], 'asn1');\n\tsig.signature.hashAlgorithm = algParts[1];\n\tsig.algo = sigAlg;\n\tsig.cache = buf.slice(tbsStart, tbsEnd);\n\n\treturn (new Certificate(cert));\n}\n\nfunction readDate(der) {\n\tif (der.peek() === asn1.Ber.UTCTime) {\n\t\treturn (utcTimeToDate(der.readString(asn1.Ber.UTCTime)));\n\t} else if (der.peek() === asn1.Ber.GeneralizedTime) {\n\t\treturn (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime)));\n\t} else {\n\t\tthrow (new Error('Unsupported date format'));\n\t}\n}\n\nfunction writeDate(der, date) {\n\tif (date.getUTCFullYear() >= 2050 || date.getUTCFullYear() < 1950) {\n\t\tder.writeString(dateToGTime(date), asn1.Ber.GeneralizedTime);\n\t} else {\n\t\tder.writeString(dateToUTCTime(date), asn1.Ber.UTCTime);\n\t}\n}\n\n/* RFC5280, section 4.2.1.6 (GeneralName type) */\nvar ALTNAME = {\n\tOtherName: Local(0),\n\tRFC822Name: Context(1),\n\tDNSName: Context(2),\n\tX400Address: Local(3),\n\tDirectoryName: Local(4),\n\tEDIPartyName: Local(5),\n\tURI: Context(6),\n\tIPAddress: Context(7),\n\tOID: Context(8)\n};\n\n/* RFC5280, section 4.2.1.12 (KeyPurposeId) */\nvar EXTPURPOSE = {\n\t'serverAuth': '1.3.6.1.5.5.7.3.1',\n\t'clientAuth': '1.3.6.1.5.5.7.3.2',\n\t'codeSigning': '1.3.6.1.5.5.7.3.3',\n\n\t/* See https://github.com/joyent/oid-docs/blob/master/root.md */\n\t'joyentDocker': '1.3.6.1.4.1.38678.1.4.1',\n\t'joyentCmon': '1.3.6.1.4.1.38678.1.4.2'\n};\nvar EXTPURPOSE_REV = {};\nObject.keys(EXTPURPOSE).forEach(function (k) {\n\tEXTPURPOSE_REV[EXTPURPOSE[k]] = k;\n});\n\nvar KEYUSEBITS = [\n\t'signature', 'identity', 'keyEncryption',\n\t'encryption', 'keyAgreement', 'ca', 'crl'\n];\n\nfunction readExtension(cert, buf, der) {\n\tder.readSequence();\n\tvar after = der.offset + der.length;\n\tvar extId = der.readOID();\n\tvar id;\n\tvar sig = cert.signatures.x509;\n\tif (!sig.extras.exts)\n\t\tsig.extras.exts = [];\n\n\tvar critical;\n\tif (der.peek() === asn1.Ber.Boolean)\n\t\tcritical = der.readBoolean();\n\n\tswitch (extId) {\n\tcase (EXTS.basicConstraints):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tvar bcEnd = der.offset + der.length;\n\t\tvar ca = false;\n\t\tif (der.peek() === asn1.Ber.Boolean)\n\t\t\tca = der.readBoolean();\n\t\tif (cert.purposes === undefined)\n\t\t\tcert.purposes = [];\n\t\tif (ca === true)\n\t\t\tcert.purposes.push('ca');\n\t\tvar bc = { oid: extId, critical: critical };\n\t\tif (der.offset < bcEnd && der.peek() === asn1.Ber.Integer)\n\t\t\tbc.pathLen = der.readInt();\n\t\tsig.extras.exts.push(bc);\n\t\tbreak;\n\tcase (EXTS.extKeyUsage):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tif (cert.purposes === undefined)\n\t\t\tcert.purposes = [];\n\t\tvar ekEnd = der.offset + der.length;\n\t\twhile (der.offset < ekEnd) {\n\t\t\tvar oid = der.readOID();\n\t\t\tcert.purposes.push(EXTPURPOSE_REV[oid] || oid);\n\t\t}\n\t\t/*\n\t\t * This is a bit of a hack: in the case where we have a cert\n\t\t * that's only allowed to do serverAuth or clientAuth (and not\n\t\t * the other), we want to make sure all our Subjects are of\n\t\t * the right type. But we already parsed our Subjects and\n\t\t * decided if they were hosts or users earlier (since it appears\n\t\t * first in the cert).\n\t\t *\n\t\t * So we go through and mutate them into the right kind here if\n\t\t * it doesn't match. This might not be hugely beneficial, as it\n\t\t * seems that single-purpose certs are not often seen in the\n\t\t * wild.\n\t\t */\n\t\tif (cert.purposes.indexOf('serverAuth') !== -1 &&\n\t\t cert.purposes.indexOf('clientAuth') === -1) {\n\t\t\tcert.subjects.forEach(function (ide) {\n\t\t\t\tif (ide.type !== 'host') {\n\t\t\t\t\tide.type = 'host';\n\t\t\t\t\tide.hostname = ide.uid ||\n\t\t\t\t\t ide.email ||\n\t\t\t\t\t ide.components[0].value;\n\t\t\t\t}\n\t\t\t});\n\t\t} else if (cert.purposes.indexOf('clientAuth') !== -1 &&\n\t\t cert.purposes.indexOf('serverAuth') === -1) {\n\t\t\tcert.subjects.forEach(function (ide) {\n\t\t\t\tif (ide.type !== 'user') {\n\t\t\t\t\tide.type = 'user';\n\t\t\t\t\tide.uid = ide.hostname ||\n\t\t\t\t\t ide.email ||\n\t\t\t\t\t ide.components[0].value;\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tsig.extras.exts.push({ oid: extId, critical: critical });\n\t\tbreak;\n\tcase (EXTS.keyUsage):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tvar bits = der.readString(asn1.Ber.BitString, true);\n\t\tvar setBits = readBitField(bits, KEYUSEBITS);\n\t\tsetBits.forEach(function (bit) {\n\t\t\tif (cert.purposes === undefined)\n\t\t\t\tcert.purposes = [];\n\t\t\tif (cert.purposes.indexOf(bit) === -1)\n\t\t\t\tcert.purposes.push(bit);\n\t\t});\n\t\tsig.extras.exts.push({ oid: extId, critical: critical,\n\t\t bits: bits });\n\t\tbreak;\n\tcase (EXTS.altName):\n\t\tder.readSequence(asn1.Ber.OctetString);\n\t\tder.readSequence();\n\t\tvar aeEnd = der.offset + der.length;\n\t\twhile (der.offset < aeEnd) {\n\t\t\tswitch (der.peek()) {\n\t\t\tcase ALTNAME.OtherName:\n\t\t\tcase ALTNAME.EDIPartyName:\n\t\t\t\tder.readSequence();\n\t\t\t\tder._offset += der.length;\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.OID:\n\t\t\t\tder.readOID(ALTNAME.OID);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.RFC822Name:\n\t\t\t\t/* RFC822 specifies email addresses */\n\t\t\t\tvar email = der.readString(ALTNAME.RFC822Name);\n\t\t\t\tid = Identity.forEmail(email);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.DirectoryName:\n\t\t\t\tder.readSequence(ALTNAME.DirectoryName);\n\t\t\t\tid = Identity.parseAsn1(der);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tcase ALTNAME.DNSName:\n\t\t\t\tvar host = der.readString(\n\t\t\t\t ALTNAME.DNSName);\n\t\t\t\tid = Identity.forHost(host);\n\t\t\t\tif (!cert.subjects[0].equals(id))\n\t\t\t\t\tcert.subjects.push(id);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tder.readString(der.peek());\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tsig.extras.exts.push({ oid: extId, critical: critical });\n\t\tbreak;\n\tdefault:\n\t\tsig.extras.exts.push({\n\t\t\toid: extId,\n\t\t\tcritical: critical,\n\t\t\tdata: der.readString(asn1.Ber.OctetString, true)\n\t\t});\n\t\tbreak;\n\t}\n\n\tder._offset = after;\n}\n\nvar UTCTIME_RE =\n /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;\nfunction utcTimeToDate(t) {\n\tvar m = t.match(UTCTIME_RE);\n\tassert.ok(m, 'timestamps must be in UTC');\n\tvar d = new Date();\n\n\tvar thisYear = d.getUTCFullYear();\n\tvar century = Math.floor(thisYear / 100) * 100;\n\n\tvar year = parseInt(m[1], 10);\n\tif (thisYear % 100 < 50 && year >= 60)\n\t\tyear += (century - 1);\n\telse\n\t\tyear += century;\n\td.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10));\n\td.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));\n\tif (m[6] && m[6].length > 0)\n\t\td.setUTCSeconds(parseInt(m[6], 10));\n\treturn (d);\n}\n\nvar GTIME_RE =\n /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;\nfunction gTimeToDate(t) {\n\tvar m = t.match(GTIME_RE);\n\tassert.ok(m);\n\tvar d = new Date();\n\n\td.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1,\n\t parseInt(m[3], 10));\n\td.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));\n\tif (m[6] && m[6].length > 0)\n\t\td.setUTCSeconds(parseInt(m[6], 10));\n\treturn (d);\n}\n\nfunction zeroPad(n, m) {\n\tif (m === undefined)\n\t\tm = 2;\n\tvar s = '' + n;\n\twhile (s.length < m)\n\t\ts = '0' + s;\n\treturn (s);\n}\n\nfunction dateToUTCTime(d) {\n\tvar s = '';\n\ts += zeroPad(d.getUTCFullYear() % 100);\n\ts += zeroPad(d.getUTCMonth() + 1);\n\ts += zeroPad(d.getUTCDate());\n\ts += zeroPad(d.getUTCHours());\n\ts += zeroPad(d.getUTCMinutes());\n\ts += zeroPad(d.getUTCSeconds());\n\ts += 'Z';\n\treturn (s);\n}\n\nfunction dateToGTime(d) {\n\tvar s = '';\n\ts += zeroPad(d.getUTCFullYear(), 4);\n\ts += zeroPad(d.getUTCMonth() + 1);\n\ts += zeroPad(d.getUTCDate());\n\ts += zeroPad(d.getUTCHours());\n\ts += zeroPad(d.getUTCMinutes());\n\ts += zeroPad(d.getUTCSeconds());\n\ts += 'Z';\n\treturn (s);\n}\n\nfunction sign(cert, key) {\n\tif (cert.signatures.x509 === undefined)\n\t\tcert.signatures.x509 = {};\n\tvar sig = cert.signatures.x509;\n\n\tsig.algo = key.type + '-' + key.defaultHashAlgorithm();\n\tif (SIGN_ALGS[sig.algo] === undefined)\n\t\treturn (false);\n\n\tvar der = new asn1.BerWriter();\n\twriteTBSCert(cert, der);\n\tvar blob = der.buffer;\n\tsig.cache = blob;\n\n\tvar signer = key.createSign();\n\tsigner.write(blob);\n\tcert.signatures.x509.signature = signer.sign();\n\n\treturn (true);\n}\n\nfunction signAsync(cert, signer, done) {\n\tif (cert.signatures.x509 === undefined)\n\t\tcert.signatures.x509 = {};\n\tvar sig = cert.signatures.x509;\n\n\tvar der = new asn1.BerWriter();\n\twriteTBSCert(cert, der);\n\tvar blob = der.buffer;\n\tsig.cache = blob;\n\n\tsigner(blob, function (err, signature) {\n\t\tif (err) {\n\t\t\tdone(err);\n\t\t\treturn;\n\t\t}\n\t\tsig.algo = signature.type + '-' + signature.hashAlgorithm;\n\t\tif (SIGN_ALGS[sig.algo] === undefined) {\n\t\t\tdone(new Error('Invalid signing algorithm \"' +\n\t\t\t sig.algo + '\"'));\n\t\t\treturn;\n\t\t}\n\t\tsig.signature = signature;\n\t\tdone();\n\t});\n}\n\nfunction write(cert, options) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tvar der = new asn1.BerWriter();\n\tder.startSequence();\n\tif (sig.cache) {\n\t\tder._ensure(sig.cache.length);\n\t\tsig.cache.copy(der._buf, der._offset);\n\t\tder._offset += sig.cache.length;\n\t} else {\n\t\twriteTBSCert(cert, der);\n\t}\n\n\tder.startSequence();\n\tder.writeOID(SIGN_ALGS[sig.algo]);\n\tif (sig.algo.match(/^rsa-/))\n\t\tder.writeNull();\n\tder.endSequence();\n\n\tvar sigData = sig.signature.toBuffer('asn1');\n\tvar data = Buffer.alloc(sigData.length + 1);\n\tdata[0] = 0;\n\tsigData.copy(data, 1);\n\tder.writeBuffer(data, asn1.Ber.BitString);\n\tder.endSequence();\n\n\treturn (der.buffer);\n}\n\nfunction writeTBSCert(cert, der) {\n\tvar sig = cert.signatures.x509;\n\tassert.object(sig, 'x509 signature');\n\n\tder.startSequence();\n\n\tder.startSequence(Local(0));\n\tder.writeInt(2);\n\tder.endSequence();\n\n\tder.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer);\n\n\tder.startSequence();\n\tder.writeOID(SIGN_ALGS[sig.algo]);\n\tif (sig.algo.match(/^rsa-/))\n\t\tder.writeNull();\n\tder.endSequence();\n\n\tcert.issuer.toAsn1(der);\n\n\tder.startSequence();\n\twriteDate(der, cert.validFrom);\n\twriteDate(der, cert.validUntil);\n\tder.endSequence();\n\n\tvar subject = cert.subjects[0];\n\tvar altNames = cert.subjects.slice(1);\n\tsubject.toAsn1(der);\n\n\tpkcs8.writePkcs8(der, cert.subjectKey);\n\n\tif (sig.extras && sig.extras.issuerUniqueID) {\n\t\tder.writeBuffer(sig.extras.issuerUniqueID, Local(1));\n\t}\n\n\tif (sig.extras && sig.extras.subjectUniqueID) {\n\t\tder.writeBuffer(sig.extras.subjectUniqueID, Local(2));\n\t}\n\n\tif (altNames.length > 0 || subject.type === 'host' ||\n\t (cert.purposes !== undefined && cert.purposes.length > 0) ||\n\t (sig.extras && sig.extras.exts)) {\n\t\tder.startSequence(Local(3));\n\t\tder.startSequence();\n\n\t\tvar exts = [];\n\t\tif (cert.purposes !== undefined && cert.purposes.length > 0) {\n\t\t\texts.push({\n\t\t\t\toid: EXTS.basicConstraints,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t\texts.push({\n\t\t\t\toid: EXTS.keyUsage,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t\texts.push({\n\t\t\t\toid: EXTS.extKeyUsage,\n\t\t\t\tcritical: true\n\t\t\t});\n\t\t}\n\t\texts.push({ oid: EXTS.altName });\n\t\tif (sig.extras && sig.extras.exts)\n\t\t\texts = sig.extras.exts;\n\n\t\tfor (var i = 0; i < exts.length; ++i) {\n\t\t\tder.startSequence();\n\t\t\tder.writeOID(exts[i].oid);\n\n\t\t\tif (exts[i].critical !== undefined)\n\t\t\t\tder.writeBoolean(exts[i].critical);\n\n\t\t\tif (exts[i].oid === EXTS.altName) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tif (subject.type === 'host') {\n\t\t\t\t\tder.writeString(subject.hostname,\n\t\t\t\t\t Context(2));\n\t\t\t\t}\n\t\t\t\tfor (var j = 0; j < altNames.length; ++j) {\n\t\t\t\t\tif (altNames[j].type === 'host') {\n\t\t\t\t\t\tder.writeString(\n\t\t\t\t\t\t altNames[j].hostname,\n\t\t\t\t\t\t ALTNAME.DNSName);\n\t\t\t\t\t} else if (altNames[j].type ===\n\t\t\t\t\t 'email') {\n\t\t\t\t\t\tder.writeString(\n\t\t\t\t\t\t altNames[j].email,\n\t\t\t\t\t\t ALTNAME.RFC822Name);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t/*\n\t\t\t\t\t\t * Encode anything else as a\n\t\t\t\t\t\t * DN style name for now.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tder.startSequence(\n\t\t\t\t\t\t ALTNAME.DirectoryName);\n\t\t\t\t\t\taltNames[j].toAsn1(der);\n\t\t\t\t\t\tder.endSequence();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.basicConstraints) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tvar ca = (cert.purposes.indexOf('ca') !== -1);\n\t\t\t\tvar pathLen = exts[i].pathLen;\n\t\t\t\tder.writeBoolean(ca);\n\t\t\t\tif (pathLen !== undefined)\n\t\t\t\t\tder.writeInt(pathLen);\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.extKeyUsage) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\tder.startSequence();\n\t\t\t\tcert.purposes.forEach(function (purpose) {\n\t\t\t\t\tif (purpose === 'ca')\n\t\t\t\t\t\treturn;\n\t\t\t\t\tif (KEYUSEBITS.indexOf(purpose) !== -1)\n\t\t\t\t\t\treturn;\n\t\t\t\t\tvar oid = purpose;\n\t\t\t\t\tif (EXTPURPOSE[purpose] !== undefined)\n\t\t\t\t\t\toid = EXTPURPOSE[purpose];\n\t\t\t\t\tder.writeOID(oid);\n\t\t\t\t});\n\t\t\t\tder.endSequence();\n\t\t\t\tder.endSequence();\n\t\t\t} else if (exts[i].oid === EXTS.keyUsage) {\n\t\t\t\tder.startSequence(asn1.Ber.OctetString);\n\t\t\t\t/*\n\t\t\t\t * If we parsed this certificate from a byte\n\t\t\t\t * stream (i.e. we didn't generate it in sshpk)\n\t\t\t\t * then we'll have a \".bits\" property on the\n\t\t\t\t * ext with the original raw byte contents.\n\t\t\t\t *\n\t\t\t\t * If we have this, use it here instead of\n\t\t\t\t * regenerating it. This guarantees we output\n\t\t\t\t * the same data we parsed, so signatures still\n\t\t\t\t * validate.\n\t\t\t\t */\n\t\t\t\tif (exts[i].bits !== undefined) {\n\t\t\t\t\tder.writeBuffer(exts[i].bits,\n\t\t\t\t\t asn1.Ber.BitString);\n\t\t\t\t} else {\n\t\t\t\t\tvar bits = writeBitField(cert.purposes,\n\t\t\t\t\t KEYUSEBITS);\n\t\t\t\t\tder.writeBuffer(bits,\n\t\t\t\t\t asn1.Ber.BitString);\n\t\t\t\t}\n\t\t\t\tder.endSequence();\n\t\t\t} else {\n\t\t\t\tder.writeBuffer(exts[i].data,\n\t\t\t\t asn1.Ber.OctetString);\n\t\t\t}\n\n\t\t\tder.endSequence();\n\t\t}\n\n\t\tder.endSequence();\n\t\tder.endSequence();\n\t}\n\n\tder.endSequence();\n}\n\n/*\n * Reads an ASN.1 BER bitfield out of the Buffer produced by doing\n * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw\n * contents of the BitString tag, which is a count of unused bits followed by\n * the bits as a right-padded byte string.\n *\n * `bits` is the Buffer, `bitIndex` should contain an array of string names\n * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec.\n *\n * Returns an array of Strings, the names of the bits that were set to 1.\n */\nfunction readBitField(bits, bitIndex) {\n\tvar bitLen = 8 * (bits.length - 1) - bits[0];\n\tvar setBits = {};\n\tfor (var i = 0; i < bitLen; ++i) {\n\t\tvar byteN = 1 + Math.floor(i / 8);\n\t\tvar bit = 7 - (i % 8);\n\t\tvar mask = 1 << bit;\n\t\tvar bitVal = ((bits[byteN] & mask) !== 0);\n\t\tvar name = bitIndex[i];\n\t\tif (bitVal && typeof (name) === 'string') {\n\t\t\tsetBits[name] = true;\n\t\t}\n\t}\n\treturn (Object.keys(setBits));\n}\n\n/*\n * `setBits` is an array of strings, containing the names for each bit that\n * sould be set to 1. `bitIndex` is same as in `readBitField()`.\n *\n * Returns a Buffer, ready to be written out with `BerWriter#writeString()`.\n */\nfunction writeBitField(setBits, bitIndex) {\n\tvar bitLen = bitIndex.length;\n\tvar blen = Math.ceil(bitLen / 8);\n\tvar unused = blen * 8 - bitLen;\n\tvar bits = Buffer.alloc(1 + blen); // zero-filled\n\tbits[0] = unused;\n\tfor (var i = 0; i < bitLen; ++i) {\n\t\tvar byteN = 1 + Math.floor(i / 8);\n\t\tvar bit = 7 - (i % 8);\n\t\tvar mask = 1 << bit;\n\t\tvar name = bitIndex[i];\n\t\tif (name === undefined)\n\t\t\tcontinue;\n\t\tvar bitVal = (setBits.indexOf(name) !== -1);\n\t\tif (bitVal) {\n\t\t\tbits[byteN] |= mask;\n\t\t}\n\t}\n\treturn (bits);\n}\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = Identity;\n\nvar assert = require('assert-plus');\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar errs = require('./errors');\nvar util = require('util');\nvar utils = require('./utils');\nvar asn1 = require('asn1');\nvar Buffer = require('safer-buffer').Buffer;\n\n/*JSSTYLED*/\nvar DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\\-]{0,62})(?:\\.([*]|[a-z0-9][a-z0-9\\-]{0,62}))*$/i;\n\nvar oids = {};\noids.cn = '2.5.4.3';\noids.o = '2.5.4.10';\noids.ou = '2.5.4.11';\noids.l = '2.5.4.7';\noids.s = '2.5.4.8';\noids.c = '2.5.4.6';\noids.sn = '2.5.4.4';\noids.postalCode = '2.5.4.17';\noids.serialNumber = '2.5.4.5';\noids.street = '2.5.4.9';\noids.x500UniqueIdentifier = '2.5.4.45';\noids.role = '2.5.4.72';\noids.telephoneNumber = '2.5.4.20';\noids.description = '2.5.4.13';\noids.dc = '0.9.2342.19200300.100.1.25';\noids.uid = '0.9.2342.19200300.100.1.1';\noids.mail = '0.9.2342.19200300.100.1.3';\noids.title = '2.5.4.12';\noids.gn = '2.5.4.42';\noids.initials = '2.5.4.43';\noids.pseudonym = '2.5.4.65';\noids.emailAddress = '1.2.840.113549.1.9.1';\n\nvar unoids = {};\nObject.keys(oids).forEach(function (k) {\n\tunoids[oids[k]] = k;\n});\n\nfunction Identity(opts) {\n\tvar self = this;\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.components, 'options.components');\n\tthis.components = opts.components;\n\tthis.componentLookup = {};\n\tthis.components.forEach(function (c) {\n\t\tif (c.name && !c.oid)\n\t\t\tc.oid = oids[c.name];\n\t\tif (c.oid && !c.name)\n\t\t\tc.name = unoids[c.oid];\n\t\tif (self.componentLookup[c.name] === undefined)\n\t\t\tself.componentLookup[c.name] = [];\n\t\tself.componentLookup[c.name].push(c);\n\t});\n\tif (this.componentLookup.cn && this.componentLookup.cn.length > 0) {\n\t\tthis.cn = this.componentLookup.cn[0].value;\n\t}\n\tassert.optionalString(opts.type, 'options.type');\n\tif (opts.type === undefined) {\n\t\tif (this.components.length === 1 &&\n\t\t this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1 &&\n\t\t this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.cn[0].value;\n\n\t\t} else if (this.componentLookup.dc &&\n\t\t this.components.length === this.componentLookup.dc.length) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.dc.map(\n\t\t\t function (c) {\n\t\t\t\treturn (c.value);\n\t\t\t}).join('.');\n\n\t\t} else if (this.componentLookup.uid &&\n\t\t this.components.length ===\n\t\t this.componentLookup.uid.length) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.uid[0].value;\n\n\t\t} else if (this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1 &&\n\t\t this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {\n\t\t\tthis.type = 'host';\n\t\t\tthis.hostname = this.componentLookup.cn[0].value;\n\n\t\t} else if (this.componentLookup.uid &&\n\t\t this.componentLookup.uid.length === 1) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.uid[0].value;\n\n\t\t} else if (this.componentLookup.mail &&\n\t\t this.componentLookup.mail.length === 1) {\n\t\t\tthis.type = 'email';\n\t\t\tthis.email = this.componentLookup.mail[0].value;\n\n\t\t} else if (this.componentLookup.cn &&\n\t\t this.componentLookup.cn.length === 1) {\n\t\t\tthis.type = 'user';\n\t\t\tthis.uid = this.componentLookup.cn[0].value;\n\n\t\t} else {\n\t\t\tthis.type = 'unknown';\n\t\t}\n\t} else {\n\t\tthis.type = opts.type;\n\t\tif (this.type === 'host')\n\t\t\tthis.hostname = opts.hostname;\n\t\telse if (this.type === 'user')\n\t\t\tthis.uid = opts.uid;\n\t\telse if (this.type === 'email')\n\t\t\tthis.email = opts.email;\n\t\telse\n\t\t\tthrow (new Error('Unknown type ' + this.type));\n\t}\n}\n\nIdentity.prototype.toString = function () {\n\treturn (this.components.map(function (c) {\n\t\tvar n = c.name.toUpperCase();\n\t\t/*JSSTYLED*/\n\t\tn = n.replace(/=/g, '\\\\=');\n\t\tvar v = c.value;\n\t\t/*JSSTYLED*/\n\t\tv = v.replace(/,/g, '\\\\,');\n\t\treturn (n + '=' + v);\n\t}).join(', '));\n};\n\nIdentity.prototype.get = function (name, asArray) {\n\tassert.string(name, 'name');\n\tvar arr = this.componentLookup[name];\n\tif (arr === undefined || arr.length === 0)\n\t\treturn (undefined);\n\tif (!asArray && arr.length > 1)\n\t\tthrow (new Error('Multiple values for attribute ' + name));\n\tif (!asArray)\n\t\treturn (arr[0].value);\n\treturn (arr.map(function (c) {\n\t\treturn (c.value);\n\t}));\n};\n\nIdentity.prototype.toArray = function (idx) {\n\treturn (this.components.map(function (c) {\n\t\treturn ({\n\t\t\tname: c.name,\n\t\t\tvalue: c.value\n\t\t});\n\t}));\n};\n\n/*\n * These are from X.680 -- PrintableString allowed chars are in section 37.4\n * table 8. Spec for IA5Strings is \"1,6 + SPACE + DEL\" where 1 refers to\n * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006\n * (the basic ASCII character set).\n */\n/* JSSTYLED */\nvar NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\\/:=?-]/;\n/* JSSTYLED */\nvar NOT_IA5 = /[^\\x00-\\x7f]/;\n\nIdentity.prototype.toAsn1 = function (der, tag) {\n\tder.startSequence(tag);\n\tthis.components.forEach(function (c) {\n\t\tder.startSequence(asn1.Ber.Constructor | asn1.Ber.Set);\n\t\tder.startSequence();\n\t\tder.writeOID(c.oid);\n\t\t/*\n\t\t * If we fit in a PrintableString, use that. Otherwise use an\n\t\t * IA5String or UTF8String.\n\t\t *\n\t\t * If this identity was parsed from a DN, use the ASN.1 types\n\t\t * from the original representation (otherwise this might not\n\t\t * be a full match for the original in some validators).\n\t\t */\n\t\tif (c.asn1type === asn1.Ber.Utf8String ||\n\t\t c.value.match(NOT_IA5)) {\n\t\t\tvar v = Buffer.from(c.value, 'utf8');\n\t\t\tder.writeBuffer(v, asn1.Ber.Utf8String);\n\n\t\t} else if (c.asn1type === asn1.Ber.IA5String ||\n\t\t c.value.match(NOT_PRINTABLE)) {\n\t\t\tder.writeString(c.value, asn1.Ber.IA5String);\n\n\t\t} else {\n\t\t\tvar type = asn1.Ber.PrintableString;\n\t\t\tif (c.asn1type !== undefined)\n\t\t\t\ttype = c.asn1type;\n\t\t\tder.writeString(c.value, type);\n\t\t}\n\t\tder.endSequence();\n\t\tder.endSequence();\n\t});\n\tder.endSequence();\n};\n\nfunction globMatch(a, b) {\n\tif (a === '**' || b === '**')\n\t\treturn (true);\n\tvar aParts = a.split('.');\n\tvar bParts = b.split('.');\n\tif (aParts.length !== bParts.length)\n\t\treturn (false);\n\tfor (var i = 0; i < aParts.length; ++i) {\n\t\tif (aParts[i] === '*' || bParts[i] === '*')\n\t\t\tcontinue;\n\t\tif (aParts[i] !== bParts[i])\n\t\t\treturn (false);\n\t}\n\treturn (true);\n}\n\nIdentity.prototype.equals = function (other) {\n\tif (!Identity.isIdentity(other, [1, 0]))\n\t\treturn (false);\n\tif (other.components.length !== this.components.length)\n\t\treturn (false);\n\tfor (var i = 0; i < this.components.length; ++i) {\n\t\tif (this.components[i].oid !== other.components[i].oid)\n\t\t\treturn (false);\n\t\tif (!globMatch(this.components[i].value,\n\t\t other.components[i].value)) {\n\t\t\treturn (false);\n\t\t}\n\t}\n\treturn (true);\n};\n\nIdentity.forHost = function (hostname) {\n\tassert.string(hostname, 'hostname');\n\treturn (new Identity({\n\t\ttype: 'host',\n\t\thostname: hostname,\n\t\tcomponents: [ { name: 'cn', value: hostname } ]\n\t}));\n};\n\nIdentity.forUser = function (uid) {\n\tassert.string(uid, 'uid');\n\treturn (new Identity({\n\t\ttype: 'user',\n\t\tuid: uid,\n\t\tcomponents: [ { name: 'uid', value: uid } ]\n\t}));\n};\n\nIdentity.forEmail = function (email) {\n\tassert.string(email, 'email');\n\treturn (new Identity({\n\t\ttype: 'email',\n\t\temail: email,\n\t\tcomponents: [ { name: 'mail', value: email } ]\n\t}));\n};\n\nIdentity.parseDN = function (dn) {\n\tassert.string(dn, 'dn');\n\tvar parts = [''];\n\tvar idx = 0;\n\tvar rem = dn;\n\twhile (rem.length > 0) {\n\t\tvar m;\n\t\t/*JSSTYLED*/\n\t\tif ((m = /^,/.exec(rem)) !== null) {\n\t\t\tparts[++idx] = '';\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^\\\\,/.exec(rem)) !== null) {\n\t\t\tparts[idx] += ',';\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^\\\\./.exec(rem)) !== null) {\n\t\t\tparts[idx] += m[0];\n\t\t\trem = rem.slice(m[0].length);\n\t\t/*JSSTYLED*/\n\t\t} else if ((m = /^[^\\\\,]+/.exec(rem)) !== null) {\n\t\t\tparts[idx] += m[0];\n\t\t\trem = rem.slice(m[0].length);\n\t\t} else {\n\t\t\tthrow (new Error('Failed to parse DN'));\n\t\t}\n\t}\n\tvar cmps = parts.map(function (c) {\n\t\tc = c.trim();\n\t\tvar eqPos = c.indexOf('=');\n\t\twhile (eqPos > 0 && c.charAt(eqPos - 1) === '\\\\')\n\t\t\teqPos = c.indexOf('=', eqPos + 1);\n\t\tif (eqPos === -1) {\n\t\t\tthrow (new Error('Failed to parse DN'));\n\t\t}\n\t\t/*JSSTYLED*/\n\t\tvar name = c.slice(0, eqPos).toLowerCase().replace(/\\\\=/g, '=');\n\t\tvar value = c.slice(eqPos + 1);\n\t\treturn ({ name: name, value: value });\n\t});\n\treturn (new Identity({ components: cmps }));\n};\n\nIdentity.fromArray = function (components) {\n\tassert.arrayOfObject(components, 'components');\n\tcomponents.forEach(function (cmp) {\n\t\tassert.object(cmp, 'component');\n\t\tassert.string(cmp.name, 'component.name');\n\t\tif (!Buffer.isBuffer(cmp.value) &&\n\t\t !(typeof (cmp.value) === 'string')) {\n\t\t\tthrow (new Error('Invalid component value'));\n\t\t}\n\t});\n\treturn (new Identity({ components: components }));\n};\n\nIdentity.parseAsn1 = function (der, top) {\n\tvar components = [];\n\tder.readSequence(top);\n\tvar end = der.offset + der.length;\n\twhile (der.offset < end) {\n\t\tder.readSequence(asn1.Ber.Constructor | asn1.Ber.Set);\n\t\tvar after = der.offset + der.length;\n\t\tder.readSequence();\n\t\tvar oid = der.readOID();\n\t\tvar type = der.peek();\n\t\tvar value;\n\t\tswitch (type) {\n\t\tcase asn1.Ber.PrintableString:\n\t\tcase asn1.Ber.IA5String:\n\t\tcase asn1.Ber.OctetString:\n\t\tcase asn1.Ber.T61String:\n\t\t\tvalue = der.readString(type);\n\t\t\tbreak;\n\t\tcase asn1.Ber.Utf8String:\n\t\t\tvalue = der.readString(type, true);\n\t\t\tvalue = value.toString('utf8');\n\t\t\tbreak;\n\t\tcase asn1.Ber.CharacterString:\n\t\tcase asn1.Ber.BMPString:\n\t\t\tvalue = der.readString(type, true);\n\t\t\tvalue = value.toString('utf16le');\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('Unknown asn1 type ' + type));\n\t\t}\n\t\tcomponents.push({ oid: oid, asn1type: type, value: value });\n\t\tder._offset = after;\n\t}\n\tder._offset = end;\n\treturn (new Identity({\n\t\tcomponents: components\n\t}));\n};\n\nIdentity.isIdentity = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Identity, ver));\n};\n\n/*\n * API versions for Identity:\n * [1,0] -- initial ver\n */\nIdentity.prototype._sshpkApiVersion = [1, 0];\n\nIdentity._oldVersionDetect = function (obj) {\n\treturn ([1, 0]);\n};\n","// Copyright 2015 Joyent, Inc.\n\nvar Key = require('./key');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar PrivateKey = require('./private-key');\nvar Certificate = require('./certificate');\nvar Identity = require('./identity');\nvar errs = require('./errors');\n\nmodule.exports = {\n\t/* top-level classes */\n\tKey: Key,\n\tparseKey: Key.parse,\n\tFingerprint: Fingerprint,\n\tparseFingerprint: Fingerprint.parse,\n\tSignature: Signature,\n\tparseSignature: Signature.parse,\n\tPrivateKey: PrivateKey,\n\tparsePrivateKey: PrivateKey.parse,\n\tgeneratePrivateKey: PrivateKey.generate,\n\tCertificate: Certificate,\n\tparseCertificate: Certificate.parse,\n\tcreateSelfSignedCertificate: Certificate.createSelfSigned,\n\tcreateCertificate: Certificate.create,\n\tIdentity: Identity,\n\tidentityFromDN: Identity.parseDN,\n\tidentityForHost: Identity.forHost,\n\tidentityForUser: Identity.forUser,\n\tidentityForEmail: Identity.forEmail,\n\tidentityFromArray: Identity.fromArray,\n\n\t/* errors */\n\tFingerprintFormatError: errs.FingerprintFormatError,\n\tInvalidAlgorithmError: errs.InvalidAlgorithmError,\n\tKeyParseError: errs.KeyParseError,\n\tSignatureParseError: errs.SignatureParseError,\n\tKeyEncryptedError: errs.KeyEncryptedError,\n\tCertificateParseError: errs.CertificateParseError\n};\n","// Copyright 2018 Joyent, Inc.\n\nmodule.exports = Key;\n\nvar assert = require('assert-plus');\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar DiffieHellman = require('./dhe').DiffieHellman;\nvar errs = require('./errors');\nvar utils = require('./utils');\nvar PrivateKey = require('./private-key');\nvar edCompat;\n\ntry {\n\tedCompat = require('./ed-compat');\n} catch (e) {\n\t/* Just continue through, and bail out if we try to use it. */\n}\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar KeyParseError = errs.KeyParseError;\n\nvar formats = {};\nformats['auto'] = require('./formats/auto');\nformats['pem'] = require('./formats/pem');\nformats['pkcs1'] = require('./formats/pkcs1');\nformats['pkcs8'] = require('./formats/pkcs8');\nformats['rfc4253'] = require('./formats/rfc4253');\nformats['ssh'] = require('./formats/ssh');\nformats['ssh-private'] = require('./formats/ssh-private');\nformats['openssh'] = formats['ssh-private'];\nformats['dnssec'] = require('./formats/dnssec');\nformats['putty'] = require('./formats/putty');\nformats['ppk'] = formats['putty'];\n\nfunction Key(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.parts, 'options.parts');\n\tassert.string(opts.type, 'options.type');\n\tassert.optionalString(opts.comment, 'options.comment');\n\n\tvar algInfo = algs.info[opts.type];\n\tif (typeof (algInfo) !== 'object')\n\t\tthrow (new InvalidAlgorithmError(opts.type));\n\n\tvar partLookup = {};\n\tfor (var i = 0; i < opts.parts.length; ++i) {\n\t\tvar part = opts.parts[i];\n\t\tpartLookup[part.name] = part;\n\t}\n\n\tthis.type = opts.type;\n\tthis.parts = opts.parts;\n\tthis.part = partLookup;\n\tthis.comment = undefined;\n\tthis.source = opts.source;\n\n\t/* for speeding up hashing/fingerprint operations */\n\tthis._rfc4253Cache = opts._rfc4253Cache;\n\tthis._hashCache = {};\n\n\tvar sz;\n\tthis.curve = undefined;\n\tif (this.type === 'ecdsa') {\n\t\tvar curve = this.part.curve.data.toString();\n\t\tthis.curve = curve;\n\t\tsz = algs.curves[curve].size;\n\t} else if (this.type === 'ed25519' || this.type === 'curve25519') {\n\t\tsz = 256;\n\t\tthis.curve = 'curve25519';\n\t} else {\n\t\tvar szPart = this.part[algInfo.sizePart];\n\t\tsz = szPart.data.length;\n\t\tsz = sz * 8 - utils.countZeros(szPart.data);\n\t}\n\tthis.size = sz;\n}\n\nKey.formats = formats;\n\nKey.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'ssh';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\tif (format === 'rfc4253') {\n\t\tif (this._rfc4253Cache === undefined)\n\t\t\tthis._rfc4253Cache = formats['rfc4253'].write(this);\n\t\treturn (this._rfc4253Cache);\n\t}\n\n\treturn (formats[format].write(this, options));\n};\n\nKey.prototype.toString = function (format, options) {\n\treturn (this.toBuffer(format, options).toString());\n};\n\nKey.prototype.hash = function (algo, type) {\n\tassert.string(algo, 'algorithm');\n\tassert.optionalString(type, 'type');\n\tif (type === undefined)\n\t\ttype = 'ssh';\n\talgo = algo.toLowerCase();\n\tif (algs.hashAlgs[algo] === undefined)\n\t\tthrow (new InvalidAlgorithmError(algo));\n\n\tvar cacheKey = algo + '||' + type;\n\tif (this._hashCache[cacheKey])\n\t\treturn (this._hashCache[cacheKey]);\n\n\tvar buf;\n\tif (type === 'ssh') {\n\t\tbuf = this.toBuffer('rfc4253');\n\t} else if (type === 'spki') {\n\t\tbuf = formats.pkcs8.pkcs8ToBuffer(this);\n\t} else {\n\t\tthrow (new Error('Hash type ' + type + ' not supported'));\n\t}\n\tvar hash = crypto.createHash(algo).update(buf).digest();\n\tthis._hashCache[cacheKey] = hash;\n\treturn (hash);\n};\n\nKey.prototype.fingerprint = function (algo, type) {\n\tif (algo === undefined)\n\t\talgo = 'sha256';\n\tif (type === undefined)\n\t\ttype = 'ssh';\n\tassert.string(algo, 'algorithm');\n\tassert.string(type, 'type');\n\tvar opts = {\n\t\ttype: 'key',\n\t\thash: this.hash(algo, type),\n\t\talgorithm: algo,\n\t\thashType: type\n\t};\n\treturn (new Fingerprint(opts));\n};\n\nKey.prototype.defaultHashAlgorithm = function () {\n\tvar hashAlgo = 'sha1';\n\tif (this.type === 'rsa')\n\t\thashAlgo = 'sha256';\n\tif (this.type === 'dsa' && this.size > 1024)\n\t\thashAlgo = 'sha256';\n\tif (this.type === 'ed25519')\n\t\thashAlgo = 'sha512';\n\tif (this.type === 'ecdsa') {\n\t\tif (this.size <= 256)\n\t\t\thashAlgo = 'sha256';\n\t\telse if (this.size <= 384)\n\t\t\thashAlgo = 'sha384';\n\t\telse\n\t\t\thashAlgo = 'sha512';\n\t}\n\treturn (hashAlgo);\n};\n\nKey.prototype.createVerify = function (hashAlgo) {\n\tif (hashAlgo === undefined)\n\t\thashAlgo = this.defaultHashAlgorithm();\n\tassert.string(hashAlgo, 'hash algorithm');\n\n\t/* ED25519 is not supported by OpenSSL, use a javascript impl. */\n\tif (this.type === 'ed25519' && edCompat !== undefined)\n\t\treturn (new edCompat.Verifier(this, hashAlgo));\n\tif (this.type === 'curve25519')\n\t\tthrow (new Error('Curve25519 keys are not suitable for ' +\n\t\t 'signing or verification'));\n\n\tvar v, nm, err;\n\ttry {\n\t\tnm = hashAlgo.toUpperCase();\n\t\tv = crypto.createVerify(nm);\n\t} catch (e) {\n\t\terr = e;\n\t}\n\tif (v === undefined || (err instanceof Error &&\n\t err.message.match(/Unknown message digest/))) {\n\t\tnm = 'RSA-';\n\t\tnm += hashAlgo.toUpperCase();\n\t\tv = crypto.createVerify(nm);\n\t}\n\tassert.ok(v, 'failed to create verifier');\n\tvar oldVerify = v.verify.bind(v);\n\tvar key = this.toBuffer('pkcs8');\n\tvar curve = this.curve;\n\tvar self = this;\n\tv.verify = function (signature, fmt) {\n\t\tif (Signature.isSignature(signature, [2, 0])) {\n\t\t\tif (signature.type !== self.type)\n\t\t\t\treturn (false);\n\t\t\tif (signature.hashAlgorithm &&\n\t\t\t signature.hashAlgorithm !== hashAlgo)\n\t\t\t\treturn (false);\n\t\t\tif (signature.curve && self.type === 'ecdsa' &&\n\t\t\t signature.curve !== curve)\n\t\t\t\treturn (false);\n\t\t\treturn (oldVerify(key, signature.toBuffer('asn1')));\n\n\t\t} else if (typeof (signature) === 'string' ||\n\t\t Buffer.isBuffer(signature)) {\n\t\t\treturn (oldVerify(key, signature, fmt));\n\n\t\t/*\n\t\t * Avoid doing this on valid arguments, walking the prototype\n\t\t * chain can be quite slow.\n\t\t */\n\t\t} else if (Signature.isSignature(signature, [1, 0])) {\n\t\t\tthrow (new Error('signature was created by too old ' +\n\t\t\t 'a version of sshpk and cannot be verified'));\n\n\t\t} else {\n\t\t\tthrow (new TypeError('signature must be a string, ' +\n\t\t\t 'Buffer, or Signature object'));\n\t\t}\n\t};\n\treturn (v);\n};\n\nKey.prototype.createDiffieHellman = function () {\n\tif (this.type === 'rsa')\n\t\tthrow (new Error('RSA keys do not support Diffie-Hellman'));\n\n\treturn (new DiffieHellman(this));\n};\nKey.prototype.createDH = Key.prototype.createDiffieHellman;\n\nKey.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\tif (k instanceof PrivateKey)\n\t\t\tk = k.toPublic();\n\t\tif (!k.comment)\n\t\t\tk.comment = options.filename;\n\t\treturn (k);\n\t} catch (e) {\n\t\tif (e.name === 'KeyEncryptedError')\n\t\t\tthrow (e);\n\t\tthrow (new KeyParseError(options.filename, format, e));\n\t}\n};\n\nKey.isKey = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Key, ver));\n};\n\n/*\n * API versions for Key:\n * [1,0] -- initial ver, may take Signature for createVerify or may not\n * [1,1] -- added pkcs1, pkcs8 formats\n * [1,2] -- added auto, ssh-private, openssh formats\n * [1,3] -- added defaultHashAlgorithm\n * [1,4] -- added ed support, createDH\n * [1,5] -- first explicitly tagged version\n * [1,6] -- changed ed25519 part names\n * [1,7] -- spki hash types\n */\nKey.prototype._sshpkApiVersion = [1, 7];\n\nKey._oldVersionDetect = function (obj) {\n\tassert.func(obj.toBuffer);\n\tassert.func(obj.fingerprint);\n\tif (obj.createDH)\n\t\treturn ([1, 4]);\n\tif (obj.defaultHashAlgorithm)\n\t\treturn ([1, 3]);\n\tif (obj.formats['auto'])\n\t\treturn ([1, 2]);\n\tif (obj.formats['pkcs1'])\n\t\treturn ([1, 1]);\n\treturn ([1, 0]);\n};\n","// Copyright 2017 Joyent, Inc.\n\nmodule.exports = PrivateKey;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar Fingerprint = require('./fingerprint');\nvar Signature = require('./signature');\nvar errs = require('./errors');\nvar util = require('util');\nvar utils = require('./utils');\nvar dhe = require('./dhe');\nvar generateECDSA = dhe.generateECDSA;\nvar generateED25519 = dhe.generateED25519;\nvar edCompat = require('./ed-compat');\nvar nacl = require('tweetnacl');\n\nvar Key = require('./key');\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar KeyParseError = errs.KeyParseError;\nvar KeyEncryptedError = errs.KeyEncryptedError;\n\nvar formats = {};\nformats['auto'] = require('./formats/auto');\nformats['pem'] = require('./formats/pem');\nformats['pkcs1'] = require('./formats/pkcs1');\nformats['pkcs8'] = require('./formats/pkcs8');\nformats['rfc4253'] = require('./formats/rfc4253');\nformats['ssh-private'] = require('./formats/ssh-private');\nformats['openssh'] = formats['ssh-private'];\nformats['ssh'] = formats['ssh-private'];\nformats['dnssec'] = require('./formats/dnssec');\nformats['putty'] = require('./formats/putty');\n\nfunction PrivateKey(opts) {\n\tassert.object(opts, 'options');\n\tKey.call(this, opts);\n\n\tthis._pubCache = undefined;\n}\nutil.inherits(PrivateKey, Key);\n\nPrivateKey.formats = formats;\n\nPrivateKey.prototype.toBuffer = function (format, options) {\n\tif (format === undefined)\n\t\tformat = 'pkcs1';\n\tassert.string(format, 'format');\n\tassert.object(formats[format], 'formats[format]');\n\tassert.optionalObject(options, 'options');\n\n\treturn (formats[format].write(this, options));\n};\n\nPrivateKey.prototype.hash = function (algo, type) {\n\treturn (this.toPublic().hash(algo, type));\n};\n\nPrivateKey.prototype.fingerprint = function (algo, type) {\n\treturn (this.toPublic().fingerprint(algo, type));\n};\n\nPrivateKey.prototype.toPublic = function () {\n\tif (this._pubCache)\n\t\treturn (this._pubCache);\n\n\tvar algInfo = algs.info[this.type];\n\tvar pubParts = [];\n\tfor (var i = 0; i < algInfo.parts.length; ++i) {\n\t\tvar p = algInfo.parts[i];\n\t\tpubParts.push(this.part[p]);\n\t}\n\n\tthis._pubCache = new Key({\n\t\ttype: this.type,\n\t\tsource: this,\n\t\tparts: pubParts\n\t});\n\tif (this.comment)\n\t\tthis._pubCache.comment = this.comment;\n\treturn (this._pubCache);\n};\n\nPrivateKey.prototype.derive = function (newType) {\n\tassert.string(newType, 'type');\n\tvar priv, pub, pair;\n\n\tif (this.type === 'ed25519' && newType === 'curve25519') {\n\t\tpriv = this.part.k.data;\n\t\tif (priv[0] === 0x00)\n\t\t\tpriv = priv.slice(1);\n\n\t\tpair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv));\n\t\tpub = Buffer.from(pair.publicKey);\n\n\t\treturn (new PrivateKey({\n\t\t\ttype: 'curve25519',\n\t\t\tparts: [\n\t\t\t\t{ name: 'A', data: utils.mpNormalize(pub) },\n\t\t\t\t{ name: 'k', data: utils.mpNormalize(priv) }\n\t\t\t]\n\t\t}));\n\t} else if (this.type === 'curve25519' && newType === 'ed25519') {\n\t\tpriv = this.part.k.data;\n\t\tif (priv[0] === 0x00)\n\t\t\tpriv = priv.slice(1);\n\n\t\tpair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv));\n\t\tpub = Buffer.from(pair.publicKey);\n\n\t\treturn (new PrivateKey({\n\t\t\ttype: 'ed25519',\n\t\t\tparts: [\n\t\t\t\t{ name: 'A', data: utils.mpNormalize(pub) },\n\t\t\t\t{ name: 'k', data: utils.mpNormalize(priv) }\n\t\t\t]\n\t\t}));\n\t}\n\tthrow (new Error('Key derivation not supported from ' + this.type +\n\t ' to ' + newType));\n};\n\nPrivateKey.prototype.createVerify = function (hashAlgo) {\n\treturn (this.toPublic().createVerify(hashAlgo));\n};\n\nPrivateKey.prototype.createSign = function (hashAlgo) {\n\tif (hashAlgo === undefined)\n\t\thashAlgo = this.defaultHashAlgorithm();\n\tassert.string(hashAlgo, 'hash algorithm');\n\n\t/* ED25519 is not supported by OpenSSL, use a javascript impl. */\n\tif (this.type === 'ed25519' && edCompat !== undefined)\n\t\treturn (new edCompat.Signer(this, hashAlgo));\n\tif (this.type === 'curve25519')\n\t\tthrow (new Error('Curve25519 keys are not suitable for ' +\n\t\t 'signing or verification'));\n\n\tvar v, nm, err;\n\ttry {\n\t\tnm = hashAlgo.toUpperCase();\n\t\tv = crypto.createSign(nm);\n\t} catch (e) {\n\t\terr = e;\n\t}\n\tif (v === undefined || (err instanceof Error &&\n\t err.message.match(/Unknown message digest/))) {\n\t\tnm = 'RSA-';\n\t\tnm += hashAlgo.toUpperCase();\n\t\tv = crypto.createSign(nm);\n\t}\n\tassert.ok(v, 'failed to create verifier');\n\tvar oldSign = v.sign.bind(v);\n\tvar key = this.toBuffer('pkcs1');\n\tvar type = this.type;\n\tvar curve = this.curve;\n\tv.sign = function () {\n\t\tvar sig = oldSign(key);\n\t\tif (typeof (sig) === 'string')\n\t\t\tsig = Buffer.from(sig, 'binary');\n\t\tsig = Signature.parse(sig, type, 'asn1');\n\t\tsig.hashAlgorithm = hashAlgo;\n\t\tsig.curve = curve;\n\t\treturn (sig);\n\t};\n\treturn (v);\n};\n\nPrivateKey.parse = function (data, format, options) {\n\tif (typeof (data) !== 'string')\n\t\tassert.buffer(data, 'data');\n\tif (format === undefined)\n\t\tformat = 'auto';\n\tassert.string(format, 'format');\n\tif (typeof (options) === 'string')\n\t\toptions = { filename: options };\n\tassert.optionalObject(options, 'options');\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.optionalString(options.filename, 'options.filename');\n\tif (options.filename === undefined)\n\t\toptions.filename = '(unnamed)';\n\n\tassert.object(formats[format], 'formats[format]');\n\n\ttry {\n\t\tvar k = formats[format].read(data, options);\n\t\tassert.ok(k instanceof PrivateKey, 'key is not a private key');\n\t\tif (!k.comment)\n\t\t\tk.comment = options.filename;\n\t\treturn (k);\n\t} catch (e) {\n\t\tif (e.name === 'KeyEncryptedError')\n\t\t\tthrow (e);\n\t\tthrow (new KeyParseError(options.filename, format, e));\n\t}\n};\n\nPrivateKey.isPrivateKey = function (obj, ver) {\n\treturn (utils.isCompatible(obj, PrivateKey, ver));\n};\n\nPrivateKey.generate = function (type, options) {\n\tif (options === undefined)\n\t\toptions = {};\n\tassert.object(options, 'options');\n\n\tswitch (type) {\n\tcase 'ecdsa':\n\t\tif (options.curve === undefined)\n\t\t\toptions.curve = 'nistp256';\n\t\tassert.string(options.curve, 'options.curve');\n\t\treturn (generateECDSA(options.curve));\n\tcase 'ed25519':\n\t\treturn (generateED25519());\n\tdefault:\n\t\tthrow (new Error('Key generation not supported with key ' +\n\t\t 'type \"' + type + '\"'));\n\t}\n};\n\n/*\n * API versions for PrivateKey:\n * [1,0] -- initial ver\n * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats\n * [1,2] -- added defaultHashAlgorithm\n * [1,3] -- added derive, ed, createDH\n * [1,4] -- first tagged version\n * [1,5] -- changed ed25519 part names and format\n * [1,6] -- type arguments for hash() and fingerprint()\n */\nPrivateKey.prototype._sshpkApiVersion = [1, 6];\n\nPrivateKey._oldVersionDetect = function (obj) {\n\tassert.func(obj.toPublic);\n\tassert.func(obj.createSign);\n\tif (obj.derive)\n\t\treturn ([1, 3]);\n\tif (obj.defaultHashAlgorithm)\n\t\treturn ([1, 2]);\n\tif (obj.formats['auto'])\n\t\treturn ([1, 1]);\n\treturn ([1, 0]);\n};\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = Signature;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar algs = require('./algs');\nvar crypto = require('crypto');\nvar errs = require('./errors');\nvar utils = require('./utils');\nvar asn1 = require('asn1');\nvar SSHBuffer = require('./ssh-buffer');\n\nvar InvalidAlgorithmError = errs.InvalidAlgorithmError;\nvar SignatureParseError = errs.SignatureParseError;\n\nfunction Signature(opts) {\n\tassert.object(opts, 'options');\n\tassert.arrayOfObject(opts.parts, 'options.parts');\n\tassert.string(opts.type, 'options.type');\n\n\tvar partLookup = {};\n\tfor (var i = 0; i < opts.parts.length; ++i) {\n\t\tvar part = opts.parts[i];\n\t\tpartLookup[part.name] = part;\n\t}\n\n\tthis.type = opts.type;\n\tthis.hashAlgorithm = opts.hashAlgo;\n\tthis.curve = opts.curve;\n\tthis.parts = opts.parts;\n\tthis.part = partLookup;\n}\n\nSignature.prototype.toBuffer = function (format) {\n\tif (format === undefined)\n\t\tformat = 'asn1';\n\tassert.string(format, 'format');\n\n\tvar buf;\n\tvar stype = 'ssh-' + this.type;\n\n\tswitch (this.type) {\n\tcase 'rsa':\n\t\tswitch (this.hashAlgorithm) {\n\t\tcase 'sha256':\n\t\t\tstype = 'rsa-sha2-256';\n\t\t\tbreak;\n\t\tcase 'sha512':\n\t\t\tstype = 'rsa-sha2-512';\n\t\t\tbreak;\n\t\tcase 'sha1':\n\t\tcase undefined:\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('SSH signature ' +\n\t\t\t 'format does not support hash ' +\n\t\t\t 'algorithm ' + this.hashAlgorithm));\n\t\t}\n\t\tif (format === 'ssh') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString(stype);\n\t\t\tbuf.writePart(this.part.sig);\n\t\t\treturn (buf.toBuffer());\n\t\t} else {\n\t\t\treturn (this.part.sig.data);\n\t\t}\n\t\tbreak;\n\n\tcase 'ed25519':\n\t\tif (format === 'ssh') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString(stype);\n\t\t\tbuf.writePart(this.part.sig);\n\t\t\treturn (buf.toBuffer());\n\t\t} else {\n\t\t\treturn (this.part.sig.data);\n\t\t}\n\t\tbreak;\n\n\tcase 'dsa':\n\tcase 'ecdsa':\n\t\tvar r, s;\n\t\tif (format === 'asn1') {\n\t\t\tvar der = new asn1.BerWriter();\n\t\t\tder.startSequence();\n\t\t\tr = utils.mpNormalize(this.part.r.data);\n\t\t\ts = utils.mpNormalize(this.part.s.data);\n\t\t\tder.writeBuffer(r, asn1.Ber.Integer);\n\t\t\tder.writeBuffer(s, asn1.Ber.Integer);\n\t\t\tder.endSequence();\n\t\t\treturn (der.buffer);\n\t\t} else if (format === 'ssh' && this.type === 'dsa') {\n\t\t\tbuf = new SSHBuffer({});\n\t\t\tbuf.writeString('ssh-dss');\n\t\t\tr = this.part.r.data;\n\t\t\tif (r.length > 20 && r[0] === 0x00)\n\t\t\t\tr = r.slice(1);\n\t\t\ts = this.part.s.data;\n\t\t\tif (s.length > 20 && s[0] === 0x00)\n\t\t\t\ts = s.slice(1);\n\t\t\tif ((this.hashAlgorithm &&\n\t\t\t this.hashAlgorithm !== 'sha1') ||\n\t\t\t r.length + s.length !== 40) {\n\t\t\t\tthrow (new Error('OpenSSH only supports ' +\n\t\t\t\t 'DSA signatures with SHA1 hash'));\n\t\t\t}\n\t\t\tbuf.writeBuffer(Buffer.concat([r, s]));\n\t\t\treturn (buf.toBuffer());\n\t\t} else if (format === 'ssh' && this.type === 'ecdsa') {\n\t\t\tvar inner = new SSHBuffer({});\n\t\t\tr = this.part.r.data;\n\t\t\tinner.writeBuffer(r);\n\t\t\tinner.writePart(this.part.s);\n\n\t\t\tbuf = new SSHBuffer({});\n\t\t\t/* XXX: find a more proper way to do this? */\n\t\t\tvar curve;\n\t\t\tif (r[0] === 0x00)\n\t\t\t\tr = r.slice(1);\n\t\t\tvar sz = r.length * 8;\n\t\t\tif (sz === 256)\n\t\t\t\tcurve = 'nistp256';\n\t\t\telse if (sz === 384)\n\t\t\t\tcurve = 'nistp384';\n\t\t\telse if (sz === 528)\n\t\t\t\tcurve = 'nistp521';\n\t\t\tbuf.writeString('ecdsa-sha2-' + curve);\n\t\t\tbuf.writeBuffer(inner.toBuffer());\n\t\t\treturn (buf.toBuffer());\n\t\t}\n\t\tthrow (new Error('Invalid signature format'));\n\tdefault:\n\t\tthrow (new Error('Invalid signature data'));\n\t}\n};\n\nSignature.prototype.toString = function (format) {\n\tassert.optionalString(format, 'format');\n\treturn (this.toBuffer(format).toString('base64'));\n};\n\nSignature.parse = function (data, type, format) {\n\tif (typeof (data) === 'string')\n\t\tdata = Buffer.from(data, 'base64');\n\tassert.buffer(data, 'data');\n\tassert.string(format, 'format');\n\tassert.string(type, 'type');\n\n\tvar opts = {};\n\topts.type = type.toLowerCase();\n\topts.parts = [];\n\n\ttry {\n\t\tassert.ok(data.length > 0, 'signature must not be empty');\n\t\tswitch (opts.type) {\n\t\tcase 'rsa':\n\t\t\treturn (parseOneNum(data, type, format, opts));\n\t\tcase 'ed25519':\n\t\t\treturn (parseOneNum(data, type, format, opts));\n\n\t\tcase 'dsa':\n\t\tcase 'ecdsa':\n\t\t\tif (format === 'asn1')\n\t\t\t\treturn (parseDSAasn1(data, type, format, opts));\n\t\t\telse if (opts.type === 'dsa')\n\t\t\t\treturn (parseDSA(data, type, format, opts));\n\t\t\telse\n\t\t\t\treturn (parseECDSA(data, type, format, opts));\n\n\t\tdefault:\n\t\t\tthrow (new InvalidAlgorithmError(type));\n\t\t}\n\n\t} catch (e) {\n\t\tif (e instanceof InvalidAlgorithmError)\n\t\t\tthrow (e);\n\t\tthrow (new SignatureParseError(type, format, e));\n\t}\n};\n\nfunction parseOneNum(data, type, format, opts) {\n\tif (format === 'ssh') {\n\t\ttry {\n\t\t\tvar buf = new SSHBuffer({buffer: data});\n\t\t\tvar head = buf.readString();\n\t\t} catch (e) {\n\t\t\t/* fall through */\n\t\t}\n\t\tif (buf !== undefined) {\n\t\t\tvar msg = 'SSH signature does not match expected ' +\n\t\t\t 'type (expected ' + type + ', got ' + head + ')';\n\t\t\tswitch (head) {\n\t\t\tcase 'ssh-rsa':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha1';\n\t\t\t\tbreak;\n\t\t\tcase 'rsa-sha2-256':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha256';\n\t\t\t\tbreak;\n\t\t\tcase 'rsa-sha2-512':\n\t\t\t\tassert.strictEqual(type, 'rsa', msg);\n\t\t\t\topts.hashAlgo = 'sha512';\n\t\t\t\tbreak;\n\t\t\tcase 'ssh-ed25519':\n\t\t\t\tassert.strictEqual(type, 'ed25519', msg);\n\t\t\t\topts.hashAlgo = 'sha512';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow (new Error('Unknown SSH signature ' +\n\t\t\t\t 'type: ' + head));\n\t\t\t}\n\t\t\tvar sig = buf.readPart();\n\t\t\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\t\t\tsig.name = 'sig';\n\t\t\topts.parts.push(sig);\n\t\t\treturn (new Signature(opts));\n\t\t}\n\t}\n\topts.parts.push({name: 'sig', data: data});\n\treturn (new Signature(opts));\n}\n\nfunction parseDSAasn1(data, type, format, opts) {\n\tvar der = new asn1.BerReader(data);\n\tder.readSequence();\n\tvar r = der.readString(asn1.Ber.Integer, true);\n\tvar s = der.readString(asn1.Ber.Integer, true);\n\n\topts.parts.push({name: 'r', data: utils.mpNormalize(r)});\n\topts.parts.push({name: 's', data: utils.mpNormalize(s)});\n\n\treturn (new Signature(opts));\n}\n\nfunction parseDSA(data, type, format, opts) {\n\tif (data.length != 40) {\n\t\tvar buf = new SSHBuffer({buffer: data});\n\t\tvar d = buf.readBuffer();\n\t\tif (d.toString('ascii') === 'ssh-dss')\n\t\t\td = buf.readBuffer();\n\t\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\t\tassert.strictEqual(d.length, 40, 'invalid inner length');\n\t\tdata = d;\n\t}\n\topts.parts.push({name: 'r', data: data.slice(0, 20)});\n\topts.parts.push({name: 's', data: data.slice(20, 40)});\n\treturn (new Signature(opts));\n}\n\nfunction parseECDSA(data, type, format, opts) {\n\tvar buf = new SSHBuffer({buffer: data});\n\n\tvar r, s;\n\tvar inner = buf.readBuffer();\n\tvar stype = inner.toString('ascii');\n\tif (stype.slice(0, 6) === 'ecdsa-') {\n\t\tvar parts = stype.split('-');\n\t\tassert.strictEqual(parts[0], 'ecdsa');\n\t\tassert.strictEqual(parts[1], 'sha2');\n\t\topts.curve = parts[2];\n\t\tswitch (opts.curve) {\n\t\tcase 'nistp256':\n\t\t\topts.hashAlgo = 'sha256';\n\t\t\tbreak;\n\t\tcase 'nistp384':\n\t\t\topts.hashAlgo = 'sha384';\n\t\t\tbreak;\n\t\tcase 'nistp521':\n\t\t\topts.hashAlgo = 'sha512';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow (new Error('Unsupported ECDSA curve: ' +\n\t\t\t opts.curve));\n\t\t}\n\t\tinner = buf.readBuffer();\n\t\tassert.ok(buf.atEnd(), 'extra trailing bytes on outer');\n\t\tbuf = new SSHBuffer({buffer: inner});\n\t\tr = buf.readPart();\n\t} else {\n\t\tr = {data: inner};\n\t}\n\n\ts = buf.readPart();\n\tassert.ok(buf.atEnd(), 'extra trailing bytes');\n\n\tr.name = 'r';\n\ts.name = 's';\n\n\topts.parts.push(r);\n\topts.parts.push(s);\n\treturn (new Signature(opts));\n}\n\nSignature.isSignature = function (obj, ver) {\n\treturn (utils.isCompatible(obj, Signature, ver));\n};\n\n/*\n * API versions for Signature:\n * [1,0] -- initial ver\n * [2,0] -- support for rsa in full ssh format, compat with sshpk-agent\n * hashAlgorithm property\n * [2,1] -- first tagged version\n */\nSignature.prototype._sshpkApiVersion = [2, 1];\n\nSignature._oldVersionDetect = function (obj) {\n\tassert.func(obj.toBuffer);\n\tif (obj.hasOwnProperty('hashAlgorithm'))\n\t\treturn ([2, 0]);\n\treturn ([1, 0]);\n};\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = SSHBuffer;\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\n\nfunction SSHBuffer(opts) {\n\tassert.object(opts, 'options');\n\tif (opts.buffer !== undefined)\n\t\tassert.buffer(opts.buffer, 'options.buffer');\n\n\tthis._size = opts.buffer ? opts.buffer.length : 1024;\n\tthis._buffer = opts.buffer || Buffer.alloc(this._size);\n\tthis._offset = 0;\n}\n\nSSHBuffer.prototype.toBuffer = function () {\n\treturn (this._buffer.slice(0, this._offset));\n};\n\nSSHBuffer.prototype.atEnd = function () {\n\treturn (this._offset >= this._buffer.length);\n};\n\nSSHBuffer.prototype.remainder = function () {\n\treturn (this._buffer.slice(this._offset));\n};\n\nSSHBuffer.prototype.skip = function (n) {\n\tthis._offset += n;\n};\n\nSSHBuffer.prototype.expand = function () {\n\tthis._size *= 2;\n\tvar buf = Buffer.alloc(this._size);\n\tthis._buffer.copy(buf, 0);\n\tthis._buffer = buf;\n};\n\nSSHBuffer.prototype.readPart = function () {\n\treturn ({data: this.readBuffer()});\n};\n\nSSHBuffer.prototype.readBuffer = function () {\n\tvar len = this._buffer.readUInt32BE(this._offset);\n\tthis._offset += 4;\n\tassert.ok(this._offset + len <= this._buffer.length,\n\t 'length out of bounds at +0x' + this._offset.toString(16) +\n\t ' (data truncated?)');\n\tvar buf = this._buffer.slice(this._offset, this._offset + len);\n\tthis._offset += len;\n\treturn (buf);\n};\n\nSSHBuffer.prototype.readString = function () {\n\treturn (this.readBuffer().toString());\n};\n\nSSHBuffer.prototype.readCString = function () {\n\tvar offset = this._offset;\n\twhile (offset < this._buffer.length &&\n\t this._buffer[offset] !== 0x00)\n\t\toffset++;\n\tassert.ok(offset < this._buffer.length, 'c string does not terminate');\n\tvar str = this._buffer.slice(this._offset, offset).toString();\n\tthis._offset = offset + 1;\n\treturn (str);\n};\n\nSSHBuffer.prototype.readInt = function () {\n\tvar v = this._buffer.readUInt32BE(this._offset);\n\tthis._offset += 4;\n\treturn (v);\n};\n\nSSHBuffer.prototype.readInt64 = function () {\n\tassert.ok(this._offset + 8 < this._buffer.length,\n\t 'buffer not long enough to read Int64');\n\tvar v = this._buffer.slice(this._offset, this._offset + 8);\n\tthis._offset += 8;\n\treturn (v);\n};\n\nSSHBuffer.prototype.readChar = function () {\n\tvar v = this._buffer[this._offset++];\n\treturn (v);\n};\n\nSSHBuffer.prototype.writeBuffer = function (buf) {\n\twhile (this._offset + 4 + buf.length > this._size)\n\t\tthis.expand();\n\tthis._buffer.writeUInt32BE(buf.length, this._offset);\n\tthis._offset += 4;\n\tbuf.copy(this._buffer, this._offset);\n\tthis._offset += buf.length;\n};\n\nSSHBuffer.prototype.writeString = function (str) {\n\tthis.writeBuffer(Buffer.from(str, 'utf8'));\n};\n\nSSHBuffer.prototype.writeCString = function (str) {\n\twhile (this._offset + 1 + str.length > this._size)\n\t\tthis.expand();\n\tthis._buffer.write(str, this._offset);\n\tthis._offset += str.length;\n\tthis._buffer[this._offset++] = 0;\n};\n\nSSHBuffer.prototype.writeInt = function (v) {\n\twhile (this._offset + 4 > this._size)\n\t\tthis.expand();\n\tthis._buffer.writeUInt32BE(v, this._offset);\n\tthis._offset += 4;\n};\n\nSSHBuffer.prototype.writeInt64 = function (v) {\n\tassert.buffer(v, 'value');\n\tif (v.length > 8) {\n\t\tvar lead = v.slice(0, v.length - 8);\n\t\tfor (var i = 0; i < lead.length; ++i) {\n\t\t\tassert.strictEqual(lead[i], 0,\n\t\t\t 'must fit in 64 bits of precision');\n\t\t}\n\t\tv = v.slice(v.length - 8, v.length);\n\t}\n\twhile (this._offset + 8 > this._size)\n\t\tthis.expand();\n\tv.copy(this._buffer, this._offset);\n\tthis._offset += 8;\n};\n\nSSHBuffer.prototype.writeChar = function (v) {\n\twhile (this._offset + 1 > this._size)\n\t\tthis.expand();\n\tthis._buffer[this._offset++] = v;\n};\n\nSSHBuffer.prototype.writePart = function (p) {\n\tthis.writeBuffer(p.data);\n};\n\nSSHBuffer.prototype.write = function (buf) {\n\twhile (this._offset + buf.length > this._size)\n\t\tthis.expand();\n\tbuf.copy(this._buffer, this._offset);\n\tthis._offset += buf.length;\n};\n","// Copyright 2015 Joyent, Inc.\n\nmodule.exports = {\n\tbufferSplit: bufferSplit,\n\taddRSAMissing: addRSAMissing,\n\tcalculateDSAPublic: calculateDSAPublic,\n\tcalculateED25519Public: calculateED25519Public,\n\tcalculateX25519Public: calculateX25519Public,\n\tmpNormalize: mpNormalize,\n\tmpDenormalize: mpDenormalize,\n\tecNormalize: ecNormalize,\n\tcountZeros: countZeros,\n\tassertCompatible: assertCompatible,\n\tisCompatible: isCompatible,\n\topensslKeyDeriv: opensslKeyDeriv,\n\topensshCipherInfo: opensshCipherInfo,\n\tpublicFromPrivateECDSA: publicFromPrivateECDSA,\n\tzeroPadToLength: zeroPadToLength,\n\twriteBitString: writeBitString,\n\treadBitString: readBitString,\n\tpbkdf2: pbkdf2\n};\n\nvar assert = require('assert-plus');\nvar Buffer = require('safer-buffer').Buffer;\nvar PrivateKey = require('./private-key');\nvar Key = require('./key');\nvar crypto = require('crypto');\nvar algs = require('./algs');\nvar asn1 = require('asn1');\n\nvar ec = require('ecc-jsbn/lib/ec');\nvar jsbn = require('jsbn').BigInteger;\nvar nacl = require('tweetnacl');\n\nvar MAX_CLASS_DEPTH = 3;\n\nfunction isCompatible(obj, klass, needVer) {\n\tif (obj === null || typeof (obj) !== 'object')\n\t\treturn (false);\n\tif (needVer === undefined)\n\t\tneedVer = klass.prototype._sshpkApiVersion;\n\tif (obj instanceof klass &&\n\t klass.prototype._sshpkApiVersion[0] == needVer[0])\n\t\treturn (true);\n\tvar proto = Object.getPrototypeOf(obj);\n\tvar depth = 0;\n\twhile (proto.constructor.name !== klass.name) {\n\t\tproto = Object.getPrototypeOf(proto);\n\t\tif (!proto || ++depth > MAX_CLASS_DEPTH)\n\t\t\treturn (false);\n\t}\n\tif (proto.constructor.name !== klass.name)\n\t\treturn (false);\n\tvar ver = proto._sshpkApiVersion;\n\tif (ver === undefined)\n\t\tver = klass._oldVersionDetect(obj);\n\tif (ver[0] != needVer[0] || ver[1] < needVer[1])\n\t\treturn (false);\n\treturn (true);\n}\n\nfunction assertCompatible(obj, klass, needVer, name) {\n\tif (name === undefined)\n\t\tname = 'object';\n\tassert.ok(obj, name + ' must not be null');\n\tassert.object(obj, name + ' must be an object');\n\tif (needVer === undefined)\n\t\tneedVer = klass.prototype._sshpkApiVersion;\n\tif (obj instanceof klass &&\n\t klass.prototype._sshpkApiVersion[0] == needVer[0])\n\t\treturn;\n\tvar proto = Object.getPrototypeOf(obj);\n\tvar depth = 0;\n\twhile (proto.constructor.name !== klass.name) {\n\t\tproto = Object.getPrototypeOf(proto);\n\t\tassert.ok(proto && ++depth <= MAX_CLASS_DEPTH,\n\t\t name + ' must be a ' + klass.name + ' instance');\n\t}\n\tassert.strictEqual(proto.constructor.name, klass.name,\n\t name + ' must be a ' + klass.name + ' instance');\n\tvar ver = proto._sshpkApiVersion;\n\tif (ver === undefined)\n\t\tver = klass._oldVersionDetect(obj);\n\tassert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1],\n\t name + ' must be compatible with ' + klass.name + ' klass ' +\n\t 'version ' + needVer[0] + '.' + needVer[1]);\n}\n\nvar CIPHER_LEN = {\n\t'des-ede3-cbc': { key: 24, iv: 8 },\n\t'aes-128-cbc': { key: 16, iv: 16 },\n\t'aes-256-cbc': { key: 32, iv: 16 }\n};\nvar PKCS5_SALT_LEN = 8;\n\nfunction opensslKeyDeriv(cipher, salt, passphrase, count) {\n\tassert.buffer(salt, 'salt');\n\tassert.buffer(passphrase, 'passphrase');\n\tassert.number(count, 'iteration count');\n\n\tvar clen = CIPHER_LEN[cipher];\n\tassert.object(clen, 'supported cipher');\n\n\tsalt = salt.slice(0, PKCS5_SALT_LEN);\n\n\tvar D, D_prev, bufs;\n\tvar material = Buffer.alloc(0);\n\twhile (material.length < clen.key + clen.iv) {\n\t\tbufs = [];\n\t\tif (D_prev)\n\t\t\tbufs.push(D_prev);\n\t\tbufs.push(passphrase);\n\t\tbufs.push(salt);\n\t\tD = Buffer.concat(bufs);\n\t\tfor (var j = 0; j < count; ++j)\n\t\t\tD = crypto.createHash('md5').update(D).digest();\n\t\tmaterial = Buffer.concat([material, D]);\n\t\tD_prev = D;\n\t}\n\n\treturn ({\n\t key: material.slice(0, clen.key),\n\t iv: material.slice(clen.key, clen.key + clen.iv)\n\t});\n}\n\n/* See: RFC2898 */\nfunction pbkdf2(hashAlg, salt, iterations, size, passphrase) {\n\tvar hkey = Buffer.alloc(salt.length + 4);\n\tsalt.copy(hkey);\n\n\tvar gen = 0, ts = [];\n\tvar i = 1;\n\twhile (gen < size) {\n\t\tvar t = T(i++);\n\t\tgen += t.length;\n\t\tts.push(t);\n\t}\n\treturn (Buffer.concat(ts).slice(0, size));\n\n\tfunction T(I) {\n\t\thkey.writeUInt32BE(I, hkey.length - 4);\n\n\t\tvar hmac = crypto.createHmac(hashAlg, passphrase);\n\t\thmac.update(hkey);\n\n\t\tvar Ti = hmac.digest();\n\t\tvar Uc = Ti;\n\t\tvar c = 1;\n\t\twhile (c++ < iterations) {\n\t\t\thmac = crypto.createHmac(hashAlg, passphrase);\n\t\t\thmac.update(Uc);\n\t\t\tUc = hmac.digest();\n\t\t\tfor (var x = 0; x < Ti.length; ++x)\n\t\t\t\tTi[x] ^= Uc[x];\n\t\t}\n\t\treturn (Ti);\n\t}\n}\n\n/* Count leading zero bits on a buffer */\nfunction countZeros(buf) {\n\tvar o = 0, obit = 8;\n\twhile (o < buf.length) {\n\t\tvar mask = (1 << obit);\n\t\tif ((buf[o] & mask) === mask)\n\t\t\tbreak;\n\t\tobit--;\n\t\tif (obit < 0) {\n\t\t\to++;\n\t\t\tobit = 8;\n\t\t}\n\t}\n\treturn (o*8 + (8 - obit) - 1);\n}\n\nfunction bufferSplit(buf, chr) {\n\tassert.buffer(buf);\n\tassert.string(chr);\n\n\tvar parts = [];\n\tvar lastPart = 0;\n\tvar matches = 0;\n\tfor (var i = 0; i < buf.length; ++i) {\n\t\tif (buf[i] === chr.charCodeAt(matches))\n\t\t\t++matches;\n\t\telse if (buf[i] === chr.charCodeAt(0))\n\t\t\tmatches = 1;\n\t\telse\n\t\t\tmatches = 0;\n\n\t\tif (matches >= chr.length) {\n\t\t\tvar newPart = i + 1;\n\t\t\tparts.push(buf.slice(lastPart, newPart - matches));\n\t\t\tlastPart = newPart;\n\t\t\tmatches = 0;\n\t\t}\n\t}\n\tif (lastPart <= buf.length)\n\t\tparts.push(buf.slice(lastPart, buf.length));\n\n\treturn (parts);\n}\n\nfunction ecNormalize(buf, addZero) {\n\tassert.buffer(buf);\n\tif (buf[0] === 0x00 && buf[1] === 0x04) {\n\t\tif (addZero)\n\t\t\treturn (buf);\n\t\treturn (buf.slice(1));\n\t} else if (buf[0] === 0x04) {\n\t\tif (!addZero)\n\t\t\treturn (buf);\n\t} else {\n\t\twhile (buf[0] === 0x00)\n\t\t\tbuf = buf.slice(1);\n\t\tif (buf[0] === 0x02 || buf[0] === 0x03)\n\t\t\tthrow (new Error('Compressed elliptic curve points ' +\n\t\t\t 'are not supported'));\n\t\tif (buf[0] !== 0x04)\n\t\t\tthrow (new Error('Not a valid elliptic curve point'));\n\t\tif (!addZero)\n\t\t\treturn (buf);\n\t}\n\tvar b = Buffer.alloc(buf.length + 1);\n\tb[0] = 0x0;\n\tbuf.copy(b, 1);\n\treturn (b);\n}\n\nfunction readBitString(der, tag) {\n\tif (tag === undefined)\n\t\ttag = asn1.Ber.BitString;\n\tvar buf = der.readString(tag, true);\n\tassert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' +\n\t 'not supported (0x' + buf[0].toString(16) + ')');\n\treturn (buf.slice(1));\n}\n\nfunction writeBitString(der, buf, tag) {\n\tif (tag === undefined)\n\t\ttag = asn1.Ber.BitString;\n\tvar b = Buffer.alloc(buf.length + 1);\n\tb[0] = 0x00;\n\tbuf.copy(b, 1);\n\tder.writeBuffer(b, tag);\n}\n\nfunction mpNormalize(buf) {\n\tassert.buffer(buf);\n\twhile (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00)\n\t\tbuf = buf.slice(1);\n\tif ((buf[0] & 0x80) === 0x80) {\n\t\tvar b = Buffer.alloc(buf.length + 1);\n\t\tb[0] = 0x00;\n\t\tbuf.copy(b, 1);\n\t\tbuf = b;\n\t}\n\treturn (buf);\n}\n\nfunction mpDenormalize(buf) {\n\tassert.buffer(buf);\n\twhile (buf.length > 1 && buf[0] === 0x00)\n\t\tbuf = buf.slice(1);\n\treturn (buf);\n}\n\nfunction zeroPadToLength(buf, len) {\n\tassert.buffer(buf);\n\tassert.number(len);\n\twhile (buf.length > len) {\n\t\tassert.equal(buf[0], 0x00);\n\t\tbuf = buf.slice(1);\n\t}\n\twhile (buf.length < len) {\n\t\tvar b = Buffer.alloc(buf.length + 1);\n\t\tb[0] = 0x00;\n\t\tbuf.copy(b, 1);\n\t\tbuf = b;\n\t}\n\treturn (buf);\n}\n\nfunction bigintToMpBuf(bigint) {\n\tvar buf = Buffer.from(bigint.toByteArray());\n\tbuf = mpNormalize(buf);\n\treturn (buf);\n}\n\nfunction calculateDSAPublic(g, p, x) {\n\tassert.buffer(g);\n\tassert.buffer(p);\n\tassert.buffer(x);\n\tg = new jsbn(g);\n\tp = new jsbn(p);\n\tx = new jsbn(x);\n\tvar y = g.modPow(x, p);\n\tvar ybuf = bigintToMpBuf(y);\n\treturn (ybuf);\n}\n\nfunction calculateED25519Public(k) {\n\tassert.buffer(k);\n\n\tvar kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k));\n\treturn (Buffer.from(kp.publicKey));\n}\n\nfunction calculateX25519Public(k) {\n\tassert.buffer(k);\n\n\tvar kp = nacl.box.keyPair.fromSeed(new Uint8Array(k));\n\treturn (Buffer.from(kp.publicKey));\n}\n\nfunction addRSAMissing(key) {\n\tassert.object(key);\n\tassertCompatible(key, PrivateKey, [1, 1]);\n\n\tvar d = new jsbn(key.part.d.data);\n\tvar buf;\n\n\tif (!key.part.dmodp) {\n\t\tvar p = new jsbn(key.part.p.data);\n\t\tvar dmodp = d.mod(p.subtract(1));\n\n\t\tbuf = bigintToMpBuf(dmodp);\n\t\tkey.part.dmodp = {name: 'dmodp', data: buf};\n\t\tkey.parts.push(key.part.dmodp);\n\t}\n\tif (!key.part.dmodq) {\n\t\tvar q = new jsbn(key.part.q.data);\n\t\tvar dmodq = d.mod(q.subtract(1));\n\n\t\tbuf = bigintToMpBuf(dmodq);\n\t\tkey.part.dmodq = {name: 'dmodq', data: buf};\n\t\tkey.parts.push(key.part.dmodq);\n\t}\n}\n\nfunction publicFromPrivateECDSA(curveName, priv) {\n\tassert.string(curveName, 'curveName');\n\tassert.buffer(priv);\n\tvar params = algs.curves[curveName];\n\tvar p = new jsbn(params.p);\n\tvar a = new jsbn(params.a);\n\tvar b = new jsbn(params.b);\n\tvar curve = new ec.ECCurveFp(p, a, b);\n\tvar G = curve.decodePointHex(params.G.toString('hex'));\n\n\tvar d = new jsbn(mpNormalize(priv));\n\tvar pub = G.multiply(d);\n\tpub = Buffer.from(curve.encodePointHex(pub), 'hex');\n\n\tvar parts = [];\n\tparts.push({name: 'curve', data: Buffer.from(curveName)});\n\tparts.push({name: 'Q', data: pub});\n\n\tvar key = new Key({type: 'ecdsa', curve: curve, parts: parts});\n\treturn (key);\n}\n\nfunction opensshCipherInfo(cipher) {\n\tvar inf = {};\n\tswitch (cipher) {\n\tcase '3des-cbc':\n\t\tinf.keySize = 24;\n\t\tinf.blockSize = 8;\n\t\tinf.opensslName = 'des-ede3-cbc';\n\t\tbreak;\n\tcase 'blowfish-cbc':\n\t\tinf.keySize = 16;\n\t\tinf.blockSize = 8;\n\t\tinf.opensslName = 'bf-cbc';\n\t\tbreak;\n\tcase 'aes128-cbc':\n\tcase 'aes128-ctr':\n\tcase 'aes128-gcm@openssh.com':\n\t\tinf.keySize = 16;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-128-' + cipher.slice(7, 10);\n\t\tbreak;\n\tcase 'aes192-cbc':\n\tcase 'aes192-ctr':\n\tcase 'aes192-gcm@openssh.com':\n\t\tinf.keySize = 24;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-192-' + cipher.slice(7, 10);\n\t\tbreak;\n\tcase 'aes256-cbc':\n\tcase 'aes256-ctr':\n\tcase 'aes256-gcm@openssh.com':\n\t\tinf.keySize = 32;\n\t\tinf.blockSize = 16;\n\t\tinf.opensslName = 'aes-256-' + cipher.slice(7, 10);\n\t\tbreak;\n\tdefault:\n\t\tthrow (new Error(\n\t\t 'Unsupported openssl cipher \"' + cipher + '\"'));\n\t}\n\treturn (inf);\n}\n","'use strict';\n\nmodule.exports = {\n DEFAULT_INITIAL_SIZE: (8 * 1024),\n DEFAULT_INCREMENT_AMOUNT: (8 * 1024),\n DEFAULT_FREQUENCY: 1,\n DEFAULT_CHUNK_SIZE: 1024\n};\n","'use strict';\n\nvar stream = require('stream');\nvar constants = require('./constants');\nvar util = require('util');\n\nvar ReadableStreamBuffer = module.exports = function(opts) {\n var that = this;\n opts = opts || {};\n\n stream.Readable.call(this, opts);\n\n this.stopped = false;\n\n var frequency = opts.hasOwnProperty('frequency') ? opts.frequency : constants.DEFAULT_FREQUENCY;\n var chunkSize = opts.chunkSize || constants.DEFAULT_CHUNK_SIZE;\n var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE;\n var incrementAmount = opts.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT;\n\n var size = 0;\n var buffer = new Buffer(initialSize);\n var allowPush = false;\n\n var sendData = function() {\n var amount = Math.min(chunkSize, size);\n var sendMore = false;\n\n if (amount > 0) {\n var chunk = null;\n chunk = new Buffer(amount);\n buffer.copy(chunk, 0, 0, amount);\n\n sendMore = that.push(chunk) !== false;\n allowPush = sendMore;\n\n buffer.copy(buffer, 0, amount, size);\n size -= amount;\n }\n\n if(size === 0 && that.stopped) {\n that.push(null);\n }\n\n if (sendMore) {\n sendData.timeout = setTimeout(sendData, frequency);\n }\n else {\n sendData.timeout = null;\n }\n };\n\n this.stop = function() {\n if (this.stopped) {\n throw new Error('stop() called on already stopped ReadableStreamBuffer');\n }\n this.stopped = true;\n\n if (size === 0) {\n this.push(null);\n }\n };\n\n this.size = function() {\n return size;\n };\n\n this.maxSize = function() {\n return buffer.length;\n };\n\n var increaseBufferIfNecessary = function(incomingDataSize) {\n if((buffer.length - size) < incomingDataSize) {\n var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount);\n\n var newBuffer = new Buffer(buffer.length + (incrementAmount * factor));\n buffer.copy(newBuffer, 0, 0, size);\n buffer = newBuffer;\n }\n };\n\n var kickSendDataTask = function () {\n if (!sendData.timeout && allowPush) {\n sendData.timeout = setTimeout(sendData, frequency);\n }\n }\n\n this.put = function(data, encoding) {\n if (that.stopped) {\n throw new Error('Tried to write data to a stopped ReadableStreamBuffer');\n }\n\n if(Buffer.isBuffer(data)) {\n increaseBufferIfNecessary(data.length);\n data.copy(buffer, size, 0);\n size += data.length;\n }\n else {\n data = data + '';\n var dataSizeInBytes = Buffer.byteLength(data);\n increaseBufferIfNecessary(dataSizeInBytes);\n buffer.write(data, size, encoding || 'utf8');\n size += dataSizeInBytes;\n }\n\n kickSendDataTask();\n };\n\n this._read = function() {\n allowPush = true;\n kickSendDataTask();\n };\n};\n\nutil.inherits(ReadableStreamBuffer, stream.Readable);\n","'use strict';\n\nmodule.exports = require('./constants');\nmodule.exports.ReadableStreamBuffer = require('./readable_streambuffer');\nmodule.exports.WritableStreamBuffer = require('./writable_streambuffer');\n","'use strict';\n\nvar util = require('util');\nvar stream = require('stream');\nvar constants = require('./constants');\n\nvar WritableStreamBuffer = module.exports = function(opts) {\n opts = opts || {};\n opts.decodeStrings = true;\n\n stream.Writable.call(this, opts);\n\n var initialSize = opts.initialSize || constants.DEFAULT_INITIAL_SIZE;\n var incrementAmount = opts.incrementAmount || constants.DEFAULT_INCREMENT_AMOUNT;\n\n var buffer = new Buffer(initialSize);\n var size = 0;\n\n this.size = function() {\n return size;\n };\n\n this.maxSize = function() {\n return buffer.length;\n };\n\n this.getContents = function(length) {\n if(!size) return false;\n\n var data = new Buffer(Math.min(length || size, size));\n buffer.copy(data, 0, 0, data.length);\n\n if(data.length < size)\n buffer.copy(buffer, 0, data.length);\n\n size -= data.length;\n\n return data;\n };\n\n this.getContentsAsString = function(encoding, length) {\n if(!size) return false;\n\n var data = buffer.toString(encoding || 'utf8', 0, Math.min(length || size, size));\n var dataLength = Buffer.byteLength(data);\n\n if(dataLength < size)\n buffer.copy(buffer, 0, dataLength);\n\n size -= dataLength;\n return data;\n };\n\n var increaseBufferIfNecessary = function(incomingDataSize) {\n if((buffer.length - size) < incomingDataSize) {\n var factor = Math.ceil((incomingDataSize - (buffer.length - size)) / incrementAmount);\n\n var newBuffer = new Buffer(buffer.length + (incrementAmount * factor));\n buffer.copy(newBuffer, 0, 0, size);\n buffer = newBuffer;\n }\n };\n\n this._write = function(chunk, encoding, callback) {\n increaseBufferIfNecessary(chunk.length);\n chunk.copy(buffer, size, 0);\n size += chunk.length;\n callback();\n };\n};\n\nutil.inherits(WritableStreamBuffer, stream.Writable);\n","'use strict';\n\nmodule.exports = input => {\n\tconst LF = typeof input === 'string' ? '\\n' : '\\n'.charCodeAt();\n\tconst CR = typeof input === 'string' ? '\\r' : '\\r'.charCodeAt();\n\n\tif (input[input.length - 1] === LF) {\n\t\tinput = input.slice(0, input.length - 1);\n\t}\n\n\tif (input[input.length - 1] === CR) {\n\t\tinput = input.slice(0, input.length - 1);\n\t}\n\n\treturn input;\n};\n","'use strict'\n\n// high-level commands\nexports.c = exports.create = require('./lib/create.js')\nexports.r = exports.replace = require('./lib/replace.js')\nexports.t = exports.list = require('./lib/list.js')\nexports.u = exports.update = require('./lib/update.js')\nexports.x = exports.extract = require('./lib/extract.js')\n\n// classes\nexports.Pack = require('./lib/pack.js')\nexports.Unpack = require('./lib/unpack.js')\nexports.Parse = require('./lib/parse.js')\nexports.ReadEntry = require('./lib/read-entry.js')\nexports.WriteEntry = require('./lib/write-entry.js')\nexports.Header = require('./lib/header.js')\nexports.Pax = require('./lib/pax.js')\nexports.types = require('./lib/types.js')\n","'use strict'\n\n// tar -c\nconst hlo = require('./high-level-opt.js')\n\nconst Pack = require('./pack.js')\nconst fsm = require('fs-minipass')\nconst t = require('./list.js')\nconst path = require('path')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof files === 'function') {\n cb = files\n }\n\n if (Array.isArray(opt_)) {\n files = opt_, opt_ = {}\n }\n\n if (!files || !Array.isArray(files) || !files.length) {\n throw new TypeError('no files or directories specified')\n }\n\n files = Array.from(files)\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function') {\n throw new TypeError('callback not supported for sync tar functions')\n }\n\n if (!opt.file && typeof cb === 'function') {\n throw new TypeError('callback only supported with file option')\n }\n\n return opt.file && opt.sync ? createFileSync(opt, files)\n : opt.file ? createFile(opt, files, cb)\n : opt.sync ? createSync(opt, files)\n : create(opt, files)\n}\n\nconst createFileSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n const stream = new fsm.WriteStreamSync(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream)\n addFilesSync(p, files)\n}\n\nconst createFile = (opt, files, cb) => {\n const p = new Pack(opt)\n const stream = new fsm.WriteStream(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream)\n\n const promise = new Promise((res, rej) => {\n stream.on('error', rej)\n stream.on('close', res)\n p.on('error', rej)\n })\n\n addFilesAsync(p, files)\n\n return cb ? promise.then(cb, cb) : promise\n}\n\nconst addFilesSync = (p, files) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n t({\n file: path.resolve(p.cwd, file.slice(1)),\n sync: true,\n noResume: true,\n onentry: entry => p.add(entry),\n })\n } else {\n p.add(file)\n }\n })\n p.end()\n}\n\nconst addFilesAsync = (p, files) => {\n while (files.length) {\n const file = files.shift()\n if (file.charAt(0) === '@') {\n return t({\n file: path.resolve(p.cwd, file.slice(1)),\n noResume: true,\n onentry: entry => p.add(entry),\n }).then(_ => addFilesAsync(p, files))\n } else {\n p.add(file)\n }\n }\n p.end()\n}\n\nconst createSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n addFilesSync(p, files)\n return p\n}\n\nconst create = (opt, files) => {\n const p = new Pack(opt)\n addFilesAsync(p, files)\n return p\n}\n","'use strict'\n\n// tar -x\nconst hlo = require('./high-level-opt.js')\nconst Unpack = require('./unpack.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\nconst stripSlash = require('./strip-trailing-slashes.js')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof opt_ === 'function') {\n cb = opt_, files = null, opt_ = {}\n } else if (Array.isArray(opt_)) {\n files = opt_, opt_ = {}\n }\n\n if (typeof files === 'function') {\n cb = files, files = null\n }\n\n if (!files) {\n files = []\n } else {\n files = Array.from(files)\n }\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function') {\n throw new TypeError('callback not supported for sync tar functions')\n }\n\n if (!opt.file && typeof cb === 'function') {\n throw new TypeError('callback only supported with file option')\n }\n\n if (files.length) {\n filesFilter(opt, files)\n }\n\n return opt.file && opt.sync ? extractFileSync(opt)\n : opt.file ? extractFile(opt, cb)\n : opt.sync ? extractSync(opt)\n : extract(opt)\n}\n\n// construct a filter that limits the file entries listed\n// include child entries if a dir is included\nconst filesFilter = (opt, files) => {\n const map = new Map(files.map(f => [stripSlash(f), true]))\n const filter = opt.filter\n\n const mapHas = (file, r) => {\n const root = r || path.parse(file).root || '.'\n const ret = file === root ? false\n : map.has(file) ? map.get(file)\n : mapHas(path.dirname(file), root)\n\n map.set(file, ret)\n return ret\n }\n\n opt.filter = filter\n ? (file, entry) => filter(file, entry) && mapHas(stripSlash(file))\n : file => mapHas(stripSlash(file))\n}\n\nconst extractFileSync = opt => {\n const u = new Unpack.Sync(opt)\n\n const file = opt.file\n const stat = fs.statSync(file)\n // This trades a zero-byte read() syscall for a stat\n // However, it will usually result in less memory allocation\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n const stream = new fsm.ReadStreamSync(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.pipe(u)\n}\n\nconst extractFile = (opt, cb) => {\n const u = new Unpack(opt)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n\n const file = opt.file\n const p = new Promise((resolve, reject) => {\n u.on('error', reject)\n u.on('close', resolve)\n\n // This trades a zero-byte read() syscall for a stat\n // However, it will usually result in less memory allocation\n fs.stat(file, (er, stat) => {\n if (er) {\n reject(er)\n } else {\n const stream = new fsm.ReadStream(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.on('error', reject)\n stream.pipe(u)\n }\n })\n })\n return cb ? p.then(cb, cb) : p\n}\n\nconst extractSync = opt => new Unpack.Sync(opt)\n\nconst extract = opt => new Unpack(opt)\n","// Get the appropriate flag to use for creating files\n// We use fmap on Windows platforms for files less than\n// 512kb. This is a fairly low limit, but avoids making\n// things slower in some cases. Since most of what this\n// library is used for is extracting tarballs of many\n// relatively small files in npm packages and the like,\n// it can be a big boost on Windows platforms.\n// Only supported in Node v12.9.0 and above.\nconst platform = process.env.__FAKE_PLATFORM__ || process.platform\nconst isWindows = platform === 'win32'\nconst fs = global.__FAKE_TESTING_FS__ || require('fs')\n\n/* istanbul ignore next */\nconst { O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP = 0 } = fs.constants\n\nconst fMapEnabled = isWindows && !!UV_FS_O_FILEMAP\nconst fMapLimit = 512 * 1024\nconst fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY\nmodule.exports = !fMapEnabled ? () => 'w'\n : size => size < fMapLimit ? fMapFlag : 'w'\n","'use strict'\n// parse a 512-byte header block to a data object, or vice-versa\n// encode returns `true` if a pax extended header is needed, because\n// the data could not be faithfully encoded in a simple header.\n// (Also, check header.needPax to see if it needs a pax header.)\n\nconst types = require('./types.js')\nconst pathModule = require('path').posix\nconst large = require('./large-numbers.js')\n\nconst SLURP = Symbol('slurp')\nconst TYPE = Symbol('type')\n\nclass Header {\n constructor (data, off, ex, gex) {\n this.cksumValid = false\n this.needPax = false\n this.nullBlock = false\n\n this.block = null\n this.path = null\n this.mode = null\n this.uid = null\n this.gid = null\n this.size = null\n this.mtime = null\n this.cksum = null\n this[TYPE] = '0'\n this.linkpath = null\n this.uname = null\n this.gname = null\n this.devmaj = 0\n this.devmin = 0\n this.atime = null\n this.ctime = null\n\n if (Buffer.isBuffer(data)) {\n this.decode(data, off || 0, ex, gex)\n } else if (data) {\n this.set(data)\n }\n }\n\n decode (buf, off, ex, gex) {\n if (!off) {\n off = 0\n }\n\n if (!buf || !(buf.length >= off + 512)) {\n throw new Error('need 512 bytes for header')\n }\n\n this.path = decString(buf, off, 100)\n this.mode = decNumber(buf, off + 100, 8)\n this.uid = decNumber(buf, off + 108, 8)\n this.gid = decNumber(buf, off + 116, 8)\n this.size = decNumber(buf, off + 124, 12)\n this.mtime = decDate(buf, off + 136, 12)\n this.cksum = decNumber(buf, off + 148, 12)\n\n // if we have extended or global extended headers, apply them now\n // See https://github.com/npm/node-tar/pull/187\n this[SLURP](ex)\n this[SLURP](gex, true)\n\n // old tar versions marked dirs as a file with a trailing /\n this[TYPE] = decString(buf, off + 156, 1)\n if (this[TYPE] === '') {\n this[TYPE] = '0'\n }\n if (this[TYPE] === '0' && this.path.slice(-1) === '/') {\n this[TYPE] = '5'\n }\n\n // tar implementations sometimes incorrectly put the stat(dir).size\n // as the size in the tarball, even though Directory entries are\n // not able to have any body at all. In the very rare chance that\n // it actually DOES have a body, we weren't going to do anything with\n // it anyway, and it'll just be a warning about an invalid header.\n if (this[TYPE] === '5') {\n this.size = 0\n }\n\n this.linkpath = decString(buf, off + 157, 100)\n if (buf.slice(off + 257, off + 265).toString() === 'ustar\\u000000') {\n this.uname = decString(buf, off + 265, 32)\n this.gname = decString(buf, off + 297, 32)\n this.devmaj = decNumber(buf, off + 329, 8)\n this.devmin = decNumber(buf, off + 337, 8)\n if (buf[off + 475] !== 0) {\n // definitely a prefix, definitely >130 chars.\n const prefix = decString(buf, off + 345, 155)\n this.path = prefix + '/' + this.path\n } else {\n const prefix = decString(buf, off + 345, 130)\n if (prefix) {\n this.path = prefix + '/' + this.path\n }\n this.atime = decDate(buf, off + 476, 12)\n this.ctime = decDate(buf, off + 488, 12)\n }\n }\n\n let sum = 8 * 0x20\n for (let i = off; i < off + 148; i++) {\n sum += buf[i]\n }\n\n for (let i = off + 156; i < off + 512; i++) {\n sum += buf[i]\n }\n\n this.cksumValid = sum === this.cksum\n if (this.cksum === null && sum === 8 * 0x20) {\n this.nullBlock = true\n }\n }\n\n [SLURP] (ex, global) {\n for (const k in ex) {\n // we slurp in everything except for the path attribute in\n // a global extended header, because that's weird.\n if (ex[k] !== null && ex[k] !== undefined &&\n !(global && k === 'path')) {\n this[k] = ex[k]\n }\n }\n }\n\n encode (buf, off) {\n if (!buf) {\n buf = this.block = Buffer.alloc(512)\n off = 0\n }\n\n if (!off) {\n off = 0\n }\n\n if (!(buf.length >= off + 512)) {\n throw new Error('need 512 bytes for header')\n }\n\n const prefixSize = this.ctime || this.atime ? 130 : 155\n const split = splitPrefix(this.path || '', prefixSize)\n const path = split[0]\n const prefix = split[1]\n this.needPax = split[2]\n\n this.needPax = encString(buf, off, 100, path) || this.needPax\n this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax\n this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax\n this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax\n this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax\n this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax\n buf[off + 156] = this[TYPE].charCodeAt(0)\n this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax\n buf.write('ustar\\u000000', off + 257, 8)\n this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax\n this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax\n this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax\n this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax\n this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax\n if (buf[off + 475] !== 0) {\n this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax\n } else {\n this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax\n this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax\n this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax\n }\n\n let sum = 8 * 0x20\n for (let i = off; i < off + 148; i++) {\n sum += buf[i]\n }\n\n for (let i = off + 156; i < off + 512; i++) {\n sum += buf[i]\n }\n\n this.cksum = sum\n encNumber(buf, off + 148, 8, this.cksum)\n this.cksumValid = true\n\n return this.needPax\n }\n\n set (data) {\n for (const i in data) {\n if (data[i] !== null && data[i] !== undefined) {\n this[i] = data[i]\n }\n }\n }\n\n get type () {\n return types.name.get(this[TYPE]) || this[TYPE]\n }\n\n get typeKey () {\n return this[TYPE]\n }\n\n set type (type) {\n if (types.code.has(type)) {\n this[TYPE] = types.code.get(type)\n } else {\n this[TYPE] = type\n }\n }\n}\n\nconst splitPrefix = (p, prefixSize) => {\n const pathSize = 100\n let pp = p\n let prefix = ''\n let ret\n const root = pathModule.parse(p).root || '.'\n\n if (Buffer.byteLength(pp) < pathSize) {\n ret = [pp, prefix, false]\n } else {\n // first set prefix to the dir, and path to the base\n prefix = pathModule.dirname(pp)\n pp = pathModule.basename(pp)\n\n do {\n if (Buffer.byteLength(pp) <= pathSize &&\n Buffer.byteLength(prefix) <= prefixSize) {\n // both fit!\n ret = [pp, prefix, false]\n } else if (Buffer.byteLength(pp) > pathSize &&\n Buffer.byteLength(prefix) <= prefixSize) {\n // prefix fits in prefix, but path doesn't fit in path\n ret = [pp.slice(0, pathSize - 1), prefix, true]\n } else {\n // make path take a bit from prefix\n pp = pathModule.join(pathModule.basename(prefix), pp)\n prefix = pathModule.dirname(prefix)\n }\n } while (prefix !== root && !ret)\n\n // at this point, found no resolution, just truncate\n if (!ret) {\n ret = [p.slice(0, pathSize - 1), '', true]\n }\n }\n return ret\n}\n\nconst decString = (buf, off, size) =>\n buf.slice(off, off + size).toString('utf8').replace(/\\0.*/, '')\n\nconst decDate = (buf, off, size) =>\n numToDate(decNumber(buf, off, size))\n\nconst numToDate = num => num === null ? null : new Date(num * 1000)\n\nconst decNumber = (buf, off, size) =>\n buf[off] & 0x80 ? large.parse(buf.slice(off, off + size))\n : decSmallNumber(buf, off, size)\n\nconst nanNull = value => isNaN(value) ? null : value\n\nconst decSmallNumber = (buf, off, size) =>\n nanNull(parseInt(\n buf.slice(off, off + size)\n .toString('utf8').replace(/\\0.*$/, '').trim(), 8))\n\n// the maximum encodable as a null-terminated octal, by field size\nconst MAXNUM = {\n 12: 0o77777777777,\n 8: 0o7777777,\n}\n\nconst encNumber = (buf, off, size, number) =>\n number === null ? false :\n number > MAXNUM[size] || number < 0\n ? (large.encode(number, buf.slice(off, off + size)), true)\n : (encSmallNumber(buf, off, size, number), false)\n\nconst encSmallNumber = (buf, off, size, number) =>\n buf.write(octalString(number, size), off, size, 'ascii')\n\nconst octalString = (number, size) =>\n padOctal(Math.floor(number).toString(8), size)\n\nconst padOctal = (string, size) =>\n (string.length === size - 1 ? string\n : new Array(size - string.length - 1).join('0') + string + ' ') + '\\0'\n\nconst encDate = (buf, off, size, date) =>\n date === null ? false :\n encNumber(buf, off, size, date.getTime() / 1000)\n\n// enough to fill the longest string we've got\nconst NULLS = new Array(156).join('\\0')\n// pad with nulls, return true if it's longer or non-ascii\nconst encString = (buf, off, size, string) =>\n string === null ? false :\n (buf.write(string + NULLS, off, size, 'utf8'),\n string.length !== Buffer.byteLength(string) || string.length > size)\n\nmodule.exports = Header\n","'use strict'\n\n// turn tar(1) style args like `C` into the more verbose things like `cwd`\n\nconst argmap = new Map([\n ['C', 'cwd'],\n ['f', 'file'],\n ['z', 'gzip'],\n ['P', 'preservePaths'],\n ['U', 'unlink'],\n ['strip-components', 'strip'],\n ['stripComponents', 'strip'],\n ['keep-newer', 'newer'],\n ['keepNewer', 'newer'],\n ['keep-newer-files', 'newer'],\n ['keepNewerFiles', 'newer'],\n ['k', 'keep'],\n ['keep-existing', 'keep'],\n ['keepExisting', 'keep'],\n ['m', 'noMtime'],\n ['no-mtime', 'noMtime'],\n ['p', 'preserveOwner'],\n ['L', 'follow'],\n ['h', 'follow'],\n])\n\nmodule.exports = opt => opt ? Object.keys(opt).map(k => [\n argmap.has(k) ? argmap.get(k) : k, opt[k],\n]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {}\n","'use strict'\n// Tar can encode large and negative numbers using a leading byte of\n// 0xff for negative, and 0x80 for positive.\n\nconst encode = (num, buf) => {\n if (!Number.isSafeInteger(num)) {\n // The number is so large that javascript cannot represent it with integer\n // precision.\n throw Error('cannot encode number outside of javascript safe integer range')\n } else if (num < 0) {\n encodeNegative(num, buf)\n } else {\n encodePositive(num, buf)\n }\n return buf\n}\n\nconst encodePositive = (num, buf) => {\n buf[0] = 0x80\n\n for (var i = buf.length; i > 1; i--) {\n buf[i - 1] = num & 0xff\n num = Math.floor(num / 0x100)\n }\n}\n\nconst encodeNegative = (num, buf) => {\n buf[0] = 0xff\n var flipped = false\n num = num * -1\n for (var i = buf.length; i > 1; i--) {\n var byte = num & 0xff\n num = Math.floor(num / 0x100)\n if (flipped) {\n buf[i - 1] = onesComp(byte)\n } else if (byte === 0) {\n buf[i - 1] = 0\n } else {\n flipped = true\n buf[i - 1] = twosComp(byte)\n }\n }\n}\n\nconst parse = (buf) => {\n const pre = buf[0]\n const value = pre === 0x80 ? pos(buf.slice(1, buf.length))\n : pre === 0xff ? twos(buf)\n : null\n if (value === null) {\n throw Error('invalid base256 encoding')\n }\n\n if (!Number.isSafeInteger(value)) {\n // The number is so large that javascript cannot represent it with integer\n // precision.\n throw Error('parsed number outside of javascript safe integer range')\n }\n\n return value\n}\n\nconst twos = (buf) => {\n var len = buf.length\n var sum = 0\n var flipped = false\n for (var i = len - 1; i > -1; i--) {\n var byte = buf[i]\n var f\n if (flipped) {\n f = onesComp(byte)\n } else if (byte === 0) {\n f = byte\n } else {\n flipped = true\n f = twosComp(byte)\n }\n if (f !== 0) {\n sum -= f * Math.pow(256, len - i - 1)\n }\n }\n return sum\n}\n\nconst pos = (buf) => {\n var len = buf.length\n var sum = 0\n for (var i = len - 1; i > -1; i--) {\n var byte = buf[i]\n if (byte !== 0) {\n sum += byte * Math.pow(256, len - i - 1)\n }\n }\n return sum\n}\n\nconst onesComp = byte => (0xff ^ byte) & 0xff\n\nconst twosComp = byte => ((0xff ^ byte) + 1) & 0xff\n\nmodule.exports = {\n encode,\n parse,\n}\n","'use strict'\n\n// XXX: This shares a lot in common with extract.js\n// maybe some DRY opportunity here?\n\n// tar -t\nconst hlo = require('./high-level-opt.js')\nconst Parser = require('./parse.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\nconst stripSlash = require('./strip-trailing-slashes.js')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof opt_ === 'function') {\n cb = opt_, files = null, opt_ = {}\n } else if (Array.isArray(opt_)) {\n files = opt_, opt_ = {}\n }\n\n if (typeof files === 'function') {\n cb = files, files = null\n }\n\n if (!files) {\n files = []\n } else {\n files = Array.from(files)\n }\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function') {\n throw new TypeError('callback not supported for sync tar functions')\n }\n\n if (!opt.file && typeof cb === 'function') {\n throw new TypeError('callback only supported with file option')\n }\n\n if (files.length) {\n filesFilter(opt, files)\n }\n\n if (!opt.noResume) {\n onentryFunction(opt)\n }\n\n return opt.file && opt.sync ? listFileSync(opt)\n : opt.file ? listFile(opt, cb)\n : list(opt)\n}\n\nconst onentryFunction = opt => {\n const onentry = opt.onentry\n opt.onentry = onentry ? e => {\n onentry(e)\n e.resume()\n } : e => e.resume()\n}\n\n// construct a filter that limits the file entries listed\n// include child entries if a dir is included\nconst filesFilter = (opt, files) => {\n const map = new Map(files.map(f => [stripSlash(f), true]))\n const filter = opt.filter\n\n const mapHas = (file, r) => {\n const root = r || path.parse(file).root || '.'\n const ret = file === root ? false\n : map.has(file) ? map.get(file)\n : mapHas(path.dirname(file), root)\n\n map.set(file, ret)\n return ret\n }\n\n opt.filter = filter\n ? (file, entry) => filter(file, entry) && mapHas(stripSlash(file))\n : file => mapHas(stripSlash(file))\n}\n\nconst listFileSync = opt => {\n const p = list(opt)\n const file = opt.file\n let threw = true\n let fd\n try {\n const stat = fs.statSync(file)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n if (stat.size < readSize) {\n p.end(fs.readFileSync(file))\n } else {\n let pos = 0\n const buf = Buffer.allocUnsafe(readSize)\n fd = fs.openSync(file, 'r')\n while (pos < stat.size) {\n const bytesRead = fs.readSync(fd, buf, 0, readSize, pos)\n pos += bytesRead\n p.write(buf.slice(0, bytesRead))\n }\n p.end()\n }\n threw = false\n } finally {\n if (threw && fd) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n }\n }\n}\n\nconst listFile = (opt, cb) => {\n const parse = new Parser(opt)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n\n const file = opt.file\n const p = new Promise((resolve, reject) => {\n parse.on('error', reject)\n parse.on('end', resolve)\n\n fs.stat(file, (er, stat) => {\n if (er) {\n reject(er)\n } else {\n const stream = new fsm.ReadStream(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.on('error', reject)\n stream.pipe(parse)\n }\n })\n })\n return cb ? p.then(cb, cb) : p\n}\n\nconst list = opt => new Parser(opt)\n","'use strict'\n// wrapper around mkdirp for tar's needs.\n\n// TODO: This should probably be a class, not functionally\n// passing around state in a gazillion args.\n\nconst mkdirp = require('mkdirp')\nconst fs = require('fs')\nconst path = require('path')\nconst chownr = require('chownr')\nconst normPath = require('./normalize-windows-path.js')\n\nclass SymlinkError extends Error {\n constructor (symlink, path) {\n super('Cannot extract through symbolic link')\n this.path = path\n this.symlink = symlink\n }\n\n get name () {\n return 'SylinkError'\n }\n}\n\nclass CwdError extends Error {\n constructor (path, code) {\n super(code + ': Cannot cd into \\'' + path + '\\'')\n this.path = path\n this.code = code\n }\n\n get name () {\n return 'CwdError'\n }\n}\n\nconst cGet = (cache, key) => cache.get(normPath(key))\nconst cSet = (cache, key, val) => cache.set(normPath(key), val)\n\nconst checkCwd = (dir, cb) => {\n fs.stat(dir, (er, st) => {\n if (er || !st.isDirectory()) {\n er = new CwdError(dir, er && er.code || 'ENOTDIR')\n }\n cb(er)\n })\n}\n\nmodule.exports = (dir, opt, cb) => {\n dir = normPath(dir)\n\n // if there's any overlap between mask and mode,\n // then we'll need an explicit chmod\n const umask = opt.umask\n const mode = opt.mode | 0o0700\n const needChmod = (mode & umask) !== 0\n\n const uid = opt.uid\n const gid = opt.gid\n const doChown = typeof uid === 'number' &&\n typeof gid === 'number' &&\n (uid !== opt.processUid || gid !== opt.processGid)\n\n const preserve = opt.preserve\n const unlink = opt.unlink\n const cache = opt.cache\n const cwd = normPath(opt.cwd)\n\n const done = (er, created) => {\n if (er) {\n cb(er)\n } else {\n cSet(cache, dir, true)\n if (created && doChown) {\n chownr(created, uid, gid, er => done(er))\n } else if (needChmod) {\n fs.chmod(dir, mode, cb)\n } else {\n cb()\n }\n }\n }\n\n if (cache && cGet(cache, dir) === true) {\n return done()\n }\n\n if (dir === cwd) {\n return checkCwd(dir, done)\n }\n\n if (preserve) {\n return mkdirp(dir, { mode }).then(made => done(null, made), done)\n }\n\n const sub = normPath(path.relative(cwd, dir))\n const parts = sub.split('/')\n mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done)\n}\n\nconst mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => {\n if (!parts.length) {\n return cb(null, created)\n }\n const p = parts.shift()\n const part = normPath(path.resolve(base + '/' + p))\n if (cGet(cache, part)) {\n return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n }\n fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))\n}\n\nconst onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => {\n if (er) {\n fs.lstat(part, (statEr, st) => {\n if (statEr) {\n statEr.path = statEr.path && normPath(statEr.path)\n cb(statEr)\n } else if (st.isDirectory()) {\n mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n } else if (unlink) {\n fs.unlink(part, er => {\n if (er) {\n return cb(er)\n }\n fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))\n })\n } else if (st.isSymbolicLink()) {\n return cb(new SymlinkError(part, part + '/' + parts.join('/')))\n } else {\n cb(er)\n }\n })\n } else {\n created = created || part\n mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n }\n}\n\nconst checkCwdSync = dir => {\n let ok = false\n let code = 'ENOTDIR'\n try {\n ok = fs.statSync(dir).isDirectory()\n } catch (er) {\n code = er.code\n } finally {\n if (!ok) {\n throw new CwdError(dir, code)\n }\n }\n}\n\nmodule.exports.sync = (dir, opt) => {\n dir = normPath(dir)\n // if there's any overlap between mask and mode,\n // then we'll need an explicit chmod\n const umask = opt.umask\n const mode = opt.mode | 0o0700\n const needChmod = (mode & umask) !== 0\n\n const uid = opt.uid\n const gid = opt.gid\n const doChown = typeof uid === 'number' &&\n typeof gid === 'number' &&\n (uid !== opt.processUid || gid !== opt.processGid)\n\n const preserve = opt.preserve\n const unlink = opt.unlink\n const cache = opt.cache\n const cwd = normPath(opt.cwd)\n\n const done = (created) => {\n cSet(cache, dir, true)\n if (created && doChown) {\n chownr.sync(created, uid, gid)\n }\n if (needChmod) {\n fs.chmodSync(dir, mode)\n }\n }\n\n if (cache && cGet(cache, dir) === true) {\n return done()\n }\n\n if (dir === cwd) {\n checkCwdSync(cwd)\n return done()\n }\n\n if (preserve) {\n return done(mkdirp.sync(dir, mode))\n }\n\n const sub = normPath(path.relative(cwd, dir))\n const parts = sub.split('/')\n let created = null\n for (let p = parts.shift(), part = cwd;\n p && (part += '/' + p);\n p = parts.shift()) {\n part = normPath(path.resolve(part))\n if (cGet(cache, part)) {\n continue\n }\n\n try {\n fs.mkdirSync(part, mode)\n created = created || part\n cSet(cache, part, true)\n } catch (er) {\n const st = fs.lstatSync(part)\n if (st.isDirectory()) {\n cSet(cache, part, true)\n continue\n } else if (unlink) {\n fs.unlinkSync(part)\n fs.mkdirSync(part, mode)\n created = created || part\n cSet(cache, part, true)\n continue\n } else if (st.isSymbolicLink()) {\n return new SymlinkError(part, part + '/' + parts.join('/'))\n }\n }\n }\n\n return done(created)\n}\n","'use strict'\nmodule.exports = (mode, isDir, portable) => {\n mode &= 0o7777\n\n // in portable mode, use the minimum reasonable umask\n // if this system creates files with 0o664 by default\n // (as some linux distros do), then we'll write the\n // archive with 0o644 instead. Also, don't ever create\n // a file that is not readable/writable by the owner.\n if (portable) {\n mode = (mode | 0o600) & ~0o22\n }\n\n // if dirs are readable, then they should be listable\n if (isDir) {\n if (mode & 0o400) {\n mode |= 0o100\n }\n if (mode & 0o40) {\n mode |= 0o10\n }\n if (mode & 0o4) {\n mode |= 0o1\n }\n }\n return mode\n}\n","// warning: extremely hot code path.\n// This has been meticulously optimized for use\n// within npm install on large package trees.\n// Do not edit without careful benchmarking.\nconst normalizeCache = Object.create(null)\nconst { hasOwnProperty } = Object.prototype\nmodule.exports = s => {\n if (!hasOwnProperty.call(normalizeCache, s)) {\n normalizeCache[s] = s.normalize('NFD')\n }\n return normalizeCache[s]\n}\n","// on windows, either \\ or / are valid directory separators.\n// on unix, \\ is a valid character in filenames.\n// so, on windows, and only on windows, we replace all \\ chars with /,\n// so that we can use / as our one and only directory separator char.\n\nconst platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform\nmodule.exports = platform !== 'win32' ? p => p\n : p => p && p.replace(/\\\\/g, '/')\n","'use strict'\n\n// A readable tar stream creator\n// Technically, this is a transform stream that you write paths into,\n// and tar format comes out of.\n// The `add()` method is like `write()` but returns this,\n// and end() return `this` as well, so you can\n// do `new Pack(opt).add('files').add('dir').end().pipe(output)\n// You could also do something like:\n// streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar'))\n\nclass PackJob {\n constructor (path, absolute) {\n this.path = path || './'\n this.absolute = absolute\n this.entry = null\n this.stat = null\n this.readdir = null\n this.pending = false\n this.ignore = false\n this.piped = false\n }\n}\n\nconst { Minipass } = require('minipass')\nconst zlib = require('minizlib')\nconst ReadEntry = require('./read-entry.js')\nconst WriteEntry = require('./write-entry.js')\nconst WriteEntrySync = WriteEntry.Sync\nconst WriteEntryTar = WriteEntry.Tar\nconst Yallist = require('yallist')\nconst EOF = Buffer.alloc(1024)\nconst ONSTAT = Symbol('onStat')\nconst ENDED = Symbol('ended')\nconst QUEUE = Symbol('queue')\nconst CURRENT = Symbol('current')\nconst PROCESS = Symbol('process')\nconst PROCESSING = Symbol('processing')\nconst PROCESSJOB = Symbol('processJob')\nconst JOBS = Symbol('jobs')\nconst JOBDONE = Symbol('jobDone')\nconst ADDFSENTRY = Symbol('addFSEntry')\nconst ADDTARENTRY = Symbol('addTarEntry')\nconst STAT = Symbol('stat')\nconst READDIR = Symbol('readdir')\nconst ONREADDIR = Symbol('onreaddir')\nconst PIPE = Symbol('pipe')\nconst ENTRY = Symbol('entry')\nconst ENTRYOPT = Symbol('entryOpt')\nconst WRITEENTRYCLASS = Symbol('writeEntryClass')\nconst WRITE = Symbol('write')\nconst ONDRAIN = Symbol('ondrain')\n\nconst fs = require('fs')\nconst path = require('path')\nconst warner = require('./warn-mixin.js')\nconst normPath = require('./normalize-windows-path.js')\n\nconst Pack = warner(class Pack extends Minipass {\n constructor (opt) {\n super(opt)\n opt = opt || Object.create(null)\n this.opt = opt\n this.file = opt.file || ''\n this.cwd = opt.cwd || process.cwd()\n this.maxReadSize = opt.maxReadSize\n this.preservePaths = !!opt.preservePaths\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.prefix = normPath(opt.prefix || '')\n this.linkCache = opt.linkCache || new Map()\n this.statCache = opt.statCache || new Map()\n this.readdirCache = opt.readdirCache || new Map()\n\n this[WRITEENTRYCLASS] = WriteEntry\n if (typeof opt.onwarn === 'function') {\n this.on('warn', opt.onwarn)\n }\n\n this.portable = !!opt.portable\n this.zip = null\n if (opt.gzip) {\n if (typeof opt.gzip !== 'object') {\n opt.gzip = {}\n }\n if (this.portable) {\n opt.gzip.portable = true\n }\n this.zip = new zlib.Gzip(opt.gzip)\n this.zip.on('data', chunk => super.write(chunk))\n this.zip.on('end', _ => super.end())\n this.zip.on('drain', _ => this[ONDRAIN]())\n this.on('resume', _ => this.zip.resume())\n } else {\n this.on('drain', this[ONDRAIN])\n }\n\n this.noDirRecurse = !!opt.noDirRecurse\n this.follow = !!opt.follow\n this.noMtime = !!opt.noMtime\n this.mtime = opt.mtime || null\n\n this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true\n\n this[QUEUE] = new Yallist()\n this[JOBS] = 0\n this.jobs = +opt.jobs || 4\n this[PROCESSING] = false\n this[ENDED] = false\n }\n\n [WRITE] (chunk) {\n return super.write(chunk)\n }\n\n add (path) {\n this.write(path)\n return this\n }\n\n end (path) {\n if (path) {\n this.write(path)\n }\n this[ENDED] = true\n this[PROCESS]()\n return this\n }\n\n write (path) {\n if (this[ENDED]) {\n throw new Error('write after end')\n }\n\n if (path instanceof ReadEntry) {\n this[ADDTARENTRY](path)\n } else {\n this[ADDFSENTRY](path)\n }\n return this.flowing\n }\n\n [ADDTARENTRY] (p) {\n const absolute = normPath(path.resolve(this.cwd, p.path))\n // in this case, we don't have to wait for the stat\n if (!this.filter(p.path, p)) {\n p.resume()\n } else {\n const job = new PackJob(p.path, absolute, false)\n job.entry = new WriteEntryTar(p, this[ENTRYOPT](job))\n job.entry.on('end', _ => this[JOBDONE](job))\n this[JOBS] += 1\n this[QUEUE].push(job)\n }\n\n this[PROCESS]()\n }\n\n [ADDFSENTRY] (p) {\n const absolute = normPath(path.resolve(this.cwd, p))\n this[QUEUE].push(new PackJob(p, absolute))\n this[PROCESS]()\n }\n\n [STAT] (job) {\n job.pending = true\n this[JOBS] += 1\n const stat = this.follow ? 'stat' : 'lstat'\n fs[stat](job.absolute, (er, stat) => {\n job.pending = false\n this[JOBS] -= 1\n if (er) {\n this.emit('error', er)\n } else {\n this[ONSTAT](job, stat)\n }\n })\n }\n\n [ONSTAT] (job, stat) {\n this.statCache.set(job.absolute, stat)\n job.stat = stat\n\n // now we have the stat, we can filter it.\n if (!this.filter(job.path, stat)) {\n job.ignore = true\n }\n\n this[PROCESS]()\n }\n\n [READDIR] (job) {\n job.pending = true\n this[JOBS] += 1\n fs.readdir(job.absolute, (er, entries) => {\n job.pending = false\n this[JOBS] -= 1\n if (er) {\n return this.emit('error', er)\n }\n this[ONREADDIR](job, entries)\n })\n }\n\n [ONREADDIR] (job, entries) {\n this.readdirCache.set(job.absolute, entries)\n job.readdir = entries\n this[PROCESS]()\n }\n\n [PROCESS] () {\n if (this[PROCESSING]) {\n return\n }\n\n this[PROCESSING] = true\n for (let w = this[QUEUE].head;\n w !== null && this[JOBS] < this.jobs;\n w = w.next) {\n this[PROCESSJOB](w.value)\n if (w.value.ignore) {\n const p = w.next\n this[QUEUE].removeNode(w)\n w.next = p\n }\n }\n\n this[PROCESSING] = false\n\n if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) {\n if (this.zip) {\n this.zip.end(EOF)\n } else {\n super.write(EOF)\n super.end()\n }\n }\n }\n\n get [CURRENT] () {\n return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value\n }\n\n [JOBDONE] (job) {\n this[QUEUE].shift()\n this[JOBS] -= 1\n this[PROCESS]()\n }\n\n [PROCESSJOB] (job) {\n if (job.pending) {\n return\n }\n\n if (job.entry) {\n if (job === this[CURRENT] && !job.piped) {\n this[PIPE](job)\n }\n return\n }\n\n if (!job.stat) {\n if (this.statCache.has(job.absolute)) {\n this[ONSTAT](job, this.statCache.get(job.absolute))\n } else {\n this[STAT](job)\n }\n }\n if (!job.stat) {\n return\n }\n\n // filtered out!\n if (job.ignore) {\n return\n }\n\n if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) {\n if (this.readdirCache.has(job.absolute)) {\n this[ONREADDIR](job, this.readdirCache.get(job.absolute))\n } else {\n this[READDIR](job)\n }\n if (!job.readdir) {\n return\n }\n }\n\n // we know it doesn't have an entry, because that got checked above\n job.entry = this[ENTRY](job)\n if (!job.entry) {\n job.ignore = true\n return\n }\n\n if (job === this[CURRENT] && !job.piped) {\n this[PIPE](job)\n }\n }\n\n [ENTRYOPT] (job) {\n return {\n onwarn: (code, msg, data) => this.warn(code, msg, data),\n noPax: this.noPax,\n cwd: this.cwd,\n absolute: job.absolute,\n preservePaths: this.preservePaths,\n maxReadSize: this.maxReadSize,\n strict: this.strict,\n portable: this.portable,\n linkCache: this.linkCache,\n statCache: this.statCache,\n noMtime: this.noMtime,\n mtime: this.mtime,\n prefix: this.prefix,\n }\n }\n\n [ENTRY] (job) {\n this[JOBS] += 1\n try {\n return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job))\n .on('end', () => this[JOBDONE](job))\n .on('error', er => this.emit('error', er))\n } catch (er) {\n this.emit('error', er)\n }\n }\n\n [ONDRAIN] () {\n if (this[CURRENT] && this[CURRENT].entry) {\n this[CURRENT].entry.resume()\n }\n }\n\n // like .pipe() but using super, because our write() is special\n [PIPE] (job) {\n job.piped = true\n\n if (job.readdir) {\n job.readdir.forEach(entry => {\n const p = job.path\n const base = p === './' ? '' : p.replace(/\\/*$/, '/')\n this[ADDFSENTRY](base + entry)\n })\n }\n\n const source = job.entry\n const zip = this.zip\n\n if (zip) {\n source.on('data', chunk => {\n if (!zip.write(chunk)) {\n source.pause()\n }\n })\n } else {\n source.on('data', chunk => {\n if (!super.write(chunk)) {\n source.pause()\n }\n })\n }\n }\n\n pause () {\n if (this.zip) {\n this.zip.pause()\n }\n return super.pause()\n }\n})\n\nclass PackSync extends Pack {\n constructor (opt) {\n super(opt)\n this[WRITEENTRYCLASS] = WriteEntrySync\n }\n\n // pause/resume are no-ops in sync streams.\n pause () {}\n resume () {}\n\n [STAT] (job) {\n const stat = this.follow ? 'statSync' : 'lstatSync'\n this[ONSTAT](job, fs[stat](job.absolute))\n }\n\n [READDIR] (job, stat) {\n this[ONREADDIR](job, fs.readdirSync(job.absolute))\n }\n\n // gotta get it all in this tick\n [PIPE] (job) {\n const source = job.entry\n const zip = this.zip\n\n if (job.readdir) {\n job.readdir.forEach(entry => {\n const p = job.path\n const base = p === './' ? '' : p.replace(/\\/*$/, '/')\n this[ADDFSENTRY](base + entry)\n })\n }\n\n if (zip) {\n source.on('data', chunk => {\n zip.write(chunk)\n })\n } else {\n source.on('data', chunk => {\n super[WRITE](chunk)\n })\n }\n }\n}\n\nPack.Sync = PackSync\n\nmodule.exports = Pack\n","'use strict'\n\n// this[BUFFER] is the remainder of a chunk if we're waiting for\n// the full 512 bytes of a header to come in. We will Buffer.concat()\n// it to the next write(), which is a mem copy, but a small one.\n//\n// this[QUEUE] is a Yallist of entries that haven't been emitted\n// yet this can only get filled up if the user keeps write()ing after\n// a write() returns false, or does a write() with more than one entry\n//\n// We don't buffer chunks, we always parse them and either create an\n// entry, or push it into the active entry. The ReadEntry class knows\n// to throw data away if .ignore=true\n//\n// Shift entry off the buffer when it emits 'end', and emit 'entry' for\n// the next one in the list.\n//\n// At any time, we're pushing body chunks into the entry at WRITEENTRY,\n// and waiting for 'end' on the entry at READENTRY\n//\n// ignored entries get .resume() called on them straight away\n\nconst warner = require('./warn-mixin.js')\nconst Header = require('./header.js')\nconst EE = require('events')\nconst Yallist = require('yallist')\nconst maxMetaEntrySize = 1024 * 1024\nconst Entry = require('./read-entry.js')\nconst Pax = require('./pax.js')\nconst zlib = require('minizlib')\nconst { nextTick } = require('process')\n\nconst gzipHeader = Buffer.from([0x1f, 0x8b])\nconst STATE = Symbol('state')\nconst WRITEENTRY = Symbol('writeEntry')\nconst READENTRY = Symbol('readEntry')\nconst NEXTENTRY = Symbol('nextEntry')\nconst PROCESSENTRY = Symbol('processEntry')\nconst EX = Symbol('extendedHeader')\nconst GEX = Symbol('globalExtendedHeader')\nconst META = Symbol('meta')\nconst EMITMETA = Symbol('emitMeta')\nconst BUFFER = Symbol('buffer')\nconst QUEUE = Symbol('queue')\nconst ENDED = Symbol('ended')\nconst EMITTEDEND = Symbol('emittedEnd')\nconst EMIT = Symbol('emit')\nconst UNZIP = Symbol('unzip')\nconst CONSUMECHUNK = Symbol('consumeChunk')\nconst CONSUMECHUNKSUB = Symbol('consumeChunkSub')\nconst CONSUMEBODY = Symbol('consumeBody')\nconst CONSUMEMETA = Symbol('consumeMeta')\nconst CONSUMEHEADER = Symbol('consumeHeader')\nconst CONSUMING = Symbol('consuming')\nconst BUFFERCONCAT = Symbol('bufferConcat')\nconst MAYBEEND = Symbol('maybeEnd')\nconst WRITING = Symbol('writing')\nconst ABORTED = Symbol('aborted')\nconst DONE = Symbol('onDone')\nconst SAW_VALID_ENTRY = Symbol('sawValidEntry')\nconst SAW_NULL_BLOCK = Symbol('sawNullBlock')\nconst SAW_EOF = Symbol('sawEOF')\nconst CLOSESTREAM = Symbol('closeStream')\n\nconst noop = _ => true\n\nmodule.exports = warner(class Parser extends EE {\n constructor (opt) {\n opt = opt || {}\n super(opt)\n\n this.file = opt.file || ''\n\n // set to boolean false when an entry starts. 1024 bytes of \\0\n // is technically a valid tarball, albeit a boring one.\n this[SAW_VALID_ENTRY] = null\n\n // these BADARCHIVE errors can't be detected early. listen on DONE.\n this.on(DONE, _ => {\n if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) {\n // either less than 1 block of data, or all entries were invalid.\n // Either way, probably not even a tarball.\n this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format')\n }\n })\n\n if (opt.ondone) {\n this.on(DONE, opt.ondone)\n } else {\n this.on(DONE, _ => {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n })\n }\n\n this.strict = !!opt.strict\n this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize\n this.filter = typeof opt.filter === 'function' ? opt.filter : noop\n\n // have to set this so that streams are ok piping into it\n this.writable = true\n this.readable = false\n\n this[QUEUE] = new Yallist()\n this[BUFFER] = null\n this[READENTRY] = null\n this[WRITEENTRY] = null\n this[STATE] = 'begin'\n this[META] = ''\n this[EX] = null\n this[GEX] = null\n this[ENDED] = false\n this[UNZIP] = null\n this[ABORTED] = false\n this[SAW_NULL_BLOCK] = false\n this[SAW_EOF] = false\n\n this.on('end', () => this[CLOSESTREAM]())\n\n if (typeof opt.onwarn === 'function') {\n this.on('warn', opt.onwarn)\n }\n if (typeof opt.onentry === 'function') {\n this.on('entry', opt.onentry)\n }\n }\n\n [CONSUMEHEADER] (chunk, position) {\n if (this[SAW_VALID_ENTRY] === null) {\n this[SAW_VALID_ENTRY] = false\n }\n let header\n try {\n header = new Header(chunk, position, this[EX], this[GEX])\n } catch (er) {\n return this.warn('TAR_ENTRY_INVALID', er)\n }\n\n if (header.nullBlock) {\n if (this[SAW_NULL_BLOCK]) {\n this[SAW_EOF] = true\n // ending an archive with no entries. pointless, but legal.\n if (this[STATE] === 'begin') {\n this[STATE] = 'header'\n }\n this[EMIT]('eof')\n } else {\n this[SAW_NULL_BLOCK] = true\n this[EMIT]('nullBlock')\n }\n } else {\n this[SAW_NULL_BLOCK] = false\n if (!header.cksumValid) {\n this.warn('TAR_ENTRY_INVALID', 'checksum failure', { header })\n } else if (!header.path) {\n this.warn('TAR_ENTRY_INVALID', 'path is required', { header })\n } else {\n const type = header.type\n if (/^(Symbolic)?Link$/.test(type) && !header.linkpath) {\n this.warn('TAR_ENTRY_INVALID', 'linkpath required', { header })\n } else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath) {\n this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', { header })\n } else {\n const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX])\n\n // we do this for meta & ignored entries as well, because they\n // are still valid tar, or else we wouldn't know to ignore them\n if (!this[SAW_VALID_ENTRY]) {\n if (entry.remain) {\n // this might be the one!\n const onend = () => {\n if (!entry.invalid) {\n this[SAW_VALID_ENTRY] = true\n }\n }\n entry.on('end', onend)\n } else {\n this[SAW_VALID_ENTRY] = true\n }\n }\n\n if (entry.meta) {\n if (entry.size > this.maxMetaEntrySize) {\n entry.ignore = true\n this[EMIT]('ignoredEntry', entry)\n this[STATE] = 'ignore'\n entry.resume()\n } else if (entry.size > 0) {\n this[META] = ''\n entry.on('data', c => this[META] += c)\n this[STATE] = 'meta'\n }\n } else {\n this[EX] = null\n entry.ignore = entry.ignore || !this.filter(entry.path, entry)\n\n if (entry.ignore) {\n // probably valid, just not something we care about\n this[EMIT]('ignoredEntry', entry)\n this[STATE] = entry.remain ? 'ignore' : 'header'\n entry.resume()\n } else {\n if (entry.remain) {\n this[STATE] = 'body'\n } else {\n this[STATE] = 'header'\n entry.end()\n }\n\n if (!this[READENTRY]) {\n this[QUEUE].push(entry)\n this[NEXTENTRY]()\n } else {\n this[QUEUE].push(entry)\n }\n }\n }\n }\n }\n }\n }\n\n [CLOSESTREAM] () {\n nextTick(() => this.emit('close'))\n }\n\n [PROCESSENTRY] (entry) {\n let go = true\n\n if (!entry) {\n this[READENTRY] = null\n go = false\n } else if (Array.isArray(entry)) {\n this.emit.apply(this, entry)\n } else {\n this[READENTRY] = entry\n this.emit('entry', entry)\n if (!entry.emittedEnd) {\n entry.on('end', _ => this[NEXTENTRY]())\n go = false\n }\n }\n\n return go\n }\n\n [NEXTENTRY] () {\n do {} while (this[PROCESSENTRY](this[QUEUE].shift()))\n\n if (!this[QUEUE].length) {\n // At this point, there's nothing in the queue, but we may have an\n // entry which is being consumed (readEntry).\n // If we don't, then we definitely can handle more data.\n // If we do, and either it's flowing, or it has never had any data\n // written to it, then it needs more.\n // The only other possibility is that it has returned false from a\n // write() call, so we wait for the next drain to continue.\n const re = this[READENTRY]\n const drainNow = !re || re.flowing || re.size === re.remain\n if (drainNow) {\n if (!this[WRITING]) {\n this.emit('drain')\n }\n } else {\n re.once('drain', _ => this.emit('drain'))\n }\n }\n }\n\n [CONSUMEBODY] (chunk, position) {\n // write up to but no more than writeEntry.blockRemain\n const entry = this[WRITEENTRY]\n const br = entry.blockRemain\n const c = (br >= chunk.length && position === 0) ? chunk\n : chunk.slice(position, position + br)\n\n entry.write(c)\n\n if (!entry.blockRemain) {\n this[STATE] = 'header'\n this[WRITEENTRY] = null\n entry.end()\n }\n\n return c.length\n }\n\n [CONSUMEMETA] (chunk, position) {\n const entry = this[WRITEENTRY]\n const ret = this[CONSUMEBODY](chunk, position)\n\n // if we finished, then the entry is reset\n if (!this[WRITEENTRY]) {\n this[EMITMETA](entry)\n }\n\n return ret\n }\n\n [EMIT] (ev, data, extra) {\n if (!this[QUEUE].length && !this[READENTRY]) {\n this.emit(ev, data, extra)\n } else {\n this[QUEUE].push([ev, data, extra])\n }\n }\n\n [EMITMETA] (entry) {\n this[EMIT]('meta', this[META])\n switch (entry.type) {\n case 'ExtendedHeader':\n case 'OldExtendedHeader':\n this[EX] = Pax.parse(this[META], this[EX], false)\n break\n\n case 'GlobalExtendedHeader':\n this[GEX] = Pax.parse(this[META], this[GEX], true)\n break\n\n case 'NextFileHasLongPath':\n case 'OldGnuLongPath':\n this[EX] = this[EX] || Object.create(null)\n this[EX].path = this[META].replace(/\\0.*/, '')\n break\n\n case 'NextFileHasLongLinkpath':\n this[EX] = this[EX] || Object.create(null)\n this[EX].linkpath = this[META].replace(/\\0.*/, '')\n break\n\n /* istanbul ignore next */\n default: throw new Error('unknown meta: ' + entry.type)\n }\n }\n\n abort (error) {\n this[ABORTED] = true\n this.emit('abort', error)\n // always throws, even in non-strict mode\n this.warn('TAR_ABORT', error, { recoverable: false })\n }\n\n write (chunk) {\n if (this[ABORTED]) {\n return\n }\n\n // first write, might be gzipped\n if (this[UNZIP] === null && chunk) {\n if (this[BUFFER]) {\n chunk = Buffer.concat([this[BUFFER], chunk])\n this[BUFFER] = null\n }\n if (chunk.length < gzipHeader.length) {\n this[BUFFER] = chunk\n return true\n }\n for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) {\n if (chunk[i] !== gzipHeader[i]) {\n this[UNZIP] = false\n }\n }\n if (this[UNZIP] === null) {\n const ended = this[ENDED]\n this[ENDED] = false\n this[UNZIP] = new zlib.Unzip()\n this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk))\n this[UNZIP].on('error', er => this.abort(er))\n this[UNZIP].on('end', _ => {\n this[ENDED] = true\n this[CONSUMECHUNK]()\n })\n this[WRITING] = true\n const ret = this[UNZIP][ended ? 'end' : 'write'](chunk)\n this[WRITING] = false\n return ret\n }\n }\n\n this[WRITING] = true\n if (this[UNZIP]) {\n this[UNZIP].write(chunk)\n } else {\n this[CONSUMECHUNK](chunk)\n }\n this[WRITING] = false\n\n // return false if there's a queue, or if the current entry isn't flowing\n const ret =\n this[QUEUE].length ? false :\n this[READENTRY] ? this[READENTRY].flowing :\n true\n\n // if we have no queue, then that means a clogged READENTRY\n if (!ret && !this[QUEUE].length) {\n this[READENTRY].once('drain', _ => this.emit('drain'))\n }\n\n return ret\n }\n\n [BUFFERCONCAT] (c) {\n if (c && !this[ABORTED]) {\n this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c\n }\n }\n\n [MAYBEEND] () {\n if (this[ENDED] &&\n !this[EMITTEDEND] &&\n !this[ABORTED] &&\n !this[CONSUMING]) {\n this[EMITTEDEND] = true\n const entry = this[WRITEENTRY]\n if (entry && entry.blockRemain) {\n // truncated, likely a damaged file\n const have = this[BUFFER] ? this[BUFFER].length : 0\n this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${\n entry.blockRemain} more bytes, only ${have} available)`, { entry })\n if (this[BUFFER]) {\n entry.write(this[BUFFER])\n }\n entry.end()\n }\n this[EMIT](DONE)\n }\n }\n\n [CONSUMECHUNK] (chunk) {\n if (this[CONSUMING]) {\n this[BUFFERCONCAT](chunk)\n } else if (!chunk && !this[BUFFER]) {\n this[MAYBEEND]()\n } else {\n this[CONSUMING] = true\n if (this[BUFFER]) {\n this[BUFFERCONCAT](chunk)\n const c = this[BUFFER]\n this[BUFFER] = null\n this[CONSUMECHUNKSUB](c)\n } else {\n this[CONSUMECHUNKSUB](chunk)\n }\n\n while (this[BUFFER] &&\n this[BUFFER].length >= 512 &&\n !this[ABORTED] &&\n !this[SAW_EOF]) {\n const c = this[BUFFER]\n this[BUFFER] = null\n this[CONSUMECHUNKSUB](c)\n }\n this[CONSUMING] = false\n }\n\n if (!this[BUFFER] || this[ENDED]) {\n this[MAYBEEND]()\n }\n }\n\n [CONSUMECHUNKSUB] (chunk) {\n // we know that we are in CONSUMING mode, so anything written goes into\n // the buffer. Advance the position and put any remainder in the buffer.\n let position = 0\n const length = chunk.length\n while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) {\n switch (this[STATE]) {\n case 'begin':\n case 'header':\n this[CONSUMEHEADER](chunk, position)\n position += 512\n break\n\n case 'ignore':\n case 'body':\n position += this[CONSUMEBODY](chunk, position)\n break\n\n case 'meta':\n position += this[CONSUMEMETA](chunk, position)\n break\n\n /* istanbul ignore next */\n default:\n throw new Error('invalid state: ' + this[STATE])\n }\n }\n\n if (position < length) {\n if (this[BUFFER]) {\n this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]])\n } else {\n this[BUFFER] = chunk.slice(position)\n }\n }\n }\n\n end (chunk) {\n if (!this[ABORTED]) {\n if (this[UNZIP]) {\n this[UNZIP].end(chunk)\n } else {\n this[ENDED] = true\n this.write(chunk)\n }\n }\n }\n})\n","// A path exclusive reservation system\n// reserve([list, of, paths], fn)\n// When the fn is first in line for all its paths, it\n// is called with a cb that clears the reservation.\n//\n// Used by async unpack to avoid clobbering paths in use,\n// while still allowing maximal safe parallelization.\n\nconst assert = require('assert')\nconst normalize = require('./normalize-unicode.js')\nconst stripSlashes = require('./strip-trailing-slashes.js')\nconst { join } = require('path')\n\nconst platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform\nconst isWindows = platform === 'win32'\n\nmodule.exports = () => {\n // path => [function or Set]\n // A Set object means a directory reservation\n // A fn is a direct reservation on that path\n const queues = new Map()\n\n // fn => {paths:[path,...], dirs:[path, ...]}\n const reservations = new Map()\n\n // return a set of parent dirs for a given path\n // '/a/b/c/d' -> ['/', '/a', '/a/b', '/a/b/c', '/a/b/c/d']\n const getDirs = path => {\n const dirs = path.split('/').slice(0, -1).reduce((set, path) => {\n if (set.length) {\n path = join(set[set.length - 1], path)\n }\n set.push(path || '/')\n return set\n }, [])\n return dirs\n }\n\n // functions currently running\n const running = new Set()\n\n // return the queues for each path the function cares about\n // fn => {paths, dirs}\n const getQueues = fn => {\n const res = reservations.get(fn)\n /* istanbul ignore if - unpossible */\n if (!res) {\n throw new Error('function does not have any path reservations')\n }\n return {\n paths: res.paths.map(path => queues.get(path)),\n dirs: [...res.dirs].map(path => queues.get(path)),\n }\n }\n\n // check if fn is first in line for all its paths, and is\n // included in the first set for all its dir queues\n const check = fn => {\n const { paths, dirs } = getQueues(fn)\n return paths.every(q => q[0] === fn) &&\n dirs.every(q => q[0] instanceof Set && q[0].has(fn))\n }\n\n // run the function if it's first in line and not already running\n const run = fn => {\n if (running.has(fn) || !check(fn)) {\n return false\n }\n running.add(fn)\n fn(() => clear(fn))\n return true\n }\n\n const clear = fn => {\n if (!running.has(fn)) {\n return false\n }\n\n const { paths, dirs } = reservations.get(fn)\n const next = new Set()\n\n paths.forEach(path => {\n const q = queues.get(path)\n assert.equal(q[0], fn)\n if (q.length === 1) {\n queues.delete(path)\n } else {\n q.shift()\n if (typeof q[0] === 'function') {\n next.add(q[0])\n } else {\n q[0].forEach(fn => next.add(fn))\n }\n }\n })\n\n dirs.forEach(dir => {\n const q = queues.get(dir)\n assert(q[0] instanceof Set)\n if (q[0].size === 1 && q.length === 1) {\n queues.delete(dir)\n } else if (q[0].size === 1) {\n q.shift()\n\n // must be a function or else the Set would've been reused\n next.add(q[0])\n } else {\n q[0].delete(fn)\n }\n })\n running.delete(fn)\n\n next.forEach(fn => run(fn))\n return true\n }\n\n const reserve = (paths, fn) => {\n // collide on matches across case and unicode normalization\n // On windows, thanks to the magic of 8.3 shortnames, it is fundamentally\n // impossible to determine whether two paths refer to the same thing on\n // disk, without asking the kernel for a shortname.\n // So, we just pretend that every path matches every other path here,\n // effectively removing all parallelization on windows.\n paths = isWindows ? ['win32 parallelization disabled'] : paths.map(p => {\n // don't need normPath, because we skip this entirely for windows\n return stripSlashes(join(normalize(p))).toLowerCase()\n })\n\n const dirs = new Set(\n paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b))\n )\n reservations.set(fn, { dirs, paths })\n paths.forEach(path => {\n const q = queues.get(path)\n if (!q) {\n queues.set(path, [fn])\n } else {\n q.push(fn)\n }\n })\n dirs.forEach(dir => {\n const q = queues.get(dir)\n if (!q) {\n queues.set(dir, [new Set([fn])])\n } else if (q[q.length - 1] instanceof Set) {\n q[q.length - 1].add(fn)\n } else {\n q.push(new Set([fn]))\n }\n })\n\n return run(fn)\n }\n\n return { check, reserve }\n}\n","'use strict'\nconst Header = require('./header.js')\nconst path = require('path')\n\nclass Pax {\n constructor (obj, global) {\n this.atime = obj.atime || null\n this.charset = obj.charset || null\n this.comment = obj.comment || null\n this.ctime = obj.ctime || null\n this.gid = obj.gid || null\n this.gname = obj.gname || null\n this.linkpath = obj.linkpath || null\n this.mtime = obj.mtime || null\n this.path = obj.path || null\n this.size = obj.size || null\n this.uid = obj.uid || null\n this.uname = obj.uname || null\n this.dev = obj.dev || null\n this.ino = obj.ino || null\n this.nlink = obj.nlink || null\n this.global = global || false\n }\n\n encode () {\n const body = this.encodeBody()\n if (body === '') {\n return null\n }\n\n const bodyLen = Buffer.byteLength(body)\n // round up to 512 bytes\n // add 512 for header\n const bufLen = 512 * Math.ceil(1 + bodyLen / 512)\n const buf = Buffer.allocUnsafe(bufLen)\n\n // 0-fill the header section, it might not hit every field\n for (let i = 0; i < 512; i++) {\n buf[i] = 0\n }\n\n new Header({\n // XXX split the path\n // then the path should be PaxHeader + basename, but less than 99,\n // prepend with the dirname\n path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99),\n mode: this.mode || 0o644,\n uid: this.uid || null,\n gid: this.gid || null,\n size: bodyLen,\n mtime: this.mtime || null,\n type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader',\n linkpath: '',\n uname: this.uname || '',\n gname: this.gname || '',\n devmaj: 0,\n devmin: 0,\n atime: this.atime || null,\n ctime: this.ctime || null,\n }).encode(buf)\n\n buf.write(body, 512, bodyLen, 'utf8')\n\n // null pad after the body\n for (let i = bodyLen + 512; i < buf.length; i++) {\n buf[i] = 0\n }\n\n return buf\n }\n\n encodeBody () {\n return (\n this.encodeField('path') +\n this.encodeField('ctime') +\n this.encodeField('atime') +\n this.encodeField('dev') +\n this.encodeField('ino') +\n this.encodeField('nlink') +\n this.encodeField('charset') +\n this.encodeField('comment') +\n this.encodeField('gid') +\n this.encodeField('gname') +\n this.encodeField('linkpath') +\n this.encodeField('mtime') +\n this.encodeField('size') +\n this.encodeField('uid') +\n this.encodeField('uname')\n )\n }\n\n encodeField (field) {\n if (this[field] === null || this[field] === undefined) {\n return ''\n }\n const v = this[field] instanceof Date ? this[field].getTime() / 1000\n : this[field]\n const s = ' ' +\n (field === 'dev' || field === 'ino' || field === 'nlink'\n ? 'SCHILY.' : '') +\n field + '=' + v + '\\n'\n const byteLen = Buffer.byteLength(s)\n // the digits includes the length of the digits in ascii base-10\n // so if it's 9 characters, then adding 1 for the 9 makes it 10\n // which makes it 11 chars.\n let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1\n if (byteLen + digits >= Math.pow(10, digits)) {\n digits += 1\n }\n const len = digits + byteLen\n return len + s\n }\n}\n\nPax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g)\n\nconst merge = (a, b) =>\n b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a\n\nconst parseKV = string =>\n string\n .replace(/\\n$/, '')\n .split('\\n')\n .reduce(parseKVLine, Object.create(null))\n\nconst parseKVLine = (set, line) => {\n const n = parseInt(line, 10)\n\n // XXX Values with \\n in them will fail this.\n // Refactor to not be a naive line-by-line parse.\n if (n !== Buffer.byteLength(line) + 1) {\n return set\n }\n\n line = line.slice((n + ' ').length)\n const kv = line.split('=')\n const k = kv.shift().replace(/^SCHILY\\.(dev|ino|nlink)/, '$1')\n if (!k) {\n return set\n }\n\n const v = kv.join('=')\n set[k] = /^([A-Z]+\\.)?([mac]|birth|creation)time$/.test(k)\n ? new Date(v * 1000)\n : /^[0-9]+$/.test(v) ? +v\n : v\n return set\n}\n\nmodule.exports = Pax\n","'use strict'\nconst { Minipass } = require('minipass')\nconst normPath = require('./normalize-windows-path.js')\n\nconst SLURP = Symbol('slurp')\nmodule.exports = class ReadEntry extends Minipass {\n constructor (header, ex, gex) {\n super()\n // read entries always start life paused. this is to avoid the\n // situation where Minipass's auto-ending empty streams results\n // in an entry ending before we're ready for it.\n this.pause()\n this.extended = ex\n this.globalExtended = gex\n this.header = header\n this.startBlockSize = 512 * Math.ceil(header.size / 512)\n this.blockRemain = this.startBlockSize\n this.remain = header.size\n this.type = header.type\n this.meta = false\n this.ignore = false\n switch (this.type) {\n case 'File':\n case 'OldFile':\n case 'Link':\n case 'SymbolicLink':\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'Directory':\n case 'FIFO':\n case 'ContiguousFile':\n case 'GNUDumpDir':\n break\n\n case 'NextFileHasLongLinkpath':\n case 'NextFileHasLongPath':\n case 'OldGnuLongPath':\n case 'GlobalExtendedHeader':\n case 'ExtendedHeader':\n case 'OldExtendedHeader':\n this.meta = true\n break\n\n // NOTE: gnutar and bsdtar treat unrecognized types as 'File'\n // it may be worth doing the same, but with a warning.\n default:\n this.ignore = true\n }\n\n this.path = normPath(header.path)\n this.mode = header.mode\n if (this.mode) {\n this.mode = this.mode & 0o7777\n }\n this.uid = header.uid\n this.gid = header.gid\n this.uname = header.uname\n this.gname = header.gname\n this.size = header.size\n this.mtime = header.mtime\n this.atime = header.atime\n this.ctime = header.ctime\n this.linkpath = normPath(header.linkpath)\n this.uname = header.uname\n this.gname = header.gname\n\n if (ex) {\n this[SLURP](ex)\n }\n if (gex) {\n this[SLURP](gex, true)\n }\n }\n\n write (data) {\n const writeLen = data.length\n if (writeLen > this.blockRemain) {\n throw new Error('writing more to entry than is appropriate')\n }\n\n const r = this.remain\n const br = this.blockRemain\n this.remain = Math.max(0, r - writeLen)\n this.blockRemain = Math.max(0, br - writeLen)\n if (this.ignore) {\n return true\n }\n\n if (r >= writeLen) {\n return super.write(data)\n }\n\n // r < writeLen\n return super.write(data.slice(0, r))\n }\n\n [SLURP] (ex, global) {\n for (const k in ex) {\n // we slurp in everything except for the path attribute in\n // a global extended header, because that's weird.\n if (ex[k] !== null && ex[k] !== undefined &&\n !(global && k === 'path')) {\n this[k] = k === 'path' || k === 'linkpath' ? normPath(ex[k]) : ex[k]\n }\n }\n }\n}\n","'use strict'\n\n// tar -r\nconst hlo = require('./high-level-opt.js')\nconst Pack = require('./pack.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst t = require('./list.js')\nconst path = require('path')\n\n// starting at the head of the file, read a Header\n// If the checksum is invalid, that's our position to start writing\n// If it is, jump forward by the specified size (round up to 512)\n// and try again.\n// Write the new Pack stream starting there.\n\nconst Header = require('./header.js')\n\nmodule.exports = (opt_, files, cb) => {\n const opt = hlo(opt_)\n\n if (!opt.file) {\n throw new TypeError('file is required')\n }\n\n if (opt.gzip) {\n throw new TypeError('cannot append to compressed archives')\n }\n\n if (!files || !Array.isArray(files) || !files.length) {\n throw new TypeError('no files or directories specified')\n }\n\n files = Array.from(files)\n\n return opt.sync ? replaceSync(opt, files)\n : replace(opt, files, cb)\n}\n\nconst replaceSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n\n let threw = true\n let fd\n let position\n\n try {\n try {\n fd = fs.openSync(opt.file, 'r+')\n } catch (er) {\n if (er.code === 'ENOENT') {\n fd = fs.openSync(opt.file, 'w+')\n } else {\n throw er\n }\n }\n\n const st = fs.fstatSync(fd)\n const headBuf = Buffer.alloc(512)\n\n POSITION: for (position = 0; position < st.size; position += 512) {\n for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {\n bytes = fs.readSync(\n fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos\n )\n\n if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {\n throw new Error('cannot append to compressed archives')\n }\n\n if (!bytes) {\n break POSITION\n }\n }\n\n const h = new Header(headBuf)\n if (!h.cksumValid) {\n break\n }\n const entryBlockSize = 512 * Math.ceil(h.size / 512)\n if (position + entryBlockSize + 512 > st.size) {\n break\n }\n // the 512 for the header we just parsed will be added as well\n // also jump ahead all the blocks for the body\n position += entryBlockSize\n if (opt.mtimeCache) {\n opt.mtimeCache.set(h.path, h.mtime)\n }\n }\n threw = false\n\n streamSync(opt, p, position, fd, files)\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n }\n }\n}\n\nconst streamSync = (opt, p, position, fd, files) => {\n const stream = new fsm.WriteStreamSync(opt.file, {\n fd: fd,\n start: position,\n })\n p.pipe(stream)\n addFilesSync(p, files)\n}\n\nconst replace = (opt, files, cb) => {\n files = Array.from(files)\n const p = new Pack(opt)\n\n const getPos = (fd, size, cb_) => {\n const cb = (er, pos) => {\n if (er) {\n fs.close(fd, _ => cb_(er))\n } else {\n cb_(null, pos)\n }\n }\n\n let position = 0\n if (size === 0) {\n return cb(null, 0)\n }\n\n let bufPos = 0\n const headBuf = Buffer.alloc(512)\n const onread = (er, bytes) => {\n if (er) {\n return cb(er)\n }\n bufPos += bytes\n if (bufPos < 512 && bytes) {\n return fs.read(\n fd, headBuf, bufPos, headBuf.length - bufPos,\n position + bufPos, onread\n )\n }\n\n if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b) {\n return cb(new Error('cannot append to compressed archives'))\n }\n\n // truncated header\n if (bufPos < 512) {\n return cb(null, position)\n }\n\n const h = new Header(headBuf)\n if (!h.cksumValid) {\n return cb(null, position)\n }\n\n const entryBlockSize = 512 * Math.ceil(h.size / 512)\n if (position + entryBlockSize + 512 > size) {\n return cb(null, position)\n }\n\n position += entryBlockSize + 512\n if (position >= size) {\n return cb(null, position)\n }\n\n if (opt.mtimeCache) {\n opt.mtimeCache.set(h.path, h.mtime)\n }\n bufPos = 0\n fs.read(fd, headBuf, 0, 512, position, onread)\n }\n fs.read(fd, headBuf, 0, 512, position, onread)\n }\n\n const promise = new Promise((resolve, reject) => {\n p.on('error', reject)\n let flag = 'r+'\n const onopen = (er, fd) => {\n if (er && er.code === 'ENOENT' && flag === 'r+') {\n flag = 'w+'\n return fs.open(opt.file, flag, onopen)\n }\n\n if (er) {\n return reject(er)\n }\n\n fs.fstat(fd, (er, st) => {\n if (er) {\n return fs.close(fd, () => reject(er))\n }\n\n getPos(fd, st.size, (er, position) => {\n if (er) {\n return reject(er)\n }\n const stream = new fsm.WriteStream(opt.file, {\n fd: fd,\n start: position,\n })\n p.pipe(stream)\n stream.on('error', reject)\n stream.on('close', resolve)\n addFilesAsync(p, files)\n })\n })\n }\n fs.open(opt.file, flag, onopen)\n })\n\n return cb ? promise.then(cb, cb) : promise\n}\n\nconst addFilesSync = (p, files) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n t({\n file: path.resolve(p.cwd, file.slice(1)),\n sync: true,\n noResume: true,\n onentry: entry => p.add(entry),\n })\n } else {\n p.add(file)\n }\n })\n p.end()\n}\n\nconst addFilesAsync = (p, files) => {\n while (files.length) {\n const file = files.shift()\n if (file.charAt(0) === '@') {\n return t({\n file: path.resolve(p.cwd, file.slice(1)),\n noResume: true,\n onentry: entry => p.add(entry),\n }).then(_ => addFilesAsync(p, files))\n } else {\n p.add(file)\n }\n }\n p.end()\n}\n","// unix absolute paths are also absolute on win32, so we use this for both\nconst { isAbsolute, parse } = require('path').win32\n\n// returns [root, stripped]\n// Note that windows will think that //x/y/z/a has a \"root\" of //x/y, and in\n// those cases, we want to sanitize it to x/y/z/a, not z/a, so we strip /\n// explicitly if it's the first character.\n// drive-specific relative paths on Windows get their root stripped off even\n// though they are not absolute, so `c:../foo` becomes ['c:', '../foo']\nmodule.exports = path => {\n let r = ''\n\n let parsed = parse(path)\n while (isAbsolute(path) || parsed.root) {\n // windows will think that //x/y/z has a \"root\" of //x/y/\n // but strip the //?/C:/ off of //?/C:/path\n const root = path.charAt(0) === '/' && path.slice(0, 4) !== '//?/' ? '/'\n : parsed.root\n path = path.slice(root.length)\n r += root\n parsed = parse(path)\n }\n return [r, path]\n}\n","// warning: extremely hot code path.\n// This has been meticulously optimized for use\n// within npm install on large package trees.\n// Do not edit without careful benchmarking.\nmodule.exports = str => {\n let i = str.length - 1\n let slashesStart = -1\n while (i > -1 && str.charAt(i) === '/') {\n slashesStart = i\n i--\n }\n return slashesStart === -1 ? str : str.slice(0, slashesStart)\n}\n","'use strict'\n// map types from key to human-friendly name\nexports.name = new Map([\n ['0', 'File'],\n // same as File\n ['', 'OldFile'],\n ['1', 'Link'],\n ['2', 'SymbolicLink'],\n // Devices and FIFOs aren't fully supported\n // they are parsed, but skipped when unpacking\n ['3', 'CharacterDevice'],\n ['4', 'BlockDevice'],\n ['5', 'Directory'],\n ['6', 'FIFO'],\n // same as File\n ['7', 'ContiguousFile'],\n // pax headers\n ['g', 'GlobalExtendedHeader'],\n ['x', 'ExtendedHeader'],\n // vendor-specific stuff\n // skip\n ['A', 'SolarisACL'],\n // like 5, but with data, which should be skipped\n ['D', 'GNUDumpDir'],\n // metadata only, skip\n ['I', 'Inode'],\n // data = link path of next file\n ['K', 'NextFileHasLongLinkpath'],\n // data = path of next file\n ['L', 'NextFileHasLongPath'],\n // skip\n ['M', 'ContinuationFile'],\n // like L\n ['N', 'OldGnuLongPath'],\n // skip\n ['S', 'SparseFile'],\n // skip\n ['V', 'TapeVolumeHeader'],\n // like x\n ['X', 'OldExtendedHeader'],\n])\n\n// map the other direction\nexports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]]))\n","'use strict'\n\n// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet.\n// but the path reservations are required to avoid race conditions where\n// parallelized unpack ops may mess with one another, due to dependencies\n// (like a Link depending on its target) or destructive operations (like\n// clobbering an fs object to create one of a different type.)\n\nconst assert = require('assert')\nconst Parser = require('./parse.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\nconst mkdir = require('./mkdir.js')\nconst wc = require('./winchars.js')\nconst pathReservations = require('./path-reservations.js')\nconst stripAbsolutePath = require('./strip-absolute-path.js')\nconst normPath = require('./normalize-windows-path.js')\nconst stripSlash = require('./strip-trailing-slashes.js')\nconst normalize = require('./normalize-unicode.js')\n\nconst ONENTRY = Symbol('onEntry')\nconst CHECKFS = Symbol('checkFs')\nconst CHECKFS2 = Symbol('checkFs2')\nconst PRUNECACHE = Symbol('pruneCache')\nconst ISREUSABLE = Symbol('isReusable')\nconst MAKEFS = Symbol('makeFs')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst LINK = Symbol('link')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst UNSUPPORTED = Symbol('unsupported')\nconst CHECKPATH = Symbol('checkPath')\nconst MKDIR = Symbol('mkdir')\nconst ONERROR = Symbol('onError')\nconst PENDING = Symbol('pending')\nconst PEND = Symbol('pend')\nconst UNPEND = Symbol('unpend')\nconst ENDED = Symbol('ended')\nconst MAYBECLOSE = Symbol('maybeClose')\nconst SKIP = Symbol('skip')\nconst DOCHOWN = Symbol('doChown')\nconst UID = Symbol('uid')\nconst GID = Symbol('gid')\nconst CHECKED_CWD = Symbol('checkedCwd')\nconst crypto = require('crypto')\nconst getFlag = require('./get-write-flag.js')\nconst platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform\nconst isWindows = platform === 'win32'\n\n// Unlinks on Windows are not atomic.\n//\n// This means that if you have a file entry, followed by another\n// file entry with an identical name, and you cannot re-use the file\n// (because it's a hardlink, or because unlink:true is set, or it's\n// Windows, which does not have useful nlink values), then the unlink\n// will be committed to the disk AFTER the new file has been written\n// over the old one, deleting the new file.\n//\n// To work around this, on Windows systems, we rename the file and then\n// delete the renamed file. It's a sloppy kludge, but frankly, I do not\n// know of a better way to do this, given windows' non-atomic unlink\n// semantics.\n//\n// See: https://github.com/npm/node-tar/issues/183\n/* istanbul ignore next */\nconst unlinkFile = (path, cb) => {\n if (!isWindows) {\n return fs.unlink(path, cb)\n }\n\n const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')\n fs.rename(path, name, er => {\n if (er) {\n return cb(er)\n }\n fs.unlink(name, cb)\n })\n}\n\n/* istanbul ignore next */\nconst unlinkFileSync = path => {\n if (!isWindows) {\n return fs.unlinkSync(path)\n }\n\n const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')\n fs.renameSync(path, name)\n fs.unlinkSync(name)\n}\n\n// this.gid, entry.gid, this.processUid\nconst uint32 = (a, b, c) =>\n a === a >>> 0 ? a\n : b === b >>> 0 ? b\n : c\n\n// clear the cache if it's a case-insensitive unicode-squashing match.\n// we can't know if the current file system is case-sensitive or supports\n// unicode fully, so we check for similarity on the maximally compatible\n// representation. Err on the side of pruning, since all it's doing is\n// preventing lstats, and it's not the end of the world if we get a false\n// positive.\n// Note that on windows, we always drop the entire cache whenever a\n// symbolic link is encountered, because 8.3 filenames are impossible\n// to reason about, and collisions are hazards rather than just failures.\nconst cacheKeyNormalize = path => stripSlash(normPath(normalize(path)))\n .toLowerCase()\n\nconst pruneCache = (cache, abs) => {\n abs = cacheKeyNormalize(abs)\n for (const path of cache.keys()) {\n const pnorm = cacheKeyNormalize(path)\n if (pnorm === abs || pnorm.indexOf(abs + '/') === 0) {\n cache.delete(path)\n }\n }\n}\n\nconst dropCache = cache => {\n for (const key of cache.keys()) {\n cache.delete(key)\n }\n}\n\nclass Unpack extends Parser {\n constructor (opt) {\n if (!opt) {\n opt = {}\n }\n\n opt.ondone = _ => {\n this[ENDED] = true\n this[MAYBECLOSE]()\n }\n\n super(opt)\n\n this[CHECKED_CWD] = false\n\n this.reservations = pathReservations()\n\n this.transform = typeof opt.transform === 'function' ? opt.transform : null\n\n this.writable = true\n this.readable = false\n\n this[PENDING] = 0\n this[ENDED] = false\n\n this.dirCache = opt.dirCache || new Map()\n\n if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {\n // need both or neither\n if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number') {\n throw new TypeError('cannot set owner without number uid and gid')\n }\n if (opt.preserveOwner) {\n throw new TypeError(\n 'cannot preserve owner in archive and also set owner explicitly')\n }\n this.uid = opt.uid\n this.gid = opt.gid\n this.setOwner = true\n } else {\n this.uid = null\n this.gid = null\n this.setOwner = false\n }\n\n // default true for root\n if (opt.preserveOwner === undefined && typeof opt.uid !== 'number') {\n this.preserveOwner = process.getuid && process.getuid() === 0\n } else {\n this.preserveOwner = !!opt.preserveOwner\n }\n\n this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ?\n process.getuid() : null\n this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ?\n process.getgid() : null\n\n // mostly just for testing, but useful in some cases.\n // Forcibly trigger a chown on every entry, no matter what\n this.forceChown = opt.forceChown === true\n\n // turn > this[ONENTRY](entry))\n }\n\n // a bad or damaged archive is a warning for Parser, but an error\n // when extracting. Mark those errors as unrecoverable, because\n // the Unpack contract cannot be met.\n warn (code, msg, data = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT') {\n data.recoverable = false\n }\n return super.warn(code, msg, data)\n }\n\n [MAYBECLOSE] () {\n if (this[ENDED] && this[PENDING] === 0) {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n }\n }\n\n [CHECKPATH] (entry) {\n if (this.strip) {\n const parts = normPath(entry.path).split('/')\n if (parts.length < this.strip) {\n return false\n }\n entry.path = parts.slice(this.strip).join('/')\n\n if (entry.type === 'Link') {\n const linkparts = normPath(entry.linkpath).split('/')\n if (linkparts.length >= this.strip) {\n entry.linkpath = linkparts.slice(this.strip).join('/')\n } else {\n return false\n }\n }\n }\n\n if (!this.preservePaths) {\n const p = normPath(entry.path)\n const parts = p.split('/')\n if (parts.includes('..') || isWindows && /^[a-z]:\\.\\.$/i.test(parts[0])) {\n this.warn('TAR_ENTRY_ERROR', `path contains '..'`, {\n entry,\n path: p,\n })\n return false\n }\n\n // strip off the root\n const [root, stripped] = stripAbsolutePath(p)\n if (root) {\n entry.path = stripped\n this.warn('TAR_ENTRY_INFO', `stripping ${root} from absolute path`, {\n entry,\n path: p,\n })\n }\n }\n\n if (path.isAbsolute(entry.path)) {\n entry.absolute = normPath(path.resolve(entry.path))\n } else {\n entry.absolute = normPath(path.resolve(this.cwd, entry.path))\n }\n\n // if we somehow ended up with a path that escapes the cwd, and we are\n // not in preservePaths mode, then something is fishy! This should have\n // been prevented above, so ignore this for coverage.\n /* istanbul ignore if - defense in depth */\n if (!this.preservePaths &&\n entry.absolute.indexOf(this.cwd + '/') !== 0 &&\n entry.absolute !== this.cwd) {\n this.warn('TAR_ENTRY_ERROR', 'path escaped extraction target', {\n entry,\n path: normPath(entry.path),\n resolvedPath: entry.absolute,\n cwd: this.cwd,\n })\n return false\n }\n\n // an archive can set properties on the extraction directory, but it\n // may not replace the cwd with a different kind of thing entirely.\n if (entry.absolute === this.cwd &&\n entry.type !== 'Directory' &&\n entry.type !== 'GNUDumpDir') {\n return false\n }\n\n // only encode : chars that aren't drive letter indicators\n if (this.win32) {\n const { root: aRoot } = path.win32.parse(entry.absolute)\n entry.absolute = aRoot + wc.encode(entry.absolute.slice(aRoot.length))\n const { root: pRoot } = path.win32.parse(entry.path)\n entry.path = pRoot + wc.encode(entry.path.slice(pRoot.length))\n }\n\n return true\n }\n\n [ONENTRY] (entry) {\n if (!this[CHECKPATH](entry)) {\n return entry.resume()\n }\n\n assert.equal(typeof entry.absolute, 'string')\n\n switch (entry.type) {\n case 'Directory':\n case 'GNUDumpDir':\n if (entry.mode) {\n entry.mode = entry.mode | 0o700\n }\n\n // eslint-disable-next-line no-fallthrough\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n case 'Link':\n case 'SymbolicLink':\n return this[CHECKFS](entry)\n\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'FIFO':\n default:\n return this[UNSUPPORTED](entry)\n }\n }\n\n [ONERROR] (er, entry) {\n // Cwd has to exist, or else nothing works. That's serious.\n // Other errors are warnings, which raise the error in strict\n // mode, but otherwise continue on.\n if (er.name === 'CwdError') {\n this.emit('error', er)\n } else {\n this.warn('TAR_ENTRY_ERROR', er, { entry })\n this[UNPEND]()\n entry.resume()\n }\n }\n\n [MKDIR] (dir, mode, cb) {\n mkdir(normPath(dir), {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cache: this.dirCache,\n cwd: this.cwd,\n mode: mode,\n noChmod: this.noChmod,\n }, cb)\n }\n\n [DOCHOWN] (entry) {\n // in preserve owner mode, chown if the entry doesn't match process\n // in set owner mode, chown if setting doesn't match process\n return this.forceChown ||\n this.preserveOwner &&\n (typeof entry.uid === 'number' && entry.uid !== this.processUid ||\n typeof entry.gid === 'number' && entry.gid !== this.processGid)\n ||\n (typeof this.uid === 'number' && this.uid !== this.processUid ||\n typeof this.gid === 'number' && this.gid !== this.processGid)\n }\n\n [UID] (entry) {\n return uint32(this.uid, entry.uid, this.processUid)\n }\n\n [GID] (entry) {\n return uint32(this.gid, entry.gid, this.processGid)\n }\n\n [FILE] (entry, fullyDone) {\n const mode = entry.mode & 0o7777 || this.fmode\n const stream = new fsm.WriteStream(entry.absolute, {\n flags: getFlag(entry.size),\n mode: mode,\n autoClose: false,\n })\n stream.on('error', er => {\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n\n // flush all the data out so that we aren't left hanging\n // if the error wasn't actually fatal. otherwise the parse\n // is blocked, and we never proceed.\n stream.write = () => true\n this[ONERROR](er, entry)\n fullyDone()\n })\n\n let actions = 1\n const done = er => {\n if (er) {\n /* istanbul ignore else - we should always have a fd by now */\n if (stream.fd) {\n fs.close(stream.fd, () => {})\n }\n\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n if (--actions === 0) {\n fs.close(stream.fd, er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n }\n fullyDone()\n })\n }\n }\n\n stream.on('finish', _ => {\n // if futimes fails, try utimes\n // if utimes fails, fail with the original error\n // same for fchown/chown\n const abs = entry.absolute\n const fd = stream.fd\n\n if (entry.mtime && !this.noMtime) {\n actions++\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n fs.futimes(fd, atime, mtime, er =>\n er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er))\n : done())\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n fs.fchown(fd, uid, gid, er =>\n er ? fs.chown(abs, uid, gid, er2 => done(er2 && er))\n : done())\n }\n\n done()\n })\n\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', er => {\n this[ONERROR](er, entry)\n fullyDone()\n })\n entry.pipe(tx)\n }\n tx.pipe(stream)\n }\n\n [DIRECTORY] (entry, fullyDone) {\n const mode = entry.mode & 0o7777 || this.dmode\n this[MKDIR](entry.absolute, mode, er => {\n if (er) {\n this[ONERROR](er, entry)\n fullyDone()\n return\n }\n\n let actions = 1\n const done = _ => {\n if (--actions === 0) {\n fullyDone()\n this[UNPEND]()\n entry.resume()\n }\n }\n\n if (entry.mtime && !this.noMtime) {\n actions++\n fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done)\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done)\n }\n\n done()\n })\n }\n\n [UNSUPPORTED] (entry) {\n entry.unsupported = true\n this.warn('TAR_ENTRY_UNSUPPORTED',\n `unsupported entry type: ${entry.type}`, { entry })\n entry.resume()\n }\n\n [SYMLINK] (entry, done) {\n this[LINK](entry, entry.linkpath, 'symlink', done)\n }\n\n [HARDLINK] (entry, done) {\n const linkpath = normPath(path.resolve(this.cwd, entry.linkpath))\n this[LINK](entry, linkpath, 'link', done)\n }\n\n [PEND] () {\n this[PENDING]++\n }\n\n [UNPEND] () {\n this[PENDING]--\n this[MAYBECLOSE]()\n }\n\n [SKIP] (entry) {\n this[UNPEND]()\n entry.resume()\n }\n\n // Check if we can reuse an existing filesystem entry safely and\n // overwrite it, rather than unlinking and recreating\n // Windows doesn't report a useful nlink, so we just never reuse entries\n [ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n !isWindows\n }\n\n // check if a thing is there, and if so, try to clobber it\n [CHECKFS] (entry) {\n this[PEND]()\n const paths = [entry.path]\n if (entry.linkpath) {\n paths.push(entry.linkpath)\n }\n this.reservations.reserve(paths, done => this[CHECKFS2](entry, done))\n }\n\n [PRUNECACHE] (entry) {\n // if we are not creating a directory, and the path is in the dirCache,\n // then that means we are about to delete the directory we created\n // previously, and it is no longer going to be a directory, and neither\n // is any of its children.\n // If a symbolic link is encountered, all bets are off. There is no\n // reasonable way to sanitize the cache in such a way we will be able to\n // avoid having filesystem collisions. If this happens with a non-symlink\n // entry, it'll just fail to unpack, but a symlink to a directory, using an\n // 8.3 shortname or certain unicode attacks, can evade detection and lead\n // to arbitrary writes to anywhere on the system.\n if (entry.type === 'SymbolicLink') {\n dropCache(this.dirCache)\n } else if (entry.type !== 'Directory') {\n pruneCache(this.dirCache, entry.absolute)\n }\n }\n\n [CHECKFS2] (entry, fullyDone) {\n this[PRUNECACHE](entry)\n\n const done = er => {\n this[PRUNECACHE](entry)\n fullyDone(er)\n }\n\n const checkCwd = () => {\n this[MKDIR](this.cwd, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n this[CHECKED_CWD] = true\n start()\n })\n }\n\n const start = () => {\n if (entry.absolute !== this.cwd) {\n const parent = normPath(path.dirname(entry.absolute))\n if (parent !== this.cwd) {\n return this[MKDIR](parent, this.dmode, er => {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n afterMakeParent()\n })\n }\n }\n afterMakeParent()\n }\n\n const afterMakeParent = () => {\n fs.lstat(entry.absolute, (lstatEr, st) => {\n if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {\n this[SKIP](entry)\n done()\n return\n }\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry, done)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod = !this.noChmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const afterChmod = er => this[MAKEFS](er, entry, done)\n if (!needChmod) {\n return afterChmod()\n }\n return fs.chmod(entry.absolute, entry.mode, afterChmod)\n }\n // Not a dir entry, have to remove it.\n // NB: the only way to end up with an entry that is the cwd\n // itself, in such a way that == does not detect, is a\n // tricky windows absolute path with UNC or 8.3 parts (and\n // preservePaths:true, or else it will have been stripped).\n // In that case, the user has opted out of path protections\n // explicitly, so if they blow away the cwd, c'est la vie.\n if (entry.absolute !== this.cwd) {\n return fs.rmdir(entry.absolute, er =>\n this[MAKEFS](er, entry, done))\n }\n }\n\n // not a dir, and not reusable\n // don't remove if the cwd, we want that error\n if (entry.absolute === this.cwd) {\n return this[MAKEFS](null, entry, done)\n }\n\n unlinkFile(entry.absolute, er =>\n this[MAKEFS](er, entry, done))\n })\n }\n\n if (this[CHECKED_CWD]) {\n start()\n } else {\n checkCwd()\n }\n }\n\n [MAKEFS] (er, entry, done) {\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n\n switch (entry.type) {\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n return this[FILE](entry, done)\n\n case 'Link':\n return this[HARDLINK](entry, done)\n\n case 'SymbolicLink':\n return this[SYMLINK](entry, done)\n\n case 'Directory':\n case 'GNUDumpDir':\n return this[DIRECTORY](entry, done)\n }\n }\n\n [LINK] (entry, linkpath, link, done) {\n // XXX: get the type ('symlink' or 'junction') for windows\n fs[link](linkpath, entry.absolute, er => {\n if (er) {\n this[ONERROR](er, entry)\n } else {\n this[UNPEND]()\n entry.resume()\n }\n done()\n })\n }\n}\n\nconst callSync = fn => {\n try {\n return [null, fn()]\n } catch (er) {\n return [er, null]\n }\n}\nclass UnpackSync extends Unpack {\n [MAKEFS] (er, entry) {\n return super[MAKEFS](er, entry, () => {})\n }\n\n [CHECKFS] (entry) {\n this[PRUNECACHE](entry)\n\n if (!this[CHECKED_CWD]) {\n const er = this[MKDIR](this.cwd, this.dmode)\n if (er) {\n return this[ONERROR](er, entry)\n }\n this[CHECKED_CWD] = true\n }\n\n // don't bother to make the parent if the current entry is the cwd,\n // we've already checked it.\n if (entry.absolute !== this.cwd) {\n const parent = normPath(path.dirname(entry.absolute))\n if (parent !== this.cwd) {\n const mkParent = this[MKDIR](parent, this.dmode)\n if (mkParent) {\n return this[ONERROR](mkParent, entry)\n }\n }\n }\n\n const [lstatEr, st] = callSync(() => fs.lstatSync(entry.absolute))\n if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {\n return this[SKIP](entry)\n }\n\n if (lstatEr || this[ISREUSABLE](entry, st)) {\n return this[MAKEFS](null, entry)\n }\n\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n const needChmod = !this.noChmod &&\n entry.mode &&\n (st.mode & 0o7777) !== entry.mode\n const [er] = needChmod ? callSync(() => {\n fs.chmodSync(entry.absolute, entry.mode)\n }) : []\n return this[MAKEFS](er, entry)\n }\n // not a dir entry, have to remove it\n const [er] = callSync(() => fs.rmdirSync(entry.absolute))\n this[MAKEFS](er, entry)\n }\n\n // not a dir, and not reusable.\n // don't remove if it's the cwd, since we want that error.\n const [er] = entry.absolute === this.cwd ? []\n : callSync(() => unlinkFileSync(entry.absolute))\n this[MAKEFS](er, entry)\n }\n\n [FILE] (entry, done) {\n const mode = entry.mode & 0o7777 || this.fmode\n\n const oner = er => {\n let closeError\n try {\n fs.closeSync(fd)\n } catch (e) {\n closeError = e\n }\n if (er || closeError) {\n this[ONERROR](er || closeError, entry)\n }\n done()\n }\n\n let fd\n try {\n fd = fs.openSync(entry.absolute, getFlag(entry.size), mode)\n } catch (er) {\n return oner(er)\n }\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', er => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n\n tx.on('data', chunk => {\n try {\n fs.writeSync(fd, chunk, 0, chunk.length)\n } catch (er) {\n oner(er)\n }\n })\n\n tx.on('end', _ => {\n let er = null\n // try both, falling futimes back to utimes\n // if either fails, handle the first error\n if (entry.mtime && !this.noMtime) {\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n try {\n fs.futimesSync(fd, atime, mtime)\n } catch (futimeser) {\n try {\n fs.utimesSync(entry.absolute, atime, mtime)\n } catch (utimeser) {\n er = futimeser\n }\n }\n }\n\n if (this[DOCHOWN](entry)) {\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n\n try {\n fs.fchownSync(fd, uid, gid)\n } catch (fchowner) {\n try {\n fs.chownSync(entry.absolute, uid, gid)\n } catch (chowner) {\n er = er || fchowner\n }\n }\n }\n\n oner(er)\n })\n }\n\n [DIRECTORY] (entry, done) {\n const mode = entry.mode & 0o7777 || this.dmode\n const er = this[MKDIR](entry.absolute, mode)\n if (er) {\n this[ONERROR](er, entry)\n done()\n return\n }\n if (entry.mtime && !this.noMtime) {\n try {\n fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime)\n } catch (er) {}\n }\n if (this[DOCHOWN](entry)) {\n try {\n fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry))\n } catch (er) {}\n }\n done()\n entry.resume()\n }\n\n [MKDIR] (dir, mode) {\n try {\n return mkdir.sync(normPath(dir), {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cache: this.dirCache,\n cwd: this.cwd,\n mode: mode,\n })\n } catch (er) {\n return er\n }\n }\n\n [LINK] (entry, linkpath, link, done) {\n try {\n fs[link + 'Sync'](linkpath, entry.absolute)\n done()\n entry.resume()\n } catch (er) {\n return this[ONERROR](er, entry)\n }\n }\n}\n\nUnpack.Sync = UnpackSync\nmodule.exports = Unpack\n","'use strict'\n\n// tar -u\n\nconst hlo = require('./high-level-opt.js')\nconst r = require('./replace.js')\n// just call tar.r with the filter and mtimeCache\n\nmodule.exports = (opt_, files, cb) => {\n const opt = hlo(opt_)\n\n if (!opt.file) {\n throw new TypeError('file is required')\n }\n\n if (opt.gzip) {\n throw new TypeError('cannot append to compressed archives')\n }\n\n if (!files || !Array.isArray(files) || !files.length) {\n throw new TypeError('no files or directories specified')\n }\n\n files = Array.from(files)\n\n mtimeFilter(opt)\n return r(opt, files, cb)\n}\n\nconst mtimeFilter = opt => {\n const filter = opt.filter\n\n if (!opt.mtimeCache) {\n opt.mtimeCache = new Map()\n }\n\n opt.filter = filter ? (path, stat) =>\n filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime)\n : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime)\n}\n","'use strict'\nmodule.exports = Base => class extends Base {\n warn (code, message, data = {}) {\n if (this.file) {\n data.file = this.file\n }\n if (this.cwd) {\n data.cwd = this.cwd\n }\n data.code = message instanceof Error && message.code || code\n data.tarCode = code\n if (!this.strict && data.recoverable !== false) {\n if (message instanceof Error) {\n data = Object.assign(message, data)\n message = message.message\n }\n this.emit('warn', data.tarCode, message, data)\n } else if (message instanceof Error) {\n this.emit('error', Object.assign(message, data))\n } else {\n this.emit('error', Object.assign(new Error(`${code}: ${message}`), data))\n }\n }\n}\n","'use strict'\n\n// When writing files on Windows, translate the characters to their\n// 0xf000 higher-encoded versions.\n\nconst raw = [\n '|',\n '<',\n '>',\n '?',\n ':',\n]\n\nconst win = raw.map(char =>\n String.fromCharCode(0xf000 + char.charCodeAt(0)))\n\nconst toWin = new Map(raw.map((char, i) => [char, win[i]]))\nconst toRaw = new Map(win.map((char, i) => [char, raw[i]]))\n\nmodule.exports = {\n encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s),\n decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s),\n}\n","'use strict'\nconst { Minipass } = require('minipass')\nconst Pax = require('./pax.js')\nconst Header = require('./header.js')\nconst fs = require('fs')\nconst path = require('path')\nconst normPath = require('./normalize-windows-path.js')\nconst stripSlash = require('./strip-trailing-slashes.js')\n\nconst prefixPath = (path, prefix) => {\n if (!prefix) {\n return normPath(path)\n }\n path = normPath(path).replace(/^\\.(\\/|$)/, '')\n return stripSlash(prefix) + '/' + path\n}\n\nconst maxReadSize = 16 * 1024 * 1024\nconst PROCESS = Symbol('process')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst HEADER = Symbol('header')\nconst READ = Symbol('read')\nconst LSTAT = Symbol('lstat')\nconst ONLSTAT = Symbol('onlstat')\nconst ONREAD = Symbol('onread')\nconst ONREADLINK = Symbol('onreadlink')\nconst OPENFILE = Symbol('openfile')\nconst ONOPENFILE = Symbol('onopenfile')\nconst CLOSE = Symbol('close')\nconst MODE = Symbol('mode')\nconst AWAITDRAIN = Symbol('awaitDrain')\nconst ONDRAIN = Symbol('ondrain')\nconst PREFIX = Symbol('prefix')\nconst HAD_ERROR = Symbol('hadError')\nconst warner = require('./warn-mixin.js')\nconst winchars = require('./winchars.js')\nconst stripAbsolutePath = require('./strip-absolute-path.js')\n\nconst modeFix = require('./mode-fix.js')\n\nconst WriteEntry = warner(class WriteEntry extends Minipass {\n constructor (p, opt) {\n opt = opt || {}\n super(opt)\n if (typeof p !== 'string') {\n throw new TypeError('path is required')\n }\n this.path = normPath(p)\n // suppress atime, ctime, uid, gid, uname, gname\n this.portable = !!opt.portable\n // until node has builtin pwnam functions, this'll have to do\n this.myuid = process.getuid && process.getuid() || 0\n this.myuser = process.env.USER || ''\n this.maxReadSize = opt.maxReadSize || maxReadSize\n this.linkCache = opt.linkCache || new Map()\n this.statCache = opt.statCache || new Map()\n this.preservePaths = !!opt.preservePaths\n this.cwd = normPath(opt.cwd || process.cwd())\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.noMtime = !!opt.noMtime\n this.mtime = opt.mtime || null\n this.prefix = opt.prefix ? normPath(opt.prefix) : null\n\n this.fd = null\n this.blockLen = null\n this.blockRemain = null\n this.buf = null\n this.offset = null\n this.length = null\n this.pos = null\n this.remain = null\n\n if (typeof opt.onwarn === 'function') {\n this.on('warn', opt.onwarn)\n }\n\n let pathWarn = false\n if (!this.preservePaths) {\n const [root, stripped] = stripAbsolutePath(this.path)\n if (root) {\n this.path = stripped\n pathWarn = root\n }\n }\n\n this.win32 = !!opt.win32 || process.platform === 'win32'\n if (this.win32) {\n // force the \\ to / normalization, since we might not *actually*\n // be on windows, but want \\ to be considered a path separator.\n this.path = winchars.decode(this.path.replace(/\\\\/g, '/'))\n p = p.replace(/\\\\/g, '/')\n }\n\n this.absolute = normPath(opt.absolute || path.resolve(this.cwd, p))\n\n if (this.path === '') {\n this.path = './'\n }\n\n if (pathWarn) {\n this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {\n entry: this,\n path: pathWarn + this.path,\n })\n }\n\n if (this.statCache.has(this.absolute)) {\n this[ONLSTAT](this.statCache.get(this.absolute))\n } else {\n this[LSTAT]()\n }\n }\n\n emit (ev, ...data) {\n if (ev === 'error') {\n this[HAD_ERROR] = true\n }\n return super.emit(ev, ...data)\n }\n\n [LSTAT] () {\n fs.lstat(this.absolute, (er, stat) => {\n if (er) {\n return this.emit('error', er)\n }\n this[ONLSTAT](stat)\n })\n }\n\n [ONLSTAT] (stat) {\n this.statCache.set(this.absolute, stat)\n this.stat = stat\n if (!stat.isFile()) {\n stat.size = 0\n }\n this.type = getType(stat)\n this.emit('stat', stat)\n this[PROCESS]()\n }\n\n [PROCESS] () {\n switch (this.type) {\n case 'File': return this[FILE]()\n case 'Directory': return this[DIRECTORY]()\n case 'SymbolicLink': return this[SYMLINK]()\n // unsupported types are ignored.\n default: return this.end()\n }\n }\n\n [MODE] (mode) {\n return modeFix(mode, this.type === 'Directory', this.portable)\n }\n\n [PREFIX] (path) {\n return prefixPath(path, this.prefix)\n }\n\n [HEADER] () {\n if (this.type === 'Directory' && this.portable) {\n this.noMtime = true\n }\n\n this.header = new Header({\n path: this[PREFIX](this.path),\n // only apply the prefix to hard links.\n linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath)\n : this.linkpath,\n // only the permissions and setuid/setgid/sticky bitflags\n // not the higher-order bits that specify file type\n mode: this[MODE](this.stat.mode),\n uid: this.portable ? null : this.stat.uid,\n gid: this.portable ? null : this.stat.gid,\n size: this.stat.size,\n mtime: this.noMtime ? null : this.mtime || this.stat.mtime,\n type: this.type,\n uname: this.portable ? null :\n this.stat.uid === this.myuid ? this.myuser : '',\n atime: this.portable ? null : this.stat.atime,\n ctime: this.portable ? null : this.stat.ctime,\n })\n\n if (this.header.encode() && !this.noPax) {\n super.write(new Pax({\n atime: this.portable ? null : this.header.atime,\n ctime: this.portable ? null : this.header.ctime,\n gid: this.portable ? null : this.header.gid,\n mtime: this.noMtime ? null : this.mtime || this.header.mtime,\n path: this[PREFIX](this.path),\n linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath)\n : this.linkpath,\n size: this.header.size,\n uid: this.portable ? null : this.header.uid,\n uname: this.portable ? null : this.header.uname,\n dev: this.portable ? null : this.stat.dev,\n ino: this.portable ? null : this.stat.ino,\n nlink: this.portable ? null : this.stat.nlink,\n }).encode())\n }\n super.write(this.header.block)\n }\n\n [DIRECTORY] () {\n if (this.path.slice(-1) !== '/') {\n this.path += '/'\n }\n this.stat.size = 0\n this[HEADER]()\n this.end()\n }\n\n [SYMLINK] () {\n fs.readlink(this.absolute, (er, linkpath) => {\n if (er) {\n return this.emit('error', er)\n }\n this[ONREADLINK](linkpath)\n })\n }\n\n [ONREADLINK] (linkpath) {\n this.linkpath = normPath(linkpath)\n this[HEADER]()\n this.end()\n }\n\n [HARDLINK] (linkpath) {\n this.type = 'Link'\n this.linkpath = normPath(path.relative(this.cwd, linkpath))\n this.stat.size = 0\n this[HEADER]()\n this.end()\n }\n\n [FILE] () {\n if (this.stat.nlink > 1) {\n const linkKey = this.stat.dev + ':' + this.stat.ino\n if (this.linkCache.has(linkKey)) {\n const linkpath = this.linkCache.get(linkKey)\n if (linkpath.indexOf(this.cwd) === 0) {\n return this[HARDLINK](linkpath)\n }\n }\n this.linkCache.set(linkKey, this.absolute)\n }\n\n this[HEADER]()\n if (this.stat.size === 0) {\n return this.end()\n }\n\n this[OPENFILE]()\n }\n\n [OPENFILE] () {\n fs.open(this.absolute, 'r', (er, fd) => {\n if (er) {\n return this.emit('error', er)\n }\n this[ONOPENFILE](fd)\n })\n }\n\n [ONOPENFILE] (fd) {\n this.fd = fd\n if (this[HAD_ERROR]) {\n return this[CLOSE]()\n }\n\n this.blockLen = 512 * Math.ceil(this.stat.size / 512)\n this.blockRemain = this.blockLen\n const bufLen = Math.min(this.blockLen, this.maxReadSize)\n this.buf = Buffer.allocUnsafe(bufLen)\n this.offset = 0\n this.pos = 0\n this.remain = this.stat.size\n this.length = this.buf.length\n this[READ]()\n }\n\n [READ] () {\n const { fd, buf, offset, length, pos } = this\n fs.read(fd, buf, offset, length, pos, (er, bytesRead) => {\n if (er) {\n // ignoring the error from close(2) is a bad practice, but at\n // this point we already have an error, don't need another one\n return this[CLOSE](() => this.emit('error', er))\n }\n this[ONREAD](bytesRead)\n })\n }\n\n [CLOSE] (cb) {\n fs.close(this.fd, cb)\n }\n\n [ONREAD] (bytesRead) {\n if (bytesRead <= 0 && this.remain > 0) {\n const er = new Error('encountered unexpected EOF')\n er.path = this.absolute\n er.syscall = 'read'\n er.code = 'EOF'\n return this[CLOSE](() => this.emit('error', er))\n }\n\n if (bytesRead > this.remain) {\n const er = new Error('did not encounter expected EOF')\n er.path = this.absolute\n er.syscall = 'read'\n er.code = 'EOF'\n return this[CLOSE](() => this.emit('error', er))\n }\n\n // null out the rest of the buffer, if we could fit the block padding\n // at the end of this loop, we've incremented bytesRead and this.remain\n // to be incremented up to the blockRemain level, as if we had expected\n // to get a null-padded file, and read it until the end. then we will\n // decrement both remain and blockRemain by bytesRead, and know that we\n // reached the expected EOF, without any null buffer to append.\n if (bytesRead === this.remain) {\n for (let i = bytesRead; i < this.length && bytesRead < this.blockRemain; i++) {\n this.buf[i + this.offset] = 0\n bytesRead++\n this.remain++\n }\n }\n\n const writeBuf = this.offset === 0 && bytesRead === this.buf.length ?\n this.buf : this.buf.slice(this.offset, this.offset + bytesRead)\n\n const flushed = this.write(writeBuf)\n if (!flushed) {\n this[AWAITDRAIN](() => this[ONDRAIN]())\n } else {\n this[ONDRAIN]()\n }\n }\n\n [AWAITDRAIN] (cb) {\n this.once('drain', cb)\n }\n\n write (writeBuf) {\n if (this.blockRemain < writeBuf.length) {\n const er = new Error('writing more data than expected')\n er.path = this.absolute\n return this.emit('error', er)\n }\n this.remain -= writeBuf.length\n this.blockRemain -= writeBuf.length\n this.pos += writeBuf.length\n this.offset += writeBuf.length\n return super.write(writeBuf)\n }\n\n [ONDRAIN] () {\n if (!this.remain) {\n if (this.blockRemain) {\n super.write(Buffer.alloc(this.blockRemain))\n }\n return this[CLOSE](er => er ? this.emit('error', er) : this.end())\n }\n\n if (this.offset >= this.length) {\n // if we only have a smaller bit left to read, alloc a smaller buffer\n // otherwise, keep it the same length it was before.\n this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length))\n this.offset = 0\n }\n this.length = this.buf.length - this.offset\n this[READ]()\n }\n})\n\nclass WriteEntrySync extends WriteEntry {\n [LSTAT] () {\n this[ONLSTAT](fs.lstatSync(this.absolute))\n }\n\n [SYMLINK] () {\n this[ONREADLINK](fs.readlinkSync(this.absolute))\n }\n\n [OPENFILE] () {\n this[ONOPENFILE](fs.openSync(this.absolute, 'r'))\n }\n\n [READ] () {\n let threw = true\n try {\n const { fd, buf, offset, length, pos } = this\n const bytesRead = fs.readSync(fd, buf, offset, length, pos)\n this[ONREAD](bytesRead)\n threw = false\n } finally {\n // ignoring the error from close(2) is a bad practice, but at\n // this point we already have an error, don't need another one\n if (threw) {\n try {\n this[CLOSE](() => {})\n } catch (er) {}\n }\n }\n }\n\n [AWAITDRAIN] (cb) {\n cb()\n }\n\n [CLOSE] (cb) {\n fs.closeSync(this.fd)\n cb()\n }\n}\n\nconst WriteEntryTar = warner(class WriteEntryTar extends Minipass {\n constructor (readEntry, opt) {\n opt = opt || {}\n super(opt)\n this.preservePaths = !!opt.preservePaths\n this.portable = !!opt.portable\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.noMtime = !!opt.noMtime\n\n this.readEntry = readEntry\n this.type = readEntry.type\n if (this.type === 'Directory' && this.portable) {\n this.noMtime = true\n }\n\n this.prefix = opt.prefix || null\n\n this.path = normPath(readEntry.path)\n this.mode = this[MODE](readEntry.mode)\n this.uid = this.portable ? null : readEntry.uid\n this.gid = this.portable ? null : readEntry.gid\n this.uname = this.portable ? null : readEntry.uname\n this.gname = this.portable ? null : readEntry.gname\n this.size = readEntry.size\n this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime\n this.atime = this.portable ? null : readEntry.atime\n this.ctime = this.portable ? null : readEntry.ctime\n this.linkpath = normPath(readEntry.linkpath)\n\n if (typeof opt.onwarn === 'function') {\n this.on('warn', opt.onwarn)\n }\n\n let pathWarn = false\n if (!this.preservePaths) {\n const [root, stripped] = stripAbsolutePath(this.path)\n if (root) {\n this.path = stripped\n pathWarn = root\n }\n }\n\n this.remain = readEntry.size\n this.blockRemain = readEntry.startBlockSize\n\n this.header = new Header({\n path: this[PREFIX](this.path),\n linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath)\n : this.linkpath,\n // only the permissions and setuid/setgid/sticky bitflags\n // not the higher-order bits that specify file type\n mode: this.mode,\n uid: this.portable ? null : this.uid,\n gid: this.portable ? null : this.gid,\n size: this.size,\n mtime: this.noMtime ? null : this.mtime,\n type: this.type,\n uname: this.portable ? null : this.uname,\n atime: this.portable ? null : this.atime,\n ctime: this.portable ? null : this.ctime,\n })\n\n if (pathWarn) {\n this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {\n entry: this,\n path: pathWarn + this.path,\n })\n }\n\n if (this.header.encode() && !this.noPax) {\n super.write(new Pax({\n atime: this.portable ? null : this.atime,\n ctime: this.portable ? null : this.ctime,\n gid: this.portable ? null : this.gid,\n mtime: this.noMtime ? null : this.mtime,\n path: this[PREFIX](this.path),\n linkpath: this.type === 'Link' ? this[PREFIX](this.linkpath)\n : this.linkpath,\n size: this.size,\n uid: this.portable ? null : this.uid,\n uname: this.portable ? null : this.uname,\n dev: this.portable ? null : this.readEntry.dev,\n ino: this.portable ? null : this.readEntry.ino,\n nlink: this.portable ? null : this.readEntry.nlink,\n }).encode())\n }\n\n super.write(this.header.block)\n readEntry.pipe(this)\n }\n\n [PREFIX] (path) {\n return prefixPath(path, this.prefix)\n }\n\n [MODE] (mode) {\n return modeFix(mode, this.type === 'Directory', this.portable)\n }\n\n write (data) {\n const writeLen = data.length\n if (writeLen > this.blockRemain) {\n throw new Error('writing more to entry than is appropriate')\n }\n this.blockRemain -= writeLen\n return super.write(data)\n }\n\n end () {\n if (this.blockRemain) {\n super.write(Buffer.alloc(this.blockRemain))\n }\n return super.end()\n }\n})\n\nWriteEntry.Sync = WriteEntrySync\nWriteEntry.Tar = WriteEntryTar\n\nconst getType = stat =>\n stat.isFile() ? 'File'\n : stat.isDirectory() ? 'Directory'\n : stat.isSymbolicLink() ? 'SymbolicLink'\n : 'Unsupported'\n\nmodule.exports = WriteEntry\n","'use strict'\nconst proc =\n typeof process === 'object' && process\n ? process\n : {\n stdout: null,\n stderr: null,\n }\nconst EE = require('events')\nconst Stream = require('stream')\nconst stringdecoder = require('string_decoder')\nconst SD = stringdecoder.StringDecoder\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst EMITTED_ERROR = Symbol('emittedError')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFER = Symbol('buffer')\nconst PIPES = Symbol('pipes')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\n// internal event when stream is destroyed\nconst DESTROYED = Symbol('destroyed')\n// internal event when stream has an error\nconst ERROR = Symbol('error')\nconst EMITDATA = Symbol('emitData')\nconst EMITEND = Symbol('emitEnd')\nconst EMITEND2 = Symbol('emitEnd2')\nconst ASYNC = Symbol('async')\nconst ABORT = Symbol('abort')\nconst ABORTED = Symbol('aborted')\nconst SIGNAL = Symbol('signal')\n\nconst defer = fn => Promise.resolve().then(fn)\n\n// TODO remove when Node v8 support drops\nconst doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1'\nconst ASYNCITERATOR =\n (doIter && Symbol.asyncIterator) || Symbol('asyncIterator not implemented')\nconst ITERATOR =\n (doIter && Symbol.iterator) || Symbol('iterator not implemented')\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\nconst isEndish = ev => ev === 'end' || ev === 'finish' || ev === 'prefinish'\n\nconst isArrayBuffer = b =>\n b instanceof ArrayBuffer ||\n (typeof b === 'object' &&\n b.constructor &&\n b.constructor.name === 'ArrayBuffer' &&\n b.byteLength >= 0)\n\nconst isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\nclass Pipe {\n constructor(src, dest, opts) {\n this.src = src\n this.dest = dest\n this.opts = opts\n this.ondrain = () => src[RESUME]()\n dest.on('drain', this.ondrain)\n }\n unpipe() {\n this.dest.removeListener('drain', this.ondrain)\n }\n // istanbul ignore next - only here for the prototype\n proxyErrors() {}\n end() {\n this.unpipe()\n if (this.opts.end) this.dest.end()\n }\n}\n\nclass PipeProxyErrors extends Pipe {\n unpipe() {\n this.src.removeListener('error', this.proxyErrors)\n super.unpipe()\n }\n constructor(src, dest, opts) {\n super(src, dest, opts)\n this.proxyErrors = er => dest.emit('error', er)\n src.on('error', this.proxyErrors)\n }\n}\n\nclass Minipass extends Stream {\n constructor(options) {\n super()\n this[FLOWING] = false\n // whether we're explicitly paused\n this[PAUSED] = false\n this[PIPES] = []\n this[BUFFER] = []\n this[OBJECTMODE] = (options && options.objectMode) || false\n if (this[OBJECTMODE]) this[ENCODING] = null\n else this[ENCODING] = (options && options.encoding) || null\n if (this[ENCODING] === 'buffer') this[ENCODING] = null\n this[ASYNC] = (options && !!options.async) || false\n this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null\n this[EOF] = false\n this[EMITTED_END] = false\n this[EMITTING_END] = false\n this[CLOSED] = false\n this[EMITTED_ERROR] = null\n this.writable = true\n this.readable = true\n this[BUFFERLENGTH] = 0\n this[DESTROYED] = false\n if (options && options.debugExposeBuffer === true) {\n Object.defineProperty(this, 'buffer', { get: () => this[BUFFER] })\n }\n if (options && options.debugExposePipes === true) {\n Object.defineProperty(this, 'pipes', { get: () => this[PIPES] })\n }\n this[SIGNAL] = options && options.signal\n this[ABORTED] = false\n if (this[SIGNAL]) {\n this[SIGNAL].addEventListener('abort', () => this[ABORT]())\n if (this[SIGNAL].aborted) {\n this[ABORT]()\n }\n }\n }\n\n get bufferLength() {\n return this[BUFFERLENGTH]\n }\n\n get encoding() {\n return this[ENCODING]\n }\n set encoding(enc) {\n if (this[OBJECTMODE]) throw new Error('cannot set encoding in objectMode')\n\n if (\n this[ENCODING] &&\n enc !== this[ENCODING] &&\n ((this[DECODER] && this[DECODER].lastNeed) || this[BUFFERLENGTH])\n )\n throw new Error('cannot change encoding')\n\n if (this[ENCODING] !== enc) {\n this[DECODER] = enc ? new SD(enc) : null\n if (this[BUFFER].length)\n this[BUFFER] = this[BUFFER].map(chunk => this[DECODER].write(chunk))\n }\n\n this[ENCODING] = enc\n }\n\n setEncoding(enc) {\n this.encoding = enc\n }\n\n get objectMode() {\n return this[OBJECTMODE]\n }\n set objectMode(om) {\n this[OBJECTMODE] = this[OBJECTMODE] || !!om\n }\n\n get ['async']() {\n return this[ASYNC]\n }\n set ['async'](a) {\n this[ASYNC] = this[ASYNC] || !!a\n }\n\n // drop everything and get out of the flow completely\n [ABORT]() {\n this[ABORTED] = true\n this.emit('abort', this[SIGNAL].reason)\n this.destroy(this[SIGNAL].reason)\n }\n\n get aborted() {\n return this[ABORTED]\n }\n set aborted(_) {}\n\n write(chunk, encoding, cb) {\n if (this[ABORTED]) return false\n if (this[EOF]) throw new Error('write after end')\n\n if (this[DESTROYED]) {\n this.emit(\n 'error',\n Object.assign(\n new Error('Cannot call write after a stream was destroyed'),\n { code: 'ERR_STREAM_DESTROYED' }\n )\n )\n return true\n }\n\n if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8')\n\n if (!encoding) encoding = 'utf8'\n\n const fn = this[ASYNC] ? defer : f => f()\n\n // convert array buffers and typed array views into buffers\n // at some point in the future, we may want to do the opposite!\n // leave strings and buffers as-is\n // anything else switches us into object mode\n if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n if (isArrayBufferView(chunk))\n chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n else if (isArrayBuffer(chunk)) chunk = Buffer.from(chunk)\n else if (typeof chunk !== 'string')\n // use the setter so we throw if we have encoding set\n this.objectMode = true\n }\n\n // handle object mode up front, since it's simpler\n // this yields better performance, fewer checks later.\n if (this[OBJECTMODE]) {\n /* istanbul ignore if - maybe impossible? */\n if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n if (this.flowing) this.emit('data', chunk)\n else this[BUFFERPUSH](chunk)\n\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n if (cb) fn(cb)\n\n return this.flowing\n }\n\n // at this point the chunk is a buffer or string\n // don't buffer it up or send it to the decoder\n if (!chunk.length) {\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n if (cb) fn(cb)\n return this.flowing\n }\n\n // fast-path writing strings of same encoding to a stream with\n // an empty buffer, skipping the buffer/decoder dance\n if (\n typeof chunk === 'string' &&\n // unless it is a string already ready for us to use\n !(encoding === this[ENCODING] && !this[DECODER].lastNeed)\n ) {\n chunk = Buffer.from(chunk, encoding)\n }\n\n if (Buffer.isBuffer(chunk) && this[ENCODING])\n chunk = this[DECODER].write(chunk)\n\n // Note: flushing CAN potentially switch us into not-flowing mode\n if (this.flowing && this[BUFFERLENGTH] !== 0) this[FLUSH](true)\n\n if (this.flowing) this.emit('data', chunk)\n else this[BUFFERPUSH](chunk)\n\n if (this[BUFFERLENGTH] !== 0) this.emit('readable')\n\n if (cb) fn(cb)\n\n return this.flowing\n }\n\n read(n) {\n if (this[DESTROYED]) return null\n\n if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH]) {\n this[MAYBE_EMIT_END]()\n return null\n }\n\n if (this[OBJECTMODE]) n = null\n\n if (this[BUFFER].length > 1 && !this[OBJECTMODE]) {\n if (this.encoding) this[BUFFER] = [this[BUFFER].join('')]\n else this[BUFFER] = [Buffer.concat(this[BUFFER], this[BUFFERLENGTH])]\n }\n\n const ret = this[READ](n || null, this[BUFFER][0])\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [READ](n, chunk) {\n if (n === chunk.length || n === null) this[BUFFERSHIFT]()\n else {\n this[BUFFER][0] = chunk.slice(n)\n chunk = chunk.slice(0, n)\n this[BUFFERLENGTH] -= n\n }\n\n this.emit('data', chunk)\n\n if (!this[BUFFER].length && !this[EOF]) this.emit('drain')\n\n return chunk\n }\n\n end(chunk, encoding, cb) {\n if (typeof chunk === 'function') (cb = chunk), (chunk = null)\n if (typeof encoding === 'function') (cb = encoding), (encoding = 'utf8')\n if (chunk) this.write(chunk, encoding)\n if (cb) this.once('end', cb)\n this[EOF] = true\n this.writable = false\n\n // if we haven't written anything, then go ahead and emit,\n // even if we're not reading.\n // we'll re-emit if a new 'end' listener is added anyway.\n // This makes MP more suitable to write-only use cases.\n if (this.flowing || !this[PAUSED]) this[MAYBE_EMIT_END]()\n return this\n }\n\n // don't let the internal resume be overwritten\n [RESUME]() {\n if (this[DESTROYED]) return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this[BUFFER].length) this[FLUSH]()\n else if (this[EOF]) this[MAYBE_EMIT_END]()\n else this.emit('drain')\n }\n\n resume() {\n return this[RESUME]()\n }\n\n pause() {\n this[FLOWING] = false\n this[PAUSED] = true\n }\n\n get destroyed() {\n return this[DESTROYED]\n }\n\n get flowing() {\n return this[FLOWING]\n }\n\n get paused() {\n return this[PAUSED]\n }\n\n [BUFFERPUSH](chunk) {\n if (this[OBJECTMODE]) this[BUFFERLENGTH] += 1\n else this[BUFFERLENGTH] += chunk.length\n this[BUFFER].push(chunk)\n }\n\n [BUFFERSHIFT]() {\n if (this[OBJECTMODE]) this[BUFFERLENGTH] -= 1\n else this[BUFFERLENGTH] -= this[BUFFER][0].length\n return this[BUFFER].shift()\n }\n\n [FLUSH](noDrain) {\n do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length)\n\n if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit('drain')\n }\n\n [FLUSHCHUNK](chunk) {\n this.emit('data', chunk)\n return this.flowing\n }\n\n pipe(dest, opts) {\n if (this[DESTROYED]) return\n\n const ended = this[EMITTED_END]\n opts = opts || {}\n if (dest === proc.stdout || dest === proc.stderr) opts.end = false\n else opts.end = opts.end !== false\n opts.proxyErrors = !!opts.proxyErrors\n\n // piping an ended stream ends immediately\n if (ended) {\n if (opts.end) dest.end()\n } else {\n this[PIPES].push(\n !opts.proxyErrors\n ? new Pipe(this, dest, opts)\n : new PipeProxyErrors(this, dest, opts)\n )\n if (this[ASYNC]) defer(() => this[RESUME]())\n else this[RESUME]()\n }\n\n return dest\n }\n\n unpipe(dest) {\n const p = this[PIPES].find(p => p.dest === dest)\n if (p) {\n this[PIPES].splice(this[PIPES].indexOf(p), 1)\n p.unpipe()\n }\n }\n\n addListener(ev, fn) {\n return this.on(ev, fn)\n }\n\n on(ev, fn) {\n const ret = super.on(ev, fn)\n if (ev === 'data' && !this[PIPES].length && !this.flowing) this[RESUME]()\n else if (ev === 'readable' && this[BUFFERLENGTH] !== 0)\n super.emit('readable')\n else if (isEndish(ev) && this[EMITTED_END]) {\n super.emit(ev)\n this.removeAllListeners(ev)\n } else if (ev === 'error' && this[EMITTED_ERROR]) {\n if (this[ASYNC]) defer(() => fn.call(this, this[EMITTED_ERROR]))\n else fn.call(this, this[EMITTED_ERROR])\n }\n return ret\n }\n\n get emittedEnd() {\n return this[EMITTED_END]\n }\n\n [MAYBE_EMIT_END]() {\n if (\n !this[EMITTING_END] &&\n !this[EMITTED_END] &&\n !this[DESTROYED] &&\n this[BUFFER].length === 0 &&\n this[EOF]\n ) {\n this[EMITTING_END] = true\n this.emit('end')\n this.emit('prefinish')\n this.emit('finish')\n if (this[CLOSED]) this.emit('close')\n this[EMITTING_END] = false\n }\n }\n\n emit(ev, data, ...extra) {\n // error and close are only events allowed after calling destroy()\n if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED])\n return\n else if (ev === 'data') {\n return !this[OBJECTMODE] && !data\n ? false\n : this[ASYNC]\n ? defer(() => this[EMITDATA](data))\n : this[EMITDATA](data)\n } else if (ev === 'end') {\n return this[EMITEND]()\n } else if (ev === 'close') {\n this[CLOSED] = true\n // don't emit close before 'end' and 'finish'\n if (!this[EMITTED_END] && !this[DESTROYED]) return\n const ret = super.emit('close')\n this.removeAllListeners('close')\n return ret\n } else if (ev === 'error') {\n this[EMITTED_ERROR] = data\n super.emit(ERROR, data)\n const ret =\n !this[SIGNAL] || this.listeners('error').length\n ? super.emit('error', data)\n : false\n this[MAYBE_EMIT_END]()\n return ret\n } else if (ev === 'resume') {\n const ret = super.emit('resume')\n this[MAYBE_EMIT_END]()\n return ret\n } else if (ev === 'finish' || ev === 'prefinish') {\n const ret = super.emit(ev)\n this.removeAllListeners(ev)\n return ret\n }\n\n // Some other unknown event\n const ret = super.emit(ev, data, ...extra)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [EMITDATA](data) {\n for (const p of this[PIPES]) {\n if (p.dest.write(data) === false) this.pause()\n }\n const ret = super.emit('data', data)\n this[MAYBE_EMIT_END]()\n return ret\n }\n\n [EMITEND]() {\n if (this[EMITTED_END]) return\n\n this[EMITTED_END] = true\n this.readable = false\n if (this[ASYNC]) defer(() => this[EMITEND2]())\n else this[EMITEND2]()\n }\n\n [EMITEND2]() {\n if (this[DECODER]) {\n const data = this[DECODER].end()\n if (data) {\n for (const p of this[PIPES]) {\n p.dest.write(data)\n }\n super.emit('data', data)\n }\n }\n\n for (const p of this[PIPES]) {\n p.end()\n }\n const ret = super.emit('end')\n this.removeAllListeners('end')\n return ret\n }\n\n // const all = await stream.collect()\n collect() {\n const buf = []\n if (!this[OBJECTMODE]) buf.dataLength = 0\n // set the promise first, in case an error is raised\n // by triggering the flow here.\n const p = this.promise()\n this.on('data', c => {\n buf.push(c)\n if (!this[OBJECTMODE]) buf.dataLength += c.length\n })\n return p.then(() => buf)\n }\n\n // const data = await stream.concat()\n concat() {\n return this[OBJECTMODE]\n ? Promise.reject(new Error('cannot concat in objectMode'))\n : this.collect().then(buf =>\n this[OBJECTMODE]\n ? Promise.reject(new Error('cannot concat in objectMode'))\n : this[ENCODING]\n ? buf.join('')\n : Buffer.concat(buf, buf.dataLength)\n )\n }\n\n // stream.promise().then(() => done, er => emitted error)\n promise() {\n return new Promise((resolve, reject) => {\n this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n this.on('error', er => reject(er))\n this.on('end', () => resolve())\n })\n }\n\n // for await (let chunk of stream)\n [ASYNCITERATOR]() {\n let stopped = false\n const stop = () => {\n this.pause()\n stopped = true\n return Promise.resolve({ done: true })\n }\n const next = () => {\n if (stopped) return stop()\n const res = this.read()\n if (res !== null) return Promise.resolve({ done: false, value: res })\n\n if (this[EOF]) return stop()\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n this.removeListener(DESTROYED, ondestroy)\n stop()\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.removeListener(DESTROYED, ondestroy)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n this.removeListener(DESTROYED, ondestroy)\n stop()\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return {\n next,\n throw: stop,\n return: stop,\n [ASYNCITERATOR]() {\n return this\n },\n }\n }\n\n // for (let chunk of stream)\n [ITERATOR]() {\n let stopped = false\n const stop = () => {\n this.pause()\n this.removeListener(ERROR, stop)\n this.removeListener(DESTROYED, stop)\n this.removeListener('end', stop)\n stopped = true\n return { done: true }\n }\n\n const next = () => {\n if (stopped) return stop()\n const value = this.read()\n return value === null ? stop() : { value }\n }\n this.once('end', stop)\n this.once(ERROR, stop)\n this.once(DESTROYED, stop)\n\n return {\n next,\n throw: stop,\n return: stop,\n [ITERATOR]() {\n return this\n },\n }\n }\n\n destroy(er) {\n if (this[DESTROYED]) {\n if (er) this.emit('error', er)\n else this.emit(DESTROYED)\n return this\n }\n\n this[DESTROYED] = true\n\n // throw away all buffered data, it's never coming out\n this[BUFFER].length = 0\n this[BUFFERLENGTH] = 0\n\n if (typeof this.close === 'function' && !this[CLOSED]) this.close()\n\n if (er) this.emit('error', er)\n // if no error to emit, still reject pending promises\n else this.emit(DESTROYED)\n\n return this\n }\n\n static isStream(s) {\n return (\n !!s &&\n (s instanceof Minipass ||\n s instanceof Stream ||\n (s instanceof EE &&\n // readable\n (typeof s.pipe === 'function' ||\n // writable\n (typeof s.write === 'function' && typeof s.end === 'function'))))\n )\n }\n}\n\nexports.Minipass = Minipass\n","'use strict';\n\nconst { promisify } = require(\"util\");\nconst tmp = require(\"tmp\");\n\n// file\nmodule.exports.fileSync = tmp.fileSync;\nconst fileWithOptions = promisify((options, cb) =>\n tmp.file(options, (err, path, fd, cleanup) =>\n err ? cb(err) : cb(undefined, { path, fd, cleanup: promisify(cleanup) })\n )\n);\nmodule.exports.file = async (options) => fileWithOptions(options);\n\nmodule.exports.withFile = async function withFile(fn, options) {\n const { path, fd, cleanup } = await module.exports.file(options);\n try {\n return await fn({ path, fd });\n } finally {\n await cleanup();\n }\n};\n\n\n// directory\nmodule.exports.dirSync = tmp.dirSync;\nconst dirWithOptions = promisify((options, cb) =>\n tmp.dir(options, (err, path, cleanup) =>\n err ? cb(err) : cb(undefined, { path, cleanup: promisify(cleanup) })\n )\n);\nmodule.exports.dir = async (options) => dirWithOptions(options);\n\nmodule.exports.withDir = async function withDir(fn, options) {\n const { path, cleanup } = await module.exports.dir(options);\n try {\n return await fn({ path });\n } finally {\n await cleanup();\n }\n};\n\n\n// name generation\nmodule.exports.tmpNameSync = tmp.tmpNameSync;\nmodule.exports.tmpName = promisify(tmp.tmpName);\n\nmodule.exports.tmpdir = tmp.tmpdir;\n\nmodule.exports.setGracefulCleanup = tmp.setGracefulCleanup;\n","/*!\n * Tmp\n *\n * Copyright (c) 2011-2017 KARASZI Istvan \n *\n * MIT Licensed\n */\n\n/*\n * Module dependencies.\n */\nconst fs = require('fs');\nconst os = require('os');\nconst path = require('path');\nconst crypto = require('crypto');\nconst _c = { fs: fs.constants, os: os.constants };\nconst rimraf = require('rimraf');\n\n/*\n * The working inner variables.\n */\nconst\n // the random characters to choose from\n RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',\n\n TEMPLATE_PATTERN = /XXXXXX/,\n\n DEFAULT_TRIES = 3,\n\n CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR),\n\n // constants are off on the windows platform and will not match the actual errno codes\n IS_WIN32 = os.platform() === 'win32',\n EBADF = _c.EBADF || _c.os.errno.EBADF,\n ENOENT = _c.ENOENT || _c.os.errno.ENOENT,\n\n DIR_MODE = 0o700 /* 448 */,\n FILE_MODE = 0o600 /* 384 */,\n\n EXIT = 'exit',\n\n // this will hold the objects need to be removed on exit\n _removeObjects = [],\n\n // API change in fs.rmdirSync leads to error when passing in a second parameter, e.g. the callback\n FN_RMDIR_SYNC = fs.rmdirSync.bind(fs),\n FN_RIMRAF_SYNC = rimraf.sync;\n\nlet\n _gracefulCleanup = false;\n\n/**\n * Gets a temporary file name.\n *\n * @param {(Options|tmpNameCallback)} options options or callback\n * @param {?tmpNameCallback} callback the callback function\n */\nfunction tmpName(options, callback) {\n const\n args = _parseArguments(options, callback),\n opts = args[0],\n cb = args[1];\n\n try {\n _assertAndSanitizeOptions(opts);\n } catch (err) {\n return cb(err);\n }\n\n let tries = opts.tries;\n (function _getUniqueName() {\n try {\n const name = _generateTmpName(opts);\n\n // check whether the path exists then retry if needed\n fs.stat(name, function (err) {\n /* istanbul ignore else */\n if (!err) {\n /* istanbul ignore else */\n if (tries-- > 0) return _getUniqueName();\n\n return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name));\n }\n\n cb(null, name);\n });\n } catch (err) {\n cb(err);\n }\n }());\n}\n\n/**\n * Synchronous version of tmpName.\n *\n * @param {Object} options\n * @returns {string} the generated random name\n * @throws {Error} if the options are invalid or could not generate a filename\n */\nfunction tmpNameSync(options) {\n const\n args = _parseArguments(options),\n opts = args[0];\n\n _assertAndSanitizeOptions(opts);\n\n let tries = opts.tries;\n do {\n const name = _generateTmpName(opts);\n try {\n fs.statSync(name);\n } catch (e) {\n return name;\n }\n } while (tries-- > 0);\n\n throw new Error('Could not get a unique tmp filename, max tries reached');\n}\n\n/**\n * Creates and opens a temporary file.\n *\n * @param {(Options|null|undefined|fileCallback)} options the config options or the callback function or null or undefined\n * @param {?fileCallback} callback\n */\nfunction file(options, callback) {\n const\n args = _parseArguments(options, callback),\n opts = args[0],\n cb = args[1];\n\n // gets a temporary filename\n tmpName(opts, function _tmpNameCreated(err, name) {\n /* istanbul ignore else */\n if (err) return cb(err);\n\n // create and open the file\n fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) {\n /* istanbu ignore else */\n if (err) return cb(err);\n\n if (opts.discardDescriptor) {\n return fs.close(fd, function _discardCallback(possibleErr) {\n // the chance of getting an error on close here is rather low and might occur in the most edgiest cases only\n return cb(possibleErr, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts, false));\n });\n } else {\n // detachDescriptor passes the descriptor whereas discardDescriptor closes it, either way, we no longer care\n // about the descriptor\n const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;\n cb(null, name, fd, _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, false));\n }\n });\n });\n}\n\n/**\n * Synchronous version of file.\n *\n * @param {Options} options\n * @returns {FileSyncObject} object consists of name, fd and removeCallback\n * @throws {Error} if cannot create a file\n */\nfunction fileSync(options) {\n const\n args = _parseArguments(options),\n opts = args[0];\n\n const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;\n const name = tmpNameSync(opts);\n var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);\n /* istanbul ignore else */\n if (opts.discardDescriptor) {\n fs.closeSync(fd);\n fd = undefined;\n }\n\n return {\n name: name,\n fd: fd,\n removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts, true)\n };\n}\n\n/**\n * Creates a temporary directory.\n *\n * @param {(Options|dirCallback)} options the options or the callback function\n * @param {?dirCallback} callback\n */\nfunction dir(options, callback) {\n const\n args = _parseArguments(options, callback),\n opts = args[0],\n cb = args[1];\n\n // gets a temporary filename\n tmpName(opts, function _tmpNameCreated(err, name) {\n /* istanbul ignore else */\n if (err) return cb(err);\n\n // create the directory\n fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) {\n /* istanbul ignore else */\n if (err) return cb(err);\n\n cb(null, name, _prepareTmpDirRemoveCallback(name, opts, false));\n });\n });\n}\n\n/**\n * Synchronous version of dir.\n *\n * @param {Options} options\n * @returns {DirSyncObject} object consists of name and removeCallback\n * @throws {Error} if it cannot create a directory\n */\nfunction dirSync(options) {\n const\n args = _parseArguments(options),\n opts = args[0];\n\n const name = tmpNameSync(opts);\n fs.mkdirSync(name, opts.mode || DIR_MODE);\n\n return {\n name: name,\n removeCallback: _prepareTmpDirRemoveCallback(name, opts, true)\n };\n}\n\n/**\n * Removes files asynchronously.\n *\n * @param {Object} fdPath\n * @param {Function} next\n * @private\n */\nfunction _removeFileAsync(fdPath, next) {\n const _handler = function (err) {\n if (err && !_isENOENT(err)) {\n // reraise any unanticipated error\n return next(err);\n }\n next();\n };\n\n if (0 <= fdPath[0])\n fs.close(fdPath[0], function () {\n fs.unlink(fdPath[1], _handler);\n });\n else fs.unlink(fdPath[1], _handler);\n}\n\n/**\n * Removes files synchronously.\n *\n * @param {Object} fdPath\n * @private\n */\nfunction _removeFileSync(fdPath) {\n let rethrownException = null;\n try {\n if (0 <= fdPath[0]) fs.closeSync(fdPath[0]);\n } catch (e) {\n // reraise any unanticipated error\n if (!_isEBADF(e) && !_isENOENT(e)) throw e;\n } finally {\n try {\n fs.unlinkSync(fdPath[1]);\n }\n catch (e) {\n // reraise any unanticipated error\n if (!_isENOENT(e)) rethrownException = e;\n }\n }\n if (rethrownException !== null) {\n throw rethrownException;\n }\n}\n\n/**\n * Prepares the callback for removal of the temporary file.\n *\n * Returns either a sync callback or a async callback depending on whether\n * fileSync or file was called, which is expressed by the sync parameter.\n *\n * @param {string} name the path of the file\n * @param {number} fd file descriptor\n * @param {Object} opts\n * @param {boolean} sync\n * @returns {fileCallback | fileCallbackSync}\n * @private\n */\nfunction _prepareTmpFileRemoveCallback(name, fd, opts, sync) {\n const removeCallbackSync = _prepareRemoveCallback(_removeFileSync, [fd, name], sync);\n const removeCallback = _prepareRemoveCallback(_removeFileAsync, [fd, name], sync, removeCallbackSync);\n\n if (!opts.keep) _removeObjects.unshift(removeCallbackSync);\n\n return sync ? removeCallbackSync : removeCallback;\n}\n\n/**\n * Prepares the callback for removal of the temporary directory.\n *\n * Returns either a sync callback or a async callback depending on whether\n * tmpFileSync or tmpFile was called, which is expressed by the sync parameter.\n *\n * @param {string} name\n * @param {Object} opts\n * @param {boolean} sync\n * @returns {Function} the callback\n * @private\n */\nfunction _prepareTmpDirRemoveCallback(name, opts, sync) {\n const removeFunction = opts.unsafeCleanup ? rimraf : fs.rmdir.bind(fs);\n const removeFunctionSync = opts.unsafeCleanup ? FN_RIMRAF_SYNC : FN_RMDIR_SYNC;\n const removeCallbackSync = _prepareRemoveCallback(removeFunctionSync, name, sync);\n const removeCallback = _prepareRemoveCallback(removeFunction, name, sync, removeCallbackSync);\n if (!opts.keep) _removeObjects.unshift(removeCallbackSync);\n\n return sync ? removeCallbackSync : removeCallback;\n}\n\n/**\n * Creates a guarded function wrapping the removeFunction call.\n *\n * The cleanup callback is save to be called multiple times.\n * Subsequent invocations will be ignored.\n *\n * @param {Function} removeFunction\n * @param {string} fileOrDirName\n * @param {boolean} sync\n * @param {cleanupCallbackSync?} cleanupCallbackSync\n * @returns {cleanupCallback | cleanupCallbackSync}\n * @private\n */\nfunction _prepareRemoveCallback(removeFunction, fileOrDirName, sync, cleanupCallbackSync) {\n let called = false;\n\n // if sync is true, the next parameter will be ignored\n return function _cleanupCallback(next) {\n\n /* istanbul ignore else */\n if (!called) {\n // remove cleanupCallback from cache\n const toRemove = cleanupCallbackSync || _cleanupCallback;\n const index = _removeObjects.indexOf(toRemove);\n /* istanbul ignore else */\n if (index >= 0) _removeObjects.splice(index, 1);\n\n called = true;\n if (sync || removeFunction === FN_RMDIR_SYNC || removeFunction === FN_RIMRAF_SYNC) {\n return removeFunction(fileOrDirName);\n } else {\n return removeFunction(fileOrDirName, next || function() {});\n }\n }\n };\n}\n\n/**\n * The garbage collector.\n *\n * @private\n */\nfunction _garbageCollector() {\n /* istanbul ignore else */\n if (!_gracefulCleanup) return;\n\n // the function being called removes itself from _removeObjects,\n // loop until _removeObjects is empty\n while (_removeObjects.length) {\n try {\n _removeObjects[0]();\n } catch (e) {\n // already removed?\n }\n }\n}\n\n/**\n * Random name generator based on crypto.\n * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript\n *\n * @param {number} howMany\n * @returns {string} the generated random name\n * @private\n */\nfunction _randomChars(howMany) {\n let\n value = [],\n rnd = null;\n\n // make sure that we do not fail because we ran out of entropy\n try {\n rnd = crypto.randomBytes(howMany);\n } catch (e) {\n rnd = crypto.pseudoRandomBytes(howMany);\n }\n\n for (var i = 0; i < howMany; i++) {\n value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);\n }\n\n return value.join('');\n}\n\n/**\n * Helper which determines whether a string s is blank, that is undefined, or empty or null.\n *\n * @private\n * @param {string} s\n * @returns {Boolean} true whether the string s is blank, false otherwise\n */\nfunction _isBlank(s) {\n return s === null || _isUndefined(s) || !s.trim();\n}\n\n/**\n * Checks whether the `obj` parameter is defined or not.\n *\n * @param {Object} obj\n * @returns {boolean} true if the object is undefined\n * @private\n */\nfunction _isUndefined(obj) {\n return typeof obj === 'undefined';\n}\n\n/**\n * Parses the function arguments.\n *\n * This function helps to have optional arguments.\n *\n * @param {(Options|null|undefined|Function)} options\n * @param {?Function} callback\n * @returns {Array} parsed arguments\n * @private\n */\nfunction _parseArguments(options, callback) {\n /* istanbul ignore else */\n if (typeof options === 'function') {\n return [{}, options];\n }\n\n /* istanbul ignore else */\n if (_isUndefined(options)) {\n return [{}, callback];\n }\n\n // copy options so we do not leak the changes we make internally\n const actualOptions = {};\n for (const key of Object.getOwnPropertyNames(options)) {\n actualOptions[key] = options[key];\n }\n\n return [actualOptions, callback];\n}\n\n/**\n * Generates a new temporary name.\n *\n * @param {Object} opts\n * @returns {string} the new random name according to opts\n * @private\n */\nfunction _generateTmpName(opts) {\n\n const tmpDir = opts.tmpdir;\n\n /* istanbul ignore else */\n if (!_isUndefined(opts.name))\n return path.join(tmpDir, opts.dir, opts.name);\n\n /* istanbul ignore else */\n if (!_isUndefined(opts.template))\n return path.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));\n\n // prefix and postfix\n const name = [\n opts.prefix ? opts.prefix : 'tmp',\n '-',\n process.pid,\n '-',\n _randomChars(12),\n opts.postfix ? '-' + opts.postfix : ''\n ].join('');\n\n return path.join(tmpDir, opts.dir, name);\n}\n\n/**\n * Asserts whether the specified options are valid, also sanitizes options and provides sane defaults for missing\n * options.\n *\n * @param {Options} options\n * @private\n */\nfunction _assertAndSanitizeOptions(options) {\n\n options.tmpdir = _getTmpDir(options);\n\n const tmpDir = options.tmpdir;\n\n /* istanbul ignore else */\n if (!_isUndefined(options.name))\n _assertIsRelative(options.name, 'name', tmpDir);\n /* istanbul ignore else */\n if (!_isUndefined(options.dir))\n _assertIsRelative(options.dir, 'dir', tmpDir);\n /* istanbul ignore else */\n if (!_isUndefined(options.template)) {\n _assertIsRelative(options.template, 'template', tmpDir);\n if (!options.template.match(TEMPLATE_PATTERN))\n throw new Error(`Invalid template, found \"${options.template}\".`);\n }\n /* istanbul ignore else */\n if (!_isUndefined(options.tries) && isNaN(options.tries) || options.tries < 0)\n throw new Error(`Invalid tries, found \"${options.tries}\".`);\n\n // if a name was specified we will try once\n options.tries = _isUndefined(options.name) ? options.tries || DEFAULT_TRIES : 1;\n options.keep = !!options.keep;\n options.detachDescriptor = !!options.detachDescriptor;\n options.discardDescriptor = !!options.discardDescriptor;\n options.unsafeCleanup = !!options.unsafeCleanup;\n\n // sanitize dir, also keep (multiple) blanks if the user, purportedly sane, requests us to\n options.dir = _isUndefined(options.dir) ? '' : path.relative(tmpDir, _resolvePath(options.dir, tmpDir));\n options.template = _isUndefined(options.template) ? undefined : path.relative(tmpDir, _resolvePath(options.template, tmpDir));\n // sanitize further if template is relative to options.dir\n options.template = _isBlank(options.template) ? undefined : path.relative(options.dir, options.template);\n\n // for completeness' sake only, also keep (multiple) blanks if the user, purportedly sane, requests us to\n options.name = _isUndefined(options.name) ? undefined : _sanitizeName(options.name);\n options.prefix = _isUndefined(options.prefix) ? '' : options.prefix;\n options.postfix = _isUndefined(options.postfix) ? '' : options.postfix;\n}\n\n/**\n * Resolve the specified path name in respect to tmpDir.\n *\n * The specified name might include relative path components, e.g. ../\n * so we need to resolve in order to be sure that is is located inside tmpDir\n *\n * @param name\n * @param tmpDir\n * @returns {string}\n * @private\n */\nfunction _resolvePath(name, tmpDir) {\n const sanitizedName = _sanitizeName(name);\n if (sanitizedName.startsWith(tmpDir)) {\n return path.resolve(sanitizedName);\n } else {\n return path.resolve(path.join(tmpDir, sanitizedName));\n }\n}\n\n/**\n * Sanitize the specified path name by removing all quote characters.\n *\n * @param name\n * @returns {string}\n * @private\n */\nfunction _sanitizeName(name) {\n if (_isBlank(name)) {\n return name;\n }\n return name.replace(/[\"']/g, '');\n}\n\n/**\n * Asserts whether specified name is relative to the specified tmpDir.\n *\n * @param {string} name\n * @param {string} option\n * @param {string} tmpDir\n * @throws {Error}\n * @private\n */\nfunction _assertIsRelative(name, option, tmpDir) {\n if (option === 'name') {\n // assert that name is not absolute and does not contain a path\n if (path.isAbsolute(name))\n throw new Error(`${option} option must not contain an absolute path, found \"${name}\".`);\n // must not fail on valid . or .. or similar such constructs\n let basename = path.basename(name);\n if (basename === '..' || basename === '.' || basename !== name)\n throw new Error(`${option} option must not contain a path, found \"${name}\".`);\n }\n else { // if (option === 'dir' || option === 'template') {\n // assert that dir or template are relative to tmpDir\n if (path.isAbsolute(name) && !name.startsWith(tmpDir)) {\n throw new Error(`${option} option must be relative to \"${tmpDir}\", found \"${name}\".`);\n }\n let resolvedPath = _resolvePath(name, tmpDir);\n if (!resolvedPath.startsWith(tmpDir))\n throw new Error(`${option} option must be relative to \"${tmpDir}\", found \"${resolvedPath}\".`);\n }\n}\n\n/**\n * Helper for testing against EBADF to compensate changes made to Node 7.x under Windows.\n *\n * @private\n */\nfunction _isEBADF(error) {\n return _isExpectedError(error, -EBADF, 'EBADF');\n}\n\n/**\n * Helper for testing against ENOENT to compensate changes made to Node 7.x under Windows.\n *\n * @private\n */\nfunction _isENOENT(error) {\n return _isExpectedError(error, -ENOENT, 'ENOENT');\n}\n\n/**\n * Helper to determine whether the expected error code matches the actual code and errno,\n * which will differ between the supported node versions.\n *\n * - Node >= 7.0:\n * error.code {string}\n * error.errno {number} any numerical value will be negated\n *\n * CAVEAT\n *\n * On windows, the errno for EBADF is -4083 but os.constants.errno.EBADF is different and we must assume that ENOENT\n * is no different here.\n *\n * @param {SystemError} error\n * @param {number} errno\n * @param {string} code\n * @private\n */\nfunction _isExpectedError(error, errno, code) {\n return IS_WIN32 ? error.code === code : error.code === code && error.errno === errno;\n}\n\n/**\n * Sets the graceful cleanup.\n *\n * If graceful cleanup is set, tmp will remove all controlled temporary objects on process exit, otherwise the\n * temporary objects will remain in place, waiting to be cleaned up on system restart or otherwise scheduled temporary\n * object removals.\n */\nfunction setGracefulCleanup() {\n _gracefulCleanup = true;\n}\n\n/**\n * Returns the currently configured tmp dir from os.tmpdir().\n *\n * @private\n * @param {?Options} options\n * @returns {string} the currently configured tmp dir\n */\nfunction _getTmpDir(options) {\n return path.resolve(_sanitizeName(options && options.tmpdir || os.tmpdir()));\n}\n\n// Install process exit listener\nprocess.addListener(EXIT, _garbageCollector);\n\n/**\n * Configuration options.\n *\n * @typedef {Object} Options\n * @property {?boolean} keep the temporary object (file or dir) will not be garbage collected\n * @property {?number} tries the number of tries before give up the name generation\n * @property (?int) mode the access mode, defaults are 0o700 for directories and 0o600 for files\n * @property {?string} template the \"mkstemp\" like filename template\n * @property {?string} name fixed name relative to tmpdir or the specified dir option\n * @property {?string} dir tmp directory relative to the root tmp directory in use\n * @property {?string} prefix prefix for the generated name\n * @property {?string} postfix postfix for the generated name\n * @property {?string} tmpdir the root tmp directory which overrides the os tmpdir\n * @property {?boolean} unsafeCleanup recursively removes the created temporary directory, even when it's not empty\n * @property {?boolean} detachDescriptor detaches the file descriptor, caller is responsible for closing the file, tmp will no longer try closing the file during garbage collection\n * @property {?boolean} discardDescriptor discards the file descriptor (closes file, fd is -1), tmp will no longer try closing the file during garbage collection\n */\n\n/**\n * @typedef {Object} FileSyncObject\n * @property {string} name the name of the file\n * @property {string} fd the file descriptor or -1 if the fd has been discarded\n * @property {fileCallback} removeCallback the callback function to remove the file\n */\n\n/**\n * @typedef {Object} DirSyncObject\n * @property {string} name the name of the directory\n * @property {fileCallback} removeCallback the callback function to remove the directory\n */\n\n/**\n * @callback tmpNameCallback\n * @param {?Error} err the error object if anything goes wrong\n * @param {string} name the temporary file name\n */\n\n/**\n * @callback fileCallback\n * @param {?Error} err the error object if anything goes wrong\n * @param {string} name the temporary file name\n * @param {number} fd the file descriptor or -1 if the fd had been discarded\n * @param {cleanupCallback} fn the cleanup callback function\n */\n\n/**\n * @callback fileCallbackSync\n * @param {?Error} err the error object if anything goes wrong\n * @param {string} name the temporary file name\n * @param {number} fd the file descriptor or -1 if the fd had been discarded\n * @param {cleanupCallbackSync} fn the cleanup callback function\n */\n\n/**\n * @callback dirCallback\n * @param {?Error} err the error object if anything goes wrong\n * @param {string} name the temporary file name\n * @param {cleanupCallback} fn the cleanup callback function\n */\n\n/**\n * @callback dirCallbackSync\n * @param {?Error} err the error object if anything goes wrong\n * @param {string} name the temporary file name\n * @param {cleanupCallbackSync} fn the cleanup callback function\n */\n\n/**\n * Removes the temporary created file or directory.\n *\n * @callback cleanupCallback\n * @param {simpleCallback} [next] function to call whenever the tmp object needs to be removed\n */\n\n/**\n * Removes the temporary created file or directory.\n *\n * @callback cleanupCallbackSync\n */\n\n/**\n * Callback function for function composition.\n * @see {@link https://github.com/raszi/node-tmp/issues/57|raszi/node-tmp#57}\n *\n * @callback simpleCallback\n */\n\n// exporting all the needed methods\n\n// evaluate _getTmpDir() lazily, mainly for simplifying testing but it also will\n// allow users to reconfigure the temporary directory\nObject.defineProperty(module.exports, 'tmpdir', {\n enumerable: true,\n configurable: false,\n get: function () {\n return _getTmpDir();\n }\n});\n\nmodule.exports.dir = dir;\nmodule.exports.dirSync = dirSync;\n\nmodule.exports.file = file;\nmodule.exports.fileSync = fileSync;\n\nmodule.exports.tmpName = tmpName;\nmodule.exports.tmpNameSync = tmpNameSync;\n\nmodule.exports.setGracefulCleanup = setGracefulCleanup;\n","/*!\n * Copyright (c) 2015, Salesforce.com, Inc.\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * 3. Neither the name of Salesforce.com nor the names of its contributors may\n * be used to endorse or promote products derived from this software without\n * specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n */\n'use strict';\nvar net = require('net');\nvar urlParse = require('url').parse;\nvar util = require('util');\nvar pubsuffix = require('./pubsuffix-psl');\nvar Store = require('./store').Store;\nvar MemoryCookieStore = require('./memstore').MemoryCookieStore;\nvar pathMatch = require('./pathMatch').pathMatch;\nvar VERSION = require('./version');\n\nvar punycode;\ntry {\n punycode = require('punycode');\n} catch(e) {\n console.warn(\"tough-cookie: can't load punycode; won't use punycode for domain normalization\");\n}\n\n// From RFC6265 S4.1.1\n// note that it excludes \\x3B \";\"\nvar COOKIE_OCTETS = /^[\\x21\\x23-\\x2B\\x2D-\\x3A\\x3C-\\x5B\\x5D-\\x7E]+$/;\n\nvar CONTROL_CHARS = /[\\x00-\\x1F]/;\n\n// From Chromium // '\\r', '\\n' and '\\0' should be treated as a terminator in\n// the \"relaxed\" mode, see:\n// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60\nvar TERMINATORS = ['\\n', '\\r', '\\0'];\n\n// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or \";\"'\n// Note ';' is \\x3B\nvar PATH_VALUE = /[\\x20-\\x3A\\x3C-\\x7E]+/;\n\n// date-time parsing constants (RFC6265 S5.1.1)\n\nvar DATE_DELIM = /[\\x09\\x20-\\x2F\\x3B-\\x40\\x5B-\\x60\\x7B-\\x7E]/;\n\nvar MONTH_TO_NUM = {\n jan:0, feb:1, mar:2, apr:3, may:4, jun:5,\n jul:6, aug:7, sep:8, oct:9, nov:10, dec:11\n};\nvar NUM_TO_MONTH = [\n 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'\n];\nvar NUM_TO_DAY = [\n 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'\n];\n\nvar MAX_TIME = 2147483647000; // 31-bit max\nvar MIN_TIME = 0; // 31-bit min\n\n/*\n * Parses a Natural number (i.e., non-negative integer) with either the\n * *DIGIT ( non-digit *OCTET )\n * or\n * *DIGIT\n * grammar (RFC6265 S5.1.1).\n *\n * The \"trailingOK\" boolean controls if the grammar accepts a\n * \"( non-digit *OCTET )\" trailer.\n */\nfunction parseDigits(token, minDigits, maxDigits, trailingOK) {\n var count = 0;\n while (count < token.length) {\n var c = token.charCodeAt(count);\n // \"non-digit = %x00-2F / %x3A-FF\"\n if (c <= 0x2F || c >= 0x3A) {\n break;\n }\n count++;\n }\n\n // constrain to a minimum and maximum number of digits.\n if (count < minDigits || count > maxDigits) {\n return null;\n }\n\n if (!trailingOK && count != token.length) {\n return null;\n }\n\n return parseInt(token.substr(0,count), 10);\n}\n\nfunction parseTime(token) {\n var parts = token.split(':');\n var result = [0,0,0];\n\n /* RF6256 S5.1.1:\n * time = hms-time ( non-digit *OCTET )\n * hms-time = time-field \":\" time-field \":\" time-field\n * time-field = 1*2DIGIT\n */\n\n if (parts.length !== 3) {\n return null;\n }\n\n for (var i = 0; i < 3; i++) {\n // \"time-field\" must be strictly \"1*2DIGIT\", HOWEVER, \"hms-time\" can be\n // followed by \"( non-digit *OCTET )\" so therefore the last time-field can\n // have a trailer\n var trailingOK = (i == 2);\n var num = parseDigits(parts[i], 1, 2, trailingOK);\n if (num === null) {\n return null;\n }\n result[i] = num;\n }\n\n return result;\n}\n\nfunction parseMonth(token) {\n token = String(token).substr(0,3).toLowerCase();\n var num = MONTH_TO_NUM[token];\n return num >= 0 ? num : null;\n}\n\n/*\n * RFC6265 S5.1.1 date parser (see RFC for full grammar)\n */\nfunction parseDate(str) {\n if (!str) {\n return;\n }\n\n /* RFC6265 S5.1.1:\n * 2. Process each date-token sequentially in the order the date-tokens\n * appear in the cookie-date\n */\n var tokens = str.split(DATE_DELIM);\n if (!tokens) {\n return;\n }\n\n var hour = null;\n var minute = null;\n var second = null;\n var dayOfMonth = null;\n var month = null;\n var year = null;\n\n for (var i=0; i= 70 && year <= 99) {\n year += 1900;\n } else if (year >= 0 && year <= 69) {\n year += 2000;\n }\n }\n }\n }\n\n /* RFC 6265 S5.1.1\n * \"5. Abort these steps and fail to parse the cookie-date if:\n * * at least one of the found-day-of-month, found-month, found-\n * year, or found-time flags is not set,\n * * the day-of-month-value is less than 1 or greater than 31,\n * * the year-value is less than 1601,\n * * the hour-value is greater than 23,\n * * the minute-value is greater than 59, or\n * * the second-value is greater than 59.\n * (Note that leap seconds cannot be represented in this syntax.)\"\n *\n * So, in order as above:\n */\n if (\n dayOfMonth === null || month === null || year === null || second === null ||\n dayOfMonth < 1 || dayOfMonth > 31 ||\n year < 1601 ||\n hour > 23 ||\n minute > 59 ||\n second > 59\n ) {\n return;\n }\n\n return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));\n}\n\nfunction formatDate(date) {\n var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;\n var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;\n var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;\n var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;\n return NUM_TO_DAY[date.getUTCDay()] + ', ' +\n d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+\n h+':'+m+':'+s+' GMT';\n}\n\n// S5.1.2 Canonicalized Host Names\nfunction canonicalDomain(str) {\n if (str == null) {\n return null;\n }\n str = str.trim().replace(/^\\./,''); // S4.1.2.3 & S5.2.3: ignore leading .\n\n // convert to IDN if any non-ASCII characters\n if (punycode && /[^\\u0001-\\u007f]/.test(str)) {\n str = punycode.toASCII(str);\n }\n\n return str.toLowerCase();\n}\n\n// S5.1.3 Domain Matching\nfunction domainMatch(str, domStr, canonicalize) {\n if (str == null || domStr == null) {\n return null;\n }\n if (canonicalize !== false) {\n str = canonicalDomain(str);\n domStr = canonicalDomain(domStr);\n }\n\n /*\n * \"The domain string and the string are identical. (Note that both the\n * domain string and the string will have been canonicalized to lower case at\n * this point)\"\n */\n if (str == domStr) {\n return true;\n }\n\n /* \"All of the following [three] conditions hold:\" (order adjusted from the RFC) */\n\n /* \"* The string is a host name (i.e., not an IP address).\" */\n if (net.isIP(str)) {\n return false;\n }\n\n /* \"* The domain string is a suffix of the string\" */\n var idx = str.indexOf(domStr);\n if (idx <= 0) {\n return false; // it's a non-match (-1) or prefix (0)\n }\n\n // e.g \"a.b.c\".indexOf(\"b.c\") === 2\n // 5 === 3+2\n if (str.length !== domStr.length + idx) { // it's not a suffix\n return false;\n }\n\n /* \"* The last character of the string that is not included in the domain\n * string is a %x2E (\".\") character.\" */\n if (str.substr(idx-1,1) !== '.') {\n return false;\n }\n\n return true;\n}\n\n\n// RFC6265 S5.1.4 Paths and Path-Match\n\n/*\n * \"The user agent MUST use an algorithm equivalent to the following algorithm\n * to compute the default-path of a cookie:\"\n *\n * Assumption: the path (and not query part or absolute uri) is passed in.\n */\nfunction defaultPath(path) {\n // \"2. If the uri-path is empty or if the first character of the uri-path is not\n // a %x2F (\"/\") character, output %x2F (\"/\") and skip the remaining steps.\n if (!path || path.substr(0,1) !== \"/\") {\n return \"/\";\n }\n\n // \"3. If the uri-path contains no more than one %x2F (\"/\") character, output\n // %x2F (\"/\") and skip the remaining step.\"\n if (path === \"/\") {\n return path;\n }\n\n var rightSlash = path.lastIndexOf(\"/\");\n if (rightSlash === 0) {\n return \"/\";\n }\n\n // \"4. Output the characters of the uri-path from the first character up to,\n // but not including, the right-most %x2F (\"/\").\"\n return path.slice(0, rightSlash);\n}\n\nfunction trimTerminator(str) {\n for (var t = 0; t < TERMINATORS.length; t++) {\n var terminatorIdx = str.indexOf(TERMINATORS[t]);\n if (terminatorIdx !== -1) {\n str = str.substr(0,terminatorIdx);\n }\n }\n\n return str;\n}\n\nfunction parseCookiePair(cookiePair, looseMode) {\n cookiePair = trimTerminator(cookiePair);\n\n var firstEq = cookiePair.indexOf('=');\n if (looseMode) {\n if (firstEq === 0) { // '=' is immediately at start\n cookiePair = cookiePair.substr(1);\n firstEq = cookiePair.indexOf('='); // might still need to split on '='\n }\n } else { // non-loose mode\n if (firstEq <= 0) { // no '=' or is at start\n return; // needs to have non-empty \"cookie-name\"\n }\n }\n\n var cookieName, cookieValue;\n if (firstEq <= 0) {\n cookieName = \"\";\n cookieValue = cookiePair.trim();\n } else {\n cookieName = cookiePair.substr(0, firstEq).trim();\n cookieValue = cookiePair.substr(firstEq+1).trim();\n }\n\n if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {\n return;\n }\n\n var c = new Cookie();\n c.key = cookieName;\n c.value = cookieValue;\n return c;\n}\n\nfunction parse(str, options) {\n if (!options || typeof options !== 'object') {\n options = {};\n }\n str = str.trim();\n\n // We use a regex to parse the \"name-value-pair\" part of S5.2\n var firstSemi = str.indexOf(';'); // S5.2 step 1\n var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);\n var c = parseCookiePair(cookiePair, !!options.loose);\n if (!c) {\n return;\n }\n\n if (firstSemi === -1) {\n return c;\n }\n\n // S5.2.3 \"unparsed-attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\" plus later on in the same section\n // \"discard the first \";\" and trim\".\n var unparsed = str.slice(firstSemi + 1).trim();\n\n // \"If the unparsed-attributes string is empty, skip the rest of these\n // steps.\"\n if (unparsed.length === 0) {\n return c;\n }\n\n /*\n * S5.2 says that when looping over the items \"[p]rocess the attribute-name\n * and attribute-value according to the requirements in the following\n * subsections\" for every item. Plus, for many of the individual attributes\n * in S5.3 it says to use the \"attribute-value of the last attribute in the\n * cookie-attribute-list\". Therefore, in this implementation, we overwrite\n * the previous value.\n */\n var cookie_avs = unparsed.split(';');\n while (cookie_avs.length) {\n var av = cookie_avs.shift().trim();\n if (av.length === 0) { // happens if \";;\" appears\n continue;\n }\n var av_sep = av.indexOf('=');\n var av_key, av_value;\n\n if (av_sep === -1) {\n av_key = av;\n av_value = null;\n } else {\n av_key = av.substr(0,av_sep);\n av_value = av.substr(av_sep+1);\n }\n\n av_key = av_key.trim().toLowerCase();\n\n if (av_value) {\n av_value = av_value.trim();\n }\n\n switch(av_key) {\n case 'expires': // S5.2.1\n if (av_value) {\n var exp = parseDate(av_value);\n // \"If the attribute-value failed to parse as a cookie date, ignore the\n // cookie-av.\"\n if (exp) {\n // over and underflow not realistically a concern: V8's getTime() seems to\n // store something larger than a 32-bit time_t (even with 32-bit node)\n c.expires = exp;\n }\n }\n break;\n\n case 'max-age': // S5.2.2\n if (av_value) {\n // \"If the first character of the attribute-value is not a DIGIT or a \"-\"\n // character ...[or]... If the remainder of attribute-value contains a\n // non-DIGIT character, ignore the cookie-av.\"\n if (/^-?[0-9]+$/.test(av_value)) {\n var delta = parseInt(av_value, 10);\n // \"If delta-seconds is less than or equal to zero (0), let expiry-time\n // be the earliest representable date and time.\"\n c.setMaxAge(delta);\n }\n }\n break;\n\n case 'domain': // S5.2.3\n // \"If the attribute-value is empty, the behavior is undefined. However,\n // the user agent SHOULD ignore the cookie-av entirely.\"\n if (av_value) {\n // S5.2.3 \"Let cookie-domain be the attribute-value without the leading %x2E\n // (\".\") character.\"\n var domain = av_value.trim().replace(/^\\./, '');\n if (domain) {\n // \"Convert the cookie-domain to lower case.\"\n c.domain = domain.toLowerCase();\n }\n }\n break;\n\n case 'path': // S5.2.4\n /*\n * \"If the attribute-value is empty or if the first character of the\n * attribute-value is not %x2F (\"/\"):\n * Let cookie-path be the default-path.\n * Otherwise:\n * Let cookie-path be the attribute-value.\"\n *\n * We'll represent the default-path as null since it depends on the\n * context of the parsing.\n */\n c.path = av_value && av_value[0] === \"/\" ? av_value : null;\n break;\n\n case 'secure': // S5.2.5\n /*\n * \"If the attribute-name case-insensitively matches the string \"Secure\",\n * the user agent MUST append an attribute to the cookie-attribute-list\n * with an attribute-name of Secure and an empty attribute-value.\"\n */\n c.secure = true;\n break;\n\n case 'httponly': // S5.2.6 -- effectively the same as 'secure'\n c.httpOnly = true;\n break;\n\n default:\n c.extensions = c.extensions || [];\n c.extensions.push(av);\n break;\n }\n }\n\n return c;\n}\n\n// avoid the V8 deoptimization monster!\nfunction jsonParse(str) {\n var obj;\n try {\n obj = JSON.parse(str);\n } catch (e) {\n return e;\n }\n return obj;\n}\n\nfunction fromJSON(str) {\n if (!str) {\n return null;\n }\n\n var obj;\n if (typeof str === 'string') {\n obj = jsonParse(str);\n if (obj instanceof Error) {\n return null;\n }\n } else {\n // assume it's an Object\n obj = str;\n }\n\n var c = new Cookie();\n for (var i=0; i 1) {\n var lindex = path.lastIndexOf('/');\n if (lindex === 0) {\n break;\n }\n path = path.substr(0,lindex);\n permutations.push(path);\n }\n permutations.push('/');\n return permutations;\n}\n\nfunction getCookieContext(url) {\n if (url instanceof Object) {\n return url;\n }\n // NOTE: decodeURI will throw on malformed URIs (see GH-32).\n // Therefore, we will just skip decoding for such URIs.\n try {\n url = decodeURI(url);\n }\n catch(err) {\n // Silently swallow error\n }\n\n return urlParse(url);\n}\n\nfunction Cookie(options) {\n options = options || {};\n\n Object.keys(options).forEach(function(prop) {\n if (Cookie.prototype.hasOwnProperty(prop) &&\n Cookie.prototype[prop] !== options[prop] &&\n prop.substr(0,1) !== '_')\n {\n this[prop] = options[prop];\n }\n }, this);\n\n this.creation = this.creation || new Date();\n\n // used to break creation ties in cookieCompare():\n Object.defineProperty(this, 'creationIndex', {\n configurable: false,\n enumerable: false, // important for assert.deepEqual checks\n writable: true,\n value: ++Cookie.cookiesCreated\n });\n}\n\nCookie.cookiesCreated = 0; // incremented each time a cookie is created\n\nCookie.parse = parse;\nCookie.fromJSON = fromJSON;\n\nCookie.prototype.key = \"\";\nCookie.prototype.value = \"\";\n\n// the order in which the RFC has them:\nCookie.prototype.expires = \"Infinity\"; // coerces to literal Infinity\nCookie.prototype.maxAge = null; // takes precedence over expires for TTL\nCookie.prototype.domain = null;\nCookie.prototype.path = null;\nCookie.prototype.secure = false;\nCookie.prototype.httpOnly = false;\nCookie.prototype.extensions = null;\n\n// set by the CookieJar:\nCookie.prototype.hostOnly = null; // boolean when set\nCookie.prototype.pathIsDefault = null; // boolean when set\nCookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse\nCookie.prototype.lastAccessed = null; // Date when set\nObject.defineProperty(Cookie.prototype, 'creationIndex', {\n configurable: true,\n enumerable: false,\n writable: true,\n value: 0\n});\n\nCookie.serializableProperties = Object.keys(Cookie.prototype)\n .filter(function(prop) {\n return !(\n Cookie.prototype[prop] instanceof Function ||\n prop === 'creationIndex' ||\n prop.substr(0,1) === '_'\n );\n });\n\nCookie.prototype.inspect = function inspect() {\n var now = Date.now();\n return 'Cookie=\"'+this.toString() +\n '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +\n '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +\n '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +\n '\"';\n};\n\n// Use the new custom inspection symbol to add the custom inspect function if\n// available.\nif (util.inspect.custom) {\n Cookie.prototype[util.inspect.custom] = Cookie.prototype.inspect;\n}\n\nCookie.prototype.toJSON = function() {\n var obj = {};\n\n var props = Cookie.serializableProperties;\n for (var i=0; i= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n };\r\n\r\n __param = function (paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n };\r\n\r\n __esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n };\r\n\r\n __runInitializers = function (thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n };\r\n\r\n __propKey = function (x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n };\r\n\r\n __setFunctionName = function (f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n };\r\n\r\n __metadata = function (metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n };\r\n\r\n __awaiter = function (thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n };\r\n\r\n __generator = function (thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n };\r\n\r\n __exportStar = function(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n };\r\n\r\n __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n }) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n });\r\n\r\n __values = function (o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n };\r\n\r\n __read = function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spread = function () {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n };\r\n\r\n /** @deprecated */\r\n __spreadArrays = function () {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n };\r\n\r\n __spreadArray = function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n };\r\n\r\n __await = function (v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n };\r\n\r\n __asyncGenerator = function (thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n };\r\n\r\n __asyncDelegator = function (o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n };\r\n\r\n __asyncValues = function (o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n 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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n };\r\n\r\n __makeTemplateObject = function (cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n };\r\n\r\n var __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n }) : function(o, v) {\r\n o[\"default\"] = v;\r\n };\r\n\r\n __importStar = function (mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n };\r\n\r\n __importDefault = function (mod) {\r\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\r\n };\r\n\r\n __classPrivateFieldGet = function (receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n };\r\n\r\n __classPrivateFieldSet = function (receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n };\r\n\r\n __classPrivateFieldIn = function (state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n };\r\n\r\n __addDisposableResource = function (env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n };\r\n\r\n var _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n };\r\n\r\n __disposeResources = function (env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n };\r\n\r\n exporter(\"__extends\", __extends);\r\n exporter(\"__assign\", __assign);\r\n exporter(\"__rest\", __rest);\r\n exporter(\"__decorate\", __decorate);\r\n exporter(\"__param\", __param);\r\n exporter(\"__esDecorate\", __esDecorate);\r\n exporter(\"__runInitializers\", __runInitializers);\r\n exporter(\"__propKey\", __propKey);\r\n exporter(\"__setFunctionName\", __setFunctionName);\r\n exporter(\"__metadata\", __metadata);\r\n exporter(\"__awaiter\", __awaiter);\r\n exporter(\"__generator\", __generator);\r\n exporter(\"__exportStar\", __exportStar);\r\n exporter(\"__createBinding\", __createBinding);\r\n exporter(\"__values\", __values);\r\n exporter(\"__read\", __read);\r\n exporter(\"__spread\", __spread);\r\n exporter(\"__spreadArrays\", __spreadArrays);\r\n exporter(\"__spreadArray\", __spreadArray);\r\n exporter(\"__await\", __await);\r\n exporter(\"__asyncGenerator\", __asyncGenerator);\r\n exporter(\"__asyncDelegator\", __asyncDelegator);\r\n exporter(\"__asyncValues\", __asyncValues);\r\n exporter(\"__makeTemplateObject\", __makeTemplateObject);\r\n exporter(\"__importStar\", __importStar);\r\n exporter(\"__importDefault\", __importDefault);\r\n exporter(\"__classPrivateFieldGet\", __classPrivateFieldGet);\r\n exporter(\"__classPrivateFieldSet\", __classPrivateFieldSet);\r\n exporter(\"__classPrivateFieldIn\", __classPrivateFieldIn);\r\n exporter(\"__addDisposableResource\", __addDisposableResource);\r\n exporter(\"__disposeResources\", __disposeResources);\r\n});\r\n","'use strict'\n\nvar net = require('net')\n , tls = require('tls')\n , http = require('http')\n , https = require('https')\n , events = require('events')\n , assert = require('assert')\n , util = require('util')\n , Buffer = require('safe-buffer').Buffer\n ;\n\nexports.httpOverHttp = httpOverHttp\nexports.httpsOverHttp = httpsOverHttp\nexports.httpOverHttps = httpOverHttps\nexports.httpsOverHttps = httpsOverHttps\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options)\n agent.request = http.request\n return agent\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options)\n agent.request = http.request\n agent.createSocket = createSecureSocket\n agent.defaultPort = 443\n return agent\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options)\n agent.request = https.request\n return agent\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options)\n agent.request = https.request\n agent.createSocket = createSecureSocket\n agent.defaultPort = 443\n return agent\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this\n self.options = options || {}\n self.proxyOptions = self.options.proxy || {}\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets\n self.requests = []\n self.sockets = []\n\n self.on('free', function onFree(socket, host, port) {\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i]\n if (pending.host === host && pending.port === port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1)\n pending.request.onSocket(socket)\n return\n }\n }\n socket.destroy()\n self.removeSocket(socket)\n })\n}\nutil.inherits(TunnelingAgent, events.EventEmitter)\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, options) {\n var self = this\n\n // Legacy API: addRequest(req, host, port, path)\n if (typeof options === 'string') {\n options = {\n host: options,\n port: arguments[2],\n path: arguments[3]\n };\n }\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push({host: options.host, port: options.port, request: req})\n return\n }\n\n // If we are under maxSockets create a new one.\n self.createConnection({host: options.host, port: options.port, request: req})\n}\n\nTunnelingAgent.prototype.createConnection = function createConnection(pending) {\n var self = this\n\n self.createSocket(pending, function(socket) {\n socket.on('free', onFree)\n socket.on('close', onCloseOrRemove)\n socket.on('agentRemove', onCloseOrRemove)\n pending.request.onSocket(socket)\n\n function onFree() {\n self.emit('free', socket, pending.host, pending.port)\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket)\n socket.removeListener('free', onFree)\n socket.removeListener('close', onCloseOrRemove)\n socket.removeListener('agentRemove', onCloseOrRemove)\n }\n })\n}\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this\n var placeholder = {}\n self.sockets.push(placeholder)\n\n var connectOptions = mergeOptions({}, self.proxyOptions,\n { method: 'CONNECT'\n , path: options.host + ':' + options.port\n , agent: false\n }\n )\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {}\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n Buffer.from(connectOptions.proxyAuth).toString('base64')\n }\n\n debug('making CONNECT request')\n var connectReq = self.request(connectOptions)\n connectReq.useChunkedEncodingByDefault = false // for v0.6\n connectReq.once('response', onResponse) // for v0.6\n connectReq.once('upgrade', onUpgrade) // for v0.6\n connectReq.once('connect', onConnect) // for v0.7 or later\n connectReq.once('error', onError)\n connectReq.end()\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head)\n })\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners()\n socket.removeAllListeners()\n\n if (res.statusCode === 200) {\n assert.equal(head.length, 0)\n debug('tunneling connection has established')\n self.sockets[self.sockets.indexOf(placeholder)] = socket\n cb(socket)\n } else {\n debug('tunneling socket could not be established, statusCode=%d', res.statusCode)\n var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)\n error.code = 'ECONNRESET'\n options.request.emit('error', error)\n self.removeSocket(placeholder)\n }\n }\n\n function onError(cause) {\n connectReq.removeAllListeners()\n\n debug('tunneling socket could not be established, cause=%s\\n', cause.message, cause.stack)\n var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)\n error.code = 'ECONNRESET'\n options.request.emit('error', error)\n self.removeSocket(placeholder)\n }\n}\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) return\n\n this.sockets.splice(pos, 1)\n\n var pending = this.requests.shift()\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createConnection(pending)\n }\n}\n\nfunction createSecureSocket(options, cb) {\n var self = this\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, mergeOptions({}, self.options,\n { servername: options.host\n , socket: socket\n }\n ))\n self.sockets[self.sockets.indexOf(socket)] = secureSocket\n cb(secureSocket)\n })\n}\n\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i]\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides)\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j]\n if (overrides[k] !== undefined) {\n target[k] = overrides[k]\n }\n }\n }\n }\n return target\n}\n\n\nvar debug\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments)\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0]\n } else {\n args.unshift('TUNNEL:')\n }\n console.error.apply(console, args)\n }\n} else {\n debug = function() {}\n}\nexports.debug = debug // for test\n","module.exports = require('./lib/tunnel');\n","'use strict';\n\nvar net = require('net');\nvar tls = require('tls');\nvar http = require('http');\nvar https = require('https');\nvar events = require('events');\nvar assert = require('assert');\nvar util = require('util');\n\n\nexports.httpOverHttp = httpOverHttp;\nexports.httpsOverHttp = httpsOverHttp;\nexports.httpOverHttps = httpOverHttps;\nexports.httpsOverHttps = httpsOverHttps;\n\n\nfunction httpOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n return agent;\n}\n\nfunction httpsOverHttp(options) {\n var agent = new TunnelingAgent(options);\n agent.request = http.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\nfunction httpOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n return agent;\n}\n\nfunction httpsOverHttps(options) {\n var agent = new TunnelingAgent(options);\n agent.request = https.request;\n agent.createSocket = createSecureSocket;\n agent.defaultPort = 443;\n return agent;\n}\n\n\nfunction TunnelingAgent(options) {\n var self = this;\n self.options = options || {};\n self.proxyOptions = self.options.proxy || {};\n self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;\n self.requests = [];\n self.sockets = [];\n\n self.on('free', function onFree(socket, host, port, localAddress) {\n var options = toOptions(host, port, localAddress);\n for (var i = 0, len = self.requests.length; i < len; ++i) {\n var pending = self.requests[i];\n if (pending.host === options.host && pending.port === options.port) {\n // Detect the request to connect same origin server,\n // reuse the connection.\n self.requests.splice(i, 1);\n pending.request.onSocket(socket);\n return;\n }\n }\n socket.destroy();\n self.removeSocket(socket);\n });\n}\nutil.inherits(TunnelingAgent, events.EventEmitter);\n\nTunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {\n var self = this;\n var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));\n\n if (self.sockets.length >= this.maxSockets) {\n // We are over limit so we'll add it to the queue.\n self.requests.push(options);\n return;\n }\n\n // If we are under maxSockets create a new one.\n self.createSocket(options, function(socket) {\n socket.on('free', onFree);\n socket.on('close', onCloseOrRemove);\n socket.on('agentRemove', onCloseOrRemove);\n req.onSocket(socket);\n\n function onFree() {\n self.emit('free', socket, options);\n }\n\n function onCloseOrRemove(err) {\n self.removeSocket(socket);\n socket.removeListener('free', onFree);\n socket.removeListener('close', onCloseOrRemove);\n socket.removeListener('agentRemove', onCloseOrRemove);\n }\n });\n};\n\nTunnelingAgent.prototype.createSocket = function createSocket(options, cb) {\n var self = this;\n var placeholder = {};\n self.sockets.push(placeholder);\n\n var connectOptions = mergeOptions({}, self.proxyOptions, {\n method: 'CONNECT',\n path: options.host + ':' + options.port,\n agent: false,\n headers: {\n host: options.host + ':' + options.port\n }\n });\n if (options.localAddress) {\n connectOptions.localAddress = options.localAddress;\n }\n if (connectOptions.proxyAuth) {\n connectOptions.headers = connectOptions.headers || {};\n connectOptions.headers['Proxy-Authorization'] = 'Basic ' +\n new Buffer(connectOptions.proxyAuth).toString('base64');\n }\n\n debug('making CONNECT request');\n var connectReq = self.request(connectOptions);\n connectReq.useChunkedEncodingByDefault = false; // for v0.6\n connectReq.once('response', onResponse); // for v0.6\n connectReq.once('upgrade', onUpgrade); // for v0.6\n connectReq.once('connect', onConnect); // for v0.7 or later\n connectReq.once('error', onError);\n connectReq.end();\n\n function onResponse(res) {\n // Very hacky. This is necessary to avoid http-parser leaks.\n res.upgrade = true;\n }\n\n function onUpgrade(res, socket, head) {\n // Hacky.\n process.nextTick(function() {\n onConnect(res, socket, head);\n });\n }\n\n function onConnect(res, socket, head) {\n connectReq.removeAllListeners();\n socket.removeAllListeners();\n\n if (res.statusCode !== 200) {\n debug('tunneling socket could not be established, statusCode=%d',\n res.statusCode);\n socket.destroy();\n var error = new Error('tunneling socket could not be established, ' +\n 'statusCode=' + res.statusCode);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n if (head.length > 0) {\n debug('got illegal response body from proxy');\n socket.destroy();\n var error = new Error('got illegal response body from proxy');\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n return;\n }\n debug('tunneling connection has established');\n self.sockets[self.sockets.indexOf(placeholder)] = socket;\n return cb(socket);\n }\n\n function onError(cause) {\n connectReq.removeAllListeners();\n\n debug('tunneling socket could not be established, cause=%s\\n',\n cause.message, cause.stack);\n var error = new Error('tunneling socket could not be established, ' +\n 'cause=' + cause.message);\n error.code = 'ECONNRESET';\n options.request.emit('error', error);\n self.removeSocket(placeholder);\n }\n};\n\nTunnelingAgent.prototype.removeSocket = function removeSocket(socket) {\n var pos = this.sockets.indexOf(socket)\n if (pos === -1) {\n return;\n }\n this.sockets.splice(pos, 1);\n\n var pending = this.requests.shift();\n if (pending) {\n // If we have pending requests and a socket gets closed a new one\n // needs to be created to take over in the pool for the one that closed.\n this.createSocket(pending, function(socket) {\n pending.request.onSocket(socket);\n });\n }\n};\n\nfunction createSecureSocket(options, cb) {\n var self = this;\n TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {\n var hostHeader = options.request.getHeader('host');\n var tlsOptions = mergeOptions({}, self.options, {\n socket: socket,\n servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host\n });\n\n // 0 is dummy port for v0.6\n var secureSocket = tls.connect(0, tlsOptions);\n self.sockets[self.sockets.indexOf(socket)] = secureSocket;\n cb(secureSocket);\n });\n}\n\n\nfunction toOptions(host, port, localAddress) {\n if (typeof host === 'string') { // since v0.10\n return {\n host: host,\n port: port,\n localAddress: localAddress\n };\n }\n return host; // for v0.11 or later\n}\n\nfunction mergeOptions(target) {\n for (var i = 1, len = arguments.length; i < len; ++i) {\n var overrides = arguments[i];\n if (typeof overrides === 'object') {\n var keys = Object.keys(overrides);\n for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {\n var k = keys[j];\n if (overrides[k] !== undefined) {\n target[k] = overrides[k];\n }\n }\n }\n }\n return target;\n}\n\n\nvar debug;\nif (process.env.NODE_DEBUG && /\\btunnel\\b/.test(process.env.NODE_DEBUG)) {\n debug = function() {\n var args = Array.prototype.slice.call(arguments);\n if (typeof args[0] === 'string') {\n args[0] = 'TUNNEL: ' + args[0];\n } else {\n args.unshift('TUNNEL:');\n }\n console.error.apply(console, args);\n }\n} else {\n debug = function() {};\n}\nexports.debug = debug; // for test\n","(function(nacl) {\n'use strict';\n\n// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.\n// Public domain.\n//\n// Implementation derived from TweetNaCl version 20140427.\n// See for details: http://tweetnacl.cr.yp.to/\n\nvar gf = function(init) {\n var i, r = new Float64Array(16);\n if (init) for (i = 0; i < init.length; i++) r[i] = init[i];\n return r;\n};\n\n// Pluggable, initialized in high-level API below.\nvar randombytes = function(/* x, n */) { throw new Error('no PRNG'); };\n\nvar _0 = new Uint8Array(16);\nvar _9 = new Uint8Array(32); _9[0] = 9;\n\nvar gf0 = gf(),\n gf1 = gf([1]),\n _121665 = gf([0xdb41, 1]),\n D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),\n D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),\n X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),\n Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),\n I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);\n\nfunction ts64(x, i, h, l) {\n x[i] = (h >> 24) & 0xff;\n x[i+1] = (h >> 16) & 0xff;\n x[i+2] = (h >> 8) & 0xff;\n x[i+3] = h & 0xff;\n x[i+4] = (l >> 24) & 0xff;\n x[i+5] = (l >> 16) & 0xff;\n x[i+6] = (l >> 8) & 0xff;\n x[i+7] = l & 0xff;\n}\n\nfunction vn(x, xi, y, yi, n) {\n var i,d = 0;\n for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];\n return (1 & ((d - 1) >>> 8)) - 1;\n}\n\nfunction crypto_verify_16(x, xi, y, yi) {\n return vn(x,xi,y,yi,16);\n}\n\nfunction crypto_verify_32(x, xi, y, yi) {\n return vn(x,xi,y,yi,32);\n}\n\nfunction core_salsa20(o, p, k, c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n x0 = x0 + j0 | 0;\n x1 = x1 + j1 | 0;\n x2 = x2 + j2 | 0;\n x3 = x3 + j3 | 0;\n x4 = x4 + j4 | 0;\n x5 = x5 + j5 | 0;\n x6 = x6 + j6 | 0;\n x7 = x7 + j7 | 0;\n x8 = x8 + j8 | 0;\n x9 = x9 + j9 | 0;\n x10 = x10 + j10 | 0;\n x11 = x11 + j11 | 0;\n x12 = x12 + j12 | 0;\n x13 = x13 + j13 | 0;\n x14 = x14 + j14 | 0;\n x15 = x15 + j15 | 0;\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x1 >>> 0 & 0xff;\n o[ 5] = x1 >>> 8 & 0xff;\n o[ 6] = x1 >>> 16 & 0xff;\n o[ 7] = x1 >>> 24 & 0xff;\n\n o[ 8] = x2 >>> 0 & 0xff;\n o[ 9] = x2 >>> 8 & 0xff;\n o[10] = x2 >>> 16 & 0xff;\n o[11] = x2 >>> 24 & 0xff;\n\n o[12] = x3 >>> 0 & 0xff;\n o[13] = x3 >>> 8 & 0xff;\n o[14] = x3 >>> 16 & 0xff;\n o[15] = x3 >>> 24 & 0xff;\n\n o[16] = x4 >>> 0 & 0xff;\n o[17] = x4 >>> 8 & 0xff;\n o[18] = x4 >>> 16 & 0xff;\n o[19] = x4 >>> 24 & 0xff;\n\n o[20] = x5 >>> 0 & 0xff;\n o[21] = x5 >>> 8 & 0xff;\n o[22] = x5 >>> 16 & 0xff;\n o[23] = x5 >>> 24 & 0xff;\n\n o[24] = x6 >>> 0 & 0xff;\n o[25] = x6 >>> 8 & 0xff;\n o[26] = x6 >>> 16 & 0xff;\n o[27] = x6 >>> 24 & 0xff;\n\n o[28] = x7 >>> 0 & 0xff;\n o[29] = x7 >>> 8 & 0xff;\n o[30] = x7 >>> 16 & 0xff;\n o[31] = x7 >>> 24 & 0xff;\n\n o[32] = x8 >>> 0 & 0xff;\n o[33] = x8 >>> 8 & 0xff;\n o[34] = x8 >>> 16 & 0xff;\n o[35] = x8 >>> 24 & 0xff;\n\n o[36] = x9 >>> 0 & 0xff;\n o[37] = x9 >>> 8 & 0xff;\n o[38] = x9 >>> 16 & 0xff;\n o[39] = x9 >>> 24 & 0xff;\n\n o[40] = x10 >>> 0 & 0xff;\n o[41] = x10 >>> 8 & 0xff;\n o[42] = x10 >>> 16 & 0xff;\n o[43] = x10 >>> 24 & 0xff;\n\n o[44] = x11 >>> 0 & 0xff;\n o[45] = x11 >>> 8 & 0xff;\n o[46] = x11 >>> 16 & 0xff;\n o[47] = x11 >>> 24 & 0xff;\n\n o[48] = x12 >>> 0 & 0xff;\n o[49] = x12 >>> 8 & 0xff;\n o[50] = x12 >>> 16 & 0xff;\n o[51] = x12 >>> 24 & 0xff;\n\n o[52] = x13 >>> 0 & 0xff;\n o[53] = x13 >>> 8 & 0xff;\n o[54] = x13 >>> 16 & 0xff;\n o[55] = x13 >>> 24 & 0xff;\n\n o[56] = x14 >>> 0 & 0xff;\n o[57] = x14 >>> 8 & 0xff;\n o[58] = x14 >>> 16 & 0xff;\n o[59] = x14 >>> 24 & 0xff;\n\n o[60] = x15 >>> 0 & 0xff;\n o[61] = x15 >>> 8 & 0xff;\n o[62] = x15 >>> 16 & 0xff;\n o[63] = x15 >>> 24 & 0xff;\n}\n\nfunction core_hsalsa20(o,p,k,c) {\n var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,\n j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,\n j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,\n j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,\n j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,\n j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,\n j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,\n j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,\n j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,\n j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,\n j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,\n j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,\n j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,\n j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,\n j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,\n j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;\n\n var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,\n x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,\n x15 = j15, u;\n\n for (var i = 0; i < 20; i += 2) {\n u = x0 + x12 | 0;\n x4 ^= u<<7 | u>>>(32-7);\n u = x4 + x0 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x4 | 0;\n x12 ^= u<<13 | u>>>(32-13);\n u = x12 + x8 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x1 | 0;\n x9 ^= u<<7 | u>>>(32-7);\n u = x9 + x5 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x9 | 0;\n x1 ^= u<<13 | u>>>(32-13);\n u = x1 + x13 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x6 | 0;\n x14 ^= u<<7 | u>>>(32-7);\n u = x14 + x10 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x14 | 0;\n x6 ^= u<<13 | u>>>(32-13);\n u = x6 + x2 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x11 | 0;\n x3 ^= u<<7 | u>>>(32-7);\n u = x3 + x15 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x3 | 0;\n x11 ^= u<<13 | u>>>(32-13);\n u = x11 + x7 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n\n u = x0 + x3 | 0;\n x1 ^= u<<7 | u>>>(32-7);\n u = x1 + x0 | 0;\n x2 ^= u<<9 | u>>>(32-9);\n u = x2 + x1 | 0;\n x3 ^= u<<13 | u>>>(32-13);\n u = x3 + x2 | 0;\n x0 ^= u<<18 | u>>>(32-18);\n\n u = x5 + x4 | 0;\n x6 ^= u<<7 | u>>>(32-7);\n u = x6 + x5 | 0;\n x7 ^= u<<9 | u>>>(32-9);\n u = x7 + x6 | 0;\n x4 ^= u<<13 | u>>>(32-13);\n u = x4 + x7 | 0;\n x5 ^= u<<18 | u>>>(32-18);\n\n u = x10 + x9 | 0;\n x11 ^= u<<7 | u>>>(32-7);\n u = x11 + x10 | 0;\n x8 ^= u<<9 | u>>>(32-9);\n u = x8 + x11 | 0;\n x9 ^= u<<13 | u>>>(32-13);\n u = x9 + x8 | 0;\n x10 ^= u<<18 | u>>>(32-18);\n\n u = x15 + x14 | 0;\n x12 ^= u<<7 | u>>>(32-7);\n u = x12 + x15 | 0;\n x13 ^= u<<9 | u>>>(32-9);\n u = x13 + x12 | 0;\n x14 ^= u<<13 | u>>>(32-13);\n u = x14 + x13 | 0;\n x15 ^= u<<18 | u>>>(32-18);\n }\n\n o[ 0] = x0 >>> 0 & 0xff;\n o[ 1] = x0 >>> 8 & 0xff;\n o[ 2] = x0 >>> 16 & 0xff;\n o[ 3] = x0 >>> 24 & 0xff;\n\n o[ 4] = x5 >>> 0 & 0xff;\n o[ 5] = x5 >>> 8 & 0xff;\n o[ 6] = x5 >>> 16 & 0xff;\n o[ 7] = x5 >>> 24 & 0xff;\n\n o[ 8] = x10 >>> 0 & 0xff;\n o[ 9] = x10 >>> 8 & 0xff;\n o[10] = x10 >>> 16 & 0xff;\n o[11] = x10 >>> 24 & 0xff;\n\n o[12] = x15 >>> 0 & 0xff;\n o[13] = x15 >>> 8 & 0xff;\n o[14] = x15 >>> 16 & 0xff;\n o[15] = x15 >>> 24 & 0xff;\n\n o[16] = x6 >>> 0 & 0xff;\n o[17] = x6 >>> 8 & 0xff;\n o[18] = x6 >>> 16 & 0xff;\n o[19] = x6 >>> 24 & 0xff;\n\n o[20] = x7 >>> 0 & 0xff;\n o[21] = x7 >>> 8 & 0xff;\n o[22] = x7 >>> 16 & 0xff;\n o[23] = x7 >>> 24 & 0xff;\n\n o[24] = x8 >>> 0 & 0xff;\n o[25] = x8 >>> 8 & 0xff;\n o[26] = x8 >>> 16 & 0xff;\n o[27] = x8 >>> 24 & 0xff;\n\n o[28] = x9 >>> 0 & 0xff;\n o[29] = x9 >>> 8 & 0xff;\n o[30] = x9 >>> 16 & 0xff;\n o[31] = x9 >>> 24 & 0xff;\n}\n\nfunction crypto_core_salsa20(out,inp,k,c) {\n core_salsa20(out,inp,k,c);\n}\n\nfunction crypto_core_hsalsa20(out,inp,k,c) {\n core_hsalsa20(out,inp,k,c);\n}\n\nvar sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);\n // \"expand 32-byte k\"\n\nfunction crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n mpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];\n }\n return 0;\n}\n\nfunction crypto_stream_salsa20(c,cpos,b,n,k) {\n var z = new Uint8Array(16), x = new Uint8Array(64);\n var u, i;\n for (i = 0; i < 16; i++) z[i] = 0;\n for (i = 0; i < 8; i++) z[i] = n[i];\n while (b >= 64) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < 64; i++) c[cpos+i] = x[i];\n u = 1;\n for (i = 8; i < 16; i++) {\n u = u + (z[i] & 0xff) | 0;\n z[i] = u & 0xff;\n u >>>= 8;\n }\n b -= 64;\n cpos += 64;\n }\n if (b > 0) {\n crypto_core_salsa20(x,z,k,sigma);\n for (i = 0; i < b; i++) c[cpos+i] = x[i];\n }\n return 0;\n}\n\nfunction crypto_stream(c,cpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20(c,cpos,d,sn,s);\n}\n\nfunction crypto_stream_xor(c,cpos,m,mpos,d,n,k) {\n var s = new Uint8Array(32);\n crypto_core_hsalsa20(s,n,k,sigma);\n var sn = new Uint8Array(8);\n for (var i = 0; i < 8; i++) sn[i] = n[i+16];\n return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);\n}\n\n/*\n* Port of Andrew Moon's Poly1305-donna-16. Public domain.\n* https://github.com/floodyberry/poly1305-donna\n*/\n\nvar poly1305 = function(key) {\n this.buffer = new Uint8Array(16);\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.leftover = 0;\n this.fin = 0;\n\n var t0, t1, t2, t3, t4, t5, t6, t7;\n\n t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;\n t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;\n t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;\n this.r[5] = ((t4 >>> 1)) & 0x1ffe;\n t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;\n t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n this.r[9] = ((t7 >>> 5)) & 0x007f;\n\n this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;\n this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;\n this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;\n this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;\n this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;\n this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;\n this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;\n this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;\n};\n\npoly1305.prototype.blocks = function(m, mpos, bytes) {\n var hibit = this.fin ? 0 : (1 << 11);\n var t0, t1, t2, t3, t4, t5, t6, t7, c;\n var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;\n\n var h0 = this.h[0],\n h1 = this.h[1],\n h2 = this.h[2],\n h3 = this.h[3],\n h4 = this.h[4],\n h5 = this.h[5],\n h6 = this.h[6],\n h7 = this.h[7],\n h8 = this.h[8],\n h9 = this.h[9];\n\n var r0 = this.r[0],\n r1 = this.r[1],\n r2 = this.r[2],\n r3 = this.r[3],\n r4 = this.r[4],\n r5 = this.r[5],\n r6 = this.r[6],\n r7 = this.r[7],\n r8 = this.r[8],\n r9 = this.r[9];\n\n while (bytes >= 16) {\n t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;\n t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;\n t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;\n t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;\n t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;\n h5 += ((t4 >>> 1)) & 0x1fff;\n t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;\n t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;\n t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;\n h9 += ((t7 >>> 5)) | hibit;\n\n c = 0;\n\n d0 = c;\n d0 += h0 * r0;\n d0 += h1 * (5 * r9);\n d0 += h2 * (5 * r8);\n d0 += h3 * (5 * r7);\n d0 += h4 * (5 * r6);\n c = (d0 >>> 13); d0 &= 0x1fff;\n d0 += h5 * (5 * r5);\n d0 += h6 * (5 * r4);\n d0 += h7 * (5 * r3);\n d0 += h8 * (5 * r2);\n d0 += h9 * (5 * r1);\n c += (d0 >>> 13); d0 &= 0x1fff;\n\n d1 = c;\n d1 += h0 * r1;\n d1 += h1 * r0;\n d1 += h2 * (5 * r9);\n d1 += h3 * (5 * r8);\n d1 += h4 * (5 * r7);\n c = (d1 >>> 13); d1 &= 0x1fff;\n d1 += h5 * (5 * r6);\n d1 += h6 * (5 * r5);\n d1 += h7 * (5 * r4);\n d1 += h8 * (5 * r3);\n d1 += h9 * (5 * r2);\n c += (d1 >>> 13); d1 &= 0x1fff;\n\n d2 = c;\n d2 += h0 * r2;\n d2 += h1 * r1;\n d2 += h2 * r0;\n d2 += h3 * (5 * r9);\n d2 += h4 * (5 * r8);\n c = (d2 >>> 13); d2 &= 0x1fff;\n d2 += h5 * (5 * r7);\n d2 += h6 * (5 * r6);\n d2 += h7 * (5 * r5);\n d2 += h8 * (5 * r4);\n d2 += h9 * (5 * r3);\n c += (d2 >>> 13); d2 &= 0x1fff;\n\n d3 = c;\n d3 += h0 * r3;\n d3 += h1 * r2;\n d3 += h2 * r1;\n d3 += h3 * r0;\n d3 += h4 * (5 * r9);\n c = (d3 >>> 13); d3 &= 0x1fff;\n d3 += h5 * (5 * r8);\n d3 += h6 * (5 * r7);\n d3 += h7 * (5 * r6);\n d3 += h8 * (5 * r5);\n d3 += h9 * (5 * r4);\n c += (d3 >>> 13); d3 &= 0x1fff;\n\n d4 = c;\n d4 += h0 * r4;\n d4 += h1 * r3;\n d4 += h2 * r2;\n d4 += h3 * r1;\n d4 += h4 * r0;\n c = (d4 >>> 13); d4 &= 0x1fff;\n d4 += h5 * (5 * r9);\n d4 += h6 * (5 * r8);\n d4 += h7 * (5 * r7);\n d4 += h8 * (5 * r6);\n d4 += h9 * (5 * r5);\n c += (d4 >>> 13); d4 &= 0x1fff;\n\n d5 = c;\n d5 += h0 * r5;\n d5 += h1 * r4;\n d5 += h2 * r3;\n d5 += h3 * r2;\n d5 += h4 * r1;\n c = (d5 >>> 13); d5 &= 0x1fff;\n d5 += h5 * r0;\n d5 += h6 * (5 * r9);\n d5 += h7 * (5 * r8);\n d5 += h8 * (5 * r7);\n d5 += h9 * (5 * r6);\n c += (d5 >>> 13); d5 &= 0x1fff;\n\n d6 = c;\n d6 += h0 * r6;\n d6 += h1 * r5;\n d6 += h2 * r4;\n d6 += h3 * r3;\n d6 += h4 * r2;\n c = (d6 >>> 13); d6 &= 0x1fff;\n d6 += h5 * r1;\n d6 += h6 * r0;\n d6 += h7 * (5 * r9);\n d6 += h8 * (5 * r8);\n d6 += h9 * (5 * r7);\n c += (d6 >>> 13); d6 &= 0x1fff;\n\n d7 = c;\n d7 += h0 * r7;\n d7 += h1 * r6;\n d7 += h2 * r5;\n d7 += h3 * r4;\n d7 += h4 * r3;\n c = (d7 >>> 13); d7 &= 0x1fff;\n d7 += h5 * r2;\n d7 += h6 * r1;\n d7 += h7 * r0;\n d7 += h8 * (5 * r9);\n d7 += h9 * (5 * r8);\n c += (d7 >>> 13); d7 &= 0x1fff;\n\n d8 = c;\n d8 += h0 * r8;\n d8 += h1 * r7;\n d8 += h2 * r6;\n d8 += h3 * r5;\n d8 += h4 * r4;\n c = (d8 >>> 13); d8 &= 0x1fff;\n d8 += h5 * r3;\n d8 += h6 * r2;\n d8 += h7 * r1;\n d8 += h8 * r0;\n d8 += h9 * (5 * r9);\n c += (d8 >>> 13); d8 &= 0x1fff;\n\n d9 = c;\n d9 += h0 * r9;\n d9 += h1 * r8;\n d9 += h2 * r7;\n d9 += h3 * r6;\n d9 += h4 * r5;\n c = (d9 >>> 13); d9 &= 0x1fff;\n d9 += h5 * r4;\n d9 += h6 * r3;\n d9 += h7 * r2;\n d9 += h8 * r1;\n d9 += h9 * r0;\n c += (d9 >>> 13); d9 &= 0x1fff;\n\n c = (((c << 2) + c)) | 0;\n c = (c + d0) | 0;\n d0 = c & 0x1fff;\n c = (c >>> 13);\n d1 += c;\n\n h0 = d0;\n h1 = d1;\n h2 = d2;\n h3 = d3;\n h4 = d4;\n h5 = d5;\n h6 = d6;\n h7 = d7;\n h8 = d8;\n h9 = d9;\n\n mpos += 16;\n bytes -= 16;\n }\n this.h[0] = h0;\n this.h[1] = h1;\n this.h[2] = h2;\n this.h[3] = h3;\n this.h[4] = h4;\n this.h[5] = h5;\n this.h[6] = h6;\n this.h[7] = h7;\n this.h[8] = h8;\n this.h[9] = h9;\n};\n\npoly1305.prototype.finish = function(mac, macpos) {\n var g = new Uint16Array(10);\n var c, mask, f, i;\n\n if (this.leftover) {\n i = this.leftover;\n this.buffer[i++] = 1;\n for (; i < 16; i++) this.buffer[i] = 0;\n this.fin = 1;\n this.blocks(this.buffer, 0, 16);\n }\n\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n for (i = 2; i < 10; i++) {\n this.h[i] += c;\n c = this.h[i] >>> 13;\n this.h[i] &= 0x1fff;\n }\n this.h[0] += (c * 5);\n c = this.h[0] >>> 13;\n this.h[0] &= 0x1fff;\n this.h[1] += c;\n c = this.h[1] >>> 13;\n this.h[1] &= 0x1fff;\n this.h[2] += c;\n\n g[0] = this.h[0] + 5;\n c = g[0] >>> 13;\n g[0] &= 0x1fff;\n for (i = 1; i < 10; i++) {\n g[i] = this.h[i] + c;\n c = g[i] >>> 13;\n g[i] &= 0x1fff;\n }\n g[9] -= (1 << 13);\n\n mask = (c ^ 1) - 1;\n for (i = 0; i < 10; i++) g[i] &= mask;\n mask = ~mask;\n for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];\n\n this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;\n this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;\n this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;\n this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;\n this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;\n this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;\n this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;\n this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;\n\n f = this.h[0] + this.pad[0];\n this.h[0] = f & 0xffff;\n for (i = 1; i < 8; i++) {\n f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;\n this.h[i] = f & 0xffff;\n }\n\n mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;\n mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;\n mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;\n mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;\n mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;\n mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;\n mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;\n mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;\n mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;\n mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;\n mac[macpos+10] = (this.h[5] >>> 0) & 0xff;\n mac[macpos+11] = (this.h[5] >>> 8) & 0xff;\n mac[macpos+12] = (this.h[6] >>> 0) & 0xff;\n mac[macpos+13] = (this.h[6] >>> 8) & 0xff;\n mac[macpos+14] = (this.h[7] >>> 0) & 0xff;\n mac[macpos+15] = (this.h[7] >>> 8) & 0xff;\n};\n\npoly1305.prototype.update = function(m, mpos, bytes) {\n var i, want;\n\n if (this.leftover) {\n want = (16 - this.leftover);\n if (want > bytes)\n want = bytes;\n for (i = 0; i < want; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n bytes -= want;\n mpos += want;\n this.leftover += want;\n if (this.leftover < 16)\n return;\n this.blocks(this.buffer, 0, 16);\n this.leftover = 0;\n }\n\n if (bytes >= 16) {\n want = bytes - (bytes % 16);\n this.blocks(m, mpos, want);\n mpos += want;\n bytes -= want;\n }\n\n if (bytes) {\n for (i = 0; i < bytes; i++)\n this.buffer[this.leftover + i] = m[mpos+i];\n this.leftover += bytes;\n }\n};\n\nfunction crypto_onetimeauth(out, outpos, m, mpos, n, k) {\n var s = new poly1305(k);\n s.update(m, mpos, n);\n s.finish(out, outpos);\n return 0;\n}\n\nfunction crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {\n var x = new Uint8Array(16);\n crypto_onetimeauth(x,0,m,mpos,n,k);\n return crypto_verify_16(h,hpos,x,0);\n}\n\nfunction crypto_secretbox(c,m,d,n,k) {\n var i;\n if (d < 32) return -1;\n crypto_stream_xor(c,0,m,0,d,n,k);\n crypto_onetimeauth(c, 16, c, 32, d - 32, c);\n for (i = 0; i < 16; i++) c[i] = 0;\n return 0;\n}\n\nfunction crypto_secretbox_open(m,c,d,n,k) {\n var i;\n var x = new Uint8Array(32);\n if (d < 32) return -1;\n crypto_stream(x,0,32,n,k);\n if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;\n crypto_stream_xor(m,0,c,0,d,n,k);\n for (i = 0; i < 32; i++) m[i] = 0;\n return 0;\n}\n\nfunction set25519(r, a) {\n var i;\n for (i = 0; i < 16; i++) r[i] = a[i]|0;\n}\n\nfunction car25519(o) {\n var i, v, c = 1;\n for (i = 0; i < 16; i++) {\n v = o[i] + c + 65535;\n c = Math.floor(v / 65536);\n o[i] = v - c * 65536;\n }\n o[0] += c-1 + 37 * (c-1);\n}\n\nfunction sel25519(p, q, b) {\n var t, c = ~(b-1);\n for (var i = 0; i < 16; i++) {\n t = c & (p[i] ^ q[i]);\n p[i] ^= t;\n q[i] ^= t;\n }\n}\n\nfunction pack25519(o, n) {\n var i, j, b;\n var m = gf(), t = gf();\n for (i = 0; i < 16; i++) t[i] = n[i];\n car25519(t);\n car25519(t);\n car25519(t);\n for (j = 0; j < 2; j++) {\n m[0] = t[0] - 0xffed;\n for (i = 1; i < 15; i++) {\n m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);\n m[i-1] &= 0xffff;\n }\n m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);\n b = (m[15]>>16) & 1;\n m[14] &= 0xffff;\n sel25519(t, m, 1-b);\n }\n for (i = 0; i < 16; i++) {\n o[2*i] = t[i] & 0xff;\n o[2*i+1] = t[i]>>8;\n }\n}\n\nfunction neq25519(a, b) {\n var c = new Uint8Array(32), d = new Uint8Array(32);\n pack25519(c, a);\n pack25519(d, b);\n return crypto_verify_32(c, 0, d, 0);\n}\n\nfunction par25519(a) {\n var d = new Uint8Array(32);\n pack25519(d, a);\n return d[0] & 1;\n}\n\nfunction unpack25519(o, n) {\n var i;\n for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);\n o[15] &= 0x7fff;\n}\n\nfunction A(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];\n}\n\nfunction Z(o, a, b) {\n for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];\n}\n\nfunction M(o, a, b) {\n var v, c,\n t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,\n t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,\n t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,\n t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,\n b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11],\n b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n\n v = a[0];\n t0 += v * b0;\n t1 += v * b1;\n t2 += v * b2;\n t3 += v * b3;\n t4 += v * b4;\n t5 += v * b5;\n t6 += v * b6;\n t7 += v * b7;\n t8 += v * b8;\n t9 += v * b9;\n t10 += v * b10;\n t11 += v * b11;\n t12 += v * b12;\n t13 += v * b13;\n t14 += v * b14;\n t15 += v * b15;\n v = a[1];\n t1 += v * b0;\n t2 += v * b1;\n t3 += v * b2;\n t4 += v * b3;\n t5 += v * b4;\n t6 += v * b5;\n t7 += v * b6;\n t8 += v * b7;\n t9 += v * b8;\n t10 += v * b9;\n t11 += v * b10;\n t12 += v * b11;\n t13 += v * b12;\n t14 += v * b13;\n t15 += v * b14;\n t16 += v * b15;\n v = a[2];\n t2 += v * b0;\n t3 += v * b1;\n t4 += v * b2;\n t5 += v * b3;\n t6 += v * b4;\n t7 += v * b5;\n t8 += v * b6;\n t9 += v * b7;\n t10 += v * b8;\n t11 += v * b9;\n t12 += v * b10;\n t13 += v * b11;\n t14 += v * b12;\n t15 += v * b13;\n t16 += v * b14;\n t17 += v * b15;\n v = a[3];\n t3 += v * b0;\n t4 += v * b1;\n t5 += v * b2;\n t6 += v * b3;\n t7 += v * b4;\n t8 += v * b5;\n t9 += v * b6;\n t10 += v * b7;\n t11 += v * b8;\n t12 += v * b9;\n t13 += v * b10;\n t14 += v * b11;\n t15 += v * b12;\n t16 += v * b13;\n t17 += v * b14;\n t18 += v * b15;\n v = a[4];\n t4 += v * b0;\n t5 += v * b1;\n t6 += v * b2;\n t7 += v * b3;\n t8 += v * b4;\n t9 += v * b5;\n t10 += v * b6;\n t11 += v * b7;\n t12 += v * b8;\n t13 += v * b9;\n t14 += v * b10;\n t15 += v * b11;\n t16 += v * b12;\n t17 += v * b13;\n t18 += v * b14;\n t19 += v * b15;\n v = a[5];\n t5 += v * b0;\n t6 += v * b1;\n t7 += v * b2;\n t8 += v * b3;\n t9 += v * b4;\n t10 += v * b5;\n t11 += v * b6;\n t12 += v * b7;\n t13 += v * b8;\n t14 += v * b9;\n t15 += v * b10;\n t16 += v * b11;\n t17 += v * b12;\n t18 += v * b13;\n t19 += v * b14;\n t20 += v * b15;\n v = a[6];\n t6 += v * b0;\n t7 += v * b1;\n t8 += v * b2;\n t9 += v * b3;\n t10 += v * b4;\n t11 += v * b5;\n t12 += v * b6;\n t13 += v * b7;\n t14 += v * b8;\n t15 += v * b9;\n t16 += v * b10;\n t17 += v * b11;\n t18 += v * b12;\n t19 += v * b13;\n t20 += v * b14;\n t21 += v * b15;\n v = a[7];\n t7 += v * b0;\n t8 += v * b1;\n t9 += v * b2;\n t10 += v * b3;\n t11 += v * b4;\n t12 += v * b5;\n t13 += v * b6;\n t14 += v * b7;\n t15 += v * b8;\n t16 += v * b9;\n t17 += v * b10;\n t18 += v * b11;\n t19 += v * b12;\n t20 += v * b13;\n t21 += v * b14;\n t22 += v * b15;\n v = a[8];\n t8 += v * b0;\n t9 += v * b1;\n t10 += v * b2;\n t11 += v * b3;\n t12 += v * b4;\n t13 += v * b5;\n t14 += v * b6;\n t15 += v * b7;\n t16 += v * b8;\n t17 += v * b9;\n t18 += v * b10;\n t19 += v * b11;\n t20 += v * b12;\n t21 += v * b13;\n t22 += v * b14;\n t23 += v * b15;\n v = a[9];\n t9 += v * b0;\n t10 += v * b1;\n t11 += v * b2;\n t12 += v * b3;\n t13 += v * b4;\n t14 += v * b5;\n t15 += v * b6;\n t16 += v * b7;\n t17 += v * b8;\n t18 += v * b9;\n t19 += v * b10;\n t20 += v * b11;\n t21 += v * b12;\n t22 += v * b13;\n t23 += v * b14;\n t24 += v * b15;\n v = a[10];\n t10 += v * b0;\n t11 += v * b1;\n t12 += v * b2;\n t13 += v * b3;\n t14 += v * b4;\n t15 += v * b5;\n t16 += v * b6;\n t17 += v * b7;\n t18 += v * b8;\n t19 += v * b9;\n t20 += v * b10;\n t21 += v * b11;\n t22 += v * b12;\n t23 += v * b13;\n t24 += v * b14;\n t25 += v * b15;\n v = a[11];\n t11 += v * b0;\n t12 += v * b1;\n t13 += v * b2;\n t14 += v * b3;\n t15 += v * b4;\n t16 += v * b5;\n t17 += v * b6;\n t18 += v * b7;\n t19 += v * b8;\n t20 += v * b9;\n t21 += v * b10;\n t22 += v * b11;\n t23 += v * b12;\n t24 += v * b13;\n t25 += v * b14;\n t26 += v * b15;\n v = a[12];\n t12 += v * b0;\n t13 += v * b1;\n t14 += v * b2;\n t15 += v * b3;\n t16 += v * b4;\n t17 += v * b5;\n t18 += v * b6;\n t19 += v * b7;\n t20 += v * b8;\n t21 += v * b9;\n t22 += v * b10;\n t23 += v * b11;\n t24 += v * b12;\n t25 += v * b13;\n t26 += v * b14;\n t27 += v * b15;\n v = a[13];\n t13 += v * b0;\n t14 += v * b1;\n t15 += v * b2;\n t16 += v * b3;\n t17 += v * b4;\n t18 += v * b5;\n t19 += v * b6;\n t20 += v * b7;\n t21 += v * b8;\n t22 += v * b9;\n t23 += v * b10;\n t24 += v * b11;\n t25 += v * b12;\n t26 += v * b13;\n t27 += v * b14;\n t28 += v * b15;\n v = a[14];\n t14 += v * b0;\n t15 += v * b1;\n t16 += v * b2;\n t17 += v * b3;\n t18 += v * b4;\n t19 += v * b5;\n t20 += v * b6;\n t21 += v * b7;\n t22 += v * b8;\n t23 += v * b9;\n t24 += v * b10;\n t25 += v * b11;\n t26 += v * b12;\n t27 += v * b13;\n t28 += v * b14;\n t29 += v * b15;\n v = a[15];\n t15 += v * b0;\n t16 += v * b1;\n t17 += v * b2;\n t18 += v * b3;\n t19 += v * b4;\n t20 += v * b5;\n t21 += v * b6;\n t22 += v * b7;\n t23 += v * b8;\n t24 += v * b9;\n t25 += v * b10;\n t26 += v * b11;\n t27 += v * b12;\n t28 += v * b13;\n t29 += v * b14;\n t30 += v * b15;\n\n t0 += 38 * t16;\n t1 += 38 * t17;\n t2 += 38 * t18;\n t3 += 38 * t19;\n t4 += 38 * t20;\n t5 += 38 * t21;\n t6 += 38 * t22;\n t7 += 38 * t23;\n t8 += 38 * t24;\n t9 += 38 * t25;\n t10 += 38 * t26;\n t11 += 38 * t27;\n t12 += 38 * t28;\n t13 += 38 * t29;\n t14 += 38 * t30;\n // t15 left as is\n\n // first car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n // second car\n c = 1;\n v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;\n v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;\n v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;\n v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;\n v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;\n v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;\n v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;\n v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;\n v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;\n v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;\n v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;\n v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;\n v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;\n v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;\n v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;\n v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;\n t0 += c-1 + 37 * (c-1);\n\n o[ 0] = t0;\n o[ 1] = t1;\n o[ 2] = t2;\n o[ 3] = t3;\n o[ 4] = t4;\n o[ 5] = t5;\n o[ 6] = t6;\n o[ 7] = t7;\n o[ 8] = t8;\n o[ 9] = t9;\n o[10] = t10;\n o[11] = t11;\n o[12] = t12;\n o[13] = t13;\n o[14] = t14;\n o[15] = t15;\n}\n\nfunction S(o, a) {\n M(o, a, a);\n}\n\nfunction inv25519(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 253; a >= 0; a--) {\n S(c, c);\n if(a !== 2 && a !== 4) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction pow2523(o, i) {\n var c = gf();\n var a;\n for (a = 0; a < 16; a++) c[a] = i[a];\n for (a = 250; a >= 0; a--) {\n S(c, c);\n if(a !== 1) M(c, c, i);\n }\n for (a = 0; a < 16; a++) o[a] = c[a];\n}\n\nfunction crypto_scalarmult(q, n, p) {\n var z = new Uint8Array(32);\n var x = new Float64Array(80), r, i;\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf();\n for (i = 0; i < 31; i++) z[i] = n[i];\n z[31]=(n[31]&127)|64;\n z[0]&=248;\n unpack25519(x,p);\n for (i = 0; i < 16; i++) {\n b[i]=x[i];\n d[i]=a[i]=c[i]=0;\n }\n a[0]=d[0]=1;\n for (i=254; i>=0; --i) {\n r=(z[i>>>3]>>>(i&7))&1;\n sel25519(a,b,r);\n sel25519(c,d,r);\n A(e,a,c);\n Z(a,a,c);\n A(c,b,d);\n Z(b,b,d);\n S(d,e);\n S(f,a);\n M(a,c,a);\n M(c,b,e);\n A(e,a,c);\n Z(a,a,c);\n S(b,a);\n Z(c,d,f);\n M(a,c,_121665);\n A(a,a,d);\n M(c,c,a);\n M(a,d,f);\n M(d,b,x);\n S(b,e);\n sel25519(a,b,r);\n sel25519(c,d,r);\n }\n for (i = 0; i < 16; i++) {\n x[i+16]=a[i];\n x[i+32]=c[i];\n x[i+48]=b[i];\n x[i+64]=d[i];\n }\n var x32 = x.subarray(32);\n var x16 = x.subarray(16);\n inv25519(x32,x32);\n M(x16,x16,x32);\n pack25519(q,x16);\n return 0;\n}\n\nfunction crypto_scalarmult_base(q, n) {\n return crypto_scalarmult(q, n, _9);\n}\n\nfunction crypto_box_keypair(y, x) {\n randombytes(x, 32);\n return crypto_scalarmult_base(y, x);\n}\n\nfunction crypto_box_beforenm(k, y, x) {\n var s = new Uint8Array(32);\n crypto_scalarmult(s, x, y);\n return crypto_core_hsalsa20(k, _0, s, sigma);\n}\n\nvar crypto_box_afternm = crypto_secretbox;\nvar crypto_box_open_afternm = crypto_secretbox_open;\n\nfunction crypto_box(c, m, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_afternm(c, m, d, n, k);\n}\n\nfunction crypto_box_open(m, c, d, n, y, x) {\n var k = new Uint8Array(32);\n crypto_box_beforenm(k, y, x);\n return crypto_box_open_afternm(m, c, d, n, k);\n}\n\nvar K = [\n 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,\n 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,\n 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,\n 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,\n 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,\n 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,\n 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,\n 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,\n 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,\n 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,\n 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,\n 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,\n 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,\n 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,\n 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,\n 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,\n 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,\n 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,\n 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,\n 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,\n 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,\n 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,\n 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,\n 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,\n 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,\n 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,\n 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,\n 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,\n 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,\n 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,\n 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,\n 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,\n 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,\n 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,\n 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,\n 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,\n 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,\n 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,\n 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,\n 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817\n];\n\nfunction crypto_hashblocks_hl(hh, hl, m, n) {\n var wh = new Int32Array(16), wl = new Int32Array(16),\n bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,\n bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,\n th, tl, i, j, h, l, a, b, c, d;\n\n var ah0 = hh[0],\n ah1 = hh[1],\n ah2 = hh[2],\n ah3 = hh[3],\n ah4 = hh[4],\n ah5 = hh[5],\n ah6 = hh[6],\n ah7 = hh[7],\n\n al0 = hl[0],\n al1 = hl[1],\n al2 = hl[2],\n al3 = hl[3],\n al4 = hl[4],\n al5 = hl[5],\n al6 = hl[6],\n al7 = hl[7];\n\n var pos = 0;\n while (n >= 128) {\n for (i = 0; i < 16; i++) {\n j = 8 * i + pos;\n wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];\n wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];\n }\n for (i = 0; i < 80; i++) {\n bh0 = ah0;\n bh1 = ah1;\n bh2 = ah2;\n bh3 = ah3;\n bh4 = ah4;\n bh5 = ah5;\n bh6 = ah6;\n bh7 = ah7;\n\n bl0 = al0;\n bl1 = al1;\n bl2 = al2;\n bl3 = al3;\n bl4 = al4;\n bl5 = al5;\n bl6 = al6;\n bl7 = al7;\n\n // add\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma1\n h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));\n l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Ch\n h = (ah4 & ah5) ^ (~ah4 & ah6);\n l = (al4 & al5) ^ (~al4 & al6);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // K\n h = K[i*2];\n l = K[i*2+1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // w\n h = wh[i%16];\n l = wl[i%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n th = c & 0xffff | d << 16;\n tl = a & 0xffff | b << 16;\n\n // add\n h = th;\n l = tl;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n // Sigma0\n h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));\n l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // Maj\n h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);\n l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh7 = (c & 0xffff) | (d << 16);\n bl7 = (a & 0xffff) | (b << 16);\n\n // add\n h = bh3;\n l = bl3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = th;\n l = tl;\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n bh3 = (c & 0xffff) | (d << 16);\n bl3 = (a & 0xffff) | (b << 16);\n\n ah1 = bh0;\n ah2 = bh1;\n ah3 = bh2;\n ah4 = bh3;\n ah5 = bh4;\n ah6 = bh5;\n ah7 = bh6;\n ah0 = bh7;\n\n al1 = bl0;\n al2 = bl1;\n al3 = bl2;\n al4 = bl3;\n al5 = bl4;\n al6 = bl5;\n al7 = bl6;\n al0 = bl7;\n\n if (i%16 === 15) {\n for (j = 0; j < 16; j++) {\n // add\n h = wh[j];\n l = wl[j];\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = wh[(j+9)%16];\n l = wl[(j+9)%16];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma0\n th = wh[(j+1)%16];\n tl = wl[(j+1)%16];\n h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);\n l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n // sigma1\n th = wh[(j+14)%16];\n tl = wl[(j+14)%16];\n h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);\n l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n wh[j] = (c & 0xffff) | (d << 16);\n wl[j] = (a & 0xffff) | (b << 16);\n }\n }\n }\n\n // add\n h = ah0;\n l = al0;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[0];\n l = hl[0];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[0] = ah0 = (c & 0xffff) | (d << 16);\n hl[0] = al0 = (a & 0xffff) | (b << 16);\n\n h = ah1;\n l = al1;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[1];\n l = hl[1];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[1] = ah1 = (c & 0xffff) | (d << 16);\n hl[1] = al1 = (a & 0xffff) | (b << 16);\n\n h = ah2;\n l = al2;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[2];\n l = hl[2];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[2] = ah2 = (c & 0xffff) | (d << 16);\n hl[2] = al2 = (a & 0xffff) | (b << 16);\n\n h = ah3;\n l = al3;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[3];\n l = hl[3];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[3] = ah3 = (c & 0xffff) | (d << 16);\n hl[3] = al3 = (a & 0xffff) | (b << 16);\n\n h = ah4;\n l = al4;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[4];\n l = hl[4];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[4] = ah4 = (c & 0xffff) | (d << 16);\n hl[4] = al4 = (a & 0xffff) | (b << 16);\n\n h = ah5;\n l = al5;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[5];\n l = hl[5];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[5] = ah5 = (c & 0xffff) | (d << 16);\n hl[5] = al5 = (a & 0xffff) | (b << 16);\n\n h = ah6;\n l = al6;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[6];\n l = hl[6];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[6] = ah6 = (c & 0xffff) | (d << 16);\n hl[6] = al6 = (a & 0xffff) | (b << 16);\n\n h = ah7;\n l = al7;\n\n a = l & 0xffff; b = l >>> 16;\n c = h & 0xffff; d = h >>> 16;\n\n h = hh[7];\n l = hl[7];\n\n a += l & 0xffff; b += l >>> 16;\n c += h & 0xffff; d += h >>> 16;\n\n b += a >>> 16;\n c += b >>> 16;\n d += c >>> 16;\n\n hh[7] = ah7 = (c & 0xffff) | (d << 16);\n hl[7] = al7 = (a & 0xffff) | (b << 16);\n\n pos += 128;\n n -= 128;\n }\n\n return n;\n}\n\nfunction crypto_hash(out, m, n) {\n var hh = new Int32Array(8),\n hl = new Int32Array(8),\n x = new Uint8Array(256),\n i, b = n;\n\n hh[0] = 0x6a09e667;\n hh[1] = 0xbb67ae85;\n hh[2] = 0x3c6ef372;\n hh[3] = 0xa54ff53a;\n hh[4] = 0x510e527f;\n hh[5] = 0x9b05688c;\n hh[6] = 0x1f83d9ab;\n hh[7] = 0x5be0cd19;\n\n hl[0] = 0xf3bcc908;\n hl[1] = 0x84caa73b;\n hl[2] = 0xfe94f82b;\n hl[3] = 0x5f1d36f1;\n hl[4] = 0xade682d1;\n hl[5] = 0x2b3e6c1f;\n hl[6] = 0xfb41bd6b;\n hl[7] = 0x137e2179;\n\n crypto_hashblocks_hl(hh, hl, m, n);\n n %= 128;\n\n for (i = 0; i < n; i++) x[i] = m[b-n+i];\n x[n] = 128;\n\n n = 256-128*(n<112?1:0);\n x[n-9] = 0;\n ts64(x, n-8, (b / 0x20000000) | 0, b << 3);\n crypto_hashblocks_hl(hh, hl, x, n);\n\n for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);\n\n return 0;\n}\n\nfunction add(p, q) {\n var a = gf(), b = gf(), c = gf(),\n d = gf(), e = gf(), f = gf(),\n g = gf(), h = gf(), t = gf();\n\n Z(a, p[1], p[0]);\n Z(t, q[1], q[0]);\n M(a, a, t);\n A(b, p[0], p[1]);\n A(t, q[0], q[1]);\n M(b, b, t);\n M(c, p[3], q[3]);\n M(c, c, D2);\n M(d, p[2], q[2]);\n A(d, d, d);\n Z(e, b, a);\n Z(f, d, c);\n A(g, d, c);\n A(h, b, a);\n\n M(p[0], e, f);\n M(p[1], h, g);\n M(p[2], g, f);\n M(p[3], e, h);\n}\n\nfunction cswap(p, q, b) {\n var i;\n for (i = 0; i < 4; i++) {\n sel25519(p[i], q[i], b);\n }\n}\n\nfunction pack(r, p) {\n var tx = gf(), ty = gf(), zi = gf();\n inv25519(zi, p[2]);\n M(tx, p[0], zi);\n M(ty, p[1], zi);\n pack25519(r, ty);\n r[31] ^= par25519(tx) << 7;\n}\n\nfunction scalarmult(p, q, s) {\n var b, i;\n set25519(p[0], gf0);\n set25519(p[1], gf1);\n set25519(p[2], gf1);\n set25519(p[3], gf0);\n for (i = 255; i >= 0; --i) {\n b = (s[(i/8)|0] >> (i&7)) & 1;\n cswap(p, q, b);\n add(q, p);\n add(p, p);\n cswap(p, q, b);\n }\n}\n\nfunction scalarbase(p, s) {\n var q = [gf(), gf(), gf(), gf()];\n set25519(q[0], X);\n set25519(q[1], Y);\n set25519(q[2], gf1);\n M(q[3], X, Y);\n scalarmult(p, q, s);\n}\n\nfunction crypto_sign_keypair(pk, sk, seeded) {\n var d = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()];\n var i;\n\n if (!seeded) randombytes(sk, 32);\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n scalarbase(p, d);\n pack(pk, p);\n\n for (i = 0; i < 32; i++) sk[i+32] = pk[i];\n return 0;\n}\n\nvar L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);\n\nfunction modL(r, x) {\n var carry, i, j, k;\n for (i = 63; i >= 32; --i) {\n carry = 0;\n for (j = i - 32, k = i - 12; j < k; ++j) {\n x[j] += carry - 16 * x[i] * L[j - (i - 32)];\n carry = (x[j] + 128) >> 8;\n x[j] -= carry * 256;\n }\n x[j] += carry;\n x[i] = 0;\n }\n carry = 0;\n for (j = 0; j < 32; j++) {\n x[j] += carry - (x[31] >> 4) * L[j];\n carry = x[j] >> 8;\n x[j] &= 255;\n }\n for (j = 0; j < 32; j++) x[j] -= carry * L[j];\n for (i = 0; i < 32; i++) {\n x[i+1] += x[i] >> 8;\n r[i] = x[i] & 255;\n }\n}\n\nfunction reduce(r) {\n var x = new Float64Array(64), i;\n for (i = 0; i < 64; i++) x[i] = r[i];\n for (i = 0; i < 64; i++) r[i] = 0;\n modL(r, x);\n}\n\n// Note: difference from C - smlen returned, not passed as argument.\nfunction crypto_sign(sm, m, n, sk) {\n var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);\n var i, j, x = new Float64Array(64);\n var p = [gf(), gf(), gf(), gf()];\n\n crypto_hash(d, sk, 32);\n d[0] &= 248;\n d[31] &= 127;\n d[31] |= 64;\n\n var smlen = n + 64;\n for (i = 0; i < n; i++) sm[64 + i] = m[i];\n for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];\n\n crypto_hash(r, sm.subarray(32), n+32);\n reduce(r);\n scalarbase(p, r);\n pack(sm, p);\n\n for (i = 32; i < 64; i++) sm[i] = sk[i];\n crypto_hash(h, sm, n + 64);\n reduce(h);\n\n for (i = 0; i < 64; i++) x[i] = 0;\n for (i = 0; i < 32; i++) x[i] = r[i];\n for (i = 0; i < 32; i++) {\n for (j = 0; j < 32; j++) {\n x[i+j] += h[i] * d[j];\n }\n }\n\n modL(sm.subarray(32), x);\n return smlen;\n}\n\nfunction unpackneg(r, p) {\n var t = gf(), chk = gf(), num = gf(),\n den = gf(), den2 = gf(), den4 = gf(),\n den6 = gf();\n\n set25519(r[2], gf1);\n unpack25519(r[1], p);\n S(num, r[1]);\n M(den, num, D);\n Z(num, num, r[2]);\n A(den, r[2], den);\n\n S(den2, den);\n S(den4, den2);\n M(den6, den4, den2);\n M(t, den6, num);\n M(t, t, den);\n\n pow2523(t, t);\n M(t, t, num);\n M(t, t, den);\n M(t, t, den);\n M(r[0], t, den);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) M(r[0], r[0], I);\n\n S(chk, r[0]);\n M(chk, chk, den);\n if (neq25519(chk, num)) return -1;\n\n if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);\n\n M(r[3], r[0], r[1]);\n return 0;\n}\n\nfunction crypto_sign_open(m, sm, n, pk) {\n var i, mlen;\n var t = new Uint8Array(32), h = new Uint8Array(64);\n var p = [gf(), gf(), gf(), gf()],\n q = [gf(), gf(), gf(), gf()];\n\n mlen = -1;\n if (n < 64) return -1;\n\n if (unpackneg(q, pk)) return -1;\n\n for (i = 0; i < n; i++) m[i] = sm[i];\n for (i = 0; i < 32; i++) m[i+32] = pk[i];\n crypto_hash(h, m, n);\n reduce(h);\n scalarmult(p, q, h);\n\n scalarbase(q, sm.subarray(32));\n add(p, q);\n pack(t, p);\n\n n -= 64;\n if (crypto_verify_32(sm, 0, t, 0)) {\n for (i = 0; i < n; i++) m[i] = 0;\n return -1;\n }\n\n for (i = 0; i < n; i++) m[i] = sm[i + 64];\n mlen = n;\n return mlen;\n}\n\nvar crypto_secretbox_KEYBYTES = 32,\n crypto_secretbox_NONCEBYTES = 24,\n crypto_secretbox_ZEROBYTES = 32,\n crypto_secretbox_BOXZEROBYTES = 16,\n crypto_scalarmult_BYTES = 32,\n crypto_scalarmult_SCALARBYTES = 32,\n crypto_box_PUBLICKEYBYTES = 32,\n crypto_box_SECRETKEYBYTES = 32,\n crypto_box_BEFORENMBYTES = 32,\n crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,\n crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,\n crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,\n crypto_sign_BYTES = 64,\n crypto_sign_PUBLICKEYBYTES = 32,\n crypto_sign_SECRETKEYBYTES = 64,\n crypto_sign_SEEDBYTES = 32,\n crypto_hash_BYTES = 64;\n\nnacl.lowlevel = {\n crypto_core_hsalsa20: crypto_core_hsalsa20,\n crypto_stream_xor: crypto_stream_xor,\n crypto_stream: crypto_stream,\n crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,\n crypto_stream_salsa20: crypto_stream_salsa20,\n crypto_onetimeauth: crypto_onetimeauth,\n crypto_onetimeauth_verify: crypto_onetimeauth_verify,\n crypto_verify_16: crypto_verify_16,\n crypto_verify_32: crypto_verify_32,\n crypto_secretbox: crypto_secretbox,\n crypto_secretbox_open: crypto_secretbox_open,\n crypto_scalarmult: crypto_scalarmult,\n crypto_scalarmult_base: crypto_scalarmult_base,\n crypto_box_beforenm: crypto_box_beforenm,\n crypto_box_afternm: crypto_box_afternm,\n crypto_box: crypto_box,\n crypto_box_open: crypto_box_open,\n crypto_box_keypair: crypto_box_keypair,\n crypto_hash: crypto_hash,\n crypto_sign: crypto_sign,\n crypto_sign_keypair: crypto_sign_keypair,\n crypto_sign_open: crypto_sign_open,\n\n crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,\n crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,\n crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,\n crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,\n crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,\n crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,\n crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,\n crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,\n crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,\n crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,\n crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,\n crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,\n crypto_sign_BYTES: crypto_sign_BYTES,\n crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,\n crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,\n crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,\n crypto_hash_BYTES: crypto_hash_BYTES\n};\n\n/* High-level API */\n\nfunction checkLengths(k, n) {\n if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');\n if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');\n}\n\nfunction checkBoxLengths(pk, sk) {\n if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');\n if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');\n}\n\nfunction checkArrayTypes() {\n var t, i;\n for (i = 0; i < arguments.length; i++) {\n if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')\n throw new TypeError('unexpected type ' + t + ', use Uint8Array');\n }\n}\n\nfunction cleanup(arr) {\n for (var i = 0; i < arr.length; i++) arr[i] = 0;\n}\n\n// TODO: Completely remove this in v0.15.\nif (!nacl.util) {\n nacl.util = {};\n nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {\n throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');\n };\n}\n\nnacl.randomBytes = function(n) {\n var b = new Uint8Array(n);\n randombytes(b, n);\n return b;\n};\n\nnacl.secretbox = function(msg, nonce, key) {\n checkArrayTypes(msg, nonce, key);\n checkLengths(key, nonce);\n var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);\n var c = new Uint8Array(m.length);\n for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];\n crypto_secretbox(c, m, m.length, nonce, key);\n return c.subarray(crypto_secretbox_BOXZEROBYTES);\n};\n\nnacl.secretbox.open = function(box, nonce, key) {\n checkArrayTypes(box, nonce, key);\n checkLengths(key, nonce);\n var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);\n var m = new Uint8Array(c.length);\n for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];\n if (c.length < 32) return false;\n if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false;\n return m.subarray(crypto_secretbox_ZEROBYTES);\n};\n\nnacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;\nnacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;\nnacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;\n\nnacl.scalarMult = function(n, p) {\n checkArrayTypes(n, p);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult(q, n, p);\n return q;\n};\n\nnacl.scalarMult.base = function(n) {\n checkArrayTypes(n);\n if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');\n var q = new Uint8Array(crypto_scalarmult_BYTES);\n crypto_scalarmult_base(q, n);\n return q;\n};\n\nnacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;\nnacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;\n\nnacl.box = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox(msg, nonce, k);\n};\n\nnacl.box.before = function(publicKey, secretKey) {\n checkArrayTypes(publicKey, secretKey);\n checkBoxLengths(publicKey, secretKey);\n var k = new Uint8Array(crypto_box_BEFORENMBYTES);\n crypto_box_beforenm(k, publicKey, secretKey);\n return k;\n};\n\nnacl.box.after = nacl.secretbox;\n\nnacl.box.open = function(msg, nonce, publicKey, secretKey) {\n var k = nacl.box.before(publicKey, secretKey);\n return nacl.secretbox.open(msg, nonce, k);\n};\n\nnacl.box.open.after = nacl.secretbox.open;\n\nnacl.box.keyPair = function() {\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);\n crypto_box_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.box.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_box_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);\n crypto_scalarmult_base(pk, secretKey);\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;\nnacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;\nnacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;\nnacl.box.nonceLength = crypto_box_NONCEBYTES;\nnacl.box.overheadLength = nacl.secretbox.overheadLength;\n\nnacl.sign = function(msg, secretKey) {\n checkArrayTypes(msg, secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);\n crypto_sign(signedMsg, msg, msg.length, secretKey);\n return signedMsg;\n};\n\nnacl.sign.open = function(signedMsg, publicKey) {\n if (arguments.length !== 2)\n throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?');\n checkArrayTypes(signedMsg, publicKey);\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var tmp = new Uint8Array(signedMsg.length);\n var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);\n if (mlen < 0) return null;\n var m = new Uint8Array(mlen);\n for (var i = 0; i < m.length; i++) m[i] = tmp[i];\n return m;\n};\n\nnacl.sign.detached = function(msg, secretKey) {\n var signedMsg = nacl.sign(msg, secretKey);\n var sig = new Uint8Array(crypto_sign_BYTES);\n for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];\n return sig;\n};\n\nnacl.sign.detached.verify = function(msg, sig, publicKey) {\n checkArrayTypes(msg, sig, publicKey);\n if (sig.length !== crypto_sign_BYTES)\n throw new Error('bad signature size');\n if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)\n throw new Error('bad public key size');\n var sm = new Uint8Array(crypto_sign_BYTES + msg.length);\n var m = new Uint8Array(crypto_sign_BYTES + msg.length);\n var i;\n for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];\n for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];\n return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);\n};\n\nnacl.sign.keyPair = function() {\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n crypto_sign_keypair(pk, sk);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.keyPair.fromSecretKey = function(secretKey) {\n checkArrayTypes(secretKey);\n if (secretKey.length !== crypto_sign_SECRETKEYBYTES)\n throw new Error('bad secret key size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];\n return {publicKey: pk, secretKey: new Uint8Array(secretKey)};\n};\n\nnacl.sign.keyPair.fromSeed = function(seed) {\n checkArrayTypes(seed);\n if (seed.length !== crypto_sign_SEEDBYTES)\n throw new Error('bad seed size');\n var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);\n var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);\n for (var i = 0; i < 32; i++) sk[i] = seed[i];\n crypto_sign_keypair(pk, sk, true);\n return {publicKey: pk, secretKey: sk};\n};\n\nnacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;\nnacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;\nnacl.sign.seedLength = crypto_sign_SEEDBYTES;\nnacl.sign.signatureLength = crypto_sign_BYTES;\n\nnacl.hash = function(msg) {\n checkArrayTypes(msg);\n var h = new Uint8Array(crypto_hash_BYTES);\n crypto_hash(h, msg, msg.length);\n return h;\n};\n\nnacl.hash.hashLength = crypto_hash_BYTES;\n\nnacl.verify = function(x, y) {\n checkArrayTypes(x, y);\n // Zero length arguments are considered not equal.\n if (x.length === 0 || y.length === 0) return false;\n if (x.length !== y.length) return false;\n return (vn(x, 0, y, 0, x.length) === 0) ? true : false;\n};\n\nnacl.setPRNG = function(fn) {\n randombytes = fn;\n};\n\n(function() {\n // Initialize PRNG if environment provides CSPRNG.\n // If not, methods calling randombytes will throw.\n var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;\n if (crypto && crypto.getRandomValues) {\n // Browsers.\n var QUOTA = 65536;\n nacl.setPRNG(function(x, n) {\n var i, v = new Uint8Array(n);\n for (i = 0; i < n; i += QUOTA) {\n crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));\n }\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n } else if (typeof require !== 'undefined') {\n // Node.js.\n crypto = require('crypto');\n if (crypto && crypto.randomBytes) {\n nacl.setPRNG(function(x, n) {\n var i, v = crypto.randomBytes(n);\n for (i = 0; i < n; i++) x[i] = v[i];\n cleanup(v);\n });\n }\n }\n})();\n\n})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));\n","'use strict'\n\nconst Client = require('./lib/client')\nconst Dispatcher = require('./lib/dispatcher')\nconst errors = require('./lib/core/errors')\nconst Pool = require('./lib/pool')\nconst BalancedPool = require('./lib/balanced-pool')\nconst Agent = require('./lib/agent')\nconst util = require('./lib/core/util')\nconst { InvalidArgumentError } = errors\nconst api = require('./lib/api')\nconst buildConnector = require('./lib/core/connect')\nconst MockClient = require('./lib/mock/mock-client')\nconst MockAgent = require('./lib/mock/mock-agent')\nconst MockPool = require('./lib/mock/mock-pool')\nconst mockErrors = require('./lib/mock/mock-errors')\nconst ProxyAgent = require('./lib/proxy-agent')\nconst { getGlobalDispatcher, setGlobalDispatcher } = require('./lib/global')\nconst DecoratorHandler = require('./lib/handler/DecoratorHandler')\nconst RedirectHandler = require('./lib/handler/RedirectHandler')\nconst createRedirectInterceptor = require('./lib/interceptor/redirectInterceptor')\n\nlet hasCrypto\ntry {\n require('crypto')\n hasCrypto = true\n} catch {\n hasCrypto = false\n}\n\nObject.assign(Dispatcher.prototype, api)\n\nmodule.exports.Dispatcher = Dispatcher\nmodule.exports.Client = Client\nmodule.exports.Pool = Pool\nmodule.exports.BalancedPool = BalancedPool\nmodule.exports.Agent = Agent\nmodule.exports.ProxyAgent = ProxyAgent\n\nmodule.exports.DecoratorHandler = DecoratorHandler\nmodule.exports.RedirectHandler = RedirectHandler\nmodule.exports.createRedirectInterceptor = createRedirectInterceptor\n\nmodule.exports.buildConnector = buildConnector\nmodule.exports.errors = errors\n\nfunction makeDispatcher (fn) {\n return (url, opts, handler) => {\n if (typeof opts === 'function') {\n handler = opts\n opts = null\n }\n\n if (!url || (typeof url !== 'string' && typeof url !== 'object' && !(url instanceof URL))) {\n throw new InvalidArgumentError('invalid url')\n }\n\n if (opts != null && typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (opts && opts.path != null) {\n if (typeof opts.path !== 'string') {\n throw new InvalidArgumentError('invalid opts.path')\n }\n\n let path = opts.path\n if (!opts.path.startsWith('/')) {\n path = `/${path}`\n }\n\n url = new URL(util.parseOrigin(url).origin + path)\n } else {\n if (!opts) {\n opts = typeof url === 'object' ? url : {}\n }\n\n url = util.parseURL(url)\n }\n\n const { agent, dispatcher = getGlobalDispatcher() } = opts\n\n if (agent) {\n throw new InvalidArgumentError('unsupported opts.agent. Did you mean opts.client?')\n }\n\n return fn.call(dispatcher, {\n ...opts,\n origin: url.origin,\n path: url.search ? `${url.pathname}${url.search}` : url.pathname,\n method: opts.method || (opts.body ? 'PUT' : 'GET')\n }, handler)\n }\n}\n\nmodule.exports.setGlobalDispatcher = setGlobalDispatcher\nmodule.exports.getGlobalDispatcher = getGlobalDispatcher\n\nif (util.nodeMajor > 16 || (util.nodeMajor === 16 && util.nodeMinor >= 8)) {\n let fetchImpl = null\n module.exports.fetch = async function fetch (resource) {\n if (!fetchImpl) {\n fetchImpl = require('./lib/fetch').fetch\n }\n\n try {\n return await fetchImpl(...arguments)\n } catch (err) {\n if (typeof err === 'object') {\n Error.captureStackTrace(err, this)\n }\n\n throw err\n }\n }\n module.exports.Headers = require('./lib/fetch/headers').Headers\n module.exports.Response = require('./lib/fetch/response').Response\n module.exports.Request = require('./lib/fetch/request').Request\n module.exports.FormData = require('./lib/fetch/formdata').FormData\n module.exports.File = require('./lib/fetch/file').File\n module.exports.FileReader = require('./lib/fileapi/filereader').FileReader\n\n const { setGlobalOrigin, getGlobalOrigin } = require('./lib/fetch/global')\n\n module.exports.setGlobalOrigin = setGlobalOrigin\n module.exports.getGlobalOrigin = getGlobalOrigin\n\n const { CacheStorage } = require('./lib/cache/cachestorage')\n const { kConstruct } = require('./lib/cache/symbols')\n\n // Cache & CacheStorage are tightly coupled with fetch. Even if it may run\n // in an older version of Node, it doesn't have any use without fetch.\n module.exports.caches = new CacheStorage(kConstruct)\n}\n\nif (util.nodeMajor >= 16) {\n const { deleteCookie, getCookies, getSetCookies, setCookie } = require('./lib/cookies')\n\n module.exports.deleteCookie = deleteCookie\n module.exports.getCookies = getCookies\n module.exports.getSetCookies = getSetCookies\n module.exports.setCookie = setCookie\n\n const { parseMIMEType, serializeAMimeType } = require('./lib/fetch/dataURL')\n\n module.exports.parseMIMEType = parseMIMEType\n module.exports.serializeAMimeType = serializeAMimeType\n}\n\nif (util.nodeMajor >= 18 && hasCrypto) {\n const { WebSocket } = require('./lib/websocket/websocket')\n\n module.exports.WebSocket = WebSocket\n}\n\nmodule.exports.request = makeDispatcher(api.request)\nmodule.exports.stream = makeDispatcher(api.stream)\nmodule.exports.pipeline = makeDispatcher(api.pipeline)\nmodule.exports.connect = makeDispatcher(api.connect)\nmodule.exports.upgrade = makeDispatcher(api.upgrade)\n\nmodule.exports.MockClient = MockClient\nmodule.exports.MockPool = MockPool\nmodule.exports.MockAgent = MockAgent\nmodule.exports.mockErrors = mockErrors\n","'use strict'\n\nconst { InvalidArgumentError } = require('./core/errors')\nconst { kClients, kRunning, kClose, kDestroy, kDispatch, kInterceptors } = require('./core/symbols')\nconst DispatcherBase = require('./dispatcher-base')\nconst Pool = require('./pool')\nconst Client = require('./client')\nconst util = require('./core/util')\nconst createRedirectInterceptor = require('./interceptor/redirectInterceptor')\nconst { WeakRef, FinalizationRegistry } = require('./compat/dispatcher-weakref')()\n\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kMaxRedirections = Symbol('maxRedirections')\nconst kOnDrain = Symbol('onDrain')\nconst kFactory = Symbol('factory')\nconst kFinalizer = Symbol('finalizer')\nconst kOptions = Symbol('options')\n\nfunction defaultFactory (origin, opts) {\n return opts && opts.connections === 1\n ? new Client(origin, opts)\n : new Pool(origin, opts)\n}\n\nclass Agent extends DispatcherBase {\n constructor ({ factory = defaultFactory, maxRedirections = 0, connect, ...options } = {}) {\n super()\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (!Number.isInteger(maxRedirections) || maxRedirections < 0) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n if (connect && typeof connect !== 'function') {\n connect = { ...connect }\n }\n\n this[kInterceptors] = options.interceptors && options.interceptors.Agent && Array.isArray(options.interceptors.Agent)\n ? options.interceptors.Agent\n : [createRedirectInterceptor({ maxRedirections })]\n\n this[kOptions] = { ...util.deepClone(options), connect }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kMaxRedirections] = maxRedirections\n this[kFactory] = factory\n this[kClients] = new Map()\n this[kFinalizer] = new FinalizationRegistry(/* istanbul ignore next: gc is undeterministic */ key => {\n const ref = this[kClients].get(key)\n if (ref !== undefined && ref.deref() === undefined) {\n this[kClients].delete(key)\n }\n })\n\n const agent = this\n\n this[kOnDrain] = (origin, targets) => {\n agent.emit('drain', origin, [agent, ...targets])\n }\n\n this[kOnConnect] = (origin, targets) => {\n agent.emit('connect', origin, [agent, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n agent.emit('disconnect', origin, [agent, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n agent.emit('connectionError', origin, [agent, ...targets], err)\n }\n }\n\n get [kRunning] () {\n let ret = 0\n for (const ref of this[kClients].values()) {\n const client = ref.deref()\n /* istanbul ignore next: gc is undeterministic */\n if (client) {\n ret += client[kRunning]\n }\n }\n return ret\n }\n\n [kDispatch] (opts, handler) {\n let key\n if (opts.origin && (typeof opts.origin === 'string' || opts.origin instanceof URL)) {\n key = String(opts.origin)\n } else {\n throw new InvalidArgumentError('opts.origin must be a non-empty string or URL.')\n }\n\n const ref = this[kClients].get(key)\n\n let dispatcher = ref ? ref.deref() : null\n if (!dispatcher) {\n dispatcher = this[kFactory](opts.origin, this[kOptions])\n .on('drain', this[kOnDrain])\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n this[kClients].set(key, new WeakRef(dispatcher))\n this[kFinalizer].register(dispatcher, key)\n }\n\n return dispatcher.dispatch(opts, handler)\n }\n\n async [kClose] () {\n const closePromises = []\n for (const ref of this[kClients].values()) {\n const client = ref.deref()\n /* istanbul ignore else: gc is undeterministic */\n if (client) {\n closePromises.push(client.close())\n }\n }\n\n await Promise.all(closePromises)\n }\n\n async [kDestroy] (err) {\n const destroyPromises = []\n for (const ref of this[kClients].values()) {\n const client = ref.deref()\n /* istanbul ignore else: gc is undeterministic */\n if (client) {\n destroyPromises.push(client.destroy(err))\n }\n }\n\n await Promise.all(destroyPromises)\n }\n}\n\nmodule.exports = Agent\n","const { addAbortListener } = require('../core/util')\nconst { RequestAbortedError } = require('../core/errors')\n\nconst kListener = Symbol('kListener')\nconst kSignal = Symbol('kSignal')\n\nfunction abort (self) {\n if (self.abort) {\n self.abort()\n } else {\n self.onError(new RequestAbortedError())\n }\n}\n\nfunction addSignal (self, signal) {\n self[kSignal] = null\n self[kListener] = null\n\n if (!signal) {\n return\n }\n\n if (signal.aborted) {\n abort(self)\n return\n }\n\n self[kSignal] = signal\n self[kListener] = () => {\n abort(self)\n }\n\n addAbortListener(self[kSignal], self[kListener])\n}\n\nfunction removeSignal (self) {\n if (!self[kSignal]) {\n return\n }\n\n if ('removeEventListener' in self[kSignal]) {\n self[kSignal].removeEventListener('abort', self[kListener])\n } else {\n self[kSignal].removeListener('abort', self[kListener])\n }\n\n self[kSignal] = null\n self[kListener] = null\n}\n\nmodule.exports = {\n addSignal,\n removeSignal\n}\n","'use strict'\n\nconst { AsyncResource } = require('async_hooks')\nconst { InvalidArgumentError, RequestAbortedError, SocketError } = require('../core/errors')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass ConnectHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_CONNECT')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.callback = callback\n this.abort = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (!this.callback) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders () {\n throw new SocketError('bad connect', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n const { callback, opaque, context } = this\n\n removeSignal(this)\n\n this.callback = null\n\n let headers = rawHeaders\n // Indicates is an HTTP2Session\n if (headers != null) {\n headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n }\n\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction connect (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n connect.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const connectHandler = new ConnectHandler(opts, callback)\n this.dispatch({ ...opts, method: 'CONNECT' }, connectHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts && opts.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = connect\n","'use strict'\n\nconst {\n Readable,\n Duplex,\n PassThrough\n} = require('stream')\nconst {\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { AsyncResource } = require('async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('assert')\n\nconst kResume = Symbol('resume')\n\nclass PipelineRequest extends Readable {\n constructor () {\n super({ autoDestroy: true })\n\n this[kResume] = null\n }\n\n _read () {\n const { [kResume]: resume } = this\n\n if (resume) {\n this[kResume] = null\n resume()\n }\n }\n\n _destroy (err, callback) {\n this._read()\n\n callback(err)\n }\n}\n\nclass PipelineResponse extends Readable {\n constructor (resume) {\n super({ autoDestroy: true })\n this[kResume] = resume\n }\n\n _read () {\n this[kResume]()\n }\n\n _destroy (err, callback) {\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n callback(err)\n }\n}\n\nclass PipelineHandler extends AsyncResource {\n constructor (opts, handler) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof handler !== 'function') {\n throw new InvalidArgumentError('invalid handler')\n }\n\n const { signal, method, opaque, onInfo, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_PIPELINE')\n\n this.opaque = opaque || null\n this.responseHeaders = responseHeaders || null\n this.handler = handler\n this.abort = null\n this.context = null\n this.onInfo = onInfo || null\n\n this.req = new PipelineRequest().on('error', util.nop)\n\n this.ret = new Duplex({\n readableObjectMode: opts.objectMode,\n autoDestroy: true,\n read: () => {\n const { body } = this\n\n if (body && body.resume) {\n body.resume()\n }\n },\n write: (chunk, encoding, callback) => {\n const { req } = this\n\n if (req.push(chunk, encoding) || req._readableState.destroyed) {\n callback()\n } else {\n req[kResume] = callback\n }\n },\n destroy: (err, callback) => {\n const { body, req, res, ret, abort } = this\n\n if (!err && !ret._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (abort && err) {\n abort()\n }\n\n util.destroy(body, err)\n util.destroy(req, err)\n util.destroy(res, err)\n\n removeSignal(this)\n\n callback(err)\n }\n }).on('prefinish', () => {\n const { req } = this\n\n // Node < 15 does not call _final in same tick.\n req.push(null)\n })\n\n this.res = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n const { ret, res } = this\n\n assert(!res, 'pipeline cannot be retried')\n\n if (ret.destroyed) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume) {\n const { opaque, handler, context } = this\n\n if (statusCode < 200) {\n if (this.onInfo) {\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.res = new PipelineResponse(resume)\n\n let body\n try {\n this.handler = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n body = this.runInAsyncScope(handler, null, {\n statusCode,\n headers,\n opaque,\n body: this.res,\n context\n })\n } catch (err) {\n this.res.on('error', util.nop)\n throw err\n }\n\n if (!body || typeof body.on !== 'function') {\n throw new InvalidReturnValueError('expected Readable')\n }\n\n body\n .on('data', (chunk) => {\n const { ret, body } = this\n\n if (!ret.push(chunk) && body.pause) {\n body.pause()\n }\n })\n .on('error', (err) => {\n const { ret } = this\n\n util.destroy(ret, err)\n })\n .on('end', () => {\n const { ret } = this\n\n ret.push(null)\n })\n .on('close', () => {\n const { ret } = this\n\n if (!ret._readableState.ended) {\n util.destroy(ret, new RequestAbortedError())\n }\n })\n\n this.body = body\n }\n\n onData (chunk) {\n const { res } = this\n return res.push(chunk)\n }\n\n onComplete (trailers) {\n const { res } = this\n res.push(null)\n }\n\n onError (err) {\n const { ret } = this\n this.handler = null\n util.destroy(ret, err)\n }\n}\n\nfunction pipeline (opts, handler) {\n try {\n const pipelineHandler = new PipelineHandler(opts, handler)\n this.dispatch({ ...opts, body: pipelineHandler.req }, pipelineHandler)\n return pipelineHandler.ret\n } catch (err) {\n return new PassThrough().destroy(err)\n }\n}\n\nmodule.exports = pipeline\n","'use strict'\n\nconst Readable = require('./readable')\nconst {\n InvalidArgumentError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass RequestHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError, highWaterMark } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (highWaterMark && (typeof highWaterMark !== 'number' || highWaterMark < 0)) {\n throw new InvalidArgumentError('invalid highWaterMark')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_REQUEST')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', util.nop), err)\n }\n throw err\n }\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.res = null\n this.abort = null\n this.body = body\n this.trailers = {}\n this.context = null\n this.onInfo = onInfo || null\n this.throwOnError = throwOnError\n this.highWaterMark = highWaterMark\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (!this.callback) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { callback, opaque, abort, context, responseHeaders, highWaterMark } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n const body = new Readable({ resume, abort, contentType, highWaterMark })\n\n this.callback = null\n this.res = body\n if (callback !== null) {\n if (this.throwOnError && statusCode >= 400) {\n this.runInAsyncScope(getResolveErrorBodyCallback, null,\n { callback, body, contentType, statusCode, statusMessage, headers }\n )\n } else {\n this.runInAsyncScope(callback, null, null, {\n statusCode,\n headers,\n trailers: this.trailers,\n opaque,\n body,\n context\n })\n }\n }\n }\n\n onData (chunk) {\n const { res } = this\n return res.push(chunk)\n }\n\n onComplete (trailers) {\n const { res } = this\n\n removeSignal(this)\n\n util.parseHeaders(trailers, this.trailers)\n\n res.push(null)\n }\n\n onError (err) {\n const { res, callback, body, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n // TODO: Does this need queueMicrotask?\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (res) {\n this.res = null\n // Ensure all queued handlers are invoked before destroying res.\n queueMicrotask(() => {\n util.destroy(res, err)\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n }\n}\n\nfunction request (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n request.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n this.dispatch(opts, new RequestHandler(opts, callback))\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts && opts.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = request\n","'use strict'\n\nconst { finished, PassThrough } = require('stream')\nconst {\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError\n} = require('../core/errors')\nconst util = require('../core/util')\nconst { getResolveErrorBodyCallback } = require('./util')\nconst { AsyncResource } = require('async_hooks')\nconst { addSignal, removeSignal } = require('./abort-signal')\n\nclass StreamHandler extends AsyncResource {\n constructor (opts, factory, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n const { signal, method, opaque, body, onInfo, responseHeaders, throwOnError } = opts\n\n try {\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('invalid factory')\n }\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n if (method === 'CONNECT') {\n throw new InvalidArgumentError('invalid method')\n }\n\n if (onInfo && typeof onInfo !== 'function') {\n throw new InvalidArgumentError('invalid onInfo callback')\n }\n\n super('UNDICI_STREAM')\n } catch (err) {\n if (util.isStream(body)) {\n util.destroy(body.on('error', util.nop), err)\n }\n throw err\n }\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.factory = factory\n this.callback = callback\n this.res = null\n this.abort = null\n this.context = null\n this.trailers = null\n this.body = body\n this.onInfo = onInfo || null\n this.throwOnError = throwOnError || false\n\n if (util.isStream(body)) {\n body.on('error', (err) => {\n this.onError(err)\n })\n }\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (!this.callback) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = context\n }\n\n onHeaders (statusCode, rawHeaders, resume, statusMessage) {\n const { factory, opaque, context, callback, responseHeaders } = this\n\n const headers = responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n\n if (statusCode < 200) {\n if (this.onInfo) {\n this.onInfo({ statusCode, headers })\n }\n return\n }\n\n this.factory = null\n\n let res\n\n if (this.throwOnError && statusCode >= 400) {\n const parsedHeaders = responseHeaders === 'raw' ? util.parseHeaders(rawHeaders) : headers\n const contentType = parsedHeaders['content-type']\n res = new PassThrough()\n\n this.callback = null\n this.runInAsyncScope(getResolveErrorBodyCallback, null,\n { callback, body: res, contentType, statusCode, statusMessage, headers }\n )\n } else {\n if (factory === null) {\n return\n }\n\n res = this.runInAsyncScope(factory, null, {\n statusCode,\n headers,\n opaque,\n context\n })\n\n if (\n !res ||\n typeof res.write !== 'function' ||\n typeof res.end !== 'function' ||\n typeof res.on !== 'function'\n ) {\n throw new InvalidReturnValueError('expected Writable')\n }\n\n // TODO: Avoid finished. It registers an unnecessary amount of listeners.\n finished(res, { readable: false }, (err) => {\n const { callback, res, opaque, trailers, abort } = this\n\n this.res = null\n if (err || !res.readable) {\n util.destroy(res, err)\n }\n\n this.callback = null\n this.runInAsyncScope(callback, null, err || null, { opaque, trailers })\n\n if (err) {\n abort()\n }\n })\n }\n\n res.on('drain', resume)\n\n this.res = res\n\n const needDrain = res.writableNeedDrain !== undefined\n ? res.writableNeedDrain\n : res._writableState && res._writableState.needDrain\n\n return needDrain !== true\n }\n\n onData (chunk) {\n const { res } = this\n\n return res ? res.write(chunk) : true\n }\n\n onComplete (trailers) {\n const { res } = this\n\n removeSignal(this)\n\n if (!res) {\n return\n }\n\n this.trailers = util.parseHeaders(trailers)\n\n res.end()\n }\n\n onError (err) {\n const { res, callback, opaque, body } = this\n\n removeSignal(this)\n\n this.factory = null\n\n if (res) {\n this.res = null\n util.destroy(res, err)\n } else if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n\n if (body) {\n this.body = null\n util.destroy(body, err)\n }\n }\n}\n\nfunction stream (opts, factory, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n stream.call(this, opts, factory, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n this.dispatch(opts, new StreamHandler(opts, factory, callback))\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts && opts.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = stream\n","'use strict'\n\nconst { InvalidArgumentError, RequestAbortedError, SocketError } = require('../core/errors')\nconst { AsyncResource } = require('async_hooks')\nconst util = require('../core/util')\nconst { addSignal, removeSignal } = require('./abort-signal')\nconst assert = require('assert')\n\nclass UpgradeHandler extends AsyncResource {\n constructor (opts, callback) {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('invalid opts')\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n const { signal, opaque, responseHeaders } = opts\n\n if (signal && typeof signal.on !== 'function' && typeof signal.addEventListener !== 'function') {\n throw new InvalidArgumentError('signal must be an EventEmitter or EventTarget')\n }\n\n super('UNDICI_UPGRADE')\n\n this.responseHeaders = responseHeaders || null\n this.opaque = opaque || null\n this.callback = callback\n this.abort = null\n this.context = null\n\n addSignal(this, signal)\n }\n\n onConnect (abort, context) {\n if (!this.callback) {\n throw new RequestAbortedError()\n }\n\n this.abort = abort\n this.context = null\n }\n\n onHeaders () {\n throw new SocketError('bad upgrade', null)\n }\n\n onUpgrade (statusCode, rawHeaders, socket) {\n const { callback, opaque, context } = this\n\n assert.strictEqual(statusCode, 101)\n\n removeSignal(this)\n\n this.callback = null\n const headers = this.responseHeaders === 'raw' ? util.parseRawHeaders(rawHeaders) : util.parseHeaders(rawHeaders)\n this.runInAsyncScope(callback, null, null, {\n headers,\n socket,\n opaque,\n context\n })\n }\n\n onError (err) {\n const { callback, opaque } = this\n\n removeSignal(this)\n\n if (callback) {\n this.callback = null\n queueMicrotask(() => {\n this.runInAsyncScope(callback, null, err, { opaque })\n })\n }\n }\n}\n\nfunction upgrade (opts, callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n upgrade.call(this, opts, (err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n try {\n const upgradeHandler = new UpgradeHandler(opts, callback)\n this.dispatch({\n ...opts,\n method: opts.method || 'GET',\n upgrade: opts.protocol || 'Websocket'\n }, upgradeHandler)\n } catch (err) {\n if (typeof callback !== 'function') {\n throw err\n }\n const opaque = opts && opts.opaque\n queueMicrotask(() => callback(err, { opaque }))\n }\n}\n\nmodule.exports = upgrade\n","'use strict'\n\nmodule.exports.request = require('./api-request')\nmodule.exports.stream = require('./api-stream')\nmodule.exports.pipeline = require('./api-pipeline')\nmodule.exports.upgrade = require('./api-upgrade')\nmodule.exports.connect = require('./api-connect')\n","// Ported from https://github.com/nodejs/undici/pull/907\n\n'use strict'\n\nconst assert = require('assert')\nconst { Readable } = require('stream')\nconst { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require('../core/errors')\nconst util = require('../core/util')\nconst { ReadableStreamFrom, toUSVString } = require('../core/util')\n\nlet Blob\n\nconst kConsume = Symbol('kConsume')\nconst kReading = Symbol('kReading')\nconst kBody = Symbol('kBody')\nconst kAbort = Symbol('abort')\nconst kContentType = Symbol('kContentType')\n\nmodule.exports = class BodyReadable extends Readable {\n constructor ({\n resume,\n abort,\n contentType = '',\n highWaterMark = 64 * 1024 // Same as nodejs fs streams.\n }) {\n super({\n autoDestroy: true,\n read: resume,\n highWaterMark\n })\n\n this._readableState.dataEmitted = false\n\n this[kAbort] = abort\n this[kConsume] = null\n this[kBody] = null\n this[kContentType] = contentType\n\n // Is stream being consumed through Readable API?\n // This is an optimization so that we avoid checking\n // for 'data' and 'readable' listeners in the hot path\n // inside push().\n this[kReading] = false\n }\n\n destroy (err) {\n if (this.destroyed) {\n // Node < 16\n return this\n }\n\n if (!err && !this._readableState.endEmitted) {\n err = new RequestAbortedError()\n }\n\n if (err) {\n this[kAbort]()\n }\n\n return super.destroy(err)\n }\n\n emit (ev, ...args) {\n if (ev === 'data') {\n // Node < 16.7\n this._readableState.dataEmitted = true\n } else if (ev === 'error') {\n // Node < 16\n this._readableState.errorEmitted = true\n }\n return super.emit(ev, ...args)\n }\n\n on (ev, ...args) {\n if (ev === 'data' || ev === 'readable') {\n this[kReading] = true\n }\n return super.on(ev, ...args)\n }\n\n addListener (ev, ...args) {\n return this.on(ev, ...args)\n }\n\n off (ev, ...args) {\n const ret = super.off(ev, ...args)\n if (ev === 'data' || ev === 'readable') {\n this[kReading] = (\n this.listenerCount('data') > 0 ||\n this.listenerCount('readable') > 0\n )\n }\n return ret\n }\n\n removeListener (ev, ...args) {\n return this.off(ev, ...args)\n }\n\n push (chunk) {\n if (this[kConsume] && chunk !== null && this.readableLength === 0) {\n consumePush(this[kConsume], chunk)\n return this[kReading] ? super.push(chunk) : true\n }\n return super.push(chunk)\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-text\n async text () {\n return consume(this, 'text')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-json\n async json () {\n return consume(this, 'json')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-blob\n async blob () {\n return consume(this, 'blob')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-arraybuffer\n async arrayBuffer () {\n return consume(this, 'arrayBuffer')\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-formdata\n async formData () {\n // TODO: Implement.\n throw new NotSupportedError()\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-bodyused\n get bodyUsed () {\n return util.isDisturbed(this)\n }\n\n // https://fetch.spec.whatwg.org/#dom-body-body\n get body () {\n if (!this[kBody]) {\n this[kBody] = ReadableStreamFrom(this)\n if (this[kConsume]) {\n // TODO: Is this the best way to force a lock?\n this[kBody].getReader() // Ensure stream is locked.\n assert(this[kBody].locked)\n }\n }\n return this[kBody]\n }\n\n async dump (opts) {\n let limit = opts && Number.isFinite(opts.limit) ? opts.limit : 262144\n const signal = opts && opts.signal\n const abortFn = () => {\n this.destroy()\n }\n let signalListenerCleanup\n if (signal) {\n if (typeof signal !== 'object' || !('aborted' in signal)) {\n throw new InvalidArgumentError('signal must be an AbortSignal')\n }\n util.throwIfAborted(signal)\n signalListenerCleanup = util.addAbortListener(signal, abortFn)\n }\n try {\n for await (const chunk of this) {\n util.throwIfAborted(signal)\n limit -= Buffer.byteLength(chunk)\n if (limit < 0) {\n return\n }\n }\n } catch {\n util.throwIfAborted(signal)\n } finally {\n if (typeof signalListenerCleanup === 'function') {\n signalListenerCleanup()\n } else if (signalListenerCleanup) {\n signalListenerCleanup[Symbol.dispose]()\n }\n }\n }\n}\n\n// https://streams.spec.whatwg.org/#readablestream-locked\nfunction isLocked (self) {\n // Consume is an implicit lock.\n return (self[kBody] && self[kBody].locked === true) || self[kConsume]\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction isUnusable (self) {\n return util.isDisturbed(self) || isLocked(self)\n}\n\nasync function consume (stream, type) {\n if (isUnusable(stream)) {\n throw new TypeError('unusable')\n }\n\n assert(!stream[kConsume])\n\n return new Promise((resolve, reject) => {\n stream[kConsume] = {\n type,\n stream,\n resolve,\n reject,\n length: 0,\n body: []\n }\n\n stream\n .on('error', function (err) {\n consumeFinish(this[kConsume], err)\n })\n .on('close', function () {\n if (this[kConsume].body !== null) {\n consumeFinish(this[kConsume], new RequestAbortedError())\n }\n })\n\n process.nextTick(consumeStart, stream[kConsume])\n })\n}\n\nfunction consumeStart (consume) {\n if (consume.body === null) {\n return\n }\n\n const { _readableState: state } = consume.stream\n\n for (const chunk of state.buffer) {\n consumePush(consume, chunk)\n }\n\n if (state.endEmitted) {\n consumeEnd(this[kConsume])\n } else {\n consume.stream.on('end', function () {\n consumeEnd(this[kConsume])\n })\n }\n\n consume.stream.resume()\n\n while (consume.stream.read() != null) {\n // Loop\n }\n}\n\nfunction consumeEnd (consume) {\n const { type, body, resolve, stream, length } = consume\n\n try {\n if (type === 'text') {\n resolve(toUSVString(Buffer.concat(body)))\n } else if (type === 'json') {\n resolve(JSON.parse(Buffer.concat(body)))\n } else if (type === 'arrayBuffer') {\n const dst = new Uint8Array(length)\n\n let pos = 0\n for (const buf of body) {\n dst.set(buf, pos)\n pos += buf.byteLength\n }\n\n resolve(dst.buffer)\n } else if (type === 'blob') {\n if (!Blob) {\n Blob = require('buffer').Blob\n }\n resolve(new Blob(body, { type: stream[kContentType] }))\n }\n\n consumeFinish(consume)\n } catch (err) {\n stream.destroy(err)\n }\n}\n\nfunction consumePush (consume, chunk) {\n consume.length += chunk.length\n consume.body.push(chunk)\n}\n\nfunction consumeFinish (consume, err) {\n if (consume.body === null) {\n return\n }\n\n if (err) {\n consume.reject(err)\n } else {\n consume.resolve()\n }\n\n consume.type = null\n consume.stream = null\n consume.resolve = null\n consume.reject = null\n consume.length = 0\n consume.body = null\n}\n","const assert = require('assert')\nconst {\n ResponseStatusCodeError\n} = require('../core/errors')\nconst { toUSVString } = require('../core/util')\n\nasync function getResolveErrorBodyCallback ({ callback, body, contentType, statusCode, statusMessage, headers }) {\n assert(body)\n\n let chunks = []\n let limit = 0\n\n for await (const chunk of body) {\n chunks.push(chunk)\n limit += chunk.length\n if (limit > 128 * 1024) {\n chunks = null\n break\n }\n }\n\n if (statusCode === 204 || !contentType || !chunks) {\n process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))\n return\n }\n\n try {\n if (contentType.startsWith('application/json')) {\n const payload = JSON.parse(toUSVString(Buffer.concat(chunks)))\n process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))\n return\n }\n\n if (contentType.startsWith('text/')) {\n const payload = toUSVString(Buffer.concat(chunks))\n process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers, payload))\n return\n }\n } catch (err) {\n // Process in a fallback if error\n }\n\n process.nextTick(callback, new ResponseStatusCodeError(`Response status code ${statusCode}${statusMessage ? `: ${statusMessage}` : ''}`, statusCode, headers))\n}\n\nmodule.exports = { getResolveErrorBodyCallback }\n","'use strict'\n\nconst {\n BalancedPoolMissingUpstreamError,\n InvalidArgumentError\n} = require('./core/errors')\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Pool = require('./pool')\nconst { kUrl, kInterceptors } = require('./core/symbols')\nconst { parseOrigin } = require('./core/util')\nconst kFactory = Symbol('factory')\n\nconst kOptions = Symbol('options')\nconst kGreatestCommonDivisor = Symbol('kGreatestCommonDivisor')\nconst kCurrentWeight = Symbol('kCurrentWeight')\nconst kIndex = Symbol('kIndex')\nconst kWeight = Symbol('kWeight')\nconst kMaxWeightPerServer = Symbol('kMaxWeightPerServer')\nconst kErrorPenalty = Symbol('kErrorPenalty')\n\nfunction getGreatestCommonDivisor (a, b) {\n if (b === 0) return a\n return getGreatestCommonDivisor(b, a % b)\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nclass BalancedPool extends PoolBase {\n constructor (upstreams = [], { factory = defaultFactory, ...opts } = {}) {\n super()\n\n this[kOptions] = opts\n this[kIndex] = -1\n this[kCurrentWeight] = 0\n\n this[kMaxWeightPerServer] = this[kOptions].maxWeightPerServer || 100\n this[kErrorPenalty] = this[kOptions].errorPenalty || 15\n\n if (!Array.isArray(upstreams)) {\n upstreams = [upstreams]\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n this[kInterceptors] = opts.interceptors && opts.interceptors.BalancedPool && Array.isArray(opts.interceptors.BalancedPool)\n ? opts.interceptors.BalancedPool\n : []\n this[kFactory] = factory\n\n for (const upstream of upstreams) {\n this.addUpstream(upstream)\n }\n this._updateBalancedPoolStats()\n }\n\n addUpstream (upstream) {\n const upstreamOrigin = parseOrigin(upstream).origin\n\n if (this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))) {\n return this\n }\n const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]))\n\n this[kAddClient](pool)\n pool.on('connect', () => {\n pool[kWeight] = Math.min(this[kMaxWeightPerServer], pool[kWeight] + this[kErrorPenalty])\n })\n\n pool.on('connectionError', () => {\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n })\n\n pool.on('disconnect', (...args) => {\n const err = args[2]\n if (err && err.code === 'UND_ERR_SOCKET') {\n // decrease the weight of the pool.\n pool[kWeight] = Math.max(1, pool[kWeight] - this[kErrorPenalty])\n this._updateBalancedPoolStats()\n }\n })\n\n for (const client of this[kClients]) {\n client[kWeight] = this[kMaxWeightPerServer]\n }\n\n this._updateBalancedPoolStats()\n\n return this\n }\n\n _updateBalancedPoolStats () {\n this[kGreatestCommonDivisor] = this[kClients].map(p => p[kWeight]).reduce(getGreatestCommonDivisor, 0)\n }\n\n removeUpstream (upstream) {\n const upstreamOrigin = parseOrigin(upstream).origin\n\n const pool = this[kClients].find((pool) => (\n pool[kUrl].origin === upstreamOrigin &&\n pool.closed !== true &&\n pool.destroyed !== true\n ))\n\n if (pool) {\n this[kRemoveClient](pool)\n }\n\n return this\n }\n\n get upstreams () {\n return this[kClients]\n .filter(dispatcher => dispatcher.closed !== true && dispatcher.destroyed !== true)\n .map((p) => p[kUrl].origin)\n }\n\n [kGetDispatcher] () {\n // We validate that pools is greater than 0,\n // otherwise we would have to wait until an upstream\n // is added, which might never happen.\n if (this[kClients].length === 0) {\n throw new BalancedPoolMissingUpstreamError()\n }\n\n const dispatcher = this[kClients].find(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n\n if (!dispatcher) {\n return\n }\n\n const allClientsBusy = this[kClients].map(pool => pool[kNeedDrain]).reduce((a, b) => a && b, true)\n\n if (allClientsBusy) {\n return\n }\n\n let counter = 0\n\n let maxWeightIndex = this[kClients].findIndex(pool => !pool[kNeedDrain])\n\n while (counter++ < this[kClients].length) {\n this[kIndex] = (this[kIndex] + 1) % this[kClients].length\n const pool = this[kClients][this[kIndex]]\n\n // find pool index with the largest weight\n if (pool[kWeight] > this[kClients][maxWeightIndex][kWeight] && !pool[kNeedDrain]) {\n maxWeightIndex = this[kIndex]\n }\n\n // decrease the current weight every `this[kClients].length`.\n if (this[kIndex] === 0) {\n // Set the current weight to the next lower weight.\n this[kCurrentWeight] = this[kCurrentWeight] - this[kGreatestCommonDivisor]\n\n if (this[kCurrentWeight] <= 0) {\n this[kCurrentWeight] = this[kMaxWeightPerServer]\n }\n }\n if (pool[kWeight] >= this[kCurrentWeight] && (!pool[kNeedDrain])) {\n return pool\n }\n }\n\n this[kCurrentWeight] = this[kClients][maxWeightIndex][kWeight]\n this[kIndex] = maxWeightIndex\n return this[kClients][maxWeightIndex]\n }\n}\n\nmodule.exports = BalancedPool\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { urlEquals, fieldValues: getFieldValues } = require('./util')\nconst { kEnumerableProperty, isDisturbed } = require('../core/util')\nconst { kHeadersList } = require('../core/symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { Response, cloneResponse } = require('../fetch/response')\nconst { Request } = require('../fetch/request')\nconst { kState, kHeaders, kGuard, kRealm } = require('../fetch/symbols')\nconst { fetching } = require('../fetch/index')\nconst { urlIsHttpHttpsScheme, createDeferredPromise, readAllBytes } = require('../fetch/util')\nconst assert = require('assert')\nconst { getGlobalDispatcher } = require('../global')\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-cache-batch-operation\n * @typedef {Object} CacheBatchOperation\n * @property {'delete' | 'put'} type\n * @property {any} request\n * @property {any} response\n * @property {import('../../types/cache').CacheQueryOptions} options\n */\n\n/**\n * @see https://w3c.github.io/ServiceWorker/#dfn-request-response-list\n * @typedef {[any, any][]} requestResponseList\n */\n\nclass Cache {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-request-response-list\n * @type {requestResponseList}\n */\n #relevantRequestResponseList\n\n constructor () {\n if (arguments[0] !== kConstruct) {\n webidl.illegalConstructor()\n }\n\n this.#relevantRequestResponseList = arguments[1]\n }\n\n async match (request, options = {}) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.match' })\n\n request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options)\n\n const p = await this.matchAll(request, options)\n\n if (p.length === 0) {\n return\n }\n\n return p[0]\n }\n\n async matchAll (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n if (request !== undefined) request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options)\n\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n if (request instanceof Request) {\n // 2.1.1\n r = request[kState]\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') {\n // 2.2.1\n r = new Request(request)[kState]\n }\n }\n\n // 5.\n // 5.1\n const responses = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n responses.push(requestResponse[1])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n responses.push(requestResponse[1])\n }\n }\n\n // 5.4\n // We don't implement CORs so we don't need to loop over the responses, yay!\n\n // 5.5.1\n const responseList = []\n\n // 5.5.2\n for (const response of responses) {\n // 5.5.2.1\n const responseObject = new Response(response.body?.source ?? null)\n const body = responseObject[kState].body\n responseObject[kState] = response\n responseObject[kState].body = body\n responseObject[kHeaders][kHeadersList] = response.headersList\n responseObject[kHeaders][kGuard] = 'immutable'\n\n responseList.push(responseObject)\n }\n\n // 6.\n return Object.freeze(responseList)\n }\n\n async add (request) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.add' })\n\n request = webidl.converters.RequestInfo(request)\n\n // 1.\n const requests = [request]\n\n // 2.\n const responseArrayPromise = this.addAll(requests)\n\n // 3.\n return await responseArrayPromise\n }\n\n async addAll (requests) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.addAll' })\n\n requests = webidl.converters['sequence'](requests)\n\n // 1.\n const responsePromises = []\n\n // 2.\n const requestList = []\n\n // 3.\n for (const request of requests) {\n if (typeof request === 'string') {\n continue\n }\n\n // 3.1\n const r = request[kState]\n\n // 3.2\n if (!urlIsHttpHttpsScheme(r.url) || r.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Expected http/s scheme when method is not GET.'\n })\n }\n }\n\n // 4.\n /** @type {ReturnType[]} */\n const fetchControllers = []\n\n // 5.\n for (const request of requests) {\n // 5.1\n const r = new Request(request)[kState]\n\n // 5.2\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Expected http/s scheme.'\n })\n }\n\n // 5.4\n r.initiator = 'fetch'\n r.destination = 'subresource'\n\n // 5.5\n requestList.push(r)\n\n // 5.6\n const responsePromise = createDeferredPromise()\n\n // 5.7\n fetchControllers.push(fetching({\n request: r,\n dispatcher: getGlobalDispatcher(),\n processResponse (response) {\n // 1.\n if (response.type === 'error' || response.status === 206 || response.status < 200 || response.status > 299) {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'Received an invalid status code or the request failed.'\n }))\n } else if (response.headersList.contains('vary')) { // 2.\n // 2.1\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n // 2.2\n for (const fieldValue of fieldValues) {\n // 2.2.1\n if (fieldValue === '*') {\n responsePromise.reject(webidl.errors.exception({\n header: 'Cache.addAll',\n message: 'invalid vary field value'\n }))\n\n for (const controller of fetchControllers) {\n controller.abort()\n }\n\n return\n }\n }\n }\n },\n processResponseEndOfBody (response) {\n // 1.\n if (response.aborted) {\n responsePromise.reject(new DOMException('aborted', 'AbortError'))\n return\n }\n\n // 2.\n responsePromise.resolve(response)\n }\n }))\n\n // 5.8\n responsePromises.push(responsePromise.promise)\n }\n\n // 6.\n const p = Promise.all(responsePromises)\n\n // 7.\n const responses = await p\n\n // 7.1\n const operations = []\n\n // 7.2\n let index = 0\n\n // 7.3\n for (const response of responses) {\n // 7.3.1\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 7.3.2\n request: requestList[index], // 7.3.3\n response // 7.3.4\n }\n\n operations.push(operation) // 7.3.5\n\n index++ // 7.3.6\n }\n\n // 7.5\n const cacheJobPromise = createDeferredPromise()\n\n // 7.6.1\n let errorData = null\n\n // 7.6.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 7.6.3\n queueMicrotask(() => {\n // 7.6.3.1\n if (errorData === null) {\n cacheJobPromise.resolve(undefined)\n } else {\n // 7.6.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n // 7.7\n return cacheJobPromise.promise\n }\n\n async put (request, response) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 2, { header: 'Cache.put' })\n\n request = webidl.converters.RequestInfo(request)\n response = webidl.converters.Response(response)\n\n // 1.\n let innerRequest = null\n\n // 2.\n if (request instanceof Request) {\n innerRequest = request[kState]\n } else { // 3.\n innerRequest = new Request(request)[kState]\n }\n\n // 4.\n if (!urlIsHttpHttpsScheme(innerRequest.url) || innerRequest.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.put',\n message: 'Expected an http/s scheme when method is not GET'\n })\n }\n\n // 5.\n const innerResponse = response[kState]\n\n // 6.\n if (innerResponse.status === 206) {\n throw webidl.errors.exception({\n header: 'Cache.put',\n message: 'Got 206 status'\n })\n }\n\n // 7.\n if (innerResponse.headersList.contains('vary')) {\n // 7.1.\n const fieldValues = getFieldValues(innerResponse.headersList.get('vary'))\n\n // 7.2.\n for (const fieldValue of fieldValues) {\n // 7.2.1\n if (fieldValue === '*') {\n throw webidl.errors.exception({\n header: 'Cache.put',\n message: 'Got * vary field value'\n })\n }\n }\n }\n\n // 8.\n if (innerResponse.body && (isDisturbed(innerResponse.body.stream) || innerResponse.body.stream.locked)) {\n throw webidl.errors.exception({\n header: 'Cache.put',\n message: 'Response body is locked or disturbed'\n })\n }\n\n // 9.\n const clonedResponse = cloneResponse(innerResponse)\n\n // 10.\n const bodyReadPromise = createDeferredPromise()\n\n // 11.\n if (innerResponse.body != null) {\n // 11.1\n const stream = innerResponse.body.stream\n\n // 11.2\n const reader = stream.getReader()\n\n // 11.3\n readAllBytes(reader).then(bodyReadPromise.resolve, bodyReadPromise.reject)\n } else {\n bodyReadPromise.resolve(undefined)\n }\n\n // 12.\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n // 13.\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'put', // 14.\n request: innerRequest, // 15.\n response: clonedResponse // 16.\n }\n\n // 17.\n operations.push(operation)\n\n // 19.\n const bytes = await bodyReadPromise.promise\n\n if (clonedResponse.body != null) {\n clonedResponse.body.source = bytes\n }\n\n // 19.1\n const cacheJobPromise = createDeferredPromise()\n\n // 19.2.1\n let errorData = null\n\n // 19.2.2\n try {\n this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n // 19.2.3\n queueMicrotask(() => {\n // 19.2.3.1\n if (errorData === null) {\n cacheJobPromise.resolve()\n } else { // 19.2.3.2\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n async delete (request, options = {}) {\n webidl.brandCheck(this, Cache)\n webidl.argumentLengthCheck(arguments, 1, { header: 'Cache.delete' })\n\n request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options)\n\n /**\n * @type {Request}\n */\n let r = null\n\n if (request instanceof Request) {\n r = request[kState]\n\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return false\n }\n } else {\n assert(typeof request === 'string')\n\n r = new Request(request)[kState]\n }\n\n /** @type {CacheBatchOperation[]} */\n const operations = []\n\n /** @type {CacheBatchOperation} */\n const operation = {\n type: 'delete',\n request: r,\n options\n }\n\n operations.push(operation)\n\n const cacheJobPromise = createDeferredPromise()\n\n let errorData = null\n let requestResponses\n\n try {\n requestResponses = this.#batchCacheOperations(operations)\n } catch (e) {\n errorData = e\n }\n\n queueMicrotask(() => {\n if (errorData === null) {\n cacheJobPromise.resolve(!!requestResponses?.length)\n } else {\n cacheJobPromise.reject(errorData)\n }\n })\n\n return cacheJobPromise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cache-keys\n * @param {any} request\n * @param {import('../../types/cache').CacheQueryOptions} options\n * @returns {readonly Request[]}\n */\n async keys (request = undefined, options = {}) {\n webidl.brandCheck(this, Cache)\n\n if (request !== undefined) request = webidl.converters.RequestInfo(request)\n options = webidl.converters.CacheQueryOptions(options)\n\n // 1.\n let r = null\n\n // 2.\n if (request !== undefined) {\n // 2.1\n if (request instanceof Request) {\n // 2.1.1\n r = request[kState]\n\n // 2.1.2\n if (r.method !== 'GET' && !options.ignoreMethod) {\n return []\n }\n } else if (typeof request === 'string') { // 2.2\n r = new Request(request)[kState]\n }\n }\n\n // 4.\n const promise = createDeferredPromise()\n\n // 5.\n // 5.1\n const requests = []\n\n // 5.2\n if (request === undefined) {\n // 5.2.1\n for (const requestResponse of this.#relevantRequestResponseList) {\n // 5.2.1.1\n requests.push(requestResponse[0])\n }\n } else { // 5.3\n // 5.3.1\n const requestResponses = this.#queryCache(r, options)\n\n // 5.3.2\n for (const requestResponse of requestResponses) {\n // 5.3.2.1\n requests.push(requestResponse[0])\n }\n }\n\n // 5.4\n queueMicrotask(() => {\n // 5.4.1\n const requestList = []\n\n // 5.4.2\n for (const request of requests) {\n const requestObject = new Request('https://a')\n requestObject[kState] = request\n requestObject[kHeaders][kHeadersList] = request.headersList\n requestObject[kHeaders][kGuard] = 'immutable'\n requestObject[kRealm] = request.client\n\n // 5.4.2.1\n requestList.push(requestObject)\n }\n\n // 5.4.3\n promise.resolve(Object.freeze(requestList))\n })\n\n return promise.promise\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#batch-cache-operations-algorithm\n * @param {CacheBatchOperation[]} operations\n * @returns {requestResponseList}\n */\n #batchCacheOperations (operations) {\n // 1.\n const cache = this.#relevantRequestResponseList\n\n // 2.\n const backupCache = [...cache]\n\n // 3.\n const addedItems = []\n\n // 4.1\n const resultList = []\n\n try {\n // 4.2\n for (const operation of operations) {\n // 4.2.1\n if (operation.type !== 'delete' && operation.type !== 'put') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'operation type does not match \"delete\" or \"put\"'\n })\n }\n\n // 4.2.2\n if (operation.type === 'delete' && operation.response != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'delete operation should not have an associated response'\n })\n }\n\n // 4.2.3\n if (this.#queryCache(operation.request, operation.options, addedItems).length) {\n throw new DOMException('???', 'InvalidStateError')\n }\n\n // 4.2.4\n let requestResponses\n\n // 4.2.5\n if (operation.type === 'delete') {\n // 4.2.5.1\n requestResponses = this.#queryCache(operation.request, operation.options)\n\n // TODO: the spec is wrong, this is needed to pass WPTs\n if (requestResponses.length === 0) {\n return []\n }\n\n // 4.2.5.2\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.5.2.1\n cache.splice(idx, 1)\n }\n } else if (operation.type === 'put') { // 4.2.6\n // 4.2.6.1\n if (operation.response == null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'put operation should have an associated response'\n })\n }\n\n // 4.2.6.2\n const r = operation.request\n\n // 4.2.6.3\n if (!urlIsHttpHttpsScheme(r.url)) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'expected http or https scheme'\n })\n }\n\n // 4.2.6.4\n if (r.method !== 'GET') {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'not get method'\n })\n }\n\n // 4.2.6.5\n if (operation.options != null) {\n throw webidl.errors.exception({\n header: 'Cache.#batchCacheOperations',\n message: 'options must not be defined'\n })\n }\n\n // 4.2.6.6\n requestResponses = this.#queryCache(operation.request)\n\n // 4.2.6.7\n for (const requestResponse of requestResponses) {\n const idx = cache.indexOf(requestResponse)\n assert(idx !== -1)\n\n // 4.2.6.7.1\n cache.splice(idx, 1)\n }\n\n // 4.2.6.8\n cache.push([operation.request, operation.response])\n\n // 4.2.6.10\n addedItems.push([operation.request, operation.response])\n }\n\n // 4.2.7\n resultList.push([operation.request, operation.response])\n }\n\n // 4.3\n return resultList\n } catch (e) { // 5.\n // 5.1\n this.#relevantRequestResponseList.length = 0\n\n // 5.2\n this.#relevantRequestResponseList = backupCache\n\n // 5.3\n throw e\n }\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#query-cache\n * @param {any} requestQuery\n * @param {import('../../types/cache').CacheQueryOptions} options\n * @param {requestResponseList} targetStorage\n * @returns {requestResponseList}\n */\n #queryCache (requestQuery, options, targetStorage) {\n /** @type {requestResponseList} */\n const resultList = []\n\n const storage = targetStorage ?? this.#relevantRequestResponseList\n\n for (const requestResponse of storage) {\n const [cachedRequest, cachedResponse] = requestResponse\n if (this.#requestMatchesCachedItem(requestQuery, cachedRequest, cachedResponse, options)) {\n resultList.push(requestResponse)\n }\n }\n\n return resultList\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#request-matches-cached-item-algorithm\n * @param {any} requestQuery\n * @param {any} request\n * @param {any | null} response\n * @param {import('../../types/cache').CacheQueryOptions | undefined} options\n * @returns {boolean}\n */\n #requestMatchesCachedItem (requestQuery, request, response = null, options) {\n // if (options?.ignoreMethod === false && request.method === 'GET') {\n // return false\n // }\n\n const queryURL = new URL(requestQuery.url)\n\n const cachedURL = new URL(request.url)\n\n if (options?.ignoreSearch) {\n cachedURL.search = ''\n\n queryURL.search = ''\n }\n\n if (!urlEquals(queryURL, cachedURL, true)) {\n return false\n }\n\n if (\n response == null ||\n options?.ignoreVary ||\n !response.headersList.contains('vary')\n ) {\n return true\n }\n\n const fieldValues = getFieldValues(response.headersList.get('vary'))\n\n for (const fieldValue of fieldValues) {\n if (fieldValue === '*') {\n return false\n }\n\n const requestValue = request.headersList.get(fieldValue)\n const queryValue = requestQuery.headersList.get(fieldValue)\n\n // If one has the header and the other doesn't, or one has\n // a different value than the other, return false\n if (requestValue !== queryValue) {\n return false\n }\n }\n\n return true\n }\n}\n\nObject.defineProperties(Cache.prototype, {\n [Symbol.toStringTag]: {\n value: 'Cache',\n configurable: true\n },\n match: kEnumerableProperty,\n matchAll: kEnumerableProperty,\n add: kEnumerableProperty,\n addAll: kEnumerableProperty,\n put: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nconst cacheQueryOptionConverters = [\n {\n key: 'ignoreSearch',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'ignoreMethod',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'ignoreVary',\n converter: webidl.converters.boolean,\n defaultValue: false\n }\n]\n\nwebidl.converters.CacheQueryOptions = webidl.dictionaryConverter(cacheQueryOptionConverters)\n\nwebidl.converters.MultiCacheQueryOptions = webidl.dictionaryConverter([\n ...cacheQueryOptionConverters,\n {\n key: 'cacheName',\n converter: webidl.converters.DOMString\n }\n])\n\nwebidl.converters.Response = webidl.interfaceConverter(Response)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.RequestInfo\n)\n\nmodule.exports = {\n Cache\n}\n","'use strict'\n\nconst { kConstruct } = require('./symbols')\nconst { Cache } = require('./cache')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../core/util')\n\nclass CacheStorage {\n /**\n * @see https://w3c.github.io/ServiceWorker/#dfn-relevant-name-to-cache-map\n * @type {Map}\n */\n async has (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.has' })\n\n cacheName = webidl.converters.DOMString(cacheName)\n\n // 2.1.1\n // 2.2\n return this.#caches.has(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#dom-cachestorage-open\n * @param {string} cacheName\n * @returns {Promise}\n */\n async open (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.open' })\n\n cacheName = webidl.converters.DOMString(cacheName)\n\n // 2.1\n if (this.#caches.has(cacheName)) {\n // await caches.open('v1') !== await caches.open('v1')\n\n // 2.1.1\n const cache = this.#caches.get(cacheName)\n\n // 2.1.1.1\n return new Cache(kConstruct, cache)\n }\n\n // 2.2\n const cache = []\n\n // 2.3\n this.#caches.set(cacheName, cache)\n\n // 2.4\n return new Cache(kConstruct, cache)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-delete\n * @param {string} cacheName\n * @returns {Promise}\n */\n async delete (cacheName) {\n webidl.brandCheck(this, CacheStorage)\n webidl.argumentLengthCheck(arguments, 1, { header: 'CacheStorage.delete' })\n\n cacheName = webidl.converters.DOMString(cacheName)\n\n return this.#caches.delete(cacheName)\n }\n\n /**\n * @see https://w3c.github.io/ServiceWorker/#cache-storage-keys\n * @returns {string[]}\n */\n async keys () {\n webidl.brandCheck(this, CacheStorage)\n\n // 2.1\n const keys = this.#caches.keys()\n\n // 2.2\n return [...keys]\n }\n}\n\nObject.defineProperties(CacheStorage.prototype, {\n [Symbol.toStringTag]: {\n value: 'CacheStorage',\n configurable: true\n },\n match: kEnumerableProperty,\n has: kEnumerableProperty,\n open: kEnumerableProperty,\n delete: kEnumerableProperty,\n keys: kEnumerableProperty\n})\n\nmodule.exports = {\n CacheStorage\n}\n","'use strict'\n\nmodule.exports = {\n kConstruct: Symbol('constructable')\n}\n","'use strict'\n\nconst assert = require('assert')\nconst { URLSerializer } = require('../fetch/dataURL')\nconst { isValidHeaderName } = require('../fetch/util')\n\n/**\n * @see https://url.spec.whatwg.org/#concept-url-equals\n * @param {URL} A\n * @param {URL} B\n * @param {boolean | undefined} excludeFragment\n * @returns {boolean}\n */\nfunction urlEquals (A, B, excludeFragment = false) {\n const serializedA = URLSerializer(A, excludeFragment)\n\n const serializedB = URLSerializer(B, excludeFragment)\n\n return serializedA === serializedB\n}\n\n/**\n * @see https://github.com/chromium/chromium/blob/694d20d134cb553d8d89e5500b9148012b1ba299/content/browser/cache_storage/cache_storage_cache.cc#L260-L262\n * @param {string} header\n */\nfunction fieldValues (header) {\n assert(header !== null)\n\n const values = []\n\n for (let value of header.split(',')) {\n value = value.trim()\n\n if (!value.length) {\n continue\n } else if (!isValidHeaderName(value)) {\n continue\n }\n\n values.push(value)\n }\n\n return values\n}\n\nmodule.exports = {\n urlEquals,\n fieldValues\n}\n","// @ts-check\n\n'use strict'\n\n/* global WebAssembly */\n\nconst assert = require('assert')\nconst net = require('net')\nconst http = require('http')\nconst { pipeline } = require('stream')\nconst util = require('./core/util')\nconst timers = require('./timers')\nconst Request = require('./core/request')\nconst DispatcherBase = require('./dispatcher-base')\nconst {\n RequestContentLengthMismatchError,\n ResponseContentLengthMismatchError,\n InvalidArgumentError,\n RequestAbortedError,\n HeadersTimeoutError,\n HeadersOverflowError,\n SocketError,\n InformationalError,\n BodyTimeoutError,\n HTTPParserError,\n ResponseExceededMaxSizeError,\n ClientDestroyedError\n} = require('./core/errors')\nconst buildConnector = require('./core/connect')\nconst {\n kUrl,\n kReset,\n kServerName,\n kClient,\n kBusy,\n kParser,\n kConnect,\n kBlocking,\n kResuming,\n kRunning,\n kPending,\n kSize,\n kWriting,\n kQueue,\n kConnected,\n kConnecting,\n kNeedDrain,\n kNoRef,\n kKeepAliveDefaultTimeout,\n kHostHeader,\n kPendingIdx,\n kRunningIdx,\n kError,\n kPipelining,\n kSocket,\n kKeepAliveTimeoutValue,\n kMaxHeadersSize,\n kKeepAliveMaxTimeout,\n kKeepAliveTimeoutThreshold,\n kHeadersTimeout,\n kBodyTimeout,\n kStrictContentLength,\n kConnector,\n kMaxRedirections,\n kMaxRequests,\n kCounter,\n kClose,\n kDestroy,\n kDispatch,\n kInterceptors,\n kLocalAddress,\n kMaxResponseSize,\n kHTTPConnVersion,\n // HTTP2\n kHost,\n kHTTP2Session,\n kHTTP2SessionState,\n kHTTP2BuildRequest,\n kHTTP2CopyHeaders,\n kHTTP1BuildRequest\n} = require('./core/symbols')\n\n/** @type {import('http2')} */\nlet http2\ntry {\n http2 = require('http2')\n} catch {\n // @ts-ignore\n http2 = { constants: {} }\n}\n\nconst {\n constants: {\n HTTP2_HEADER_AUTHORITY,\n HTTP2_HEADER_METHOD,\n HTTP2_HEADER_PATH,\n HTTP2_HEADER_SCHEME,\n HTTP2_HEADER_CONTENT_LENGTH,\n HTTP2_HEADER_EXPECT,\n HTTP2_HEADER_STATUS\n }\n} = http2\n\n// Experimental\nlet h2ExperimentalWarned = false\n\nconst FastBuffer = Buffer[Symbol.species]\n\nconst kClosedResolve = Symbol('kClosedResolve')\n\nconst channels = {}\n\ntry {\n const diagnosticsChannel = require('diagnostics_channel')\n channels.sendHeaders = diagnosticsChannel.channel('undici:client:sendHeaders')\n channels.beforeConnect = diagnosticsChannel.channel('undici:client:beforeConnect')\n channels.connectError = diagnosticsChannel.channel('undici:client:connectError')\n channels.connected = diagnosticsChannel.channel('undici:client:connected')\n} catch {\n channels.sendHeaders = { hasSubscribers: false }\n channels.beforeConnect = { hasSubscribers: false }\n channels.connectError = { hasSubscribers: false }\n channels.connected = { hasSubscribers: false }\n}\n\n/**\n * @type {import('../types/client').default}\n */\nclass Client extends DispatcherBase {\n /**\n *\n * @param {string|URL} url\n * @param {import('../types/client').Client.Options} options\n */\n constructor (url, {\n interceptors,\n maxHeaderSize,\n headersTimeout,\n socketTimeout,\n requestTimeout,\n connectTimeout,\n bodyTimeout,\n idleTimeout,\n keepAlive,\n keepAliveTimeout,\n maxKeepAliveTimeout,\n keepAliveMaxTimeout,\n keepAliveTimeoutThreshold,\n socketPath,\n pipelining,\n tls,\n strictContentLength,\n maxCachedSessions,\n maxRedirections,\n connect,\n maxRequestsPerClient,\n localAddress,\n maxResponseSize,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n // h2\n allowH2,\n maxConcurrentStreams\n } = {}) {\n super()\n\n if (keepAlive !== undefined) {\n throw new InvalidArgumentError('unsupported keepAlive, use pipelining=0 instead')\n }\n\n if (socketTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported socketTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (requestTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported requestTimeout, use headersTimeout & bodyTimeout instead')\n }\n\n if (idleTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported idleTimeout, use keepAliveTimeout instead')\n }\n\n if (maxKeepAliveTimeout !== undefined) {\n throw new InvalidArgumentError('unsupported maxKeepAliveTimeout, use keepAliveMaxTimeout instead')\n }\n\n if (maxHeaderSize != null && !Number.isFinite(maxHeaderSize)) {\n throw new InvalidArgumentError('invalid maxHeaderSize')\n }\n\n if (socketPath != null && typeof socketPath !== 'string') {\n throw new InvalidArgumentError('invalid socketPath')\n }\n\n if (connectTimeout != null && (!Number.isFinite(connectTimeout) || connectTimeout < 0)) {\n throw new InvalidArgumentError('invalid connectTimeout')\n }\n\n if (keepAliveTimeout != null && (!Number.isFinite(keepAliveTimeout) || keepAliveTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveTimeout')\n }\n\n if (keepAliveMaxTimeout != null && (!Number.isFinite(keepAliveMaxTimeout) || keepAliveMaxTimeout <= 0)) {\n throw new InvalidArgumentError('invalid keepAliveMaxTimeout')\n }\n\n if (keepAliveTimeoutThreshold != null && !Number.isFinite(keepAliveTimeoutThreshold)) {\n throw new InvalidArgumentError('invalid keepAliveTimeoutThreshold')\n }\n\n if (headersTimeout != null && (!Number.isInteger(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('headersTimeout must be a positive integer or zero')\n }\n\n if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('bodyTimeout must be a positive integer or zero')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {\n throw new InvalidArgumentError('maxRequestsPerClient must be a positive number')\n }\n\n if (localAddress != null && (typeof localAddress !== 'string' || net.isIP(localAddress) === 0)) {\n throw new InvalidArgumentError('localAddress must be valid string IP address')\n }\n\n if (maxResponseSize != null && (!Number.isInteger(maxResponseSize) || maxResponseSize < -1)) {\n throw new InvalidArgumentError('maxResponseSize must be a positive number')\n }\n\n if (\n autoSelectFamilyAttemptTimeout != null &&\n (!Number.isInteger(autoSelectFamilyAttemptTimeout) || autoSelectFamilyAttemptTimeout < -1)\n ) {\n throw new InvalidArgumentError('autoSelectFamilyAttemptTimeout must be a positive number')\n }\n\n // h2\n if (allowH2 != null && typeof allowH2 !== 'boolean') {\n throw new InvalidArgumentError('allowH2 must be a valid boolean value')\n }\n\n if (maxConcurrentStreams != null && (typeof maxConcurrentStreams !== 'number' || maxConcurrentStreams < 1)) {\n throw new InvalidArgumentError('maxConcurrentStreams must be a possitive integer, greater than 0')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client)\n ? interceptors.Client\n : [createRedirectInterceptor({ maxRedirections })]\n this[kUrl] = util.parseOrigin(url)\n this[kConnector] = connect\n this[kSocket] = null\n this[kPipelining] = pipelining != null ? pipelining : 1\n this[kMaxHeadersSize] = maxHeaderSize || http.maxHeaderSize\n this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4e3 : keepAliveTimeout\n this[kKeepAliveMaxTimeout] = keepAliveMaxTimeout == null ? 600e3 : keepAliveMaxTimeout\n this[kKeepAliveTimeoutThreshold] = keepAliveTimeoutThreshold == null ? 1e3 : keepAliveTimeoutThreshold\n this[kKeepAliveTimeoutValue] = this[kKeepAliveDefaultTimeout]\n this[kServerName] = null\n this[kLocalAddress] = localAddress != null ? localAddress : null\n this[kResuming] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kNeedDrain] = 0 // 0, idle, 1, scheduled, 2 resuming\n this[kHostHeader] = `host: ${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}\\r\\n`\n this[kBodyTimeout] = bodyTimeout != null ? bodyTimeout : 300e3\n this[kHeadersTimeout] = headersTimeout != null ? headersTimeout : 300e3\n this[kStrictContentLength] = strictContentLength == null ? true : strictContentLength\n this[kMaxRedirections] = maxRedirections\n this[kMaxRequests] = maxRequestsPerClient\n this[kClosedResolve] = null\n this[kMaxResponseSize] = maxResponseSize > -1 ? maxResponseSize : -1\n this[kHTTPConnVersion] = 'h1'\n\n // HTTP/2\n this[kHTTP2Session] = null\n this[kHTTP2SessionState] = !allowH2\n ? null\n : {\n // streams: null, // Fixed queue of streams - For future support of `push`\n openStreams: 0, // Keep track of them to decide wether or not unref the session\n maxConcurrentStreams: maxConcurrentStreams != null ? maxConcurrentStreams : 100 // Max peerConcurrentStreams for a Node h2 server\n }\n this[kHost] = `${this[kUrl].hostname}${this[kUrl].port ? `:${this[kUrl].port}` : ''}`\n\n // kQueue is built up of 3 sections separated by\n // the kRunningIdx and kPendingIdx indices.\n // | complete | running | pending |\n // ^ kRunningIdx ^ kPendingIdx ^ kQueue.length\n // kRunningIdx points to the first running element.\n // kPendingIdx points to the first pending element.\n // This implements a fast queue with an amortized\n // time of O(1).\n\n this[kQueue] = []\n this[kRunningIdx] = 0\n this[kPendingIdx] = 0\n }\n\n get pipelining () {\n return this[kPipelining]\n }\n\n set pipelining (value) {\n this[kPipelining] = value\n resume(this, true)\n }\n\n get [kPending] () {\n return this[kQueue].length - this[kPendingIdx]\n }\n\n get [kRunning] () {\n return this[kPendingIdx] - this[kRunningIdx]\n }\n\n get [kSize] () {\n return this[kQueue].length - this[kRunningIdx]\n }\n\n get [kConnected] () {\n return !!this[kSocket] && !this[kConnecting] && !this[kSocket].destroyed\n }\n\n get [kBusy] () {\n const socket = this[kSocket]\n return (\n (socket && (socket[kReset] || socket[kWriting] || socket[kBlocking])) ||\n (this[kSize] >= (this[kPipelining] || 1)) ||\n this[kPending] > 0\n )\n }\n\n /* istanbul ignore: only used for test */\n [kConnect] (cb) {\n connect(this)\n this.once('connect', cb)\n }\n\n [kDispatch] (opts, handler) {\n const origin = opts.origin || this[kUrl].origin\n\n const request = this[kHTTPConnVersion] === 'h2'\n ? Request[kHTTP2BuildRequest](origin, opts, handler)\n : Request[kHTTP1BuildRequest](origin, opts, handler)\n\n this[kQueue].push(request)\n if (this[kResuming]) {\n // Do nothing.\n } else if (util.bodyLength(request.body) == null && util.isIterable(request.body)) {\n // Wait a tick in case stream/iterator is ended in the same tick.\n this[kResuming] = 1\n process.nextTick(resume, this)\n } else {\n resume(this, true)\n }\n\n if (this[kResuming] && this[kNeedDrain] !== 2 && this[kBusy]) {\n this[kNeedDrain] = 2\n }\n\n return this[kNeedDrain] < 2\n }\n\n async [kClose] () {\n // TODO: for H2 we need to gracefully flush the remaining enqueued\n // request and close each stream.\n return new Promise((resolve) => {\n if (!this[kSize]) {\n resolve(null)\n } else {\n this[kClosedResolve] = resolve\n }\n })\n }\n\n async [kDestroy] (err) {\n return new Promise((resolve) => {\n const requests = this[kQueue].splice(this[kPendingIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n errorRequest(this, request, err)\n }\n\n const callback = () => {\n if (this[kClosedResolve]) {\n // TODO (fix): Should we error here with ClientDestroyedError?\n this[kClosedResolve]()\n this[kClosedResolve] = null\n }\n resolve()\n }\n\n if (this[kHTTP2Session] != null) {\n util.destroy(this[kHTTP2Session], err)\n this[kHTTP2Session] = null\n this[kHTTP2SessionState] = null\n }\n\n if (!this[kSocket]) {\n queueMicrotask(callback)\n } else {\n util.destroy(this[kSocket].on('close', callback), err)\n }\n\n resume(this)\n })\n }\n}\n\nfunction onHttp2SessionError (err) {\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n this[kSocket][kError] = err\n\n onError(this[kClient], err)\n}\n\nfunction onHttp2FrameError (type, code, id) {\n const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n\n if (id === 0) {\n this[kSocket][kError] = err\n onError(this[kClient], err)\n }\n}\n\nfunction onHttp2SessionEnd () {\n util.destroy(this, new SocketError('other side closed'))\n util.destroy(this[kSocket], new SocketError('other side closed'))\n}\n\nfunction onHTTP2GoAway (code) {\n const client = this[kClient]\n const err = new InformationalError(`HTTP/2: \"GOAWAY\" frame received with code ${code}`)\n client[kSocket] = null\n client[kHTTP2Session] = null\n\n if (client.destroyed) {\n assert(this[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n errorRequest(this, request, err)\n }\n } else if (client[kRunning] > 0) {\n // Fail head of pipeline.\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n\n errorRequest(client, request, err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect',\n client[kUrl],\n [client],\n err\n )\n\n resume(client)\n}\n\nconst constants = require('./llhttp/constants')\nconst createRedirectInterceptor = require('./interceptor/redirectInterceptor')\nconst EMPTY_BUF = Buffer.alloc(0)\n\nasync function lazyllhttp () {\n const llhttpWasmData = process.env.JEST_WORKER_ID ? require('./llhttp/llhttp-wasm.js') : undefined\n\n let mod\n try {\n mod = await WebAssembly.compile(Buffer.from(require('./llhttp/llhttp_simd-wasm.js'), 'base64'))\n } catch (e) {\n /* istanbul ignore next */\n\n // We could check if the error was caused by the simd option not\n // being enabled, but the occurring of this other error\n // * https://github.com/emscripten-core/emscripten/issues/11495\n // got me to remove that check to avoid breaking Node 12.\n mod = await WebAssembly.compile(Buffer.from(llhttpWasmData || require('./llhttp/llhttp-wasm.js'), 'base64'))\n }\n\n return await WebAssembly.instantiate(mod, {\n env: {\n /* eslint-disable camelcase */\n\n wasm_on_url: (p, at, len) => {\n /* istanbul ignore next */\n return 0\n },\n wasm_on_status: (p, at, len) => {\n assert.strictEqual(currentParser.ptr, p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onStatus(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_message_begin: (p) => {\n assert.strictEqual(currentParser.ptr, p)\n return currentParser.onMessageBegin() || 0\n },\n wasm_on_header_field: (p, at, len) => {\n assert.strictEqual(currentParser.ptr, p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderField(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_header_value: (p, at, len) => {\n assert.strictEqual(currentParser.ptr, p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onHeaderValue(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_headers_complete: (p, statusCode, upgrade, shouldKeepAlive) => {\n assert.strictEqual(currentParser.ptr, p)\n return currentParser.onHeadersComplete(statusCode, Boolean(upgrade), Boolean(shouldKeepAlive)) || 0\n },\n wasm_on_body: (p, at, len) => {\n assert.strictEqual(currentParser.ptr, p)\n const start = at - currentBufferPtr + currentBufferRef.byteOffset\n return currentParser.onBody(new FastBuffer(currentBufferRef.buffer, start, len)) || 0\n },\n wasm_on_message_complete: (p) => {\n assert.strictEqual(currentParser.ptr, p)\n return currentParser.onMessageComplete() || 0\n }\n\n /* eslint-enable camelcase */\n }\n })\n}\n\nlet llhttpInstance = null\nlet llhttpPromise = lazyllhttp()\nllhttpPromise.catch()\n\nlet currentParser = null\nlet currentBufferRef = null\nlet currentBufferSize = 0\nlet currentBufferPtr = null\n\nconst TIMEOUT_HEADERS = 1\nconst TIMEOUT_BODY = 2\nconst TIMEOUT_IDLE = 3\n\nclass Parser {\n constructor (client, socket, { exports }) {\n assert(Number.isFinite(client[kMaxHeadersSize]) && client[kMaxHeadersSize] > 0)\n\n this.llhttp = exports\n this.ptr = this.llhttp.llhttp_alloc(constants.TYPE.RESPONSE)\n this.client = client\n this.socket = socket\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n this.statusCode = null\n this.statusText = ''\n this.upgrade = false\n this.headers = []\n this.headersSize = 0\n this.headersMaxSize = client[kMaxHeadersSize]\n this.shouldKeepAlive = false\n this.paused = false\n this.resume = this.resume.bind(this)\n\n this.bytesRead = 0\n\n this.keepAlive = ''\n this.contentLength = ''\n this.connection = ''\n this.maxResponseSize = client[kMaxResponseSize]\n }\n\n setTimeout (value, type) {\n this.timeoutType = type\n if (value !== this.timeoutValue) {\n timers.clearTimeout(this.timeout)\n if (value) {\n this.timeout = timers.setTimeout(onParserTimeout, value, this)\n // istanbul ignore else: only for jest\n if (this.timeout.unref) {\n this.timeout.unref()\n }\n } else {\n this.timeout = null\n }\n this.timeoutValue = value\n } else if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n }\n\n resume () {\n if (this.socket.destroyed || !this.paused) {\n return\n }\n\n assert(this.ptr != null)\n assert(currentParser == null)\n\n this.llhttp.llhttp_resume(this.ptr)\n\n assert(this.timeoutType === TIMEOUT_BODY)\n if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n this.paused = false\n this.execute(this.socket.read() || EMPTY_BUF) // Flush parser.\n this.readMore()\n }\n\n readMore () {\n while (!this.paused && this.ptr) {\n const chunk = this.socket.read()\n if (chunk === null) {\n break\n }\n this.execute(chunk)\n }\n }\n\n execute (data) {\n assert(this.ptr != null)\n assert(currentParser == null)\n assert(!this.paused)\n\n const { socket, llhttp } = this\n\n if (data.length > currentBufferSize) {\n if (currentBufferPtr) {\n llhttp.free(currentBufferPtr)\n }\n currentBufferSize = Math.ceil(data.length / 4096) * 4096\n currentBufferPtr = llhttp.malloc(currentBufferSize)\n }\n\n new Uint8Array(llhttp.memory.buffer, currentBufferPtr, currentBufferSize).set(data)\n\n // Call `execute` on the wasm parser.\n // We pass the `llhttp_parser` pointer address, the pointer address of buffer view data,\n // and finally the length of bytes to parse.\n // The return value is an error code or `constants.ERROR.OK`.\n try {\n let ret\n\n try {\n currentBufferRef = data\n currentParser = this\n ret = llhttp.llhttp_execute(this.ptr, currentBufferPtr, data.length)\n /* eslint-disable-next-line no-useless-catch */\n } catch (err) {\n /* istanbul ignore next: difficult to make a test case for */\n throw err\n } finally {\n currentParser = null\n currentBufferRef = null\n }\n\n const offset = llhttp.llhttp_get_error_pos(this.ptr) - currentBufferPtr\n\n if (ret === constants.ERROR.PAUSED_UPGRADE) {\n this.onUpgrade(data.slice(offset))\n } else if (ret === constants.ERROR.PAUSED) {\n this.paused = true\n socket.unshift(data.slice(offset))\n } else if (ret !== constants.ERROR.OK) {\n const ptr = llhttp.llhttp_get_error_reason(this.ptr)\n let message = ''\n /* istanbul ignore else: difficult to make a test case for */\n if (ptr) {\n const len = new Uint8Array(llhttp.memory.buffer, ptr).indexOf(0)\n message =\n 'Response does not match the HTTP/1.1 protocol (' +\n Buffer.from(llhttp.memory.buffer, ptr, len).toString() +\n ')'\n }\n throw new HTTPParserError(message, constants.ERROR[ret], data.slice(offset))\n }\n } catch (err) {\n util.destroy(socket, err)\n }\n }\n\n destroy () {\n assert(this.ptr != null)\n assert(currentParser == null)\n\n this.llhttp.llhttp_free(this.ptr)\n this.ptr = null\n\n timers.clearTimeout(this.timeout)\n this.timeout = null\n this.timeoutValue = null\n this.timeoutType = null\n\n this.paused = false\n }\n\n onStatus (buf) {\n this.statusText = buf.toString()\n }\n\n onMessageBegin () {\n const { socket, client } = this\n\n /* istanbul ignore next: difficult to make a test case for */\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n if (!request) {\n return -1\n }\n }\n\n onHeaderField (buf) {\n const len = this.headers.length\n\n if ((len & 1) === 0) {\n this.headers.push(buf)\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n this.trackHeader(buf.length)\n }\n\n onHeaderValue (buf) {\n let len = this.headers.length\n\n if ((len & 1) === 1) {\n this.headers.push(buf)\n len += 1\n } else {\n this.headers[len - 1] = Buffer.concat([this.headers[len - 1], buf])\n }\n\n const key = this.headers[len - 2]\n if (key.length === 10 && key.toString().toLowerCase() === 'keep-alive') {\n this.keepAlive += buf.toString()\n } else if (key.length === 10 && key.toString().toLowerCase() === 'connection') {\n this.connection += buf.toString()\n } else if (key.length === 14 && key.toString().toLowerCase() === 'content-length') {\n this.contentLength += buf.toString()\n }\n\n this.trackHeader(buf.length)\n }\n\n trackHeader (len) {\n this.headersSize += len\n if (this.headersSize >= this.headersMaxSize) {\n util.destroy(this.socket, new HeadersOverflowError())\n }\n }\n\n onUpgrade (head) {\n const { upgrade, client, socket, headers, statusCode } = this\n\n assert(upgrade)\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert(!socket.destroyed)\n assert(socket === client[kSocket])\n assert(!this.paused)\n assert(request.upgrade || request.method === 'CONNECT')\n\n this.statusCode = null\n this.statusText = ''\n this.shouldKeepAlive = null\n\n assert(this.headers.length % 2 === 0)\n this.headers = []\n this.headersSize = 0\n\n socket.unshift(head)\n\n socket[kParser].destroy()\n socket[kParser] = null\n\n socket[kClient] = null\n socket[kError] = null\n socket\n .removeListener('error', onSocketError)\n .removeListener('readable', onSocketReadable)\n .removeListener('end', onSocketEnd)\n .removeListener('close', onSocketClose)\n\n client[kSocket] = null\n client[kQueue][client[kRunningIdx]++] = null\n client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))\n\n try {\n request.onUpgrade(statusCode, headers, socket)\n } catch (err) {\n util.destroy(socket, err)\n }\n\n resume(client)\n }\n\n onHeadersComplete (statusCode, upgrade, shouldKeepAlive) {\n const { client, socket, headers, statusText } = this\n\n /* istanbul ignore next: difficult to make a test case for */\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n\n /* istanbul ignore next: difficult to make a test case for */\n if (!request) {\n return -1\n }\n\n assert(!this.upgrade)\n assert(this.statusCode < 200)\n\n if (statusCode === 100) {\n util.destroy(socket, new SocketError('bad response', util.getSocketInfo(socket)))\n return -1\n }\n\n /* this can only happen if server is misbehaving */\n if (upgrade && !request.upgrade) {\n util.destroy(socket, new SocketError('bad upgrade', util.getSocketInfo(socket)))\n return -1\n }\n\n assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS)\n\n this.statusCode = statusCode\n this.shouldKeepAlive = (\n shouldKeepAlive ||\n // Override llhttp value which does not allow keepAlive for HEAD.\n (request.method === 'HEAD' && !socket[kReset] && this.connection.toLowerCase() === 'keep-alive')\n )\n\n if (this.statusCode >= 200) {\n const bodyTimeout = request.bodyTimeout != null\n ? request.bodyTimeout\n : client[kBodyTimeout]\n this.setTimeout(bodyTimeout, TIMEOUT_BODY)\n } else if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n if (request.method === 'CONNECT') {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n if (upgrade) {\n assert(client[kRunning] === 1)\n this.upgrade = true\n return 2\n }\n\n assert(this.headers.length % 2 === 0)\n this.headers = []\n this.headersSize = 0\n\n if (this.shouldKeepAlive && client[kPipelining]) {\n const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null\n\n if (keepAliveTimeout != null) {\n const timeout = Math.min(\n keepAliveTimeout - client[kKeepAliveTimeoutThreshold],\n client[kKeepAliveMaxTimeout]\n )\n if (timeout <= 0) {\n socket[kReset] = true\n } else {\n client[kKeepAliveTimeoutValue] = timeout\n }\n } else {\n client[kKeepAliveTimeoutValue] = client[kKeepAliveDefaultTimeout]\n }\n } else {\n // Stop more requests from being dispatched.\n socket[kReset] = true\n }\n\n let pause\n try {\n pause = request.onHeaders(statusCode, headers, this.resume, statusText) === false\n } catch (err) {\n util.destroy(socket, err)\n return -1\n }\n\n if (request.method === 'HEAD') {\n return 1\n }\n\n if (statusCode < 200) {\n return 1\n }\n\n if (socket[kBlocking]) {\n socket[kBlocking] = false\n resume(client)\n }\n\n return pause ? constants.ERROR.PAUSED : 0\n }\n\n onBody (buf) {\n const { client, socket, statusCode, maxResponseSize } = this\n\n if (socket.destroyed) {\n return -1\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert.strictEqual(this.timeoutType, TIMEOUT_BODY)\n if (this.timeout) {\n // istanbul ignore else: only for jest\n if (this.timeout.refresh) {\n this.timeout.refresh()\n }\n }\n\n assert(statusCode >= 200)\n\n if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {\n util.destroy(socket, new ResponseExceededMaxSizeError())\n return -1\n }\n\n this.bytesRead += buf.length\n\n try {\n if (request.onData(buf) === false) {\n return constants.ERROR.PAUSED\n }\n } catch (err) {\n util.destroy(socket, err)\n return -1\n }\n }\n\n onMessageComplete () {\n const { client, socket, statusCode, upgrade, headers, contentLength, bytesRead, shouldKeepAlive } = this\n\n if (socket.destroyed && (!statusCode || shouldKeepAlive)) {\n return -1\n }\n\n if (upgrade) {\n return\n }\n\n const request = client[kQueue][client[kRunningIdx]]\n assert(request)\n\n assert(statusCode >= 100)\n\n this.statusCode = null\n this.statusText = ''\n this.bytesRead = 0\n this.contentLength = ''\n this.keepAlive = ''\n this.connection = ''\n\n assert(this.headers.length % 2 === 0)\n this.headers = []\n this.headersSize = 0\n\n if (statusCode < 200) {\n return\n }\n\n /* istanbul ignore next: should be handled by llhttp? */\n if (request.method !== 'HEAD' && contentLength && bytesRead !== parseInt(contentLength, 10)) {\n util.destroy(socket, new ResponseContentLengthMismatchError())\n return -1\n }\n\n try {\n request.onComplete(headers)\n } catch (err) {\n errorRequest(client, request, err)\n }\n\n client[kQueue][client[kRunningIdx]++] = null\n\n if (socket[kWriting]) {\n assert.strictEqual(client[kRunning], 0)\n // Response completed before request.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (!shouldKeepAlive) {\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (socket[kReset] && client[kRunning] === 0) {\n // Destroy socket once all requests have completed.\n // The request at the tail of the pipeline is the one\n // that requested reset and no further requests should\n // have been queued since then.\n util.destroy(socket, new InformationalError('reset'))\n return constants.ERROR.PAUSED\n } else if (client[kPipelining] === 1) {\n // We must wait a full event loop cycle to reuse this socket to make sure\n // that non-spec compliant servers are not closing the connection even if they\n // said they won't.\n setImmediate(resume, client)\n } else {\n resume(client)\n }\n }\n}\n\nfunction onParserTimeout (parser) {\n const { socket, timeoutType, client } = parser\n\n /* istanbul ignore else */\n if (timeoutType === TIMEOUT_HEADERS) {\n if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {\n assert(!parser.paused, 'cannot be paused while waiting for headers')\n util.destroy(socket, new HeadersTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_BODY) {\n if (!parser.paused) {\n util.destroy(socket, new BodyTimeoutError())\n }\n } else if (timeoutType === TIMEOUT_IDLE) {\n assert(client[kRunning] === 0 && client[kKeepAliveTimeoutValue])\n util.destroy(socket, new InformationalError('socket idle timeout'))\n }\n}\n\nfunction onSocketReadable () {\n const { [kParser]: parser } = this\n if (parser) {\n parser.readMore()\n }\n}\n\nfunction onSocketError (err) {\n const { [kClient]: client, [kParser]: parser } = this\n\n assert(err.code !== 'ERR_TLS_CERT_ALTNAME_INVALID')\n\n if (client[kHTTPConnVersion] !== 'h2') {\n // On Mac OS, we get an ECONNRESET even if there is a full body to be forwarded\n // to the user.\n if (err.code === 'ECONNRESET' && parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so for as a valid response.\n parser.onMessageComplete()\n return\n }\n }\n\n this[kError] = err\n\n onError(this[kClient], err)\n}\n\nfunction onError (client, err) {\n if (\n client[kRunning] === 0 &&\n err.code !== 'UND_ERR_INFO' &&\n err.code !== 'UND_ERR_SOCKET'\n ) {\n // Error is not caused by running request and not a recoverable\n // socket error.\n\n assert(client[kPendingIdx] === client[kRunningIdx])\n\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n errorRequest(client, request, err)\n }\n assert(client[kSize] === 0)\n }\n}\n\nfunction onSocketEnd () {\n const { [kParser]: parser, [kClient]: client } = this\n\n if (client[kHTTPConnVersion] !== 'h2') {\n if (parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so far as a valid response.\n parser.onMessageComplete()\n return\n }\n }\n\n util.destroy(this, new SocketError('other side closed', util.getSocketInfo(this)))\n}\n\nfunction onSocketClose () {\n const { [kClient]: client, [kParser]: parser } = this\n\n if (client[kHTTPConnVersion] === 'h1' && parser) {\n if (!this[kError] && parser.statusCode && !parser.shouldKeepAlive) {\n // We treat all incoming data so far as a valid response.\n parser.onMessageComplete()\n }\n\n this[kParser].destroy()\n this[kParser] = null\n }\n\n const err = this[kError] || new SocketError('closed', util.getSocketInfo(this))\n\n client[kSocket] = null\n\n if (client.destroyed) {\n assert(client[kPending] === 0)\n\n // Fail entire queue.\n const requests = client[kQueue].splice(client[kRunningIdx])\n for (let i = 0; i < requests.length; i++) {\n const request = requests[i]\n errorRequest(client, request, err)\n }\n } else if (client[kRunning] > 0 && err.code !== 'UND_ERR_INFO') {\n // Fail head of pipeline.\n const request = client[kQueue][client[kRunningIdx]]\n client[kQueue][client[kRunningIdx]++] = null\n\n errorRequest(client, request, err)\n }\n\n client[kPendingIdx] = client[kRunningIdx]\n\n assert(client[kRunning] === 0)\n\n client.emit('disconnect', client[kUrl], [client], err)\n\n resume(client)\n}\n\nasync function connect (client) {\n assert(!client[kConnecting])\n assert(!client[kSocket])\n\n let { host, hostname, protocol, port } = client[kUrl]\n\n // Resolve ipv6\n if (hostname[0] === '[') {\n const idx = hostname.indexOf(']')\n\n assert(idx !== -1)\n const ip = hostname.substr(1, idx - 1)\n\n assert(net.isIP(ip))\n hostname = ip\n }\n\n client[kConnecting] = true\n\n if (channels.beforeConnect.hasSubscribers) {\n channels.beforeConnect.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector]\n })\n }\n\n try {\n const socket = await new Promise((resolve, reject) => {\n client[kConnector]({\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n }, (err, socket) => {\n if (err) {\n reject(err)\n } else {\n resolve(socket)\n }\n })\n })\n\n if (client.destroyed) {\n util.destroy(socket.on('error', () => {}), new ClientDestroyedError())\n return\n }\n\n client[kConnecting] = false\n\n assert(socket)\n\n const isH2 = socket.alpnProtocol === 'h2'\n if (isH2) {\n if (!h2ExperimentalWarned) {\n h2ExperimentalWarned = true\n process.emitWarning('H2 support is experimental, expect them to change at any time.', {\n code: 'UNDICI-H2'\n })\n }\n\n const session = http2.connect(client[kUrl], {\n createConnection: () => socket,\n peerMaxConcurrentStreams: client[kHTTP2SessionState].maxConcurrentStreams\n })\n\n client[kHTTPConnVersion] = 'h2'\n session[kClient] = client\n session[kSocket] = socket\n session.on('error', onHttp2SessionError)\n session.on('frameError', onHttp2FrameError)\n session.on('end', onHttp2SessionEnd)\n session.on('goaway', onHTTP2GoAway)\n session.on('close', onSocketClose)\n session.unref()\n\n client[kHTTP2Session] = session\n socket[kHTTP2Session] = session\n } else {\n if (!llhttpInstance) {\n llhttpInstance = await llhttpPromise\n llhttpPromise = null\n }\n\n socket[kNoRef] = false\n socket[kWriting] = false\n socket[kReset] = false\n socket[kBlocking] = false\n socket[kParser] = new Parser(client, socket, llhttpInstance)\n }\n\n socket[kCounter] = 0\n socket[kMaxRequests] = client[kMaxRequests]\n socket[kClient] = client\n socket[kError] = null\n\n socket\n .on('error', onSocketError)\n .on('readable', onSocketReadable)\n .on('end', onSocketEnd)\n .on('close', onSocketClose)\n\n client[kSocket] = socket\n\n if (channels.connected.hasSubscribers) {\n channels.connected.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n socket\n })\n }\n client.emit('connect', client[kUrl], [client])\n } catch (err) {\n if (client.destroyed) {\n return\n }\n\n client[kConnecting] = false\n\n if (channels.connectError.hasSubscribers) {\n channels.connectError.publish({\n connectParams: {\n host,\n hostname,\n protocol,\n port,\n servername: client[kServerName],\n localAddress: client[kLocalAddress]\n },\n connector: client[kConnector],\n error: err\n })\n }\n\n if (err.code === 'ERR_TLS_CERT_ALTNAME_INVALID') {\n assert(client[kRunning] === 0)\n while (client[kPending] > 0 && client[kQueue][client[kPendingIdx]].servername === client[kServerName]) {\n const request = client[kQueue][client[kPendingIdx]++]\n errorRequest(client, request, err)\n }\n } else {\n onError(client, err)\n }\n\n client.emit('connectionError', client[kUrl], [client], err)\n }\n\n resume(client)\n}\n\nfunction emitDrain (client) {\n client[kNeedDrain] = 0\n client.emit('drain', client[kUrl], [client])\n}\n\nfunction resume (client, sync) {\n if (client[kResuming] === 2) {\n return\n }\n\n client[kResuming] = 2\n\n _resume(client, sync)\n client[kResuming] = 0\n\n if (client[kRunningIdx] > 256) {\n client[kQueue].splice(0, client[kRunningIdx])\n client[kPendingIdx] -= client[kRunningIdx]\n client[kRunningIdx] = 0\n }\n}\n\nfunction _resume (client, sync) {\n while (true) {\n if (client.destroyed) {\n assert(client[kPending] === 0)\n return\n }\n\n if (client[kClosedResolve] && !client[kSize]) {\n client[kClosedResolve]()\n client[kClosedResolve] = null\n return\n }\n\n const socket = client[kSocket]\n\n if (socket && !socket.destroyed && socket.alpnProtocol !== 'h2') {\n if (client[kSize] === 0) {\n if (!socket[kNoRef] && socket.unref) {\n socket.unref()\n socket[kNoRef] = true\n }\n } else if (socket[kNoRef] && socket.ref) {\n socket.ref()\n socket[kNoRef] = false\n }\n\n if (client[kSize] === 0) {\n if (socket[kParser].timeoutType !== TIMEOUT_IDLE) {\n socket[kParser].setTimeout(client[kKeepAliveTimeoutValue], TIMEOUT_IDLE)\n }\n } else if (client[kRunning] > 0 && socket[kParser].statusCode < 200) {\n if (socket[kParser].timeoutType !== TIMEOUT_HEADERS) {\n const request = client[kQueue][client[kRunningIdx]]\n const headersTimeout = request.headersTimeout != null\n ? request.headersTimeout\n : client[kHeadersTimeout]\n socket[kParser].setTimeout(headersTimeout, TIMEOUT_HEADERS)\n }\n }\n }\n\n if (client[kBusy]) {\n client[kNeedDrain] = 2\n } else if (client[kNeedDrain] === 2) {\n if (sync) {\n client[kNeedDrain] = 1\n process.nextTick(emitDrain, client)\n } else {\n emitDrain(client)\n }\n continue\n }\n\n if (client[kPending] === 0) {\n return\n }\n\n if (client[kRunning] >= (client[kPipelining] || 1)) {\n return\n }\n\n const request = client[kQueue][client[kPendingIdx]]\n\n if (client[kUrl].protocol === 'https:' && client[kServerName] !== request.servername) {\n if (client[kRunning] > 0) {\n return\n }\n\n client[kServerName] = request.servername\n\n if (socket && socket.servername !== request.servername) {\n util.destroy(socket, new InformationalError('servername changed'))\n return\n }\n }\n\n if (client[kConnecting]) {\n return\n }\n\n if (!socket && !client[kHTTP2Session]) {\n connect(client)\n return\n }\n\n if (socket.destroyed || socket[kWriting] || socket[kReset] || socket[kBlocking]) {\n return\n }\n\n if (client[kRunning] > 0 && !request.idempotent) {\n // Non-idempotent request cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return\n }\n\n if (client[kRunning] > 0 && (request.upgrade || request.method === 'CONNECT')) {\n // Don't dispatch an upgrade until all preceding requests have completed.\n // A misbehaving server might upgrade the connection before all pipelined\n // request has completed.\n return\n }\n\n if (client[kRunning] > 0 && util.bodyLength(request.body) !== 0 &&\n (util.isStream(request.body) || util.isAsyncIterable(request.body))) {\n // Request with stream or iterator body can error while other requests\n // are inflight and indirectly error those as well.\n // Ensure this doesn't happen by waiting for inflight\n // to complete before dispatching.\n\n // Request with stream or iterator body cannot be retried.\n // Ensure that no other requests are inflight and\n // could cause failure.\n return\n }\n\n if (!request.aborted && write(client, request)) {\n client[kPendingIdx]++\n } else {\n client[kQueue].splice(client[kPendingIdx], 1)\n }\n }\n}\n\n// https://www.rfc-editor.org/rfc/rfc7230#section-3.3.2\nfunction shouldSendContentLength (method) {\n return method !== 'GET' && method !== 'HEAD' && method !== 'OPTIONS' && method !== 'TRACE' && method !== 'CONNECT'\n}\n\nfunction write (client, request) {\n if (client[kHTTPConnVersion] === 'h2') {\n writeH2(client, client[kHTTP2Session], request)\n return\n }\n\n const { body, method, path, host, upgrade, headers, blocking, reset } = request\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH'\n )\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n const bodyLength = util.bodyLength(body)\n\n let contentLength = bodyLength\n\n if (contentLength === null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 && !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength !== null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n const socket = client[kSocket]\n\n try {\n request.onConnect((err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n errorRequest(client, request, err || new RequestAbortedError())\n\n util.destroy(socket, new InformationalError('aborted'))\n })\n } catch (err) {\n errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n if (method === 'HEAD') {\n // https://github.com/mcollina/undici/issues/258\n // Close after a HEAD request to interop with misbehaving servers\n // that may send a body in the response.\n\n socket[kReset] = true\n }\n\n if (upgrade || method === 'CONNECT') {\n // On CONNECT or upgrade, block pipeline from dispatching further\n // requests on this connection.\n\n socket[kReset] = true\n }\n\n if (reset != null) {\n socket[kReset] = reset\n }\n\n if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {\n socket[kReset] = true\n }\n\n if (blocking) {\n socket[kBlocking] = true\n }\n\n let header = `${method} ${path} HTTP/1.1\\r\\n`\n\n if (typeof host === 'string') {\n header += `host: ${host}\\r\\n`\n } else {\n header += client[kHostHeader]\n }\n\n if (upgrade) {\n header += `connection: upgrade\\r\\nupgrade: ${upgrade}\\r\\n`\n } else if (client[kPipelining] && !socket[kReset]) {\n header += 'connection: keep-alive\\r\\n'\n } else {\n header += 'connection: close\\r\\n'\n }\n\n if (headers) {\n header += headers\n }\n\n if (channels.sendHeaders.hasSubscribers) {\n channels.sendHeaders.publish({ request, headers: header, socket })\n }\n\n /* istanbul ignore else: assertion */\n if (!body || bodyLength === 0) {\n if (contentLength === 0) {\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n assert(contentLength === null, 'no body must not have content length')\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n request.onRequestSent()\n } else if (util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(body)\n socket.uncork()\n request.onBodySent(body)\n request.onRequestSent()\n if (!expectsPayload) {\n socket[kReset] = true\n }\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable({ body: body.stream(), client, request, socket, contentLength, header, expectsPayload })\n } else {\n writeBlob({ body, client, request, socket, contentLength, header, expectsPayload })\n }\n } else if (util.isStream(body)) {\n writeStream({ body, client, request, socket, contentLength, header, expectsPayload })\n } else if (util.isIterable(body)) {\n writeIterable({ body, client, request, socket, contentLength, header, expectsPayload })\n } else {\n assert(false)\n }\n\n return true\n}\n\nfunction writeH2 (client, session, request) {\n const { body, method, path, host, upgrade, expectContinue, signal, headers: reqHeaders } = request\n\n let headers\n if (typeof reqHeaders === 'string') headers = Request[kHTTP2CopyHeaders](reqHeaders.trim())\n else headers = reqHeaders\n\n if (upgrade) {\n errorRequest(client, request, new Error('Upgrade not supported for H2'))\n return false\n }\n\n try {\n // TODO(HTTP/2): Should we call onConnect immediately or on stream ready event?\n request.onConnect((err) => {\n if (request.aborted || request.completed) {\n return\n }\n\n errorRequest(client, request, err || new RequestAbortedError())\n })\n } catch (err) {\n errorRequest(client, request, err)\n }\n\n if (request.aborted) {\n return false\n }\n\n let stream\n const h2State = client[kHTTP2SessionState]\n\n headers[HTTP2_HEADER_AUTHORITY] = host || client[kHost]\n headers[HTTP2_HEADER_METHOD] = method\n\n if (method === 'CONNECT') {\n session.ref()\n // we are already connected, streams are pending, first request\n // will create a new stream. We trigger a request to create the stream and wait until\n // `ready` event is triggered\n // We disabled endStream to allow the user to write to the stream\n stream = session.request(headers, { endStream: false, signal })\n\n if (stream.id && !stream.pending) {\n request.onUpgrade(null, null, stream)\n ++h2State.openStreams\n } else {\n stream.once('ready', () => {\n request.onUpgrade(null, null, stream)\n ++h2State.openStreams\n })\n }\n\n stream.once('close', () => {\n h2State.openStreams -= 1\n // TODO(HTTP/2): unref only if current streams count is 0\n if (h2State.openStreams === 0) session.unref()\n })\n\n return true\n }\n\n // https://tools.ietf.org/html/rfc7540#section-8.3\n // :path and :scheme headers must be omited when sending CONNECT\n\n headers[HTTP2_HEADER_PATH] = path\n headers[HTTP2_HEADER_SCHEME] = 'https'\n\n // https://tools.ietf.org/html/rfc7231#section-4.3.1\n // https://tools.ietf.org/html/rfc7231#section-4.3.2\n // https://tools.ietf.org/html/rfc7231#section-4.3.5\n\n // Sending a payload body on a request that does not\n // expect it can cause undefined behavior on some\n // servers and corrupt connection state. Do not\n // re-use the connection for further requests.\n\n const expectsPayload = (\n method === 'PUT' ||\n method === 'POST' ||\n method === 'PATCH'\n )\n\n if (body && typeof body.read === 'function') {\n // Try to read EOF in order to get length.\n body.read(0)\n }\n\n let contentLength = util.bodyLength(body)\n\n if (contentLength == null) {\n contentLength = request.contentLength\n }\n\n if (contentLength === 0 || !expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD NOT send a Content-Length header field when\n // the request message does not contain a payload body and the method\n // semantics do not anticipate such a body.\n\n contentLength = null\n }\n\n // https://github.com/nodejs/undici/issues/2046\n // A user agent may send a Content-Length header with 0 value, this should be allowed.\n if (shouldSendContentLength(method) && contentLength > 0 && request.contentLength != null && request.contentLength !== contentLength) {\n if (client[kStrictContentLength]) {\n errorRequest(client, request, new RequestContentLengthMismatchError())\n return false\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n if (contentLength != null) {\n assert(body, 'no body must not have content length')\n headers[HTTP2_HEADER_CONTENT_LENGTH] = `${contentLength}`\n }\n\n session.ref()\n\n const shouldEndStream = method === 'GET' || method === 'HEAD'\n if (expectContinue) {\n headers[HTTP2_HEADER_EXPECT] = '100-continue'\n /**\n * @type {import('node:http2').ClientHttp2Stream}\n */\n stream = session.request(headers, { endStream: shouldEndStream, signal })\n\n stream.once('continue', writeBodyH2)\n } else {\n /** @type {import('node:http2').ClientHttp2Stream} */\n stream = session.request(headers, {\n endStream: shouldEndStream,\n signal\n })\n writeBodyH2()\n }\n\n // Increment counter as we have new several streams open\n ++h2State.openStreams\n\n stream.once('response', headers => {\n if (request.onHeaders(Number(headers[HTTP2_HEADER_STATUS]), headers, stream.resume.bind(stream), '') === false) {\n stream.pause()\n }\n })\n\n stream.once('end', () => {\n request.onComplete([])\n })\n\n stream.on('data', (chunk) => {\n if (request.onData(chunk) === false) stream.pause()\n })\n\n stream.once('close', () => {\n h2State.openStreams -= 1\n // TODO(HTTP/2): unref only if current streams count is 0\n if (h2State.openStreams === 0) session.unref()\n })\n\n stream.once('error', function (err) {\n if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {\n h2State.streams -= 1\n util.destroy(stream, err)\n }\n })\n\n stream.once('frameError', (type, code) => {\n const err = new InformationalError(`HTTP/2: \"frameError\" received - type ${type}, code ${code}`)\n errorRequest(client, request, err)\n\n if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {\n h2State.streams -= 1\n util.destroy(stream, err)\n }\n })\n\n // stream.on('aborted', () => {\n // // TODO(HTTP/2): Support aborted\n // })\n\n // stream.on('timeout', () => {\n // // TODO(HTTP/2): Support timeout\n // })\n\n // stream.on('push', headers => {\n // // TODO(HTTP/2): Suppor push\n // })\n\n // stream.on('trailers', headers => {\n // // TODO(HTTP/2): Support trailers\n // })\n\n return true\n\n function writeBodyH2 () {\n /* istanbul ignore else: assertion */\n if (!body) {\n request.onRequestSent()\n } else if (util.isBuffer(body)) {\n assert(contentLength === body.byteLength, 'buffer body must have content length')\n stream.cork()\n stream.write(body)\n stream.uncork()\n stream.end()\n request.onBodySent(body)\n request.onRequestSent()\n } else if (util.isBlobLike(body)) {\n if (typeof body.stream === 'function') {\n writeIterable({\n client,\n request,\n contentLength,\n h2stream: stream,\n expectsPayload,\n body: body.stream(),\n socket: client[kSocket],\n header: ''\n })\n } else {\n writeBlob({\n body,\n client,\n request,\n contentLength,\n expectsPayload,\n h2stream: stream,\n header: '',\n socket: client[kSocket]\n })\n }\n } else if (util.isStream(body)) {\n writeStream({\n body,\n client,\n request,\n contentLength,\n expectsPayload,\n socket: client[kSocket],\n h2stream: stream,\n header: ''\n })\n } else if (util.isIterable(body)) {\n writeIterable({\n body,\n client,\n request,\n contentLength,\n expectsPayload,\n header: '',\n h2stream: stream,\n socket: client[kSocket]\n })\n } else {\n assert(false)\n }\n }\n}\n\nfunction writeStream ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'stream body cannot be pipelined')\n\n if (client[kHTTPConnVersion] === 'h2') {\n // For HTTP/2, is enough to pipe the stream\n const pipe = pipeline(\n body,\n h2stream,\n (err) => {\n if (err) {\n util.destroy(body, err)\n util.destroy(h2stream, err)\n } else {\n request.onRequestSent()\n }\n }\n )\n\n pipe.on('data', onPipeData)\n pipe.once('end', () => {\n pipe.removeListener('data', onPipeData)\n util.destroy(pipe)\n })\n\n function onPipeData (chunk) {\n request.onBodySent(chunk)\n }\n\n return\n }\n\n let finished = false\n\n const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })\n\n const onData = function (chunk) {\n if (finished) {\n return\n }\n\n try {\n if (!writer.write(chunk) && this.pause) {\n this.pause()\n }\n } catch (err) {\n util.destroy(this, err)\n }\n }\n const onDrain = function () {\n if (finished) {\n return\n }\n\n if (body.resume) {\n body.resume()\n }\n }\n const onAbort = function () {\n onFinished(new RequestAbortedError())\n }\n const onFinished = function (err) {\n if (finished) {\n return\n }\n\n finished = true\n\n assert(socket.destroyed || (socket[kWriting] && client[kRunning] <= 1))\n\n socket\n .off('drain', onDrain)\n .off('error', onFinished)\n\n body\n .removeListener('data', onData)\n .removeListener('end', onFinished)\n .removeListener('error', onFinished)\n .removeListener('close', onAbort)\n\n if (!err) {\n try {\n writer.end()\n } catch (er) {\n err = er\n }\n }\n\n writer.destroy(err)\n\n if (err && (err.code !== 'UND_ERR_INFO' || err.message !== 'reset')) {\n util.destroy(body, err)\n } else {\n util.destroy(body)\n }\n }\n\n body\n .on('data', onData)\n .on('end', onFinished)\n .on('error', onFinished)\n .on('close', onAbort)\n\n if (body.resume) {\n body.resume()\n }\n\n socket\n .on('drain', onDrain)\n .on('error', onFinished)\n}\n\nasync function writeBlob ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {\n assert(contentLength === body.size, 'blob body must have content length')\n\n const isH2 = client[kHTTPConnVersion] === 'h2'\n try {\n if (contentLength != null && contentLength !== body.size) {\n throw new RequestContentLengthMismatchError()\n }\n\n const buffer = Buffer.from(await body.arrayBuffer())\n\n if (isH2) {\n h2stream.cork()\n h2stream.write(buffer)\n h2stream.uncork()\n } else {\n socket.cork()\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n socket.write(buffer)\n socket.uncork()\n }\n\n request.onBodySent(buffer)\n request.onRequestSent()\n\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n resume(client)\n } catch (err) {\n util.destroy(isH2 ? h2stream : socket, err)\n }\n}\n\nasync function writeIterable ({ h2stream, body, client, request, socket, contentLength, header, expectsPayload }) {\n assert(contentLength !== 0 || client[kRunning] === 0, 'iterator body cannot be pipelined')\n\n let callback = null\n function onDrain () {\n if (callback) {\n const cb = callback\n callback = null\n cb()\n }\n }\n\n const waitForDrain = () => new Promise((resolve, reject) => {\n assert(callback === null)\n\n if (socket[kError]) {\n reject(socket[kError])\n } else {\n callback = resolve\n }\n })\n\n if (client[kHTTPConnVersion] === 'h2') {\n h2stream\n .on('close', onDrain)\n .on('drain', onDrain)\n\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n const res = h2stream.write(chunk)\n request.onBodySent(chunk)\n if (!res) {\n await waitForDrain()\n }\n }\n } catch (err) {\n h2stream.destroy(err)\n } finally {\n request.onRequestSent()\n h2stream.end()\n h2stream\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n\n return\n }\n\n socket\n .on('close', onDrain)\n .on('drain', onDrain)\n\n const writer = new AsyncWriter({ socket, request, contentLength, client, expectsPayload, header })\n try {\n // It's up to the user to somehow abort the async iterable.\n for await (const chunk of body) {\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (!writer.write(chunk)) {\n await waitForDrain()\n }\n }\n\n writer.end()\n } catch (err) {\n writer.destroy(err)\n } finally {\n socket\n .off('close', onDrain)\n .off('drain', onDrain)\n }\n}\n\nclass AsyncWriter {\n constructor ({ socket, request, contentLength, client, expectsPayload, header }) {\n this.socket = socket\n this.request = request\n this.contentLength = contentLength\n this.client = client\n this.bytesWritten = 0\n this.expectsPayload = expectsPayload\n this.header = header\n\n socket[kWriting] = true\n }\n\n write (chunk) {\n const { socket, request, contentLength, client, bytesWritten, expectsPayload, header } = this\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return false\n }\n\n const len = Buffer.byteLength(chunk)\n if (!len) {\n return true\n }\n\n // We should defer writing chunks.\n if (contentLength !== null && bytesWritten + len > contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n }\n\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n\n socket.cork()\n\n if (bytesWritten === 0) {\n if (!expectsPayload) {\n socket[kReset] = true\n }\n\n if (contentLength === null) {\n socket.write(`${header}transfer-encoding: chunked\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}content-length: ${contentLength}\\r\\n\\r\\n`, 'latin1')\n }\n }\n\n if (contentLength === null) {\n socket.write(`\\r\\n${len.toString(16)}\\r\\n`, 'latin1')\n }\n\n this.bytesWritten += len\n\n const ret = socket.write(chunk)\n\n socket.uncork()\n\n request.onBodySent(chunk)\n\n if (!ret) {\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n // istanbul ignore else: only for jest\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n }\n\n return ret\n }\n\n end () {\n const { socket, contentLength, client, bytesWritten, expectsPayload, header, request } = this\n request.onRequestSent()\n\n socket[kWriting] = false\n\n if (socket[kError]) {\n throw socket[kError]\n }\n\n if (socket.destroyed) {\n return\n }\n\n if (bytesWritten === 0) {\n if (expectsPayload) {\n // https://tools.ietf.org/html/rfc7230#section-3.3.2\n // A user agent SHOULD send a Content-Length in a request message when\n // no Transfer-Encoding is sent and the request method defines a meaning\n // for an enclosed payload body.\n\n socket.write(`${header}content-length: 0\\r\\n\\r\\n`, 'latin1')\n } else {\n socket.write(`${header}\\r\\n`, 'latin1')\n }\n } else if (contentLength === null) {\n socket.write('\\r\\n0\\r\\n\\r\\n', 'latin1')\n }\n\n if (contentLength !== null && bytesWritten !== contentLength) {\n if (client[kStrictContentLength]) {\n throw new RequestContentLengthMismatchError()\n } else {\n process.emitWarning(new RequestContentLengthMismatchError())\n }\n }\n\n if (socket[kParser].timeout && socket[kParser].timeoutType === TIMEOUT_HEADERS) {\n // istanbul ignore else: only for jest\n if (socket[kParser].timeout.refresh) {\n socket[kParser].timeout.refresh()\n }\n }\n\n resume(client)\n }\n\n destroy (err) {\n const { socket, client } = this\n\n socket[kWriting] = false\n\n if (err) {\n assert(client[kRunning] <= 1, 'pipeline should only contain this request')\n util.destroy(socket, err)\n }\n }\n}\n\nfunction errorRequest (client, request, err) {\n try {\n request.onError(err)\n assert(request.aborted)\n } catch (err) {\n client.emit('error', err)\n }\n}\n\nmodule.exports = Client\n","'use strict'\n\n/* istanbul ignore file: only for Node 12 */\n\nconst { kConnected, kSize } = require('../core/symbols')\n\nclass CompatWeakRef {\n constructor (value) {\n this.value = value\n }\n\n deref () {\n return this.value[kConnected] === 0 && this.value[kSize] === 0\n ? undefined\n : this.value\n }\n}\n\nclass CompatFinalizer {\n constructor (finalizer) {\n this.finalizer = finalizer\n }\n\n register (dispatcher, key) {\n if (dispatcher.on) {\n dispatcher.on('disconnect', () => {\n if (dispatcher[kConnected] === 0 && dispatcher[kSize] === 0) {\n this.finalizer(key)\n }\n })\n }\n }\n}\n\nmodule.exports = function () {\n // FIXME: remove workaround when the Node bug is fixed\n // https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\n if (process.env.NODE_V8_COVERAGE) {\n return {\n WeakRef: CompatWeakRef,\n FinalizationRegistry: CompatFinalizer\n }\n }\n return {\n WeakRef: global.WeakRef || CompatWeakRef,\n FinalizationRegistry: global.FinalizationRegistry || CompatFinalizer\n }\n}\n","'use strict'\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-attribute-value-size\nconst maxAttributeValueSize = 1024\n\n// https://wicg.github.io/cookie-store/#cookie-maximum-name-value-pair-size\nconst maxNameValuePairSize = 4096\n\nmodule.exports = {\n maxAttributeValueSize,\n maxNameValuePairSize\n}\n","'use strict'\n\nconst { parseSetCookie } = require('./parse')\nconst { stringify, getHeadersList } = require('./util')\nconst { webidl } = require('../fetch/webidl')\nconst { Headers } = require('../fetch/headers')\n\n/**\n * @typedef {Object} Cookie\n * @property {string} name\n * @property {string} value\n * @property {Date|number|undefined} expires\n * @property {number|undefined} maxAge\n * @property {string|undefined} domain\n * @property {string|undefined} path\n * @property {boolean|undefined} secure\n * @property {boolean|undefined} httpOnly\n * @property {'Strict'|'Lax'|'None'} sameSite\n * @property {string[]} unparsed\n */\n\n/**\n * @param {Headers} headers\n * @returns {Record}\n */\nfunction getCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'getCookies' })\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const cookie = headers.get('cookie')\n const out = {}\n\n if (!cookie) {\n return out\n }\n\n for (const piece of cookie.split(';')) {\n const [name, ...value] = piece.split('=')\n\n out[name.trim()] = value.join('=')\n }\n\n return out\n}\n\n/**\n * @param {Headers} headers\n * @param {string} name\n * @param {{ path?: string, domain?: string }|undefined} attributes\n * @returns {void}\n */\nfunction deleteCookie (headers, name, attributes) {\n webidl.argumentLengthCheck(arguments, 2, { header: 'deleteCookie' })\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n name = webidl.converters.DOMString(name)\n attributes = webidl.converters.DeleteCookieAttributes(attributes)\n\n // Matches behavior of\n // https://github.com/denoland/deno_std/blob/63827b16330b82489a04614027c33b7904e08be5/http/cookie.ts#L278\n setCookie(headers, {\n name,\n value: '',\n expires: new Date(0),\n ...attributes\n })\n}\n\n/**\n * @param {Headers} headers\n * @returns {Cookie[]}\n */\nfunction getSetCookies (headers) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'getSetCookies' })\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n const cookies = getHeadersList(headers).cookies\n\n if (!cookies) {\n return []\n }\n\n // In older versions of undici, cookies is a list of name:value.\n return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))\n}\n\n/**\n * @param {Headers} headers\n * @param {Cookie} cookie\n * @returns {void}\n */\nfunction setCookie (headers, cookie) {\n webidl.argumentLengthCheck(arguments, 2, { header: 'setCookie' })\n\n webidl.brandCheck(headers, Headers, { strict: false })\n\n cookie = webidl.converters.Cookie(cookie)\n\n const str = stringify(cookie)\n\n if (str) {\n headers.append('Set-Cookie', stringify(cookie))\n }\n}\n\nwebidl.converters.DeleteCookieAttributes = webidl.dictionaryConverter([\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: null\n }\n])\n\nwebidl.converters.Cookie = webidl.dictionaryConverter([\n {\n converter: webidl.converters.DOMString,\n key: 'name'\n },\n {\n converter: webidl.converters.DOMString,\n key: 'value'\n },\n {\n converter: webidl.nullableConverter((value) => {\n if (typeof value === 'number') {\n return webidl.converters['unsigned long long'](value)\n }\n\n return new Date(value)\n }),\n key: 'expires',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters['long long']),\n key: 'maxAge',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'domain',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.DOMString),\n key: 'path',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'secure',\n defaultValue: null\n },\n {\n converter: webidl.nullableConverter(webidl.converters.boolean),\n key: 'httpOnly',\n defaultValue: null\n },\n {\n converter: webidl.converters.USVString,\n key: 'sameSite',\n allowedValues: ['Strict', 'Lax', 'None']\n },\n {\n converter: webidl.sequenceConverter(webidl.converters.DOMString),\n key: 'unparsed',\n defaultValue: []\n }\n])\n\nmodule.exports = {\n getCookies,\n deleteCookie,\n getSetCookies,\n setCookie\n}\n","'use strict'\n\nconst { maxNameValuePairSize, maxAttributeValueSize } = require('./constants')\nconst { isCTLExcludingHtab } = require('./util')\nconst { collectASequenceOfCodePointsFast } = require('../fetch/dataURL')\nconst assert = require('assert')\n\n/**\n * @description Parses the field-value attributes of a set-cookie header string.\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} header\n * @returns if the header is invalid, null will be returned\n */\nfunction parseSetCookie (header) {\n // 1. If the set-cookie-string contains a %x00-08 / %x0A-1F / %x7F\n // character (CTL characters excluding HTAB): Abort these steps and\n // ignore the set-cookie-string entirely.\n if (isCTLExcludingHtab(header)) {\n return null\n }\n\n let nameValuePair = ''\n let unparsedAttributes = ''\n let name = ''\n let value = ''\n\n // 2. If the set-cookie-string contains a %x3B (\";\") character:\n if (header.includes(';')) {\n // 1. The name-value-pair string consists of the characters up to,\n // but not including, the first %x3B (\";\"), and the unparsed-\n // attributes consist of the remainder of the set-cookie-string\n // (including the %x3B (\";\") in question).\n const position = { position: 0 }\n\n nameValuePair = collectASequenceOfCodePointsFast(';', header, position)\n unparsedAttributes = header.slice(position.position)\n } else {\n // Otherwise:\n\n // 1. The name-value-pair string consists of all the characters\n // contained in the set-cookie-string, and the unparsed-\n // attributes is the empty string.\n nameValuePair = header\n }\n\n // 3. If the name-value-pair string lacks a %x3D (\"=\") character, then\n // the name string is empty, and the value string is the value of\n // name-value-pair.\n if (!nameValuePair.includes('=')) {\n value = nameValuePair\n } else {\n // Otherwise, the name string consists of the characters up to, but\n // not including, the first %x3D (\"=\") character, and the (possibly\n // empty) value string consists of the characters after the first\n // %x3D (\"=\") character.\n const position = { position: 0 }\n name = collectASequenceOfCodePointsFast(\n '=',\n nameValuePair,\n position\n )\n value = nameValuePair.slice(position.position + 1)\n }\n\n // 4. Remove any leading or trailing WSP characters from the name\n // string and the value string.\n name = name.trim()\n value = value.trim()\n\n // 5. If the sum of the lengths of the name string and the value string\n // is more than 4096 octets, abort these steps and ignore the set-\n // cookie-string entirely.\n if (name.length + value.length > maxNameValuePairSize) {\n return null\n }\n\n // 6. The cookie-name is the name string, and the cookie-value is the\n // value string.\n return {\n name, value, ...parseUnparsedAttributes(unparsedAttributes)\n }\n}\n\n/**\n * Parses the remaining attributes of a set-cookie header\n * @see https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4\n * @param {string} unparsedAttributes\n * @param {[Object.]={}} cookieAttributeList\n */\nfunction parseUnparsedAttributes (unparsedAttributes, cookieAttributeList = {}) {\n // 1. If the unparsed-attributes string is empty, skip the rest of\n // these steps.\n if (unparsedAttributes.length === 0) {\n return cookieAttributeList\n }\n\n // 2. Discard the first character of the unparsed-attributes (which\n // will be a %x3B (\";\") character).\n assert(unparsedAttributes[0] === ';')\n unparsedAttributes = unparsedAttributes.slice(1)\n\n let cookieAv = ''\n\n // 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n // character:\n if (unparsedAttributes.includes(';')) {\n // 1. Consume the characters of the unparsed-attributes up to, but\n // not including, the first %x3B (\";\") character.\n cookieAv = collectASequenceOfCodePointsFast(\n ';',\n unparsedAttributes,\n { position: 0 }\n )\n unparsedAttributes = unparsedAttributes.slice(cookieAv.length)\n } else {\n // Otherwise:\n\n // 1. Consume the remainder of the unparsed-attributes.\n cookieAv = unparsedAttributes\n unparsedAttributes = ''\n }\n\n // Let the cookie-av string be the characters consumed in this step.\n\n let attributeName = ''\n let attributeValue = ''\n\n // 4. If the cookie-av string contains a %x3D (\"=\") character:\n if (cookieAv.includes('=')) {\n // 1. The (possibly empty) attribute-name string consists of the\n // characters up to, but not including, the first %x3D (\"=\")\n // character, and the (possibly empty) attribute-value string\n // consists of the characters after the first %x3D (\"=\")\n // character.\n const position = { position: 0 }\n\n attributeName = collectASequenceOfCodePointsFast(\n '=',\n cookieAv,\n position\n )\n attributeValue = cookieAv.slice(position.position + 1)\n } else {\n // Otherwise:\n\n // 1. The attribute-name string consists of the entire cookie-av\n // string, and the attribute-value string is empty.\n attributeName = cookieAv\n }\n\n // 5. Remove any leading or trailing WSP characters from the attribute-\n // name string and the attribute-value string.\n attributeName = attributeName.trim()\n attributeValue = attributeValue.trim()\n\n // 6. If the attribute-value is longer than 1024 octets, ignore the\n // cookie-av string and return to Step 1 of this algorithm.\n if (attributeValue.length > maxAttributeValueSize) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 7. Process the attribute-name and attribute-value according to the\n // requirements in the following subsections. (Notice that\n // attributes with unrecognized attribute-names are ignored.)\n const attributeNameLowercase = attributeName.toLowerCase()\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.1\n // If the attribute-name case-insensitively matches the string\n // \"Expires\", the user agent MUST process the cookie-av as follows.\n if (attributeNameLowercase === 'expires') {\n // 1. Let the expiry-time be the result of parsing the attribute-value\n // as cookie-date (see Section 5.1.1).\n const expiryTime = new Date(attributeValue)\n\n // 2. If the attribute-value failed to parse as a cookie date, ignore\n // the cookie-av.\n\n cookieAttributeList.expires = expiryTime\n } else if (attributeNameLowercase === 'max-age') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.2\n // If the attribute-name case-insensitively matches the string \"Max-\n // Age\", the user agent MUST process the cookie-av as follows.\n\n // 1. If the first character of the attribute-value is not a DIGIT or a\n // \"-\" character, ignore the cookie-av.\n const charCode = attributeValue.charCodeAt(0)\n\n if ((charCode < 48 || charCode > 57) && attributeValue[0] !== '-') {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 2. If the remainder of attribute-value contains a non-DIGIT\n // character, ignore the cookie-av.\n if (!/^\\d+$/.test(attributeValue)) {\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n }\n\n // 3. Let delta-seconds be the attribute-value converted to an integer.\n const deltaSeconds = Number(attributeValue)\n\n // 4. Let cookie-age-limit be the maximum age of the cookie (which\n // SHOULD be 400 days or less, see Section 4.1.2.2).\n\n // 5. Set delta-seconds to the smaller of its present value and cookie-\n // age-limit.\n // deltaSeconds = Math.min(deltaSeconds * 1000, maxExpiresMs)\n\n // 6. If delta-seconds is less than or equal to zero (0), let expiry-\n // time be the earliest representable date and time. Otherwise, let\n // the expiry-time be the current date and time plus delta-seconds\n // seconds.\n // const expiryTime = deltaSeconds <= 0 ? Date.now() : Date.now() + deltaSeconds\n\n // 7. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Max-Age and an attribute-value of expiry-time.\n cookieAttributeList.maxAge = deltaSeconds\n } else if (attributeNameLowercase === 'domain') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.3\n // If the attribute-name case-insensitively matches the string \"Domain\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. Let cookie-domain be the attribute-value.\n let cookieDomain = attributeValue\n\n // 2. If cookie-domain starts with %x2E (\".\"), let cookie-domain be\n // cookie-domain without its leading %x2E (\".\").\n if (cookieDomain[0] === '.') {\n cookieDomain = cookieDomain.slice(1)\n }\n\n // 3. Convert the cookie-domain to lower case.\n cookieDomain = cookieDomain.toLowerCase()\n\n // 4. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Domain and an attribute-value of cookie-domain.\n cookieAttributeList.domain = cookieDomain\n } else if (attributeNameLowercase === 'path') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.4\n // If the attribute-name case-insensitively matches the string \"Path\",\n // the user agent MUST process the cookie-av as follows.\n\n // 1. If the attribute-value is empty or if the first character of the\n // attribute-value is not %x2F (\"/\"):\n let cookiePath = ''\n if (attributeValue.length === 0 || attributeValue[0] !== '/') {\n // 1. Let cookie-path be the default-path.\n cookiePath = '/'\n } else {\n // Otherwise:\n\n // 1. Let cookie-path be the attribute-value.\n cookiePath = attributeValue\n }\n\n // 2. Append an attribute to the cookie-attribute-list with an\n // attribute-name of Path and an attribute-value of cookie-path.\n cookieAttributeList.path = cookiePath\n } else if (attributeNameLowercase === 'secure') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.5\n // If the attribute-name case-insensitively matches the string \"Secure\",\n // the user agent MUST append an attribute to the cookie-attribute-list\n // with an attribute-name of Secure and an empty attribute-value.\n\n cookieAttributeList.secure = true\n } else if (attributeNameLowercase === 'httponly') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.6\n // If the attribute-name case-insensitively matches the string\n // \"HttpOnly\", the user agent MUST append an attribute to the cookie-\n // attribute-list with an attribute-name of HttpOnly and an empty\n // attribute-value.\n\n cookieAttributeList.httpOnly = true\n } else if (attributeNameLowercase === 'samesite') {\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-rfc6265bis#section-5.4.7\n // If the attribute-name case-insensitively matches the string\n // \"SameSite\", the user agent MUST process the cookie-av as follows:\n\n // 1. Let enforcement be \"Default\".\n let enforcement = 'Default'\n\n const attributeValueLowercase = attributeValue.toLowerCase()\n // 2. If cookie-av's attribute-value is a case-insensitive match for\n // \"None\", set enforcement to \"None\".\n if (attributeValueLowercase.includes('none')) {\n enforcement = 'None'\n }\n\n // 3. If cookie-av's attribute-value is a case-insensitive match for\n // \"Strict\", set enforcement to \"Strict\".\n if (attributeValueLowercase.includes('strict')) {\n enforcement = 'Strict'\n }\n\n // 4. If cookie-av's attribute-value is a case-insensitive match for\n // \"Lax\", set enforcement to \"Lax\".\n if (attributeValueLowercase.includes('lax')) {\n enforcement = 'Lax'\n }\n\n // 5. Append an attribute to the cookie-attribute-list with an\n // attribute-name of \"SameSite\" and an attribute-value of\n // enforcement.\n cookieAttributeList.sameSite = enforcement\n } else {\n cookieAttributeList.unparsed ??= []\n\n cookieAttributeList.unparsed.push(`${attributeName}=${attributeValue}`)\n }\n\n // 8. Return to Step 1 of this algorithm.\n return parseUnparsedAttributes(unparsedAttributes, cookieAttributeList)\n}\n\nmodule.exports = {\n parseSetCookie,\n parseUnparsedAttributes\n}\n","'use strict'\n\nconst assert = require('assert')\nconst { kHeadersList } = require('../core/symbols')\n\nfunction isCTLExcludingHtab (value) {\n if (value.length === 0) {\n return false\n }\n\n for (const char of value) {\n const code = char.charCodeAt(0)\n\n if (\n (code >= 0x00 || code <= 0x08) ||\n (code >= 0x0A || code <= 0x1F) ||\n code === 0x7F\n ) {\n return false\n }\n }\n}\n\n/**\n CHAR = \n token = 1*\n separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n | \",\" | \";\" | \":\" | \"\\\" | <\">\n | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n | \"{\" | \"}\" | SP | HT\n * @param {string} name\n */\nfunction validateCookieName (name) {\n for (const char of name) {\n const code = char.charCodeAt(0)\n\n if (\n (code <= 0x20 || code > 0x7F) ||\n char === '(' ||\n char === ')' ||\n char === '>' ||\n char === '<' ||\n char === '@' ||\n char === ',' ||\n char === ';' ||\n char === ':' ||\n char === '\\\\' ||\n char === '\"' ||\n char === '/' ||\n char === '[' ||\n char === ']' ||\n char === '?' ||\n char === '=' ||\n char === '{' ||\n char === '}'\n ) {\n throw new Error('Invalid cookie name')\n }\n }\n}\n\n/**\n cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n ; US-ASCII characters excluding CTLs,\n ; whitespace DQUOTE, comma, semicolon,\n ; and backslash\n * @param {string} value\n */\nfunction validateCookieValue (value) {\n for (const char of value) {\n const code = char.charCodeAt(0)\n\n if (\n code < 0x21 || // exclude CTLs (0-31)\n code === 0x22 ||\n code === 0x2C ||\n code === 0x3B ||\n code === 0x5C ||\n code > 0x7E // non-ascii\n ) {\n throw new Error('Invalid header value')\n }\n }\n}\n\n/**\n * path-value = \n * @param {string} path\n */\nfunction validateCookiePath (path) {\n for (const char of path) {\n const code = char.charCodeAt(0)\n\n if (code < 0x21 || char === ';') {\n throw new Error('Invalid cookie path')\n }\n }\n}\n\n/**\n * I have no idea why these values aren't allowed to be honest,\n * but Deno tests these. - Khafra\n * @param {string} domain\n */\nfunction validateCookieDomain (domain) {\n if (\n domain.startsWith('-') ||\n domain.endsWith('.') ||\n domain.endsWith('-')\n ) {\n throw new Error('Invalid cookie domain')\n }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc7231#section-7.1.1.1\n * @param {number|Date} date\n IMF-fixdate = day-name \",\" SP date1 SP time-of-day SP GMT\n ; fixed length/zone/capitalization subset of the format\n ; see Section 3.3 of [RFC5322]\n\n day-name = %x4D.6F.6E ; \"Mon\", case-sensitive\n / %x54.75.65 ; \"Tue\", case-sensitive\n / %x57.65.64 ; \"Wed\", case-sensitive\n / %x54.68.75 ; \"Thu\", case-sensitive\n / %x46.72.69 ; \"Fri\", case-sensitive\n / %x53.61.74 ; \"Sat\", case-sensitive\n / %x53.75.6E ; \"Sun\", case-sensitive\n date1 = day SP month SP year\n ; e.g., 02 Jun 1982\n\n day = 2DIGIT\n month = %x4A.61.6E ; \"Jan\", case-sensitive\n / %x46.65.62 ; \"Feb\", case-sensitive\n / %x4D.61.72 ; \"Mar\", case-sensitive\n / %x41.70.72 ; \"Apr\", case-sensitive\n / %x4D.61.79 ; \"May\", case-sensitive\n / %x4A.75.6E ; \"Jun\", case-sensitive\n / %x4A.75.6C ; \"Jul\", case-sensitive\n / %x41.75.67 ; \"Aug\", case-sensitive\n / %x53.65.70 ; \"Sep\", case-sensitive\n / %x4F.63.74 ; \"Oct\", case-sensitive\n / %x4E.6F.76 ; \"Nov\", case-sensitive\n / %x44.65.63 ; \"Dec\", case-sensitive\n year = 4DIGIT\n\n GMT = %x47.4D.54 ; \"GMT\", case-sensitive\n\n time-of-day = hour \":\" minute \":\" second\n ; 00:00:00 - 23:59:60 (leap second)\n\n hour = 2DIGIT\n minute = 2DIGIT\n second = 2DIGIT\n */\nfunction toIMFDate (date) {\n if (typeof date === 'number') {\n date = new Date(date)\n }\n\n const days = [\n 'Sun', 'Mon', 'Tue', 'Wed',\n 'Thu', 'Fri', 'Sat'\n ]\n\n const months = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n ]\n\n const dayName = days[date.getUTCDay()]\n const day = date.getUTCDate().toString().padStart(2, '0')\n const month = months[date.getUTCMonth()]\n const year = date.getUTCFullYear()\n const hour = date.getUTCHours().toString().padStart(2, '0')\n const minute = date.getUTCMinutes().toString().padStart(2, '0')\n const second = date.getUTCSeconds().toString().padStart(2, '0')\n\n return `${dayName}, ${day} ${month} ${year} ${hour}:${minute}:${second} GMT`\n}\n\n/**\n max-age-av = \"Max-Age=\" non-zero-digit *DIGIT\n ; In practice, both expires-av and max-age-av\n ; are limited to dates representable by the\n ; user agent.\n * @param {number} maxAge\n */\nfunction validateCookieMaxAge (maxAge) {\n if (maxAge < 0) {\n throw new Error('Invalid cookie max-age')\n }\n}\n\n/**\n * @see https://www.rfc-editor.org/rfc/rfc6265#section-4.1.1\n * @param {import('./index').Cookie} cookie\n */\nfunction stringify (cookie) {\n if (cookie.name.length === 0) {\n return null\n }\n\n validateCookieName(cookie.name)\n validateCookieValue(cookie.value)\n\n const out = [`${cookie.name}=${cookie.value}`]\n\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.1\n // https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-cookie-prefixes-00#section-3.2\n if (cookie.name.startsWith('__Secure-')) {\n cookie.secure = true\n }\n\n if (cookie.name.startsWith('__Host-')) {\n cookie.secure = true\n cookie.domain = null\n cookie.path = '/'\n }\n\n if (cookie.secure) {\n out.push('Secure')\n }\n\n if (cookie.httpOnly) {\n out.push('HttpOnly')\n }\n\n if (typeof cookie.maxAge === 'number') {\n validateCookieMaxAge(cookie.maxAge)\n out.push(`Max-Age=${cookie.maxAge}`)\n }\n\n if (cookie.domain) {\n validateCookieDomain(cookie.domain)\n out.push(`Domain=${cookie.domain}`)\n }\n\n if (cookie.path) {\n validateCookiePath(cookie.path)\n out.push(`Path=${cookie.path}`)\n }\n\n if (cookie.expires && cookie.expires.toString() !== 'Invalid Date') {\n out.push(`Expires=${toIMFDate(cookie.expires)}`)\n }\n\n if (cookie.sameSite) {\n out.push(`SameSite=${cookie.sameSite}`)\n }\n\n for (const part of cookie.unparsed) {\n if (!part.includes('=')) {\n throw new Error('Invalid unparsed')\n }\n\n const [key, ...value] = part.split('=')\n\n out.push(`${key.trim()}=${value.join('=')}`)\n }\n\n return out.join('; ')\n}\n\nlet kHeadersListNode\n\nfunction getHeadersList (headers) {\n if (headers[kHeadersList]) {\n return headers[kHeadersList]\n }\n\n if (!kHeadersListNode) {\n kHeadersListNode = Object.getOwnPropertySymbols(headers).find(\n (symbol) => symbol.description === 'headers list'\n )\n\n assert(kHeadersListNode, 'Headers cannot be parsed')\n }\n\n const headersList = headers[kHeadersListNode]\n assert(headersList)\n\n return headersList\n}\n\nmodule.exports = {\n isCTLExcludingHtab,\n stringify,\n getHeadersList\n}\n","'use strict'\n\nconst net = require('net')\nconst assert = require('assert')\nconst util = require('./util')\nconst { InvalidArgumentError, ConnectTimeoutError } = require('./errors')\n\nlet tls // include tls conditionally since it is not always available\n\n// TODO: session re-use does not wait for the first\n// connection to resolve the session and might therefore\n// resolve the same servername multiple times even when\n// re-use is enabled.\n\nlet SessionCache\n// FIXME: remove workaround when the Node bug is fixed\n// https://github.com/nodejs/node/issues/49344#issuecomment-1741776308\nif (global.FinalizationRegistry && !process.env.NODE_V8_COVERAGE) {\n SessionCache = class WeakSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n this._sessionRegistry = new global.FinalizationRegistry((key) => {\n if (this._sessionCache.size < this._maxCachedSessions) {\n return\n }\n\n const ref = this._sessionCache.get(key)\n if (ref !== undefined && ref.deref() === undefined) {\n this._sessionCache.delete(key)\n }\n })\n }\n\n get (sessionKey) {\n const ref = this._sessionCache.get(sessionKey)\n return ref ? ref.deref() : null\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n this._sessionCache.set(sessionKey, new WeakRef(session))\n this._sessionRegistry.register(session, sessionKey)\n }\n }\n} else {\n SessionCache = class SimpleSessionCache {\n constructor (maxCachedSessions) {\n this._maxCachedSessions = maxCachedSessions\n this._sessionCache = new Map()\n }\n\n get (sessionKey) {\n return this._sessionCache.get(sessionKey)\n }\n\n set (sessionKey, session) {\n if (this._maxCachedSessions === 0) {\n return\n }\n\n if (this._sessionCache.size >= this._maxCachedSessions) {\n // remove the oldest session\n const { value: oldestKey } = this._sessionCache.keys().next()\n this._sessionCache.delete(oldestKey)\n }\n\n this._sessionCache.set(sessionKey, session)\n }\n }\n}\n\nfunction buildConnector ({ allowH2, maxCachedSessions, socketPath, timeout, ...opts }) {\n if (maxCachedSessions != null && (!Number.isInteger(maxCachedSessions) || maxCachedSessions < 0)) {\n throw new InvalidArgumentError('maxCachedSessions must be a positive integer or zero')\n }\n\n const options = { path: socketPath, ...opts }\n const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions)\n timeout = timeout == null ? 10e3 : timeout\n allowH2 = allowH2 != null ? allowH2 : false\n return function connect ({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {\n let socket\n if (protocol === 'https:') {\n if (!tls) {\n tls = require('tls')\n }\n servername = servername || options.servername || util.getServerName(host) || null\n\n const sessionKey = servername || hostname\n const session = sessionCache.get(sessionKey) || null\n\n assert(sessionKey)\n\n socket = tls.connect({\n highWaterMark: 16384, // TLS in node can't have bigger HWM anyway...\n ...options,\n servername,\n session,\n localAddress,\n // TODO(HTTP/2): Add support for h2c\n ALPNProtocols: allowH2 ? ['http/1.1', 'h2'] : ['http/1.1'],\n socket: httpSocket, // upgrade socket connection\n port: port || 443,\n host: hostname\n })\n\n socket\n .on('session', function (session) {\n // TODO (fix): Can a session become invalid once established? Don't think so?\n sessionCache.set(sessionKey, session)\n })\n } else {\n assert(!httpSocket, 'httpSocket can only be sent on TLS update')\n socket = net.connect({\n highWaterMark: 64 * 1024, // Same as nodejs fs streams.\n ...options,\n localAddress,\n port: port || 80,\n host: hostname\n })\n }\n\n // Set TCP keep alive options on the socket here instead of in connect() for the case of assigning the socket\n if (options.keepAlive == null || options.keepAlive) {\n const keepAliveInitialDelay = options.keepAliveInitialDelay === undefined ? 60e3 : options.keepAliveInitialDelay\n socket.setKeepAlive(true, keepAliveInitialDelay)\n }\n\n const cancelTimeout = setupTimeout(() => onConnectTimeout(socket), timeout)\n\n socket\n .setNoDelay(true)\n .once(protocol === 'https:' ? 'secureConnect' : 'connect', function () {\n cancelTimeout()\n\n if (callback) {\n const cb = callback\n callback = null\n cb(null, this)\n }\n })\n .on('error', function (err) {\n cancelTimeout()\n\n if (callback) {\n const cb = callback\n callback = null\n cb(err)\n }\n })\n\n return socket\n }\n}\n\nfunction setupTimeout (onConnectTimeout, timeout) {\n if (!timeout) {\n return () => {}\n }\n\n let s1 = null\n let s2 = null\n const timeoutId = setTimeout(() => {\n // setImmediate is added to make sure that we priotorise socket error events over timeouts\n s1 = setImmediate(() => {\n if (process.platform === 'win32') {\n // Windows needs an extra setImmediate probably due to implementation differences in the socket logic\n s2 = setImmediate(() => onConnectTimeout())\n } else {\n onConnectTimeout()\n }\n })\n }, timeout)\n return () => {\n clearTimeout(timeoutId)\n clearImmediate(s1)\n clearImmediate(s2)\n }\n}\n\nfunction onConnectTimeout (socket) {\n util.destroy(socket, new ConnectTimeoutError())\n}\n\nmodule.exports = buildConnector\n","'use strict'\n\nclass UndiciError extends Error {\n constructor (message) {\n super(message)\n this.name = 'UndiciError'\n this.code = 'UND_ERR'\n }\n}\n\nclass ConnectTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ConnectTimeoutError)\n this.name = 'ConnectTimeoutError'\n this.message = message || 'Connect Timeout Error'\n this.code = 'UND_ERR_CONNECT_TIMEOUT'\n }\n}\n\nclass HeadersTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, HeadersTimeoutError)\n this.name = 'HeadersTimeoutError'\n this.message = message || 'Headers Timeout Error'\n this.code = 'UND_ERR_HEADERS_TIMEOUT'\n }\n}\n\nclass HeadersOverflowError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, HeadersOverflowError)\n this.name = 'HeadersOverflowError'\n this.message = message || 'Headers Overflow Error'\n this.code = 'UND_ERR_HEADERS_OVERFLOW'\n }\n}\n\nclass BodyTimeoutError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, BodyTimeoutError)\n this.name = 'BodyTimeoutError'\n this.message = message || 'Body Timeout Error'\n this.code = 'UND_ERR_BODY_TIMEOUT'\n }\n}\n\nclass ResponseStatusCodeError extends UndiciError {\n constructor (message, statusCode, headers, body) {\n super(message)\n Error.captureStackTrace(this, ResponseStatusCodeError)\n this.name = 'ResponseStatusCodeError'\n this.message = message || 'Response Status Code Error'\n this.code = 'UND_ERR_RESPONSE_STATUS_CODE'\n this.body = body\n this.status = statusCode\n this.statusCode = statusCode\n this.headers = headers\n }\n}\n\nclass InvalidArgumentError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, InvalidArgumentError)\n this.name = 'InvalidArgumentError'\n this.message = message || 'Invalid Argument Error'\n this.code = 'UND_ERR_INVALID_ARG'\n }\n}\n\nclass InvalidReturnValueError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, InvalidReturnValueError)\n this.name = 'InvalidReturnValueError'\n this.message = message || 'Invalid Return Value Error'\n this.code = 'UND_ERR_INVALID_RETURN_VALUE'\n }\n}\n\nclass RequestAbortedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, RequestAbortedError)\n this.name = 'AbortError'\n this.message = message || 'Request aborted'\n this.code = 'UND_ERR_ABORTED'\n }\n}\n\nclass InformationalError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, InformationalError)\n this.name = 'InformationalError'\n this.message = message || 'Request information'\n this.code = 'UND_ERR_INFO'\n }\n}\n\nclass RequestContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, RequestContentLengthMismatchError)\n this.name = 'RequestContentLengthMismatchError'\n this.message = message || 'Request body length does not match content-length header'\n this.code = 'UND_ERR_REQ_CONTENT_LENGTH_MISMATCH'\n }\n}\n\nclass ResponseContentLengthMismatchError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ResponseContentLengthMismatchError)\n this.name = 'ResponseContentLengthMismatchError'\n this.message = message || 'Response body length does not match content-length header'\n this.code = 'UND_ERR_RES_CONTENT_LENGTH_MISMATCH'\n }\n}\n\nclass ClientDestroyedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ClientDestroyedError)\n this.name = 'ClientDestroyedError'\n this.message = message || 'The client is destroyed'\n this.code = 'UND_ERR_DESTROYED'\n }\n}\n\nclass ClientClosedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ClientClosedError)\n this.name = 'ClientClosedError'\n this.message = message || 'The client is closed'\n this.code = 'UND_ERR_CLOSED'\n }\n}\n\nclass SocketError extends UndiciError {\n constructor (message, socket) {\n super(message)\n Error.captureStackTrace(this, SocketError)\n this.name = 'SocketError'\n this.message = message || 'Socket error'\n this.code = 'UND_ERR_SOCKET'\n this.socket = socket\n }\n}\n\nclass NotSupportedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, NotSupportedError)\n this.name = 'NotSupportedError'\n this.message = message || 'Not supported error'\n this.code = 'UND_ERR_NOT_SUPPORTED'\n }\n}\n\nclass BalancedPoolMissingUpstreamError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, NotSupportedError)\n this.name = 'MissingUpstreamError'\n this.message = message || 'No upstream has been added to the BalancedPool'\n this.code = 'UND_ERR_BPL_MISSING_UPSTREAM'\n }\n}\n\nclass HTTPParserError extends Error {\n constructor (message, code, data) {\n super(message)\n Error.captureStackTrace(this, HTTPParserError)\n this.name = 'HTTPParserError'\n this.code = code ? `HPE_${code}` : undefined\n this.data = data ? data.toString() : undefined\n }\n}\n\nclass ResponseExceededMaxSizeError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, ResponseExceededMaxSizeError)\n this.name = 'ResponseExceededMaxSizeError'\n this.message = message || 'Response content exceeded max size'\n this.code = 'UND_ERR_RES_EXCEEDED_MAX_SIZE'\n }\n}\n\nmodule.exports = {\n HTTPParserError,\n UndiciError,\n HeadersTimeoutError,\n HeadersOverflowError,\n BodyTimeoutError,\n RequestContentLengthMismatchError,\n ConnectTimeoutError,\n ResponseStatusCodeError,\n InvalidArgumentError,\n InvalidReturnValueError,\n RequestAbortedError,\n ClientDestroyedError,\n ClientClosedError,\n InformationalError,\n SocketError,\n NotSupportedError,\n ResponseContentLengthMismatchError,\n BalancedPoolMissingUpstreamError,\n ResponseExceededMaxSizeError\n}\n","'use strict'\n\nconst {\n InvalidArgumentError,\n NotSupportedError\n} = require('./errors')\nconst assert = require('assert')\nconst { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require('./symbols')\nconst util = require('./util')\n\n// tokenRegExp and headerCharRegex have been lifted from\n// https://github.com/nodejs/node/blob/main/lib/_http_common.js\n\n/**\n * Verifies that the given val is a valid HTTP token\n * per the rules defined in RFC 7230\n * See https://tools.ietf.org/html/rfc7230#section-3.2.6\n */\nconst tokenRegExp = /^[\\^_`a-zA-Z\\-0-9!#$%&'*+.|~]+$/\n\n/**\n * Matches if val contains an invalid field-vchar\n * field-value = *( field-content / obs-fold )\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n */\nconst headerCharRegex = /[^\\t\\x20-\\x7e\\x80-\\xff]/\n\n// Verifies that a given path is valid does not contain control chars \\x00 to \\x20\nconst invalidPathRegex = /[^\\u0021-\\u00ff]/\n\nconst kHandler = Symbol('handler')\n\nconst channels = {}\n\nlet extractBody\n\ntry {\n const diagnosticsChannel = require('diagnostics_channel')\n channels.create = diagnosticsChannel.channel('undici:request:create')\n channels.bodySent = diagnosticsChannel.channel('undici:request:bodySent')\n channels.headers = diagnosticsChannel.channel('undici:request:headers')\n channels.trailers = diagnosticsChannel.channel('undici:request:trailers')\n channels.error = diagnosticsChannel.channel('undici:request:error')\n} catch {\n channels.create = { hasSubscribers: false }\n channels.bodySent = { hasSubscribers: false }\n channels.headers = { hasSubscribers: false }\n channels.trailers = { hasSubscribers: false }\n channels.error = { hasSubscribers: false }\n}\n\nclass Request {\n constructor (origin, {\n path,\n method,\n body,\n headers,\n query,\n idempotent,\n blocking,\n upgrade,\n headersTimeout,\n bodyTimeout,\n reset,\n throwOnError,\n expectContinue\n }, handler) {\n if (typeof path !== 'string') {\n throw new InvalidArgumentError('path must be a string')\n } else if (\n path[0] !== '/' &&\n !(path.startsWith('http://') || path.startsWith('https://')) &&\n method !== 'CONNECT'\n ) {\n throw new InvalidArgumentError('path must be an absolute URL or start with a slash')\n } else if (invalidPathRegex.exec(path) !== null) {\n throw new InvalidArgumentError('invalid request path')\n }\n\n if (typeof method !== 'string') {\n throw new InvalidArgumentError('method must be a string')\n } else if (tokenRegExp.exec(method) === null) {\n throw new InvalidArgumentError('invalid request method')\n }\n\n if (upgrade && typeof upgrade !== 'string') {\n throw new InvalidArgumentError('upgrade must be a string')\n }\n\n if (headersTimeout != null && (!Number.isFinite(headersTimeout) || headersTimeout < 0)) {\n throw new InvalidArgumentError('invalid headersTimeout')\n }\n\n if (bodyTimeout != null && (!Number.isFinite(bodyTimeout) || bodyTimeout < 0)) {\n throw new InvalidArgumentError('invalid bodyTimeout')\n }\n\n if (reset != null && typeof reset !== 'boolean') {\n throw new InvalidArgumentError('invalid reset')\n }\n\n if (expectContinue != null && typeof expectContinue !== 'boolean') {\n throw new InvalidArgumentError('invalid expectContinue')\n }\n\n this.headersTimeout = headersTimeout\n\n this.bodyTimeout = bodyTimeout\n\n this.throwOnError = throwOnError === true\n\n this.method = method\n\n this.abort = null\n\n if (body == null) {\n this.body = null\n } else if (util.isStream(body)) {\n this.body = body\n\n const rState = this.body._readableState\n if (!rState || !rState.autoDestroy) {\n this.endHandler = function autoDestroy () {\n util.destroy(this)\n }\n this.body.on('end', this.endHandler)\n }\n\n this.errorHandler = err => {\n if (this.abort) {\n this.abort(err)\n } else {\n this.error = err\n }\n }\n this.body.on('error', this.errorHandler)\n } else if (util.isBuffer(body)) {\n this.body = body.byteLength ? body : null\n } else if (ArrayBuffer.isView(body)) {\n this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null\n } else if (body instanceof ArrayBuffer) {\n this.body = body.byteLength ? Buffer.from(body) : null\n } else if (typeof body === 'string') {\n this.body = body.length ? Buffer.from(body) : null\n } else if (util.isFormDataLike(body) || util.isIterable(body) || util.isBlobLike(body)) {\n this.body = body\n } else {\n throw new InvalidArgumentError('body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable')\n }\n\n this.completed = false\n\n this.aborted = false\n\n this.upgrade = upgrade || null\n\n this.path = query ? util.buildURL(path, query) : path\n\n this.origin = origin\n\n this.idempotent = idempotent == null\n ? method === 'HEAD' || method === 'GET'\n : idempotent\n\n this.blocking = blocking == null ? false : blocking\n\n this.reset = reset == null ? null : reset\n\n this.host = null\n\n this.contentLength = null\n\n this.contentType = null\n\n this.headers = ''\n\n // Only for H2\n this.expectContinue = expectContinue != null ? expectContinue : false\n\n if (Array.isArray(headers)) {\n if (headers.length % 2 !== 0) {\n throw new InvalidArgumentError('headers array must be even')\n }\n for (let i = 0; i < headers.length; i += 2) {\n processHeader(this, headers[i], headers[i + 1])\n }\n } else if (headers && typeof headers === 'object') {\n const keys = Object.keys(headers)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n processHeader(this, key, headers[key])\n }\n } else if (headers != null) {\n throw new InvalidArgumentError('headers must be an object or an array')\n }\n\n if (util.isFormDataLike(this.body)) {\n if (util.nodeMajor < 16 || (util.nodeMajor === 16 && util.nodeMinor < 8)) {\n throw new InvalidArgumentError('Form-Data bodies are only supported in node v16.8 and newer.')\n }\n\n if (!extractBody) {\n extractBody = require('../fetch/body.js').extractBody\n }\n\n const [bodyStream, contentType] = extractBody(body)\n if (this.contentType == null) {\n this.contentType = contentType\n this.headers += `content-type: ${contentType}\\r\\n`\n }\n this.body = bodyStream.stream\n this.contentLength = bodyStream.length\n } else if (util.isBlobLike(body) && this.contentType == null && body.type) {\n this.contentType = body.type\n this.headers += `content-type: ${body.type}\\r\\n`\n }\n\n util.validateHandler(handler, method, upgrade)\n\n this.servername = util.getServerName(this.host)\n\n this[kHandler] = handler\n\n if (channels.create.hasSubscribers) {\n channels.create.publish({ request: this })\n }\n }\n\n onBodySent (chunk) {\n if (this[kHandler].onBodySent) {\n try {\n this[kHandler].onBodySent(chunk)\n } catch (err) {\n this.onError(err)\n }\n }\n }\n\n onRequestSent () {\n if (channels.bodySent.hasSubscribers) {\n channels.bodySent.publish({ request: this })\n }\n\n if (this[kHandler].onRequestSent) {\n try {\n this[kHandler].onRequestSent()\n } catch (err) {\n this.onError(err)\n }\n }\n }\n\n onConnect (abort) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (this.error) {\n abort(this.error)\n } else {\n this.abort = abort\n return this[kHandler].onConnect(abort)\n }\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n assert(!this.aborted)\n assert(!this.completed)\n\n if (channels.headers.hasSubscribers) {\n channels.headers.publish({ request: this, response: { statusCode, headers, statusText } })\n }\n\n return this[kHandler].onHeaders(statusCode, headers, resume, statusText)\n }\n\n onData (chunk) {\n assert(!this.aborted)\n assert(!this.completed)\n\n return this[kHandler].onData(chunk)\n }\n\n onUpgrade (statusCode, headers, socket) {\n assert(!this.aborted)\n assert(!this.completed)\n\n return this[kHandler].onUpgrade(statusCode, headers, socket)\n }\n\n onComplete (trailers) {\n this.onFinally()\n\n assert(!this.aborted)\n\n this.completed = true\n if (channels.trailers.hasSubscribers) {\n channels.trailers.publish({ request: this, trailers })\n }\n return this[kHandler].onComplete(trailers)\n }\n\n onError (error) {\n this.onFinally()\n\n if (channels.error.hasSubscribers) {\n channels.error.publish({ request: this, error })\n }\n\n if (this.aborted) {\n return\n }\n this.aborted = true\n return this[kHandler].onError(error)\n }\n\n onFinally () {\n if (this.errorHandler) {\n this.body.off('error', this.errorHandler)\n this.errorHandler = null\n }\n\n if (this.endHandler) {\n this.body.off('end', this.endHandler)\n this.endHandler = null\n }\n }\n\n // TODO: adjust to support H2\n addHeader (key, value) {\n processHeader(this, key, value)\n return this\n }\n\n static [kHTTP1BuildRequest] (origin, opts, handler) {\n // TODO: Migrate header parsing here, to make Requests\n // HTTP agnostic\n return new Request(origin, opts, handler)\n }\n\n static [kHTTP2BuildRequest] (origin, opts, handler) {\n const headers = opts.headers\n opts = { ...opts, headers: null }\n\n const request = new Request(origin, opts, handler)\n\n request.headers = {}\n\n if (Array.isArray(headers)) {\n if (headers.length % 2 !== 0) {\n throw new InvalidArgumentError('headers array must be even')\n }\n for (let i = 0; i < headers.length; i += 2) {\n processHeader(request, headers[i], headers[i + 1], true)\n }\n } else if (headers && typeof headers === 'object') {\n const keys = Object.keys(headers)\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i]\n processHeader(request, key, headers[key], true)\n }\n } else if (headers != null) {\n throw new InvalidArgumentError('headers must be an object or an array')\n }\n\n return request\n }\n\n static [kHTTP2CopyHeaders] (raw) {\n const rawHeaders = raw.split('\\r\\n')\n const headers = {}\n\n for (const header of rawHeaders) {\n const [key, value] = header.split(': ')\n\n if (value == null || value.length === 0) continue\n\n if (headers[key]) headers[key] += `,${value}`\n else headers[key] = value\n }\n\n return headers\n }\n}\n\nfunction processHeaderValue (key, val, skipAppend) {\n if (val && typeof val === 'object') {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n\n val = val != null ? `${val}` : ''\n\n if (headerCharRegex.exec(val) !== null) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n\n return skipAppend ? val : `${key}: ${val}\\r\\n`\n}\n\nfunction processHeader (request, key, val, skipAppend = false) {\n if (val && (typeof val === 'object' && !Array.isArray(val))) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n } else if (val === undefined) {\n return\n }\n\n if (\n request.host === null &&\n key.length === 4 &&\n key.toLowerCase() === 'host'\n ) {\n if (headerCharRegex.exec(val) !== null) {\n throw new InvalidArgumentError(`invalid ${key} header`)\n }\n // Consumed by Client\n request.host = val\n } else if (\n request.contentLength === null &&\n key.length === 14 &&\n key.toLowerCase() === 'content-length'\n ) {\n request.contentLength = parseInt(val, 10)\n if (!Number.isFinite(request.contentLength)) {\n throw new InvalidArgumentError('invalid content-length header')\n }\n } else if (\n request.contentType === null &&\n key.length === 12 &&\n key.toLowerCase() === 'content-type'\n ) {\n request.contentType = val\n if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)\n else request.headers += processHeaderValue(key, val)\n } else if (\n key.length === 17 &&\n key.toLowerCase() === 'transfer-encoding'\n ) {\n throw new InvalidArgumentError('invalid transfer-encoding header')\n } else if (\n key.length === 10 &&\n key.toLowerCase() === 'connection'\n ) {\n const value = typeof val === 'string' ? val.toLowerCase() : null\n if (value !== 'close' && value !== 'keep-alive') {\n throw new InvalidArgumentError('invalid connection header')\n } else if (value === 'close') {\n request.reset = true\n }\n } else if (\n key.length === 10 &&\n key.toLowerCase() === 'keep-alive'\n ) {\n throw new InvalidArgumentError('invalid keep-alive header')\n } else if (\n key.length === 7 &&\n key.toLowerCase() === 'upgrade'\n ) {\n throw new InvalidArgumentError('invalid upgrade header')\n } else if (\n key.length === 6 &&\n key.toLowerCase() === 'expect'\n ) {\n throw new NotSupportedError('expect header not supported')\n } else if (tokenRegExp.exec(key) === null) {\n throw new InvalidArgumentError('invalid header key')\n } else {\n if (Array.isArray(val)) {\n for (let i = 0; i < val.length; i++) {\n if (skipAppend) {\n if (request.headers[key]) request.headers[key] += `,${processHeaderValue(key, val[i], skipAppend)}`\n else request.headers[key] = processHeaderValue(key, val[i], skipAppend)\n } else {\n request.headers += processHeaderValue(key, val[i])\n }\n }\n } else {\n if (skipAppend) request.headers[key] = processHeaderValue(key, val, skipAppend)\n else request.headers += processHeaderValue(key, val)\n }\n }\n}\n\nmodule.exports = Request\n","module.exports = {\n kClose: Symbol('close'),\n kDestroy: Symbol('destroy'),\n kDispatch: Symbol('dispatch'),\n kUrl: Symbol('url'),\n kWriting: Symbol('writing'),\n kResuming: Symbol('resuming'),\n kQueue: Symbol('queue'),\n kConnect: Symbol('connect'),\n kConnecting: Symbol('connecting'),\n kHeadersList: Symbol('headers list'),\n kKeepAliveDefaultTimeout: Symbol('default keep alive timeout'),\n kKeepAliveMaxTimeout: Symbol('max keep alive timeout'),\n kKeepAliveTimeoutThreshold: Symbol('keep alive timeout threshold'),\n kKeepAliveTimeoutValue: Symbol('keep alive timeout'),\n kKeepAlive: Symbol('keep alive'),\n kHeadersTimeout: Symbol('headers timeout'),\n kBodyTimeout: Symbol('body timeout'),\n kServerName: Symbol('server name'),\n kLocalAddress: Symbol('local address'),\n kHost: Symbol('host'),\n kNoRef: Symbol('no ref'),\n kBodyUsed: Symbol('used'),\n kRunning: Symbol('running'),\n kBlocking: Symbol('blocking'),\n kPending: Symbol('pending'),\n kSize: Symbol('size'),\n kBusy: Symbol('busy'),\n kQueued: Symbol('queued'),\n kFree: Symbol('free'),\n kConnected: Symbol('connected'),\n kClosed: Symbol('closed'),\n kNeedDrain: Symbol('need drain'),\n kReset: Symbol('reset'),\n kDestroyed: Symbol.for('nodejs.stream.destroyed'),\n kMaxHeadersSize: Symbol('max headers size'),\n kRunningIdx: Symbol('running index'),\n kPendingIdx: Symbol('pending index'),\n kError: Symbol('error'),\n kClients: Symbol('clients'),\n kClient: Symbol('client'),\n kParser: Symbol('parser'),\n kOnDestroyed: Symbol('destroy callbacks'),\n kPipelining: Symbol('pipelining'),\n kSocket: Symbol('socket'),\n kHostHeader: Symbol('host header'),\n kConnector: Symbol('connector'),\n kStrictContentLength: Symbol('strict content length'),\n kMaxRedirections: Symbol('maxRedirections'),\n kMaxRequests: Symbol('maxRequestsPerClient'),\n kProxy: Symbol('proxy agent options'),\n kCounter: Symbol('socket request counter'),\n kInterceptors: Symbol('dispatch interceptors'),\n kMaxResponseSize: Symbol('max response size'),\n kHTTP2Session: Symbol('http2Session'),\n kHTTP2SessionState: Symbol('http2Session state'),\n kHTTP2BuildRequest: Symbol('http2 build request'),\n kHTTP1BuildRequest: Symbol('http1 build request'),\n kHTTP2CopyHeaders: Symbol('http2 copy headers'),\n kHTTPConnVersion: Symbol('http connection version')\n}\n","'use strict'\n\nconst assert = require('assert')\nconst { kDestroyed, kBodyUsed } = require('./symbols')\nconst { IncomingMessage } = require('http')\nconst stream = require('stream')\nconst net = require('net')\nconst { InvalidArgumentError } = require('./errors')\nconst { Blob } = require('buffer')\nconst nodeUtil = require('util')\nconst { stringify } = require('querystring')\n\nconst [nodeMajor, nodeMinor] = process.versions.node.split('.').map(v => Number(v))\n\nfunction nop () {}\n\nfunction isStream (obj) {\n return obj && typeof obj === 'object' && typeof obj.pipe === 'function' && typeof obj.on === 'function'\n}\n\n// based on https://github.com/node-fetch/fetch-blob/blob/8ab587d34080de94140b54f07168451e7d0b655e/index.js#L229-L241 (MIT License)\nfunction isBlobLike (object) {\n return (Blob && object instanceof Blob) || (\n object &&\n typeof object === 'object' &&\n (typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function') &&\n /^(Blob|File)$/.test(object[Symbol.toStringTag])\n )\n}\n\nfunction buildURL (url, queryParams) {\n if (url.includes('?') || url.includes('#')) {\n throw new Error('Query params cannot be passed when url already contains \"?\" or \"#\".')\n }\n\n const stringified = stringify(queryParams)\n\n if (stringified) {\n url += '?' + stringified\n }\n\n return url\n}\n\nfunction parseURL (url) {\n if (typeof url === 'string') {\n url = new URL(url)\n\n if (!/^https?:/.test(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n return url\n }\n\n if (!url || typeof url !== 'object') {\n throw new InvalidArgumentError('Invalid URL: The URL argument must be a non-null object.')\n }\n\n if (!/^https?:/.test(url.origin || url.protocol)) {\n throw new InvalidArgumentError('Invalid URL protocol: the URL must start with `http:` or `https:`.')\n }\n\n if (!(url instanceof URL)) {\n if (url.port != null && url.port !== '' && !Number.isFinite(parseInt(url.port))) {\n throw new InvalidArgumentError('Invalid URL: port must be a valid integer or a string representation of an integer.')\n }\n\n if (url.path != null && typeof url.path !== 'string') {\n throw new InvalidArgumentError('Invalid URL path: the path must be a string or null/undefined.')\n }\n\n if (url.pathname != null && typeof url.pathname !== 'string') {\n throw new InvalidArgumentError('Invalid URL pathname: the pathname must be a string or null/undefined.')\n }\n\n if (url.hostname != null && typeof url.hostname !== 'string') {\n throw new InvalidArgumentError('Invalid URL hostname: the hostname must be a string or null/undefined.')\n }\n\n if (url.origin != null && typeof url.origin !== 'string') {\n throw new InvalidArgumentError('Invalid URL origin: the origin must be a string or null/undefined.')\n }\n\n const port = url.port != null\n ? url.port\n : (url.protocol === 'https:' ? 443 : 80)\n let origin = url.origin != null\n ? url.origin\n : `${url.protocol}//${url.hostname}:${port}`\n let path = url.path != null\n ? url.path\n : `${url.pathname || ''}${url.search || ''}`\n\n if (origin.endsWith('/')) {\n origin = origin.substring(0, origin.length - 1)\n }\n\n if (path && !path.startsWith('/')) {\n path = `/${path}`\n }\n // new URL(path, origin) is unsafe when `path` contains an absolute URL\n // From https://developer.mozilla.org/en-US/docs/Web/API/URL/URL:\n // If first parameter is a relative URL, second param is required, and will be used as the base URL.\n // If first parameter is an absolute URL, a given second param will be ignored.\n url = new URL(origin + path)\n }\n\n return url\n}\n\nfunction parseOrigin (url) {\n url = parseURL(url)\n\n if (url.pathname !== '/' || url.search || url.hash) {\n throw new InvalidArgumentError('invalid url')\n }\n\n return url\n}\n\nfunction getHostname (host) {\n if (host[0] === '[') {\n const idx = host.indexOf(']')\n\n assert(idx !== -1)\n return host.substr(1, idx - 1)\n }\n\n const idx = host.indexOf(':')\n if (idx === -1) return host\n\n return host.substr(0, idx)\n}\n\n// IP addresses are not valid server names per RFC6066\n// > Currently, the only server names supported are DNS hostnames\nfunction getServerName (host) {\n if (!host) {\n return null\n }\n\n assert.strictEqual(typeof host, 'string')\n\n const servername = getHostname(host)\n if (net.isIP(servername)) {\n return ''\n }\n\n return servername\n}\n\nfunction deepClone (obj) {\n return JSON.parse(JSON.stringify(obj))\n}\n\nfunction isAsyncIterable (obj) {\n return !!(obj != null && typeof obj[Symbol.asyncIterator] === 'function')\n}\n\nfunction isIterable (obj) {\n return !!(obj != null && (typeof obj[Symbol.iterator] === 'function' || typeof obj[Symbol.asyncIterator] === 'function'))\n}\n\nfunction bodyLength (body) {\n if (body == null) {\n return 0\n } else if (isStream(body)) {\n const state = body._readableState\n return state && state.objectMode === false && state.ended === true && Number.isFinite(state.length)\n ? state.length\n : null\n } else if (isBlobLike(body)) {\n return body.size != null ? body.size : null\n } else if (isBuffer(body)) {\n return body.byteLength\n }\n\n return null\n}\n\nfunction isDestroyed (stream) {\n return !stream || !!(stream.destroyed || stream[kDestroyed])\n}\n\nfunction isReadableAborted (stream) {\n const state = stream && stream._readableState\n return isDestroyed(stream) && state && !state.endEmitted\n}\n\nfunction destroy (stream, err) {\n if (stream == null || !isStream(stream) || isDestroyed(stream)) {\n return\n }\n\n if (typeof stream.destroy === 'function') {\n if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {\n // See: https://github.com/nodejs/node/pull/38505/files\n stream.socket = null\n }\n\n stream.destroy(err)\n } else if (err) {\n process.nextTick((stream, err) => {\n stream.emit('error', err)\n }, stream, err)\n }\n\n if (stream.destroyed !== true) {\n stream[kDestroyed] = true\n }\n}\n\nconst KEEPALIVE_TIMEOUT_EXPR = /timeout=(\\d+)/\nfunction parseKeepAliveTimeout (val) {\n const m = val.toString().match(KEEPALIVE_TIMEOUT_EXPR)\n return m ? parseInt(m[1], 10) * 1000 : null\n}\n\nfunction parseHeaders (headers, obj = {}) {\n // For H2 support\n if (!Array.isArray(headers)) return headers\n\n for (let i = 0; i < headers.length; i += 2) {\n const key = headers[i].toString().toLowerCase()\n let val = obj[key]\n\n if (!val) {\n if (Array.isArray(headers[i + 1])) {\n obj[key] = headers[i + 1]\n } else {\n obj[key] = headers[i + 1].toString('utf8')\n }\n } else {\n if (!Array.isArray(val)) {\n val = [val]\n obj[key] = val\n }\n val.push(headers[i + 1].toString('utf8'))\n }\n }\n\n // See https://github.com/nodejs/node/pull/46528\n if ('content-length' in obj && 'content-disposition' in obj) {\n obj['content-disposition'] = Buffer.from(obj['content-disposition']).toString('latin1')\n }\n\n return obj\n}\n\nfunction parseRawHeaders (headers) {\n const ret = []\n let hasContentLength = false\n let contentDispositionIdx = -1\n\n for (let n = 0; n < headers.length; n += 2) {\n const key = headers[n + 0].toString()\n const val = headers[n + 1].toString('utf8')\n\n if (key.length === 14 && (key === 'content-length' || key.toLowerCase() === 'content-length')) {\n ret.push(key, val)\n hasContentLength = true\n } else if (key.length === 19 && (key === 'content-disposition' || key.toLowerCase() === 'content-disposition')) {\n contentDispositionIdx = ret.push(key, val) - 1\n } else {\n ret.push(key, val)\n }\n }\n\n // See https://github.com/nodejs/node/pull/46528\n if (hasContentLength && contentDispositionIdx !== -1) {\n ret[contentDispositionIdx] = Buffer.from(ret[contentDispositionIdx]).toString('latin1')\n }\n\n return ret\n}\n\nfunction isBuffer (buffer) {\n // See, https://github.com/mcollina/undici/pull/319\n return buffer instanceof Uint8Array || Buffer.isBuffer(buffer)\n}\n\nfunction validateHandler (handler, method, upgrade) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n if (typeof handler.onConnect !== 'function') {\n throw new InvalidArgumentError('invalid onConnect method')\n }\n\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n if (typeof handler.onBodySent !== 'function' && handler.onBodySent !== undefined) {\n throw new InvalidArgumentError('invalid onBodySent method')\n }\n\n if (upgrade || method === 'CONNECT') {\n if (typeof handler.onUpgrade !== 'function') {\n throw new InvalidArgumentError('invalid onUpgrade method')\n }\n } else {\n if (typeof handler.onHeaders !== 'function') {\n throw new InvalidArgumentError('invalid onHeaders method')\n }\n\n if (typeof handler.onData !== 'function') {\n throw new InvalidArgumentError('invalid onData method')\n }\n\n if (typeof handler.onComplete !== 'function') {\n throw new InvalidArgumentError('invalid onComplete method')\n }\n }\n}\n\n// A body is disturbed if it has been read from and it cannot\n// be re-used without losing state or data.\nfunction isDisturbed (body) {\n return !!(body && (\n stream.isDisturbed\n ? stream.isDisturbed(body) || body[kBodyUsed] // TODO (fix): Why is body[kBodyUsed] needed?\n : body[kBodyUsed] ||\n body.readableDidRead ||\n (body._readableState && body._readableState.dataEmitted) ||\n isReadableAborted(body)\n ))\n}\n\nfunction isErrored (body) {\n return !!(body && (\n stream.isErrored\n ? stream.isErrored(body)\n : /state: 'errored'/.test(nodeUtil.inspect(body)\n )))\n}\n\nfunction isReadable (body) {\n return !!(body && (\n stream.isReadable\n ? stream.isReadable(body)\n : /state: 'readable'/.test(nodeUtil.inspect(body)\n )))\n}\n\nfunction getSocketInfo (socket) {\n return {\n localAddress: socket.localAddress,\n localPort: socket.localPort,\n remoteAddress: socket.remoteAddress,\n remotePort: socket.remotePort,\n remoteFamily: socket.remoteFamily,\n timeout: socket.timeout,\n bytesWritten: socket.bytesWritten,\n bytesRead: socket.bytesRead\n }\n}\n\nasync function * convertIterableToBuffer (iterable) {\n for await (const chunk of iterable) {\n yield Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk)\n }\n}\n\nlet ReadableStream\nfunction ReadableStreamFrom (iterable) {\n if (!ReadableStream) {\n ReadableStream = require('stream/web').ReadableStream\n }\n\n if (ReadableStream.from) {\n return ReadableStream.from(convertIterableToBuffer(iterable))\n }\n\n let iterator\n return new ReadableStream(\n {\n async start () {\n iterator = iterable[Symbol.asyncIterator]()\n },\n async pull (controller) {\n const { done, value } = await iterator.next()\n if (done) {\n queueMicrotask(() => {\n controller.close()\n })\n } else {\n const buf = Buffer.isBuffer(value) ? value : Buffer.from(value)\n controller.enqueue(new Uint8Array(buf))\n }\n return controller.desiredSize > 0\n },\n async cancel (reason) {\n await iterator.return()\n }\n },\n 0\n )\n}\n\n// The chunk should be a FormData instance and contains\n// all the required methods.\nfunction isFormDataLike (object) {\n return (\n object &&\n typeof object === 'object' &&\n typeof object.append === 'function' &&\n typeof object.delete === 'function' &&\n typeof object.get === 'function' &&\n typeof object.getAll === 'function' &&\n typeof object.has === 'function' &&\n typeof object.set === 'function' &&\n object[Symbol.toStringTag] === 'FormData'\n )\n}\n\nfunction throwIfAborted (signal) {\n if (!signal) { return }\n if (typeof signal.throwIfAborted === 'function') {\n signal.throwIfAborted()\n } else {\n if (signal.aborted) {\n // DOMException not available < v17.0.0\n const err = new Error('The operation was aborted')\n err.name = 'AbortError'\n throw err\n }\n }\n}\n\nlet events\nfunction addAbortListener (signal, listener) {\n if (typeof Symbol.dispose === 'symbol') {\n if (!events) {\n events = require('events')\n }\n if (typeof events.addAbortListener === 'function' && 'aborted' in signal) {\n return events.addAbortListener(signal, listener)\n }\n }\n if ('addEventListener' in signal) {\n signal.addEventListener('abort', listener, { once: true })\n return () => signal.removeEventListener('abort', listener)\n }\n signal.addListener('abort', listener)\n return () => signal.removeListener('abort', listener)\n}\n\nconst hasToWellFormed = !!String.prototype.toWellFormed\n\n/**\n * @param {string} val\n */\nfunction toUSVString (val) {\n if (hasToWellFormed) {\n return `${val}`.toWellFormed()\n } else if (nodeUtil.toUSVString) {\n return nodeUtil.toUSVString(val)\n }\n\n return `${val}`\n}\n\nconst kEnumerableProperty = Object.create(null)\nkEnumerableProperty.enumerable = true\n\nmodule.exports = {\n kEnumerableProperty,\n nop,\n isDisturbed,\n isErrored,\n isReadable,\n toUSVString,\n isReadableAborted,\n isBlobLike,\n parseOrigin,\n parseURL,\n getServerName,\n isStream,\n isIterable,\n isAsyncIterable,\n isDestroyed,\n parseRawHeaders,\n parseHeaders,\n parseKeepAliveTimeout,\n destroy,\n bodyLength,\n deepClone,\n ReadableStreamFrom,\n isBuffer,\n validateHandler,\n getSocketInfo,\n isFormDataLike,\n buildURL,\n throwIfAborted,\n addAbortListener,\n nodeMajor,\n nodeMinor,\n nodeHasAutoSelectFamily: nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 13)\n}\n","'use strict'\n\nconst Dispatcher = require('./dispatcher')\nconst {\n ClientDestroyedError,\n ClientClosedError,\n InvalidArgumentError\n} = require('./core/errors')\nconst { kDestroy, kClose, kDispatch, kInterceptors } = require('./core/symbols')\n\nconst kDestroyed = Symbol('destroyed')\nconst kClosed = Symbol('closed')\nconst kOnDestroyed = Symbol('onDestroyed')\nconst kOnClosed = Symbol('onClosed')\nconst kInterceptedDispatch = Symbol('Intercepted Dispatch')\n\nclass DispatcherBase extends Dispatcher {\n constructor () {\n super()\n\n this[kDestroyed] = false\n this[kOnDestroyed] = null\n this[kClosed] = false\n this[kOnClosed] = []\n }\n\n get destroyed () {\n return this[kDestroyed]\n }\n\n get closed () {\n return this[kClosed]\n }\n\n get interceptors () {\n return this[kInterceptors]\n }\n\n set interceptors (newInterceptors) {\n if (newInterceptors) {\n for (let i = newInterceptors.length - 1; i >= 0; i--) {\n const interceptor = this[kInterceptors][i]\n if (typeof interceptor !== 'function') {\n throw new InvalidArgumentError('interceptor must be an function')\n }\n }\n }\n\n this[kInterceptors] = newInterceptors\n }\n\n close (callback) {\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.close((err, data) => {\n return err ? reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n queueMicrotask(() => callback(new ClientDestroyedError(), null))\n return\n }\n\n if (this[kClosed]) {\n if (this[kOnClosed]) {\n this[kOnClosed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n this[kClosed] = true\n this[kOnClosed].push(callback)\n\n const onClosed = () => {\n const callbacks = this[kOnClosed]\n this[kOnClosed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kClose]()\n .then(() => this.destroy())\n .then(() => {\n queueMicrotask(onClosed)\n })\n }\n\n destroy (err, callback) {\n if (typeof err === 'function') {\n callback = err\n err = null\n }\n\n if (callback === undefined) {\n return new Promise((resolve, reject) => {\n this.destroy(err, (err, data) => {\n return err ? /* istanbul ignore next: should never error */ reject(err) : resolve(data)\n })\n })\n }\n\n if (typeof callback !== 'function') {\n throw new InvalidArgumentError('invalid callback')\n }\n\n if (this[kDestroyed]) {\n if (this[kOnDestroyed]) {\n this[kOnDestroyed].push(callback)\n } else {\n queueMicrotask(() => callback(null, null))\n }\n return\n }\n\n if (!err) {\n err = new ClientDestroyedError()\n }\n\n this[kDestroyed] = true\n this[kOnDestroyed] = this[kOnDestroyed] || []\n this[kOnDestroyed].push(callback)\n\n const onDestroyed = () => {\n const callbacks = this[kOnDestroyed]\n this[kOnDestroyed] = null\n for (let i = 0; i < callbacks.length; i++) {\n callbacks[i](null, null)\n }\n }\n\n // Should not error.\n this[kDestroy](err).then(() => {\n queueMicrotask(onDestroyed)\n })\n }\n\n [kInterceptedDispatch] (opts, handler) {\n if (!this[kInterceptors] || this[kInterceptors].length === 0) {\n this[kInterceptedDispatch] = this[kDispatch]\n return this[kDispatch](opts, handler)\n }\n\n let dispatch = this[kDispatch].bind(this)\n for (let i = this[kInterceptors].length - 1; i >= 0; i--) {\n dispatch = this[kInterceptors][i](dispatch)\n }\n this[kInterceptedDispatch] = dispatch\n return dispatch(opts, handler)\n }\n\n dispatch (opts, handler) {\n if (!handler || typeof handler !== 'object') {\n throw new InvalidArgumentError('handler must be an object')\n }\n\n try {\n if (!opts || typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object.')\n }\n\n if (this[kDestroyed] || this[kOnDestroyed]) {\n throw new ClientDestroyedError()\n }\n\n if (this[kClosed]) {\n throw new ClientClosedError()\n }\n\n return this[kInterceptedDispatch](opts, handler)\n } catch (err) {\n if (typeof handler.onError !== 'function') {\n throw new InvalidArgumentError('invalid onError method')\n }\n\n handler.onError(err)\n\n return false\n }\n }\n}\n\nmodule.exports = DispatcherBase\n","'use strict'\n\nconst EventEmitter = require('events')\n\nclass Dispatcher extends EventEmitter {\n dispatch () {\n throw new Error('not implemented')\n }\n\n close () {\n throw new Error('not implemented')\n }\n\n destroy () {\n throw new Error('not implemented')\n }\n}\n\nmodule.exports = Dispatcher\n","'use strict'\n\nconst Busboy = require('@fastify/busboy')\nconst util = require('../core/util')\nconst {\n ReadableStreamFrom,\n isBlobLike,\n isReadableStreamLike,\n readableStreamClose,\n createDeferredPromise,\n fullyReadBody\n} = require('./util')\nconst { FormData } = require('./formdata')\nconst { kState } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { DOMException, structuredClone } = require('./constants')\nconst { Blob, File: NativeFile } = require('buffer')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('assert')\nconst { isErrored } = require('../core/util')\nconst { isUint8Array, isArrayBuffer } = require('util/types')\nconst { File: UndiciFile } = require('./file')\nconst { parseMIMEType, serializeAMimeType } = require('./dataURL')\n\nlet ReadableStream = globalThis.ReadableStream\n\n/** @type {globalThis['File']} */\nconst File = NativeFile ?? UndiciFile\nconst textEncoder = new TextEncoder()\nconst textDecoder = new TextDecoder()\n\n// https://fetch.spec.whatwg.org/#concept-bodyinit-extract\nfunction extractBody (object, keepalive = false) {\n if (!ReadableStream) {\n ReadableStream = require('stream/web').ReadableStream\n }\n\n // 1. Let stream be null.\n let stream = null\n\n // 2. If object is a ReadableStream object, then set stream to object.\n if (object instanceof ReadableStream) {\n stream = object\n } else if (isBlobLike(object)) {\n // 3. Otherwise, if object is a Blob object, set stream to the\n // result of running object’s get stream.\n stream = object.stream()\n } else {\n // 4. Otherwise, set stream to a new ReadableStream object, and set\n // up stream.\n stream = new ReadableStream({\n async pull (controller) {\n controller.enqueue(\n typeof source === 'string' ? textEncoder.encode(source) : source\n )\n queueMicrotask(() => readableStreamClose(controller))\n },\n start () {},\n type: undefined\n })\n }\n\n // 5. Assert: stream is a ReadableStream object.\n assert(isReadableStreamLike(stream))\n\n // 6. Let action be null.\n let action = null\n\n // 7. Let source be null.\n let source = null\n\n // 8. Let length be null.\n let length = null\n\n // 9. Let type be null.\n let type = null\n\n // 10. Switch on object:\n if (typeof object === 'string') {\n // Set source to the UTF-8 encoding of object.\n // Note: setting source to a Uint8Array here breaks some mocking assumptions.\n source = object\n\n // Set type to `text/plain;charset=UTF-8`.\n type = 'text/plain;charset=UTF-8'\n } else if (object instanceof URLSearchParams) {\n // URLSearchParams\n\n // spec says to run application/x-www-form-urlencoded on body.list\n // this is implemented in Node.js as apart of an URLSearchParams instance toString method\n // See: https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L490\n // and https://github.com/nodejs/node/blob/e46c680bf2b211bbd52cf959ca17ee98c7f657f5/lib/internal/url.js#L1100\n\n // Set source to the result of running the application/x-www-form-urlencoded serializer with object’s list.\n source = object.toString()\n\n // Set type to `application/x-www-form-urlencoded;charset=UTF-8`.\n type = 'application/x-www-form-urlencoded;charset=UTF-8'\n } else if (isArrayBuffer(object)) {\n // BufferSource/ArrayBuffer\n\n // Set source to a copy of the bytes held by object.\n source = new Uint8Array(object.slice())\n } else if (ArrayBuffer.isView(object)) {\n // BufferSource/ArrayBufferView\n\n // Set source to a copy of the bytes held by object.\n source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))\n } else if (util.isFormDataLike(object)) {\n const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`\n const prefix = `--${boundary}\\r\\nContent-Disposition: form-data`\n\n /*! formdata-polyfill. MIT License. Jimmy Wärting */\n const escape = (str) =>\n str.replace(/\\n/g, '%0A').replace(/\\r/g, '%0D').replace(/\"/g, '%22')\n const normalizeLinefeeds = (value) => value.replace(/\\r?\\n|\\r/g, '\\r\\n')\n\n // Set action to this step: run the multipart/form-data\n // encoding algorithm, with object’s entry list and UTF-8.\n // - This ensures that the body is immutable and can't be changed afterwords\n // - That the content-length is calculated in advance.\n // - And that all parts are pre-encoded and ready to be sent.\n\n const blobParts = []\n const rn = new Uint8Array([13, 10]) // '\\r\\n'\n length = 0\n let hasUnknownSizeValue = false\n\n for (const [name, value] of object) {\n if (typeof value === 'string') {\n const chunk = textEncoder.encode(prefix +\n `; name=\"${escape(normalizeLinefeeds(name))}\"` +\n `\\r\\n\\r\\n${normalizeLinefeeds(value)}\\r\\n`)\n blobParts.push(chunk)\n length += chunk.byteLength\n } else {\n const chunk = textEncoder.encode(`${prefix}; name=\"${escape(normalizeLinefeeds(name))}\"` +\n (value.name ? `; filename=\"${escape(value.name)}\"` : '') + '\\r\\n' +\n `Content-Type: ${\n value.type || 'application/octet-stream'\n }\\r\\n\\r\\n`)\n blobParts.push(chunk, value, rn)\n if (typeof value.size === 'number') {\n length += chunk.byteLength + value.size + rn.byteLength\n } else {\n hasUnknownSizeValue = true\n }\n }\n }\n\n const chunk = textEncoder.encode(`--${boundary}--`)\n blobParts.push(chunk)\n length += chunk.byteLength\n if (hasUnknownSizeValue) {\n length = null\n }\n\n // Set source to object.\n source = object\n\n action = async function * () {\n for (const part of blobParts) {\n if (part.stream) {\n yield * part.stream()\n } else {\n yield part\n }\n }\n }\n\n // Set type to `multipart/form-data; boundary=`,\n // followed by the multipart/form-data boundary string generated\n // by the multipart/form-data encoding algorithm.\n type = 'multipart/form-data; boundary=' + boundary\n } else if (isBlobLike(object)) {\n // Blob\n\n // Set source to object.\n source = object\n\n // Set length to object’s size.\n length = object.size\n\n // If object’s type attribute is not the empty byte sequence, set\n // type to its value.\n if (object.type) {\n type = object.type\n }\n } else if (typeof object[Symbol.asyncIterator] === 'function') {\n // If keepalive is true, then throw a TypeError.\n if (keepalive) {\n throw new TypeError('keepalive')\n }\n\n // If object is disturbed or locked, then throw a TypeError.\n if (util.isDisturbed(object) || object.locked) {\n throw new TypeError(\n 'Response body object should not be disturbed or locked'\n )\n }\n\n stream =\n object instanceof ReadableStream ? object : ReadableStreamFrom(object)\n }\n\n // 11. If source is a byte sequence, then set action to a\n // step that returns source and length to source’s length.\n if (typeof source === 'string' || util.isBuffer(source)) {\n length = Buffer.byteLength(source)\n }\n\n // 12. If action is non-null, then run these steps in in parallel:\n if (action != null) {\n // Run action.\n let iterator\n stream = new ReadableStream({\n async start () {\n iterator = action(object)[Symbol.asyncIterator]()\n },\n async pull (controller) {\n const { value, done } = await iterator.next()\n if (done) {\n // When running action is done, close stream.\n queueMicrotask(() => {\n controller.close()\n })\n } else {\n // Whenever one or more bytes are available and stream is not errored,\n // enqueue a Uint8Array wrapping an ArrayBuffer containing the available\n // bytes into stream.\n if (!isErrored(stream)) {\n controller.enqueue(new Uint8Array(value))\n }\n }\n return controller.desiredSize > 0\n },\n async cancel (reason) {\n await iterator.return()\n },\n type: undefined\n })\n }\n\n // 13. Let body be a body whose stream is stream, source is source,\n // and length is length.\n const body = { stream, source, length }\n\n // 14. Return (body, type).\n return [body, type]\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit-safely-extract\nfunction safelyExtractBody (object, keepalive = false) {\n if (!ReadableStream) {\n // istanbul ignore next\n ReadableStream = require('stream/web').ReadableStream\n }\n\n // To safely extract a body and a `Content-Type` value from\n // a byte sequence or BodyInit object object, run these steps:\n\n // 1. If object is a ReadableStream object, then:\n if (object instanceof ReadableStream) {\n // Assert: object is neither disturbed nor locked.\n // istanbul ignore next\n assert(!util.isDisturbed(object), 'The body has already been consumed.')\n // istanbul ignore next\n assert(!object.locked, 'The stream is locked.')\n }\n\n // 2. Return the results of extracting object.\n return extractBody(object, keepalive)\n}\n\nfunction cloneBody (body) {\n // To clone a body body, run these steps:\n\n // https://fetch.spec.whatwg.org/#concept-body-clone\n\n // 1. Let « out1, out2 » be the result of teeing body’s stream.\n const [out1, out2] = body.stream.tee()\n const out2Clone = structuredClone(out2, { transfer: [out2] })\n // This, for whatever reasons, unrefs out2Clone which allows\n // the process to exit by itself.\n const [, finalClone] = out2Clone.tee()\n\n // 2. Set body’s stream to out1.\n body.stream = out1\n\n // 3. Return a body whose stream is out2 and other members are copied from body.\n return {\n stream: finalClone,\n length: body.length,\n source: body.source\n }\n}\n\nasync function * consumeBody (body) {\n if (body) {\n if (isUint8Array(body)) {\n yield body\n } else {\n const stream = body.stream\n\n if (util.isDisturbed(stream)) {\n throw new TypeError('The body has already been consumed.')\n }\n\n if (stream.locked) {\n throw new TypeError('The stream is locked.')\n }\n\n // Compat.\n stream[kBodyUsed] = true\n\n yield * stream\n }\n }\n}\n\nfunction throwIfAborted (state) {\n if (state.aborted) {\n throw new DOMException('The operation was aborted.', 'AbortError')\n }\n}\n\nfunction bodyMixinMethods (instance) {\n const methods = {\n blob () {\n // The blob() method steps are to return the result of\n // running consume body with this and the following step\n // given a byte sequence bytes: return a Blob whose\n // contents are bytes and whose type attribute is this’s\n // MIME type.\n return specConsumeBody(this, (bytes) => {\n let mimeType = bodyMimeType(this)\n\n if (mimeType === 'failure') {\n mimeType = ''\n } else if (mimeType) {\n mimeType = serializeAMimeType(mimeType)\n }\n\n // Return a Blob whose contents are bytes and type attribute\n // is mimeType.\n return new Blob([bytes], { type: mimeType })\n }, instance)\n },\n\n arrayBuffer () {\n // The arrayBuffer() method steps are to return the result\n // of running consume body with this and the following step\n // given a byte sequence bytes: return a new ArrayBuffer\n // whose contents are bytes.\n return specConsumeBody(this, (bytes) => {\n return new Uint8Array(bytes).buffer\n }, instance)\n },\n\n text () {\n // The text() method steps are to return the result of running\n // consume body with this and UTF-8 decode.\n return specConsumeBody(this, utf8DecodeBytes, instance)\n },\n\n json () {\n // The json() method steps are to return the result of running\n // consume body with this and parse JSON from bytes.\n return specConsumeBody(this, parseJSONFromBytes, instance)\n },\n\n async formData () {\n webidl.brandCheck(this, instance)\n\n throwIfAborted(this[kState])\n\n const contentType = this.headers.get('Content-Type')\n\n // If mimeType’s essence is \"multipart/form-data\", then:\n if (/multipart\\/form-data/.test(contentType)) {\n const headers = {}\n for (const [key, value] of this.headers) headers[key.toLowerCase()] = value\n\n const responseFormData = new FormData()\n\n let busboy\n\n try {\n busboy = new Busboy({\n headers,\n preservePath: true\n })\n } catch (err) {\n throw new DOMException(`${err}`, 'AbortError')\n }\n\n busboy.on('field', (name, value) => {\n responseFormData.append(name, value)\n })\n busboy.on('file', (name, value, filename, encoding, mimeType) => {\n const chunks = []\n\n if (encoding === 'base64' || encoding.toLowerCase() === 'base64') {\n let base64chunk = ''\n\n value.on('data', (chunk) => {\n base64chunk += chunk.toString().replace(/[\\r\\n]/gm, '')\n\n const end = base64chunk.length - base64chunk.length % 4\n chunks.push(Buffer.from(base64chunk.slice(0, end), 'base64'))\n\n base64chunk = base64chunk.slice(end)\n })\n value.on('end', () => {\n chunks.push(Buffer.from(base64chunk, 'base64'))\n responseFormData.append(name, new File(chunks, filename, { type: mimeType }))\n })\n } else {\n value.on('data', (chunk) => {\n chunks.push(chunk)\n })\n value.on('end', () => {\n responseFormData.append(name, new File(chunks, filename, { type: mimeType }))\n })\n }\n })\n\n const busboyResolve = new Promise((resolve, reject) => {\n busboy.on('finish', resolve)\n busboy.on('error', (err) => reject(new TypeError(err)))\n })\n\n if (this.body !== null) for await (const chunk of consumeBody(this[kState].body)) busboy.write(chunk)\n busboy.end()\n await busboyResolve\n\n return responseFormData\n } else if (/application\\/x-www-form-urlencoded/.test(contentType)) {\n // Otherwise, if mimeType’s essence is \"application/x-www-form-urlencoded\", then:\n\n // 1. Let entries be the result of parsing bytes.\n let entries\n try {\n let text = ''\n // application/x-www-form-urlencoded parser will keep the BOM.\n // https://url.spec.whatwg.org/#concept-urlencoded-parser\n // Note that streaming decoder is stateful and cannot be reused\n const streamingDecoder = new TextDecoder('utf-8', { ignoreBOM: true })\n\n for await (const chunk of consumeBody(this[kState].body)) {\n if (!isUint8Array(chunk)) {\n throw new TypeError('Expected Uint8Array chunk')\n }\n text += streamingDecoder.decode(chunk, { stream: true })\n }\n text += streamingDecoder.decode()\n entries = new URLSearchParams(text)\n } catch (err) {\n // istanbul ignore next: Unclear when new URLSearchParams can fail on a string.\n // 2. If entries is failure, then throw a TypeError.\n throw Object.assign(new TypeError(), { cause: err })\n }\n\n // 3. Return a new FormData object whose entries are entries.\n const formData = new FormData()\n for (const [name, value] of entries) {\n formData.append(name, value)\n }\n return formData\n } else {\n // Wait a tick before checking if the request has been aborted.\n // Otherwise, a TypeError can be thrown when an AbortError should.\n await Promise.resolve()\n\n throwIfAborted(this[kState])\n\n // Otherwise, throw a TypeError.\n throw webidl.errors.exception({\n header: `${instance.name}.formData`,\n message: 'Could not parse content as FormData.'\n })\n }\n }\n }\n\n return methods\n}\n\nfunction mixinBody (prototype) {\n Object.assign(prototype.prototype, bodyMixinMethods(prototype))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-consume-body\n * @param {Response|Request} object\n * @param {(value: unknown) => unknown} convertBytesToJSValue\n * @param {Response|Request} instance\n */\nasync function specConsumeBody (object, convertBytesToJSValue, instance) {\n webidl.brandCheck(object, instance)\n\n throwIfAborted(object[kState])\n\n // 1. If object is unusable, then return a promise rejected\n // with a TypeError.\n if (bodyUnusable(object[kState].body)) {\n throw new TypeError('Body is unusable')\n }\n\n // 2. Let promise be a new promise.\n const promise = createDeferredPromise()\n\n // 3. Let errorSteps given error be to reject promise with error.\n const errorSteps = (error) => promise.reject(error)\n\n // 4. Let successSteps given a byte sequence data be to resolve\n // promise with the result of running convertBytesToJSValue\n // with data. If that threw an exception, then run errorSteps\n // with that exception.\n const successSteps = (data) => {\n try {\n promise.resolve(convertBytesToJSValue(data))\n } catch (e) {\n errorSteps(e)\n }\n }\n\n // 5. If object’s body is null, then run successSteps with an\n // empty byte sequence.\n if (object[kState].body == null) {\n successSteps(new Uint8Array())\n return promise.promise\n }\n\n // 6. Otherwise, fully read object’s body given successSteps,\n // errorSteps, and object’s relevant global object.\n await fullyReadBody(object[kState].body, successSteps, errorSteps)\n\n // 7. Return promise.\n return promise.promise\n}\n\n// https://fetch.spec.whatwg.org/#body-unusable\nfunction bodyUnusable (body) {\n // An object including the Body interface mixin is\n // said to be unusable if its body is non-null and\n // its body’s stream is disturbed or locked.\n return body != null && (body.stream.locked || util.isDisturbed(body.stream))\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#utf-8-decode\n * @param {Buffer} buffer\n */\nfunction utf8DecodeBytes (buffer) {\n if (buffer.length === 0) {\n return ''\n }\n\n // 1. Let buffer be the result of peeking three bytes from\n // ioQueue, converted to a byte sequence.\n\n // 2. If buffer is 0xEF 0xBB 0xBF, then read three\n // bytes from ioQueue. (Do nothing with those bytes.)\n if (buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {\n buffer = buffer.subarray(3)\n }\n\n // 3. Process a queue with an instance of UTF-8’s\n // decoder, ioQueue, output, and \"replacement\".\n const output = textDecoder.decode(buffer)\n\n // 4. Return output.\n return output\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#parse-json-bytes-to-a-javascript-value\n * @param {Uint8Array} bytes\n */\nfunction parseJSONFromBytes (bytes) {\n return JSON.parse(utf8DecodeBytes(bytes))\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-body-mime-type\n * @param {import('./response').Response|import('./request').Request} object\n */\nfunction bodyMimeType (object) {\n const { headersList } = object[kState]\n const contentType = headersList.get('content-type')\n\n if (contentType === null) {\n return 'failure'\n }\n\n return parseMIMEType(contentType)\n}\n\nmodule.exports = {\n extractBody,\n safelyExtractBody,\n cloneBody,\n mixinBody\n}\n","'use strict'\n\nconst { MessageChannel, receiveMessageOnPort } = require('worker_threads')\n\nconst corsSafeListedMethods = ['GET', 'HEAD', 'POST']\nconst corsSafeListedMethodsSet = new Set(corsSafeListedMethods)\n\nconst nullBodyStatus = [101, 204, 205, 304]\n\nconst redirectStatus = [301, 302, 303, 307, 308]\nconst redirectStatusSet = new Set(redirectStatus)\n\n// https://fetch.spec.whatwg.org/#block-bad-port\nconst badPorts = [\n '1', '7', '9', '11', '13', '15', '17', '19', '20', '21', '22', '23', '25', '37', '42', '43', '53', '69', '77', '79',\n '87', '95', '101', '102', '103', '104', '109', '110', '111', '113', '115', '117', '119', '123', '135', '137',\n '139', '143', '161', '179', '389', '427', '465', '512', '513', '514', '515', '526', '530', '531', '532',\n '540', '548', '554', '556', '563', '587', '601', '636', '989', '990', '993', '995', '1719', '1720', '1723',\n '2049', '3659', '4045', '5060', '5061', '6000', '6566', '6665', '6666', '6667', '6668', '6669', '6697',\n '10080'\n]\n\nconst badPortsSet = new Set(badPorts)\n\n// https://w3c.github.io/webappsec-referrer-policy/#referrer-policies\nconst referrerPolicy = [\n '',\n 'no-referrer',\n 'no-referrer-when-downgrade',\n 'same-origin',\n 'origin',\n 'strict-origin',\n 'origin-when-cross-origin',\n 'strict-origin-when-cross-origin',\n 'unsafe-url'\n]\nconst referrerPolicySet = new Set(referrerPolicy)\n\nconst requestRedirect = ['follow', 'manual', 'error']\n\nconst safeMethods = ['GET', 'HEAD', 'OPTIONS', 'TRACE']\nconst safeMethodsSet = new Set(safeMethods)\n\nconst requestMode = ['navigate', 'same-origin', 'no-cors', 'cors']\n\nconst requestCredentials = ['omit', 'same-origin', 'include']\n\nconst requestCache = [\n 'default',\n 'no-store',\n 'reload',\n 'no-cache',\n 'force-cache',\n 'only-if-cached'\n]\n\n// https://fetch.spec.whatwg.org/#request-body-header-name\nconst requestBodyHeader = [\n 'content-encoding',\n 'content-language',\n 'content-location',\n 'content-type',\n // See https://github.com/nodejs/undici/issues/2021\n // 'Content-Length' is a forbidden header name, which is typically\n // removed in the Headers implementation. However, undici doesn't\n // filter out headers, so we add it here.\n 'content-length'\n]\n\n// https://fetch.spec.whatwg.org/#enumdef-requestduplex\nconst requestDuplex = [\n 'half'\n]\n\n// http://fetch.spec.whatwg.org/#forbidden-method\nconst forbiddenMethods = ['CONNECT', 'TRACE', 'TRACK']\nconst forbiddenMethodsSet = new Set(forbiddenMethods)\n\nconst subresource = [\n 'audio',\n 'audioworklet',\n 'font',\n 'image',\n 'manifest',\n 'paintworklet',\n 'script',\n 'style',\n 'track',\n 'video',\n 'xslt',\n ''\n]\nconst subresourceSet = new Set(subresource)\n\n/** @type {globalThis['DOMException']} */\nconst DOMException = globalThis.DOMException ?? (() => {\n // DOMException was only made a global in Node v17.0.0,\n // but fetch supports >= v16.8.\n try {\n atob('~')\n } catch (err) {\n return Object.getPrototypeOf(err).constructor\n }\n})()\n\nlet channel\n\n/** @type {globalThis['structuredClone']} */\nconst structuredClone =\n globalThis.structuredClone ??\n // https://github.com/nodejs/node/blob/b27ae24dcc4251bad726d9d84baf678d1f707fed/lib/internal/structured_clone.js\n // structuredClone was added in v17.0.0, but fetch supports v16.8\n function structuredClone (value, options = undefined) {\n if (arguments.length === 0) {\n throw new TypeError('missing argument')\n }\n\n if (!channel) {\n channel = new MessageChannel()\n }\n channel.port1.unref()\n channel.port2.unref()\n channel.port1.postMessage(value, options?.transfer)\n return receiveMessageOnPort(channel.port2).message\n }\n\nmodule.exports = {\n DOMException,\n structuredClone,\n subresource,\n forbiddenMethods,\n requestBodyHeader,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n redirectStatus,\n corsSafeListedMethods,\n nullBodyStatus,\n safeMethods,\n badPorts,\n requestDuplex,\n subresourceSet,\n badPortsSet,\n redirectStatusSet,\n corsSafeListedMethodsSet,\n safeMethodsSet,\n forbiddenMethodsSet,\n referrerPolicySet\n}\n","const assert = require('assert')\nconst { atob } = require('buffer')\nconst { isomorphicDecode } = require('./util')\n\nconst encoder = new TextEncoder()\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-token-code-point\n */\nconst HTTP_TOKEN_CODEPOINTS = /^[!#$%&'*+-.^_|~A-Za-z0-9]+$/\nconst HTTP_WHITESPACE_REGEX = /(\\u000A|\\u000D|\\u0009|\\u0020)/ // eslint-disable-line\n/**\n * @see https://mimesniff.spec.whatwg.org/#http-quoted-string-token-code-point\n */\nconst HTTP_QUOTED_STRING_TOKENS = /[\\u0009|\\u0020-\\u007E|\\u0080-\\u00FF]/ // eslint-disable-line\n\n// https://fetch.spec.whatwg.org/#data-url-processor\n/** @param {URL} dataURL */\nfunction dataURLProcessor (dataURL) {\n // 1. Assert: dataURL’s scheme is \"data\".\n assert(dataURL.protocol === 'data:')\n\n // 2. Let input be the result of running the URL\n // serializer on dataURL with exclude fragment\n // set to true.\n let input = URLSerializer(dataURL, true)\n\n // 3. Remove the leading \"data:\" string from input.\n input = input.slice(5)\n\n // 4. Let position point at the start of input.\n const position = { position: 0 }\n\n // 5. Let mimeType be the result of collecting a\n // sequence of code points that are not equal\n // to U+002C (,), given position.\n let mimeType = collectASequenceOfCodePointsFast(\n ',',\n input,\n position\n )\n\n // 6. Strip leading and trailing ASCII whitespace\n // from mimeType.\n // Undici implementation note: we need to store the\n // length because if the mimetype has spaces removed,\n // the wrong amount will be sliced from the input in\n // step #9\n const mimeTypeLength = mimeType.length\n mimeType = removeASCIIWhitespace(mimeType, true, true)\n\n // 7. If position is past the end of input, then\n // return failure\n if (position.position >= input.length) {\n return 'failure'\n }\n\n // 8. Advance position by 1.\n position.position++\n\n // 9. Let encodedBody be the remainder of input.\n const encodedBody = input.slice(mimeTypeLength + 1)\n\n // 10. Let body be the percent-decoding of encodedBody.\n let body = stringPercentDecode(encodedBody)\n\n // 11. If mimeType ends with U+003B (;), followed by\n // zero or more U+0020 SPACE, followed by an ASCII\n // case-insensitive match for \"base64\", then:\n if (/;(\\u0020){0,}base64$/i.test(mimeType)) {\n // 1. Let stringBody be the isomorphic decode of body.\n const stringBody = isomorphicDecode(body)\n\n // 2. Set body to the forgiving-base64 decode of\n // stringBody.\n body = forgivingBase64(stringBody)\n\n // 3. If body is failure, then return failure.\n if (body === 'failure') {\n return 'failure'\n }\n\n // 4. Remove the last 6 code points from mimeType.\n mimeType = mimeType.slice(0, -6)\n\n // 5. Remove trailing U+0020 SPACE code points from mimeType,\n // if any.\n mimeType = mimeType.replace(/(\\u0020)+$/, '')\n\n // 6. Remove the last U+003B (;) code point from mimeType.\n mimeType = mimeType.slice(0, -1)\n }\n\n // 12. If mimeType starts with U+003B (;), then prepend\n // \"text/plain\" to mimeType.\n if (mimeType.startsWith(';')) {\n mimeType = 'text/plain' + mimeType\n }\n\n // 13. Let mimeTypeRecord be the result of parsing\n // mimeType.\n let mimeTypeRecord = parseMIMEType(mimeType)\n\n // 14. If mimeTypeRecord is failure, then set\n // mimeTypeRecord to text/plain;charset=US-ASCII.\n if (mimeTypeRecord === 'failure') {\n mimeTypeRecord = parseMIMEType('text/plain;charset=US-ASCII')\n }\n\n // 15. Return a new data: URL struct whose MIME\n // type is mimeTypeRecord and body is body.\n // https://fetch.spec.whatwg.org/#data-url-struct\n return { mimeType: mimeTypeRecord, body }\n}\n\n// https://url.spec.whatwg.org/#concept-url-serializer\n/**\n * @param {URL} url\n * @param {boolean} excludeFragment\n */\nfunction URLSerializer (url, excludeFragment = false) {\n const href = url.href\n\n if (!excludeFragment) {\n return href\n }\n\n const hash = href.lastIndexOf('#')\n if (hash === -1) {\n return href\n }\n return href.slice(0, hash)\n}\n\n// https://infra.spec.whatwg.org/#collect-a-sequence-of-code-points\n/**\n * @param {(char: string) => boolean} condition\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePoints (condition, input, position) {\n // 1. Let result be the empty string.\n let result = ''\n\n // 2. While position doesn’t point past the end of input and the\n // code point at position within input meets the condition condition:\n while (position.position < input.length && condition(input[position.position])) {\n // 1. Append that code point to the end of result.\n result += input[position.position]\n\n // 2. Advance position by 1.\n position.position++\n }\n\n // 3. Return result.\n return result\n}\n\n/**\n * A faster collectASequenceOfCodePoints that only works when comparing a single character.\n * @param {string} char\n * @param {string} input\n * @param {{ position: number }} position\n */\nfunction collectASequenceOfCodePointsFast (char, input, position) {\n const idx = input.indexOf(char, position.position)\n const start = position.position\n\n if (idx === -1) {\n position.position = input.length\n return input.slice(start)\n }\n\n position.position = idx\n return input.slice(start, position.position)\n}\n\n// https://url.spec.whatwg.org/#string-percent-decode\n/** @param {string} input */\nfunction stringPercentDecode (input) {\n // 1. Let bytes be the UTF-8 encoding of input.\n const bytes = encoder.encode(input)\n\n // 2. Return the percent-decoding of bytes.\n return percentDecode(bytes)\n}\n\n// https://url.spec.whatwg.org/#percent-decode\n/** @param {Uint8Array} input */\nfunction percentDecode (input) {\n // 1. Let output be an empty byte sequence.\n /** @type {number[]} */\n const output = []\n\n // 2. For each byte byte in input:\n for (let i = 0; i < input.length; i++) {\n const byte = input[i]\n\n // 1. If byte is not 0x25 (%), then append byte to output.\n if (byte !== 0x25) {\n output.push(byte)\n\n // 2. Otherwise, if byte is 0x25 (%) and the next two bytes\n // after byte in input are not in the ranges\n // 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F),\n // and 0x61 (a) to 0x66 (f), all inclusive, append byte\n // to output.\n } else if (\n byte === 0x25 &&\n !/^[0-9A-Fa-f]{2}$/i.test(String.fromCharCode(input[i + 1], input[i + 2]))\n ) {\n output.push(0x25)\n\n // 3. Otherwise:\n } else {\n // 1. Let bytePoint be the two bytes after byte in input,\n // decoded, and then interpreted as hexadecimal number.\n const nextTwoBytes = String.fromCharCode(input[i + 1], input[i + 2])\n const bytePoint = Number.parseInt(nextTwoBytes, 16)\n\n // 2. Append a byte whose value is bytePoint to output.\n output.push(bytePoint)\n\n // 3. Skip the next two bytes in input.\n i += 2\n }\n }\n\n // 3. Return output.\n return Uint8Array.from(output)\n}\n\n// https://mimesniff.spec.whatwg.org/#parse-a-mime-type\n/** @param {string} input */\nfunction parseMIMEType (input) {\n // 1. Remove any leading and trailing HTTP whitespace\n // from input.\n input = removeHTTPWhitespace(input, true, true)\n\n // 2. Let position be a position variable for input,\n // initially pointing at the start of input.\n const position = { position: 0 }\n\n // 3. Let type be the result of collecting a sequence\n // of code points that are not U+002F (/) from\n // input, given position.\n const type = collectASequenceOfCodePointsFast(\n '/',\n input,\n position\n )\n\n // 4. If type is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n // https://mimesniff.spec.whatwg.org/#http-token-code-point\n if (type.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(type)) {\n return 'failure'\n }\n\n // 5. If position is past the end of input, then return\n // failure\n if (position.position > input.length) {\n return 'failure'\n }\n\n // 6. Advance position by 1. (This skips past U+002F (/).)\n position.position++\n\n // 7. Let subtype be the result of collecting a sequence of\n // code points that are not U+003B (;) from input, given\n // position.\n let subtype = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 8. Remove any trailing HTTP whitespace from subtype.\n subtype = removeHTTPWhitespace(subtype, false, true)\n\n // 9. If subtype is the empty string or does not solely\n // contain HTTP token code points, then return failure.\n if (subtype.length === 0 || !HTTP_TOKEN_CODEPOINTS.test(subtype)) {\n return 'failure'\n }\n\n const typeLowercase = type.toLowerCase()\n const subtypeLowercase = subtype.toLowerCase()\n\n // 10. Let mimeType be a new MIME type record whose type\n // is type, in ASCII lowercase, and subtype is subtype,\n // in ASCII lowercase.\n // https://mimesniff.spec.whatwg.org/#mime-type\n const mimeType = {\n type: typeLowercase,\n subtype: subtypeLowercase,\n /** @type {Map} */\n parameters: new Map(),\n // https://mimesniff.spec.whatwg.org/#mime-type-essence\n essence: `${typeLowercase}/${subtypeLowercase}`\n }\n\n // 11. While position is not past the end of input:\n while (position.position < input.length) {\n // 1. Advance position by 1. (This skips past U+003B (;).)\n position.position++\n\n // 2. Collect a sequence of code points that are HTTP\n // whitespace from input given position.\n collectASequenceOfCodePoints(\n // https://fetch.spec.whatwg.org/#http-whitespace\n char => HTTP_WHITESPACE_REGEX.test(char),\n input,\n position\n )\n\n // 3. Let parameterName be the result of collecting a\n // sequence of code points that are not U+003B (;)\n // or U+003D (=) from input, given position.\n let parameterName = collectASequenceOfCodePoints(\n (char) => char !== ';' && char !== '=',\n input,\n position\n )\n\n // 4. Set parameterName to parameterName, in ASCII\n // lowercase.\n parameterName = parameterName.toLowerCase()\n\n // 5. If position is not past the end of input, then:\n if (position.position < input.length) {\n // 1. If the code point at position within input is\n // U+003B (;), then continue.\n if (input[position.position] === ';') {\n continue\n }\n\n // 2. Advance position by 1. (This skips past U+003D (=).)\n position.position++\n }\n\n // 6. If position is past the end of input, then break.\n if (position.position > input.length) {\n break\n }\n\n // 7. Let parameterValue be null.\n let parameterValue = null\n\n // 8. If the code point at position within input is\n // U+0022 (\"), then:\n if (input[position.position] === '\"') {\n // 1. Set parameterValue to the result of collecting\n // an HTTP quoted string from input, given position\n // and the extract-value flag.\n parameterValue = collectAnHTTPQuotedString(input, position, true)\n\n // 2. Collect a sequence of code points that are not\n // U+003B (;) from input, given position.\n collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 9. Otherwise:\n } else {\n // 1. Set parameterValue to the result of collecting\n // a sequence of code points that are not U+003B (;)\n // from input, given position.\n parameterValue = collectASequenceOfCodePointsFast(\n ';',\n input,\n position\n )\n\n // 2. Remove any trailing HTTP whitespace from parameterValue.\n parameterValue = removeHTTPWhitespace(parameterValue, false, true)\n\n // 3. If parameterValue is the empty string, then continue.\n if (parameterValue.length === 0) {\n continue\n }\n }\n\n // 10. If all of the following are true\n // - parameterName is not the empty string\n // - parameterName solely contains HTTP token code points\n // - parameterValue solely contains HTTP quoted-string token code points\n // - mimeType’s parameters[parameterName] does not exist\n // then set mimeType’s parameters[parameterName] to parameterValue.\n if (\n parameterName.length !== 0 &&\n HTTP_TOKEN_CODEPOINTS.test(parameterName) &&\n (parameterValue.length === 0 || HTTP_QUOTED_STRING_TOKENS.test(parameterValue)) &&\n !mimeType.parameters.has(parameterName)\n ) {\n mimeType.parameters.set(parameterName, parameterValue)\n }\n }\n\n // 12. Return mimeType.\n return mimeType\n}\n\n// https://infra.spec.whatwg.org/#forgiving-base64-decode\n/** @param {string} data */\nfunction forgivingBase64 (data) {\n // 1. Remove all ASCII whitespace from data.\n data = data.replace(/[\\u0009\\u000A\\u000C\\u000D\\u0020]/g, '') // eslint-disable-line\n\n // 2. If data’s code point length divides by 4 leaving\n // no remainder, then:\n if (data.length % 4 === 0) {\n // 1. If data ends with one or two U+003D (=) code points,\n // then remove them from data.\n data = data.replace(/=?=$/, '')\n }\n\n // 3. If data’s code point length divides by 4 leaving\n // a remainder of 1, then return failure.\n if (data.length % 4 === 1) {\n return 'failure'\n }\n\n // 4. If data contains a code point that is not one of\n // U+002B (+)\n // U+002F (/)\n // ASCII alphanumeric\n // then return failure.\n if (/[^+/0-9A-Za-z]/.test(data)) {\n return 'failure'\n }\n\n const binary = atob(data)\n const bytes = new Uint8Array(binary.length)\n\n for (let byte = 0; byte < binary.length; byte++) {\n bytes[byte] = binary.charCodeAt(byte)\n }\n\n return bytes\n}\n\n// https://fetch.spec.whatwg.org/#collect-an-http-quoted-string\n// tests: https://fetch.spec.whatwg.org/#example-http-quoted-string\n/**\n * @param {string} input\n * @param {{ position: number }} position\n * @param {boolean?} extractValue\n */\nfunction collectAnHTTPQuotedString (input, position, extractValue) {\n // 1. Let positionStart be position.\n const positionStart = position.position\n\n // 2. Let value be the empty string.\n let value = ''\n\n // 3. Assert: the code point at position within input\n // is U+0022 (\").\n assert(input[position.position] === '\"')\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. While true:\n while (true) {\n // 1. Append the result of collecting a sequence of code points\n // that are not U+0022 (\") or U+005C (\\) from input, given\n // position, to value.\n value += collectASequenceOfCodePoints(\n (char) => char !== '\"' && char !== '\\\\',\n input,\n position\n )\n\n // 2. If position is past the end of input, then break.\n if (position.position >= input.length) {\n break\n }\n\n // 3. Let quoteOrBackslash be the code point at position within\n // input.\n const quoteOrBackslash = input[position.position]\n\n // 4. Advance position by 1.\n position.position++\n\n // 5. If quoteOrBackslash is U+005C (\\), then:\n if (quoteOrBackslash === '\\\\') {\n // 1. If position is past the end of input, then append\n // U+005C (\\) to value and break.\n if (position.position >= input.length) {\n value += '\\\\'\n break\n }\n\n // 2. Append the code point at position within input to value.\n value += input[position.position]\n\n // 3. Advance position by 1.\n position.position++\n\n // 6. Otherwise:\n } else {\n // 1. Assert: quoteOrBackslash is U+0022 (\").\n assert(quoteOrBackslash === '\"')\n\n // 2. Break.\n break\n }\n }\n\n // 6. If the extract-value flag is set, then return value.\n if (extractValue) {\n return value\n }\n\n // 7. Return the code points from positionStart to position,\n // inclusive, within input.\n return input.slice(positionStart, position.position)\n}\n\n/**\n * @see https://mimesniff.spec.whatwg.org/#serialize-a-mime-type\n */\nfunction serializeAMimeType (mimeType) {\n assert(mimeType !== 'failure')\n const { parameters, essence } = mimeType\n\n // 1. Let serialization be the concatenation of mimeType’s\n // type, U+002F (/), and mimeType’s subtype.\n let serialization = essence\n\n // 2. For each name → value of mimeType’s parameters:\n for (let [name, value] of parameters.entries()) {\n // 1. Append U+003B (;) to serialization.\n serialization += ';'\n\n // 2. Append name to serialization.\n serialization += name\n\n // 3. Append U+003D (=) to serialization.\n serialization += '='\n\n // 4. If value does not solely contain HTTP token code\n // points or value is the empty string, then:\n if (!HTTP_TOKEN_CODEPOINTS.test(value)) {\n // 1. Precede each occurence of U+0022 (\") or\n // U+005C (\\) in value with U+005C (\\).\n value = value.replace(/(\\\\|\")/g, '\\\\$1')\n\n // 2. Prepend U+0022 (\") to value.\n value = '\"' + value\n\n // 3. Append U+0022 (\") to value.\n value += '\"'\n }\n\n // 5. Append value to serialization.\n serialization += value\n }\n\n // 3. Return serialization.\n return serialization\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} char\n */\nfunction isHTTPWhiteSpace (char) {\n return char === '\\r' || char === '\\n' || char === '\\t' || char === ' '\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-whitespace\n * @param {string} str\n */\nfunction removeHTTPWhitespace (str, leading = true, trailing = true) {\n let lead = 0\n let trail = str.length - 1\n\n if (leading) {\n for (; lead < str.length && isHTTPWhiteSpace(str[lead]); lead++);\n }\n\n if (trailing) {\n for (; trail > 0 && isHTTPWhiteSpace(str[trail]); trail--);\n }\n\n return str.slice(lead, trail + 1)\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n * @param {string} char\n */\nfunction isASCIIWhitespace (char) {\n return char === '\\r' || char === '\\n' || char === '\\t' || char === '\\f' || char === ' '\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#strip-leading-and-trailing-ascii-whitespace\n */\nfunction removeASCIIWhitespace (str, leading = true, trailing = true) {\n let lead = 0\n let trail = str.length - 1\n\n if (leading) {\n for (; lead < str.length && isASCIIWhitespace(str[lead]); lead++);\n }\n\n if (trailing) {\n for (; trail > 0 && isASCIIWhitespace(str[trail]); trail--);\n }\n\n return str.slice(lead, trail + 1)\n}\n\nmodule.exports = {\n dataURLProcessor,\n URLSerializer,\n collectASequenceOfCodePoints,\n collectASequenceOfCodePointsFast,\n stringPercentDecode,\n parseMIMEType,\n collectAnHTTPQuotedString,\n serializeAMimeType\n}\n","'use strict'\n\nconst { Blob, File: NativeFile } = require('buffer')\nconst { types } = require('util')\nconst { kState } = require('./symbols')\nconst { isBlobLike } = require('./util')\nconst { webidl } = require('./webidl')\nconst { parseMIMEType, serializeAMimeType } = require('./dataURL')\nconst { kEnumerableProperty } = require('../core/util')\nconst encoder = new TextEncoder()\n\nclass File extends Blob {\n constructor (fileBits, fileName, options = {}) {\n // The File constructor is invoked with two or three parameters, depending\n // on whether the optional dictionary parameter is used. When the File()\n // constructor is invoked, user agents must run the following steps:\n webidl.argumentLengthCheck(arguments, 2, { header: 'File constructor' })\n\n fileBits = webidl.converters['sequence'](fileBits)\n fileName = webidl.converters.USVString(fileName)\n options = webidl.converters.FilePropertyBag(options)\n\n // 1. Let bytes be the result of processing blob parts given fileBits and\n // options.\n // Note: Blob handles this for us\n\n // 2. Let n be the fileName argument to the constructor.\n const n = fileName\n\n // 3. Process FilePropertyBag dictionary argument by running the following\n // substeps:\n\n // 1. If the type member is provided and is not the empty string, let t\n // be set to the type dictionary member. If t contains any characters\n // outside the range U+0020 to U+007E, then set t to the empty string\n // and return from these substeps.\n // 2. Convert every character in t to ASCII lowercase.\n let t = options.type\n let d\n\n // eslint-disable-next-line no-labels\n substep: {\n if (t) {\n t = parseMIMEType(t)\n\n if (t === 'failure') {\n t = ''\n // eslint-disable-next-line no-labels\n break substep\n }\n\n t = serializeAMimeType(t).toLowerCase()\n }\n\n // 3. If the lastModified member is provided, let d be set to the\n // lastModified dictionary member. If it is not provided, set d to the\n // current date and time represented as the number of milliseconds since\n // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n d = options.lastModified\n }\n\n // 4. Return a new File object F such that:\n // F refers to the bytes byte sequence.\n // F.size is set to the number of total bytes in bytes.\n // F.name is set to n.\n // F.type is set to t.\n // F.lastModified is set to d.\n\n super(processBlobParts(fileBits, options), { type: t })\n this[kState] = {\n name: n,\n lastModified: d,\n type: t\n }\n }\n\n get name () {\n webidl.brandCheck(this, File)\n\n return this[kState].name\n }\n\n get lastModified () {\n webidl.brandCheck(this, File)\n\n return this[kState].lastModified\n }\n\n get type () {\n webidl.brandCheck(this, File)\n\n return this[kState].type\n }\n}\n\nclass FileLike {\n constructor (blobLike, fileName, options = {}) {\n // TODO: argument idl type check\n\n // The File constructor is invoked with two or three parameters, depending\n // on whether the optional dictionary parameter is used. When the File()\n // constructor is invoked, user agents must run the following steps:\n\n // 1. Let bytes be the result of processing blob parts given fileBits and\n // options.\n\n // 2. Let n be the fileName argument to the constructor.\n const n = fileName\n\n // 3. Process FilePropertyBag dictionary argument by running the following\n // substeps:\n\n // 1. If the type member is provided and is not the empty string, let t\n // be set to the type dictionary member. If t contains any characters\n // outside the range U+0020 to U+007E, then set t to the empty string\n // and return from these substeps.\n // TODO\n const t = options.type\n\n // 2. Convert every character in t to ASCII lowercase.\n // TODO\n\n // 3. If the lastModified member is provided, let d be set to the\n // lastModified dictionary member. If it is not provided, set d to the\n // current date and time represented as the number of milliseconds since\n // the Unix Epoch (which is the equivalent of Date.now() [ECMA-262]).\n const d = options.lastModified ?? Date.now()\n\n // 4. Return a new File object F such that:\n // F refers to the bytes byte sequence.\n // F.size is set to the number of total bytes in bytes.\n // F.name is set to n.\n // F.type is set to t.\n // F.lastModified is set to d.\n\n this[kState] = {\n blobLike,\n name: n,\n type: t,\n lastModified: d\n }\n }\n\n stream (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.stream(...args)\n }\n\n arrayBuffer (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.arrayBuffer(...args)\n }\n\n slice (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.slice(...args)\n }\n\n text (...args) {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.text(...args)\n }\n\n get size () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.size\n }\n\n get type () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].blobLike.type\n }\n\n get name () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].name\n }\n\n get lastModified () {\n webidl.brandCheck(this, FileLike)\n\n return this[kState].lastModified\n }\n\n get [Symbol.toStringTag] () {\n return 'File'\n }\n}\n\nObject.defineProperties(File.prototype, {\n [Symbol.toStringTag]: {\n value: 'File',\n configurable: true\n },\n name: kEnumerableProperty,\n lastModified: kEnumerableProperty\n})\n\nwebidl.converters.Blob = webidl.interfaceConverter(Blob)\n\nwebidl.converters.BlobPart = function (V, opts) {\n if (webidl.util.Type(V) === 'Object') {\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, { strict: false })\n }\n\n if (\n ArrayBuffer.isView(V) ||\n types.isAnyArrayBuffer(V)\n ) {\n return webidl.converters.BufferSource(V, opts)\n }\n }\n\n return webidl.converters.USVString(V, opts)\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.BlobPart\n)\n\n// https://www.w3.org/TR/FileAPI/#dfn-FilePropertyBag\nwebidl.converters.FilePropertyBag = webidl.dictionaryConverter([\n {\n key: 'lastModified',\n converter: webidl.converters['long long'],\n get defaultValue () {\n return Date.now()\n }\n },\n {\n key: 'type',\n converter: webidl.converters.DOMString,\n defaultValue: ''\n },\n {\n key: 'endings',\n converter: (value) => {\n value = webidl.converters.DOMString(value)\n value = value.toLowerCase()\n\n if (value !== 'native') {\n value = 'transparent'\n }\n\n return value\n },\n defaultValue: 'transparent'\n }\n])\n\n/**\n * @see https://www.w3.org/TR/FileAPI/#process-blob-parts\n * @param {(NodeJS.TypedArray|Blob|string)[]} parts\n * @param {{ type: string, endings: string }} options\n */\nfunction processBlobParts (parts, options) {\n // 1. Let bytes be an empty sequence of bytes.\n /** @type {NodeJS.TypedArray[]} */\n const bytes = []\n\n // 2. For each element in parts:\n for (const element of parts) {\n // 1. If element is a USVString, run the following substeps:\n if (typeof element === 'string') {\n // 1. Let s be element.\n let s = element\n\n // 2. If the endings member of options is \"native\", set s\n // to the result of converting line endings to native\n // of element.\n if (options.endings === 'native') {\n s = convertLineEndingsNative(s)\n }\n\n // 3. Append the result of UTF-8 encoding s to bytes.\n bytes.push(encoder.encode(s))\n } else if (\n types.isAnyArrayBuffer(element) ||\n types.isTypedArray(element)\n ) {\n // 2. If element is a BufferSource, get a copy of the\n // bytes held by the buffer source, and append those\n // bytes to bytes.\n if (!element.buffer) { // ArrayBuffer\n bytes.push(new Uint8Array(element))\n } else {\n bytes.push(\n new Uint8Array(element.buffer, element.byteOffset, element.byteLength)\n )\n }\n } else if (isBlobLike(element)) {\n // 3. If element is a Blob, append the bytes it represents\n // to bytes.\n bytes.push(element)\n }\n }\n\n // 3. Return bytes.\n return bytes\n}\n\n/**\n * @see https://www.w3.org/TR/FileAPI/#convert-line-endings-to-native\n * @param {string} s\n */\nfunction convertLineEndingsNative (s) {\n // 1. Let native line ending be be the code point U+000A LF.\n let nativeLineEnding = '\\n'\n\n // 2. If the underlying platform’s conventions are to\n // represent newlines as a carriage return and line feed\n // sequence, set native line ending to the code point\n // U+000D CR followed by the code point U+000A LF.\n if (process.platform === 'win32') {\n nativeLineEnding = '\\r\\n'\n }\n\n return s.replace(/\\r?\\n/g, nativeLineEnding)\n}\n\n// If this function is moved to ./util.js, some tools (such as\n// rollup) will warn about circular dependencies. See:\n// https://github.com/nodejs/undici/issues/1629\nfunction isFileLike (object) {\n return (\n (NativeFile && object instanceof NativeFile) ||\n object instanceof File || (\n object &&\n (typeof object.stream === 'function' ||\n typeof object.arrayBuffer === 'function') &&\n object[Symbol.toStringTag] === 'File'\n )\n )\n}\n\nmodule.exports = { File, FileLike, isFileLike }\n","'use strict'\n\nconst { isBlobLike, toUSVString, makeIterator } = require('./util')\nconst { kState } = require('./symbols')\nconst { File: UndiciFile, FileLike, isFileLike } = require('./file')\nconst { webidl } = require('./webidl')\nconst { Blob, File: NativeFile } = require('buffer')\n\n/** @type {globalThis['File']} */\nconst File = NativeFile ?? UndiciFile\n\n// https://xhr.spec.whatwg.org/#formdata\nclass FormData {\n constructor (form) {\n if (form !== undefined) {\n throw webidl.errors.conversionFailed({\n prefix: 'FormData constructor',\n argument: 'Argument 1',\n types: ['undefined']\n })\n }\n\n this[kState] = []\n }\n\n append (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.append' })\n\n if (arguments.length === 3 && !isBlobLike(value)) {\n throw new TypeError(\n \"Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'\"\n )\n }\n\n // 1. Let value be value if given; otherwise blobValue.\n\n name = webidl.converters.USVString(name)\n value = isBlobLike(value)\n ? webidl.converters.Blob(value, { strict: false })\n : webidl.converters.USVString(value)\n filename = arguments.length === 3\n ? webidl.converters.USVString(filename)\n : undefined\n\n // 2. Let entry be the result of creating an entry with\n // name, value, and filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. Append entry to this’s entry list.\n this[kState].push(entry)\n }\n\n delete (name) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.delete' })\n\n name = webidl.converters.USVString(name)\n\n // The delete(name) method steps are to remove all entries whose name\n // is name from this’s entry list.\n this[kState] = this[kState].filter(entry => entry.name !== name)\n }\n\n get (name) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.get' })\n\n name = webidl.converters.USVString(name)\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return null.\n const idx = this[kState].findIndex((entry) => entry.name === name)\n if (idx === -1) {\n return null\n }\n\n // 2. Return the value of the first entry whose name is name from\n // this’s entry list.\n return this[kState][idx].value\n }\n\n getAll (name) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.getAll' })\n\n name = webidl.converters.USVString(name)\n\n // 1. If there is no entry whose name is name in this’s entry list,\n // then return the empty list.\n // 2. Return the values of all entries whose name is name, in order,\n // from this’s entry list.\n return this[kState]\n .filter((entry) => entry.name === name)\n .map((entry) => entry.value)\n }\n\n has (name) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.has' })\n\n name = webidl.converters.USVString(name)\n\n // The has(name) method steps are to return true if there is an entry\n // whose name is name in this’s entry list; otherwise false.\n return this[kState].findIndex((entry) => entry.name === name) !== -1\n }\n\n set (name, value, filename = undefined) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 2, { header: 'FormData.set' })\n\n if (arguments.length === 3 && !isBlobLike(value)) {\n throw new TypeError(\n \"Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'\"\n )\n }\n\n // The set(name, value) and set(name, blobValue, filename) method steps\n // are:\n\n // 1. Let value be value if given; otherwise blobValue.\n\n name = webidl.converters.USVString(name)\n value = isBlobLike(value)\n ? webidl.converters.Blob(value, { strict: false })\n : webidl.converters.USVString(value)\n filename = arguments.length === 3\n ? toUSVString(filename)\n : undefined\n\n // 2. Let entry be the result of creating an entry with name, value, and\n // filename if given.\n const entry = makeEntry(name, value, filename)\n\n // 3. If there are entries in this’s entry list whose name is name, then\n // replace the first such entry with entry and remove the others.\n const idx = this[kState].findIndex((entry) => entry.name === name)\n if (idx !== -1) {\n this[kState] = [\n ...this[kState].slice(0, idx),\n entry,\n ...this[kState].slice(idx + 1).filter((entry) => entry.name !== name)\n ]\n } else {\n // 4. Otherwise, append entry to this’s entry list.\n this[kState].push(entry)\n }\n }\n\n entries () {\n webidl.brandCheck(this, FormData)\n\n return makeIterator(\n () => this[kState].map(pair => [pair.name, pair.value]),\n 'FormData',\n 'key+value'\n )\n }\n\n keys () {\n webidl.brandCheck(this, FormData)\n\n return makeIterator(\n () => this[kState].map(pair => [pair.name, pair.value]),\n 'FormData',\n 'key'\n )\n }\n\n values () {\n webidl.brandCheck(this, FormData)\n\n return makeIterator(\n () => this[kState].map(pair => [pair.name, pair.value]),\n 'FormData',\n 'value'\n )\n }\n\n /**\n * @param {(value: string, key: string, self: FormData) => void} callbackFn\n * @param {unknown} thisArg\n */\n forEach (callbackFn, thisArg = globalThis) {\n webidl.brandCheck(this, FormData)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FormData.forEach' })\n\n if (typeof callbackFn !== 'function') {\n throw new TypeError(\n \"Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.\"\n )\n }\n\n for (const [key, value] of this) {\n callbackFn.apply(thisArg, [value, key, this])\n }\n }\n}\n\nFormData.prototype[Symbol.iterator] = FormData.prototype.entries\n\nObject.defineProperties(FormData.prototype, {\n [Symbol.toStringTag]: {\n value: 'FormData',\n configurable: true\n }\n})\n\n/**\n * @see https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#create-an-entry\n * @param {string} name\n * @param {string|Blob} value\n * @param {?string} filename\n * @returns\n */\nfunction makeEntry (name, value, filename) {\n // 1. Set name to the result of converting name into a scalar value string.\n // \"To convert a string into a scalar value string, replace any surrogates\n // with U+FFFD.\"\n // see: https://nodejs.org/dist/latest-v18.x/docs/api/buffer.html#buftostringencoding-start-end\n name = Buffer.from(name).toString('utf8')\n\n // 2. If value is a string, then set value to the result of converting\n // value into a scalar value string.\n if (typeof value === 'string') {\n value = Buffer.from(value).toString('utf8')\n } else {\n // 3. Otherwise:\n\n // 1. If value is not a File object, then set value to a new File object,\n // representing the same bytes, whose name attribute value is \"blob\"\n if (!isFileLike(value)) {\n value = value instanceof Blob\n ? new File([value], 'blob', { type: value.type })\n : new FileLike(value, 'blob', { type: value.type })\n }\n\n // 2. If filename is given, then set value to a new File object,\n // representing the same bytes, whose name attribute is filename.\n if (filename !== undefined) {\n /** @type {FilePropertyBag} */\n const options = {\n type: value.type,\n lastModified: value.lastModified\n }\n\n value = (NativeFile && value instanceof NativeFile) || value instanceof UndiciFile\n ? new File([value], filename, options)\n : new FileLike(value, filename, options)\n }\n }\n\n // 4. Return an entry whose name is name and whose value is value.\n return { name, value }\n}\n\nmodule.exports = { FormData }\n","'use strict'\n\n// In case of breaking changes, increase the version\n// number to avoid conflicts.\nconst globalOrigin = Symbol.for('undici.globalOrigin.1')\n\nfunction getGlobalOrigin () {\n return globalThis[globalOrigin]\n}\n\nfunction setGlobalOrigin (newOrigin) {\n if (newOrigin === undefined) {\n Object.defineProperty(globalThis, globalOrigin, {\n value: undefined,\n writable: true,\n enumerable: false,\n configurable: false\n })\n\n return\n }\n\n const parsedURL = new URL(newOrigin)\n\n if (parsedURL.protocol !== 'http:' && parsedURL.protocol !== 'https:') {\n throw new TypeError(`Only http & https urls are allowed, received ${parsedURL.protocol}`)\n }\n\n Object.defineProperty(globalThis, globalOrigin, {\n value: parsedURL,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nmodule.exports = {\n getGlobalOrigin,\n setGlobalOrigin\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst { kHeadersList } = require('../core/symbols')\nconst { kGuard } = require('./symbols')\nconst { kEnumerableProperty } = require('../core/util')\nconst {\n makeIterator,\n isValidHeaderName,\n isValidHeaderValue\n} = require('./util')\nconst { webidl } = require('./webidl')\nconst assert = require('assert')\n\nconst kHeadersMap = Symbol('headers map')\nconst kHeadersSortedMap = Symbol('headers map sorted')\n\n/**\n * @see https://fetch.spec.whatwg.org/#concept-header-value-normalize\n * @param {string} potentialValue\n */\nfunction headerValueNormalize (potentialValue) {\n // To normalize a byte sequence potentialValue, remove\n // any leading and trailing HTTP whitespace bytes from\n // potentialValue.\n\n // Trimming the end with `.replace()` and a RegExp is typically subject to\n // ReDoS. This is safer and faster.\n let i = potentialValue.length\n while (/[\\r\\n\\t ]/.test(potentialValue.charAt(--i)));\n return potentialValue.slice(0, i + 1).replace(/^[\\r\\n\\t ]+/, '')\n}\n\nfunction fill (headers, object) {\n // To fill a Headers object headers with a given object object, run these steps:\n\n // 1. If object is a sequence, then for each header in object:\n // Note: webidl conversion to array has already been done.\n if (Array.isArray(object)) {\n for (const header of object) {\n // 1. If header does not contain exactly two items, then throw a TypeError.\n if (header.length !== 2) {\n throw webidl.errors.exception({\n header: 'Headers constructor',\n message: `expected name/value pair to be length 2, found ${header.length}.`\n })\n }\n\n // 2. Append (header’s first item, header’s second item) to headers.\n headers.append(header[0], header[1])\n }\n } else if (typeof object === 'object' && object !== null) {\n // Note: null should throw\n\n // 2. Otherwise, object is a record, then for each key → value in object,\n // append (key, value) to headers\n for (const [key, value] of Object.entries(object)) {\n headers.append(key, value)\n }\n } else {\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence>', 'record']\n })\n }\n}\n\nclass HeadersList {\n /** @type {[string, string][]|null} */\n cookies = null\n\n constructor (init) {\n if (init instanceof HeadersList) {\n this[kHeadersMap] = new Map(init[kHeadersMap])\n this[kHeadersSortedMap] = init[kHeadersSortedMap]\n this.cookies = init.cookies\n } else {\n this[kHeadersMap] = new Map(init)\n this[kHeadersSortedMap] = null\n }\n }\n\n // https://fetch.spec.whatwg.org/#header-list-contains\n contains (name) {\n // A header list list contains a header name name if list\n // contains a header whose name is a byte-case-insensitive\n // match for name.\n name = name.toLowerCase()\n\n return this[kHeadersMap].has(name)\n }\n\n clear () {\n this[kHeadersMap].clear()\n this[kHeadersSortedMap] = null\n this.cookies = null\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-append\n append (name, value) {\n this[kHeadersSortedMap] = null\n\n // 1. If list contains name, then set name to the first such\n // header’s name.\n const lowercaseName = name.toLowerCase()\n const exists = this[kHeadersMap].get(lowercaseName)\n\n // 2. Append (name, value) to list.\n if (exists) {\n const delimiter = lowercaseName === 'cookie' ? '; ' : ', '\n this[kHeadersMap].set(lowercaseName, {\n name: exists.name,\n value: `${exists.value}${delimiter}${value}`\n })\n } else {\n this[kHeadersMap].set(lowercaseName, { name, value })\n }\n\n if (lowercaseName === 'set-cookie') {\n this.cookies ??= []\n this.cookies.push(value)\n }\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-set\n set (name, value) {\n this[kHeadersSortedMap] = null\n const lowercaseName = name.toLowerCase()\n\n if (lowercaseName === 'set-cookie') {\n this.cookies = [value]\n }\n\n // 1. If list contains name, then set the value of\n // the first such header to value and remove the\n // others.\n // 2. Otherwise, append header (name, value) to list.\n return this[kHeadersMap].set(lowercaseName, { name, value })\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-delete\n delete (name) {\n this[kHeadersSortedMap] = null\n\n name = name.toLowerCase()\n\n if (name === 'set-cookie') {\n this.cookies = null\n }\n\n return this[kHeadersMap].delete(name)\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-get\n get (name) {\n // 1. If list does not contain name, then return null.\n if (!this.contains(name)) {\n return null\n }\n\n // 2. Return the values of all headers in list whose name\n // is a byte-case-insensitive match for name,\n // separated from each other by 0x2C 0x20, in order.\n return this[kHeadersMap].get(name.toLowerCase())?.value ?? null\n }\n\n * [Symbol.iterator] () {\n // use the lowercased name\n for (const [name, { value }] of this[kHeadersMap]) {\n yield [name, value]\n }\n }\n\n get entries () {\n const headers = {}\n\n if (this[kHeadersMap].size) {\n for (const { name, value } of this[kHeadersMap].values()) {\n headers[name] = value\n }\n }\n\n return headers\n }\n}\n\n// https://fetch.spec.whatwg.org/#headers-class\nclass Headers {\n constructor (init = undefined) {\n this[kHeadersList] = new HeadersList()\n\n // The new Headers(init) constructor steps are:\n\n // 1. Set this’s guard to \"none\".\n this[kGuard] = 'none'\n\n // 2. If init is given, then fill this with init.\n if (init !== undefined) {\n init = webidl.converters.HeadersInit(init)\n fill(this, init)\n }\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-append\n append (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.append' })\n\n name = webidl.converters.ByteString(name)\n value = webidl.converters.ByteString(value)\n\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.append',\n value,\n type: 'header value'\n })\n }\n\n // 3. If headers’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if headers’s guard is \"request\" and name is a\n // forbidden header name, return.\n // Note: undici does not implement forbidden header names\n if (this[kGuard] === 'immutable') {\n throw new TypeError('immutable')\n } else if (this[kGuard] === 'request-no-cors') {\n // 5. Otherwise, if headers’s guard is \"request-no-cors\":\n // TODO\n }\n\n // 6. Otherwise, if headers’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n\n // 7. Append (name, value) to headers’s header list.\n // 8. If headers’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from headers\n return this[kHeadersList].append(name, value)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-delete\n delete (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.delete' })\n\n name = webidl.converters.ByteString(name)\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.delete',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. If this’s guard is \"immutable\", then throw a TypeError.\n // 3. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 4. Otherwise, if this’s guard is \"request-no-cors\", name\n // is not a no-CORS-safelisted request-header name, and\n // name is not a privileged no-CORS request-header name,\n // return.\n // 5. Otherwise, if this’s guard is \"response\" and name is\n // a forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this[kGuard] === 'immutable') {\n throw new TypeError('immutable')\n } else if (this[kGuard] === 'request-no-cors') {\n // TODO\n }\n\n // 6. If this’s header list does not contain name, then\n // return.\n if (!this[kHeadersList].contains(name)) {\n return\n }\n\n // 7. Delete name from this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this.\n return this[kHeadersList].delete(name)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-get\n get (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.get' })\n\n name = webidl.converters.ByteString(name)\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.get',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return the result of getting name from this’s header\n // list.\n return this[kHeadersList].get(name)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-has\n has (name) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.has' })\n\n name = webidl.converters.ByteString(name)\n\n // 1. If name is not a header name, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.has',\n value: name,\n type: 'header name'\n })\n }\n\n // 2. Return true if this’s header list contains name;\n // otherwise false.\n return this[kHeadersList].contains(name)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-set\n set (name, value) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 2, { header: 'Headers.set' })\n\n name = webidl.converters.ByteString(name)\n value = webidl.converters.ByteString(value)\n\n // 1. Normalize value.\n value = headerValueNormalize(value)\n\n // 2. If name is not a header name or value is not a\n // header value, then throw a TypeError.\n if (!isValidHeaderName(name)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.set',\n value: name,\n type: 'header name'\n })\n } else if (!isValidHeaderValue(value)) {\n throw webidl.errors.invalidArgument({\n prefix: 'Headers.set',\n value,\n type: 'header value'\n })\n }\n\n // 3. If this’s guard is \"immutable\", then throw a TypeError.\n // 4. Otherwise, if this’s guard is \"request\" and name is a\n // forbidden header name, return.\n // 5. Otherwise, if this’s guard is \"request-no-cors\" and\n // name/value is not a no-CORS-safelisted request-header,\n // return.\n // 6. Otherwise, if this’s guard is \"response\" and name is a\n // forbidden response-header name, return.\n // Note: undici does not implement forbidden header names\n if (this[kGuard] === 'immutable') {\n throw new TypeError('immutable')\n } else if (this[kGuard] === 'request-no-cors') {\n // TODO\n }\n\n // 7. Set (name, value) in this’s header list.\n // 8. If this’s guard is \"request-no-cors\", then remove\n // privileged no-CORS request headers from this\n return this[kHeadersList].set(name, value)\n }\n\n // https://fetch.spec.whatwg.org/#dom-headers-getsetcookie\n getSetCookie () {\n webidl.brandCheck(this, Headers)\n\n // 1. If this’s header list does not contain `Set-Cookie`, then return « ».\n // 2. Return the values of all headers in this’s header list whose name is\n // a byte-case-insensitive match for `Set-Cookie`, in order.\n\n const list = this[kHeadersList].cookies\n\n if (list) {\n return [...list]\n }\n\n return []\n }\n\n // https://fetch.spec.whatwg.org/#concept-header-list-sort-and-combine\n get [kHeadersSortedMap] () {\n if (this[kHeadersList][kHeadersSortedMap]) {\n return this[kHeadersList][kHeadersSortedMap]\n }\n\n // 1. Let headers be an empty list of headers with the key being the name\n // and value the value.\n const headers = []\n\n // 2. Let names be the result of convert header names to a sorted-lowercase\n // set with all the names of the headers in list.\n const names = [...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1)\n const cookies = this[kHeadersList].cookies\n\n // 3. For each name of names:\n for (const [name, value] of names) {\n // 1. If name is `set-cookie`, then:\n if (name === 'set-cookie') {\n // 1. Let values be a list of all values of headers in list whose name\n // is a byte-case-insensitive match for name, in order.\n\n // 2. For each value of values:\n // 1. Append (name, value) to headers.\n for (const value of cookies) {\n headers.push([name, value])\n }\n } else {\n // 2. Otherwise:\n\n // 1. Let value be the result of getting name from list.\n\n // 2. Assert: value is non-null.\n assert(value !== null)\n\n // 3. Append (name, value) to headers.\n headers.push([name, value])\n }\n }\n\n this[kHeadersList][kHeadersSortedMap] = headers\n\n // 4. Return headers.\n return headers\n }\n\n keys () {\n webidl.brandCheck(this, Headers)\n\n return makeIterator(\n () => [...this[kHeadersSortedMap].values()],\n 'Headers',\n 'key'\n )\n }\n\n values () {\n webidl.brandCheck(this, Headers)\n\n return makeIterator(\n () => [...this[kHeadersSortedMap].values()],\n 'Headers',\n 'value'\n )\n }\n\n entries () {\n webidl.brandCheck(this, Headers)\n\n return makeIterator(\n () => [...this[kHeadersSortedMap].values()],\n 'Headers',\n 'key+value'\n )\n }\n\n /**\n * @param {(value: string, key: string, self: Headers) => void} callbackFn\n * @param {unknown} thisArg\n */\n forEach (callbackFn, thisArg = globalThis) {\n webidl.brandCheck(this, Headers)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Headers.forEach' })\n\n if (typeof callbackFn !== 'function') {\n throw new TypeError(\n \"Failed to execute 'forEach' on 'Headers': parameter 1 is not of type 'Function'.\"\n )\n }\n\n for (const [key, value] of this) {\n callbackFn.apply(thisArg, [value, key, this])\n }\n }\n\n [Symbol.for('nodejs.util.inspect.custom')] () {\n webidl.brandCheck(this, Headers)\n\n return this[kHeadersList]\n }\n}\n\nHeaders.prototype[Symbol.iterator] = Headers.prototype.entries\n\nObject.defineProperties(Headers.prototype, {\n append: kEnumerableProperty,\n delete: kEnumerableProperty,\n get: kEnumerableProperty,\n has: kEnumerableProperty,\n set: kEnumerableProperty,\n getSetCookie: kEnumerableProperty,\n keys: kEnumerableProperty,\n values: kEnumerableProperty,\n entries: kEnumerableProperty,\n forEach: kEnumerableProperty,\n [Symbol.iterator]: { enumerable: false },\n [Symbol.toStringTag]: {\n value: 'Headers',\n configurable: true\n }\n})\n\nwebidl.converters.HeadersInit = function (V) {\n if (webidl.util.Type(V) === 'Object') {\n if (V[Symbol.iterator]) {\n return webidl.converters['sequence>'](V)\n }\n\n return webidl.converters['record'](V)\n }\n\n throw webidl.errors.conversionFailed({\n prefix: 'Headers constructor',\n argument: 'Argument 1',\n types: ['sequence>', 'record']\n })\n}\n\nmodule.exports = {\n fill,\n Headers,\n HeadersList\n}\n","// https://github.com/Ethan-Arrowood/undici-fetch\n\n'use strict'\n\nconst {\n Response,\n makeNetworkError,\n makeAppropriateNetworkError,\n filterResponse,\n makeResponse\n} = require('./response')\nconst { Headers } = require('./headers')\nconst { Request, makeRequest } = require('./request')\nconst zlib = require('zlib')\nconst {\n bytesMatch,\n makePolicyContainer,\n clonePolicyContainer,\n requestBadPort,\n TAOCheck,\n appendRequestOriginHeader,\n responseLocationURL,\n requestCurrentURL,\n setRequestReferrerPolicyOnRedirect,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n createOpaqueTimingInfo,\n appendFetchMetadata,\n corsCheck,\n crossOriginResourcePolicyCheck,\n determineRequestsReferrer,\n coarsenedSharedCurrentTime,\n createDeferredPromise,\n isBlobLike,\n sameOrigin,\n isCancelled,\n isAborted,\n isErrorLike,\n fullyReadBody,\n readableStreamClose,\n isomorphicEncode,\n urlIsLocal,\n urlIsHttpHttpsScheme,\n urlHasHttpsScheme\n} = require('./util')\nconst { kState, kHeaders, kGuard, kRealm } = require('./symbols')\nconst assert = require('assert')\nconst { safelyExtractBody } = require('./body')\nconst {\n redirectStatusSet,\n nullBodyStatus,\n safeMethodsSet,\n requestBodyHeader,\n subresourceSet,\n DOMException\n} = require('./constants')\nconst { kHeadersList } = require('../core/symbols')\nconst EE = require('events')\nconst { Readable, pipeline } = require('stream')\nconst { addAbortListener, isErrored, isReadable, nodeMajor, nodeMinor } = require('../core/util')\nconst { dataURLProcessor, serializeAMimeType } = require('./dataURL')\nconst { TransformStream } = require('stream/web')\nconst { getGlobalDispatcher } = require('../global')\nconst { webidl } = require('./webidl')\nconst { STATUS_CODES } = require('http')\nconst GET_OR_HEAD = ['GET', 'HEAD']\n\n/** @type {import('buffer').resolveObjectURL} */\nlet resolveObjectURL\nlet ReadableStream = globalThis.ReadableStream\n\nclass Fetch extends EE {\n constructor (dispatcher) {\n super()\n\n this.dispatcher = dispatcher\n this.connection = null\n this.dump = false\n this.state = 'ongoing'\n // 2 terminated listeners get added per request,\n // but only 1 gets removed. If there are 20 redirects,\n // 21 listeners will be added.\n // See https://github.com/nodejs/undici/issues/1711\n // TODO (fix): Find and fix root cause for leaked listener.\n this.setMaxListeners(21)\n }\n\n terminate (reason) {\n if (this.state !== 'ongoing') {\n return\n }\n\n this.state = 'terminated'\n this.connection?.destroy(reason)\n this.emit('terminated', reason)\n }\n\n // https://fetch.spec.whatwg.org/#fetch-controller-abort\n abort (error) {\n if (this.state !== 'ongoing') {\n return\n }\n\n // 1. Set controller’s state to \"aborted\".\n this.state = 'aborted'\n\n // 2. Let fallbackError be an \"AbortError\" DOMException.\n // 3. Set error to fallbackError if it is not given.\n if (!error) {\n error = new DOMException('The operation was aborted.', 'AbortError')\n }\n\n // 4. Let serializedError be StructuredSerialize(error).\n // If that threw an exception, catch it, and let\n // serializedError be StructuredSerialize(fallbackError).\n\n // 5. Set controller’s serialized abort reason to serializedError.\n this.serializedAbortReason = error\n\n this.connection?.destroy(error)\n this.emit('terminated', error)\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-method\nfunction fetch (input, init = {}) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'globalThis.fetch' })\n\n // 1. Let p be a new promise.\n const p = createDeferredPromise()\n\n // 2. Let requestObject be the result of invoking the initial value of\n // Request as constructor with input and init as arguments. If this throws\n // an exception, reject p with it and return p.\n let requestObject\n\n try {\n requestObject = new Request(input, init)\n } catch (e) {\n p.reject(e)\n return p.promise\n }\n\n // 3. Let request be requestObject’s request.\n const request = requestObject[kState]\n\n // 4. If requestObject’s signal’s aborted flag is set, then:\n if (requestObject.signal.aborted) {\n // 1. Abort the fetch() call with p, request, null, and\n // requestObject’s signal’s abort reason.\n abortFetch(p, request, null, requestObject.signal.reason)\n\n // 2. Return p.\n return p.promise\n }\n\n // 5. Let globalObject be request’s client’s global object.\n const globalObject = request.client.globalObject\n\n // 6. If globalObject is a ServiceWorkerGlobalScope object, then set\n // request’s service-workers mode to \"none\".\n if (globalObject?.constructor?.name === 'ServiceWorkerGlobalScope') {\n request.serviceWorkers = 'none'\n }\n\n // 7. Let responseObject be null.\n let responseObject = null\n\n // 8. Let relevantRealm be this’s relevant Realm.\n const relevantRealm = null\n\n // 9. Let locallyAborted be false.\n let locallyAborted = false\n\n // 10. Let controller be null.\n let controller = null\n\n // 11. Add the following abort steps to requestObject’s signal:\n addAbortListener(\n requestObject.signal,\n () => {\n // 1. Set locallyAborted to true.\n locallyAborted = true\n\n // 2. Assert: controller is non-null.\n assert(controller != null)\n\n // 3. Abort controller with requestObject’s signal’s abort reason.\n controller.abort(requestObject.signal.reason)\n\n // 4. Abort the fetch() call with p, request, responseObject,\n // and requestObject’s signal’s abort reason.\n abortFetch(p, request, responseObject, requestObject.signal.reason)\n }\n )\n\n // 12. Let handleFetchDone given response response be to finalize and\n // report timing with response, globalObject, and \"fetch\".\n const handleFetchDone = (response) =>\n finalizeAndReportTiming(response, 'fetch')\n\n // 13. Set controller to the result of calling fetch given request,\n // with processResponseEndOfBody set to handleFetchDone, and processResponse\n // given response being these substeps:\n\n const processResponse = (response) => {\n // 1. If locallyAborted is true, terminate these substeps.\n if (locallyAborted) {\n return Promise.resolve()\n }\n\n // 2. If response’s aborted flag is set, then:\n if (response.aborted) {\n // 1. Let deserializedError be the result of deserialize a serialized\n // abort reason given controller’s serialized abort reason and\n // relevantRealm.\n\n // 2. Abort the fetch() call with p, request, responseObject, and\n // deserializedError.\n\n abortFetch(p, request, responseObject, controller.serializedAbortReason)\n return Promise.resolve()\n }\n\n // 3. If response is a network error, then reject p with a TypeError\n // and terminate these substeps.\n if (response.type === 'error') {\n p.reject(\n Object.assign(new TypeError('fetch failed'), { cause: response.error })\n )\n return Promise.resolve()\n }\n\n // 4. Set responseObject to the result of creating a Response object,\n // given response, \"immutable\", and relevantRealm.\n responseObject = new Response()\n responseObject[kState] = response\n responseObject[kRealm] = relevantRealm\n responseObject[kHeaders][kHeadersList] = response.headersList\n responseObject[kHeaders][kGuard] = 'immutable'\n responseObject[kHeaders][kRealm] = relevantRealm\n\n // 5. Resolve p with responseObject.\n p.resolve(responseObject)\n }\n\n controller = fetching({\n request,\n processResponseEndOfBody: handleFetchDone,\n processResponse,\n dispatcher: init.dispatcher ?? getGlobalDispatcher() // undici\n })\n\n // 14. Return p.\n return p.promise\n}\n\n// https://fetch.spec.whatwg.org/#finalize-and-report-timing\nfunction finalizeAndReportTiming (response, initiatorType = 'other') {\n // 1. If response is an aborted network error, then return.\n if (response.type === 'error' && response.aborted) {\n return\n }\n\n // 2. If response’s URL list is null or empty, then return.\n if (!response.urlList?.length) {\n return\n }\n\n // 3. Let originalURL be response’s URL list[0].\n const originalURL = response.urlList[0]\n\n // 4. Let timingInfo be response’s timing info.\n let timingInfo = response.timingInfo\n\n // 5. Let cacheState be response’s cache state.\n let cacheState = response.cacheState\n\n // 6. If originalURL’s scheme is not an HTTP(S) scheme, then return.\n if (!urlIsHttpHttpsScheme(originalURL)) {\n return\n }\n\n // 7. If timingInfo is null, then return.\n if (timingInfo === null) {\n return\n }\n\n // 8. If response’s timing allow passed flag is not set, then:\n if (!timingInfo.timingAllowPassed) {\n // 1. Set timingInfo to a the result of creating an opaque timing info for timingInfo.\n timingInfo = createOpaqueTimingInfo({\n startTime: timingInfo.startTime\n })\n\n // 2. Set cacheState to the empty string.\n cacheState = ''\n }\n\n // 9. Set timingInfo’s end time to the coarsened shared current time\n // given global’s relevant settings object’s cross-origin isolated\n // capability.\n // TODO: given global’s relevant settings object’s cross-origin isolated\n // capability?\n timingInfo.endTime = coarsenedSharedCurrentTime()\n\n // 10. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 11. Mark resource timing for timingInfo, originalURL, initiatorType,\n // global, and cacheState.\n markResourceTiming(\n timingInfo,\n originalURL,\n initiatorType,\n globalThis,\n cacheState\n )\n}\n\n// https://w3c.github.io/resource-timing/#dfn-mark-resource-timing\nfunction markResourceTiming (timingInfo, originalURL, initiatorType, globalThis, cacheState) {\n if (nodeMajor > 18 || (nodeMajor === 18 && nodeMinor >= 2)) {\n performance.markResourceTiming(timingInfo, originalURL.href, initiatorType, globalThis, cacheState)\n }\n}\n\n// https://fetch.spec.whatwg.org/#abort-fetch\nfunction abortFetch (p, request, responseObject, error) {\n // Note: AbortSignal.reason was added in node v17.2.0\n // which would give us an undefined error to reject with.\n // Remove this once node v16 is no longer supported.\n if (!error) {\n error = new DOMException('The operation was aborted.', 'AbortError')\n }\n\n // 1. Reject promise with error.\n p.reject(error)\n\n // 2. If request’s body is not null and is readable, then cancel request’s\n // body with error.\n if (request.body != null && isReadable(request.body?.stream)) {\n request.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n\n // 3. If responseObject is null, then return.\n if (responseObject == null) {\n return\n }\n\n // 4. Let response be responseObject’s response.\n const response = responseObject[kState]\n\n // 5. If response’s body is not null and is readable, then error response’s\n // body with error.\n if (response.body != null && isReadable(response.body?.stream)) {\n response.body.stream.cancel(error).catch((err) => {\n if (err.code === 'ERR_INVALID_STATE') {\n // Node bug?\n return\n }\n throw err\n })\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetching\nfunction fetching ({\n request,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseEndOfBody,\n processResponseConsumeBody,\n useParallelQueue = false,\n dispatcher // undici\n}) {\n // 1. Let taskDestination be null.\n let taskDestination = null\n\n // 2. Let crossOriginIsolatedCapability be false.\n let crossOriginIsolatedCapability = false\n\n // 3. If request’s client is non-null, then:\n if (request.client != null) {\n // 1. Set taskDestination to request’s client’s global object.\n taskDestination = request.client.globalObject\n\n // 2. Set crossOriginIsolatedCapability to request’s client’s cross-origin\n // isolated capability.\n crossOriginIsolatedCapability =\n request.client.crossOriginIsolatedCapability\n }\n\n // 4. If useParallelQueue is true, then set taskDestination to the result of\n // starting a new parallel queue.\n // TODO\n\n // 5. Let timingInfo be a new fetch timing info whose start time and\n // post-redirect start time are the coarsened shared current time given\n // crossOriginIsolatedCapability.\n const currenTime = coarsenedSharedCurrentTime(crossOriginIsolatedCapability)\n const timingInfo = createOpaqueTimingInfo({\n startTime: currenTime\n })\n\n // 6. Let fetchParams be a new fetch params whose\n // request is request,\n // timing info is timingInfo,\n // process request body chunk length is processRequestBodyChunkLength,\n // process request end-of-body is processRequestEndOfBody,\n // process response is processResponse,\n // process response consume body is processResponseConsumeBody,\n // process response end-of-body is processResponseEndOfBody,\n // task destination is taskDestination,\n // and cross-origin isolated capability is crossOriginIsolatedCapability.\n const fetchParams = {\n controller: new Fetch(dispatcher),\n request,\n timingInfo,\n processRequestBodyChunkLength,\n processRequestEndOfBody,\n processResponse,\n processResponseConsumeBody,\n processResponseEndOfBody,\n taskDestination,\n crossOriginIsolatedCapability\n }\n\n // 7. If request’s body is a byte sequence, then set request’s body to\n // request’s body as a body.\n // NOTE: Since fetching is only called from fetch, body should already be\n // extracted.\n assert(!request.body || request.body.stream)\n\n // 8. If request’s window is \"client\", then set request’s window to request’s\n // client, if request’s client’s global object is a Window object; otherwise\n // \"no-window\".\n if (request.window === 'client') {\n // TODO: What if request.client is null?\n request.window =\n request.client?.globalObject?.constructor?.name === 'Window'\n ? request.client\n : 'no-window'\n }\n\n // 9. If request’s origin is \"client\", then set request’s origin to request’s\n // client’s origin.\n if (request.origin === 'client') {\n // TODO: What if request.client is null?\n request.origin = request.client?.origin\n }\n\n // 10. If all of the following conditions are true:\n // TODO\n\n // 11. If request’s policy container is \"client\", then:\n if (request.policyContainer === 'client') {\n // 1. If request’s client is non-null, then set request’s policy\n // container to a clone of request’s client’s policy container. [HTML]\n if (request.client != null) {\n request.policyContainer = clonePolicyContainer(\n request.client.policyContainer\n )\n } else {\n // 2. Otherwise, set request’s policy container to a new policy\n // container.\n request.policyContainer = makePolicyContainer()\n }\n }\n\n // 12. If request’s header list does not contain `Accept`, then:\n if (!request.headersList.contains('accept')) {\n // 1. Let value be `*/*`.\n const value = '*/*'\n\n // 2. A user agent should set value to the first matching statement, if\n // any, switching on request’s destination:\n // \"document\"\n // \"frame\"\n // \"iframe\"\n // `text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8`\n // \"image\"\n // `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5`\n // \"style\"\n // `text/css,*/*;q=0.1`\n // TODO\n\n // 3. Append `Accept`/value to request’s header list.\n request.headersList.append('accept', value)\n }\n\n // 13. If request’s header list does not contain `Accept-Language`, then\n // user agents should append `Accept-Language`/an appropriate value to\n // request’s header list.\n if (!request.headersList.contains('accept-language')) {\n request.headersList.append('accept-language', '*')\n }\n\n // 14. If request’s priority is null, then use request’s initiator and\n // destination appropriately in setting request’s priority to a\n // user-agent-defined object.\n if (request.priority === null) {\n // TODO\n }\n\n // 15. If request is a subresource request, then:\n if (subresourceSet.has(request.destination)) {\n // TODO\n }\n\n // 16. Run main fetch given fetchParams.\n mainFetch(fetchParams)\n .catch(err => {\n fetchParams.controller.terminate(err)\n })\n\n // 17. Return fetchParam's controller\n return fetchParams.controller\n}\n\n// https://fetch.spec.whatwg.org/#concept-main-fetch\nasync function mainFetch (fetchParams, recursive = false) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. If request’s local-URLs-only flag is set and request’s current URL is\n // not local, then set response to a network error.\n if (request.localURLsOnly && !urlIsLocal(requestCurrentURL(request))) {\n response = makeNetworkError('local URLs only')\n }\n\n // 4. Run report Content Security Policy violations for request.\n // TODO\n\n // 5. Upgrade request to a potentially trustworthy URL, if appropriate.\n tryUpgradeRequestToAPotentiallyTrustworthyURL(request)\n\n // 6. If should request be blocked due to a bad port, should fetching request\n // be blocked as mixed content, or should request be blocked by Content\n // Security Policy returns blocked, then set response to a network error.\n if (requestBadPort(request) === 'blocked') {\n response = makeNetworkError('bad port')\n }\n // TODO: should fetching request be blocked as mixed content?\n // TODO: should request be blocked by Content Security Policy?\n\n // 7. If request’s referrer policy is the empty string, then set request’s\n // referrer policy to request’s policy container’s referrer policy.\n if (request.referrerPolicy === '') {\n request.referrerPolicy = request.policyContainer.referrerPolicy\n }\n\n // 8. If request’s referrer is not \"no-referrer\", then set request’s\n // referrer to the result of invoking determine request’s referrer.\n if (request.referrer !== 'no-referrer') {\n request.referrer = determineRequestsReferrer(request)\n }\n\n // 9. Set request’s current URL’s scheme to \"https\" if all of the following\n // conditions are true:\n // - request’s current URL’s scheme is \"http\"\n // - request’s current URL’s host is a domain\n // - Matching request’s current URL’s host per Known HSTS Host Domain Name\n // Matching results in either a superdomain match with an asserted\n // includeSubDomains directive or a congruent match (with or without an\n // asserted includeSubDomains directive). [HSTS]\n // TODO\n\n // 10. If recursive is false, then run the remaining steps in parallel.\n // TODO\n\n // 11. If response is null, then set response to the result of running\n // the steps corresponding to the first matching statement:\n if (response === null) {\n response = await (async () => {\n const currentURL = requestCurrentURL(request)\n\n if (\n // - request’s current URL’s origin is same origin with request’s origin,\n // and request’s response tainting is \"basic\"\n (sameOrigin(currentURL, request.url) && request.responseTainting === 'basic') ||\n // request’s current URL’s scheme is \"data\"\n (currentURL.protocol === 'data:') ||\n // - request’s mode is \"navigate\" or \"websocket\"\n (request.mode === 'navigate' || request.mode === 'websocket')\n ) {\n // 1. Set request’s response tainting to \"basic\".\n request.responseTainting = 'basic'\n\n // 2. Return the result of running scheme fetch given fetchParams.\n return await schemeFetch(fetchParams)\n }\n\n // request’s mode is \"same-origin\"\n if (request.mode === 'same-origin') {\n // 1. Return a network error.\n return makeNetworkError('request mode cannot be \"same-origin\"')\n }\n\n // request’s mode is \"no-cors\"\n if (request.mode === 'no-cors') {\n // 1. If request’s redirect mode is not \"follow\", then return a network\n // error.\n if (request.redirect !== 'follow') {\n return makeNetworkError(\n 'redirect mode cannot be \"follow\" for \"no-cors\" request'\n )\n }\n\n // 2. Set request’s response tainting to \"opaque\".\n request.responseTainting = 'opaque'\n\n // 3. Return the result of running scheme fetch given fetchParams.\n return await schemeFetch(fetchParams)\n }\n\n // request’s current URL’s scheme is not an HTTP(S) scheme\n if (!urlIsHttpHttpsScheme(requestCurrentURL(request))) {\n // Return a network error.\n return makeNetworkError('URL scheme must be a HTTP(S) scheme')\n }\n\n // - request’s use-CORS-preflight flag is set\n // - request’s unsafe-request flag is set and either request’s method is\n // not a CORS-safelisted method or CORS-unsafe request-header names with\n // request’s header list is not empty\n // 1. Set request’s response tainting to \"cors\".\n // 2. Let corsWithPreflightResponse be the result of running HTTP fetch\n // given fetchParams and true.\n // 3. If corsWithPreflightResponse is a network error, then clear cache\n // entries using request.\n // 4. Return corsWithPreflightResponse.\n // TODO\n\n // Otherwise\n // 1. Set request’s response tainting to \"cors\".\n request.responseTainting = 'cors'\n\n // 2. Return the result of running HTTP fetch given fetchParams.\n return await httpFetch(fetchParams)\n })()\n }\n\n // 12. If recursive is true, then return response.\n if (recursive) {\n return response\n }\n\n // 13. If response is not a network error and response is not a filtered\n // response, then:\n if (response.status !== 0 && !response.internalResponse) {\n // If request’s response tainting is \"cors\", then:\n if (request.responseTainting === 'cors') {\n // 1. Let headerNames be the result of extracting header list values\n // given `Access-Control-Expose-Headers` and response’s header list.\n // TODO\n // 2. If request’s credentials mode is not \"include\" and headerNames\n // contains `*`, then set response’s CORS-exposed header-name list to\n // all unique header names in response’s header list.\n // TODO\n // 3. Otherwise, if headerNames is not null or failure, then set\n // response’s CORS-exposed header-name list to headerNames.\n // TODO\n }\n\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (request.responseTainting === 'basic') {\n response = filterResponse(response, 'basic')\n } else if (request.responseTainting === 'cors') {\n response = filterResponse(response, 'cors')\n } else if (request.responseTainting === 'opaque') {\n response = filterResponse(response, 'opaque')\n } else {\n assert(false)\n }\n }\n\n // 14. Let internalResponse be response, if response is a network error,\n // and response’s internal response otherwise.\n let internalResponse =\n response.status === 0 ? response : response.internalResponse\n\n // 15. If internalResponse’s URL list is empty, then set it to a clone of\n // request’s URL list.\n if (internalResponse.urlList.length === 0) {\n internalResponse.urlList.push(...request.urlList)\n }\n\n // 16. If request’s timing allow failed flag is unset, then set\n // internalResponse’s timing allow passed flag.\n if (!request.timingAllowFailed) {\n response.timingAllowPassed = true\n }\n\n // 17. If response is not a network error and any of the following returns\n // blocked\n // - should internalResponse to request be blocked as mixed content\n // - should internalResponse to request be blocked by Content Security Policy\n // - should internalResponse to request be blocked due to its MIME type\n // - should internalResponse to request be blocked due to nosniff\n // TODO\n\n // 18. If response’s type is \"opaque\", internalResponse’s status is 206,\n // internalResponse’s range-requested flag is set, and request’s header\n // list does not contain `Range`, then set response and internalResponse\n // to a network error.\n if (\n response.type === 'opaque' &&\n internalResponse.status === 206 &&\n internalResponse.rangeRequested &&\n !request.headers.contains('range')\n ) {\n response = internalResponse = makeNetworkError()\n }\n\n // 19. If response is not a network error and either request’s method is\n // `HEAD` or `CONNECT`, or internalResponse’s status is a null body status,\n // set internalResponse’s body to null and disregard any enqueuing toward\n // it (if any).\n if (\n response.status !== 0 &&\n (request.method === 'HEAD' ||\n request.method === 'CONNECT' ||\n nullBodyStatus.includes(internalResponse.status))\n ) {\n internalResponse.body = null\n fetchParams.controller.dump = true\n }\n\n // 20. If request’s integrity metadata is not the empty string, then:\n if (request.integrity) {\n // 1. Let processBodyError be this step: run fetch finale given fetchParams\n // and a network error.\n const processBodyError = (reason) =>\n fetchFinale(fetchParams, makeNetworkError(reason))\n\n // 2. If request’s response tainting is \"opaque\", or response’s body is null,\n // then run processBodyError and abort these steps.\n if (request.responseTainting === 'opaque' || response.body == null) {\n processBodyError(response.error)\n return\n }\n\n // 3. Let processBody given bytes be these steps:\n const processBody = (bytes) => {\n // 1. If bytes do not match request’s integrity metadata,\n // then run processBodyError and abort these steps. [SRI]\n if (!bytesMatch(bytes, request.integrity)) {\n processBodyError('integrity mismatch')\n return\n }\n\n // 2. Set response’s body to bytes as a body.\n response.body = safelyExtractBody(bytes)[0]\n\n // 3. Run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n\n // 4. Fully read response’s body given processBody and processBodyError.\n await fullyReadBody(response.body, processBody, processBodyError)\n } else {\n // 21. Otherwise, run fetch finale given fetchParams and response.\n fetchFinale(fetchParams, response)\n }\n}\n\n// https://fetch.spec.whatwg.org/#concept-scheme-fetch\n// given a fetch params fetchParams\nfunction schemeFetch (fetchParams) {\n // Note: since the connection is destroyed on redirect, which sets fetchParams to a\n // cancelled state, we do not want this condition to trigger *unless* there have been\n // no redirects. See https://github.com/nodejs/undici/issues/1776\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams) && fetchParams.request.redirectCount === 0) {\n return Promise.resolve(makeAppropriateNetworkError(fetchParams))\n }\n\n // 2. Let request be fetchParams’s request.\n const { request } = fetchParams\n\n const { protocol: scheme } = requestCurrentURL(request)\n\n // 3. Switch on request’s current URL’s scheme and run the associated steps:\n switch (scheme) {\n case 'about:': {\n // If request’s current URL’s path is the string \"blank\", then return a new response\n // whose status message is `OK`, header list is « (`Content-Type`, `text/html;charset=utf-8`) »,\n // and body is the empty byte sequence as a body.\n\n // Otherwise, return a network error.\n return Promise.resolve(makeNetworkError('about scheme is not supported'))\n }\n case 'blob:': {\n if (!resolveObjectURL) {\n resolveObjectURL = require('buffer').resolveObjectURL\n }\n\n // 1. Let blobURLEntry be request’s current URL’s blob URL entry.\n const blobURLEntry = requestCurrentURL(request)\n\n // https://github.com/web-platform-tests/wpt/blob/7b0ebaccc62b566a1965396e5be7bb2bc06f841f/FileAPI/url/resources/fetch-tests.js#L52-L56\n // Buffer.resolveObjectURL does not ignore URL queries.\n if (blobURLEntry.search.length !== 0) {\n return Promise.resolve(makeNetworkError('NetworkError when attempting to fetch resource.'))\n }\n\n const blobURLEntryObject = resolveObjectURL(blobURLEntry.toString())\n\n // 2. If request’s method is not `GET`, blobURLEntry is null, or blobURLEntry’s\n // object is not a Blob object, then return a network error.\n if (request.method !== 'GET' || !isBlobLike(blobURLEntryObject)) {\n return Promise.resolve(makeNetworkError('invalid method'))\n }\n\n // 3. Let bodyWithType be the result of safely extracting blobURLEntry’s object.\n const bodyWithType = safelyExtractBody(blobURLEntryObject)\n\n // 4. Let body be bodyWithType’s body.\n const body = bodyWithType[0]\n\n // 5. Let length be body’s length, serialized and isomorphic encoded.\n const length = isomorphicEncode(`${body.length}`)\n\n // 6. Let type be bodyWithType’s type if it is non-null; otherwise the empty byte sequence.\n const type = bodyWithType[1] ?? ''\n\n // 7. Return a new response whose status message is `OK`, header list is\n // « (`Content-Length`, length), (`Content-Type`, type) », and body is body.\n const response = makeResponse({\n statusText: 'OK',\n headersList: [\n ['content-length', { name: 'Content-Length', value: length }],\n ['content-type', { name: 'Content-Type', value: type }]\n ]\n })\n\n response.body = body\n\n return Promise.resolve(response)\n }\n case 'data:': {\n // 1. Let dataURLStruct be the result of running the\n // data: URL processor on request’s current URL.\n const currentURL = requestCurrentURL(request)\n const dataURLStruct = dataURLProcessor(currentURL)\n\n // 2. If dataURLStruct is failure, then return a\n // network error.\n if (dataURLStruct === 'failure') {\n return Promise.resolve(makeNetworkError('failed to fetch the data URL'))\n }\n\n // 3. Let mimeType be dataURLStruct’s MIME type, serialized.\n const mimeType = serializeAMimeType(dataURLStruct.mimeType)\n\n // 4. Return a response whose status message is `OK`,\n // header list is « (`Content-Type`, mimeType) »,\n // and body is dataURLStruct’s body as a body.\n return Promise.resolve(makeResponse({\n statusText: 'OK',\n headersList: [\n ['content-type', { name: 'Content-Type', value: mimeType }]\n ],\n body: safelyExtractBody(dataURLStruct.body)[0]\n }))\n }\n case 'file:': {\n // For now, unfortunate as it is, file URLs are left as an exercise for the reader.\n // When in doubt, return a network error.\n return Promise.resolve(makeNetworkError('not implemented... yet...'))\n }\n case 'http:':\n case 'https:': {\n // Return the result of running HTTP fetch given fetchParams.\n\n return httpFetch(fetchParams)\n .catch((err) => makeNetworkError(err))\n }\n default: {\n return Promise.resolve(makeNetworkError('unknown scheme'))\n }\n }\n}\n\n// https://fetch.spec.whatwg.org/#finalize-response\nfunction finalizeResponse (fetchParams, response) {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // 2, If fetchParams’s process response done is not null, then queue a fetch\n // task to run fetchParams’s process response done given response, with\n // fetchParams’s task destination.\n if (fetchParams.processResponseDone != null) {\n queueMicrotask(() => fetchParams.processResponseDone(response))\n }\n}\n\n// https://fetch.spec.whatwg.org/#fetch-finale\nfunction fetchFinale (fetchParams, response) {\n // 1. If response is a network error, then:\n if (response.type === 'error') {\n // 1. Set response’s URL list to « fetchParams’s request’s URL list[0] ».\n response.urlList = [fetchParams.request.urlList[0]]\n\n // 2. Set response’s timing info to the result of creating an opaque timing\n // info for fetchParams’s timing info.\n response.timingInfo = createOpaqueTimingInfo({\n startTime: fetchParams.timingInfo.startTime\n })\n }\n\n // 2. Let processResponseEndOfBody be the following steps:\n const processResponseEndOfBody = () => {\n // 1. Set fetchParams’s request’s done flag.\n fetchParams.request.done = true\n\n // If fetchParams’s process response end-of-body is not null,\n // then queue a fetch task to run fetchParams’s process response\n // end-of-body given response with fetchParams’s task destination.\n if (fetchParams.processResponseEndOfBody != null) {\n queueMicrotask(() => fetchParams.processResponseEndOfBody(response))\n }\n }\n\n // 3. If fetchParams’s process response is non-null, then queue a fetch task\n // to run fetchParams’s process response given response, with fetchParams’s\n // task destination.\n if (fetchParams.processResponse != null) {\n queueMicrotask(() => fetchParams.processResponse(response))\n }\n\n // 4. If response’s body is null, then run processResponseEndOfBody.\n if (response.body == null) {\n processResponseEndOfBody()\n } else {\n // 5. Otherwise:\n\n // 1. Let transformStream be a new a TransformStream.\n\n // 2. Let identityTransformAlgorithm be an algorithm which, given chunk,\n // enqueues chunk in transformStream.\n const identityTransformAlgorithm = (chunk, controller) => {\n controller.enqueue(chunk)\n }\n\n // 3. Set up transformStream with transformAlgorithm set to identityTransformAlgorithm\n // and flushAlgorithm set to processResponseEndOfBody.\n const transformStream = new TransformStream({\n start () {},\n transform: identityTransformAlgorithm,\n flush: processResponseEndOfBody\n }, {\n size () {\n return 1\n }\n }, {\n size () {\n return 1\n }\n })\n\n // 4. Set response’s body to the result of piping response’s body through transformStream.\n response.body = { stream: response.body.stream.pipeThrough(transformStream) }\n }\n\n // 6. If fetchParams’s process response consume body is non-null, then:\n if (fetchParams.processResponseConsumeBody != null) {\n // 1. Let processBody given nullOrBytes be this step: run fetchParams’s\n // process response consume body given response and nullOrBytes.\n const processBody = (nullOrBytes) => fetchParams.processResponseConsumeBody(response, nullOrBytes)\n\n // 2. Let processBodyError be this step: run fetchParams’s process\n // response consume body given response and failure.\n const processBodyError = (failure) => fetchParams.processResponseConsumeBody(response, failure)\n\n // 3. If response’s body is null, then queue a fetch task to run processBody\n // given null, with fetchParams’s task destination.\n if (response.body == null) {\n queueMicrotask(() => processBody(null))\n } else {\n // 4. Otherwise, fully read response’s body given processBody, processBodyError,\n // and fetchParams’s task destination.\n return fullyReadBody(response.body, processBody, processBodyError)\n }\n return Promise.resolve()\n }\n}\n\n// https://fetch.spec.whatwg.org/#http-fetch\nasync function httpFetch (fetchParams) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let actualResponse be null.\n let actualResponse = null\n\n // 4. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 5. If request’s service-workers mode is \"all\", then:\n if (request.serviceWorkers === 'all') {\n // TODO\n }\n\n // 6. If response is null, then:\n if (response === null) {\n // 1. If makeCORSPreflight is true and one of these conditions is true:\n // TODO\n\n // 2. If request’s redirect mode is \"follow\", then set request’s\n // service-workers mode to \"none\".\n if (request.redirect === 'follow') {\n request.serviceWorkers = 'none'\n }\n\n // 3. Set response and actualResponse to the result of running\n // HTTP-network-or-cache fetch given fetchParams.\n actualResponse = response = await httpNetworkOrCacheFetch(fetchParams)\n\n // 4. If request’s response tainting is \"cors\" and a CORS check\n // for request and response returns failure, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n corsCheck(request, response) === 'failure'\n ) {\n return makeNetworkError('cors failure')\n }\n\n // 5. If the TAO check for request and response returns failure, then set\n // request’s timing allow failed flag.\n if (TAOCheck(request, response) === 'failure') {\n request.timingAllowFailed = true\n }\n }\n\n // 7. If either request’s response tainting or response’s type\n // is \"opaque\", and the cross-origin resource policy check with\n // request’s origin, request’s client, request’s destination,\n // and actualResponse returns blocked, then return a network error.\n if (\n (request.responseTainting === 'opaque' || response.type === 'opaque') &&\n crossOriginResourcePolicyCheck(\n request.origin,\n request.client,\n request.destination,\n actualResponse\n ) === 'blocked'\n ) {\n return makeNetworkError('blocked')\n }\n\n // 8. If actualResponse’s status is a redirect status, then:\n if (redirectStatusSet.has(actualResponse.status)) {\n // 1. If actualResponse’s status is not 303, request’s body is not null,\n // and the connection uses HTTP/2, then user agents may, and are even\n // encouraged to, transmit an RST_STREAM frame.\n // See, https://github.com/whatwg/fetch/issues/1288\n if (request.redirect !== 'manual') {\n fetchParams.controller.connection.destroy()\n }\n\n // 2. Switch on request’s redirect mode:\n if (request.redirect === 'error') {\n // Set response to a network error.\n response = makeNetworkError('unexpected redirect')\n } else if (request.redirect === 'manual') {\n // Set response to an opaque-redirect filtered response whose internal\n // response is actualResponse.\n // NOTE(spec): On the web this would return an `opaqueredirect` response,\n // but that doesn't make sense server side.\n // See https://github.com/nodejs/undici/issues/1193.\n response = actualResponse\n } else if (request.redirect === 'follow') {\n // Set response to the result of running HTTP-redirect fetch given\n // fetchParams and response.\n response = await httpRedirectFetch(fetchParams, response)\n } else {\n assert(false)\n }\n }\n\n // 9. Set response’s timing info to timingInfo.\n response.timingInfo = timingInfo\n\n // 10. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-redirect-fetch\nfunction httpRedirectFetch (fetchParams, response) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let actualResponse be response, if response is not a filtered response,\n // and response’s internal response otherwise.\n const actualResponse = response.internalResponse\n ? response.internalResponse\n : response\n\n // 3. Let locationURL be actualResponse’s location URL given request’s current\n // URL’s fragment.\n let locationURL\n\n try {\n locationURL = responseLocationURL(\n actualResponse,\n requestCurrentURL(request).hash\n )\n\n // 4. If locationURL is null, then return response.\n if (locationURL == null) {\n return response\n }\n } catch (err) {\n // 5. If locationURL is failure, then return a network error.\n return Promise.resolve(makeNetworkError(err))\n }\n\n // 6. If locationURL’s scheme is not an HTTP(S) scheme, then return a network\n // error.\n if (!urlIsHttpHttpsScheme(locationURL)) {\n return Promise.resolve(makeNetworkError('URL scheme must be a HTTP(S) scheme'))\n }\n\n // 7. If request’s redirect count is 20, then return a network error.\n if (request.redirectCount === 20) {\n return Promise.resolve(makeNetworkError('redirect count exceeded'))\n }\n\n // 8. Increase request’s redirect count by 1.\n request.redirectCount += 1\n\n // 9. If request’s mode is \"cors\", locationURL includes credentials, and\n // request’s origin is not same origin with locationURL’s origin, then return\n // a network error.\n if (\n request.mode === 'cors' &&\n (locationURL.username || locationURL.password) &&\n !sameOrigin(request, locationURL)\n ) {\n return Promise.resolve(makeNetworkError('cross origin not allowed for request mode \"cors\"'))\n }\n\n // 10. If request’s response tainting is \"cors\" and locationURL includes\n // credentials, then return a network error.\n if (\n request.responseTainting === 'cors' &&\n (locationURL.username || locationURL.password)\n ) {\n return Promise.resolve(makeNetworkError(\n 'URL cannot contain credentials for request mode \"cors\"'\n ))\n }\n\n // 11. If actualResponse’s status is not 303, request’s body is non-null,\n // and request’s body’s source is null, then return a network error.\n if (\n actualResponse.status !== 303 &&\n request.body != null &&\n request.body.source == null\n ) {\n return Promise.resolve(makeNetworkError())\n }\n\n // 12. If one of the following is true\n // - actualResponse’s status is 301 or 302 and request’s method is `POST`\n // - actualResponse’s status is 303 and request’s method is not `GET` or `HEAD`\n if (\n ([301, 302].includes(actualResponse.status) && request.method === 'POST') ||\n (actualResponse.status === 303 &&\n !GET_OR_HEAD.includes(request.method))\n ) {\n // then:\n // 1. Set request’s method to `GET` and request’s body to null.\n request.method = 'GET'\n request.body = null\n\n // 2. For each headerName of request-body-header name, delete headerName from\n // request’s header list.\n for (const headerName of requestBodyHeader) {\n request.headersList.delete(headerName)\n }\n }\n\n // 13. If request’s current URL’s origin is not same origin with locationURL’s\n // origin, then for each headerName of CORS non-wildcard request-header name,\n // delete headerName from request’s header list.\n if (!sameOrigin(requestCurrentURL(request), locationURL)) {\n // https://fetch.spec.whatwg.org/#cors-non-wildcard-request-header-name\n request.headersList.delete('authorization')\n\n // \"Cookie\" and \"Host\" are forbidden request-headers, which undici doesn't implement.\n request.headersList.delete('cookie')\n request.headersList.delete('host')\n }\n\n // 14. If request’s body is non-null, then set request’s body to the first return\n // value of safely extracting request’s body’s source.\n if (request.body != null) {\n assert(request.body.source != null)\n request.body = safelyExtractBody(request.body.source)[0]\n }\n\n // 15. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 16. Set timingInfo’s redirect end time and post-redirect start time to the\n // coarsened shared current time given fetchParams’s cross-origin isolated\n // capability.\n timingInfo.redirectEndTime = timingInfo.postRedirectStartTime =\n coarsenedSharedCurrentTime(fetchParams.crossOriginIsolatedCapability)\n\n // 17. If timingInfo’s redirect start time is 0, then set timingInfo’s\n // redirect start time to timingInfo’s start time.\n if (timingInfo.redirectStartTime === 0) {\n timingInfo.redirectStartTime = timingInfo.startTime\n }\n\n // 18. Append locationURL to request’s URL list.\n request.urlList.push(locationURL)\n\n // 19. Invoke set request’s referrer policy on redirect on request and\n // actualResponse.\n setRequestReferrerPolicyOnRedirect(request, actualResponse)\n\n // 20. Return the result of running main fetch given fetchParams and true.\n return mainFetch(fetchParams, true)\n}\n\n// https://fetch.spec.whatwg.org/#http-network-or-cache-fetch\nasync function httpNetworkOrCacheFetch (\n fetchParams,\n isAuthenticationFetch = false,\n isNewConnectionFetch = false\n) {\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let httpFetchParams be null.\n let httpFetchParams = null\n\n // 3. Let httpRequest be null.\n let httpRequest = null\n\n // 4. Let response be null.\n let response = null\n\n // 5. Let storedResponse be null.\n // TODO: cache\n\n // 6. Let httpCache be null.\n const httpCache = null\n\n // 7. Let the revalidatingFlag be unset.\n const revalidatingFlag = false\n\n // 8. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If request’s window is \"no-window\" and request’s redirect mode is\n // \"error\", then set httpFetchParams to fetchParams and httpRequest to\n // request.\n if (request.window === 'no-window' && request.redirect === 'error') {\n httpFetchParams = fetchParams\n httpRequest = request\n } else {\n // Otherwise:\n\n // 1. Set httpRequest to a clone of request.\n httpRequest = makeRequest(request)\n\n // 2. Set httpFetchParams to a copy of fetchParams.\n httpFetchParams = { ...fetchParams }\n\n // 3. Set httpFetchParams’s request to httpRequest.\n httpFetchParams.request = httpRequest\n }\n\n // 3. Let includeCredentials be true if one of\n const includeCredentials =\n request.credentials === 'include' ||\n (request.credentials === 'same-origin' &&\n request.responseTainting === 'basic')\n\n // 4. Let contentLength be httpRequest’s body’s length, if httpRequest’s\n // body is non-null; otherwise null.\n const contentLength = httpRequest.body ? httpRequest.body.length : null\n\n // 5. Let contentLengthHeaderValue be null.\n let contentLengthHeaderValue = null\n\n // 6. If httpRequest’s body is null and httpRequest’s method is `POST` or\n // `PUT`, then set contentLengthHeaderValue to `0`.\n if (\n httpRequest.body == null &&\n ['POST', 'PUT'].includes(httpRequest.method)\n ) {\n contentLengthHeaderValue = '0'\n }\n\n // 7. If contentLength is non-null, then set contentLengthHeaderValue to\n // contentLength, serialized and isomorphic encoded.\n if (contentLength != null) {\n contentLengthHeaderValue = isomorphicEncode(`${contentLength}`)\n }\n\n // 8. If contentLengthHeaderValue is non-null, then append\n // `Content-Length`/contentLengthHeaderValue to httpRequest’s header\n // list.\n if (contentLengthHeaderValue != null) {\n httpRequest.headersList.append('content-length', contentLengthHeaderValue)\n }\n\n // 9. If contentLengthHeaderValue is non-null, then append (`Content-Length`,\n // contentLengthHeaderValue) to httpRequest’s header list.\n\n // 10. If contentLength is non-null and httpRequest’s keepalive is true,\n // then:\n if (contentLength != null && httpRequest.keepalive) {\n // NOTE: keepalive is a noop outside of browser context.\n }\n\n // 11. If httpRequest’s referrer is a URL, then append\n // `Referer`/httpRequest’s referrer, serialized and isomorphic encoded,\n // to httpRequest’s header list.\n if (httpRequest.referrer instanceof URL) {\n httpRequest.headersList.append('referer', isomorphicEncode(httpRequest.referrer.href))\n }\n\n // 12. Append a request `Origin` header for httpRequest.\n appendRequestOriginHeader(httpRequest)\n\n // 13. Append the Fetch metadata headers for httpRequest. [FETCH-METADATA]\n appendFetchMetadata(httpRequest)\n\n // 14. If httpRequest’s header list does not contain `User-Agent`, then\n // user agents should append `User-Agent`/default `User-Agent` value to\n // httpRequest’s header list.\n if (!httpRequest.headersList.contains('user-agent')) {\n httpRequest.headersList.append('user-agent', typeof esbuildDetection === 'undefined' ? 'undici' : 'node')\n }\n\n // 15. If httpRequest’s cache mode is \"default\" and httpRequest’s header\n // list contains `If-Modified-Since`, `If-None-Match`,\n // `If-Unmodified-Since`, `If-Match`, or `If-Range`, then set\n // httpRequest’s cache mode to \"no-store\".\n if (\n httpRequest.cache === 'default' &&\n (httpRequest.headersList.contains('if-modified-since') ||\n httpRequest.headersList.contains('if-none-match') ||\n httpRequest.headersList.contains('if-unmodified-since') ||\n httpRequest.headersList.contains('if-match') ||\n httpRequest.headersList.contains('if-range'))\n ) {\n httpRequest.cache = 'no-store'\n }\n\n // 16. If httpRequest’s cache mode is \"no-cache\", httpRequest’s prevent\n // no-cache cache-control header modification flag is unset, and\n // httpRequest’s header list does not contain `Cache-Control`, then append\n // `Cache-Control`/`max-age=0` to httpRequest’s header list.\n if (\n httpRequest.cache === 'no-cache' &&\n !httpRequest.preventNoCacheCacheControlHeaderModification &&\n !httpRequest.headersList.contains('cache-control')\n ) {\n httpRequest.headersList.append('cache-control', 'max-age=0')\n }\n\n // 17. If httpRequest’s cache mode is \"no-store\" or \"reload\", then:\n if (httpRequest.cache === 'no-store' || httpRequest.cache === 'reload') {\n // 1. If httpRequest’s header list does not contain `Pragma`, then append\n // `Pragma`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('pragma')) {\n httpRequest.headersList.append('pragma', 'no-cache')\n }\n\n // 2. If httpRequest’s header list does not contain `Cache-Control`,\n // then append `Cache-Control`/`no-cache` to httpRequest’s header list.\n if (!httpRequest.headersList.contains('cache-control')) {\n httpRequest.headersList.append('cache-control', 'no-cache')\n }\n }\n\n // 18. If httpRequest’s header list contains `Range`, then append\n // `Accept-Encoding`/`identity` to httpRequest’s header list.\n if (httpRequest.headersList.contains('range')) {\n httpRequest.headersList.append('accept-encoding', 'identity')\n }\n\n // 19. Modify httpRequest’s header list per HTTP. Do not append a given\n // header if httpRequest’s header list contains that header’s name.\n // TODO: https://github.com/whatwg/fetch/issues/1285#issuecomment-896560129\n if (!httpRequest.headersList.contains('accept-encoding')) {\n if (urlHasHttpsScheme(requestCurrentURL(httpRequest))) {\n httpRequest.headersList.append('accept-encoding', 'br, gzip, deflate')\n } else {\n httpRequest.headersList.append('accept-encoding', 'gzip, deflate')\n }\n }\n\n httpRequest.headersList.delete('host')\n\n // 20. If includeCredentials is true, then:\n if (includeCredentials) {\n // 1. If the user agent is not configured to block cookies for httpRequest\n // (see section 7 of [COOKIES]), then:\n // TODO: credentials\n // 2. If httpRequest’s header list does not contain `Authorization`, then:\n // TODO: credentials\n }\n\n // 21. If there’s a proxy-authentication entry, use it as appropriate.\n // TODO: proxy-authentication\n\n // 22. Set httpCache to the result of determining the HTTP cache\n // partition, given httpRequest.\n // TODO: cache\n\n // 23. If httpCache is null, then set httpRequest’s cache mode to\n // \"no-store\".\n if (httpCache == null) {\n httpRequest.cache = 'no-store'\n }\n\n // 24. If httpRequest’s cache mode is neither \"no-store\" nor \"reload\",\n // then:\n if (httpRequest.mode !== 'no-store' && httpRequest.mode !== 'reload') {\n // TODO: cache\n }\n\n // 9. If aborted, then return the appropriate network error for fetchParams.\n // TODO\n\n // 10. If response is null, then:\n if (response == null) {\n // 1. If httpRequest’s cache mode is \"only-if-cached\", then return a\n // network error.\n if (httpRequest.mode === 'only-if-cached') {\n return makeNetworkError('only if cached')\n }\n\n // 2. Let forwardResponse be the result of running HTTP-network fetch\n // given httpFetchParams, includeCredentials, and isNewConnectionFetch.\n const forwardResponse = await httpNetworkFetch(\n httpFetchParams,\n includeCredentials,\n isNewConnectionFetch\n )\n\n // 3. If httpRequest’s method is unsafe and forwardResponse’s status is\n // in the range 200 to 399, inclusive, invalidate appropriate stored\n // responses in httpCache, as per the \"Invalidation\" chapter of HTTP\n // Caching, and set storedResponse to null. [HTTP-CACHING]\n if (\n !safeMethodsSet.has(httpRequest.method) &&\n forwardResponse.status >= 200 &&\n forwardResponse.status <= 399\n ) {\n // TODO: cache\n }\n\n // 4. If the revalidatingFlag is set and forwardResponse’s status is 304,\n // then:\n if (revalidatingFlag && forwardResponse.status === 304) {\n // TODO: cache\n }\n\n // 5. If response is null, then:\n if (response == null) {\n // 1. Set response to forwardResponse.\n response = forwardResponse\n\n // 2. Store httpRequest and forwardResponse in httpCache, as per the\n // \"Storing Responses in Caches\" chapter of HTTP Caching. [HTTP-CACHING]\n // TODO: cache\n }\n }\n\n // 11. Set response’s URL list to a clone of httpRequest’s URL list.\n response.urlList = [...httpRequest.urlList]\n\n // 12. If httpRequest’s header list contains `Range`, then set response’s\n // range-requested flag.\n if (httpRequest.headersList.contains('range')) {\n response.rangeRequested = true\n }\n\n // 13. Set response’s request-includes-credentials to includeCredentials.\n response.requestIncludesCredentials = includeCredentials\n\n // 14. If response’s status is 401, httpRequest’s response tainting is not\n // \"cors\", includeCredentials is true, and request’s window is an environment\n // settings object, then:\n // TODO\n\n // 15. If response’s status is 407, then:\n if (response.status === 407) {\n // 1. If request’s window is \"no-window\", then return a network error.\n if (request.window === 'no-window') {\n return makeNetworkError()\n }\n\n // 2. ???\n\n // 3. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 4. Prompt the end user as appropriate in request’s window and store\n // the result as a proxy-authentication entry. [HTTP-AUTH]\n // TODO: Invoke some kind of callback?\n\n // 5. Set response to the result of running HTTP-network-or-cache fetch given\n // fetchParams.\n // TODO\n return makeNetworkError('proxy authentication required')\n }\n\n // 16. If all of the following are true\n if (\n // response’s status is 421\n response.status === 421 &&\n // isNewConnectionFetch is false\n !isNewConnectionFetch &&\n // request’s body is null, or request’s body is non-null and request’s body’s source is non-null\n (request.body == null || request.body.source != null)\n ) {\n // then:\n\n // 1. If fetchParams is canceled, then return the appropriate network error for fetchParams.\n if (isCancelled(fetchParams)) {\n return makeAppropriateNetworkError(fetchParams)\n }\n\n // 2. Set response to the result of running HTTP-network-or-cache\n // fetch given fetchParams, isAuthenticationFetch, and true.\n\n // TODO (spec): The spec doesn't specify this but we need to cancel\n // the active response before we can start a new one.\n // https://github.com/whatwg/fetch/issues/1293\n fetchParams.controller.connection.destroy()\n\n response = await httpNetworkOrCacheFetch(\n fetchParams,\n isAuthenticationFetch,\n true\n )\n }\n\n // 17. If isAuthenticationFetch is true, then create an authentication entry\n if (isAuthenticationFetch) {\n // TODO\n }\n\n // 18. Return response.\n return response\n}\n\n// https://fetch.spec.whatwg.org/#http-network-fetch\nasync function httpNetworkFetch (\n fetchParams,\n includeCredentials = false,\n forceNewConnection = false\n) {\n assert(!fetchParams.controller.connection || fetchParams.controller.connection.destroyed)\n\n fetchParams.controller.connection = {\n abort: null,\n destroyed: false,\n destroy (err) {\n if (!this.destroyed) {\n this.destroyed = true\n this.abort?.(err ?? new DOMException('The operation was aborted.', 'AbortError'))\n }\n }\n }\n\n // 1. Let request be fetchParams’s request.\n const request = fetchParams.request\n\n // 2. Let response be null.\n let response = null\n\n // 3. Let timingInfo be fetchParams’s timing info.\n const timingInfo = fetchParams.timingInfo\n\n // 4. Let httpCache be the result of determining the HTTP cache partition,\n // given request.\n // TODO: cache\n const httpCache = null\n\n // 5. If httpCache is null, then set request’s cache mode to \"no-store\".\n if (httpCache == null) {\n request.cache = 'no-store'\n }\n\n // 6. Let networkPartitionKey be the result of determining the network\n // partition key given request.\n // TODO\n\n // 7. Let newConnection be \"yes\" if forceNewConnection is true; otherwise\n // \"no\".\n const newConnection = forceNewConnection ? 'yes' : 'no' // eslint-disable-line no-unused-vars\n\n // 8. Switch on request’s mode:\n if (request.mode === 'websocket') {\n // Let connection be the result of obtaining a WebSocket connection,\n // given request’s current URL.\n // TODO\n } else {\n // Let connection be the result of obtaining a connection, given\n // networkPartitionKey, request’s current URL’s origin,\n // includeCredentials, and forceNewConnection.\n // TODO\n }\n\n // 9. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. If connection is failure, then return a network error.\n\n // 2. Set timingInfo’s final connection timing info to the result of\n // calling clamp and coarsen connection timing info with connection’s\n // timing info, timingInfo’s post-redirect start time, and fetchParams’s\n // cross-origin isolated capability.\n\n // 3. If connection is not an HTTP/2 connection, request’s body is non-null,\n // and request’s body’s source is null, then append (`Transfer-Encoding`,\n // `chunked`) to request’s header list.\n\n // 4. Set timingInfo’s final network-request start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated\n // capability.\n\n // 5. Set response to the result of making an HTTP request over connection\n // using request with the following caveats:\n\n // - Follow the relevant requirements from HTTP. [HTTP] [HTTP-SEMANTICS]\n // [HTTP-COND] [HTTP-CACHING] [HTTP-AUTH]\n\n // - If request’s body is non-null, and request’s body’s source is null,\n // then the user agent may have a buffer of up to 64 kibibytes and store\n // a part of request’s body in that buffer. If the user agent reads from\n // request’s body beyond that buffer’s size and the user agent needs to\n // resend request, then instead return a network error.\n\n // - Set timingInfo’s final network-response start time to the coarsened\n // shared current time given fetchParams’s cross-origin isolated capability,\n // immediately after the user agent’s HTTP parser receives the first byte\n // of the response (e.g., frame header bytes for HTTP/2 or response status\n // line for HTTP/1.x).\n\n // - Wait until all the headers are transmitted.\n\n // - Any responses whose status is in the range 100 to 199, inclusive,\n // and is not 101, are to be ignored, except for the purposes of setting\n // timingInfo’s final network-response start time above.\n\n // - If request’s header list contains `Transfer-Encoding`/`chunked` and\n // response is transferred via HTTP/1.0 or older, then return a network\n // error.\n\n // - If the HTTP request results in a TLS client certificate dialog, then:\n\n // 1. If request’s window is an environment settings object, make the\n // dialog available in request’s window.\n\n // 2. Otherwise, return a network error.\n\n // To transmit request’s body body, run these steps:\n let requestBody = null\n // 1. If body is null and fetchParams’s process request end-of-body is\n // non-null, then queue a fetch task given fetchParams’s process request\n // end-of-body and fetchParams’s task destination.\n if (request.body == null && fetchParams.processRequestEndOfBody) {\n queueMicrotask(() => fetchParams.processRequestEndOfBody())\n } else if (request.body != null) {\n // 2. Otherwise, if body is non-null:\n\n // 1. Let processBodyChunk given bytes be these steps:\n const processBodyChunk = async function * (bytes) {\n // 1. If the ongoing fetch is terminated, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. Run this step in parallel: transmit bytes.\n yield bytes\n\n // 3. If fetchParams’s process request body is non-null, then run\n // fetchParams’s process request body given bytes’s length.\n fetchParams.processRequestBodyChunkLength?.(bytes.byteLength)\n }\n\n // 2. Let processEndOfBody be these steps:\n const processEndOfBody = () => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If fetchParams’s process request end-of-body is non-null,\n // then run fetchParams’s process request end-of-body.\n if (fetchParams.processRequestEndOfBody) {\n fetchParams.processRequestEndOfBody()\n }\n }\n\n // 3. Let processBodyError given e be these steps:\n const processBodyError = (e) => {\n // 1. If fetchParams is canceled, then abort these steps.\n if (isCancelled(fetchParams)) {\n return\n }\n\n // 2. If e is an \"AbortError\" DOMException, then abort fetchParams’s controller.\n if (e.name === 'AbortError') {\n fetchParams.controller.abort()\n } else {\n fetchParams.controller.terminate(e)\n }\n }\n\n // 4. Incrementally read request’s body given processBodyChunk, processEndOfBody,\n // processBodyError, and fetchParams’s task destination.\n requestBody = (async function * () {\n try {\n for await (const bytes of request.body.stream) {\n yield * processBodyChunk(bytes)\n }\n processEndOfBody()\n } catch (err) {\n processBodyError(err)\n }\n })()\n }\n\n try {\n // socket is only provided for websockets\n const { body, status, statusText, headersList, socket } = await dispatch({ body: requestBody })\n\n if (socket) {\n response = makeResponse({ status, statusText, headersList, socket })\n } else {\n const iterator = body[Symbol.asyncIterator]()\n fetchParams.controller.next = () => iterator.next()\n\n response = makeResponse({ status, statusText, headersList })\n }\n } catch (err) {\n // 10. If aborted, then:\n if (err.name === 'AbortError') {\n // 1. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n fetchParams.controller.connection.destroy()\n\n // 2. Return the appropriate network error for fetchParams.\n return makeAppropriateNetworkError(fetchParams, err)\n }\n\n return makeNetworkError(err)\n }\n\n // 11. Let pullAlgorithm be an action that resumes the ongoing fetch\n // if it is suspended.\n const pullAlgorithm = () => {\n fetchParams.controller.resume()\n }\n\n // 12. Let cancelAlgorithm be an algorithm that aborts fetchParams’s\n // controller with reason, given reason.\n const cancelAlgorithm = (reason) => {\n fetchParams.controller.abort(reason)\n }\n\n // 13. Let highWaterMark be a non-negative, non-NaN number, chosen by\n // the user agent.\n // TODO\n\n // 14. Let sizeAlgorithm be an algorithm that accepts a chunk object\n // and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.\n // TODO\n\n // 15. Let stream be a new ReadableStream.\n // 16. Set up stream with pullAlgorithm set to pullAlgorithm,\n // cancelAlgorithm set to cancelAlgorithm, highWaterMark set to\n // highWaterMark, and sizeAlgorithm set to sizeAlgorithm.\n if (!ReadableStream) {\n ReadableStream = require('stream/web').ReadableStream\n }\n\n const stream = new ReadableStream(\n {\n async start (controller) {\n fetchParams.controller.controller = controller\n },\n async pull (controller) {\n await pullAlgorithm(controller)\n },\n async cancel (reason) {\n await cancelAlgorithm(reason)\n }\n },\n {\n highWaterMark: 0,\n size () {\n return 1\n }\n }\n )\n\n // 17. Run these steps, but abort when the ongoing fetch is terminated:\n\n // 1. Set response’s body to a new body whose stream is stream.\n response.body = { stream }\n\n // 2. If response is not a network error and request’s cache mode is\n // not \"no-store\", then update response in httpCache for request.\n // TODO\n\n // 3. If includeCredentials is true and the user agent is not configured\n // to block cookies for request (see section 7 of [COOKIES]), then run the\n // \"set-cookie-string\" parsing algorithm (see section 5.2 of [COOKIES]) on\n // the value of each header whose name is a byte-case-insensitive match for\n // `Set-Cookie` in response’s header list, if any, and request’s current URL.\n // TODO\n\n // 18. If aborted, then:\n // TODO\n\n // 19. Run these steps in parallel:\n\n // 1. Run these steps, but abort when fetchParams is canceled:\n fetchParams.controller.on('terminated', onAborted)\n fetchParams.controller.resume = async () => {\n // 1. While true\n while (true) {\n // 1-3. See onData...\n\n // 4. Set bytes to the result of handling content codings given\n // codings and bytes.\n let bytes\n let isFailure\n try {\n const { done, value } = await fetchParams.controller.next()\n\n if (isAborted(fetchParams)) {\n break\n }\n\n bytes = done ? undefined : value\n } catch (err) {\n if (fetchParams.controller.ended && !timingInfo.encodedBodySize) {\n // zlib doesn't like empty streams.\n bytes = undefined\n } else {\n bytes = err\n\n // err may be propagated from the result of calling readablestream.cancel,\n // which might not be an error. https://github.com/nodejs/undici/issues/2009\n isFailure = true\n }\n }\n\n if (bytes === undefined) {\n // 2. Otherwise, if the bytes transmission for response’s message\n // body is done normally and stream is readable, then close\n // stream, finalize response for fetchParams and response, and\n // abort these in-parallel steps.\n readableStreamClose(fetchParams.controller.controller)\n\n finalizeResponse(fetchParams, response)\n\n return\n }\n\n // 5. Increase timingInfo’s decoded body size by bytes’s length.\n timingInfo.decodedBodySize += bytes?.byteLength ?? 0\n\n // 6. If bytes is failure, then terminate fetchParams’s controller.\n if (isFailure) {\n fetchParams.controller.terminate(bytes)\n return\n }\n\n // 7. Enqueue a Uint8Array wrapping an ArrayBuffer containing bytes\n // into stream.\n fetchParams.controller.controller.enqueue(new Uint8Array(bytes))\n\n // 8. If stream is errored, then terminate the ongoing fetch.\n if (isErrored(stream)) {\n fetchParams.controller.terminate()\n return\n }\n\n // 9. If stream doesn’t need more data ask the user agent to suspend\n // the ongoing fetch.\n if (!fetchParams.controller.controller.desiredSize) {\n return\n }\n }\n }\n\n // 2. If aborted, then:\n function onAborted (reason) {\n // 2. If fetchParams is aborted, then:\n if (isAborted(fetchParams)) {\n // 1. Set response’s aborted flag.\n response.aborted = true\n\n // 2. If stream is readable, then error stream with the result of\n // deserialize a serialized abort reason given fetchParams’s\n // controller’s serialized abort reason and an\n // implementation-defined realm.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(\n fetchParams.controller.serializedAbortReason\n )\n }\n } else {\n // 3. Otherwise, if stream is readable, error stream with a TypeError.\n if (isReadable(stream)) {\n fetchParams.controller.controller.error(new TypeError('terminated', {\n cause: isErrorLike(reason) ? reason : undefined\n }))\n }\n }\n\n // 4. If connection uses HTTP/2, then transmit an RST_STREAM frame.\n // 5. Otherwise, the user agent should close connection unless it would be bad for performance to do so.\n fetchParams.controller.connection.destroy()\n }\n\n // 20. Return response.\n return response\n\n async function dispatch ({ body }) {\n const url = requestCurrentURL(request)\n /** @type {import('../..').Agent} */\n const agent = fetchParams.controller.dispatcher\n\n return new Promise((resolve, reject) => agent.dispatch(\n {\n path: url.pathname + url.search,\n origin: url.origin,\n method: request.method,\n body: fetchParams.controller.dispatcher.isMockActive ? request.body && request.body.source : body,\n headers: request.headersList.entries,\n maxRedirections: 0,\n upgrade: request.mode === 'websocket' ? 'websocket' : undefined\n },\n {\n body: null,\n abort: null,\n\n onConnect (abort) {\n // TODO (fix): Do we need connection here?\n const { connection } = fetchParams.controller\n\n if (connection.destroyed) {\n abort(new DOMException('The operation was aborted.', 'AbortError'))\n } else {\n fetchParams.controller.on('terminated', abort)\n this.abort = connection.abort = abort\n }\n },\n\n onHeaders (status, headersList, resume, statusText) {\n if (status < 200) {\n return\n }\n\n let codings = []\n let location = ''\n\n const headers = new Headers()\n\n // For H2, the headers are a plain JS object\n // We distinguish between them and iterate accordingly\n if (Array.isArray(headersList)) {\n for (let n = 0; n < headersList.length; n += 2) {\n const key = headersList[n + 0].toString('latin1')\n const val = headersList[n + 1].toString('latin1')\n if (key.toLowerCase() === 'content-encoding') {\n // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n // \"All content-coding values are case-insensitive...\"\n codings = val.toLowerCase().split(',').map((x) => x.trim())\n } else if (key.toLowerCase() === 'location') {\n location = val\n }\n\n headers.append(key, val)\n }\n } else {\n const keys = Object.keys(headersList)\n for (const key of keys) {\n const val = headersList[key]\n if (key.toLowerCase() === 'content-encoding') {\n // https://www.rfc-editor.org/rfc/rfc7231#section-3.1.2.1\n // \"All content-coding values are case-insensitive...\"\n codings = val.toLowerCase().split(',').map((x) => x.trim()).reverse()\n } else if (key.toLowerCase() === 'location') {\n location = val\n }\n\n headers.append(key, val)\n }\n }\n\n this.body = new Readable({ read: resume })\n\n const decoders = []\n\n const willFollow = request.redirect === 'follow' &&\n location &&\n redirectStatusSet.has(status)\n\n // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding\n if (request.method !== 'HEAD' && request.method !== 'CONNECT' && !nullBodyStatus.includes(status) && !willFollow) {\n for (const coding of codings) {\n // https://www.rfc-editor.org/rfc/rfc9112.html#section-7.2\n if (coding === 'x-gzip' || coding === 'gzip') {\n decoders.push(zlib.createGunzip({\n // Be less strict when decoding compressed responses, since sometimes\n // servers send slightly invalid responses that are still accepted\n // by common browsers.\n // Always using Z_SYNC_FLUSH is what cURL does.\n flush: zlib.constants.Z_SYNC_FLUSH,\n finishFlush: zlib.constants.Z_SYNC_FLUSH\n }))\n } else if (coding === 'deflate') {\n decoders.push(zlib.createInflate())\n } else if (coding === 'br') {\n decoders.push(zlib.createBrotliDecompress())\n } else {\n decoders.length = 0\n break\n }\n }\n }\n\n resolve({\n status,\n statusText,\n headersList: headers[kHeadersList],\n body: decoders.length\n ? pipeline(this.body, ...decoders, () => { })\n : this.body.on('error', () => {})\n })\n\n return true\n },\n\n onData (chunk) {\n if (fetchParams.controller.dump) {\n return\n }\n\n // 1. If one or more bytes have been transmitted from response’s\n // message body, then:\n\n // 1. Let bytes be the transmitted bytes.\n const bytes = chunk\n\n // 2. Let codings be the result of extracting header list values\n // given `Content-Encoding` and response’s header list.\n // See pullAlgorithm.\n\n // 3. Increase timingInfo’s encoded body size by bytes’s length.\n timingInfo.encodedBodySize += bytes.byteLength\n\n // 4. See pullAlgorithm...\n\n return this.body.push(bytes)\n },\n\n onComplete () {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n fetchParams.controller.ended = true\n\n this.body.push(null)\n },\n\n onError (error) {\n if (this.abort) {\n fetchParams.controller.off('terminated', this.abort)\n }\n\n this.body?.destroy(error)\n\n fetchParams.controller.terminate(error)\n\n reject(error)\n },\n\n onUpgrade (status, headersList, socket) {\n if (status !== 101) {\n return\n }\n\n const headers = new Headers()\n\n for (let n = 0; n < headersList.length; n += 2) {\n const key = headersList[n + 0].toString('latin1')\n const val = headersList[n + 1].toString('latin1')\n\n headers.append(key, val)\n }\n\n resolve({\n status,\n statusText: STATUS_CODES[status],\n headersList: headers[kHeadersList],\n socket\n })\n\n return true\n }\n }\n ))\n }\n}\n\nmodule.exports = {\n fetch,\n Fetch,\n fetching,\n finalizeAndReportTiming\n}\n","/* globals AbortController */\n\n'use strict'\n\nconst { extractBody, mixinBody, cloneBody } = require('./body')\nconst { Headers, fill: fillHeaders, HeadersList } = require('./headers')\nconst { FinalizationRegistry } = require('../compat/dispatcher-weakref')()\nconst util = require('../core/util')\nconst {\n isValidHTTPToken,\n sameOrigin,\n normalizeMethod,\n makePolicyContainer\n} = require('./util')\nconst {\n forbiddenMethodsSet,\n corsSafeListedMethodsSet,\n referrerPolicy,\n requestRedirect,\n requestMode,\n requestCredentials,\n requestCache,\n requestDuplex\n} = require('./constants')\nconst { kEnumerableProperty } = util\nconst { kHeaders, kSignal, kState, kGuard, kRealm } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { getGlobalOrigin } = require('./global')\nconst { URLSerializer } = require('./dataURL')\nconst { kHeadersList } = require('../core/symbols')\nconst assert = require('assert')\nconst { getMaxListeners, setMaxListeners, getEventListeners, defaultMaxListeners } = require('events')\n\nlet TransformStream = globalThis.TransformStream\n\nconst kInit = Symbol('init')\nconst kAbortController = Symbol('abortController')\n\nconst requestFinalizer = new FinalizationRegistry(({ signal, abort }) => {\n signal.removeEventListener('abort', abort)\n})\n\n// https://fetch.spec.whatwg.org/#request-class\nclass Request {\n // https://fetch.spec.whatwg.org/#dom-request\n constructor (input, init = {}) {\n if (input === kInit) {\n return\n }\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Request constructor' })\n\n input = webidl.converters.RequestInfo(input)\n init = webidl.converters.RequestInit(init)\n\n // https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object\n this[kRealm] = {\n settingsObject: {\n baseUrl: getGlobalOrigin(),\n get origin () {\n return this.baseUrl?.origin\n },\n policyContainer: makePolicyContainer()\n }\n }\n\n // 1. Let request be null.\n let request = null\n\n // 2. Let fallbackMode be null.\n let fallbackMode = null\n\n // 3. Let baseURL be this’s relevant settings object’s API base URL.\n const baseUrl = this[kRealm].settingsObject.baseUrl\n\n // 4. Let signal be null.\n let signal = null\n\n // 5. If input is a string, then:\n if (typeof input === 'string') {\n // 1. Let parsedURL be the result of parsing input with baseURL.\n // 2. If parsedURL is failure, then throw a TypeError.\n let parsedURL\n try {\n parsedURL = new URL(input, baseUrl)\n } catch (err) {\n throw new TypeError('Failed to parse URL from ' + input, { cause: err })\n }\n\n // 3. If parsedURL includes credentials, then throw a TypeError.\n if (parsedURL.username || parsedURL.password) {\n throw new TypeError(\n 'Request cannot be constructed from a URL that includes credentials: ' +\n input\n )\n }\n\n // 4. Set request to a new request whose URL is parsedURL.\n request = makeRequest({ urlList: [parsedURL] })\n\n // 5. Set fallbackMode to \"cors\".\n fallbackMode = 'cors'\n } else {\n // 6. Otherwise:\n\n // 7. Assert: input is a Request object.\n assert(input instanceof Request)\n\n // 8. Set request to input’s request.\n request = input[kState]\n\n // 9. Set signal to input’s signal.\n signal = input[kSignal]\n }\n\n // 7. Let origin be this’s relevant settings object’s origin.\n const origin = this[kRealm].settingsObject.origin\n\n // 8. Let window be \"client\".\n let window = 'client'\n\n // 9. If request’s window is an environment settings object and its origin\n // is same origin with origin, then set window to request’s window.\n if (\n request.window?.constructor?.name === 'EnvironmentSettingsObject' &&\n sameOrigin(request.window, origin)\n ) {\n window = request.window\n }\n\n // 10. If init[\"window\"] exists and is non-null, then throw a TypeError.\n if (init.window != null) {\n throw new TypeError(`'window' option '${window}' must be null`)\n }\n\n // 11. If init[\"window\"] exists, then set window to \"no-window\".\n if ('window' in init) {\n window = 'no-window'\n }\n\n // 12. Set request to a new request with the following properties:\n request = makeRequest({\n // URL request’s URL.\n // undici implementation note: this is set as the first item in request's urlList in makeRequest\n // method request’s method.\n method: request.method,\n // header list A copy of request’s header list.\n // undici implementation note: headersList is cloned in makeRequest\n headersList: request.headersList,\n // unsafe-request flag Set.\n unsafeRequest: request.unsafeRequest,\n // client This’s relevant settings object.\n client: this[kRealm].settingsObject,\n // window window.\n window,\n // priority request’s priority.\n priority: request.priority,\n // origin request’s origin. The propagation of the origin is only significant for navigation requests\n // being handled by a service worker. In this scenario a request can have an origin that is different\n // from the current client.\n origin: request.origin,\n // referrer request’s referrer.\n referrer: request.referrer,\n // referrer policy request’s referrer policy.\n referrerPolicy: request.referrerPolicy,\n // mode request’s mode.\n mode: request.mode,\n // credentials mode request’s credentials mode.\n credentials: request.credentials,\n // cache mode request’s cache mode.\n cache: request.cache,\n // redirect mode request’s redirect mode.\n redirect: request.redirect,\n // integrity metadata request’s integrity metadata.\n integrity: request.integrity,\n // keepalive request’s keepalive.\n keepalive: request.keepalive,\n // reload-navigation flag request’s reload-navigation flag.\n reloadNavigation: request.reloadNavigation,\n // history-navigation flag request’s history-navigation flag.\n historyNavigation: request.historyNavigation,\n // URL list A clone of request’s URL list.\n urlList: [...request.urlList]\n })\n\n // 13. If init is not empty, then:\n if (Object.keys(init).length > 0) {\n // 1. If request’s mode is \"navigate\", then set it to \"same-origin\".\n if (request.mode === 'navigate') {\n request.mode = 'same-origin'\n }\n\n // 2. Unset request’s reload-navigation flag.\n request.reloadNavigation = false\n\n // 3. Unset request’s history-navigation flag.\n request.historyNavigation = false\n\n // 4. Set request’s origin to \"client\".\n request.origin = 'client'\n\n // 5. Set request’s referrer to \"client\"\n request.referrer = 'client'\n\n // 6. Set request’s referrer policy to the empty string.\n request.referrerPolicy = ''\n\n // 7. Set request’s URL to request’s current URL.\n request.url = request.urlList[request.urlList.length - 1]\n\n // 8. Set request’s URL list to « request’s URL ».\n request.urlList = [request.url]\n }\n\n // 14. If init[\"referrer\"] exists, then:\n if (init.referrer !== undefined) {\n // 1. Let referrer be init[\"referrer\"].\n const referrer = init.referrer\n\n // 2. If referrer is the empty string, then set request’s referrer to \"no-referrer\".\n if (referrer === '') {\n request.referrer = 'no-referrer'\n } else {\n // 1. Let parsedReferrer be the result of parsing referrer with\n // baseURL.\n // 2. If parsedReferrer is failure, then throw a TypeError.\n let parsedReferrer\n try {\n parsedReferrer = new URL(referrer, baseUrl)\n } catch (err) {\n throw new TypeError(`Referrer \"${referrer}\" is not a valid URL.`, { cause: err })\n }\n\n // 3. If one of the following is true\n // - parsedReferrer’s scheme is \"about\" and path is the string \"client\"\n // - parsedReferrer’s origin is not same origin with origin\n // then set request’s referrer to \"client\".\n if (\n (parsedReferrer.protocol === 'about:' && parsedReferrer.hostname === 'client') ||\n (origin && !sameOrigin(parsedReferrer, this[kRealm].settingsObject.baseUrl))\n ) {\n request.referrer = 'client'\n } else {\n // 4. Otherwise, set request’s referrer to parsedReferrer.\n request.referrer = parsedReferrer\n }\n }\n }\n\n // 15. If init[\"referrerPolicy\"] exists, then set request’s referrer policy\n // to it.\n if (init.referrerPolicy !== undefined) {\n request.referrerPolicy = init.referrerPolicy\n }\n\n // 16. Let mode be init[\"mode\"] if it exists, and fallbackMode otherwise.\n let mode\n if (init.mode !== undefined) {\n mode = init.mode\n } else {\n mode = fallbackMode\n }\n\n // 17. If mode is \"navigate\", then throw a TypeError.\n if (mode === 'navigate') {\n throw webidl.errors.exception({\n header: 'Request constructor',\n message: 'invalid request mode navigate.'\n })\n }\n\n // 18. If mode is non-null, set request’s mode to mode.\n if (mode != null) {\n request.mode = mode\n }\n\n // 19. If init[\"credentials\"] exists, then set request’s credentials mode\n // to it.\n if (init.credentials !== undefined) {\n request.credentials = init.credentials\n }\n\n // 18. If init[\"cache\"] exists, then set request’s cache mode to it.\n if (init.cache !== undefined) {\n request.cache = init.cache\n }\n\n // 21. If request’s cache mode is \"only-if-cached\" and request’s mode is\n // not \"same-origin\", then throw a TypeError.\n if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') {\n throw new TypeError(\n \"'only-if-cached' can be set only with 'same-origin' mode\"\n )\n }\n\n // 22. If init[\"redirect\"] exists, then set request’s redirect mode to it.\n if (init.redirect !== undefined) {\n request.redirect = init.redirect\n }\n\n // 23. If init[\"integrity\"] exists, then set request’s integrity metadata to it.\n if (init.integrity !== undefined && init.integrity != null) {\n request.integrity = String(init.integrity)\n }\n\n // 24. If init[\"keepalive\"] exists, then set request’s keepalive to it.\n if (init.keepalive !== undefined) {\n request.keepalive = Boolean(init.keepalive)\n }\n\n // 25. If init[\"method\"] exists, then:\n if (init.method !== undefined) {\n // 1. Let method be init[\"method\"].\n let method = init.method\n\n // 2. If method is not a method or method is a forbidden method, then\n // throw a TypeError.\n if (!isValidHTTPToken(init.method)) {\n throw TypeError(`'${init.method}' is not a valid HTTP method.`)\n }\n\n if (forbiddenMethodsSet.has(method.toUpperCase())) {\n throw TypeError(`'${init.method}' HTTP method is unsupported.`)\n }\n\n // 3. Normalize method.\n method = normalizeMethod(init.method)\n\n // 4. Set request’s method to method.\n request.method = method\n }\n\n // 26. If init[\"signal\"] exists, then set signal to it.\n if (init.signal !== undefined) {\n signal = init.signal\n }\n\n // 27. Set this’s request to request.\n this[kState] = request\n\n // 28. Set this’s signal to a new AbortSignal object with this’s relevant\n // Realm.\n // TODO: could this be simplified with AbortSignal.any\n // (https://dom.spec.whatwg.org/#dom-abortsignal-any)\n const ac = new AbortController()\n this[kSignal] = ac.signal\n this[kSignal][kRealm] = this[kRealm]\n\n // 29. If signal is not null, then make this’s signal follow signal.\n if (signal != null) {\n if (\n !signal ||\n typeof signal.aborted !== 'boolean' ||\n typeof signal.addEventListener !== 'function'\n ) {\n throw new TypeError(\n \"Failed to construct 'Request': member signal is not of type AbortSignal.\"\n )\n }\n\n if (signal.aborted) {\n ac.abort(signal.reason)\n } else {\n // Keep a strong ref to ac while request object\n // is alive. This is needed to prevent AbortController\n // from being prematurely garbage collected.\n // See, https://github.com/nodejs/undici/issues/1926.\n this[kAbortController] = ac\n\n const acRef = new WeakRef(ac)\n const abort = function () {\n const ac = acRef.deref()\n if (ac !== undefined) {\n ac.abort(this.reason)\n }\n }\n\n // Third-party AbortControllers may not work with these.\n // See, https://github.com/nodejs/undici/pull/1910#issuecomment-1464495619.\n try {\n // If the max amount of listeners is equal to the default, increase it\n // This is only available in node >= v19.9.0\n if (typeof getMaxListeners === 'function' && getMaxListeners(signal) === defaultMaxListeners) {\n setMaxListeners(100, signal)\n } else if (getEventListeners(signal, 'abort').length >= defaultMaxListeners) {\n setMaxListeners(100, signal)\n }\n } catch {}\n\n util.addAbortListener(signal, abort)\n requestFinalizer.register(ac, { signal, abort })\n }\n }\n\n // 30. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is request’s header list and guard is\n // \"request\".\n this[kHeaders] = new Headers()\n this[kHeaders][kHeadersList] = request.headersList\n this[kHeaders][kGuard] = 'request'\n this[kHeaders][kRealm] = this[kRealm]\n\n // 31. If this’s request’s mode is \"no-cors\", then:\n if (mode === 'no-cors') {\n // 1. If this’s request’s method is not a CORS-safelisted method,\n // then throw a TypeError.\n if (!corsSafeListedMethodsSet.has(request.method)) {\n throw new TypeError(\n `'${request.method} is unsupported in no-cors mode.`\n )\n }\n\n // 2. Set this’s headers’s guard to \"request-no-cors\".\n this[kHeaders][kGuard] = 'request-no-cors'\n }\n\n // 32. If init is not empty, then:\n if (Object.keys(init).length !== 0) {\n // 1. Let headers be a copy of this’s headers and its associated header\n // list.\n let headers = new Headers(this[kHeaders])\n\n // 2. If init[\"headers\"] exists, then set headers to init[\"headers\"].\n if (init.headers !== undefined) {\n headers = init.headers\n }\n\n // 3. Empty this’s headers’s header list.\n this[kHeaders][kHeadersList].clear()\n\n // 4. If headers is a Headers object, then for each header in its header\n // list, append header’s name/header’s value to this’s headers.\n if (headers.constructor.name === 'Headers') {\n for (const [key, val] of headers) {\n this[kHeaders].append(key, val)\n }\n } else {\n // 5. Otherwise, fill this’s headers with headers.\n fillHeaders(this[kHeaders], headers)\n }\n }\n\n // 33. Let inputBody be input’s request’s body if input is a Request\n // object; otherwise null.\n const inputBody = input instanceof Request ? input[kState].body : null\n\n // 34. If either init[\"body\"] exists and is non-null or inputBody is\n // non-null, and request’s method is `GET` or `HEAD`, then throw a\n // TypeError.\n if (\n (init.body != null || inputBody != null) &&\n (request.method === 'GET' || request.method === 'HEAD')\n ) {\n throw new TypeError('Request with GET/HEAD method cannot have body.')\n }\n\n // 35. Let initBody be null.\n let initBody = null\n\n // 36. If init[\"body\"] exists and is non-null, then:\n if (init.body != null) {\n // 1. Let Content-Type be null.\n // 2. Set initBody and Content-Type to the result of extracting\n // init[\"body\"], with keepalive set to request’s keepalive.\n const [extractedBody, contentType] = extractBody(\n init.body,\n request.keepalive\n )\n initBody = extractedBody\n\n // 3, If Content-Type is non-null and this’s headers’s header list does\n // not contain `Content-Type`, then append `Content-Type`/Content-Type to\n // this’s headers.\n if (contentType && !this[kHeaders][kHeadersList].contains('content-type')) {\n this[kHeaders].append('content-type', contentType)\n }\n }\n\n // 37. Let inputOrInitBody be initBody if it is non-null; otherwise\n // inputBody.\n const inputOrInitBody = initBody ?? inputBody\n\n // 38. If inputOrInitBody is non-null and inputOrInitBody’s source is\n // null, then:\n if (inputOrInitBody != null && inputOrInitBody.source == null) {\n // 1. If initBody is non-null and init[\"duplex\"] does not exist,\n // then throw a TypeError.\n if (initBody != null && init.duplex == null) {\n throw new TypeError('RequestInit: duplex option is required when sending a body.')\n }\n\n // 2. If this’s request’s mode is neither \"same-origin\" nor \"cors\",\n // then throw a TypeError.\n if (request.mode !== 'same-origin' && request.mode !== 'cors') {\n throw new TypeError(\n 'If request is made from ReadableStream, mode should be \"same-origin\" or \"cors\"'\n )\n }\n\n // 3. Set this’s request’s use-CORS-preflight flag.\n request.useCORSPreflightFlag = true\n }\n\n // 39. Let finalBody be inputOrInitBody.\n let finalBody = inputOrInitBody\n\n // 40. If initBody is null and inputBody is non-null, then:\n if (initBody == null && inputBody != null) {\n // 1. If input is unusable, then throw a TypeError.\n if (util.isDisturbed(inputBody.stream) || inputBody.stream.locked) {\n throw new TypeError(\n 'Cannot construct a Request with a Request object that has already been used.'\n )\n }\n\n // 2. Set finalBody to the result of creating a proxy for inputBody.\n if (!TransformStream) {\n TransformStream = require('stream/web').TransformStream\n }\n\n // https://streams.spec.whatwg.org/#readablestream-create-a-proxy\n const identityTransform = new TransformStream()\n inputBody.stream.pipeThrough(identityTransform)\n finalBody = {\n source: inputBody.source,\n length: inputBody.length,\n stream: identityTransform.readable\n }\n }\n\n // 41. Set this’s request’s body to finalBody.\n this[kState].body = finalBody\n }\n\n // Returns request’s HTTP method, which is \"GET\" by default.\n get method () {\n webidl.brandCheck(this, Request)\n\n // The method getter steps are to return this’s request’s method.\n return this[kState].method\n }\n\n // Returns the URL of request as a string.\n get url () {\n webidl.brandCheck(this, Request)\n\n // The url getter steps are to return this’s request’s URL, serialized.\n return URLSerializer(this[kState].url)\n }\n\n // Returns a Headers object consisting of the headers associated with request.\n // Note that headers added in the network layer by the user agent will not\n // be accounted for in this object, e.g., the \"Host\" header.\n get headers () {\n webidl.brandCheck(this, Request)\n\n // The headers getter steps are to return this’s headers.\n return this[kHeaders]\n }\n\n // Returns the kind of resource requested by request, e.g., \"document\"\n // or \"script\".\n get destination () {\n webidl.brandCheck(this, Request)\n\n // The destination getter are to return this’s request’s destination.\n return this[kState].destination\n }\n\n // Returns the referrer of request. Its value can be a same-origin URL if\n // explicitly set in init, the empty string to indicate no referrer, and\n // \"about:client\" when defaulting to the global’s default. This is used\n // during fetching to determine the value of the `Referer` header of the\n // request being made.\n get referrer () {\n webidl.brandCheck(this, Request)\n\n // 1. If this’s request’s referrer is \"no-referrer\", then return the\n // empty string.\n if (this[kState].referrer === 'no-referrer') {\n return ''\n }\n\n // 2. If this’s request’s referrer is \"client\", then return\n // \"about:client\".\n if (this[kState].referrer === 'client') {\n return 'about:client'\n }\n\n // Return this’s request’s referrer, serialized.\n return this[kState].referrer.toString()\n }\n\n // Returns the referrer policy associated with request.\n // This is used during fetching to compute the value of the request’s\n // referrer.\n get referrerPolicy () {\n webidl.brandCheck(this, Request)\n\n // The referrerPolicy getter steps are to return this’s request’s referrer policy.\n return this[kState].referrerPolicy\n }\n\n // Returns the mode associated with request, which is a string indicating\n // whether the request will use CORS, or will be restricted to same-origin\n // URLs.\n get mode () {\n webidl.brandCheck(this, Request)\n\n // The mode getter steps are to return this’s request’s mode.\n return this[kState].mode\n }\n\n // Returns the credentials mode associated with request,\n // which is a string indicating whether credentials will be sent with the\n // request always, never, or only when sent to a same-origin URL.\n get credentials () {\n // The credentials getter steps are to return this’s request’s credentials mode.\n return this[kState].credentials\n }\n\n // Returns the cache mode associated with request,\n // which is a string indicating how the request will\n // interact with the browser’s cache when fetching.\n get cache () {\n webidl.brandCheck(this, Request)\n\n // The cache getter steps are to return this’s request’s cache mode.\n return this[kState].cache\n }\n\n // Returns the redirect mode associated with request,\n // which is a string indicating how redirects for the\n // request will be handled during fetching. A request\n // will follow redirects by default.\n get redirect () {\n webidl.brandCheck(this, Request)\n\n // The redirect getter steps are to return this’s request’s redirect mode.\n return this[kState].redirect\n }\n\n // Returns request’s subresource integrity metadata, which is a\n // cryptographic hash of the resource being fetched. Its value\n // consists of multiple hashes separated by whitespace. [SRI]\n get integrity () {\n webidl.brandCheck(this, Request)\n\n // The integrity getter steps are to return this’s request’s integrity\n // metadata.\n return this[kState].integrity\n }\n\n // Returns a boolean indicating whether or not request can outlive the\n // global in which it was created.\n get keepalive () {\n webidl.brandCheck(this, Request)\n\n // The keepalive getter steps are to return this’s request’s keepalive.\n return this[kState].keepalive\n }\n\n // Returns a boolean indicating whether or not request is for a reload\n // navigation.\n get isReloadNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isReloadNavigation getter steps are to return true if this’s\n // request’s reload-navigation flag is set; otherwise false.\n return this[kState].reloadNavigation\n }\n\n // Returns a boolean indicating whether or not request is for a history\n // navigation (a.k.a. back-foward navigation).\n get isHistoryNavigation () {\n webidl.brandCheck(this, Request)\n\n // The isHistoryNavigation getter steps are to return true if this’s request’s\n // history-navigation flag is set; otherwise false.\n return this[kState].historyNavigation\n }\n\n // Returns the signal associated with request, which is an AbortSignal\n // object indicating whether or not request has been aborted, and its\n // abort event handler.\n get signal () {\n webidl.brandCheck(this, Request)\n\n // The signal getter steps are to return this’s signal.\n return this[kSignal]\n }\n\n get body () {\n webidl.brandCheck(this, Request)\n\n return this[kState].body ? this[kState].body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Request)\n\n return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n }\n\n get duplex () {\n webidl.brandCheck(this, Request)\n\n return 'half'\n }\n\n // Returns a clone of request.\n clone () {\n webidl.brandCheck(this, Request)\n\n // 1. If this is unusable, then throw a TypeError.\n if (this.bodyUsed || this.body?.locked) {\n throw new TypeError('unusable')\n }\n\n // 2. Let clonedRequest be the result of cloning this’s request.\n const clonedRequest = cloneRequest(this[kState])\n\n // 3. Let clonedRequestObject be the result of creating a Request object,\n // given clonedRequest, this’s headers’s guard, and this’s relevant Realm.\n const clonedRequestObject = new Request(kInit)\n clonedRequestObject[kState] = clonedRequest\n clonedRequestObject[kRealm] = this[kRealm]\n clonedRequestObject[kHeaders] = new Headers()\n clonedRequestObject[kHeaders][kHeadersList] = clonedRequest.headersList\n clonedRequestObject[kHeaders][kGuard] = this[kHeaders][kGuard]\n clonedRequestObject[kHeaders][kRealm] = this[kHeaders][kRealm]\n\n // 4. Make clonedRequestObject’s signal follow this’s signal.\n const ac = new AbortController()\n if (this.signal.aborted) {\n ac.abort(this.signal.reason)\n } else {\n util.addAbortListener(\n this.signal,\n () => {\n ac.abort(this.signal.reason)\n }\n )\n }\n clonedRequestObject[kSignal] = ac.signal\n\n // 4. Return clonedRequestObject.\n return clonedRequestObject\n }\n}\n\nmixinBody(Request)\n\nfunction makeRequest (init) {\n // https://fetch.spec.whatwg.org/#requests\n const request = {\n method: 'GET',\n localURLsOnly: false,\n unsafeRequest: false,\n body: null,\n client: null,\n reservedClient: null,\n replacesClientId: '',\n window: 'client',\n keepalive: false,\n serviceWorkers: 'all',\n initiator: '',\n destination: '',\n priority: null,\n origin: 'client',\n policyContainer: 'client',\n referrer: 'client',\n referrerPolicy: '',\n mode: 'no-cors',\n useCORSPreflightFlag: false,\n credentials: 'same-origin',\n useCredentials: false,\n cache: 'default',\n redirect: 'follow',\n integrity: '',\n cryptoGraphicsNonceMetadata: '',\n parserMetadata: '',\n reloadNavigation: false,\n historyNavigation: false,\n userActivation: false,\n taintedOrigin: false,\n redirectCount: 0,\n responseTainting: 'basic',\n preventNoCacheCacheControlHeaderModification: false,\n done: false,\n timingAllowFailed: false,\n ...init,\n headersList: init.headersList\n ? new HeadersList(init.headersList)\n : new HeadersList()\n }\n request.url = request.urlList[0]\n return request\n}\n\n// https://fetch.spec.whatwg.org/#concept-request-clone\nfunction cloneRequest (request) {\n // To clone a request request, run these steps:\n\n // 1. Let newRequest be a copy of request, except for its body.\n const newRequest = makeRequest({ ...request, body: null })\n\n // 2. If request’s body is non-null, set newRequest’s body to the\n // result of cloning request’s body.\n if (request.body != null) {\n newRequest.body = cloneBody(request.body)\n }\n\n // 3. Return newRequest.\n return newRequest\n}\n\nObject.defineProperties(Request.prototype, {\n method: kEnumerableProperty,\n url: kEnumerableProperty,\n headers: kEnumerableProperty,\n redirect: kEnumerableProperty,\n clone: kEnumerableProperty,\n signal: kEnumerableProperty,\n duplex: kEnumerableProperty,\n destination: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n isHistoryNavigation: kEnumerableProperty,\n isReloadNavigation: kEnumerableProperty,\n keepalive: kEnumerableProperty,\n integrity: kEnumerableProperty,\n cache: kEnumerableProperty,\n credentials: kEnumerableProperty,\n attribute: kEnumerableProperty,\n referrerPolicy: kEnumerableProperty,\n referrer: kEnumerableProperty,\n mode: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Request',\n configurable: true\n }\n})\n\nwebidl.converters.Request = webidl.interfaceConverter(\n Request\n)\n\n// https://fetch.spec.whatwg.org/#requestinfo\nwebidl.converters.RequestInfo = function (V) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V)\n }\n\n if (V instanceof Request) {\n return webidl.converters.Request(V)\n }\n\n return webidl.converters.USVString(V)\n}\n\nwebidl.converters.AbortSignal = webidl.interfaceConverter(\n AbortSignal\n)\n\n// https://fetch.spec.whatwg.org/#requestinit\nwebidl.converters.RequestInit = webidl.dictionaryConverter([\n {\n key: 'method',\n converter: webidl.converters.ByteString\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n },\n {\n key: 'body',\n converter: webidl.nullableConverter(\n webidl.converters.BodyInit\n )\n },\n {\n key: 'referrer',\n converter: webidl.converters.USVString\n },\n {\n key: 'referrerPolicy',\n converter: webidl.converters.DOMString,\n // https://w3c.github.io/webappsec-referrer-policy/#referrer-policy\n allowedValues: referrerPolicy\n },\n {\n key: 'mode',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#concept-request-mode\n allowedValues: requestMode\n },\n {\n key: 'credentials',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcredentials\n allowedValues: requestCredentials\n },\n {\n key: 'cache',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestcache\n allowedValues: requestCache\n },\n {\n key: 'redirect',\n converter: webidl.converters.DOMString,\n // https://fetch.spec.whatwg.org/#requestredirect\n allowedValues: requestRedirect\n },\n {\n key: 'integrity',\n converter: webidl.converters.DOMString\n },\n {\n key: 'keepalive',\n converter: webidl.converters.boolean\n },\n {\n key: 'signal',\n converter: webidl.nullableConverter(\n (signal) => webidl.converters.AbortSignal(\n signal,\n { strict: false }\n )\n )\n },\n {\n key: 'window',\n converter: webidl.converters.any\n },\n {\n key: 'duplex',\n converter: webidl.converters.DOMString,\n allowedValues: requestDuplex\n }\n])\n\nmodule.exports = { Request, makeRequest }\n","'use strict'\n\nconst { Headers, HeadersList, fill } = require('./headers')\nconst { extractBody, cloneBody, mixinBody } = require('./body')\nconst util = require('../core/util')\nconst { kEnumerableProperty } = util\nconst {\n isValidReasonPhrase,\n isCancelled,\n isAborted,\n isBlobLike,\n serializeJavascriptValueToJSONString,\n isErrorLike,\n isomorphicEncode\n} = require('./util')\nconst {\n redirectStatusSet,\n nullBodyStatus,\n DOMException\n} = require('./constants')\nconst { kState, kHeaders, kGuard, kRealm } = require('./symbols')\nconst { webidl } = require('./webidl')\nconst { FormData } = require('./formdata')\nconst { getGlobalOrigin } = require('./global')\nconst { URLSerializer } = require('./dataURL')\nconst { kHeadersList } = require('../core/symbols')\nconst assert = require('assert')\nconst { types } = require('util')\n\nconst ReadableStream = globalThis.ReadableStream || require('stream/web').ReadableStream\nconst textEncoder = new TextEncoder('utf-8')\n\n// https://fetch.spec.whatwg.org/#response-class\nclass Response {\n // Creates network error Response.\n static error () {\n // TODO\n const relevantRealm = { settingsObject: {} }\n\n // The static error() method steps are to return the result of creating a\n // Response object, given a new network error, \"immutable\", and this’s\n // relevant Realm.\n const responseObject = new Response()\n responseObject[kState] = makeNetworkError()\n responseObject[kRealm] = relevantRealm\n responseObject[kHeaders][kHeadersList] = responseObject[kState].headersList\n responseObject[kHeaders][kGuard] = 'immutable'\n responseObject[kHeaders][kRealm] = relevantRealm\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response-json\n static json (data, init = {}) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'Response.json' })\n\n if (init !== null) {\n init = webidl.converters.ResponseInit(init)\n }\n\n // 1. Let bytes the result of running serialize a JavaScript value to JSON bytes on data.\n const bytes = textEncoder.encode(\n serializeJavascriptValueToJSONString(data)\n )\n\n // 2. Let body be the result of extracting bytes.\n const body = extractBody(bytes)\n\n // 3. Let responseObject be the result of creating a Response object, given a new response,\n // \"response\", and this’s relevant Realm.\n const relevantRealm = { settingsObject: {} }\n const responseObject = new Response()\n responseObject[kRealm] = relevantRealm\n responseObject[kHeaders][kGuard] = 'response'\n responseObject[kHeaders][kRealm] = relevantRealm\n\n // 4. Perform initialize a response given responseObject, init, and (body, \"application/json\").\n initializeResponse(responseObject, init, { body: body[0], type: 'application/json' })\n\n // 5. Return responseObject.\n return responseObject\n }\n\n // Creates a redirect Response that redirects to url with status status.\n static redirect (url, status = 302) {\n const relevantRealm = { settingsObject: {} }\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'Response.redirect' })\n\n url = webidl.converters.USVString(url)\n status = webidl.converters['unsigned short'](status)\n\n // 1. Let parsedURL be the result of parsing url with current settings\n // object’s API base URL.\n // 2. If parsedURL is failure, then throw a TypeError.\n // TODO: base-URL?\n let parsedURL\n try {\n parsedURL = new URL(url, getGlobalOrigin())\n } catch (err) {\n throw Object.assign(new TypeError('Failed to parse URL from ' + url), {\n cause: err\n })\n }\n\n // 3. If status is not a redirect status, then throw a RangeError.\n if (!redirectStatusSet.has(status)) {\n throw new RangeError('Invalid status code ' + status)\n }\n\n // 4. Let responseObject be the result of creating a Response object,\n // given a new response, \"immutable\", and this’s relevant Realm.\n const responseObject = new Response()\n responseObject[kRealm] = relevantRealm\n responseObject[kHeaders][kGuard] = 'immutable'\n responseObject[kHeaders][kRealm] = relevantRealm\n\n // 5. Set responseObject’s response’s status to status.\n responseObject[kState].status = status\n\n // 6. Let value be parsedURL, serialized and isomorphic encoded.\n const value = isomorphicEncode(URLSerializer(parsedURL))\n\n // 7. Append `Location`/value to responseObject’s response’s header list.\n responseObject[kState].headersList.append('location', value)\n\n // 8. Return responseObject.\n return responseObject\n }\n\n // https://fetch.spec.whatwg.org/#dom-response\n constructor (body = null, init = {}) {\n if (body !== null) {\n body = webidl.converters.BodyInit(body)\n }\n\n init = webidl.converters.ResponseInit(init)\n\n // TODO\n this[kRealm] = { settingsObject: {} }\n\n // 1. Set this’s response to a new response.\n this[kState] = makeResponse({})\n\n // 2. Set this’s headers to a new Headers object with this’s relevant\n // Realm, whose header list is this’s response’s header list and guard\n // is \"response\".\n this[kHeaders] = new Headers()\n this[kHeaders][kGuard] = 'response'\n this[kHeaders][kHeadersList] = this[kState].headersList\n this[kHeaders][kRealm] = this[kRealm]\n\n // 3. Let bodyWithType be null.\n let bodyWithType = null\n\n // 4. If body is non-null, then set bodyWithType to the result of extracting body.\n if (body != null) {\n const [extractedBody, type] = extractBody(body)\n bodyWithType = { body: extractedBody, type }\n }\n\n // 5. Perform initialize a response given this, init, and bodyWithType.\n initializeResponse(this, init, bodyWithType)\n }\n\n // Returns response’s type, e.g., \"cors\".\n get type () {\n webidl.brandCheck(this, Response)\n\n // The type getter steps are to return this’s response’s type.\n return this[kState].type\n }\n\n // Returns response’s URL, if it has one; otherwise the empty string.\n get url () {\n webidl.brandCheck(this, Response)\n\n const urlList = this[kState].urlList\n\n // The url getter steps are to return the empty string if this’s\n // response’s URL is null; otherwise this’s response’s URL,\n // serialized with exclude fragment set to true.\n const url = urlList[urlList.length - 1] ?? null\n\n if (url === null) {\n return ''\n }\n\n return URLSerializer(url, true)\n }\n\n // Returns whether response was obtained through a redirect.\n get redirected () {\n webidl.brandCheck(this, Response)\n\n // The redirected getter steps are to return true if this’s response’s URL\n // list has more than one item; otherwise false.\n return this[kState].urlList.length > 1\n }\n\n // Returns response’s status.\n get status () {\n webidl.brandCheck(this, Response)\n\n // The status getter steps are to return this’s response’s status.\n return this[kState].status\n }\n\n // Returns whether response’s status is an ok status.\n get ok () {\n webidl.brandCheck(this, Response)\n\n // The ok getter steps are to return true if this’s response’s status is an\n // ok status; otherwise false.\n return this[kState].status >= 200 && this[kState].status <= 299\n }\n\n // Returns response’s status message.\n get statusText () {\n webidl.brandCheck(this, Response)\n\n // The statusText getter steps are to return this’s response’s status\n // message.\n return this[kState].statusText\n }\n\n // Returns response’s headers as Headers.\n get headers () {\n webidl.brandCheck(this, Response)\n\n // The headers getter steps are to return this’s headers.\n return this[kHeaders]\n }\n\n get body () {\n webidl.brandCheck(this, Response)\n\n return this[kState].body ? this[kState].body.stream : null\n }\n\n get bodyUsed () {\n webidl.brandCheck(this, Response)\n\n return !!this[kState].body && util.isDisturbed(this[kState].body.stream)\n }\n\n // Returns a clone of response.\n clone () {\n webidl.brandCheck(this, Response)\n\n // 1. If this is unusable, then throw a TypeError.\n if (this.bodyUsed || (this.body && this.body.locked)) {\n throw webidl.errors.exception({\n header: 'Response.clone',\n message: 'Body has already been consumed.'\n })\n }\n\n // 2. Let clonedResponse be the result of cloning this’s response.\n const clonedResponse = cloneResponse(this[kState])\n\n // 3. Return the result of creating a Response object, given\n // clonedResponse, this’s headers’s guard, and this’s relevant Realm.\n const clonedResponseObject = new Response()\n clonedResponseObject[kState] = clonedResponse\n clonedResponseObject[kRealm] = this[kRealm]\n clonedResponseObject[kHeaders][kHeadersList] = clonedResponse.headersList\n clonedResponseObject[kHeaders][kGuard] = this[kHeaders][kGuard]\n clonedResponseObject[kHeaders][kRealm] = this[kHeaders][kRealm]\n\n return clonedResponseObject\n }\n}\n\nmixinBody(Response)\n\nObject.defineProperties(Response.prototype, {\n type: kEnumerableProperty,\n url: kEnumerableProperty,\n status: kEnumerableProperty,\n ok: kEnumerableProperty,\n redirected: kEnumerableProperty,\n statusText: kEnumerableProperty,\n headers: kEnumerableProperty,\n clone: kEnumerableProperty,\n body: kEnumerableProperty,\n bodyUsed: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'Response',\n configurable: true\n }\n})\n\nObject.defineProperties(Response, {\n json: kEnumerableProperty,\n redirect: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\n// https://fetch.spec.whatwg.org/#concept-response-clone\nfunction cloneResponse (response) {\n // To clone a response response, run these steps:\n\n // 1. If response is a filtered response, then return a new identical\n // filtered response whose internal response is a clone of response’s\n // internal response.\n if (response.internalResponse) {\n return filterResponse(\n cloneResponse(response.internalResponse),\n response.type\n )\n }\n\n // 2. Let newResponse be a copy of response, except for its body.\n const newResponse = makeResponse({ ...response, body: null })\n\n // 3. If response’s body is non-null, then set newResponse’s body to the\n // result of cloning response’s body.\n if (response.body != null) {\n newResponse.body = cloneBody(response.body)\n }\n\n // 4. Return newResponse.\n return newResponse\n}\n\nfunction makeResponse (init) {\n return {\n aborted: false,\n rangeRequested: false,\n timingAllowPassed: false,\n requestIncludesCredentials: false,\n type: 'default',\n status: 200,\n timingInfo: null,\n cacheState: '',\n statusText: '',\n ...init,\n headersList: init.headersList\n ? new HeadersList(init.headersList)\n : new HeadersList(),\n urlList: init.urlList ? [...init.urlList] : []\n }\n}\n\nfunction makeNetworkError (reason) {\n const isError = isErrorLike(reason)\n return makeResponse({\n type: 'error',\n status: 0,\n error: isError\n ? reason\n : new Error(reason ? String(reason) : reason),\n aborted: reason && reason.name === 'AbortError'\n })\n}\n\nfunction makeFilteredResponse (response, state) {\n state = {\n internalResponse: response,\n ...state\n }\n\n return new Proxy(response, {\n get (target, p) {\n return p in state ? state[p] : target[p]\n },\n set (target, p, value) {\n assert(!(p in state))\n target[p] = value\n return true\n }\n })\n}\n\n// https://fetch.spec.whatwg.org/#concept-filtered-response\nfunction filterResponse (response, type) {\n // Set response to the following filtered response with response as its\n // internal response, depending on request’s response tainting:\n if (type === 'basic') {\n // A basic filtered response is a filtered response whose type is \"basic\"\n // and header list excludes any headers in internal response’s header list\n // whose name is a forbidden response-header name.\n\n // Note: undici does not implement forbidden response-header names\n return makeFilteredResponse(response, {\n type: 'basic',\n headersList: response.headersList\n })\n } else if (type === 'cors') {\n // A CORS filtered response is a filtered response whose type is \"cors\"\n // and header list excludes any headers in internal response’s header\n // list whose name is not a CORS-safelisted response-header name, given\n // internal response’s CORS-exposed header-name list.\n\n // Note: undici does not implement CORS-safelisted response-header names\n return makeFilteredResponse(response, {\n type: 'cors',\n headersList: response.headersList\n })\n } else if (type === 'opaque') {\n // An opaque filtered response is a filtered response whose type is\n // \"opaque\", URL list is the empty list, status is 0, status message\n // is the empty byte sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaque',\n urlList: Object.freeze([]),\n status: 0,\n statusText: '',\n body: null\n })\n } else if (type === 'opaqueredirect') {\n // An opaque-redirect filtered response is a filtered response whose type\n // is \"opaqueredirect\", status is 0, status message is the empty byte\n // sequence, header list is empty, and body is null.\n\n return makeFilteredResponse(response, {\n type: 'opaqueredirect',\n status: 0,\n statusText: '',\n headersList: [],\n body: null\n })\n } else {\n assert(false)\n }\n}\n\n// https://fetch.spec.whatwg.org/#appropriate-network-error\nfunction makeAppropriateNetworkError (fetchParams, err = null) {\n // 1. Assert: fetchParams is canceled.\n assert(isCancelled(fetchParams))\n\n // 2. Return an aborted network error if fetchParams is aborted;\n // otherwise return a network error.\n return isAborted(fetchParams)\n ? makeNetworkError(Object.assign(new DOMException('The operation was aborted.', 'AbortError'), { cause: err }))\n : makeNetworkError(Object.assign(new DOMException('Request was cancelled.'), { cause: err }))\n}\n\n// https://whatpr.org/fetch/1392.html#initialize-a-response\nfunction initializeResponse (response, init, body) {\n // 1. If init[\"status\"] is not in the range 200 to 599, inclusive, then\n // throw a RangeError.\n if (init.status !== null && (init.status < 200 || init.status > 599)) {\n throw new RangeError('init[\"status\"] must be in the range of 200 to 599, inclusive.')\n }\n\n // 2. If init[\"statusText\"] does not match the reason-phrase token production,\n // then throw a TypeError.\n if ('statusText' in init && init.statusText != null) {\n // See, https://datatracker.ietf.org/doc/html/rfc7230#section-3.1.2:\n // reason-phrase = *( HTAB / SP / VCHAR / obs-text )\n if (!isValidReasonPhrase(String(init.statusText))) {\n throw new TypeError('Invalid statusText')\n }\n }\n\n // 3. Set response’s response’s status to init[\"status\"].\n if ('status' in init && init.status != null) {\n response[kState].status = init.status\n }\n\n // 4. Set response’s response’s status message to init[\"statusText\"].\n if ('statusText' in init && init.statusText != null) {\n response[kState].statusText = init.statusText\n }\n\n // 5. If init[\"headers\"] exists, then fill response’s headers with init[\"headers\"].\n if ('headers' in init && init.headers != null) {\n fill(response[kHeaders], init.headers)\n }\n\n // 6. If body was given, then:\n if (body) {\n // 1. If response's status is a null body status, then throw a TypeError.\n if (nullBodyStatus.includes(response.status)) {\n throw webidl.errors.exception({\n header: 'Response constructor',\n message: 'Invalid response status code ' + response.status\n })\n }\n\n // 2. Set response's body to body's body.\n response[kState].body = body.body\n\n // 3. If body's type is non-null and response's header list does not contain\n // `Content-Type`, then append (`Content-Type`, body's type) to response's header list.\n if (body.type != null && !response[kState].headersList.contains('Content-Type')) {\n response[kState].headersList.append('content-type', body.type)\n }\n }\n}\n\nwebidl.converters.ReadableStream = webidl.interfaceConverter(\n ReadableStream\n)\n\nwebidl.converters.FormData = webidl.interfaceConverter(\n FormData\n)\n\nwebidl.converters.URLSearchParams = webidl.interfaceConverter(\n URLSearchParams\n)\n\n// https://fetch.spec.whatwg.org/#typedefdef-xmlhttprequestbodyinit\nwebidl.converters.XMLHttpRequestBodyInit = function (V) {\n if (typeof V === 'string') {\n return webidl.converters.USVString(V)\n }\n\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, { strict: false })\n }\n\n if (\n types.isAnyArrayBuffer(V) ||\n types.isTypedArray(V) ||\n types.isDataView(V)\n ) {\n return webidl.converters.BufferSource(V)\n }\n\n if (util.isFormDataLike(V)) {\n return webidl.converters.FormData(V, { strict: false })\n }\n\n if (V instanceof URLSearchParams) {\n return webidl.converters.URLSearchParams(V)\n }\n\n return webidl.converters.DOMString(V)\n}\n\n// https://fetch.spec.whatwg.org/#bodyinit\nwebidl.converters.BodyInit = function (V) {\n if (V instanceof ReadableStream) {\n return webidl.converters.ReadableStream(V)\n }\n\n // Note: the spec doesn't include async iterables,\n // this is an undici extension.\n if (V?.[Symbol.asyncIterator]) {\n return V\n }\n\n return webidl.converters.XMLHttpRequestBodyInit(V)\n}\n\nwebidl.converters.ResponseInit = webidl.dictionaryConverter([\n {\n key: 'status',\n converter: webidl.converters['unsigned short'],\n defaultValue: 200\n },\n {\n key: 'statusText',\n converter: webidl.converters.ByteString,\n defaultValue: ''\n },\n {\n key: 'headers',\n converter: webidl.converters.HeadersInit\n }\n])\n\nmodule.exports = {\n makeNetworkError,\n makeResponse,\n makeAppropriateNetworkError,\n filterResponse,\n Response,\n cloneResponse\n}\n","'use strict'\n\nmodule.exports = {\n kUrl: Symbol('url'),\n kHeaders: Symbol('headers'),\n kSignal: Symbol('signal'),\n kState: Symbol('state'),\n kGuard: Symbol('guard'),\n kRealm: Symbol('realm')\n}\n","'use strict'\n\nconst { redirectStatusSet, referrerPolicySet: referrerPolicyTokens, badPortsSet } = require('./constants')\nconst { getGlobalOrigin } = require('./global')\nconst { performance } = require('perf_hooks')\nconst { isBlobLike, toUSVString, ReadableStreamFrom } = require('../core/util')\nconst assert = require('assert')\nconst { isUint8Array } = require('util/types')\n\n// https://nodejs.org/api/crypto.html#determining-if-crypto-support-is-unavailable\n/** @type {import('crypto')|undefined} */\nlet crypto\n\ntry {\n crypto = require('crypto')\n} catch {\n\n}\n\nfunction responseURL (response) {\n // https://fetch.spec.whatwg.org/#responses\n // A response has an associated URL. It is a pointer to the last URL\n // in response’s URL list and null if response’s URL list is empty.\n const urlList = response.urlList\n const length = urlList.length\n return length === 0 ? null : urlList[length - 1].toString()\n}\n\n// https://fetch.spec.whatwg.org/#concept-response-location-url\nfunction responseLocationURL (response, requestFragment) {\n // 1. If response’s status is not a redirect status, then return null.\n if (!redirectStatusSet.has(response.status)) {\n return null\n }\n\n // 2. Let location be the result of extracting header list values given\n // `Location` and response’s header list.\n let location = response.headersList.get('location')\n\n // 3. If location is a header value, then set location to the result of\n // parsing location with response’s URL.\n if (location !== null && isValidHeaderValue(location)) {\n location = new URL(location, responseURL(response))\n }\n\n // 4. If location is a URL whose fragment is null, then set location’s\n // fragment to requestFragment.\n if (location && !location.hash) {\n location.hash = requestFragment\n }\n\n // 5. Return location.\n return location\n}\n\n/** @returns {URL} */\nfunction requestCurrentURL (request) {\n return request.urlList[request.urlList.length - 1]\n}\n\nfunction requestBadPort (request) {\n // 1. Let url be request’s current URL.\n const url = requestCurrentURL(request)\n\n // 2. If url’s scheme is an HTTP(S) scheme and url’s port is a bad port,\n // then return blocked.\n if (urlIsHttpHttpsScheme(url) && badPortsSet.has(url.port)) {\n return 'blocked'\n }\n\n // 3. Return allowed.\n return 'allowed'\n}\n\nfunction isErrorLike (object) {\n return object instanceof Error || (\n object?.constructor?.name === 'Error' ||\n object?.constructor?.name === 'DOMException'\n )\n}\n\n// Check whether |statusText| is a ByteString and\n// matches the Reason-Phrase token production.\n// RFC 2616: https://tools.ietf.org/html/rfc2616\n// RFC 7230: https://tools.ietf.org/html/rfc7230\n// \"reason-phrase = *( HTAB / SP / VCHAR / obs-text )\"\n// https://github.com/chromium/chromium/blob/94.0.4604.1/third_party/blink/renderer/core/fetch/response.cc#L116\nfunction isValidReasonPhrase (statusText) {\n for (let i = 0; i < statusText.length; ++i) {\n const c = statusText.charCodeAt(i)\n if (\n !(\n (\n c === 0x09 || // HTAB\n (c >= 0x20 && c <= 0x7e) || // SP / VCHAR\n (c >= 0x80 && c <= 0xff)\n ) // obs-text\n )\n ) {\n return false\n }\n }\n return true\n}\n\nfunction isTokenChar (c) {\n return !(\n c >= 0x7f ||\n c <= 0x20 ||\n c === '(' ||\n c === ')' ||\n c === '<' ||\n c === '>' ||\n c === '@' ||\n c === ',' ||\n c === ';' ||\n c === ':' ||\n c === '\\\\' ||\n c === '\"' ||\n c === '/' ||\n c === '[' ||\n c === ']' ||\n c === '?' ||\n c === '=' ||\n c === '{' ||\n c === '}'\n )\n}\n\n// See RFC 7230, Section 3.2.6.\n// https://github.com/chromium/chromium/blob/d7da0240cae77824d1eda25745c4022757499131/third_party/blink/renderer/platform/network/http_parsers.cc#L321\nfunction isValidHTTPToken (characters) {\n if (!characters || typeof characters !== 'string') {\n return false\n }\n for (let i = 0; i < characters.length; ++i) {\n const c = characters.charCodeAt(i)\n if (c > 0x7f || !isTokenChar(c)) {\n return false\n }\n }\n return true\n}\n\n// https://fetch.spec.whatwg.org/#header-name\n// https://github.com/chromium/chromium/blob/b3d37e6f94f87d59e44662d6078f6a12de845d17/net/http/http_util.cc#L342\nfunction isValidHeaderName (potentialValue) {\n if (potentialValue.length === 0) {\n return false\n }\n\n return isValidHTTPToken(potentialValue)\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#header-value\n * @param {string} potentialValue\n */\nfunction isValidHeaderValue (potentialValue) {\n // - Has no leading or trailing HTTP tab or space bytes.\n // - Contains no 0x00 (NUL) or HTTP newline bytes.\n if (\n potentialValue.startsWith('\\t') ||\n potentialValue.startsWith(' ') ||\n potentialValue.endsWith('\\t') ||\n potentialValue.endsWith(' ')\n ) {\n return false\n }\n\n if (\n potentialValue.includes('\\0') ||\n potentialValue.includes('\\r') ||\n potentialValue.includes('\\n')\n ) {\n return false\n }\n\n return true\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#set-requests-referrer-policy-on-redirect\nfunction setRequestReferrerPolicyOnRedirect (request, actualResponse) {\n // Given a request request and a response actualResponse, this algorithm\n // updates request’s referrer policy according to the Referrer-Policy\n // header (if any) in actualResponse.\n\n // 1. Let policy be the result of executing § 8.1 Parse a referrer policy\n // from a Referrer-Policy header on actualResponse.\n\n // 8.1 Parse a referrer policy from a Referrer-Policy header\n // 1. Let policy-tokens be the result of extracting header list values given `Referrer-Policy` and response’s header list.\n const { headersList } = actualResponse\n // 2. Let policy be the empty string.\n // 3. For each token in policy-tokens, if token is a referrer policy and token is not the empty string, then set policy to token.\n // 4. Return policy.\n const policyHeader = (headersList.get('referrer-policy') ?? '').split(',')\n\n // Note: As the referrer-policy can contain multiple policies\n // separated by comma, we need to loop through all of them\n // and pick the first valid one.\n // Ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy#specify_a_fallback_policy\n let policy = ''\n if (policyHeader.length > 0) {\n // The right-most policy takes precedence.\n // The left-most policy is the fallback.\n for (let i = policyHeader.length; i !== 0; i--) {\n const token = policyHeader[i - 1].trim()\n if (referrerPolicyTokens.has(token)) {\n policy = token\n break\n }\n }\n }\n\n // 2. If policy is not the empty string, then set request’s referrer policy to policy.\n if (policy !== '') {\n request.referrerPolicy = policy\n }\n}\n\n// https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check\nfunction crossOriginResourcePolicyCheck () {\n // TODO\n return 'allowed'\n}\n\n// https://fetch.spec.whatwg.org/#concept-cors-check\nfunction corsCheck () {\n // TODO\n return 'success'\n}\n\n// https://fetch.spec.whatwg.org/#concept-tao-check\nfunction TAOCheck () {\n // TODO\n return 'success'\n}\n\nfunction appendFetchMetadata (httpRequest) {\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-mode-header\n\n // 1. Assert: r’s url is a potentially trustworthy URL.\n // TODO\n\n // 2. Let header be a Structured Header whose value is a token.\n let header = null\n\n // 3. Set header’s value to r’s mode.\n header = httpRequest.mode\n\n // 4. Set a structured field value `Sec-Fetch-Mode`/header in r’s header list.\n httpRequest.headersList.set('sec-fetch-mode', header)\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-site-header\n // TODO\n\n // https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-user-header\n // TODO\n}\n\n// https://fetch.spec.whatwg.org/#append-a-request-origin-header\nfunction appendRequestOriginHeader (request) {\n // 1. Let serializedOrigin be the result of byte-serializing a request origin with request.\n let serializedOrigin = request.origin\n\n // 2. If request’s response tainting is \"cors\" or request’s mode is \"websocket\", then append (`Origin`, serializedOrigin) to request’s header list.\n if (request.responseTainting === 'cors' || request.mode === 'websocket') {\n if (serializedOrigin) {\n request.headersList.append('origin', serializedOrigin)\n }\n\n // 3. Otherwise, if request’s method is neither `GET` nor `HEAD`, then:\n } else if (request.method !== 'GET' && request.method !== 'HEAD') {\n // 1. Switch on request’s referrer policy:\n switch (request.referrerPolicy) {\n case 'no-referrer':\n // Set serializedOrigin to `null`.\n serializedOrigin = null\n break\n case 'no-referrer-when-downgrade':\n case 'strict-origin':\n case 'strict-origin-when-cross-origin':\n // If request’s origin is a tuple origin, its scheme is \"https\", and request’s current URL’s scheme is not \"https\", then set serializedOrigin to `null`.\n if (request.origin && urlHasHttpsScheme(request.origin) && !urlHasHttpsScheme(requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n case 'same-origin':\n // If request’s origin is not same origin with request’s current URL’s origin, then set serializedOrigin to `null`.\n if (!sameOrigin(request, requestCurrentURL(request))) {\n serializedOrigin = null\n }\n break\n default:\n // Do nothing.\n }\n\n if (serializedOrigin) {\n // 2. Append (`Origin`, serializedOrigin) to request’s header list.\n request.headersList.append('origin', serializedOrigin)\n }\n }\n}\n\nfunction coarsenedSharedCurrentTime (crossOriginIsolatedCapability) {\n // TODO\n return performance.now()\n}\n\n// https://fetch.spec.whatwg.org/#create-an-opaque-timing-info\nfunction createOpaqueTimingInfo (timingInfo) {\n return {\n startTime: timingInfo.startTime ?? 0,\n redirectStartTime: 0,\n redirectEndTime: 0,\n postRedirectStartTime: timingInfo.startTime ?? 0,\n finalServiceWorkerStartTime: 0,\n finalNetworkResponseStartTime: 0,\n finalNetworkRequestStartTime: 0,\n endTime: 0,\n encodedBodySize: 0,\n decodedBodySize: 0,\n finalConnectionTimingInfo: null\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#policy-container\nfunction makePolicyContainer () {\n // Note: the fetch spec doesn't make use of embedder policy or CSP list\n return {\n referrerPolicy: 'strict-origin-when-cross-origin'\n }\n}\n\n// https://html.spec.whatwg.org/multipage/origin.html#clone-a-policy-container\nfunction clonePolicyContainer (policyContainer) {\n return {\n referrerPolicy: policyContainer.referrerPolicy\n }\n}\n\n// https://w3c.github.io/webappsec-referrer-policy/#determine-requests-referrer\nfunction determineRequestsReferrer (request) {\n // 1. Let policy be request's referrer policy.\n const policy = request.referrerPolicy\n\n // Note: policy cannot (shouldn't) be null or an empty string.\n assert(policy)\n\n // 2. Let environment be request’s client.\n\n let referrerSource = null\n\n // 3. Switch on request’s referrer:\n if (request.referrer === 'client') {\n // Note: node isn't a browser and doesn't implement document/iframes,\n // so we bypass this step and replace it with our own.\n\n const globalOrigin = getGlobalOrigin()\n\n if (!globalOrigin || globalOrigin.origin === 'null') {\n return 'no-referrer'\n }\n\n // note: we need to clone it as it's mutated\n referrerSource = new URL(globalOrigin)\n } else if (request.referrer instanceof URL) {\n // Let referrerSource be request’s referrer.\n referrerSource = request.referrer\n }\n\n // 4. Let request’s referrerURL be the result of stripping referrerSource for\n // use as a referrer.\n let referrerURL = stripURLForReferrer(referrerSource)\n\n // 5. Let referrerOrigin be the result of stripping referrerSource for use as\n // a referrer, with the origin-only flag set to true.\n const referrerOrigin = stripURLForReferrer(referrerSource, true)\n\n // 6. If the result of serializing referrerURL is a string whose length is\n // greater than 4096, set referrerURL to referrerOrigin.\n if (referrerURL.toString().length > 4096) {\n referrerURL = referrerOrigin\n }\n\n const areSameOrigin = sameOrigin(request, referrerURL)\n const isNonPotentiallyTrustWorthy = isURLPotentiallyTrustworthy(referrerURL) &&\n !isURLPotentiallyTrustworthy(request.url)\n\n // 8. Execute the switch statements corresponding to the value of policy:\n switch (policy) {\n case 'origin': return referrerOrigin != null ? referrerOrigin : stripURLForReferrer(referrerSource, true)\n case 'unsafe-url': return referrerURL\n case 'same-origin':\n return areSameOrigin ? referrerOrigin : 'no-referrer'\n case 'origin-when-cross-origin':\n return areSameOrigin ? referrerURL : referrerOrigin\n case 'strict-origin-when-cross-origin': {\n const currentURL = requestCurrentURL(request)\n\n // 1. If the origin of referrerURL and the origin of request’s current\n // URL are the same, then return referrerURL.\n if (sameOrigin(referrerURL, currentURL)) {\n return referrerURL\n }\n\n // 2. If referrerURL is a potentially trustworthy URL and request’s\n // current URL is not a potentially trustworthy URL, then return no\n // referrer.\n if (isURLPotentiallyTrustworthy(referrerURL) && !isURLPotentiallyTrustworthy(currentURL)) {\n return 'no-referrer'\n }\n\n // 3. Return referrerOrigin.\n return referrerOrigin\n }\n case 'strict-origin': // eslint-disable-line\n /**\n * 1. If referrerURL is a potentially trustworthy URL and\n * request’s current URL is not a potentially trustworthy URL,\n * then return no referrer.\n * 2. Return referrerOrigin\n */\n case 'no-referrer-when-downgrade': // eslint-disable-line\n /**\n * 1. If referrerURL is a potentially trustworthy URL and\n * request’s current URL is not a potentially trustworthy URL,\n * then return no referrer.\n * 2. Return referrerOrigin\n */\n\n default: // eslint-disable-line\n return isNonPotentiallyTrustWorthy ? 'no-referrer' : referrerOrigin\n }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-referrer-policy/#strip-url\n * @param {URL} url\n * @param {boolean|undefined} originOnly\n */\nfunction stripURLForReferrer (url, originOnly) {\n // 1. Assert: url is a URL.\n assert(url instanceof URL)\n\n // 2. If url’s scheme is a local scheme, then return no referrer.\n if (url.protocol === 'file:' || url.protocol === 'about:' || url.protocol === 'blank:') {\n return 'no-referrer'\n }\n\n // 3. Set url’s username to the empty string.\n url.username = ''\n\n // 4. Set url’s password to the empty string.\n url.password = ''\n\n // 5. Set url’s fragment to null.\n url.hash = ''\n\n // 6. If the origin-only flag is true, then:\n if (originOnly) {\n // 1. Set url’s path to « the empty string ».\n url.pathname = ''\n\n // 2. Set url’s query to null.\n url.search = ''\n }\n\n // 7. Return url.\n return url\n}\n\nfunction isURLPotentiallyTrustworthy (url) {\n if (!(url instanceof URL)) {\n return false\n }\n\n // If child of about, return true\n if (url.href === 'about:blank' || url.href === 'about:srcdoc') {\n return true\n }\n\n // If scheme is data, return true\n if (url.protocol === 'data:') return true\n\n // If file, return true\n if (url.protocol === 'file:') return true\n\n return isOriginPotentiallyTrustworthy(url.origin)\n\n function isOriginPotentiallyTrustworthy (origin) {\n // If origin is explicitly null, return false\n if (origin == null || origin === 'null') return false\n\n const originAsURL = new URL(origin)\n\n // If secure, return true\n if (originAsURL.protocol === 'https:' || originAsURL.protocol === 'wss:') {\n return true\n }\n\n // If localhost or variants, return true\n if (/^127(?:\\.[0-9]+){0,2}\\.[0-9]+$|^\\[(?:0*:)*?:?0*1\\]$/.test(originAsURL.hostname) ||\n (originAsURL.hostname === 'localhost' || originAsURL.hostname.includes('localhost.')) ||\n (originAsURL.hostname.endsWith('.localhost'))) {\n return true\n }\n\n // If any other, return false\n return false\n }\n}\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#does-response-match-metadatalist\n * @param {Uint8Array} bytes\n * @param {string} metadataList\n */\nfunction bytesMatch (bytes, metadataList) {\n // If node is not built with OpenSSL support, we cannot check\n // a request's integrity, so allow it by default (the spec will\n // allow requests if an invalid hash is given, as precedence).\n /* istanbul ignore if: only if node is built with --without-ssl */\n if (crypto === undefined) {\n return true\n }\n\n // 1. Let parsedMetadata be the result of parsing metadataList.\n const parsedMetadata = parseMetadata(metadataList)\n\n // 2. If parsedMetadata is no metadata, return true.\n if (parsedMetadata === 'no metadata') {\n return true\n }\n\n // 3. If parsedMetadata is the empty set, return true.\n if (parsedMetadata.length === 0) {\n return true\n }\n\n // 4. Let metadata be the result of getting the strongest\n // metadata from parsedMetadata.\n const list = parsedMetadata.sort((c, d) => d.algo.localeCompare(c.algo))\n // get the strongest algorithm\n const strongest = list[0].algo\n // get all entries that use the strongest algorithm; ignore weaker\n const metadata = list.filter((item) => item.algo === strongest)\n\n // 5. For each item in metadata:\n for (const item of metadata) {\n // 1. Let algorithm be the alg component of item.\n const algorithm = item.algo\n\n // 2. Let expectedValue be the val component of item.\n let expectedValue = item.hash\n\n // See https://github.com/web-platform-tests/wpt/commit/e4c5cc7a5e48093220528dfdd1c4012dc3837a0e\n // \"be liberal with padding\". This is annoying, and it's not even in the spec.\n\n if (expectedValue.endsWith('==')) {\n expectedValue = expectedValue.slice(0, -2)\n }\n\n // 3. Let actualValue be the result of applying algorithm to bytes.\n let actualValue = crypto.createHash(algorithm).update(bytes).digest('base64')\n\n if (actualValue.endsWith('==')) {\n actualValue = actualValue.slice(0, -2)\n }\n\n // 4. If actualValue is a case-sensitive match for expectedValue,\n // return true.\n if (actualValue === expectedValue) {\n return true\n }\n\n let actualBase64URL = crypto.createHash(algorithm).update(bytes).digest('base64url')\n\n if (actualBase64URL.endsWith('==')) {\n actualBase64URL = actualBase64URL.slice(0, -2)\n }\n\n if (actualBase64URL === expectedValue) {\n return true\n }\n }\n\n // 6. Return false.\n return false\n}\n\n// https://w3c.github.io/webappsec-subresource-integrity/#grammardef-hash-with-options\n// https://www.w3.org/TR/CSP2/#source-list-syntax\n// https://www.rfc-editor.org/rfc/rfc5234#appendix-B.1\nconst parseHashWithOptions = /((?sha256|sha384|sha512)-(?[A-z0-9+/]{1}.*={0,2}))( +[\\x21-\\x7e]?)?/i\n\n/**\n * @see https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata\n * @param {string} metadata\n */\nfunction parseMetadata (metadata) {\n // 1. Let result be the empty set.\n /** @type {{ algo: string, hash: string }[]} */\n const result = []\n\n // 2. Let empty be equal to true.\n let empty = true\n\n const supportedHashes = crypto.getHashes()\n\n // 3. For each token returned by splitting metadata on spaces:\n for (const token of metadata.split(' ')) {\n // 1. Set empty to false.\n empty = false\n\n // 2. Parse token as a hash-with-options.\n const parsedToken = parseHashWithOptions.exec(token)\n\n // 3. If token does not parse, continue to the next token.\n if (parsedToken === null || parsedToken.groups === undefined) {\n // Note: Chromium blocks the request at this point, but Firefox\n // gives a warning that an invalid integrity was given. The\n // correct behavior is to ignore these, and subsequently not\n // check the integrity of the resource.\n continue\n }\n\n // 4. Let algorithm be the hash-algo component of token.\n const algorithm = parsedToken.groups.algo\n\n // 5. If algorithm is a hash function recognized by the user\n // agent, add the parsed token to result.\n if (supportedHashes.includes(algorithm.toLowerCase())) {\n result.push(parsedToken.groups)\n }\n }\n\n // 4. Return no metadata if empty is true, otherwise return result.\n if (empty === true) {\n return 'no metadata'\n }\n\n return result\n}\n\n// https://w3c.github.io/webappsec-upgrade-insecure-requests/#upgrade-request\nfunction tryUpgradeRequestToAPotentiallyTrustworthyURL (request) {\n // TODO\n}\n\n/**\n * @link {https://html.spec.whatwg.org/multipage/origin.html#same-origin}\n * @param {URL} A\n * @param {URL} B\n */\nfunction sameOrigin (A, B) {\n // 1. If A and B are the same opaque origin, then return true.\n if (A.origin === B.origin && A.origin === 'null') {\n return true\n }\n\n // 2. If A and B are both tuple origins and their schemes,\n // hosts, and port are identical, then return true.\n if (A.protocol === B.protocol && A.hostname === B.hostname && A.port === B.port) {\n return true\n }\n\n // 3. Return false.\n return false\n}\n\nfunction createDeferredPromise () {\n let res\n let rej\n const promise = new Promise((resolve, reject) => {\n res = resolve\n rej = reject\n })\n\n return { promise, resolve: res, reject: rej }\n}\n\nfunction isAborted (fetchParams) {\n return fetchParams.controller.state === 'aborted'\n}\n\nfunction isCancelled (fetchParams) {\n return fetchParams.controller.state === 'aborted' ||\n fetchParams.controller.state === 'terminated'\n}\n\n// https://fetch.spec.whatwg.org/#concept-method-normalize\nfunction normalizeMethod (method) {\n return /^(DELETE|GET|HEAD|OPTIONS|POST|PUT)$/i.test(method)\n ? method.toUpperCase()\n : method\n}\n\n// https://infra.spec.whatwg.org/#serialize-a-javascript-value-to-a-json-string\nfunction serializeJavascriptValueToJSONString (value) {\n // 1. Let result be ? Call(%JSON.stringify%, undefined, « value »).\n const result = JSON.stringify(value)\n\n // 2. If result is undefined, then throw a TypeError.\n if (result === undefined) {\n throw new TypeError('Value is not JSON serializable')\n }\n\n // 3. Assert: result is a string.\n assert(typeof result === 'string')\n\n // 4. Return result.\n return result\n}\n\n// https://tc39.es/ecma262/#sec-%25iteratorprototype%25-object\nconst esIteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]()))\n\n/**\n * @see https://webidl.spec.whatwg.org/#dfn-iterator-prototype-object\n * @param {() => unknown[]} iterator\n * @param {string} name name of the instance\n * @param {'key'|'value'|'key+value'} kind\n */\nfunction makeIterator (iterator, name, kind) {\n const object = {\n index: 0,\n kind,\n target: iterator\n }\n\n const i = {\n next () {\n // 1. Let interface be the interface for which the iterator prototype object exists.\n\n // 2. Let thisValue be the this value.\n\n // 3. Let object be ? ToObject(thisValue).\n\n // 4. If object is a platform object, then perform a security\n // check, passing:\n\n // 5. If object is not a default iterator object for interface,\n // then throw a TypeError.\n if (Object.getPrototypeOf(this) !== i) {\n throw new TypeError(\n `'next' called on an object that does not implement interface ${name} Iterator.`\n )\n }\n\n // 6. Let index be object’s index.\n // 7. Let kind be object’s kind.\n // 8. Let values be object’s target's value pairs to iterate over.\n const { index, kind, target } = object\n const values = target()\n\n // 9. Let len be the length of values.\n const len = values.length\n\n // 10. If index is greater than or equal to len, then return\n // CreateIterResultObject(undefined, true).\n if (index >= len) {\n return { value: undefined, done: true }\n }\n\n // 11. Let pair be the entry in values at index index.\n const pair = values[index]\n\n // 12. Set object’s index to index + 1.\n object.index = index + 1\n\n // 13. Return the iterator result for pair and kind.\n return iteratorResult(pair, kind)\n },\n // The class string of an iterator prototype object for a given interface is the\n // result of concatenating the identifier of the interface and the string \" Iterator\".\n [Symbol.toStringTag]: `${name} Iterator`\n }\n\n // The [[Prototype]] internal slot of an iterator prototype object must be %IteratorPrototype%.\n Object.setPrototypeOf(i, esIteratorPrototype)\n // esIteratorPrototype needs to be the prototype of i\n // which is the prototype of an empty object. Yes, it's confusing.\n return Object.setPrototypeOf({}, i)\n}\n\n// https://webidl.spec.whatwg.org/#iterator-result\nfunction iteratorResult (pair, kind) {\n let result\n\n // 1. Let result be a value determined by the value of kind:\n switch (kind) {\n case 'key': {\n // 1. Let idlKey be pair’s key.\n // 2. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 3. result is key.\n result = pair[0]\n break\n }\n case 'value': {\n // 1. Let idlValue be pair’s value.\n // 2. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 3. result is value.\n result = pair[1]\n break\n }\n case 'key+value': {\n // 1. Let idlKey be pair’s key.\n // 2. Let idlValue be pair’s value.\n // 3. Let key be the result of converting idlKey to an\n // ECMAScript value.\n // 4. Let value be the result of converting idlValue to\n // an ECMAScript value.\n // 5. Let array be ! ArrayCreate(2).\n // 6. Call ! CreateDataProperty(array, \"0\", key).\n // 7. Call ! CreateDataProperty(array, \"1\", value).\n // 8. result is array.\n result = pair\n break\n }\n }\n\n // 2. Return CreateIterResultObject(result, false).\n return { value: result, done: false }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#body-fully-read\n */\nasync function fullyReadBody (body, processBody, processBodyError) {\n // 1. If taskDestination is null, then set taskDestination to\n // the result of starting a new parallel queue.\n\n // 2. Let successSteps given a byte sequence bytes be to queue a\n // fetch task to run processBody given bytes, with taskDestination.\n const successSteps = processBody\n\n // 3. Let errorSteps be to queue a fetch task to run processBodyError,\n // with taskDestination.\n const errorSteps = processBodyError\n\n // 4. Let reader be the result of getting a reader for body’s stream.\n // If that threw an exception, then run errorSteps with that\n // exception and return.\n let reader\n\n try {\n reader = body.stream.getReader()\n } catch (e) {\n errorSteps(e)\n return\n }\n\n // 5. Read all bytes from reader, given successSteps and errorSteps.\n try {\n const result = await readAllBytes(reader)\n successSteps(result)\n } catch (e) {\n errorSteps(e)\n }\n}\n\n/** @type {ReadableStream} */\nlet ReadableStream = globalThis.ReadableStream\n\nfunction isReadableStreamLike (stream) {\n if (!ReadableStream) {\n ReadableStream = require('stream/web').ReadableStream\n }\n\n return stream instanceof ReadableStream || (\n stream[Symbol.toStringTag] === 'ReadableStream' &&\n typeof stream.tee === 'function'\n )\n}\n\nconst MAXIMUM_ARGUMENT_LENGTH = 65535\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-decode\n * @param {number[]|Uint8Array} input\n */\nfunction isomorphicDecode (input) {\n // 1. To isomorphic decode a byte sequence input, return a string whose code point\n // length is equal to input’s length and whose code points have the same values\n // as the values of input’s bytes, in the same order.\n\n if (input.length < MAXIMUM_ARGUMENT_LENGTH) {\n return String.fromCharCode(...input)\n }\n\n return input.reduce((previous, current) => previous + String.fromCharCode(current), '')\n}\n\n/**\n * @param {ReadableStreamController} controller\n */\nfunction readableStreamClose (controller) {\n try {\n controller.close()\n } catch (err) {\n // TODO: add comment explaining why this error occurs.\n if (!err.message.includes('Controller is already closed')) {\n throw err\n }\n }\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#isomorphic-encode\n * @param {string} input\n */\nfunction isomorphicEncode (input) {\n // 1. Assert: input contains no code points greater than U+00FF.\n for (let i = 0; i < input.length; i++) {\n assert(input.charCodeAt(i) <= 0xFF)\n }\n\n // 2. Return a byte sequence whose length is equal to input’s code\n // point length and whose bytes have the same values as the\n // values of input’s code points, in the same order\n return input\n}\n\n/**\n * @see https://streams.spec.whatwg.org/#readablestreamdefaultreader-read-all-bytes\n * @see https://streams.spec.whatwg.org/#read-loop\n * @param {ReadableStreamDefaultReader} reader\n */\nasync function readAllBytes (reader) {\n const bytes = []\n let byteLength = 0\n\n while (true) {\n const { done, value: chunk } = await reader.read()\n\n if (done) {\n // 1. Call successSteps with bytes.\n return Buffer.concat(bytes, byteLength)\n }\n\n // 1. If chunk is not a Uint8Array object, call failureSteps\n // with a TypeError and abort these steps.\n if (!isUint8Array(chunk)) {\n throw new TypeError('Received non-Uint8Array chunk')\n }\n\n // 2. Append the bytes represented by chunk to bytes.\n bytes.push(chunk)\n byteLength += chunk.length\n\n // 3. Read-loop given reader, bytes, successSteps, and failureSteps.\n }\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#is-local\n * @param {URL} url\n */\nfunction urlIsLocal (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'about:' || protocol === 'blob:' || protocol === 'data:'\n}\n\n/**\n * @param {string|URL} url\n */\nfunction urlHasHttpsScheme (url) {\n if (typeof url === 'string') {\n return url.startsWith('https:')\n }\n\n return url.protocol === 'https:'\n}\n\n/**\n * @see https://fetch.spec.whatwg.org/#http-scheme\n * @param {URL} url\n */\nfunction urlIsHttpHttpsScheme (url) {\n assert('protocol' in url) // ensure it's a url object\n\n const protocol = url.protocol\n\n return protocol === 'http:' || protocol === 'https:'\n}\n\n/**\n * Fetch supports node >= 16.8.0, but Object.hasOwn was added in v16.9.0.\n */\nconst hasOwn = Object.hasOwn || ((dict, key) => Object.prototype.hasOwnProperty.call(dict, key))\n\nmodule.exports = {\n isAborted,\n isCancelled,\n createDeferredPromise,\n ReadableStreamFrom,\n toUSVString,\n tryUpgradeRequestToAPotentiallyTrustworthyURL,\n coarsenedSharedCurrentTime,\n determineRequestsReferrer,\n makePolicyContainer,\n clonePolicyContainer,\n appendFetchMetadata,\n appendRequestOriginHeader,\n TAOCheck,\n corsCheck,\n crossOriginResourcePolicyCheck,\n createOpaqueTimingInfo,\n setRequestReferrerPolicyOnRedirect,\n isValidHTTPToken,\n requestBadPort,\n requestCurrentURL,\n responseURL,\n responseLocationURL,\n isBlobLike,\n isURLPotentiallyTrustworthy,\n isValidReasonPhrase,\n sameOrigin,\n normalizeMethod,\n serializeJavascriptValueToJSONString,\n makeIterator,\n isValidHeaderName,\n isValidHeaderValue,\n hasOwn,\n isErrorLike,\n fullyReadBody,\n bytesMatch,\n isReadableStreamLike,\n readableStreamClose,\n isomorphicEncode,\n isomorphicDecode,\n urlIsLocal,\n urlHasHttpsScheme,\n urlIsHttpHttpsScheme,\n readAllBytes\n}\n","'use strict'\n\nconst { types } = require('util')\nconst { hasOwn, toUSVString } = require('./util')\n\n/** @type {import('../../types/webidl').Webidl} */\nconst webidl = {}\nwebidl.converters = {}\nwebidl.util = {}\nwebidl.errors = {}\n\nwebidl.errors.exception = function (message) {\n return new TypeError(`${message.header}: ${message.message}`)\n}\n\nwebidl.errors.conversionFailed = function (context) {\n const plural = context.types.length === 1 ? '' : ' one of'\n const message =\n `${context.argument} could not be converted to` +\n `${plural}: ${context.types.join(', ')}.`\n\n return webidl.errors.exception({\n header: context.prefix,\n message\n })\n}\n\nwebidl.errors.invalidArgument = function (context) {\n return webidl.errors.exception({\n header: context.prefix,\n message: `\"${context.value}\" is an invalid ${context.type}.`\n })\n}\n\n// https://webidl.spec.whatwg.org/#implements\nwebidl.brandCheck = function (V, I, opts = undefined) {\n if (opts?.strict !== false && !(V instanceof I)) {\n throw new TypeError('Illegal invocation')\n } else {\n return V?.[Symbol.toStringTag] === I.prototype[Symbol.toStringTag]\n }\n}\n\nwebidl.argumentLengthCheck = function ({ length }, min, ctx) {\n if (length < min) {\n throw webidl.errors.exception({\n message: `${min} argument${min !== 1 ? 's' : ''} required, ` +\n `but${length ? ' only' : ''} ${length} found.`,\n ...ctx\n })\n }\n}\n\nwebidl.illegalConstructor = function () {\n throw webidl.errors.exception({\n header: 'TypeError',\n message: 'Illegal constructor'\n })\n}\n\n// https://tc39.es/ecma262/#sec-ecmascript-data-types-and-values\nwebidl.util.Type = function (V) {\n switch (typeof V) {\n case 'undefined': return 'Undefined'\n case 'boolean': return 'Boolean'\n case 'string': return 'String'\n case 'symbol': return 'Symbol'\n case 'number': return 'Number'\n case 'bigint': return 'BigInt'\n case 'function':\n case 'object': {\n if (V === null) {\n return 'Null'\n }\n\n return 'Object'\n }\n }\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-converttoint\nwebidl.util.ConvertToInt = function (V, bitLength, signedness, opts = {}) {\n let upperBound\n let lowerBound\n\n // 1. If bitLength is 64, then:\n if (bitLength === 64) {\n // 1. Let upperBound be 2^53 − 1.\n upperBound = Math.pow(2, 53) - 1\n\n // 2. If signedness is \"unsigned\", then let lowerBound be 0.\n if (signedness === 'unsigned') {\n lowerBound = 0\n } else {\n // 3. Otherwise let lowerBound be −2^53 + 1.\n lowerBound = Math.pow(-2, 53) + 1\n }\n } else if (signedness === 'unsigned') {\n // 2. Otherwise, if signedness is \"unsigned\", then:\n\n // 1. Let lowerBound be 0.\n lowerBound = 0\n\n // 2. Let upperBound be 2^bitLength − 1.\n upperBound = Math.pow(2, bitLength) - 1\n } else {\n // 3. Otherwise:\n\n // 1. Let lowerBound be -2^bitLength − 1.\n lowerBound = Math.pow(-2, bitLength) - 1\n\n // 2. Let upperBound be 2^bitLength − 1 − 1.\n upperBound = Math.pow(2, bitLength - 1) - 1\n }\n\n // 4. Let x be ? ToNumber(V).\n let x = Number(V)\n\n // 5. If x is −0, then set x to +0.\n if (x === 0) {\n x = 0\n }\n\n // 6. If the conversion is to an IDL type associated\n // with the [EnforceRange] extended attribute, then:\n if (opts.enforceRange === true) {\n // 1. If x is NaN, +∞, or −∞, then throw a TypeError.\n if (\n Number.isNaN(x) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Could not convert ${V} to an integer.`\n })\n }\n\n // 2. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 3. If x < lowerBound or x > upperBound, then\n // throw a TypeError.\n if (x < lowerBound || x > upperBound) {\n throw webidl.errors.exception({\n header: 'Integer conversion',\n message: `Value must be between ${lowerBound}-${upperBound}, got ${x}.`\n })\n }\n\n // 4. Return x.\n return x\n }\n\n // 7. If x is not NaN and the conversion is to an IDL\n // type associated with the [Clamp] extended\n // attribute, then:\n if (!Number.isNaN(x) && opts.clamp === true) {\n // 1. Set x to min(max(x, lowerBound), upperBound).\n x = Math.min(Math.max(x, lowerBound), upperBound)\n\n // 2. Round x to the nearest integer, choosing the\n // even integer if it lies halfway between two,\n // and choosing +0 rather than −0.\n if (Math.floor(x) % 2 === 0) {\n x = Math.floor(x)\n } else {\n x = Math.ceil(x)\n }\n\n // 3. Return x.\n return x\n }\n\n // 8. If x is NaN, +0, +∞, or −∞, then return +0.\n if (\n Number.isNaN(x) ||\n (x === 0 && Object.is(0, x)) ||\n x === Number.POSITIVE_INFINITY ||\n x === Number.NEGATIVE_INFINITY\n ) {\n return 0\n }\n\n // 9. Set x to IntegerPart(x).\n x = webidl.util.IntegerPart(x)\n\n // 10. Set x to x modulo 2^bitLength.\n x = x % Math.pow(2, bitLength)\n\n // 11. If signedness is \"signed\" and x ≥ 2^bitLength − 1,\n // then return x − 2^bitLength.\n if (signedness === 'signed' && x >= Math.pow(2, bitLength) - 1) {\n return x - Math.pow(2, bitLength)\n }\n\n // 12. Otherwise, return x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#abstract-opdef-integerpart\nwebidl.util.IntegerPart = function (n) {\n // 1. Let r be floor(abs(n)).\n const r = Math.floor(Math.abs(n))\n\n // 2. If n < 0, then return -1 × r.\n if (n < 0) {\n return -1 * r\n }\n\n // 3. Otherwise, return r.\n return r\n}\n\n// https://webidl.spec.whatwg.org/#es-sequence\nwebidl.sequenceConverter = function (converter) {\n return (V) => {\n // 1. If Type(V) is not Object, throw a TypeError.\n if (webidl.util.Type(V) !== 'Object') {\n throw webidl.errors.exception({\n header: 'Sequence',\n message: `Value of type ${webidl.util.Type(V)} is not an Object.`\n })\n }\n\n // 2. Let method be ? GetMethod(V, @@iterator).\n /** @type {Generator} */\n const method = V?.[Symbol.iterator]?.()\n const seq = []\n\n // 3. If method is undefined, throw a TypeError.\n if (\n method === undefined ||\n typeof method.next !== 'function'\n ) {\n throw webidl.errors.exception({\n header: 'Sequence',\n message: 'Object is not an iterator.'\n })\n }\n\n // https://webidl.spec.whatwg.org/#create-sequence-from-iterable\n while (true) {\n const { done, value } = method.next()\n\n if (done) {\n break\n }\n\n seq.push(converter(value))\n }\n\n return seq\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-to-record\nwebidl.recordConverter = function (keyConverter, valueConverter) {\n return (O) => {\n // 1. If Type(O) is not Object, throw a TypeError.\n if (webidl.util.Type(O) !== 'Object') {\n throw webidl.errors.exception({\n header: 'Record',\n message: `Value of type ${webidl.util.Type(O)} is not an Object.`\n })\n }\n\n // 2. Let result be a new empty instance of record.\n const result = {}\n\n if (!types.isProxy(O)) {\n // Object.keys only returns enumerable properties\n const keys = Object.keys(O)\n\n for (const key of keys) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key])\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n\n // 5. Return result.\n return result\n }\n\n // 3. Let keys be ? O.[[OwnPropertyKeys]]().\n const keys = Reflect.ownKeys(O)\n\n // 4. For each key of keys.\n for (const key of keys) {\n // 1. Let desc be ? O.[[GetOwnProperty]](key).\n const desc = Reflect.getOwnPropertyDescriptor(O, key)\n\n // 2. If desc is not undefined and desc.[[Enumerable]] is true:\n if (desc?.enumerable) {\n // 1. Let typedKey be key converted to an IDL value of type K.\n const typedKey = keyConverter(key)\n\n // 2. Let value be ? Get(O, key).\n // 3. Let typedValue be value converted to an IDL value of type V.\n const typedValue = valueConverter(O[key])\n\n // 4. Set result[typedKey] to typedValue.\n result[typedKey] = typedValue\n }\n }\n\n // 5. Return result.\n return result\n }\n}\n\nwebidl.interfaceConverter = function (i) {\n return (V, opts = {}) => {\n if (opts.strict !== false && !(V instanceof i)) {\n throw webidl.errors.exception({\n header: i.name,\n message: `Expected ${V} to be an instance of ${i.name}.`\n })\n }\n\n return V\n }\n}\n\nwebidl.dictionaryConverter = function (converters) {\n return (dictionary) => {\n const type = webidl.util.Type(dictionary)\n const dict = {}\n\n if (type === 'Null' || type === 'Undefined') {\n return dict\n } else if (type !== 'Object') {\n throw webidl.errors.exception({\n header: 'Dictionary',\n message: `Expected ${dictionary} to be one of: Null, Undefined, Object.`\n })\n }\n\n for (const options of converters) {\n const { key, defaultValue, required, converter } = options\n\n if (required === true) {\n if (!hasOwn(dictionary, key)) {\n throw webidl.errors.exception({\n header: 'Dictionary',\n message: `Missing required key \"${key}\".`\n })\n }\n }\n\n let value = dictionary[key]\n const hasDefault = hasOwn(options, 'defaultValue')\n\n // Only use defaultValue if value is undefined and\n // a defaultValue options was provided.\n if (hasDefault && value !== null) {\n value = value ?? defaultValue\n }\n\n // A key can be optional and have no default value.\n // When this happens, do not perform a conversion,\n // and do not assign the key a value.\n if (required || hasDefault || value !== undefined) {\n value = converter(value)\n\n if (\n options.allowedValues &&\n !options.allowedValues.includes(value)\n ) {\n throw webidl.errors.exception({\n header: 'Dictionary',\n message: `${value} is not an accepted type. Expected one of ${options.allowedValues.join(', ')}.`\n })\n }\n\n dict[key] = value\n }\n }\n\n return dict\n }\n}\n\nwebidl.nullableConverter = function (converter) {\n return (V) => {\n if (V === null) {\n return V\n }\n\n return converter(V)\n }\n}\n\n// https://webidl.spec.whatwg.org/#es-DOMString\nwebidl.converters.DOMString = function (V, opts = {}) {\n // 1. If V is null and the conversion is to an IDL type\n // associated with the [LegacyNullToEmptyString]\n // extended attribute, then return the DOMString value\n // that represents the empty string.\n if (V === null && opts.legacyNullToEmptyString) {\n return ''\n }\n\n // 2. Let x be ? ToString(V).\n if (typeof V === 'symbol') {\n throw new TypeError('Could not convert argument of type symbol to string.')\n }\n\n // 3. Return the IDL DOMString value that represents the\n // same sequence of code units as the one the\n // ECMAScript String value x represents.\n return String(V)\n}\n\n// https://webidl.spec.whatwg.org/#es-ByteString\nwebidl.converters.ByteString = function (V) {\n // 1. Let x be ? ToString(V).\n // Note: DOMString converter perform ? ToString(V)\n const x = webidl.converters.DOMString(V)\n\n // 2. If the value of any element of x is greater than\n // 255, then throw a TypeError.\n for (let index = 0; index < x.length; index++) {\n const charCode = x.charCodeAt(index)\n\n if (charCode > 255) {\n throw new TypeError(\n 'Cannot convert argument to a ByteString because the character at ' +\n `index ${index} has a value of ${charCode} which is greater than 255.`\n )\n }\n }\n\n // 3. Return an IDL ByteString value whose length is the\n // length of x, and where the value of each element is\n // the value of the corresponding element of x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-USVString\nwebidl.converters.USVString = toUSVString\n\n// https://webidl.spec.whatwg.org/#es-boolean\nwebidl.converters.boolean = function (V) {\n // 1. Let x be the result of computing ToBoolean(V).\n const x = Boolean(V)\n\n // 2. Return the IDL boolean value that is the one that represents\n // the same truth value as the ECMAScript Boolean value x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-any\nwebidl.converters.any = function (V) {\n return V\n}\n\n// https://webidl.spec.whatwg.org/#es-long-long\nwebidl.converters['long long'] = function (V) {\n // 1. Let x be ? ConvertToInt(V, 64, \"signed\").\n const x = webidl.util.ConvertToInt(V, 64, 'signed')\n\n // 2. Return the IDL long long value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long-long\nwebidl.converters['unsigned long long'] = function (V) {\n // 1. Let x be ? ConvertToInt(V, 64, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 64, 'unsigned')\n\n // 2. Return the IDL unsigned long long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-long\nwebidl.converters['unsigned long'] = function (V) {\n // 1. Let x be ? ConvertToInt(V, 32, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 32, 'unsigned')\n\n // 2. Return the IDL unsigned long value that\n // represents the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#es-unsigned-short\nwebidl.converters['unsigned short'] = function (V, opts) {\n // 1. Let x be ? ConvertToInt(V, 16, \"unsigned\").\n const x = webidl.util.ConvertToInt(V, 16, 'unsigned', opts)\n\n // 2. Return the IDL unsigned short value that represents\n // the same numeric value as x.\n return x\n}\n\n// https://webidl.spec.whatwg.org/#idl-ArrayBuffer\nwebidl.converters.ArrayBuffer = function (V, opts = {}) {\n // 1. If Type(V) is not Object, or V does not have an\n // [[ArrayBufferData]] internal slot, then throw a\n // TypeError.\n // see: https://tc39.es/ecma262/#sec-properties-of-the-arraybuffer-instances\n // see: https://tc39.es/ecma262/#sec-properties-of-the-sharedarraybuffer-instances\n if (\n webidl.util.Type(V) !== 'Object' ||\n !types.isAnyArrayBuffer(V)\n ) {\n throw webidl.errors.conversionFailed({\n prefix: `${V}`,\n argument: `${V}`,\n types: ['ArrayBuffer']\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V) is true, then throw a\n // TypeError.\n if (opts.allowShared === false && types.isSharedArrayBuffer(V)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V) is true, then throw a\n // TypeError.\n // Note: resizable ArrayBuffers are currently a proposal.\n\n // 4. Return the IDL ArrayBuffer value that is a\n // reference to the same object as V.\n return V\n}\n\nwebidl.converters.TypedArray = function (V, T, opts = {}) {\n // 1. Let T be the IDL type V is being converted to.\n\n // 2. If Type(V) is not Object, or V does not have a\n // [[TypedArrayName]] internal slot with a value\n // equal to T’s name, then throw a TypeError.\n if (\n webidl.util.Type(V) !== 'Object' ||\n !types.isTypedArray(V) ||\n V.constructor.name !== T.name\n ) {\n throw webidl.errors.conversionFailed({\n prefix: `${T.name}`,\n argument: `${V}`,\n types: [T.name]\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 4. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n // Note: resizable array buffers are currently a proposal\n\n // 5. Return the IDL value of type T that is a reference\n // to the same object as V.\n return V\n}\n\nwebidl.converters.DataView = function (V, opts = {}) {\n // 1. If Type(V) is not Object, or V does not have a\n // [[DataView]] internal slot, then throw a TypeError.\n if (webidl.util.Type(V) !== 'Object' || !types.isDataView(V)) {\n throw webidl.errors.exception({\n header: 'DataView',\n message: 'Object is not a DataView.'\n })\n }\n\n // 2. If the conversion is not to an IDL type associated\n // with the [AllowShared] extended attribute, and\n // IsSharedArrayBuffer(V.[[ViewedArrayBuffer]]) is true,\n // then throw a TypeError.\n if (opts.allowShared === false && types.isSharedArrayBuffer(V.buffer)) {\n throw webidl.errors.exception({\n header: 'ArrayBuffer',\n message: 'SharedArrayBuffer is not allowed.'\n })\n }\n\n // 3. If the conversion is not to an IDL type associated\n // with the [AllowResizable] extended attribute, and\n // IsResizableArrayBuffer(V.[[ViewedArrayBuffer]]) is\n // true, then throw a TypeError.\n // Note: resizable ArrayBuffers are currently a proposal\n\n // 4. Return the IDL DataView value that is a reference\n // to the same object as V.\n return V\n}\n\n// https://webidl.spec.whatwg.org/#BufferSource\nwebidl.converters.BufferSource = function (V, opts = {}) {\n if (types.isAnyArrayBuffer(V)) {\n return webidl.converters.ArrayBuffer(V, opts)\n }\n\n if (types.isTypedArray(V)) {\n return webidl.converters.TypedArray(V, V.constructor)\n }\n\n if (types.isDataView(V)) {\n return webidl.converters.DataView(V, opts)\n }\n\n throw new TypeError(`Could not convert ${V} to a BufferSource.`)\n}\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.ByteString\n)\n\nwebidl.converters['sequence>'] = webidl.sequenceConverter(\n webidl.converters['sequence']\n)\n\nwebidl.converters['record'] = webidl.recordConverter(\n webidl.converters.ByteString,\n webidl.converters.ByteString\n)\n\nmodule.exports = {\n webidl\n}\n","'use strict'\n\n/**\n * @see https://encoding.spec.whatwg.org/#concept-encoding-get\n * @param {string|undefined} label\n */\nfunction getEncoding (label) {\n if (!label) {\n return 'failure'\n }\n\n // 1. Remove any leading and trailing ASCII whitespace from label.\n // 2. If label is an ASCII case-insensitive match for any of the\n // labels listed in the table below, then return the\n // corresponding encoding; otherwise return failure.\n switch (label.trim().toLowerCase()) {\n case 'unicode-1-1-utf-8':\n case 'unicode11utf8':\n case 'unicode20utf8':\n case 'utf-8':\n case 'utf8':\n case 'x-unicode20utf8':\n return 'UTF-8'\n case '866':\n case 'cp866':\n case 'csibm866':\n case 'ibm866':\n return 'IBM866'\n case 'csisolatin2':\n case 'iso-8859-2':\n case 'iso-ir-101':\n case 'iso8859-2':\n case 'iso88592':\n case 'iso_8859-2':\n case 'iso_8859-2:1987':\n case 'l2':\n case 'latin2':\n return 'ISO-8859-2'\n case 'csisolatin3':\n case 'iso-8859-3':\n case 'iso-ir-109':\n case 'iso8859-3':\n case 'iso88593':\n case 'iso_8859-3':\n case 'iso_8859-3:1988':\n case 'l3':\n case 'latin3':\n return 'ISO-8859-3'\n case 'csisolatin4':\n case 'iso-8859-4':\n case 'iso-ir-110':\n case 'iso8859-4':\n case 'iso88594':\n case 'iso_8859-4':\n case 'iso_8859-4:1988':\n case 'l4':\n case 'latin4':\n return 'ISO-8859-4'\n case 'csisolatincyrillic':\n case 'cyrillic':\n case 'iso-8859-5':\n case 'iso-ir-144':\n case 'iso8859-5':\n case 'iso88595':\n case 'iso_8859-5':\n case 'iso_8859-5:1988':\n return 'ISO-8859-5'\n case 'arabic':\n case 'asmo-708':\n case 'csiso88596e':\n case 'csiso88596i':\n case 'csisolatinarabic':\n case 'ecma-114':\n case 'iso-8859-6':\n case 'iso-8859-6-e':\n case 'iso-8859-6-i':\n case 'iso-ir-127':\n case 'iso8859-6':\n case 'iso88596':\n case 'iso_8859-6':\n case 'iso_8859-6:1987':\n return 'ISO-8859-6'\n case 'csisolatingreek':\n case 'ecma-118':\n case 'elot_928':\n case 'greek':\n case 'greek8':\n case 'iso-8859-7':\n case 'iso-ir-126':\n case 'iso8859-7':\n case 'iso88597':\n case 'iso_8859-7':\n case 'iso_8859-7:1987':\n case 'sun_eu_greek':\n return 'ISO-8859-7'\n case 'csiso88598e':\n case 'csisolatinhebrew':\n case 'hebrew':\n case 'iso-8859-8':\n case 'iso-8859-8-e':\n case 'iso-ir-138':\n case 'iso8859-8':\n case 'iso88598':\n case 'iso_8859-8':\n case 'iso_8859-8:1988':\n case 'visual':\n return 'ISO-8859-8'\n case 'csiso88598i':\n case 'iso-8859-8-i':\n case 'logical':\n return 'ISO-8859-8-I'\n case 'csisolatin6':\n case 'iso-8859-10':\n case 'iso-ir-157':\n case 'iso8859-10':\n case 'iso885910':\n case 'l6':\n case 'latin6':\n return 'ISO-8859-10'\n case 'iso-8859-13':\n case 'iso8859-13':\n case 'iso885913':\n return 'ISO-8859-13'\n case 'iso-8859-14':\n case 'iso8859-14':\n case 'iso885914':\n return 'ISO-8859-14'\n case 'csisolatin9':\n case 'iso-8859-15':\n case 'iso8859-15':\n case 'iso885915':\n case 'iso_8859-15':\n case 'l9':\n return 'ISO-8859-15'\n case 'iso-8859-16':\n return 'ISO-8859-16'\n case 'cskoi8r':\n case 'koi':\n case 'koi8':\n case 'koi8-r':\n case 'koi8_r':\n return 'KOI8-R'\n case 'koi8-ru':\n case 'koi8-u':\n return 'KOI8-U'\n case 'csmacintosh':\n case 'mac':\n case 'macintosh':\n case 'x-mac-roman':\n return 'macintosh'\n case 'iso-8859-11':\n case 'iso8859-11':\n case 'iso885911':\n case 'tis-620':\n case 'windows-874':\n return 'windows-874'\n case 'cp1250':\n case 'windows-1250':\n case 'x-cp1250':\n return 'windows-1250'\n case 'cp1251':\n case 'windows-1251':\n case 'x-cp1251':\n return 'windows-1251'\n case 'ansi_x3.4-1968':\n case 'ascii':\n case 'cp1252':\n case 'cp819':\n case 'csisolatin1':\n case 'ibm819':\n case 'iso-8859-1':\n case 'iso-ir-100':\n case 'iso8859-1':\n case 'iso88591':\n case 'iso_8859-1':\n case 'iso_8859-1:1987':\n case 'l1':\n case 'latin1':\n case 'us-ascii':\n case 'windows-1252':\n case 'x-cp1252':\n return 'windows-1252'\n case 'cp1253':\n case 'windows-1253':\n case 'x-cp1253':\n return 'windows-1253'\n case 'cp1254':\n case 'csisolatin5':\n case 'iso-8859-9':\n case 'iso-ir-148':\n case 'iso8859-9':\n case 'iso88599':\n case 'iso_8859-9':\n case 'iso_8859-9:1989':\n case 'l5':\n case 'latin5':\n case 'windows-1254':\n case 'x-cp1254':\n return 'windows-1254'\n case 'cp1255':\n case 'windows-1255':\n case 'x-cp1255':\n return 'windows-1255'\n case 'cp1256':\n case 'windows-1256':\n case 'x-cp1256':\n return 'windows-1256'\n case 'cp1257':\n case 'windows-1257':\n case 'x-cp1257':\n return 'windows-1257'\n case 'cp1258':\n case 'windows-1258':\n case 'x-cp1258':\n return 'windows-1258'\n case 'x-mac-cyrillic':\n case 'x-mac-ukrainian':\n return 'x-mac-cyrillic'\n case 'chinese':\n case 'csgb2312':\n case 'csiso58gb231280':\n case 'gb2312':\n case 'gb_2312':\n case 'gb_2312-80':\n case 'gbk':\n case 'iso-ir-58':\n case 'x-gbk':\n return 'GBK'\n case 'gb18030':\n return 'gb18030'\n case 'big5':\n case 'big5-hkscs':\n case 'cn-big5':\n case 'csbig5':\n case 'x-x-big5':\n return 'Big5'\n case 'cseucpkdfmtjapanese':\n case 'euc-jp':\n case 'x-euc-jp':\n return 'EUC-JP'\n case 'csiso2022jp':\n case 'iso-2022-jp':\n return 'ISO-2022-JP'\n case 'csshiftjis':\n case 'ms932':\n case 'ms_kanji':\n case 'shift-jis':\n case 'shift_jis':\n case 'sjis':\n case 'windows-31j':\n case 'x-sjis':\n return 'Shift_JIS'\n case 'cseuckr':\n case 'csksc56011987':\n case 'euc-kr':\n case 'iso-ir-149':\n case 'korean':\n case 'ks_c_5601-1987':\n case 'ks_c_5601-1989':\n case 'ksc5601':\n case 'ksc_5601':\n case 'windows-949':\n return 'EUC-KR'\n case 'csiso2022kr':\n case 'hz-gb-2312':\n case 'iso-2022-cn':\n case 'iso-2022-cn-ext':\n case 'iso-2022-kr':\n case 'replacement':\n return 'replacement'\n case 'unicodefffe':\n case 'utf-16be':\n return 'UTF-16BE'\n case 'csunicode':\n case 'iso-10646-ucs-2':\n case 'ucs-2':\n case 'unicode':\n case 'unicodefeff':\n case 'utf-16':\n case 'utf-16le':\n return 'UTF-16LE'\n case 'x-user-defined':\n return 'x-user-defined'\n default: return 'failure'\n }\n}\n\nmodule.exports = {\n getEncoding\n}\n","'use strict'\n\nconst {\n staticPropertyDescriptors,\n readOperation,\n fireAProgressEvent\n} = require('./util')\nconst {\n kState,\n kError,\n kResult,\n kEvents,\n kAborted\n} = require('./symbols')\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../core/util')\n\nclass FileReader extends EventTarget {\n constructor () {\n super()\n\n this[kState] = 'empty'\n this[kResult] = null\n this[kError] = null\n this[kEvents] = {\n loadend: null,\n error: null,\n abort: null,\n load: null,\n progress: null,\n loadstart: null\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer\n * @param {import('buffer').Blob} blob\n */\n readAsArrayBuffer (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsArrayBuffer' })\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsArrayBuffer(blob) method, when invoked,\n // must initiate a read operation for blob with ArrayBuffer.\n readOperation(this, blob, 'ArrayBuffer')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#readAsBinaryString\n * @param {import('buffer').Blob} blob\n */\n readAsBinaryString (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsBinaryString' })\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsBinaryString(blob) method, when invoked,\n // must initiate a read operation for blob with BinaryString.\n readOperation(this, blob, 'BinaryString')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#readAsDataText\n * @param {import('buffer').Blob} blob\n * @param {string?} encoding\n */\n readAsText (blob, encoding = undefined) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsText' })\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n if (encoding !== undefined) {\n encoding = webidl.converters.DOMString(encoding)\n }\n\n // The readAsText(blob, encoding) method, when invoked,\n // must initiate a read operation for blob with Text and encoding.\n readOperation(this, blob, 'Text', encoding)\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-readAsDataURL\n * @param {import('buffer').Blob} blob\n */\n readAsDataURL (blob) {\n webidl.brandCheck(this, FileReader)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'FileReader.readAsDataURL' })\n\n blob = webidl.converters.Blob(blob, { strict: false })\n\n // The readAsDataURL(blob) method, when invoked, must\n // initiate a read operation for blob with DataURL.\n readOperation(this, blob, 'DataURL')\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dfn-abort\n */\n abort () {\n // 1. If this's state is \"empty\" or if this's state is\n // \"done\" set this's result to null and terminate\n // this algorithm.\n if (this[kState] === 'empty' || this[kState] === 'done') {\n this[kResult] = null\n return\n }\n\n // 2. If this's state is \"loading\" set this's state to\n // \"done\" and set this's result to null.\n if (this[kState] === 'loading') {\n this[kState] = 'done'\n this[kResult] = null\n }\n\n // 3. If there are any tasks from this on the file reading\n // task source in an affiliated task queue, then remove\n // those tasks from that task queue.\n this[kAborted] = true\n\n // 4. Terminate the algorithm for the read method being processed.\n // TODO\n\n // 5. Fire a progress event called abort at this.\n fireAProgressEvent('abort', this)\n\n // 6. If this's state is not \"loading\", fire a progress\n // event called loadend at this.\n if (this[kState] !== 'loading') {\n fireAProgressEvent('loadend', this)\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-readystate\n */\n get readyState () {\n webidl.brandCheck(this, FileReader)\n\n switch (this[kState]) {\n case 'empty': return this.EMPTY\n case 'loading': return this.LOADING\n case 'done': return this.DONE\n }\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-result\n */\n get result () {\n webidl.brandCheck(this, FileReader)\n\n // The result attribute’s getter, when invoked, must return\n // this's result.\n return this[kResult]\n }\n\n /**\n * @see https://w3c.github.io/FileAPI/#dom-filereader-error\n */\n get error () {\n webidl.brandCheck(this, FileReader)\n\n // The error attribute’s getter, when invoked, must return\n // this's error.\n return this[kError]\n }\n\n get onloadend () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].loadend\n }\n\n set onloadend (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].loadend) {\n this.removeEventListener('loadend', this[kEvents].loadend)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].loadend = fn\n this.addEventListener('loadend', fn)\n } else {\n this[kEvents].loadend = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].error) {\n this.removeEventListener('error', this[kEvents].error)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].error = fn\n this.addEventListener('error', fn)\n } else {\n this[kEvents].error = null\n }\n }\n\n get onloadstart () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].loadstart\n }\n\n set onloadstart (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].loadstart) {\n this.removeEventListener('loadstart', this[kEvents].loadstart)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].loadstart = fn\n this.addEventListener('loadstart', fn)\n } else {\n this[kEvents].loadstart = null\n }\n }\n\n get onprogress () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].progress\n }\n\n set onprogress (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].progress) {\n this.removeEventListener('progress', this[kEvents].progress)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].progress = fn\n this.addEventListener('progress', fn)\n } else {\n this[kEvents].progress = null\n }\n }\n\n get onload () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].load\n }\n\n set onload (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].load) {\n this.removeEventListener('load', this[kEvents].load)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].load = fn\n this.addEventListener('load', fn)\n } else {\n this[kEvents].load = null\n }\n }\n\n get onabort () {\n webidl.brandCheck(this, FileReader)\n\n return this[kEvents].abort\n }\n\n set onabort (fn) {\n webidl.brandCheck(this, FileReader)\n\n if (this[kEvents].abort) {\n this.removeEventListener('abort', this[kEvents].abort)\n }\n\n if (typeof fn === 'function') {\n this[kEvents].abort = fn\n this.addEventListener('abort', fn)\n } else {\n this[kEvents].abort = null\n }\n }\n}\n\n// https://w3c.github.io/FileAPI/#dom-filereader-empty\nFileReader.EMPTY = FileReader.prototype.EMPTY = 0\n// https://w3c.github.io/FileAPI/#dom-filereader-loading\nFileReader.LOADING = FileReader.prototype.LOADING = 1\n// https://w3c.github.io/FileAPI/#dom-filereader-done\nFileReader.DONE = FileReader.prototype.DONE = 2\n\nObject.defineProperties(FileReader.prototype, {\n EMPTY: staticPropertyDescriptors,\n LOADING: staticPropertyDescriptors,\n DONE: staticPropertyDescriptors,\n readAsArrayBuffer: kEnumerableProperty,\n readAsBinaryString: kEnumerableProperty,\n readAsText: kEnumerableProperty,\n readAsDataURL: kEnumerableProperty,\n abort: kEnumerableProperty,\n readyState: kEnumerableProperty,\n result: kEnumerableProperty,\n error: kEnumerableProperty,\n onloadstart: kEnumerableProperty,\n onprogress: kEnumerableProperty,\n onload: kEnumerableProperty,\n onabort: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onloadend: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'FileReader',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(FileReader, {\n EMPTY: staticPropertyDescriptors,\n LOADING: staticPropertyDescriptors,\n DONE: staticPropertyDescriptors\n})\n\nmodule.exports = {\n FileReader\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\n\nconst kState = Symbol('ProgressEvent state')\n\n/**\n * @see https://xhr.spec.whatwg.org/#progressevent\n */\nclass ProgressEvent extends Event {\n constructor (type, eventInitDict = {}) {\n type = webidl.converters.DOMString(type)\n eventInitDict = webidl.converters.ProgressEventInit(eventInitDict ?? {})\n\n super(type, eventInitDict)\n\n this[kState] = {\n lengthComputable: eventInitDict.lengthComputable,\n loaded: eventInitDict.loaded,\n total: eventInitDict.total\n }\n }\n\n get lengthComputable () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].lengthComputable\n }\n\n get loaded () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].loaded\n }\n\n get total () {\n webidl.brandCheck(this, ProgressEvent)\n\n return this[kState].total\n }\n}\n\nwebidl.converters.ProgressEventInit = webidl.dictionaryConverter([\n {\n key: 'lengthComputable',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'loaded',\n converter: webidl.converters['unsigned long long'],\n defaultValue: 0\n },\n {\n key: 'total',\n converter: webidl.converters['unsigned long long'],\n defaultValue: 0\n },\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: false\n }\n])\n\nmodule.exports = {\n ProgressEvent\n}\n","'use strict'\n\nmodule.exports = {\n kState: Symbol('FileReader state'),\n kResult: Symbol('FileReader result'),\n kError: Symbol('FileReader error'),\n kLastProgressEventFired: Symbol('FileReader last progress event fired timestamp'),\n kEvents: Symbol('FileReader events'),\n kAborted: Symbol('FileReader aborted')\n}\n","'use strict'\n\nconst {\n kState,\n kError,\n kResult,\n kAborted,\n kLastProgressEventFired\n} = require('./symbols')\nconst { ProgressEvent } = require('./progressevent')\nconst { getEncoding } = require('./encoding')\nconst { DOMException } = require('../fetch/constants')\nconst { serializeAMimeType, parseMIMEType } = require('../fetch/dataURL')\nconst { types } = require('util')\nconst { StringDecoder } = require('string_decoder')\nconst { btoa } = require('buffer')\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#readOperation\n * @param {import('./filereader').FileReader} fr\n * @param {import('buffer').Blob} blob\n * @param {string} type\n * @param {string?} encodingName\n */\nfunction readOperation (fr, blob, type, encodingName) {\n // 1. If fr’s state is \"loading\", throw an InvalidStateError\n // DOMException.\n if (fr[kState] === 'loading') {\n throw new DOMException('Invalid state', 'InvalidStateError')\n }\n\n // 2. Set fr’s state to \"loading\".\n fr[kState] = 'loading'\n\n // 3. Set fr’s result to null.\n fr[kResult] = null\n\n // 4. Set fr’s error to null.\n fr[kError] = null\n\n // 5. Let stream be the result of calling get stream on blob.\n /** @type {import('stream/web').ReadableStream} */\n const stream = blob.stream()\n\n // 6. Let reader be the result of getting a reader from stream.\n const reader = stream.getReader()\n\n // 7. Let bytes be an empty byte sequence.\n /** @type {Uint8Array[]} */\n const bytes = []\n\n // 8. Let chunkPromise be the result of reading a chunk from\n // stream with reader.\n let chunkPromise = reader.read()\n\n // 9. Let isFirstChunk be true.\n let isFirstChunk = true\n\n // 10. In parallel, while true:\n // Note: \"In parallel\" just means non-blocking\n // Note 2: readOperation itself cannot be async as double\n // reading the body would then reject the promise, instead\n // of throwing an error.\n ;(async () => {\n while (!fr[kAborted]) {\n // 1. Wait for chunkPromise to be fulfilled or rejected.\n try {\n const { done, value } = await chunkPromise\n\n // 2. If chunkPromise is fulfilled, and isFirstChunk is\n // true, queue a task to fire a progress event called\n // loadstart at fr.\n if (isFirstChunk && !fr[kAborted]) {\n queueMicrotask(() => {\n fireAProgressEvent('loadstart', fr)\n })\n }\n\n // 3. Set isFirstChunk to false.\n isFirstChunk = false\n\n // 4. If chunkPromise is fulfilled with an object whose\n // done property is false and whose value property is\n // a Uint8Array object, run these steps:\n if (!done && types.isUint8Array(value)) {\n // 1. Let bs be the byte sequence represented by the\n // Uint8Array object.\n\n // 2. Append bs to bytes.\n bytes.push(value)\n\n // 3. If roughly 50ms have passed since these steps\n // were last invoked, queue a task to fire a\n // progress event called progress at fr.\n if (\n (\n fr[kLastProgressEventFired] === undefined ||\n Date.now() - fr[kLastProgressEventFired] >= 50\n ) &&\n !fr[kAborted]\n ) {\n fr[kLastProgressEventFired] = Date.now()\n queueMicrotask(() => {\n fireAProgressEvent('progress', fr)\n })\n }\n\n // 4. Set chunkPromise to the result of reading a\n // chunk from stream with reader.\n chunkPromise = reader.read()\n } else if (done) {\n // 5. Otherwise, if chunkPromise is fulfilled with an\n // object whose done property is true, queue a task\n // to run the following steps and abort this algorithm:\n queueMicrotask(() => {\n // 1. Set fr’s state to \"done\".\n fr[kState] = 'done'\n\n // 2. Let result be the result of package data given\n // bytes, type, blob’s type, and encodingName.\n try {\n const result = packageData(bytes, type, blob.type, encodingName)\n\n // 4. Else:\n\n if (fr[kAborted]) {\n return\n }\n\n // 1. Set fr’s result to result.\n fr[kResult] = result\n\n // 2. Fire a progress event called load at the fr.\n fireAProgressEvent('load', fr)\n } catch (error) {\n // 3. If package data threw an exception error:\n\n // 1. Set fr’s error to error.\n fr[kError] = error\n\n // 2. Fire a progress event called error at fr.\n fireAProgressEvent('error', fr)\n }\n\n // 5. If fr’s state is not \"loading\", fire a progress\n // event called loadend at the fr.\n if (fr[kState] !== 'loading') {\n fireAProgressEvent('loadend', fr)\n }\n })\n\n break\n }\n } catch (error) {\n if (fr[kAborted]) {\n return\n }\n\n // 6. Otherwise, if chunkPromise is rejected with an\n // error error, queue a task to run the following\n // steps and abort this algorithm:\n queueMicrotask(() => {\n // 1. Set fr’s state to \"done\".\n fr[kState] = 'done'\n\n // 2. Set fr’s error to error.\n fr[kError] = error\n\n // 3. Fire a progress event called error at fr.\n fireAProgressEvent('error', fr)\n\n // 4. If fr’s state is not \"loading\", fire a progress\n // event called loadend at fr.\n if (fr[kState] !== 'loading') {\n fireAProgressEvent('loadend', fr)\n }\n })\n\n break\n }\n }\n })()\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#fire-a-progress-event\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e The name of the event\n * @param {import('./filereader').FileReader} reader\n */\nfunction fireAProgressEvent (e, reader) {\n // The progress event e does not bubble. e.bubbles must be false\n // The progress event e is NOT cancelable. e.cancelable must be false\n const event = new ProgressEvent(e, {\n bubbles: false,\n cancelable: false\n })\n\n reader.dispatchEvent(event)\n}\n\n/**\n * @see https://w3c.github.io/FileAPI/#blob-package-data\n * @param {Uint8Array[]} bytes\n * @param {string} type\n * @param {string?} mimeType\n * @param {string?} encodingName\n */\nfunction packageData (bytes, type, mimeType, encodingName) {\n // 1. A Blob has an associated package data algorithm, given\n // bytes, a type, a optional mimeType, and a optional\n // encodingName, which switches on type and runs the\n // associated steps:\n\n switch (type) {\n case 'DataURL': {\n // 1. Return bytes as a DataURL [RFC2397] subject to\n // the considerations below:\n // * Use mimeType as part of the Data URL if it is\n // available in keeping with the Data URL\n // specification [RFC2397].\n // * If mimeType is not available return a Data URL\n // without a media-type. [RFC2397].\n\n // https://datatracker.ietf.org/doc/html/rfc2397#section-3\n // dataurl := \"data:\" [ mediatype ] [ \";base64\" ] \",\" data\n // mediatype := [ type \"/\" subtype ] *( \";\" parameter )\n // data := *urlchar\n // parameter := attribute \"=\" value\n let dataURL = 'data:'\n\n const parsed = parseMIMEType(mimeType || 'application/octet-stream')\n\n if (parsed !== 'failure') {\n dataURL += serializeAMimeType(parsed)\n }\n\n dataURL += ';base64,'\n\n const decoder = new StringDecoder('latin1')\n\n for (const chunk of bytes) {\n dataURL += btoa(decoder.write(chunk))\n }\n\n dataURL += btoa(decoder.end())\n\n return dataURL\n }\n case 'Text': {\n // 1. Let encoding be failure\n let encoding = 'failure'\n\n // 2. If the encodingName is present, set encoding to the\n // result of getting an encoding from encodingName.\n if (encodingName) {\n encoding = getEncoding(encodingName)\n }\n\n // 3. If encoding is failure, and mimeType is present:\n if (encoding === 'failure' && mimeType) {\n // 1. Let type be the result of parse a MIME type\n // given mimeType.\n const type = parseMIMEType(mimeType)\n\n // 2. If type is not failure, set encoding to the result\n // of getting an encoding from type’s parameters[\"charset\"].\n if (type !== 'failure') {\n encoding = getEncoding(type.parameters.get('charset'))\n }\n }\n\n // 4. If encoding is failure, then set encoding to UTF-8.\n if (encoding === 'failure') {\n encoding = 'UTF-8'\n }\n\n // 5. Decode bytes using fallback encoding encoding, and\n // return the result.\n return decode(bytes, encoding)\n }\n case 'ArrayBuffer': {\n // Return a new ArrayBuffer whose contents are bytes.\n const sequence = combineByteSequences(bytes)\n\n return sequence.buffer\n }\n case 'BinaryString': {\n // Return bytes as a binary string, in which every byte\n // is represented by a code unit of equal value [0..255].\n let binaryString = ''\n\n const decoder = new StringDecoder('latin1')\n\n for (const chunk of bytes) {\n binaryString += decoder.write(chunk)\n }\n\n binaryString += decoder.end()\n\n return binaryString\n }\n }\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#decode\n * @param {Uint8Array[]} ioQueue\n * @param {string} encoding\n */\nfunction decode (ioQueue, encoding) {\n const bytes = combineByteSequences(ioQueue)\n\n // 1. Let BOMEncoding be the result of BOM sniffing ioQueue.\n const BOMEncoding = BOMSniffing(bytes)\n\n let slice = 0\n\n // 2. If BOMEncoding is non-null:\n if (BOMEncoding !== null) {\n // 1. Set encoding to BOMEncoding.\n encoding = BOMEncoding\n\n // 2. Read three bytes from ioQueue, if BOMEncoding is\n // UTF-8; otherwise read two bytes.\n // (Do nothing with those bytes.)\n slice = BOMEncoding === 'UTF-8' ? 3 : 2\n }\n\n // 3. Process a queue with an instance of encoding’s\n // decoder, ioQueue, output, and \"replacement\".\n\n // 4. Return output.\n\n const sliced = bytes.slice(slice)\n return new TextDecoder(encoding).decode(sliced)\n}\n\n/**\n * @see https://encoding.spec.whatwg.org/#bom-sniff\n * @param {Uint8Array} ioQueue\n */\nfunction BOMSniffing (ioQueue) {\n // 1. Let BOM be the result of peeking 3 bytes from ioQueue,\n // converted to a byte sequence.\n const [a, b, c] = ioQueue\n\n // 2. For each of the rows in the table below, starting with\n // the first one and going down, if BOM starts with the\n // bytes given in the first column, then return the\n // encoding given in the cell in the second column of that\n // row. Otherwise, return null.\n if (a === 0xEF && b === 0xBB && c === 0xBF) {\n return 'UTF-8'\n } else if (a === 0xFE && b === 0xFF) {\n return 'UTF-16BE'\n } else if (a === 0xFF && b === 0xFE) {\n return 'UTF-16LE'\n }\n\n return null\n}\n\n/**\n * @param {Uint8Array[]} sequences\n */\nfunction combineByteSequences (sequences) {\n const size = sequences.reduce((a, b) => {\n return a + b.byteLength\n }, 0)\n\n let offset = 0\n\n return sequences.reduce((a, b) => {\n a.set(b, offset)\n offset += b.byteLength\n return a\n }, new Uint8Array(size))\n}\n\nmodule.exports = {\n staticPropertyDescriptors,\n readOperation,\n fireAProgressEvent\n}\n","'use strict'\n\n// We include a version number for the Dispatcher API. In case of breaking changes,\n// this version number must be increased to avoid conflicts.\nconst globalDispatcher = Symbol.for('undici.globalDispatcher.1')\nconst { InvalidArgumentError } = require('./core/errors')\nconst Agent = require('./agent')\n\nif (getGlobalDispatcher() === undefined) {\n setGlobalDispatcher(new Agent())\n}\n\nfunction setGlobalDispatcher (agent) {\n if (!agent || typeof agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument agent must implement Agent')\n }\n Object.defineProperty(globalThis, globalDispatcher, {\n value: agent,\n writable: true,\n enumerable: false,\n configurable: false\n })\n}\n\nfunction getGlobalDispatcher () {\n return globalThis[globalDispatcher]\n}\n\nmodule.exports = {\n setGlobalDispatcher,\n getGlobalDispatcher\n}\n","'use strict'\n\nmodule.exports = class DecoratorHandler {\n constructor (handler) {\n this.handler = handler\n }\n\n onConnect (...args) {\n return this.handler.onConnect(...args)\n }\n\n onError (...args) {\n return this.handler.onError(...args)\n }\n\n onUpgrade (...args) {\n return this.handler.onUpgrade(...args)\n }\n\n onHeaders (...args) {\n return this.handler.onHeaders(...args)\n }\n\n onData (...args) {\n return this.handler.onData(...args)\n }\n\n onComplete (...args) {\n return this.handler.onComplete(...args)\n }\n\n onBodySent (...args) {\n return this.handler.onBodySent(...args)\n }\n}\n","'use strict'\n\nconst util = require('../core/util')\nconst { kBodyUsed } = require('../core/symbols')\nconst assert = require('assert')\nconst { InvalidArgumentError } = require('../core/errors')\nconst EE = require('events')\n\nconst redirectableStatusCodes = [300, 301, 302, 303, 307, 308]\n\nconst kBody = Symbol('body')\n\nclass BodyAsyncIterable {\n constructor (body) {\n this[kBody] = body\n this[kBodyUsed] = false\n }\n\n async * [Symbol.asyncIterator] () {\n assert(!this[kBodyUsed], 'disturbed')\n this[kBodyUsed] = true\n yield * this[kBody]\n }\n}\n\nclass RedirectHandler {\n constructor (dispatch, maxRedirections, opts, handler) {\n if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {\n throw new InvalidArgumentError('maxRedirections must be a positive number')\n }\n\n util.validateHandler(handler, opts.method, opts.upgrade)\n\n this.dispatch = dispatch\n this.location = null\n this.abort = null\n this.opts = { ...opts, maxRedirections: 0 } // opts must be a copy\n this.maxRedirections = maxRedirections\n this.handler = handler\n this.history = []\n\n if (util.isStream(this.opts.body)) {\n // TODO (fix): Provide some way for the user to cache the file to e.g. /tmp\n // so that it can be dispatched again?\n // TODO (fix): Do we need 100-expect support to provide a way to do this properly?\n if (util.bodyLength(this.opts.body) === 0) {\n this.opts.body\n .on('data', function () {\n assert(false)\n })\n }\n\n if (typeof this.opts.body.readableDidRead !== 'boolean') {\n this.opts.body[kBodyUsed] = false\n EE.prototype.on.call(this.opts.body, 'data', function () {\n this[kBodyUsed] = true\n })\n }\n } else if (this.opts.body && typeof this.opts.body.pipeTo === 'function') {\n // TODO (fix): We can't access ReadableStream internal state\n // to determine whether or not it has been disturbed. This is just\n // a workaround.\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n } else if (\n this.opts.body &&\n typeof this.opts.body !== 'string' &&\n !ArrayBuffer.isView(this.opts.body) &&\n util.isIterable(this.opts.body)\n ) {\n // TODO: Should we allow re-using iterable if !this.opts.idempotent\n // or through some other flag?\n this.opts.body = new BodyAsyncIterable(this.opts.body)\n }\n }\n\n onConnect (abort) {\n this.abort = abort\n this.handler.onConnect(abort, { history: this.history })\n }\n\n onUpgrade (statusCode, headers, socket) {\n this.handler.onUpgrade(statusCode, headers, socket)\n }\n\n onError (error) {\n this.handler.onError(error)\n }\n\n onHeaders (statusCode, headers, resume, statusText) {\n this.location = this.history.length >= this.maxRedirections || util.isDisturbed(this.opts.body)\n ? null\n : parseLocation(statusCode, headers)\n\n if (this.opts.origin) {\n this.history.push(new URL(this.opts.path, this.opts.origin))\n }\n\n if (!this.location) {\n return this.handler.onHeaders(statusCode, headers, resume, statusText)\n }\n\n const { origin, pathname, search } = util.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)))\n const path = search ? `${pathname}${search}` : pathname\n\n // Remove headers referring to the original URL.\n // By default it is Host only, unless it's a 303 (see below), which removes also all Content-* headers.\n // https://tools.ietf.org/html/rfc7231#section-6.4\n this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin)\n this.opts.path = path\n this.opts.origin = origin\n this.opts.maxRedirections = 0\n this.opts.query = null\n\n // https://tools.ietf.org/html/rfc7231#section-6.4.4\n // In case of HTTP 303, always replace method to be either HEAD or GET\n if (statusCode === 303 && this.opts.method !== 'HEAD') {\n this.opts.method = 'GET'\n this.opts.body = null\n }\n }\n\n onData (chunk) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response bodies.\n\n Redirection is used to serve the requested resource from another URL, so it is assumes that\n no body is generated (and thus can be ignored). Even though generating a body is not prohibited.\n\n For status 301, 302, 303, 307 and 308 (the latter from RFC 7238), the specs mention that the body usually\n (which means it's optional and not mandated) contain just an hyperlink to the value of\n the Location response header, so the body can be ignored safely.\n\n For status 300, which is \"Multiple Choices\", the spec mentions both generating a Location\n response header AND a response body with the other possible location to follow.\n Since the spec explicitily chooses not to specify a format for such body and leave it to\n servers and browsers implementors, we ignore the body as there is no specified way to eventually parse it.\n */\n } else {\n return this.handler.onData(chunk)\n }\n }\n\n onComplete (trailers) {\n if (this.location) {\n /*\n https://tools.ietf.org/html/rfc7231#section-6.4\n\n TLDR: undici always ignores 3xx response trailers as they are not expected in case of redirections\n and neither are useful if present.\n\n See comment on onData method above for more detailed informations.\n */\n\n this.location = null\n this.abort = null\n\n this.dispatch(this.opts, this)\n } else {\n this.handler.onComplete(trailers)\n }\n }\n\n onBodySent (chunk) {\n if (this.handler.onBodySent) {\n this.handler.onBodySent(chunk)\n }\n }\n}\n\nfunction parseLocation (statusCode, headers) {\n if (redirectableStatusCodes.indexOf(statusCode) === -1) {\n return null\n }\n\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].toString().toLowerCase() === 'location') {\n return headers[i + 1]\n }\n }\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4.4\nfunction shouldRemoveHeader (header, removeContent, unknownOrigin) {\n return (\n (header.length === 4 && header.toString().toLowerCase() === 'host') ||\n (removeContent && header.toString().toLowerCase().indexOf('content-') === 0) ||\n (unknownOrigin && header.length === 13 && header.toString().toLowerCase() === 'authorization') ||\n (unknownOrigin && header.length === 6 && header.toString().toLowerCase() === 'cookie')\n )\n}\n\n// https://tools.ietf.org/html/rfc7231#section-6.4\nfunction cleanRequestHeaders (headers, removeContent, unknownOrigin) {\n const ret = []\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (!shouldRemoveHeader(headers[i], removeContent, unknownOrigin)) {\n ret.push(headers[i], headers[i + 1])\n }\n }\n } else if (headers && typeof headers === 'object') {\n for (const key of Object.keys(headers)) {\n if (!shouldRemoveHeader(key, removeContent, unknownOrigin)) {\n ret.push(key, headers[key])\n }\n }\n } else {\n assert(headers == null, 'headers must be an object or an array')\n }\n return ret\n}\n\nmodule.exports = RedirectHandler\n","'use strict'\n\nconst RedirectHandler = require('../handler/RedirectHandler')\n\nfunction createRedirectInterceptor ({ maxRedirections: defaultMaxRedirections }) {\n return (dispatch) => {\n return function Intercept (opts, handler) {\n const { maxRedirections = defaultMaxRedirections } = opts\n\n if (!maxRedirections) {\n return dispatch(opts, handler)\n }\n\n const redirectHandler = new RedirectHandler(dispatch, maxRedirections, opts, handler)\n opts = { ...opts, maxRedirections: 0 } // Stop sub dispatcher from also redirecting.\n return dispatch(opts, redirectHandler)\n }\n }\n}\n\nmodule.exports = createRedirectInterceptor\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SPECIAL_HEADERS = exports.HEADER_STATE = exports.MINOR = exports.MAJOR = exports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS = exports.TOKEN = exports.STRICT_TOKEN = exports.HEX = exports.URL_CHAR = exports.STRICT_URL_CHAR = exports.USERINFO_CHARS = exports.MARK = exports.ALPHANUM = exports.NUM = exports.HEX_MAP = exports.NUM_MAP = exports.ALPHA = exports.FINISH = exports.H_METHOD_MAP = exports.METHOD_MAP = exports.METHODS_RTSP = exports.METHODS_ICE = exports.METHODS_HTTP = exports.METHODS = exports.LENIENT_FLAGS = exports.FLAGS = exports.TYPE = exports.ERROR = void 0;\nconst utils_1 = require(\"./utils\");\n// C headers\nvar ERROR;\n(function (ERROR) {\n ERROR[ERROR[\"OK\"] = 0] = \"OK\";\n ERROR[ERROR[\"INTERNAL\"] = 1] = \"INTERNAL\";\n ERROR[ERROR[\"STRICT\"] = 2] = \"STRICT\";\n ERROR[ERROR[\"LF_EXPECTED\"] = 3] = \"LF_EXPECTED\";\n ERROR[ERROR[\"UNEXPECTED_CONTENT_LENGTH\"] = 4] = \"UNEXPECTED_CONTENT_LENGTH\";\n ERROR[ERROR[\"CLOSED_CONNECTION\"] = 5] = \"CLOSED_CONNECTION\";\n ERROR[ERROR[\"INVALID_METHOD\"] = 6] = \"INVALID_METHOD\";\n ERROR[ERROR[\"INVALID_URL\"] = 7] = \"INVALID_URL\";\n ERROR[ERROR[\"INVALID_CONSTANT\"] = 8] = \"INVALID_CONSTANT\";\n ERROR[ERROR[\"INVALID_VERSION\"] = 9] = \"INVALID_VERSION\";\n ERROR[ERROR[\"INVALID_HEADER_TOKEN\"] = 10] = \"INVALID_HEADER_TOKEN\";\n ERROR[ERROR[\"INVALID_CONTENT_LENGTH\"] = 11] = \"INVALID_CONTENT_LENGTH\";\n ERROR[ERROR[\"INVALID_CHUNK_SIZE\"] = 12] = \"INVALID_CHUNK_SIZE\";\n ERROR[ERROR[\"INVALID_STATUS\"] = 13] = \"INVALID_STATUS\";\n ERROR[ERROR[\"INVALID_EOF_STATE\"] = 14] = \"INVALID_EOF_STATE\";\n ERROR[ERROR[\"INVALID_TRANSFER_ENCODING\"] = 15] = \"INVALID_TRANSFER_ENCODING\";\n ERROR[ERROR[\"CB_MESSAGE_BEGIN\"] = 16] = \"CB_MESSAGE_BEGIN\";\n ERROR[ERROR[\"CB_HEADERS_COMPLETE\"] = 17] = \"CB_HEADERS_COMPLETE\";\n ERROR[ERROR[\"CB_MESSAGE_COMPLETE\"] = 18] = \"CB_MESSAGE_COMPLETE\";\n ERROR[ERROR[\"CB_CHUNK_HEADER\"] = 19] = \"CB_CHUNK_HEADER\";\n ERROR[ERROR[\"CB_CHUNK_COMPLETE\"] = 20] = \"CB_CHUNK_COMPLETE\";\n ERROR[ERROR[\"PAUSED\"] = 21] = \"PAUSED\";\n ERROR[ERROR[\"PAUSED_UPGRADE\"] = 22] = \"PAUSED_UPGRADE\";\n ERROR[ERROR[\"PAUSED_H2_UPGRADE\"] = 23] = \"PAUSED_H2_UPGRADE\";\n ERROR[ERROR[\"USER\"] = 24] = \"USER\";\n})(ERROR = exports.ERROR || (exports.ERROR = {}));\nvar TYPE;\n(function (TYPE) {\n TYPE[TYPE[\"BOTH\"] = 0] = \"BOTH\";\n TYPE[TYPE[\"REQUEST\"] = 1] = \"REQUEST\";\n TYPE[TYPE[\"RESPONSE\"] = 2] = \"RESPONSE\";\n})(TYPE = exports.TYPE || (exports.TYPE = {}));\nvar FLAGS;\n(function (FLAGS) {\n FLAGS[FLAGS[\"CONNECTION_KEEP_ALIVE\"] = 1] = \"CONNECTION_KEEP_ALIVE\";\n FLAGS[FLAGS[\"CONNECTION_CLOSE\"] = 2] = \"CONNECTION_CLOSE\";\n FLAGS[FLAGS[\"CONNECTION_UPGRADE\"] = 4] = \"CONNECTION_UPGRADE\";\n FLAGS[FLAGS[\"CHUNKED\"] = 8] = \"CHUNKED\";\n FLAGS[FLAGS[\"UPGRADE\"] = 16] = \"UPGRADE\";\n FLAGS[FLAGS[\"CONTENT_LENGTH\"] = 32] = \"CONTENT_LENGTH\";\n FLAGS[FLAGS[\"SKIPBODY\"] = 64] = \"SKIPBODY\";\n FLAGS[FLAGS[\"TRAILING\"] = 128] = \"TRAILING\";\n // 1 << 8 is unused\n FLAGS[FLAGS[\"TRANSFER_ENCODING\"] = 512] = \"TRANSFER_ENCODING\";\n})(FLAGS = exports.FLAGS || (exports.FLAGS = {}));\nvar LENIENT_FLAGS;\n(function (LENIENT_FLAGS) {\n LENIENT_FLAGS[LENIENT_FLAGS[\"HEADERS\"] = 1] = \"HEADERS\";\n LENIENT_FLAGS[LENIENT_FLAGS[\"CHUNKED_LENGTH\"] = 2] = \"CHUNKED_LENGTH\";\n LENIENT_FLAGS[LENIENT_FLAGS[\"KEEP_ALIVE\"] = 4] = \"KEEP_ALIVE\";\n})(LENIENT_FLAGS = exports.LENIENT_FLAGS || (exports.LENIENT_FLAGS = {}));\nvar METHODS;\n(function (METHODS) {\n METHODS[METHODS[\"DELETE\"] = 0] = \"DELETE\";\n METHODS[METHODS[\"GET\"] = 1] = \"GET\";\n METHODS[METHODS[\"HEAD\"] = 2] = \"HEAD\";\n METHODS[METHODS[\"POST\"] = 3] = \"POST\";\n METHODS[METHODS[\"PUT\"] = 4] = \"PUT\";\n /* pathological */\n METHODS[METHODS[\"CONNECT\"] = 5] = \"CONNECT\";\n METHODS[METHODS[\"OPTIONS\"] = 6] = \"OPTIONS\";\n METHODS[METHODS[\"TRACE\"] = 7] = \"TRACE\";\n /* WebDAV */\n METHODS[METHODS[\"COPY\"] = 8] = \"COPY\";\n METHODS[METHODS[\"LOCK\"] = 9] = \"LOCK\";\n METHODS[METHODS[\"MKCOL\"] = 10] = \"MKCOL\";\n METHODS[METHODS[\"MOVE\"] = 11] = \"MOVE\";\n METHODS[METHODS[\"PROPFIND\"] = 12] = \"PROPFIND\";\n METHODS[METHODS[\"PROPPATCH\"] = 13] = \"PROPPATCH\";\n METHODS[METHODS[\"SEARCH\"] = 14] = \"SEARCH\";\n METHODS[METHODS[\"UNLOCK\"] = 15] = \"UNLOCK\";\n METHODS[METHODS[\"BIND\"] = 16] = \"BIND\";\n METHODS[METHODS[\"REBIND\"] = 17] = \"REBIND\";\n METHODS[METHODS[\"UNBIND\"] = 18] = \"UNBIND\";\n METHODS[METHODS[\"ACL\"] = 19] = \"ACL\";\n /* subversion */\n METHODS[METHODS[\"REPORT\"] = 20] = \"REPORT\";\n METHODS[METHODS[\"MKACTIVITY\"] = 21] = \"MKACTIVITY\";\n METHODS[METHODS[\"CHECKOUT\"] = 22] = \"CHECKOUT\";\n METHODS[METHODS[\"MERGE\"] = 23] = \"MERGE\";\n /* upnp */\n METHODS[METHODS[\"M-SEARCH\"] = 24] = \"M-SEARCH\";\n METHODS[METHODS[\"NOTIFY\"] = 25] = \"NOTIFY\";\n METHODS[METHODS[\"SUBSCRIBE\"] = 26] = \"SUBSCRIBE\";\n METHODS[METHODS[\"UNSUBSCRIBE\"] = 27] = \"UNSUBSCRIBE\";\n /* RFC-5789 */\n METHODS[METHODS[\"PATCH\"] = 28] = \"PATCH\";\n METHODS[METHODS[\"PURGE\"] = 29] = \"PURGE\";\n /* CalDAV */\n METHODS[METHODS[\"MKCALENDAR\"] = 30] = \"MKCALENDAR\";\n /* RFC-2068, section 19.6.1.2 */\n METHODS[METHODS[\"LINK\"] = 31] = \"LINK\";\n METHODS[METHODS[\"UNLINK\"] = 32] = \"UNLINK\";\n /* icecast */\n METHODS[METHODS[\"SOURCE\"] = 33] = \"SOURCE\";\n /* RFC-7540, section 11.6 */\n METHODS[METHODS[\"PRI\"] = 34] = \"PRI\";\n /* RFC-2326 RTSP */\n METHODS[METHODS[\"DESCRIBE\"] = 35] = \"DESCRIBE\";\n METHODS[METHODS[\"ANNOUNCE\"] = 36] = \"ANNOUNCE\";\n METHODS[METHODS[\"SETUP\"] = 37] = \"SETUP\";\n METHODS[METHODS[\"PLAY\"] = 38] = \"PLAY\";\n METHODS[METHODS[\"PAUSE\"] = 39] = \"PAUSE\";\n METHODS[METHODS[\"TEARDOWN\"] = 40] = \"TEARDOWN\";\n METHODS[METHODS[\"GET_PARAMETER\"] = 41] = \"GET_PARAMETER\";\n METHODS[METHODS[\"SET_PARAMETER\"] = 42] = \"SET_PARAMETER\";\n METHODS[METHODS[\"REDIRECT\"] = 43] = \"REDIRECT\";\n METHODS[METHODS[\"RECORD\"] = 44] = \"RECORD\";\n /* RAOP */\n METHODS[METHODS[\"FLUSH\"] = 45] = \"FLUSH\";\n})(METHODS = exports.METHODS || (exports.METHODS = {}));\nexports.METHODS_HTTP = [\n METHODS.DELETE,\n METHODS.GET,\n METHODS.HEAD,\n METHODS.POST,\n METHODS.PUT,\n METHODS.CONNECT,\n METHODS.OPTIONS,\n METHODS.TRACE,\n METHODS.COPY,\n METHODS.LOCK,\n METHODS.MKCOL,\n METHODS.MOVE,\n METHODS.PROPFIND,\n METHODS.PROPPATCH,\n METHODS.SEARCH,\n METHODS.UNLOCK,\n METHODS.BIND,\n METHODS.REBIND,\n METHODS.UNBIND,\n METHODS.ACL,\n METHODS.REPORT,\n METHODS.MKACTIVITY,\n METHODS.CHECKOUT,\n METHODS.MERGE,\n METHODS['M-SEARCH'],\n METHODS.NOTIFY,\n METHODS.SUBSCRIBE,\n METHODS.UNSUBSCRIBE,\n METHODS.PATCH,\n METHODS.PURGE,\n METHODS.MKCALENDAR,\n METHODS.LINK,\n METHODS.UNLINK,\n METHODS.PRI,\n // TODO(indutny): should we allow it with HTTP?\n METHODS.SOURCE,\n];\nexports.METHODS_ICE = [\n METHODS.SOURCE,\n];\nexports.METHODS_RTSP = [\n METHODS.OPTIONS,\n METHODS.DESCRIBE,\n METHODS.ANNOUNCE,\n METHODS.SETUP,\n METHODS.PLAY,\n METHODS.PAUSE,\n METHODS.TEARDOWN,\n METHODS.GET_PARAMETER,\n METHODS.SET_PARAMETER,\n METHODS.REDIRECT,\n METHODS.RECORD,\n METHODS.FLUSH,\n // For AirPlay\n METHODS.GET,\n METHODS.POST,\n];\nexports.METHOD_MAP = utils_1.enumToMap(METHODS);\nexports.H_METHOD_MAP = {};\nObject.keys(exports.METHOD_MAP).forEach((key) => {\n if (/^H/.test(key)) {\n exports.H_METHOD_MAP[key] = exports.METHOD_MAP[key];\n }\n});\nvar FINISH;\n(function (FINISH) {\n FINISH[FINISH[\"SAFE\"] = 0] = \"SAFE\";\n FINISH[FINISH[\"SAFE_WITH_CB\"] = 1] = \"SAFE_WITH_CB\";\n FINISH[FINISH[\"UNSAFE\"] = 2] = \"UNSAFE\";\n})(FINISH = exports.FINISH || (exports.FINISH = {}));\nexports.ALPHA = [];\nfor (let i = 'A'.charCodeAt(0); i <= 'Z'.charCodeAt(0); i++) {\n // Upper case\n exports.ALPHA.push(String.fromCharCode(i));\n // Lower case\n exports.ALPHA.push(String.fromCharCode(i + 0x20));\n}\nexports.NUM_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n};\nexports.HEX_MAP = {\n 0: 0, 1: 1, 2: 2, 3: 3, 4: 4,\n 5: 5, 6: 6, 7: 7, 8: 8, 9: 9,\n A: 0XA, B: 0XB, C: 0XC, D: 0XD, E: 0XE, F: 0XF,\n a: 0xa, b: 0xb, c: 0xc, d: 0xd, e: 0xe, f: 0xf,\n};\nexports.NUM = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n];\nexports.ALPHANUM = exports.ALPHA.concat(exports.NUM);\nexports.MARK = ['-', '_', '.', '!', '~', '*', '\\'', '(', ')'];\nexports.USERINFO_CHARS = exports.ALPHANUM\n .concat(exports.MARK)\n .concat(['%', ';', ':', '&', '=', '+', '$', ',']);\n// TODO(indutny): use RFC\nexports.STRICT_URL_CHAR = [\n '!', '\"', '$', '%', '&', '\\'',\n '(', ')', '*', '+', ',', '-', '.', '/',\n ':', ';', '<', '=', '>',\n '@', '[', '\\\\', ']', '^', '_',\n '`',\n '{', '|', '}', '~',\n].concat(exports.ALPHANUM);\nexports.URL_CHAR = exports.STRICT_URL_CHAR\n .concat(['\\t', '\\f']);\n// All characters with 0x80 bit set to 1\nfor (let i = 0x80; i <= 0xff; i++) {\n exports.URL_CHAR.push(i);\n}\nexports.HEX = exports.NUM.concat(['a', 'b', 'c', 'd', 'e', 'f', 'A', 'B', 'C', 'D', 'E', 'F']);\n/* Tokens as defined by rfc 2616. Also lowercases them.\n * token = 1*\n * separators = \"(\" | \")\" | \"<\" | \">\" | \"@\"\n * | \",\" | \";\" | \":\" | \"\\\" | <\">\n * | \"/\" | \"[\" | \"]\" | \"?\" | \"=\"\n * | \"{\" | \"}\" | SP | HT\n */\nexports.STRICT_TOKEN = [\n '!', '#', '$', '%', '&', '\\'',\n '*', '+', '-', '.',\n '^', '_', '`',\n '|', '~',\n].concat(exports.ALPHANUM);\nexports.TOKEN = exports.STRICT_TOKEN.concat([' ']);\n/*\n * Verify that a char is a valid visible (printable) US-ASCII\n * character or %x80-FF\n */\nexports.HEADER_CHARS = ['\\t'];\nfor (let i = 32; i <= 255; i++) {\n if (i !== 127) {\n exports.HEADER_CHARS.push(i);\n }\n}\n// ',' = \\x44\nexports.CONNECTION_TOKEN_CHARS = exports.HEADER_CHARS.filter((c) => c !== 44);\nexports.MAJOR = exports.NUM_MAP;\nexports.MINOR = exports.MAJOR;\nvar HEADER_STATE;\n(function (HEADER_STATE) {\n HEADER_STATE[HEADER_STATE[\"GENERAL\"] = 0] = \"GENERAL\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION\"] = 1] = \"CONNECTION\";\n HEADER_STATE[HEADER_STATE[\"CONTENT_LENGTH\"] = 2] = \"CONTENT_LENGTH\";\n HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING\"] = 3] = \"TRANSFER_ENCODING\";\n HEADER_STATE[HEADER_STATE[\"UPGRADE\"] = 4] = \"UPGRADE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_KEEP_ALIVE\"] = 5] = \"CONNECTION_KEEP_ALIVE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_CLOSE\"] = 6] = \"CONNECTION_CLOSE\";\n HEADER_STATE[HEADER_STATE[\"CONNECTION_UPGRADE\"] = 7] = \"CONNECTION_UPGRADE\";\n HEADER_STATE[HEADER_STATE[\"TRANSFER_ENCODING_CHUNKED\"] = 8] = \"TRANSFER_ENCODING_CHUNKED\";\n})(HEADER_STATE = exports.HEADER_STATE || (exports.HEADER_STATE = {}));\nexports.SPECIAL_HEADERS = {\n 'connection': HEADER_STATE.CONNECTION,\n 'content-length': HEADER_STATE.CONTENT_LENGTH,\n 'proxy-connection': HEADER_STATE.CONNECTION,\n 'transfer-encoding': HEADER_STATE.TRANSFER_ENCODING,\n 'upgrade': HEADER_STATE.UPGRADE,\n};\n//# sourceMappingURL=constants.js.map","module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCsLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC1kAIABBGGpCADcDACAAQgA3AwAgAEE4akIANwMAIABBMGpCADcDACAAQShqQgA3AwAgAEEgakIANwMAIABBEGpCADcDACAAQQhqQgA3AwAgAEHdATYCHEEAC3sBAX8CQCAAKAIMIgMNAAJAIAAoAgRFDQAgACABNgIECwJAIAAgASACEMSAgIAAIgMNACAAKAIMDwsgACADNgIcQQAhAyAAKAIEIgFFDQAgACABIAIgACgCCBGBgICAAAAiAUUNACAAIAI2AhQgACABNgIMIAEhAwsgAwvk8wEDDn8DfgR/I4CAgIAAQRBrIgMkgICAgAAgASEEIAEhBSABIQYgASEHIAEhCCABIQkgASEKIAEhCyABIQwgASENIAEhDiABIQ8CQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgACgCHCIQQX9qDt0B2gEB2QECAwQFBgcICQoLDA0O2AEPENcBERLWARMUFRYXGBkaG+AB3wEcHR7VAR8gISIjJCXUASYnKCkqKyzTAdIBLS7RAdABLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVG2wFHSElKzwHOAUvNAUzMAU1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4ABgQGCAYMBhAGFAYYBhwGIAYkBigGLAYwBjQGOAY8BkAGRAZIBkwGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwHLAcoBuAHJAbkByAG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAQDcAQtBACEQDMYBC0EOIRAMxQELQQ0hEAzEAQtBDyEQDMMBC0EQIRAMwgELQRMhEAzBAQtBFCEQDMABC0EVIRAMvwELQRYhEAy+AQtBFyEQDL0BC0EYIRAMvAELQRkhEAy7AQtBGiEQDLoBC0EbIRAMuQELQRwhEAy4AQtBCCEQDLcBC0EdIRAMtgELQSAhEAy1AQtBHyEQDLQBC0EHIRAMswELQSEhEAyyAQtBIiEQDLEBC0EeIRAMsAELQSMhEAyvAQtBEiEQDK4BC0ERIRAMrQELQSQhEAysAQtBJSEQDKsBC0EmIRAMqgELQSchEAypAQtBwwEhEAyoAQtBKSEQDKcBC0ErIRAMpgELQSwhEAylAQtBLSEQDKQBC0EuIRAMowELQS8hEAyiAQtBxAEhEAyhAQtBMCEQDKABC0E0IRAMnwELQQwhEAyeAQtBMSEQDJ0BC0EyIRAMnAELQTMhEAybAQtBOSEQDJoBC0E1IRAMmQELQcUBIRAMmAELQQshEAyXAQtBOiEQDJYBC0E2IRAMlQELQQohEAyUAQtBNyEQDJMBC0E4IRAMkgELQTwhEAyRAQtBOyEQDJABC0E9IRAMjwELQQkhEAyOAQtBKCEQDI0BC0E+IRAMjAELQT8hEAyLAQtBwAAhEAyKAQtBwQAhEAyJAQtBwgAhEAyIAQtBwwAhEAyHAQtBxAAhEAyGAQtBxQAhEAyFAQtBxgAhEAyEAQtBKiEQDIMBC0HHACEQDIIBC0HIACEQDIEBC0HJACEQDIABC0HKACEQDH8LQcsAIRAMfgtBzQAhEAx9C0HMACEQDHwLQc4AIRAMewtBzwAhEAx6C0HQACEQDHkLQdEAIRAMeAtB0gAhEAx3C0HTACEQDHYLQdQAIRAMdQtB1gAhEAx0C0HVACEQDHMLQQYhEAxyC0HXACEQDHELQQUhEAxwC0HYACEQDG8LQQQhEAxuC0HZACEQDG0LQdoAIRAMbAtB2wAhEAxrC0HcACEQDGoLQQMhEAxpC0HdACEQDGgLQd4AIRAMZwtB3wAhEAxmC0HhACEQDGULQeAAIRAMZAtB4gAhEAxjC0HjACEQDGILQQIhEAxhC0HkACEQDGALQeUAIRAMXwtB5gAhEAxeC0HnACEQDF0LQegAIRAMXAtB6QAhEAxbC0HqACEQDFoLQesAIRAMWQtB7AAhEAxYC0HtACEQDFcLQe4AIRAMVgtB7wAhEAxVC0HwACEQDFQLQfEAIRAMUwtB8gAhEAxSC0HzACEQDFELQfQAIRAMUAtB9QAhEAxPC0H2ACEQDE4LQfcAIRAMTQtB+AAhEAxMC0H5ACEQDEsLQfoAIRAMSgtB+wAhEAxJC0H8ACEQDEgLQf0AIRAMRwtB/gAhEAxGC0H/ACEQDEULQYABIRAMRAtBgQEhEAxDC0GCASEQDEILQYMBIRAMQQtBhAEhEAxAC0GFASEQDD8LQYYBIRAMPgtBhwEhEAw9C0GIASEQDDwLQYkBIRAMOwtBigEhEAw6C0GLASEQDDkLQYwBIRAMOAtBjQEhEAw3C0GOASEQDDYLQY8BIRAMNQtBkAEhEAw0C0GRASEQDDMLQZIBIRAMMgtBkwEhEAwxC0GUASEQDDALQZUBIRAMLwtBlgEhEAwuC0GXASEQDC0LQZgBIRAMLAtBmQEhEAwrC0GaASEQDCoLQZsBIRAMKQtBnAEhEAwoC0GdASEQDCcLQZ4BIRAMJgtBnwEhEAwlC0GgASEQDCQLQaEBIRAMIwtBogEhEAwiC0GjASEQDCELQaQBIRAMIAtBpQEhEAwfC0GmASEQDB4LQacBIRAMHQtBqAEhEAwcC0GpASEQDBsLQaoBIRAMGgtBqwEhEAwZC0GsASEQDBgLQa0BIRAMFwtBrgEhEAwWC0EBIRAMFQtBrwEhEAwUC0GwASEQDBMLQbEBIRAMEgtBswEhEAwRC0GyASEQDBALQbQBIRAMDwtBtQEhEAwOC0G2ASEQDA0LQbcBIRAMDAtBuAEhEAwLC0G5ASEQDAoLQboBIRAMCQtBuwEhEAwIC0HGASEQDAcLQbwBIRAMBgtBvQEhEAwFC0G+ASEQDAQLQb8BIRAMAwtBwAEhEAwCC0HCASEQDAELQcEBIRALA0ACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQDscBAAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxweHyAhIyUoP0BBREVGR0hJSktMTU9QUVJT3gNXWVtcXWBiZWZnaGlqa2xtb3BxcnN0dXZ3eHl6e3x9foABggGFAYYBhwGJAYsBjAGNAY4BjwGQAZEBlAGVAZYBlwGYAZkBmgGbAZwBnQGeAZ8BoAGhAaIBowGkAaUBpgGnAagBqQGqAasBrAGtAa4BrwGwAbEBsgGzAbQBtQG2AbcBuAG5AboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBxwHIAckBygHLAcwBzQHOAc8B0AHRAdIB0wHUAdUB1gHXAdgB2QHaAdsB3AHdAd4B4AHhAeIB4wHkAeUB5gHnAegB6QHqAesB7AHtAe4B7wHwAfEB8gHzAZkCpAKwAv4C/gILIAEiBCACRw3zAUHdASEQDP8DCyABIhAgAkcN3QFBwwEhEAz+AwsgASIBIAJHDZABQfcAIRAM/QMLIAEiASACRw2GAUHvACEQDPwDCyABIgEgAkcNf0HqACEQDPsDCyABIgEgAkcNe0HoACEQDPoDCyABIgEgAkcNeEHmACEQDPkDCyABIgEgAkcNGkEYIRAM+AMLIAEiASACRw0UQRIhEAz3AwsgASIBIAJHDVlBxQAhEAz2AwsgASIBIAJHDUpBPyEQDPUDCyABIgEgAkcNSEE8IRAM9AMLIAEiASACRw1BQTEhEAzzAwsgAC0ALkEBRg3rAwyHAgsgACABIgEgAhDAgICAAEEBRw3mASAAQgA3AyAM5wELIAAgASIBIAIQtICAgAAiEA3nASABIQEM9QILAkAgASIBIAJHDQBBBiEQDPADCyAAIAFBAWoiASACELuAgIAAIhAN6AEgASEBDDELIABCADcDIEESIRAM1QMLIAEiECACRw0rQR0hEAztAwsCQCABIgEgAkYNACABQQFqIQFBECEQDNQDC0EHIRAM7AMLIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN5QFBCCEQDOsDCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEUIRAM0gMLQQkhEAzqAwsgASEBIAApAyBQDeQBIAEhAQzyAgsCQCABIgEgAkcNAEELIRAM6QMLIAAgAUEBaiIBIAIQtoCAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3lASABIQEM8gILIAAgASIBIAIQuICAgAAiEA3mASABIQEMDQsgACABIgEgAhC6gICAACIQDecBIAEhAQzwAgsCQCABIgEgAkcNAEEPIRAM5QMLIAEtAAAiEEE7Rg0IIBBBDUcN6AEgAUEBaiEBDO8CCyAAIAEiASACELqAgIAAIhAN6AEgASEBDPICCwNAAkAgAS0AAEHwtYCAAGotAAAiEEEBRg0AIBBBAkcN6wEgACgCBCEQIABBADYCBCAAIBAgAUEBaiIBELmAgIAAIhAN6gEgASEBDPQCCyABQQFqIgEgAkcNAAtBEiEQDOIDCyAAIAEiASACELqAgIAAIhAN6QEgASEBDAoLIAEiASACRw0GQRshEAzgAwsCQCABIgEgAkcNAEEWIRAM4AMLIABBioCAgAA2AgggACABNgIEIAAgASACELiAgIAAIhAN6gEgASEBQSAhEAzGAwsCQCABIgEgAkYNAANAAkAgAS0AAEHwt4CAAGotAAAiEEECRg0AAkAgEEF/ag4E5QHsAQDrAewBCyABQQFqIQFBCCEQDMgDCyABQQFqIgEgAkcNAAtBFSEQDN8DC0EVIRAM3gMLA0ACQCABLQAAQfC5gIAAai0AACIQQQJGDQAgEEF/ag4E3gHsAeAB6wHsAQsgAUEBaiIBIAJHDQALQRghEAzdAwsCQCABIgEgAkYNACAAQYuAgIAANgIIIAAgATYCBCABIQFBByEQDMQDC0EZIRAM3AMLIAFBAWohAQwCCwJAIAEiFCACRw0AQRohEAzbAwsgFCEBAkAgFC0AAEFzag4U3QLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gIA7gILQQAhECAAQQA2AhwgAEGvi4CAADYCECAAQQI2AgwgACAUQQFqNgIUDNoDCwJAIAEtAAAiEEE7Rg0AIBBBDUcN6AEgAUEBaiEBDOUCCyABQQFqIQELQSIhEAy/AwsCQCABIhAgAkcNAEEcIRAM2AMLQgAhESAQIQEgEC0AAEFQag435wHmAQECAwQFBgcIAAAAAAAAAAkKCwwNDgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADxAREhMUAAtBHiEQDL0DC0ICIREM5QELQgMhEQzkAQtCBCERDOMBC0IFIREM4gELQgYhEQzhAQtCByERDOABC0IIIREM3wELQgkhEQzeAQtCCiERDN0BC0ILIREM3AELQgwhEQzbAQtCDSERDNoBC0IOIREM2QELQg8hEQzYAQtCCiERDNcBC0ILIREM1gELQgwhEQzVAQtCDSERDNQBC0IOIREM0wELQg8hEQzSAQtCACERAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAQLQAAQVBqDjflAeQBAAECAwQFBgfmAeYB5gHmAeYB5gHmAQgJCgsMDeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gEODxAREhPmAQtCAiERDOQBC0IDIREM4wELQgQhEQziAQtCBSERDOEBC0IGIREM4AELQgchEQzfAQtCCCERDN4BC0IJIREM3QELQgohEQzcAQtCCyERDNsBC0IMIREM2gELQg0hEQzZAQtCDiERDNgBC0IPIREM1wELQgohEQzWAQtCCyERDNUBC0IMIREM1AELQg0hEQzTAQtCDiERDNIBC0IPIREM0QELIABCACAAKQMgIhEgAiABIhBrrSISfSITIBMgEVYbNwMgIBEgElYiFEUN0gFBHyEQDMADCwJAIAEiASACRg0AIABBiYCAgAA2AgggACABNgIEIAEhAUEkIRAMpwMLQSAhEAy/AwsgACABIhAgAhC+gICAAEF/ag4FtgEAxQIB0QHSAQtBESEQDKQDCyAAQQE6AC8gECEBDLsDCyABIgEgAkcN0gFBJCEQDLsDCyABIg0gAkcNHkHGACEQDLoDCyAAIAEiASACELKAgIAAIhAN1AEgASEBDLUBCyABIhAgAkcNJkHQACEQDLgDCwJAIAEiASACRw0AQSghEAy4AwsgAEEANgIEIABBjICAgAA2AgggACABIAEQsYCAgAAiEA3TASABIQEM2AELAkAgASIQIAJHDQBBKSEQDLcDCyAQLQAAIgFBIEYNFCABQQlHDdMBIBBBAWohAQwVCwJAIAEiASACRg0AIAFBAWohAQwXC0EqIRAMtQMLAkAgASIQIAJHDQBBKyEQDLUDCwJAIBAtAAAiAUEJRg0AIAFBIEcN1QELIAAtACxBCEYN0wEgECEBDJEDCwJAIAEiASACRw0AQSwhEAy0AwsgAS0AAEEKRw3VASABQQFqIQEMyQILIAEiDiACRw3VAUEvIRAMsgMLA0ACQCABLQAAIhBBIEYNAAJAIBBBdmoOBADcAdwBANoBCyABIQEM4AELIAFBAWoiASACRw0AC0ExIRAMsQMLQTIhECABIhQgAkYNsAMgAiAUayAAKAIAIgFqIRUgFCABa0EDaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfC7gIAAai0AAEcNAQJAIAFBA0cNAEEGIQEMlgMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLEDCyAAQQA2AgAgFCEBDNkBC0EzIRAgASIUIAJGDa8DIAIgFGsgACgCACIBaiEVIBQgAWtBCGohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUH0u4CAAGotAABHDQECQCABQQhHDQBBBSEBDJUDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAywAwsgAEEANgIAIBQhAQzYAQtBNCEQIAEiFCACRg2uAyACIBRrIAAoAgAiAWohFSAUIAFrQQVqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw0BAkAgAUEFRw0AQQchAQyUAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMrwMLIABBADYCACAUIQEM1wELAkAgASIBIAJGDQADQAJAIAEtAABBgL6AgABqLQAAIhBBAUYNACAQQQJGDQogASEBDN0BCyABQQFqIgEgAkcNAAtBMCEQDK4DC0EwIRAMrQMLAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AIBBBdmoOBNkB2gHaAdkB2gELIAFBAWoiASACRw0AC0E4IRAMrQMLQTghEAysAwsDQAJAIAEtAAAiEEEgRg0AIBBBCUcNAwsgAUEBaiIBIAJHDQALQTwhEAyrAwsDQAJAIAEtAAAiEEEgRg0AAkACQCAQQXZqDgTaAQEB2gEACyAQQSxGDdsBCyABIQEMBAsgAUEBaiIBIAJHDQALQT8hEAyqAwsgASEBDNsBC0HAACEQIAEiFCACRg2oAyACIBRrIAAoAgAiAWohFiAUIAFrQQZqIRcCQANAIBQtAABBIHIgAUGAwICAAGotAABHDQEgAUEGRg2OAyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAypAwsgAEEANgIAIBQhAQtBNiEQDI4DCwJAIAEiDyACRw0AQcEAIRAMpwMLIABBjICAgAA2AgggACAPNgIEIA8hASAALQAsQX9qDgTNAdUB1wHZAYcDCyABQQFqIQEMzAELAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgciAQIBBBv39qQf8BcUEaSRtB/wFxIhBBCUYNACAQQSBGDQACQAJAAkACQCAQQZ1/ag4TAAMDAwMDAwMBAwMDAwMDAwMDAgMLIAFBAWohAUExIRAMkQMLIAFBAWohAUEyIRAMkAMLIAFBAWohAUEzIRAMjwMLIAEhAQzQAQsgAUEBaiIBIAJHDQALQTUhEAylAwtBNSEQDKQDCwJAIAEiASACRg0AA0ACQCABLQAAQYC8gIAAai0AAEEBRg0AIAEhAQzTAQsgAUEBaiIBIAJHDQALQT0hEAykAwtBPSEQDKMDCyAAIAEiASACELCAgIAAIhAN1gEgASEBDAELIBBBAWohAQtBPCEQDIcDCwJAIAEiASACRw0AQcIAIRAMoAMLAkADQAJAIAEtAABBd2oOGAAC/gL+AoQD/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4CAP4CCyABQQFqIgEgAkcNAAtBwgAhEAygAwsgAUEBaiEBIAAtAC1BAXFFDb0BIAEhAQtBLCEQDIUDCyABIgEgAkcN0wFBxAAhEAydAwsDQAJAIAEtAABBkMCAgABqLQAAQQFGDQAgASEBDLcCCyABQQFqIgEgAkcNAAtBxQAhEAycAwsgDS0AACIQQSBGDbMBIBBBOkcNgQMgACgCBCEBIABBADYCBCAAIAEgDRCvgICAACIBDdABIA1BAWohAQyzAgtBxwAhECABIg0gAkYNmgMgAiANayAAKAIAIgFqIRYgDSABa0EFaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGQwoCAAGotAABHDYADIAFBBUYN9AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmgMLQcgAIRAgASINIAJGDZkDIAIgDWsgACgCACIBaiEWIA0gAWtBCWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBlsKAgABqLQAARw3/AgJAIAFBCUcNAEECIQEM9QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJkDCwJAIAEiDSACRw0AQckAIRAMmQMLAkACQCANLQAAIgFBIHIgASABQb9/akH/AXFBGkkbQf8BcUGSf2oOBwCAA4ADgAOAA4ADAYADCyANQQFqIQFBPiEQDIADCyANQQFqIQFBPyEQDP8CC0HKACEQIAEiDSACRg2XAyACIA1rIAAoAgAiAWohFiANIAFrQQFqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaDCgIAAai0AAEcN/QIgAUEBRg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyXAwtBywAhECABIg0gAkYNlgMgAiANayAAKAIAIgFqIRYgDSABa0EOaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGiwoCAAGotAABHDfwCIAFBDkYN8AIgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlgMLQcwAIRAgASINIAJGDZUDIAIgDWsgACgCACIBaiEWIA0gAWtBD2ohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBwMKAgABqLQAARw37AgJAIAFBD0cNAEEDIQEM8QILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJUDC0HNACEQIAEiDSACRg2UAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQdDCgIAAai0AAEcN+gICQCABQQVHDQBBBCEBDPACCyABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyUAwsCQCABIg0gAkcNAEHOACEQDJQDCwJAAkACQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZ1/ag4TAP0C/QL9Av0C/QL9Av0C/QL9Av0C/QL9AgH9Av0C/QICA/0CCyANQQFqIQFBwQAhEAz9AgsgDUEBaiEBQcIAIRAM/AILIA1BAWohAUHDACEQDPsCCyANQQFqIQFBxAAhEAz6AgsCQCABIgEgAkYNACAAQY2AgIAANgIIIAAgATYCBCABIQFBxQAhEAz6AgtBzwAhEAySAwsgECEBAkACQCAQLQAAQXZqDgQBqAKoAgCoAgsgEEEBaiEBC0EnIRAM+AILAkAgASIBIAJHDQBB0QAhEAyRAwsCQCABLQAAQSBGDQAgASEBDI0BCyABQQFqIQEgAC0ALUEBcUUNxwEgASEBDIwBCyABIhcgAkcNyAFB0gAhEAyPAwtB0wAhECABIhQgAkYNjgMgAiAUayAAKAIAIgFqIRYgFCABa0EBaiEXA0AgFC0AACABQdbCgIAAai0AAEcNzAEgAUEBRg3HASABQQFqIQEgFEEBaiIUIAJHDQALIAAgFjYCAAyOAwsCQCABIgEgAkcNAEHVACEQDI4DCyABLQAAQQpHDcwBIAFBAWohAQzHAQsCQCABIgEgAkcNAEHWACEQDI0DCwJAAkAgAS0AAEF2ag4EAM0BzQEBzQELIAFBAWohAQzHAQsgAUEBaiEBQcoAIRAM8wILIAAgASIBIAIQroCAgAAiEA3LASABIQFBzQAhEAzyAgsgAC0AKUEiRg2FAwymAgsCQCABIgEgAkcNAEHbACEQDIoDC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgAS0AAEFQag4K1AHTAQABAgMEBQYI1QELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMzAELQQkhEEEBIRRBACEXQQAhFgzLAQsCQCABIgEgAkcNAEHdACEQDIkDCyABLQAAQS5HDcwBIAFBAWohAQymAgsgASIBIAJHDcwBQd8AIRAMhwMLAkAgASIBIAJGDQAgAEGOgICAADYCCCAAIAE2AgQgASEBQdAAIRAM7gILQeAAIRAMhgMLQeEAIRAgASIBIAJGDYUDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHiwoCAAGotAABHDc0BIBRBA0YNzAEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhQMLQeIAIRAgASIBIAJGDYQDIAIgAWsgACgCACIUaiEWIAEgFGtBAmohFwNAIAEtAAAgFEHmwoCAAGotAABHDcwBIBRBAkYNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMhAMLQeMAIRAgASIBIAJGDYMDIAIgAWsgACgCACIUaiEWIAEgFGtBA2ohFwNAIAEtAAAgFEHpwoCAAGotAABHDcsBIBRBA0YNzgEgFEEBaiEUIAFBAWoiASACRw0ACyAAIBY2AgAMgwMLAkAgASIBIAJHDQBB5QAhEAyDAwsgACABQQFqIgEgAhCogICAACIQDc0BIAEhAUHWACEQDOkCCwJAIAEiASACRg0AA0ACQCABLQAAIhBBIEYNAAJAAkACQCAQQbh/ag4LAAHPAc8BzwHPAc8BzwHPAc8BAs8BCyABQQFqIQFB0gAhEAztAgsgAUEBaiEBQdMAIRAM7AILIAFBAWohAUHUACEQDOsCCyABQQFqIgEgAkcNAAtB5AAhEAyCAwtB5AAhEAyBAwsDQAJAIAEtAABB8MKAgABqLQAAIhBBAUYNACAQQX5qDgPPAdAB0QHSAQsgAUEBaiIBIAJHDQALQeYAIRAMgAMLAkAgASIBIAJGDQAgAUEBaiEBDAMLQecAIRAM/wILA0ACQCABLQAAQfDEgIAAai0AACIQQQFGDQACQCAQQX5qDgTSAdMB1AEA1QELIAEhAUHXACEQDOcCCyABQQFqIgEgAkcNAAtB6AAhEAz+AgsCQCABIgEgAkcNAEHpACEQDP4CCwJAIAEtAAAiEEF2ag4augHVAdUBvAHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHKAdUB1QEA0wELIAFBAWohAQtBBiEQDOMCCwNAAkAgAS0AAEHwxoCAAGotAABBAUYNACABIQEMngILIAFBAWoiASACRw0AC0HqACEQDPsCCwJAIAEiASACRg0AIAFBAWohAQwDC0HrACEQDPoCCwJAIAEiASACRw0AQewAIRAM+gILIAFBAWohAQwBCwJAIAEiASACRw0AQe0AIRAM+QILIAFBAWohAQtBBCEQDN4CCwJAIAEiFCACRw0AQe4AIRAM9wILIBQhAQJAAkACQCAULQAAQfDIgIAAai0AAEF/ag4H1AHVAdYBAJwCAQLXAQsgFEEBaiEBDAoLIBRBAWohAQzNAQtBACEQIABBADYCHCAAQZuSgIAANgIQIABBBzYCDCAAIBRBAWo2AhQM9gILAkADQAJAIAEtAABB8MiAgABqLQAAIhBBBEYNAAJAAkAgEEF/ag4H0gHTAdQB2QEABAHZAQsgASEBQdoAIRAM4AILIAFBAWohAUHcACEQDN8CCyABQQFqIgEgAkcNAAtB7wAhEAz2AgsgAUEBaiEBDMsBCwJAIAEiFCACRw0AQfAAIRAM9QILIBQtAABBL0cN1AEgFEEBaiEBDAYLAkAgASIUIAJHDQBB8QAhEAz0AgsCQCAULQAAIgFBL0cNACAUQQFqIQFB3QAhEAzbAgsgAUF2aiIEQRZLDdMBQQEgBHRBiYCAAnFFDdMBDMoCCwJAIAEiASACRg0AIAFBAWohAUHeACEQDNoCC0HyACEQDPICCwJAIAEiFCACRw0AQfQAIRAM8gILIBQhAQJAIBQtAABB8MyAgABqLQAAQX9qDgPJApQCANQBC0HhACEQDNgCCwJAIAEiFCACRg0AA0ACQCAULQAAQfDKgIAAai0AACIBQQNGDQACQCABQX9qDgLLAgDVAQsgFCEBQd8AIRAM2gILIBRBAWoiFCACRw0AC0HzACEQDPECC0HzACEQDPACCwJAIAEiASACRg0AIABBj4CAgAA2AgggACABNgIEIAEhAUHgACEQDNcCC0H1ACEQDO8CCwJAIAEiASACRw0AQfYAIRAM7wILIABBj4CAgAA2AgggACABNgIEIAEhAQtBAyEQDNQCCwNAIAEtAABBIEcNwwIgAUEBaiIBIAJHDQALQfcAIRAM7AILAkAgASIBIAJHDQBB+AAhEAzsAgsgAS0AAEEgRw3OASABQQFqIQEM7wELIAAgASIBIAIQrICAgAAiEA3OASABIQEMjgILAkAgASIEIAJHDQBB+gAhEAzqAgsgBC0AAEHMAEcN0QEgBEEBaiEBQRMhEAzPAQsCQCABIgQgAkcNAEH7ACEQDOkCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRADQCAELQAAIAFB8M6AgABqLQAARw3QASABQQVGDc4BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQfsAIRAM6AILAkAgASIEIAJHDQBB/AAhEAzoAgsCQAJAIAQtAABBvX9qDgwA0QHRAdEB0QHRAdEB0QHRAdEB0QEB0QELIARBAWohAUHmACEQDM8CCyAEQQFqIQFB5wAhEAzOAgsCQCABIgQgAkcNAEH9ACEQDOcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDc8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH9ACEQDOcCCyAAQQA2AgAgEEEBaiEBQRAhEAzMAQsCQCABIgQgAkcNAEH+ACEQDOYCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUH2zoCAAGotAABHDc4BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH+ACEQDOYCCyAAQQA2AgAgEEEBaiEBQRYhEAzLAQsCQCABIgQgAkcNAEH/ACEQDOUCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUH8zoCAAGotAABHDc0BIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEH/ACEQDOUCCyAAQQA2AgAgEEEBaiEBQQUhEAzKAQsCQCABIgQgAkcNAEGAASEQDOQCCyAELQAAQdkARw3LASAEQQFqIQFBCCEQDMkBCwJAIAEiBCACRw0AQYEBIRAM4wILAkACQCAELQAAQbJ/ag4DAMwBAcwBCyAEQQFqIQFB6wAhEAzKAgsgBEEBaiEBQewAIRAMyQILAkAgASIEIAJHDQBBggEhEAziAgsCQAJAIAQtAABBuH9qDggAywHLAcsBywHLAcsBAcsBCyAEQQFqIQFB6gAhEAzJAgsgBEEBaiEBQe0AIRAMyAILAkAgASIEIAJHDQBBgwEhEAzhAgsgAiAEayAAKAIAIgFqIRAgBCABa0ECaiEUAkADQCAELQAAIAFBgM+AgABqLQAARw3JASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBA2AgBBgwEhEAzhAgtBACEQIABBADYCACAUQQFqIQEMxgELAkAgASIEIAJHDQBBhAEhEAzgAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBg8+AgABqLQAARw3IASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhAEhEAzgAgsgAEEANgIAIBBBAWohAUEjIRAMxQELAkAgASIEIAJHDQBBhQEhEAzfAgsCQAJAIAQtAABBtH9qDggAyAHIAcgByAHIAcgBAcgBCyAEQQFqIQFB7wAhEAzGAgsgBEEBaiEBQfAAIRAMxQILAkAgASIEIAJHDQBBhgEhEAzeAgsgBC0AAEHFAEcNxQEgBEEBaiEBDIMCCwJAIAEiBCACRw0AQYcBIRAM3QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQYjPgIAAai0AAEcNxQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYcBIRAM3QILIABBADYCACAQQQFqIQFBLSEQDMIBCwJAIAEiBCACRw0AQYgBIRAM3AILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNxAEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYgBIRAM3AILIABBADYCACAQQQFqIQFBKSEQDMEBCwJAIAEiASACRw0AQYkBIRAM2wILQQEhECABLQAAQd8ARw3AASABQQFqIQEMgQILAkAgASIEIAJHDQBBigEhEAzaAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQA0AgBC0AACABQYzPgIAAai0AAEcNwQEgAUEBRg2vAiABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGKASEQDNkCCwJAIAEiBCACRw0AQYsBIRAM2QILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQY7PgIAAai0AAEcNwQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYsBIRAM2QILIABBADYCACAQQQFqIQFBAiEQDL4BCwJAIAEiBCACRw0AQYwBIRAM2AILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNwAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYwBIRAM2AILIABBADYCACAQQQFqIQFBHyEQDL0BCwJAIAEiBCACRw0AQY0BIRAM1wILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNvwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY0BIRAM1wILIABBADYCACAQQQFqIQFBCSEQDLwBCwJAIAEiBCACRw0AQY4BIRAM1gILAkACQCAELQAAQbd/ag4HAL8BvwG/Ab8BvwEBvwELIARBAWohAUH4ACEQDL0CCyAEQQFqIQFB+QAhEAy8AgsCQCABIgQgAkcNAEGPASEQDNUCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGRz4CAAGotAABHDb0BIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGPASEQDNUCCyAAQQA2AgAgEEEBaiEBQRghEAy6AQsCQCABIgQgAkcNAEGQASEQDNQCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUGXz4CAAGotAABHDbwBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGQASEQDNQCCyAAQQA2AgAgEEEBaiEBQRchEAy5AQsCQCABIgQgAkcNAEGRASEQDNMCCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUGaz4CAAGotAABHDbsBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGRASEQDNMCCyAAQQA2AgAgEEEBaiEBQRUhEAy4AQsCQCABIgQgAkcNAEGSASEQDNICCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGhz4CAAGotAABHDboBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGSASEQDNICCyAAQQA2AgAgEEEBaiEBQR4hEAy3AQsCQCABIgQgAkcNAEGTASEQDNECCyAELQAAQcwARw24ASAEQQFqIQFBCiEQDLYBCwJAIAQgAkcNAEGUASEQDNACCwJAAkAgBC0AAEG/f2oODwC5AbkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AQG5AQsgBEEBaiEBQf4AIRAMtwILIARBAWohAUH/ACEQDLYCCwJAIAQgAkcNAEGVASEQDM8CCwJAAkAgBC0AAEG/f2oOAwC4AQG4AQsgBEEBaiEBQf0AIRAMtgILIARBAWohBEGAASEQDLUCCwJAIAQgAkcNAEGWASEQDM4CCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUGnz4CAAGotAABHDbYBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGWASEQDM4CCyAAQQA2AgAgEEEBaiEBQQshEAyzAQsCQCAEIAJHDQBBlwEhEAzNAgsCQAJAAkACQCAELQAAQVNqDiMAuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AQG4AbgBuAG4AbgBArgBuAG4AQO4AQsgBEEBaiEBQfsAIRAMtgILIARBAWohAUH8ACEQDLUCCyAEQQFqIQRBgQEhEAy0AgsgBEEBaiEEQYIBIRAMswILAkAgBCACRw0AQZgBIRAMzAILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQanPgIAAai0AAEcNtAEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZgBIRAMzAILIABBADYCACAQQQFqIQFBGSEQDLEBCwJAIAQgAkcNAEGZASEQDMsCCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUGuz4CAAGotAABHDbMBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGZASEQDMsCCyAAQQA2AgAgEEEBaiEBQQYhEAywAQsCQCAEIAJHDQBBmgEhEAzKAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBtM+AgABqLQAARw2yASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmgEhEAzKAgsgAEEANgIAIBBBAWohAUEcIRAMrwELAkAgBCACRw0AQZsBIRAMyQILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbbPgIAAai0AAEcNsQEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZsBIRAMyQILIABBADYCACAQQQFqIQFBJyEQDK4BCwJAIAQgAkcNAEGcASEQDMgCCwJAAkAgBC0AAEGsf2oOAgABsQELIARBAWohBEGGASEQDK8CCyAEQQFqIQRBhwEhEAyuAgsCQCAEIAJHDQBBnQEhEAzHAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBuM+AgABqLQAARw2vASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBnQEhEAzHAgsgAEEANgIAIBBBAWohAUEmIRAMrAELAkAgBCACRw0AQZ4BIRAMxgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQbrPgIAAai0AAEcNrgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ4BIRAMxgILIABBADYCACAQQQFqIQFBAyEQDKsBCwJAIAQgAkcNAEGfASEQDMUCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDa0BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGfASEQDMUCCyAAQQA2AgAgEEEBaiEBQQwhEAyqAQsCQCAEIAJHDQBBoAEhEAzEAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBvM+AgABqLQAARw2sASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBoAEhEAzEAgsgAEEANgIAIBBBAWohAUENIRAMqQELAkAgBCACRw0AQaEBIRAMwwILAkACQCAELQAAQbp/ag4LAKwBrAGsAawBrAGsAawBrAGsAQGsAQsgBEEBaiEEQYsBIRAMqgILIARBAWohBEGMASEQDKkCCwJAIAQgAkcNAEGiASEQDMICCyAELQAAQdAARw2pASAEQQFqIQQM6QELAkAgBCACRw0AQaMBIRAMwQILAkACQCAELQAAQbd/ag4HAaoBqgGqAaoBqgEAqgELIARBAWohBEGOASEQDKgCCyAEQQFqIQFBIiEQDKYBCwJAIAQgAkcNAEGkASEQDMACCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHAz4CAAGotAABHDagBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGkASEQDMACCyAAQQA2AgAgEEEBaiEBQR0hEAylAQsCQCAEIAJHDQBBpQEhEAy/AgsCQAJAIAQtAABBrn9qDgMAqAEBqAELIARBAWohBEGQASEQDKYCCyAEQQFqIQFBBCEQDKQBCwJAIAQgAkcNAEGmASEQDL4CCwJAAkACQAJAAkAgBC0AAEG/f2oOFQCqAaoBqgGqAaoBqgGqAaoBqgGqAQGqAaoBAqoBqgEDqgGqAQSqAQsgBEEBaiEEQYgBIRAMqAILIARBAWohBEGJASEQDKcCCyAEQQFqIQRBigEhEAymAgsgBEEBaiEEQY8BIRAMpQILIARBAWohBEGRASEQDKQCCwJAIAQgAkcNAEGnASEQDL0CCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDaUBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGnASEQDL0CCyAAQQA2AgAgEEEBaiEBQREhEAyiAQsCQCAEIAJHDQBBqAEhEAy8AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBws+AgABqLQAARw2kASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqAEhEAy8AgsgAEEANgIAIBBBAWohAUEsIRAMoQELAkAgBCACRw0AQakBIRAMuwILIAIgBGsgACgCACIBaiEUIAQgAWtBBGohEAJAA0AgBC0AACABQcXPgIAAai0AAEcNowEgAUEERg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQakBIRAMuwILIABBADYCACAQQQFqIQFBKyEQDKABCwJAIAQgAkcNAEGqASEQDLoCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHKz4CAAGotAABHDaIBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGqASEQDLoCCyAAQQA2AgAgEEEBaiEBQRQhEAyfAQsCQCAEIAJHDQBBqwEhEAy5AgsCQAJAAkACQCAELQAAQb5/ag4PAAECpAGkAaQBpAGkAaQBpAGkAaQBpAGkAQOkAQsgBEEBaiEEQZMBIRAMogILIARBAWohBEGUASEQDKECCyAEQQFqIQRBlQEhEAygAgsgBEEBaiEEQZYBIRAMnwILAkAgBCACRw0AQawBIRAMuAILIAQtAABBxQBHDZ8BIARBAWohBAzgAQsCQCAEIAJHDQBBrQEhEAy3AgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBzc+AgABqLQAARw2fASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrQEhEAy3AgsgAEEANgIAIBBBAWohAUEOIRAMnAELAkAgBCACRw0AQa4BIRAMtgILIAQtAABB0ABHDZ0BIARBAWohAUElIRAMmwELAkAgBCACRw0AQa8BIRAMtQILIAIgBGsgACgCACIBaiEUIAQgAWtBCGohEAJAA0AgBC0AACABQdDPgIAAai0AAEcNnQEgAUEIRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQa8BIRAMtQILIABBADYCACAQQQFqIQFBKiEQDJoBCwJAIAQgAkcNAEGwASEQDLQCCwJAAkAgBC0AAEGrf2oOCwCdAZ0BnQGdAZ0BnQGdAZ0BnQEBnQELIARBAWohBEGaASEQDJsCCyAEQQFqIQRBmwEhEAyaAgsCQCAEIAJHDQBBsQEhEAyzAgsCQAJAIAQtAABBv39qDhQAnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBAZwBCyAEQQFqIQRBmQEhEAyaAgsgBEEBaiEEQZwBIRAMmQILAkAgBCACRw0AQbIBIRAMsgILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQdnPgIAAai0AAEcNmgEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbIBIRAMsgILIABBADYCACAQQQFqIQFBISEQDJcBCwJAIAQgAkcNAEGzASEQDLECCyACIARrIAAoAgAiAWohFCAEIAFrQQZqIRACQANAIAQtAAAgAUHdz4CAAGotAABHDZkBIAFBBkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGzASEQDLECCyAAQQA2AgAgEEEBaiEBQRohEAyWAQsCQCAEIAJHDQBBtAEhEAywAgsCQAJAAkAgBC0AAEG7f2oOEQCaAZoBmgGaAZoBmgGaAZoBmgEBmgGaAZoBmgGaAQKaAQsgBEEBaiEEQZ0BIRAMmAILIARBAWohBEGeASEQDJcCCyAEQQFqIQRBnwEhEAyWAgsCQCAEIAJHDQBBtQEhEAyvAgsgAiAEayAAKAIAIgFqIRQgBCABa0EFaiEQAkADQCAELQAAIAFB5M+AgABqLQAARw2XASABQQVGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtQEhEAyvAgsgAEEANgIAIBBBAWohAUEoIRAMlAELAkAgBCACRw0AQbYBIRAMrgILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQerPgIAAai0AAEcNlgEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbYBIRAMrgILIABBADYCACAQQQFqIQFBByEQDJMBCwJAIAQgAkcNAEG3ASEQDK0CCwJAAkAgBC0AAEG7f2oODgCWAZYBlgGWAZYBlgGWAZYBlgGWAZYBlgEBlgELIARBAWohBEGhASEQDJQCCyAEQQFqIQRBogEhEAyTAgsCQCAEIAJHDQBBuAEhEAysAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB7c+AgABqLQAARw2UASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuAEhEAysAgsgAEEANgIAIBBBAWohAUESIRAMkQELAkAgBCACRw0AQbkBIRAMqwILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfDPgIAAai0AAEcNkwEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbkBIRAMqwILIABBADYCACAQQQFqIQFBICEQDJABCwJAIAQgAkcNAEG6ASEQDKoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUHyz4CAAGotAABHDZIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG6ASEQDKoCCyAAQQA2AgAgEEEBaiEBQQ8hEAyPAQsCQCAEIAJHDQBBuwEhEAypAgsCQAJAIAQtAABBt39qDgcAkgGSAZIBkgGSAQGSAQsgBEEBaiEEQaUBIRAMkAILIARBAWohBEGmASEQDI8CCwJAIAQgAkcNAEG8ASEQDKgCCyACIARrIAAoAgAiAWohFCAEIAFrQQdqIRACQANAIAQtAAAgAUH0z4CAAGotAABHDZABIAFBB0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG8ASEQDKgCCyAAQQA2AgAgEEEBaiEBQRshEAyNAQsCQCAEIAJHDQBBvQEhEAynAgsCQAJAAkAgBC0AAEG+f2oOEgCRAZEBkQGRAZEBkQGRAZEBkQEBkQGRAZEBkQGRAZEBApEBCyAEQQFqIQRBpAEhEAyPAgsgBEEBaiEEQacBIRAMjgILIARBAWohBEGoASEQDI0CCwJAIAQgAkcNAEG+ASEQDKYCCyAELQAAQc4ARw2NASAEQQFqIQQMzwELAkAgBCACRw0AQb8BIRAMpQILAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAgBC0AAEG/f2oOFQABAgOcAQQFBpwBnAGcAQcICQoLnAEMDQ4PnAELIARBAWohAUHoACEQDJoCCyAEQQFqIQFB6QAhEAyZAgsgBEEBaiEBQe4AIRAMmAILIARBAWohAUHyACEQDJcCCyAEQQFqIQFB8wAhEAyWAgsgBEEBaiEBQfYAIRAMlQILIARBAWohAUH3ACEQDJQCCyAEQQFqIQFB+gAhEAyTAgsgBEEBaiEEQYMBIRAMkgILIARBAWohBEGEASEQDJECCyAEQQFqIQRBhQEhEAyQAgsgBEEBaiEEQZIBIRAMjwILIARBAWohBEGYASEQDI4CCyAEQQFqIQRBoAEhEAyNAgsgBEEBaiEEQaMBIRAMjAILIARBAWohBEGqASEQDIsCCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEGrASEQDIsCC0HAASEQDKMCCyAAIAUgAhCqgICAACIBDYsBIAUhAQxcCwJAIAYgAkYNACAGQQFqIQUMjQELQcIBIRAMoQILA0ACQCAQLQAAQXZqDgSMAQAAjwEACyAQQQFqIhAgAkcNAAtBwwEhEAygAgsCQCAHIAJGDQAgAEGRgICAADYCCCAAIAc2AgQgByEBQQEhEAyHAgtBxAEhEAyfAgsCQCAHIAJHDQBBxQEhEAyfAgsCQAJAIActAABBdmoOBAHOAc4BAM4BCyAHQQFqIQYMjQELIAdBAWohBQyJAQsCQCAHIAJHDQBBxgEhEAyeAgsCQAJAIActAABBdmoOFwGPAY8BAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAQCPAQsgB0EBaiEHC0GwASEQDIQCCwJAIAggAkcNAEHIASEQDJ0CCyAILQAAQSBHDY0BIABBADsBMiAIQQFqIQFBswEhEAyDAgsgASEXAkADQCAXIgcgAkYNASAHLQAAQVBqQf8BcSIQQQpPDcwBAkAgAC8BMiIUQZkzSw0AIAAgFEEKbCIUOwEyIBBB//8DcyAUQf7/A3FJDQAgB0EBaiEXIAAgFCAQaiIQOwEyIBBB//8DcUHoB0kNAQsLQQAhECAAQQA2AhwgAEHBiYCAADYCECAAQQ02AgwgACAHQQFqNgIUDJwCC0HHASEQDJsCCyAAIAggAhCugICAACIQRQ3KASAQQRVHDYwBIABByAE2AhwgACAINgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAyaAgsCQCAJIAJHDQBBzAEhEAyaAgtBACEUQQEhF0EBIRZBACEQAkACQAJAAkACQAJAAkACQAJAIAktAABBUGoOCpYBlQEAAQIDBAUGCJcBC0ECIRAMBgtBAyEQDAULQQQhEAwEC0EFIRAMAwtBBiEQDAILQQchEAwBC0EIIRALQQAhF0EAIRZBACEUDI4BC0EJIRBBASEUQQAhF0EAIRYMjQELAkAgCiACRw0AQc4BIRAMmQILIAotAABBLkcNjgEgCkEBaiEJDMoBCyALIAJHDY4BQdABIRAMlwILAkAgCyACRg0AIABBjoCAgAA2AgggACALNgIEQbcBIRAM/gELQdEBIRAMlgILAkAgBCACRw0AQdIBIRAMlgILIAIgBGsgACgCACIQaiEUIAQgEGtBBGohCwNAIAQtAAAgEEH8z4CAAGotAABHDY4BIBBBBEYN6QEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB0gEhEAyVAgsgACAMIAIQrICAgAAiAQ2NASAMIQEMuAELAkAgBCACRw0AQdQBIRAMlAILIAIgBGsgACgCACIQaiEUIAQgEGtBAWohDANAIAQtAAAgEEGB0ICAAGotAABHDY8BIBBBAUYNjgEgEEEBaiEQIARBAWoiBCACRw0ACyAAIBQ2AgBB1AEhEAyTAgsCQCAEIAJHDQBB1gEhEAyTAgsgAiAEayAAKAIAIhBqIRQgBCAQa0ECaiELA0AgBC0AACAQQYPQgIAAai0AAEcNjgEgEEECRg2QASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHWASEQDJICCwJAIAQgAkcNAEHXASEQDJICCwJAAkAgBC0AAEG7f2oOEACPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAY8BCyAEQQFqIQRBuwEhEAz5AQsgBEEBaiEEQbwBIRAM+AELAkAgBCACRw0AQdgBIRAMkQILIAQtAABByABHDYwBIARBAWohBAzEAQsCQCAEIAJGDQAgAEGQgICAADYCCCAAIAQ2AgRBvgEhEAz3AQtB2QEhEAyPAgsCQCAEIAJHDQBB2gEhEAyPAgsgBC0AAEHIAEYNwwEgAEEBOgAoDLkBCyAAQQI6AC8gACAEIAIQpoCAgAAiEA2NAUHCASEQDPQBCyAALQAoQX9qDgK3AbkBuAELA0ACQCAELQAAQXZqDgQAjgGOAQCOAQsgBEEBaiIEIAJHDQALQd0BIRAMiwILIABBADoALyAALQAtQQRxRQ2EAgsgAEEAOgAvIABBAToANCABIQEMjAELIBBBFUYN2gEgAEEANgIcIAAgATYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMiAILAkAgACAQIAIQtICAgAAiBA0AIBAhAQyBAgsCQCAEQRVHDQAgAEEDNgIcIAAgEDYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMiAILIABBADYCHCAAIBA2AhQgAEGnjoCAADYCECAAQRI2AgxBACEQDIcCCyAQQRVGDdYBIABBADYCHCAAIAE2AhQgAEHajYCAADYCECAAQRQ2AgxBACEQDIYCCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNjQEgAEEHNgIcIAAgEDYCFCAAIBQ2AgxBACEQDIUCCyAAIAAvATBBgAFyOwEwIAEhAQtBKiEQDOoBCyAQQRVGDdEBIABBADYCHCAAIAE2AhQgAEGDjICAADYCECAAQRM2AgxBACEQDIICCyAQQRVGDc8BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDIECCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyNAQsgAEEMNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDIACCyAQQRVGDcwBIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDP8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyMAQsgAEENNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDP4BCyAQQRVGDckBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDP0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyLAQsgAEEONgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPwBCyAAQQA2AhwgACABNgIUIABBwJWAgAA2AhAgAEECNgIMQQAhEAz7AQsgEEEVRg3FASAAQQA2AhwgACABNgIUIABBxoyAgAA2AhAgAEEjNgIMQQAhEAz6AQsgAEEQNgIcIAAgATYCFCAAIBA2AgxBACEQDPkBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQzxAQsgAEERNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPgBCyAQQRVGDcEBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPcBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQuYCAgAAiEA0AIAFBAWohAQyIAQsgAEETNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPYBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQuYCAgAAiBA0AIAFBAWohAQztAQsgAEEUNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPUBCyAQQRVGDb0BIABBADYCHCAAIAE2AhQgAEGaj4CAADYCECAAQSI2AgxBACEQDPQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQt4CAgAAiEA0AIAFBAWohAQyGAQsgAEEWNgIcIAAgEDYCDCAAIAFBAWo2AhRBACEQDPMBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQt4CAgAAiBA0AIAFBAWohAQzpAQsgAEEXNgIcIAAgBDYCDCAAIAFBAWo2AhRBACEQDPIBCyAAQQA2AhwgACABNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzxAQtCASERCyAQQQFqIQECQCAAKQMgIhJC//////////8PVg0AIAAgEkIEhiARhDcDICABIQEMhAELIABBADYCHCAAIAE2AhQgAEGtiYCAADYCECAAQQw2AgxBACEQDO8BCyAAQQA2AhwgACAQNgIUIABBzZOAgAA2AhAgAEEMNgIMQQAhEAzuAQsgACgCBCEXIABBADYCBCAQIBGnaiIWIQEgACAXIBAgFiAUGyIQELWAgIAAIhRFDXMgAEEFNgIcIAAgEDYCFCAAIBQ2AgxBACEQDO0BCyAAQQA2AhwgACAQNgIUIABBqpyAgAA2AhAgAEEPNgIMQQAhEAzsAQsgACAQIAIQtICAgAAiAQ0BIBAhAQtBDiEQDNEBCwJAIAFBFUcNACAAQQI2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAzqAQsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAM6QELIAFBAWohEAJAIAAvATAiAUGAAXFFDQACQCAAIBAgAhC7gICAACIBDQAgECEBDHALIAFBFUcNugEgAEEFNgIcIAAgEDYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAM6QELAkAgAUGgBHFBoARHDQAgAC0ALUECcQ0AIABBADYCHCAAIBA2AhQgAEGWk4CAADYCECAAQQQ2AgxBACEQDOkBCyAAIBAgAhC9gICAABogECEBAkACQAJAAkACQCAAIBAgAhCzgICAAA4WAgEABAQEBAQEBAQEBAQEBAQEBAQEAwQLIABBAToALgsgACAALwEwQcAAcjsBMCAQIQELQSYhEAzRAQsgAEEjNgIcIAAgEDYCFCAAQaWWgIAANgIQIABBFTYCDEEAIRAM6QELIABBADYCHCAAIBA2AhQgAEHVi4CAADYCECAAQRE2AgxBACEQDOgBCyAALQAtQQFxRQ0BQcMBIRAMzgELAkAgDSACRg0AA0ACQCANLQAAQSBGDQAgDSEBDMQBCyANQQFqIg0gAkcNAAtBJSEQDOcBC0ElIRAM5gELIAAoAgQhBCAAQQA2AgQgACAEIA0Qr4CAgAAiBEUNrQEgAEEmNgIcIAAgBDYCDCAAIA1BAWo2AhRBACEQDOUBCyAQQRVGDasBIABBADYCHCAAIAE2AhQgAEH9jYCAADYCECAAQR02AgxBACEQDOQBCyAAQSc2AhwgACABNgIUIAAgEDYCDEEAIRAM4wELIBAhAUEBIRQCQAJAAkACQAJAAkACQCAALQAsQX5qDgcGBQUDAQIABQsgACAALwEwQQhyOwEwDAMLQQIhFAwBC0EEIRQLIABBAToALCAAIAAvATAgFHI7ATALIBAhAQtBKyEQDMoBCyAAQQA2AhwgACAQNgIUIABBq5KAgAA2AhAgAEELNgIMQQAhEAziAQsgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDEEAIRAM4QELIABBADoALCAQIQEMvQELIBAhAUEBIRQCQAJAAkACQAJAIAAtACxBe2oOBAMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0EpIRAMxQELIABBADYCHCAAIAE2AhQgAEHwlICAADYCECAAQQM2AgxBACEQDN0BCwJAIA4tAABBDUcNACAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA5BAWohAQx1CyAAQSw2AhwgACABNgIMIAAgDkEBajYCFEEAIRAM3QELIAAtAC1BAXFFDQFBxAEhEAzDAQsCQCAOIAJHDQBBLSEQDNwBCwJAAkADQAJAIA4tAABBdmoOBAIAAAMACyAOQQFqIg4gAkcNAAtBLSEQDN0BCyAAKAIEIQEgAEEANgIEAkAgACABIA4QsYCAgAAiAQ0AIA4hAQx0CyAAQSw2AhwgACAONgIUIAAgATYCDEEAIRAM3AELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHMLIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzbAQsgACgCBCEEIABBADYCBCAAIAQgDhCxgICAACIEDaABIA4hAQzOAQsgEEEsRw0BIAFBAWohEEEBIQECQAJAAkACQAJAIAAtACxBe2oOBAMBAgQACyAQIQEMBAtBAiEBDAELQQQhAQsgAEEBOgAsIAAgAC8BMCABcjsBMCAQIQEMAQsgACAALwEwQQhyOwEwIBAhAQtBOSEQDL8BCyAAQQA6ACwgASEBC0E0IRAMvQELIAAgAC8BMEEgcjsBMCABIQEMAgsgACgCBCEEIABBADYCBAJAIAAgBCABELGAgIAAIgQNACABIQEMxwELIABBNzYCHCAAIAE2AhQgACAENgIMQQAhEAzUAQsgAEEIOgAsIAEhAQtBMCEQDLkBCwJAIAAtAChBAUYNACABIQEMBAsgAC0ALUEIcUUNkwEgASEBDAMLIAAtADBBIHENlAFBxQEhEAy3AQsCQCAPIAJGDQACQANAAkAgDy0AAEFQaiIBQf8BcUEKSQ0AIA8hAUE1IRAMugELIAApAyAiEUKZs+bMmbPmzBlWDQEgACARQgp+IhE3AyAgESABrUL/AYMiEkJ/hVYNASAAIBEgEnw3AyAgD0EBaiIPIAJHDQALQTkhEAzRAQsgACgCBCECIABBADYCBCAAIAIgD0EBaiIEELGAgIAAIgINlQEgBCEBDMMBC0E5IRAMzwELAkAgAC8BMCIBQQhxRQ0AIAAtAChBAUcNACAALQAtQQhxRQ2QAQsgACABQff7A3FBgARyOwEwIA8hAQtBNyEQDLQBCyAAIAAvATBBEHI7ATAMqwELIBBBFUYNiwEgAEEANgIcIAAgATYCFCAAQfCOgIAANgIQIABBHDYCDEEAIRAMywELIABBwwA2AhwgACABNgIMIAAgDUEBajYCFEEAIRAMygELAkAgAS0AAEE6Rw0AIAAoAgQhECAAQQA2AgQCQCAAIBAgARCvgICAACIQDQAgAUEBaiEBDGMLIABBwwA2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMygELIABBADYCHCAAIAE2AhQgAEGxkYCAADYCECAAQQo2AgxBACEQDMkBCyAAQQA2AhwgACABNgIUIABBoJmAgAA2AhAgAEEeNgIMQQAhEAzIAQsgAEEANgIACyAAQYASOwEqIAAgF0EBaiIBIAIQqICAgAAiEA0BIAEhAQtBxwAhEAysAQsgEEEVRw2DASAAQdEANgIcIAAgATYCFCAAQeOXgIAANgIQIABBFTYCDEEAIRAMxAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDF4LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMwwELIABBADYCHCAAIBQ2AhQgAEHBqICAADYCECAAQQc2AgwgAEEANgIAQQAhEAzCAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAzBAQtBACEQIABBADYCHCAAIAE2AhQgAEGAkYCAADYCECAAQQk2AgwMwAELIBBBFUYNfSAAQQA2AhwgACABNgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAy/AQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgAUEBaiEBAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBAJAIAAgECABEK2AgIAAIhANACABIQEMXAsgAEHYADYCHCAAIAE2AhQgACAQNgIMQQAhEAy+AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMrQELIABB2QA2AhwgACABNgIUIAAgBDYCDEEAIRAMvQELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKsBCyAAQdoANgIcIAAgATYCFCAAIAQ2AgxBACEQDLwBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQypAQsgAEHcADYCHCAAIAE2AhQgACAENgIMQQAhEAy7AQsCQCABLQAAQVBqIhBB/wFxQQpPDQAgACAQOgAqIAFBAWohAUHPACEQDKIBCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQynAQsgAEHeADYCHCAAIAE2AhQgACAENgIMQQAhEAy6AQsgAEEANgIAIBdBAWohAQJAIAAtAClBI08NACABIQEMWQsgAEEANgIcIAAgATYCFCAAQdOJgIAANgIQIABBCDYCDEEAIRAMuQELIABBADYCAAtBACEQIABBADYCHCAAIAE2AhQgAEGQs4CAADYCECAAQQg2AgwMtwELIABBADYCACAXQQFqIQECQCAALQApQSFHDQAgASEBDFYLIABBADYCHCAAIAE2AhQgAEGbioCAADYCECAAQQg2AgxBACEQDLYBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKSIQQV1qQQtPDQAgASEBDFULAkAgEEEGSw0AQQEgEHRBygBxRQ0AIAEhAQxVC0EAIRAgAEEANgIcIAAgATYCFCAAQfeJgIAANgIQIABBCDYCDAy1AQsgEEEVRg1xIABBADYCHCAAIAE2AhQgAEG5jYCAADYCECAAQRo2AgxBACEQDLQBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxUCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLMBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDLIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDLEBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxRCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDLABCyAAQQA2AhwgACABNgIUIABBxoqAgAA2AhAgAEEHNgIMQQAhEAyvAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAyuAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMSQsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAytAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMTQsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAysAQsgAEEANgIcIAAgATYCFCAAQdyIgIAANgIQIABBBzYCDEEAIRAMqwELIBBBP0cNASABQQFqIQELQQUhEAyQAQtBACEQIABBADYCHCAAIAE2AhQgAEH9koCAADYCECAAQQc2AgwMqAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMpwELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEILIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMpgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDEYLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMpQELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0gA2AhwgACAUNgIUIAAgATYCDEEAIRAMpAELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDD8LIABB0wA2AhwgACAUNgIUIAAgATYCDEEAIRAMowELIAAoAgQhASAAQQA2AgQCQCAAIAEgFBCngICAACIBDQAgFCEBDEMLIABB5QA2AhwgACAUNgIUIAAgATYCDEEAIRAMogELIABBADYCHCAAIBQ2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKEBCyAAQQA2AhwgACABNgIUIABBw4+AgAA2AhAgAEEHNgIMQQAhEAygAQtBACEQIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgwMnwELIABBADYCHCAAIBQ2AhQgAEGMnICAADYCECAAQQc2AgxBACEQDJ4BCyAAQQA2AhwgACAUNgIUIABB/pGAgAA2AhAgAEEHNgIMQQAhEAydAQsgAEEANgIcIAAgATYCFCAAQY6bgIAANgIQIABBBjYCDEEAIRAMnAELIBBBFUYNVyAAQQA2AhwgACABNgIUIABBzI6AgAA2AhAgAEEgNgIMQQAhEAybAQsgAEEANgIAIBBBAWohAUEkIRALIAAgEDoAKSAAKAIEIRAgAEEANgIEIAAgECABEKuAgIAAIhANVCABIQEMPgsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQfGbgIAANgIQIABBBjYCDAyXAQsgAUEVRg1QIABBADYCHCAAIAU2AhQgAEHwjICAADYCECAAQRs2AgxBACEQDJYBCyAAKAIEIQUgAEEANgIEIAAgBSAQEKmAgIAAIgUNASAQQQFqIQULQa0BIRAMewsgAEHBATYCHCAAIAU2AgwgACAQQQFqNgIUQQAhEAyTAQsgACgCBCEGIABBADYCBCAAIAYgEBCpgICAACIGDQEgEEEBaiEGC0GuASEQDHgLIABBwgE2AhwgACAGNgIMIAAgEEEBajYCFEEAIRAMkAELIABBADYCHCAAIAc2AhQgAEGXi4CAADYCECAAQQ02AgxBACEQDI8BCyAAQQA2AhwgACAINgIUIABB45CAgAA2AhAgAEEJNgIMQQAhEAyOAQsgAEEANgIcIAAgCDYCFCAAQZSNgIAANgIQIABBITYCDEEAIRAMjQELQQEhFkEAIRdBACEUQQEhEAsgACAQOgArIAlBAWohCAJAAkAgAC0ALUEQcQ0AAkACQAJAIAAtACoOAwEAAgQLIBZFDQMMAgsgFA0BDAILIBdFDQELIAAoAgQhECAAQQA2AgQgACAQIAgQrYCAgAAiEEUNPSAAQckBNgIcIAAgCDYCFCAAIBA2AgxBACEQDIwBCyAAKAIEIQQgAEEANgIEIAAgBCAIEK2AgIAAIgRFDXYgAEHKATYCHCAAIAg2AhQgACAENgIMQQAhEAyLAQsgACgCBCEEIABBADYCBCAAIAQgCRCtgICAACIERQ10IABBywE2AhwgACAJNgIUIAAgBDYCDEEAIRAMigELIAAoAgQhBCAAQQA2AgQgACAEIAoQrYCAgAAiBEUNciAAQc0BNgIcIAAgCjYCFCAAIAQ2AgxBACEQDIkBCwJAIAstAABBUGoiEEH/AXFBCk8NACAAIBA6ACogC0EBaiEKQbYBIRAMcAsgACgCBCEEIABBADYCBCAAIAQgCxCtgICAACIERQ1wIABBzwE2AhwgACALNgIUIAAgBDYCDEEAIRAMiAELIABBADYCHCAAIAQ2AhQgAEGQs4CAADYCECAAQQg2AgwgAEEANgIAQQAhEAyHAQsgAUEVRg0/IABBADYCHCAAIAw2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDIYBCyAAQYEEOwEoIAAoAgQhECAAQgA3AwAgACAQIAxBAWoiDBCrgICAACIQRQ04IABB0wE2AhwgACAMNgIUIAAgEDYCDEEAIRAMhQELIABBADYCAAtBACEQIABBADYCHCAAIAQ2AhQgAEHYm4CAADYCECAAQQg2AgwMgwELIAAoAgQhECAAQgA3AwAgACAQIAtBAWoiCxCrgICAACIQDQFBxgEhEAxpCyAAQQI6ACgMVQsgAEHVATYCHCAAIAs2AhQgACAQNgIMQQAhEAyAAQsgEEEVRg03IABBADYCHCAAIAQ2AhQgAEGkjICAADYCECAAQRA2AgxBACEQDH8LIAAtADRBAUcNNCAAIAQgAhC8gICAACIQRQ00IBBBFUcNNSAAQdwBNgIcIAAgBDYCFCAAQdWWgIAANgIQIABBFTYCDEEAIRAMfgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQMfQtBACEQDGMLQQIhEAxiC0ENIRAMYQtBDyEQDGALQSUhEAxfC0ETIRAMXgtBFSEQDF0LQRYhEAxcC0EXIRAMWwtBGCEQDFoLQRkhEAxZC0EaIRAMWAtBGyEQDFcLQRwhEAxWC0EdIRAMVQtBHyEQDFQLQSEhEAxTC0EjIRAMUgtBxgAhEAxRC0EuIRAMUAtBLyEQDE8LQTshEAxOC0E9IRAMTQtByAAhEAxMC0HJACEQDEsLQcsAIRAMSgtBzAAhEAxJC0HOACEQDEgLQdEAIRAMRwtB1QAhEAxGC0HYACEQDEULQdkAIRAMRAtB2wAhEAxDC0HkACEQDEILQeUAIRAMQQtB8QAhEAxAC0H0ACEQDD8LQY0BIRAMPgtBlwEhEAw9C0GpASEQDDwLQawBIRAMOwtBwAEhEAw6C0G5ASEQDDkLQa8BIRAMOAtBsQEhEAw3C0GyASEQDDYLQbQBIRAMNQtBtQEhEAw0C0G6ASEQDDMLQb0BIRAMMgtBvwEhEAwxC0HBASEQDDALIABBADYCHCAAIAQ2AhQgAEHpi4CAADYCECAAQR82AgxBACEQDEgLIABB2wE2AhwgACAENgIUIABB+paAgAA2AhAgAEEVNgIMQQAhEAxHCyAAQfgANgIcIAAgDDYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMRgsgAEHRADYCHCAAIAU2AhQgAEGwl4CAADYCECAAQRU2AgxBACEQDEULIABB+QA2AhwgACABNgIUIAAgEDYCDEEAIRAMRAsgAEH4ADYCHCAAIAE2AhQgAEHKmICAADYCECAAQRU2AgxBACEQDEMLIABB5AA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAxCCyAAQdcANgIcIAAgATYCFCAAQcmXgIAANgIQIABBFTYCDEEAIRAMQQsgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMQAsgAEHCADYCHCAAIAE2AhQgAEHjmICAADYCECAAQRU2AgxBACEQDD8LIABBADYCBCAAIA8gDxCxgICAACIERQ0BIABBOjYCHCAAIAQ2AgwgACAPQQFqNgIUQQAhEAw+CyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBEUNACAAQTs2AhwgACAENgIMIAAgAUEBajYCFEEAIRAMPgsgAUEBaiEBDC0LIA9BAWohAQwtCyAAQQA2AhwgACAPNgIUIABB5JKAgAA2AhAgAEEENgIMQQAhEAw7CyAAQTY2AhwgACAENgIUIAAgAjYCDEEAIRAMOgsgAEEuNgIcIAAgDjYCFCAAIAQ2AgxBACEQDDkLIABB0AA2AhwgACABNgIUIABBkZiAgAA2AhAgAEEVNgIMQQAhEAw4CyANQQFqIQEMLAsgAEEVNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMNgsgAEEbNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNQsgAEEPNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMNAsgAEELNgIcIAAgATYCFCAAQZGXgIAANgIQIABBFTYCDEEAIRAMMwsgAEEaNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMgsgAEELNgIcIAAgATYCFCAAQYKZgIAANgIQIABBFTYCDEEAIRAMMQsgAEEKNgIcIAAgATYCFCAAQeSWgIAANgIQIABBFTYCDEEAIRAMMAsgAEEeNgIcIAAgATYCFCAAQfmXgIAANgIQIABBFTYCDEEAIRAMLwsgAEEANgIcIAAgEDYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMLgsgAEEENgIcIAAgATYCFCAAQbCYgIAANgIQIABBFTYCDEEAIRAMLQsgAEEANgIAIAtBAWohCwtBuAEhEAwSCyAAQQA2AgAgEEEBaiEBQfUAIRAMEQsgASEBAkAgAC0AKUEFRw0AQeMAIRAMEQtB4gAhEAwQC0EAIRAgAEEANgIcIABB5JGAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAwoCyAAQQA2AgAgF0EBaiEBQcAAIRAMDgtBASEBCyAAIAE6ACwgAEEANgIAIBdBAWohAQtBKCEQDAsLIAEhAQtBOCEQDAkLAkAgASIPIAJGDQADQAJAIA8tAABBgL6AgABqLQAAIgFBAUYNACABQQJHDQMgD0EBaiEBDAQLIA9BAWoiDyACRw0AC0E+IRAMIgtBPiEQDCELIABBADoALCAPIQEMAQtBCyEQDAYLQTohEAwFCyABQQFqIQFBLSEQDAQLIAAgAToALCAAQQA2AgAgFkEBaiEBQQwhEAwDCyAAQQA2AgAgF0EBaiEBQQohEAwCCyAAQQA2AgALIABBADoALCANIQFBCSEQDAALC0EAIRAgAEEANgIcIAAgCzYCFCAAQc2QgIAANgIQIABBCTYCDAwXC0EAIRAgAEEANgIcIAAgCjYCFCAAQemKgIAANgIQIABBCTYCDAwWC0EAIRAgAEEANgIcIAAgCTYCFCAAQbeQgIAANgIQIABBCTYCDAwVC0EAIRAgAEEANgIcIAAgCDYCFCAAQZyRgIAANgIQIABBCTYCDAwUC0EAIRAgAEEANgIcIAAgATYCFCAAQc2QgIAANgIQIABBCTYCDAwTC0EAIRAgAEEANgIcIAAgATYCFCAAQemKgIAANgIQIABBCTYCDAwSC0EAIRAgAEEANgIcIAAgATYCFCAAQbeQgIAANgIQIABBCTYCDAwRC0EAIRAgAEEANgIcIAAgATYCFCAAQZyRgIAANgIQIABBCTYCDAwQC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwPC0EAIRAgAEEANgIcIAAgATYCFCAAQZeVgIAANgIQIABBDzYCDAwOC0EAIRAgAEEANgIcIAAgATYCFCAAQcCSgIAANgIQIABBCzYCDAwNC0EAIRAgAEEANgIcIAAgATYCFCAAQZWJgIAANgIQIABBCzYCDAwMC0EAIRAgAEEANgIcIAAgATYCFCAAQeGPgIAANgIQIABBCjYCDAwLC0EAIRAgAEEANgIcIAAgATYCFCAAQfuPgIAANgIQIABBCjYCDAwKC0EAIRAgAEEANgIcIAAgATYCFCAAQfGZgIAANgIQIABBAjYCDAwJC0EAIRAgAEEANgIcIAAgATYCFCAAQcSUgIAANgIQIABBAjYCDAwIC0EAIRAgAEEANgIcIAAgATYCFCAAQfKVgIAANgIQIABBAjYCDAwHCyAAQQI2AhwgACABNgIUIABBnJqAgAA2AhAgAEEWNgIMQQAhEAwGC0EBIRAMBQtB1AAhECABIgQgAkYNBCADQQhqIAAgBCACQdjCgIAAQQoQxYCAgAAgAygCDCEEIAMoAggOAwEEAgALEMqAgIAAAAsgAEEANgIcIABBtZqAgAA2AhAgAEEXNgIMIAAgBEEBajYCFEEAIRAMAgsgAEEANgIcIAAgBDYCFCAAQcqagIAANgIQIABBCTYCDEEAIRAMAQsCQCABIgQgAkcNAEEiIRAMAQsgAEGJgICAADYCCCAAIAQ2AgRBISEQCyADQRBqJICAgIAAIBALrwEBAn8gASgCACEGAkACQCACIANGDQAgBCAGaiEEIAYgA2ogAmshByACIAZBf3MgBWoiBmohBQNAAkAgAi0AACAELQAARg0AQQIhBAwDCwJAIAYNAEEAIQQgBSECDAMLIAZBf2ohBiAEQQFqIQQgAkEBaiICIANHDQALIAchBiADIQILIABBATYCACABIAY2AgAgACACNgIEDwsgAUEANgIAIAAgBDYCACAAIAI2AgQLCgAgABDHgICAAAvyNgELfyOAgICAAEEQayIBJICAgIAAAkBBACgCoNCAgAANAEEAEMuAgIAAQYDUhIAAayICQdkASQ0AQQAhAwJAQQAoAuDTgIAAIgQNAEEAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEIakFwcUHYqtWqBXMiBDYC4NOAgABBAEEANgL004CAAEEAQQA2AsTTgIAAC0EAIAI2AszTgIAAQQBBgNSEgAA2AsjTgIAAQQBBgNSEgAA2ApjQgIAAQQAgBDYCrNCAgABBAEF/NgKo0ICAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALQYDUhIAAQXhBgNSEgABrQQ9xQQBBgNSEgABBCGpBD3EbIgNqIgRBBGogAkFIaiIFIANrIgNBAXI2AgBBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAQYDUhIAAIAVqQTg2AgQLAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABB7AFLDQACQEEAKAKI0ICAACIGQRAgAEETakFwcSAAQQtJGyICQQN2IgR2IgNBA3FFDQACQAJAIANBAXEgBHJBAXMiBUEDdCIEQbDQgIAAaiIDIARBuNCAgABqKAIAIgQoAggiAkcNAEEAIAZBfiAFd3E2AojQgIAADAELIAMgAjYCCCACIAM2AgwLIARBCGohAyAEIAVBA3QiBUEDcjYCBCAEIAVqIgQgBCgCBEEBcjYCBAwMCyACQQAoApDQgIAAIgdNDQECQCADRQ0AAkACQCADIAR0QQIgBHQiA0EAIANrcnEiA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqIgRBA3QiA0Gw0ICAAGoiBSADQbjQgIAAaigCACIDKAIIIgBHDQBBACAGQX4gBHdxIgY2AojQgIAADAELIAUgADYCCCAAIAU2AgwLIAMgAkEDcjYCBCADIARBA3QiBGogBCACayIFNgIAIAMgAmoiACAFQQFyNgIEAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQQCQAJAIAZBASAHQQN2dCIIcQ0AQQAgBiAIcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCAENgIMIAIgBDYCCCAEIAI2AgwgBCAINgIICyADQQhqIQNBACAANgKc0ICAAEEAIAU2ApDQgIAADAwLQQAoAozQgIAAIglFDQEgCUEAIAlrcUF/aiIDIANBDHZBEHEiA3YiBEEFdkEIcSIFIANyIAQgBXYiA0ECdkEEcSIEciADIAR2IgNBAXZBAnEiBHIgAyAEdiIDQQF2QQFxIgRyIAMgBHZqQQJ0QbjSgIAAaigCACIAKAIEQXhxIAJrIQQgACEFAkADQAJAIAUoAhAiAw0AIAVBFGooAgAiA0UNAgsgAygCBEF4cSACayIFIAQgBSAESSIFGyEEIAMgACAFGyEAIAMhBQwACwsgACgCGCEKAkAgACgCDCIIIABGDQAgACgCCCIDQQAoApjQgIAASRogCCADNgIIIAMgCDYCDAwLCwJAIABBFGoiBSgCACIDDQAgACgCECIDRQ0DIABBEGohBQsDQCAFIQsgAyIIQRRqIgUoAgAiAw0AIAhBEGohBSAIKAIQIgMNAAsgC0EANgIADAoLQX8hAiAAQb9/Sw0AIABBE2oiA0FwcSECQQAoAozQgIAAIgdFDQBBACELAkAgAkGAAkkNAEEfIQsgAkH///8HSw0AIANBCHYiAyADQYD+P2pBEHZBCHEiA3QiBCAEQYDgH2pBEHZBBHEiBHQiBSAFQYCAD2pBEHZBAnEiBXRBD3YgAyAEciAFcmsiA0EBdCACIANBFWp2QQFxckEcaiELC0EAIAJrIQQCQAJAAkACQCALQQJ0QbjSgIAAaigCACIFDQBBACEDQQAhCAwBC0EAIQMgAkEAQRkgC0EBdmsgC0EfRht0IQBBACEIA0ACQCAFKAIEQXhxIAJrIgYgBE8NACAGIQQgBSEIIAYNAEEAIQQgBSEIIAUhAwwDCyADIAVBFGooAgAiBiAGIAUgAEEddkEEcWpBEGooAgAiBUYbIAMgBhshAyAAQQF0IQAgBQ0ACwsCQCADIAhyDQBBACEIQQIgC3QiA0EAIANrciAHcSIDRQ0DIANBACADa3FBf2oiAyADQQx2QRBxIgN2IgVBBXZBCHEiACADciAFIAB2IgNBAnZBBHEiBXIgAyAFdiIDQQF2QQJxIgVyIAMgBXYiA0EBdkEBcSIFciADIAV2akECdEG40oCAAGooAgAhAwsgA0UNAQsDQCADKAIEQXhxIAJrIgYgBEkhAAJAIAMoAhAiBQ0AIANBFGooAgAhBQsgBiAEIAAbIQQgAyAIIAAbIQggBSEDIAUNAAsLIAhFDQAgBEEAKAKQ0ICAACACa08NACAIKAIYIQsCQCAIKAIMIgAgCEYNACAIKAIIIgNBACgCmNCAgABJGiAAIAM2AgggAyAANgIMDAkLAkAgCEEUaiIFKAIAIgMNACAIKAIQIgNFDQMgCEEQaiEFCwNAIAUhBiADIgBBFGoiBSgCACIDDQAgAEEQaiEFIAAoAhAiAw0ACyAGQQA2AgAMCAsCQEEAKAKQ0ICAACIDIAJJDQBBACgCnNCAgAAhBAJAAkAgAyACayIFQRBJDQAgBCACaiIAIAVBAXI2AgRBACAFNgKQ0ICAAEEAIAA2ApzQgIAAIAQgA2ogBTYCACAEIAJBA3I2AgQMAQsgBCADQQNyNgIEIAQgA2oiAyADKAIEQQFyNgIEQQBBADYCnNCAgABBAEEANgKQ0ICAAAsgBEEIaiEDDAoLAkBBACgClNCAgAAiACACTQ0AQQAoAqDQgIAAIgMgAmoiBCAAIAJrIgVBAXI2AgRBACAFNgKU0ICAAEEAIAQ2AqDQgIAAIAMgAkEDcjYCBCADQQhqIQMMCgsCQAJAQQAoAuDTgIAARQ0AQQAoAujTgIAAIQQMAQtBAEJ/NwLs04CAAEEAQoCAhICAgMAANwLk04CAAEEAIAFBDGpBcHFB2KrVqgVzNgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgABBgIAEIQQLQQAhAwJAIAQgAkHHAGoiB2oiBkEAIARrIgtxIgggAksNAEEAQTA2AvjTgIAADAoLAkBBACgCwNOAgAAiA0UNAAJAQQAoArjTgIAAIgQgCGoiBSAETQ0AIAUgA00NAQtBACEDQQBBMDYC+NOAgAAMCgtBAC0AxNOAgABBBHENBAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQAJAIAMoAgAiBSAESw0AIAUgAygCBGogBEsNAwsgAygCCCIDDQALC0EAEMuAgIAAIgBBf0YNBSAIIQYCQEEAKALk04CAACIDQX9qIgQgAHFFDQAgCCAAayAEIABqQQAgA2txaiEGCyAGIAJNDQUgBkH+////B0sNBQJAQQAoAsDTgIAAIgNFDQBBACgCuNOAgAAiBCAGaiIFIARNDQYgBSADSw0GCyAGEMuAgIAAIgMgAEcNAQwHCyAGIABrIAtxIgZB/v///wdLDQQgBhDLgICAACIAIAMoAgAgAygCBGpGDQMgACEDCwJAIANBf0YNACACQcgAaiAGTQ0AAkAgByAGa0EAKALo04CAACIEakEAIARrcSIEQf7///8HTQ0AIAMhAAwHCwJAIAQQy4CAgABBf0YNACAEIAZqIQYgAyEADAcLQQAgBmsQy4CAgAAaDAQLIAMhACADQX9HDQUMAwtBACEIDAcLQQAhAAwFCyAAQX9HDQILQQBBACgCxNOAgABBBHI2AsTTgIAACyAIQf7///8HSw0BIAgQy4CAgAAhAEEAEMuAgIAAIQMgAEF/Rg0BIANBf0YNASAAIANPDQEgAyAAayIGIAJBOGpNDQELQQBBACgCuNOAgAAgBmoiAzYCuNOAgAACQCADQQAoArzTgIAATQ0AQQAgAzYCvNOAgAALAkACQAJAAkBBACgCoNCAgAAiBEUNAEHI04CAACEDA0AgACADKAIAIgUgAygCBCIIakYNAiADKAIIIgMNAAwDCwsCQAJAQQAoApjQgIAAIgNFDQAgACADTw0BC0EAIAA2ApjQgIAAC0EAIQNBACAGNgLM04CAAEEAIAA2AsjTgIAAQQBBfzYCqNCAgABBAEEAKALg04CAADYCrNCAgABBAEEANgLU04CAAANAIANBxNCAgABqIANBuNCAgABqIgQ2AgAgBCADQbDQgIAAaiIFNgIAIANBvNCAgABqIAU2AgAgA0HM0ICAAGogA0HA0ICAAGoiBTYCACAFIAQ2AgAgA0HU0ICAAGogA0HI0ICAAGoiBDYCACAEIAU2AgAgA0HQ0ICAAGogBDYCACADQSBqIgNBgAJHDQALIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgQgBkFIaiIFIANrIgNBAXI2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAQ2AqDQgIAAIAAgBWpBODYCBAwCCyADLQAMQQhxDQAgBCAFSQ0AIAQgAE8NACAEQXggBGtBD3FBACAEQQhqQQ9xGyIFaiIAQQAoApTQgIAAIAZqIgsgBWsiBUEBcjYCBCADIAggBmo2AgRBAEEAKALw04CAADYCpNCAgABBACAFNgKU0ICAAEEAIAA2AqDQgIAAIAQgC2pBODYCBAwBCwJAIABBACgCmNCAgAAiCE8NAEEAIAA2ApjQgIAAIAAhCAsgACAGaiEFQcjTgIAAIQMCQAJAAkACQAJAAkACQANAIAMoAgAgBUYNASADKAIIIgMNAAwCCwsgAy0ADEEIcUUNAQtByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiIFIARLDQMLIAMoAgghAwwACwsgAyAANgIAIAMgAygCBCAGajYCBCAAQXggAGtBD3FBACAAQQhqQQ9xG2oiCyACQQNyNgIEIAVBeCAFa0EPcUEAIAVBCGpBD3EbaiIGIAsgAmoiAmshAwJAIAYgBEcNAEEAIAI2AqDQgIAAQQBBACgClNCAgAAgA2oiAzYClNCAgAAgAiADQQFyNgIEDAMLAkAgBkEAKAKc0ICAAEcNAEEAIAI2ApzQgIAAQQBBACgCkNCAgAAgA2oiAzYCkNCAgAAgAiADQQFyNgIEIAIgA2ogAzYCAAwDCwJAIAYoAgQiBEEDcUEBRw0AIARBeHEhBwJAAkAgBEH/AUsNACAGKAIIIgUgBEEDdiIIQQN0QbDQgIAAaiIARhoCQCAGKAIMIgQgBUcNAEEAQQAoAojQgIAAQX4gCHdxNgKI0ICAAAwCCyAEIABGGiAEIAU2AgggBSAENgIMDAELIAYoAhghCQJAAkAgBigCDCIAIAZGDQAgBigCCCIEIAhJGiAAIAQ2AgggBCAANgIMDAELAkAgBkEUaiIEKAIAIgUNACAGQRBqIgQoAgAiBQ0AQQAhAAwBCwNAIAQhCCAFIgBBFGoiBCgCACIFDQAgAEEQaiEEIAAoAhAiBQ0ACyAIQQA2AgALIAlFDQACQAJAIAYgBigCHCIFQQJ0QbjSgIAAaiIEKAIARw0AIAQgADYCACAADQFBAEEAKAKM0ICAAEF+IAV3cTYCjNCAgAAMAgsgCUEQQRQgCSgCECAGRhtqIAA2AgAgAEUNAQsgACAJNgIYAkAgBigCECIERQ0AIAAgBDYCECAEIAA2AhgLIAYoAhQiBEUNACAAQRRqIAQ2AgAgBCAANgIYCyAHIANqIQMgBiAHaiIGKAIEIQQLIAYgBEF+cTYCBCACIANqIAM2AgAgAiADQQFyNgIEAkAgA0H/AUsNACADQXhxQbDQgIAAaiEEAkACQEEAKAKI0ICAACIFQQEgA0EDdnQiA3ENAEEAIAUgA3I2AojQgIAAIAQhAwwBCyAEKAIIIQMLIAMgAjYCDCAEIAI2AgggAiAENgIMIAIgAzYCCAwDC0EfIQQCQCADQf///wdLDQAgA0EIdiIEIARBgP4/akEQdkEIcSIEdCIFIAVBgOAfakEQdkEEcSIFdCIAIABBgIAPakEQdkECcSIAdEEPdiAEIAVyIAByayIEQQF0IAMgBEEVanZBAXFyQRxqIQQLIAIgBDYCHCACQgA3AhAgBEECdEG40oCAAGohBQJAQQAoAozQgIAAIgBBASAEdCIIcQ0AIAUgAjYCAEEAIAAgCHI2AozQgIAAIAIgBTYCGCACIAI2AgggAiACNgIMDAMLIANBAEEZIARBAXZrIARBH0YbdCEEIAUoAgAhAANAIAAiBSgCBEF4cSADRg0CIARBHXYhACAEQQF0IQQgBSAAQQRxakEQaiIIKAIAIgANAAsgCCACNgIAIAIgBTYCGCACIAI2AgwgAiACNgIIDAILIABBeCAAa0EPcUEAIABBCGpBD3EbIgNqIgsgBkFIaiIIIANrIgNBAXI2AgQgACAIakE4NgIEIAQgBUE3IAVrQQ9xQQAgBUFJakEPcRtqQUFqIgggCCAEQRBqSRsiCEEjNgIEQQBBACgC8NOAgAA2AqTQgIAAQQAgAzYClNCAgABBACALNgKg0ICAACAIQRBqQQApAtDTgIAANwIAIAhBACkCyNOAgAA3AghBACAIQQhqNgLQ04CAAEEAIAY2AszTgIAAQQAgADYCyNOAgABBAEEANgLU04CAACAIQSRqIQMDQCADQQc2AgAgA0EEaiIDIAVJDQALIAggBEYNAyAIIAgoAgRBfnE2AgQgCCAIIARrIgA2AgAgBCAAQQFyNgIEAkAgAEH/AUsNACAAQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgAEEDdnQiAHENAEEAIAUgAHI2AojQgIAAIAMhBQwBCyADKAIIIQULIAUgBDYCDCADIAQ2AgggBCADNgIMIAQgBTYCCAwEC0EfIQMCQCAAQf///wdLDQAgAEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCIIIAhBgIAPakEQdkECcSIIdEEPdiADIAVyIAhyayIDQQF0IAAgA0EVanZBAXFyQRxqIQMLIAQgAzYCHCAEQgA3AhAgA0ECdEG40oCAAGohBQJAQQAoAozQgIAAIghBASADdCIGcQ0AIAUgBDYCAEEAIAggBnI2AozQgIAAIAQgBTYCGCAEIAQ2AgggBCAENgIMDAQLIABBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhCANAIAgiBSgCBEF4cSAARg0DIANBHXYhCCADQQF0IQMgBSAIQQRxakEQaiIGKAIAIggNAAsgBiAENgIAIAQgBTYCGCAEIAQ2AgwgBCAENgIIDAMLIAUoAggiAyACNgIMIAUgAjYCCCACQQA2AhggAiAFNgIMIAIgAzYCCAsgC0EIaiEDDAULIAUoAggiAyAENgIMIAUgBDYCCCAEQQA2AhggBCAFNgIMIAQgAzYCCAtBACgClNCAgAAiAyACTQ0AQQAoAqDQgIAAIgQgAmoiBSADIAJrIgNBAXI2AgRBACADNgKU0ICAAEEAIAU2AqDQgIAAIAQgAkEDcjYCBCAEQQhqIQMMAwtBACEDQQBBMDYC+NOAgAAMAgsCQCALRQ0AAkACQCAIIAgoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAA2AgAgAA0BQQAgB0F+IAV3cSIHNgKM0ICAAAwCCyALQRBBFCALKAIQIAhGG2ogADYCACAARQ0BCyAAIAs2AhgCQCAIKAIQIgNFDQAgACADNgIQIAMgADYCGAsgCEEUaigCACIDRQ0AIABBFGogAzYCACADIAA2AhgLAkACQCAEQQ9LDQAgCCAEIAJqIgNBA3I2AgQgCCADaiIDIAMoAgRBAXI2AgQMAQsgCCACaiIAIARBAXI2AgQgCCACQQNyNgIEIAAgBGogBDYCAAJAIARB/wFLDQAgBEF4cUGw0ICAAGohAwJAAkBBACgCiNCAgAAiBUEBIARBA3Z0IgRxDQBBACAFIARyNgKI0ICAACADIQQMAQsgAygCCCEECyAEIAA2AgwgAyAANgIIIAAgAzYCDCAAIAQ2AggMAQtBHyEDAkAgBEH///8HSw0AIARBCHYiAyADQYD+P2pBEHZBCHEiA3QiBSAFQYDgH2pBEHZBBHEiBXQiAiACQYCAD2pBEHZBAnEiAnRBD3YgAyAFciACcmsiA0EBdCAEIANBFWp2QQFxckEcaiEDCyAAIAM2AhwgAEIANwIQIANBAnRBuNKAgABqIQUCQCAHQQEgA3QiAnENACAFIAA2AgBBACAHIAJyNgKM0ICAACAAIAU2AhggACAANgIIIAAgADYCDAwBCyAEQQBBGSADQQF2ayADQR9GG3QhAyAFKAIAIQICQANAIAIiBSgCBEF4cSAERg0BIANBHXYhAiADQQF0IQMgBSACQQRxakEQaiIGKAIAIgINAAsgBiAANgIAIAAgBTYCGCAAIAA2AgwgACAANgIIDAELIAUoAggiAyAANgIMIAUgADYCCCAAQQA2AhggACAFNgIMIAAgAzYCCAsgCEEIaiEDDAELAkAgCkUNAAJAAkAgACAAKAIcIgVBAnRBuNKAgABqIgMoAgBHDQAgAyAINgIAIAgNAUEAIAlBfiAFd3E2AozQgIAADAILIApBEEEUIAooAhAgAEYbaiAINgIAIAhFDQELIAggCjYCGAJAIAAoAhAiA0UNACAIIAM2AhAgAyAINgIYCyAAQRRqKAIAIgNFDQAgCEEUaiADNgIAIAMgCDYCGAsCQAJAIARBD0sNACAAIAQgAmoiA0EDcjYCBCAAIANqIgMgAygCBEEBcjYCBAwBCyAAIAJqIgUgBEEBcjYCBCAAIAJBA3I2AgQgBSAEaiAENgIAAkAgB0UNACAHQXhxQbDQgIAAaiECQQAoApzQgIAAIQMCQAJAQQEgB0EDdnQiCCAGcQ0AQQAgCCAGcjYCiNCAgAAgAiEIDAELIAIoAgghCAsgCCADNgIMIAIgAzYCCCADIAI2AgwgAyAINgIIC0EAIAU2ApzQgIAAQQAgBDYCkNCAgAALIABBCGohAwsgAUEQaiSAgICAACADCwoAIAAQyYCAgAAL4g0BB38CQCAARQ0AIABBeGoiASAAQXxqKAIAIgJBeHEiAGohAwJAIAJBAXENACACQQNxRQ0BIAEgASgCACICayIBQQAoApjQgIAAIgRJDQEgAiAAaiEAAkAgAUEAKAKc0ICAAEYNAAJAIAJB/wFLDQAgASgCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgASgCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAwsgAiAGRhogAiAENgIIIAQgAjYCDAwCCyABKAIYIQcCQAJAIAEoAgwiBiABRg0AIAEoAggiAiAESRogBiACNgIIIAIgBjYCDAwBCwJAIAFBFGoiAigCACIEDQAgAUEQaiICKAIAIgQNAEEAIQYMAQsDQCACIQUgBCIGQRRqIgIoAgAiBA0AIAZBEGohAiAGKAIQIgQNAAsgBUEANgIACyAHRQ0BAkACQCABIAEoAhwiBEECdEG40oCAAGoiAigCAEcNACACIAY2AgAgBg0BQQBBACgCjNCAgABBfiAEd3E2AozQgIAADAMLIAdBEEEUIAcoAhAgAUYbaiAGNgIAIAZFDQILIAYgBzYCGAJAIAEoAhAiAkUNACAGIAI2AhAgAiAGNgIYCyABKAIUIgJFDQEgBkEUaiACNgIAIAIgBjYCGAwBCyADKAIEIgJBA3FBA0cNACADIAJBfnE2AgRBACAANgKQ0ICAACABIABqIAA2AgAgASAAQQFyNgIEDwsgASADTw0AIAMoAgQiAkEBcUUNAAJAAkAgAkECcQ0AAkAgA0EAKAKg0ICAAEcNAEEAIAE2AqDQgIAAQQBBACgClNCAgAAgAGoiADYClNCAgAAgASAAQQFyNgIEIAFBACgCnNCAgABHDQNBAEEANgKQ0ICAAEEAQQA2ApzQgIAADwsCQCADQQAoApzQgIAARw0AQQAgATYCnNCAgABBAEEAKAKQ0ICAACAAaiIANgKQ0ICAACABIABBAXI2AgQgASAAaiAANgIADwsgAkF4cSAAaiEAAkACQCACQf8BSw0AIAMoAggiBCACQQN2IgVBA3RBsNCAgABqIgZGGgJAIAMoAgwiAiAERw0AQQBBACgCiNCAgABBfiAFd3E2AojQgIAADAILIAIgBkYaIAIgBDYCCCAEIAI2AgwMAQsgAygCGCEHAkACQCADKAIMIgYgA0YNACADKAIIIgJBACgCmNCAgABJGiAGIAI2AgggAiAGNgIMDAELAkAgA0EUaiICKAIAIgQNACADQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQACQAJAIAMgAygCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAgsgB0EQQRQgBygCECADRhtqIAY2AgAgBkUNAQsgBiAHNgIYAkAgAygCECICRQ0AIAYgAjYCECACIAY2AhgLIAMoAhQiAkUNACAGQRRqIAI2AgAgAiAGNgIYCyABIABqIAA2AgAgASAAQQFyNgIEIAFBACgCnNCAgABHDQFBACAANgKQ0ICAAA8LIAMgAkF+cTYCBCABIABqIAA2AgAgASAAQQFyNgIECwJAIABB/wFLDQAgAEF4cUGw0ICAAGohAgJAAkBBACgCiNCAgAAiBEEBIABBA3Z0IgBxDQBBACAEIAByNgKI0ICAACACIQAMAQsgAigCCCEACyAAIAE2AgwgAiABNgIIIAEgAjYCDCABIAA2AggPC0EfIQICQCAAQf///wdLDQAgAEEIdiICIAJBgP4/akEQdkEIcSICdCIEIARBgOAfakEQdkEEcSIEdCIGIAZBgIAPakEQdkECcSIGdEEPdiACIARyIAZyayICQQF0IAAgAkEVanZBAXFyQRxqIQILIAEgAjYCHCABQgA3AhAgAkECdEG40oCAAGohBAJAAkBBACgCjNCAgAAiBkEBIAJ0IgNxDQAgBCABNgIAQQAgBiADcjYCjNCAgAAgASAENgIYIAEgATYCCCABIAE2AgwMAQsgAEEAQRkgAkEBdmsgAkEfRht0IQIgBCgCACEGAkADQCAGIgQoAgRBeHEgAEYNASACQR12IQYgAkEBdCECIAQgBkEEcWpBEGoiAygCACIGDQALIAMgATYCACABIAQ2AhggASABNgIMIAEgATYCCAwBCyAEKAIIIgAgATYCDCAEIAE2AgggAUEANgIYIAEgBDYCDCABIAA2AggLQQBBACgCqNCAgABBf2oiAUF/IAEbNgKo0ICAAAsLBAAAAAtOAAJAIAANAD8AQRB0DwsCQCAAQf//A3ENACAAQX9MDQACQCAAQRB2QAAiAEF/Rw0AQQBBMDYC+NOAgABBfw8LIABBEHQPCxDKgICAAAAL8gICA38BfgJAIAJFDQAgACABOgAAIAIgAGoiA0F/aiABOgAAIAJBA0kNACAAIAE6AAIgACABOgABIANBfWogAToAACADQX5qIAE6AAAgAkEHSQ0AIAAgAToAAyADQXxqIAE6AAAgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2AgwgAkFwaiABNgIAIAJBbGogATYCACACQWhqIAE2AgAgAkFkaiABNgIAIAQgA0EEcUEYciIFayICQSBJDQAgAa1CgYCAgBB+IQYgAyAFaiEBA0AgASAGNwMYIAEgBjcDECABIAY3AwggASAGNwMAIAFBIGohASACQWBqIgJBH0sNAAsLIAALC45IAQBBgAgLhkgBAAAAAgAAAAMAAAAAAAAAAAAAAAQAAAAFAAAAAAAAAAAAAAAGAAAABwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEludmFsaWQgY2hhciBpbiB1cmwgcXVlcnkAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9ib2R5AENvbnRlbnQtTGVuZ3RoIG92ZXJmbG93AENodW5rIHNpemUgb3ZlcmZsb3cAUmVzcG9uc2Ugb3ZlcmZsb3cASW52YWxpZCBtZXRob2QgZm9yIEhUVFAveC54IHJlcXVlc3QASW52YWxpZCBtZXRob2QgZm9yIFJUU1AveC54IHJlcXVlc3QARXhwZWN0ZWQgU09VUkNFIG1ldGhvZCBmb3IgSUNFL3gueCByZXF1ZXN0AEludmFsaWQgY2hhciBpbiB1cmwgZnJhZ21lbnQgc3RhcnQARXhwZWN0ZWQgZG90AFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fc3RhdHVzAEludmFsaWQgcmVzcG9uc2Ugc3RhdHVzAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMAVXNlciBjYWxsYmFjayBlcnJvcgBgb25fcmVzZXRgIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19oZWFkZXJgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2JlZ2luYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlYCBjYWxsYmFjayBlcnJvcgBgb25fc3RhdHVzX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdmVyc2lvbl9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX3VybF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWVzc2FnZV9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX21ldGhvZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZWAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lYCBjYWxsYmFjayBlcnJvcgBVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNlcnZlcgBJbnZhbGlkIGhlYWRlciB2YWx1ZSBjaGFyAEludmFsaWQgaGVhZGVyIGZpZWxkIGNoYXIAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl92ZXJzaW9uAEludmFsaWQgbWlub3IgdmVyc2lvbgBJbnZhbGlkIG1ham9yIHZlcnNpb24ARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgdmVyc2lvbgBFeHBlY3RlZCBDUkxGIGFmdGVyIHZlcnNpb24ASW52YWxpZCBIVFRQIHZlcnNpb24ASW52YWxpZCBoZWFkZXIgdG9rZW4AU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl91cmwASW52YWxpZCBjaGFyYWN0ZXJzIGluIHVybABVbmV4cGVjdGVkIHN0YXJ0IGNoYXIgaW4gdXJsAERvdWJsZSBAIGluIHVybABFbXB0eSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXJhY3RlciBpbiBDb250ZW50LUxlbmd0aABEdXBsaWNhdGUgQ29udGVudC1MZW5ndGgASW52YWxpZCBjaGFyIGluIHVybCBwYXRoAENvbnRlbnQtTGVuZ3RoIGNhbid0IGJlIHByZXNlbnQgd2l0aCBUcmFuc2Zlci1FbmNvZGluZwBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBzaXplAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX3ZhbHVlAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgdmFsdWUATWlzc2luZyBleHBlY3RlZCBMRiBhZnRlciBoZWFkZXIgdmFsdWUASW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIHF1b3RlIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGVkIHZhbHVlAFBhdXNlZCBieSBvbl9oZWFkZXJzX2NvbXBsZXRlAEludmFsaWQgRU9GIHN0YXRlAG9uX3Jlc2V0IHBhdXNlAG9uX2NodW5rX2hlYWRlciBwYXVzZQBvbl9tZXNzYWdlX2JlZ2luIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl92YWx1ZSBwYXVzZQBvbl9zdGF0dXNfY29tcGxldGUgcGF1c2UAb25fdmVyc2lvbl9jb21wbGV0ZSBwYXVzZQBvbl91cmxfY29tcGxldGUgcGF1c2UAb25fY2h1bmtfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX3ZhbHVlX2NvbXBsZXRlIHBhdXNlAG9uX21lc3NhZ2VfY29tcGxldGUgcGF1c2UAb25fbWV0aG9kX2NvbXBsZXRlIHBhdXNlAG9uX2hlYWRlcl9maWVsZF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19leHRlbnNpb25fbmFtZSBwYXVzZQBVbmV4cGVjdGVkIHNwYWNlIGFmdGVyIHN0YXJ0IGxpbmUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fbmFtZQBJbnZhbGlkIGNoYXJhY3RlciBpbiBjaHVuayBleHRlbnNpb25zIG5hbWUAUGF1c2Ugb24gQ09OTkVDVC9VcGdyYWRlAFBhdXNlIG9uIFBSSS9VcGdyYWRlAEV4cGVjdGVkIEhUVFAvMiBDb25uZWN0aW9uIFByZWZhY2UAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9tZXRob2QARXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgbWV0aG9kAFNwYW4gY2FsbGJhY2sgZXJyb3IgaW4gb25faGVhZGVyX2ZpZWxkAFBhdXNlZABJbnZhbGlkIHdvcmQgZW5jb3VudGVyZWQASW52YWxpZCBtZXRob2QgZW5jb3VudGVyZWQAVW5leHBlY3RlZCBjaGFyIGluIHVybCBzY2hlbWEAUmVxdWVzdCBoYXMgaW52YWxpZCBgVHJhbnNmZXItRW5jb2RpbmdgAFNXSVRDSF9QUk9YWQBVU0VfUFJPWFkATUtBQ1RJVklUWQBVTlBST0NFU1NBQkxFX0VOVElUWQBDT1BZAE1PVkVEX1BFUk1BTkVOVExZAFRPT19FQVJMWQBOT1RJRlkARkFJTEVEX0RFUEVOREVOQ1kAQkFEX0dBVEVXQVkAUExBWQBQVVQAQ0hFQ0tPVVQAR0FURVdBWV9USU1FT1VUAFJFUVVFU1RfVElNRU9VVABORVRXT1JLX0NPTk5FQ1RfVElNRU9VVABDT05ORUNUSU9OX1RJTUVPVVQATE9HSU5fVElNRU9VVABORVRXT1JLX1JFQURfVElNRU9VVABQT1NUAE1JU0RJUkVDVEVEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9SRVFVRVNUAENMSUVOVF9DTE9TRURfTE9BRF9CQUxBTkNFRF9SRVFVRVNUAEJBRF9SRVFVRVNUAEhUVFBfUkVRVUVTVF9TRU5UX1RPX0hUVFBTX1BPUlQAUkVQT1JUAElNX0FfVEVBUE9UAFJFU0VUX0NPTlRFTlQATk9fQ09OVEVOVABQQVJUSUFMX0NPTlRFTlQASFBFX0lOVkFMSURfQ09OU1RBTlQASFBFX0NCX1JFU0VUAEdFVABIUEVfU1RSSUNUAENPTkZMSUNUAFRFTVBPUkFSWV9SRURJUkVDVABQRVJNQU5FTlRfUkVESVJFQ1QAQ09OTkVDVABNVUxUSV9TVEFUVVMASFBFX0lOVkFMSURfU1RBVFVTAFRPT19NQU5ZX1JFUVVFU1RTAEVBUkxZX0hJTlRTAFVOQVZBSUxBQkxFX0ZPUl9MRUdBTF9SRUFTT05TAE9QVElPTlMAU1dJVENISU5HX1BST1RPQ09MUwBWQVJJQU5UX0FMU09fTkVHT1RJQVRFUwBNVUxUSVBMRV9DSE9JQ0VTAElOVEVSTkFMX1NFUlZFUl9FUlJPUgBXRUJfU0VSVkVSX1VOS05PV05fRVJST1IAUkFJTEdVTl9FUlJPUgBJREVOVElUWV9QUk9WSURFUl9BVVRIRU5USUNBVElPTl9FUlJPUgBTU0xfQ0VSVElGSUNBVEVfRVJST1IASU5WQUxJRF9YX0ZPUldBUkRFRF9GT1IAU0VUX1BBUkFNRVRFUgBHRVRfUEFSQU1FVEVSAEhQRV9VU0VSAFNFRV9PVEhFUgBIUEVfQ0JfQ0hVTktfSEVBREVSAE1LQ0FMRU5EQVIAU0VUVVAAV0VCX1NFUlZFUl9JU19ET1dOAFRFQVJET1dOAEhQRV9DTE9TRURfQ09OTkVDVElPTgBIRVVSSVNUSUNfRVhQSVJBVElPTgBESVNDT05ORUNURURfT1BFUkFUSU9OAE5PTl9BVVRIT1JJVEFUSVZFX0lORk9STUFUSU9OAEhQRV9JTlZBTElEX1ZFUlNJT04ASFBFX0NCX01FU1NBR0VfQkVHSU4AU0lURV9JU19GUk9aRU4ASFBFX0lOVkFMSURfSEVBREVSX1RPS0VOAElOVkFMSURfVE9LRU4ARk9SQklEREVOAEVOSEFOQ0VfWU9VUl9DQUxNAEhQRV9JTlZBTElEX1VSTABCTE9DS0VEX0JZX1BBUkVOVEFMX0NPTlRST0wATUtDT0wAQUNMAEhQRV9JTlRFUk5BTABSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFX1VOT0ZGSUNJQUwASFBFX09LAFVOTElOSwBVTkxPQ0sAUFJJAFJFVFJZX1dJVEgASFBFX0lOVkFMSURfQ09OVEVOVF9MRU5HVEgASFBFX1VORVhQRUNURURfQ09OVEVOVF9MRU5HVEgARkxVU0gAUFJPUFBBVENIAE0tU0VBUkNIAFVSSV9UT09fTE9ORwBQUk9DRVNTSU5HAE1JU0NFTExBTkVPVVNfUEVSU0lTVEVOVF9XQVJOSU5HAE1JU0NFTExBTkVPVVNfV0FSTklORwBIUEVfSU5WQUxJRF9UUkFOU0ZFUl9FTkNPRElORwBFeHBlY3RlZCBDUkxGAEhQRV9JTlZBTElEX0NIVU5LX1NJWkUATU9WRQBDT05USU5VRQBIUEVfQ0JfU1RBVFVTX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJTX0NPTVBMRVRFAEhQRV9DQl9WRVJTSU9OX0NPTVBMRVRFAEhQRV9DQl9VUkxfQ09NUExFVEUASFBFX0NCX0NIVU5LX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfVkFMVUVfQ09NUExFVEUASFBFX0NCX0NIVU5LX0VYVEVOU0lPTl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX05BTUVfQ09NUExFVEUASFBFX0NCX01FU1NBR0VfQ09NUExFVEUASFBFX0NCX01FVEhPRF9DT01QTEVURQBIUEVfQ0JfSEVBREVSX0ZJRUxEX0NPTVBMRVRFAERFTEVURQBIUEVfSU5WQUxJRF9FT0ZfU1RBVEUASU5WQUxJRF9TU0xfQ0VSVElGSUNBVEUAUEFVU0UATk9fUkVTUE9OU0UAVU5TVVBQT1JURURfTUVESUFfVFlQRQBHT05FAE5PVF9BQ0NFUFRBQkxFAFNFUlZJQ0VfVU5BVkFJTEFCTEUAUkFOR0VfTk9UX1NBVElTRklBQkxFAE9SSUdJTl9JU19VTlJFQUNIQUJMRQBSRVNQT05TRV9JU19TVEFMRQBQVVJHRQBNRVJHRQBSRVFVRVNUX0hFQURFUl9GSUVMRFNfVE9PX0xBUkdFAFJFUVVFU1RfSEVBREVSX1RPT19MQVJHRQBQQVlMT0FEX1RPT19MQVJHRQBJTlNVRkZJQ0lFTlRfU1RPUkFHRQBIUEVfUEFVU0VEX1VQR1JBREUASFBFX1BBVVNFRF9IMl9VUEdSQURFAFNPVVJDRQBBTk5PVU5DRQBUUkFDRQBIUEVfVU5FWFBFQ1RFRF9TUEFDRQBERVNDUklCRQBVTlNVQlNDUklCRQBSRUNPUkQASFBFX0lOVkFMSURfTUVUSE9EAE5PVF9GT1VORABQUk9QRklORABVTkJJTkQAUkVCSU5EAFVOQVVUSE9SSVpFRABNRVRIT0RfTk9UX0FMTE9XRUQASFRUUF9WRVJTSU9OX05PVF9TVVBQT1JURUQAQUxSRUFEWV9SRVBPUlRFRABBQ0NFUFRFRABOT1RfSU1QTEVNRU5URUQATE9PUF9ERVRFQ1RFRABIUEVfQ1JfRVhQRUNURUQASFBFX0xGX0VYUEVDVEVEAENSRUFURUQASU1fVVNFRABIUEVfUEFVU0VEAFRJTUVPVVRfT0NDVVJFRABQQVlNRU5UX1JFUVVJUkVEAFBSRUNPTkRJVElPTl9SRVFVSVJFRABQUk9YWV9BVVRIRU5USUNBVElPTl9SRVFVSVJFRABORVRXT1JLX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAExFTkdUSF9SRVFVSVJFRABTU0xfQ0VSVElGSUNBVEVfUkVRVUlSRUQAVVBHUkFERV9SRVFVSVJFRABQQUdFX0VYUElSRUQAUFJFQ09ORElUSU9OX0ZBSUxFRABFWFBFQ1RBVElPTl9GQUlMRUQAUkVWQUxJREFUSU9OX0ZBSUxFRABTU0xfSEFORFNIQUtFX0ZBSUxFRABMT0NLRUQAVFJBTlNGT1JNQVRJT05fQVBQTElFRABOT1RfTU9ESUZJRUQATk9UX0VYVEVOREVEAEJBTkRXSURUSF9MSU1JVF9FWENFRURFRABTSVRFX0lTX09WRVJMT0FERUQASEVBRABFeHBlY3RlZCBIVFRQLwAAXhMAACYTAAAwEAAA8BcAAJ0TAAAVEgAAORcAAPASAAAKEAAAdRIAAK0SAACCEwAATxQAAH8QAACgFQAAIxQAAIkSAACLFAAATRUAANQRAADPFAAAEBgAAMkWAADcFgAAwREAAOAXAAC7FAAAdBQAAHwVAADlFAAACBcAAB8QAABlFQAAoxQAACgVAAACFQAAmRUAACwQAACLGQAATw8AANQOAABqEAAAzhAAAAIXAACJDgAAbhMAABwTAABmFAAAVhcAAMETAADNEwAAbBMAAGgXAABmFwAAXxcAACITAADODwAAaQ4AANgOAABjFgAAyxMAAKoOAAAoFwAAJhcAAMUTAABdFgAA6BEAAGcTAABlEwAA8hYAAHMTAAAdFwAA+RYAAPMRAADPDgAAzhUAAAwSAACzEQAApREAAGEQAAAyFwAAuxMAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIDAgICAgIAAAICAAICAAICAgICAgICAgIABAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAICAgICAAACAgACAgACAgICAgICAgICAAMABAAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAAgACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbG9zZWVlcC1hbGl2ZQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAQEBAQEBAQEBAQIBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBY2h1bmtlZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEAAAEBAAEBAAEBAQEBAQEBAQEAAAAAAAAAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABlY3Rpb25lbnQtbGVuZ3Rob25yb3h5LWNvbm5lY3Rpb24AAAAAAAAAAAAAAAAAAAByYW5zZmVyLWVuY29kaW5ncGdyYWRlDQoNCg0KU00NCg0KVFRQL0NFL1RTUC8AAAAAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQIAAQMAAAAAAAAAAAAAAAAAAAAAAAAEAQEFAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAQAAAgAAAAAAAAAAAAAAAAAAAAAAAAMEAAAEBAQEBAQEBAQEBAUEBAQEBAQEBAQEBAQABAAGBwQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAABAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAIAAAAAAgAAAAAAAAAAAAAAAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABOT1VOQ0VFQ0tPVVRORUNURVRFQ1JJQkVMVVNIRVRFQURTRUFSQ0hSR0VDVElWSVRZTEVOREFSVkVPVElGWVBUSU9OU0NIU0VBWVNUQVRDSEdFT1JESVJFQ1RPUlRSQ0hQQVJBTUVURVJVUkNFQlNDUklCRUFSRE9XTkFDRUlORE5LQ0tVQlNDUklCRUhUVFAvQURUUC8='\n","module.exports = 'AGFzbQEAAAABMAhgAX8Bf2ADf39/AX9gBH9/f38Bf2AAAGADf39/AGABfwBgAn9/AGAGf39/f39/AALLAQgDZW52GHdhc21fb25faGVhZGVyc19jb21wbGV0ZQACA2VudhV3YXNtX29uX21lc3NhZ2VfYmVnaW4AAANlbnYLd2FzbV9vbl91cmwAAQNlbnYOd2FzbV9vbl9zdGF0dXMAAQNlbnYUd2FzbV9vbl9oZWFkZXJfZmllbGQAAQNlbnYUd2FzbV9vbl9oZWFkZXJfdmFsdWUAAQNlbnYMd2FzbV9vbl9ib2R5AAEDZW52GHdhc21fb25fbWVzc2FnZV9jb21wbGV0ZQAAA0ZFAwMEAAAFAAAAAAAABQEFAAUFBQAABgAAAAAGBgYGAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAAABAQcAAAUFAwABBAUBcAESEgUDAQACBggBfwFBgNQECwfRBSIGbWVtb3J5AgALX2luaXRpYWxpemUACRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALbGxodHRwX2luaXQAChhsbGh0dHBfc2hvdWxkX2tlZXBfYWxpdmUAQQxsbGh0dHBfYWxsb2MADAZtYWxsb2MARgtsbGh0dHBfZnJlZQANBGZyZWUASA9sbGh0dHBfZ2V0X3R5cGUADhVsbGh0dHBfZ2V0X2h0dHBfbWFqb3IADxVsbGh0dHBfZ2V0X2h0dHBfbWlub3IAEBFsbGh0dHBfZ2V0X21ldGhvZAARFmxsaHR0cF9nZXRfc3RhdHVzX2NvZGUAEhJsbGh0dHBfZ2V0X3VwZ3JhZGUAEwxsbGh0dHBfcmVzZXQAFA5sbGh0dHBfZXhlY3V0ZQAVFGxsaHR0cF9zZXR0aW5nc19pbml0ABYNbGxodHRwX2ZpbmlzaAAXDGxsaHR0cF9wYXVzZQAYDWxsaHR0cF9yZXN1bWUAGRtsbGh0dHBfcmVzdW1lX2FmdGVyX3VwZ3JhZGUAGhBsbGh0dHBfZ2V0X2Vycm5vABsXbGxodHRwX2dldF9lcnJvcl9yZWFzb24AHBdsbGh0dHBfc2V0X2Vycm9yX3JlYXNvbgAdFGxsaHR0cF9nZXRfZXJyb3JfcG9zAB4RbGxodHRwX2Vycm5vX25hbWUAHxJsbGh0dHBfbWV0aG9kX25hbWUAIBJsbGh0dHBfc3RhdHVzX25hbWUAIRpsbGh0dHBfc2V0X2xlbmllbnRfaGVhZGVycwAiIWxsaHR0cF9zZXRfbGVuaWVudF9jaHVua2VkX2xlbmd0aAAjHWxsaHR0cF9zZXRfbGVuaWVudF9rZWVwX2FsaXZlACQkbGxodHRwX3NldF9sZW5pZW50X3RyYW5zZmVyX2VuY29kaW5nACUYbGxodHRwX21lc3NhZ2VfbmVlZHNfZW9mAD8JFwEAQQELEQECAwQFCwYHNTk3MS8tJyspCrLgAkUCAAsIABCIgICAAAsZACAAEMKAgIAAGiAAIAI2AjggACABOgAoCxwAIAAgAC8BMiAALQAuIAAQwYCAgAAQgICAgAALKgEBf0HAABDGgICAACIBEMKAgIAAGiABQYCIgIAANgI4IAEgADoAKCABCwoAIAAQyICAgAALBwAgAC0AKAsHACAALQAqCwcAIAAtACsLBwAgAC0AKQsHACAALwEyCwcAIAAtAC4LRQEEfyAAKAIYIQEgAC0ALSECIAAtACghAyAAKAI4IQQgABDCgICAABogACAENgI4IAAgAzoAKCAAIAI6AC0gACABNgIYCxEAIAAgASABIAJqEMOAgIAACxAAIABBAEHcABDMgICAABoLZwEBf0EAIQECQCAAKAIMDQACQAJAAkACQCAALQAvDgMBAAMCCyAAKAI4IgFFDQAgASgCLCIBRQ0AIAAgARGAgICAAAAiAQ0DC0EADwsQyoCAgAAACyAAQcOWgIAANgIQQQ4hAQsgAQseAAJAIAAoAgwNACAAQdGbgIAANgIQIABBFTYCDAsLFgACQCAAKAIMQRVHDQAgAEEANgIMCwsWAAJAIAAoAgxBFkcNACAAQQA2AgwLCwcAIAAoAgwLBwAgACgCEAsJACAAIAE2AhALBwAgACgCFAsiAAJAIABBJEkNABDKgICAAAALIABBAnRBoLOAgABqKAIACyIAAkAgAEEuSQ0AEMqAgIAAAAsgAEECdEGwtICAAGooAgAL7gsBAX9B66iAgAAhAQJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIABBnH9qDvQDY2IAAWFhYWFhYQIDBAVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhBgcICQoLDA0OD2FhYWFhEGFhYWFhYWFhYWFhEWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYRITFBUWFxgZGhthYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2YTc4OTphYWFhYWFhYTthYWE8YWFhYT0+P2FhYWFhYWFhQGFhQWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYUJDREVGR0hJSktMTU5PUFFSU2FhYWFhYWFhVFVWV1hZWlthXF1hYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFeYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhX2BhC0Hhp4CAAA8LQaShgIAADwtBy6yAgAAPC0H+sYCAAA8LQcCkgIAADwtBq6SAgAAPC0GNqICAAA8LQeKmgIAADwtBgLCAgAAPC0G5r4CAAA8LQdekgIAADwtB75+AgAAPC0Hhn4CAAA8LQfqfgIAADwtB8qCAgAAPC0Gor4CAAA8LQa6ygIAADwtBiLCAgAAPC0Hsp4CAAA8LQYKigIAADwtBjp2AgAAPC0HQroCAAA8LQcqjgIAADwtBxbKAgAAPC0HfnICAAA8LQdKcgIAADwtBxKCAgAAPC0HXoICAAA8LQaKfgIAADwtB7a6AgAAPC0GrsICAAA8LQdSlgIAADwtBzK6AgAAPC0H6roCAAA8LQfyrgIAADwtB0rCAgAAPC0HxnYCAAA8LQbuggIAADwtB96uAgAAPC0GQsYCAAA8LQdexgIAADwtBoq2AgAAPC0HUp4CAAA8LQeCrgIAADwtBn6yAgAAPC0HrsYCAAA8LQdWfgIAADwtByrGAgAAPC0HepYCAAA8LQdSegIAADwtB9JyAgAAPC0GnsoCAAA8LQbGdgIAADwtBoJ2AgAAPC0G5sYCAAA8LQbywgIAADwtBkqGAgAAPC0GzpoCAAA8LQemsgIAADwtBrJ6AgAAPC0HUq4CAAA8LQfemgIAADwtBgKaAgAAPC0GwoYCAAA8LQf6egIAADwtBjaOAgAAPC0GJrYCAAA8LQfeigIAADwtBoLGAgAAPC0Gun4CAAA8LQcalgIAADwtB6J6AgAAPC0GTooCAAA8LQcKvgIAADwtBw52AgAAPC0GLrICAAA8LQeGdgIAADwtBja+AgAAPC0HqoYCAAA8LQbStgIAADwtB0q+AgAAPC0HfsoCAAA8LQdKygIAADwtB8LCAgAAPC0GpooCAAA8LQfmjgIAADwtBmZ6AgAAPC0G1rICAAA8LQZuwgIAADwtBkrKAgAAPC0G2q4CAAA8LQcKigIAADwtB+LKAgAAPC0GepYCAAA8LQdCigIAADwtBup6AgAAPC0GBnoCAAA8LEMqAgIAAAAtB1qGAgAAhAQsgAQsWACAAIAAtAC1B/gFxIAFBAEdyOgAtCxkAIAAgAC0ALUH9AXEgAUEAR0EBdHI6AC0LGQAgACAALQAtQfsBcSABQQBHQQJ0cjoALQsZACAAIAAtAC1B9wFxIAFBAEdBA3RyOgAtCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAgAiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCBCIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQcaRgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIwIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAggiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2ioCAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCNCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIMIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZqAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAjgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCECIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZWQgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAI8IgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAhQiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEGqm4CAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCQCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIYIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABB7ZOAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCJCIERQ0AIAAgBBGAgICAAAAhAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIsIgRFDQAgACAEEYCAgIAAACEDCyADC0kBAn9BACEDAkAgACgCOCIERQ0AIAQoAigiBEUNACAAIAEgAiABayAEEYGAgIAAACIDQX9HDQAgAEH2iICAADYCEEEYIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCUCIERQ0AIAAgBBGAgICAAAAhAwsgAwtJAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAIcIgRFDQAgACABIAIgAWsgBBGBgICAAAAiA0F/Rw0AIABBwpmAgAA2AhBBGCEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAkgiBEUNACAAIAQRgICAgAAAIQMLIAMLSQECf0EAIQMCQCAAKAI4IgRFDQAgBCgCICIERQ0AIAAgASACIAFrIAQRgYCAgAAAIgNBf0cNACAAQZSUgIAANgIQQRghAwsgAwsuAQJ/QQAhAwJAIAAoAjgiBEUNACAEKAJMIgRFDQAgACAEEYCAgIAAACEDCyADCy4BAn9BACEDAkAgACgCOCIERQ0AIAQoAlQiBEUNACAAIAQRgICAgAAAIQMLIAMLLgECf0EAIQMCQCAAKAI4IgRFDQAgBCgCWCIERQ0AIAAgBBGAgICAAAAhAwsgAwtFAQF/AkACQCAALwEwQRRxQRRHDQBBASEDIAAtAChBAUYNASAALwEyQeUARiEDDAELIAAtAClBBUYhAwsgACADOgAuQQAL/gEBA39BASEDAkAgAC8BMCIEQQhxDQAgACkDIEIAUiEDCwJAAkAgAC0ALkUNAEEBIQUgAC0AKUEFRg0BQQEhBSAEQcAAcUUgA3FBAUcNAQtBACEFIARBwABxDQBBAiEFIARB//8DcSIDQQhxDQACQCADQYAEcUUNAAJAIAAtAChBAUcNACAALQAtQQpxDQBBBQ8LQQQPCwJAIANBIHENAAJAIAAtAChBAUYNACAALwEyQf//A3EiAEGcf2pB5ABJDQAgAEHMAUYNACAAQbACRg0AQQQhBSAEQShxRQ0CIANBiARxQYAERg0CC0EADwtBAEEDIAApAyBQGyEFCyAFC2IBAn9BACEBAkAgAC0AKEEBRg0AIAAvATJB//8DcSICQZx/akHkAEkNACACQcwBRg0AIAJBsAJGDQAgAC8BMCIAQcAAcQ0AQQEhASAAQYgEcUGABEYNACAAQShxRSEBCyABC6cBAQN/AkACQAJAIAAtACpFDQAgAC0AK0UNAEEAIQMgAC8BMCIEQQJxRQ0BDAILQQAhAyAALwEwIgRBAXFFDQELQQEhAyAALQAoQQFGDQAgAC8BMkH//wNxIgVBnH9qQeQASQ0AIAVBzAFGDQAgBUGwAkYNACAEQcAAcQ0AQQAhAyAEQYgEcUGABEYNACAEQShxQQBHIQMLIABBADsBMCAAQQA6AC8gAwuZAQECfwJAAkACQCAALQAqRQ0AIAAtACtFDQBBACEBIAAvATAiAkECcUUNAQwCC0EAIQEgAC8BMCICQQFxRQ0BC0EBIQEgAC0AKEEBRg0AIAAvATJB//8DcSIAQZx/akHkAEkNACAAQcwBRg0AIABBsAJGDQAgAkHAAHENAEEAIQEgAkGIBHFBgARGDQAgAkEocUEARyEBCyABC0kBAXsgAEEQav0MAAAAAAAAAAAAAAAAAAAAACIB/QsDACAAIAH9CwMAIABBMGogAf0LAwAgAEEgaiAB/QsDACAAQd0BNgIcQQALewEBfwJAIAAoAgwiAw0AAkAgACgCBEUNACAAIAE2AgQLAkAgACABIAIQxICAgAAiAw0AIAAoAgwPCyAAIAM2AhxBACEDIAAoAgQiAUUNACAAIAEgAiAAKAIIEYGAgIAAACIBRQ0AIAAgAjYCFCAAIAE2AgwgASEDCyADC+TzAQMOfwN+BH8jgICAgABBEGsiAySAgICAACABIQQgASEFIAEhBiABIQcgASEIIAEhCSABIQogASELIAEhDCABIQ0gASEOIAEhDwJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAAKAIcIhBBf2oO3QHaAQHZAQIDBAUGBwgJCgsMDQ7YAQ8Q1wEREtYBExQVFhcYGRob4AHfARwdHtUBHyAhIiMkJdQBJicoKSorLNMB0gEtLtEB0AEvMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUbbAUdISUrPAc4BS80BTMwBTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gAGBAYIBgwGEAYUBhgGHAYgBiQGKAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AcsBygG4AckBuQHIAboBuwG8Ab0BvgG/AcABwQHCAcMBxAHFAcYBANwBC0EAIRAMxgELQQ4hEAzFAQtBDSEQDMQBC0EPIRAMwwELQRAhEAzCAQtBEyEQDMEBC0EUIRAMwAELQRUhEAy/AQtBFiEQDL4BC0EXIRAMvQELQRghEAy8AQtBGSEQDLsBC0EaIRAMugELQRshEAy5AQtBHCEQDLgBC0EIIRAMtwELQR0hEAy2AQtBICEQDLUBC0EfIRAMtAELQQchEAyzAQtBISEQDLIBC0EiIRAMsQELQR4hEAywAQtBIyEQDK8BC0ESIRAMrgELQREhEAytAQtBJCEQDKwBC0ElIRAMqwELQSYhEAyqAQtBJyEQDKkBC0HDASEQDKgBC0EpIRAMpwELQSshEAymAQtBLCEQDKUBC0EtIRAMpAELQS4hEAyjAQtBLyEQDKIBC0HEASEQDKEBC0EwIRAMoAELQTQhEAyfAQtBDCEQDJ4BC0ExIRAMnQELQTIhEAycAQtBMyEQDJsBC0E5IRAMmgELQTUhEAyZAQtBxQEhEAyYAQtBCyEQDJcBC0E6IRAMlgELQTYhEAyVAQtBCiEQDJQBC0E3IRAMkwELQTghEAySAQtBPCEQDJEBC0E7IRAMkAELQT0hEAyPAQtBCSEQDI4BC0EoIRAMjQELQT4hEAyMAQtBPyEQDIsBC0HAACEQDIoBC0HBACEQDIkBC0HCACEQDIgBC0HDACEQDIcBC0HEACEQDIYBC0HFACEQDIUBC0HGACEQDIQBC0EqIRAMgwELQccAIRAMggELQcgAIRAMgQELQckAIRAMgAELQcoAIRAMfwtBywAhEAx+C0HNACEQDH0LQcwAIRAMfAtBzgAhEAx7C0HPACEQDHoLQdAAIRAMeQtB0QAhEAx4C0HSACEQDHcLQdMAIRAMdgtB1AAhEAx1C0HWACEQDHQLQdUAIRAMcwtBBiEQDHILQdcAIRAMcQtBBSEQDHALQdgAIRAMbwtBBCEQDG4LQdkAIRAMbQtB2gAhEAxsC0HbACEQDGsLQdwAIRAMagtBAyEQDGkLQd0AIRAMaAtB3gAhEAxnC0HfACEQDGYLQeEAIRAMZQtB4AAhEAxkC0HiACEQDGMLQeMAIRAMYgtBAiEQDGELQeQAIRAMYAtB5QAhEAxfC0HmACEQDF4LQecAIRAMXQtB6AAhEAxcC0HpACEQDFsLQeoAIRAMWgtB6wAhEAxZC0HsACEQDFgLQe0AIRAMVwtB7gAhEAxWC0HvACEQDFULQfAAIRAMVAtB8QAhEAxTC0HyACEQDFILQfMAIRAMUQtB9AAhEAxQC0H1ACEQDE8LQfYAIRAMTgtB9wAhEAxNC0H4ACEQDEwLQfkAIRAMSwtB+gAhEAxKC0H7ACEQDEkLQfwAIRAMSAtB/QAhEAxHC0H+ACEQDEYLQf8AIRAMRQtBgAEhEAxEC0GBASEQDEMLQYIBIRAMQgtBgwEhEAxBC0GEASEQDEALQYUBIRAMPwtBhgEhEAw+C0GHASEQDD0LQYgBIRAMPAtBiQEhEAw7C0GKASEQDDoLQYsBIRAMOQtBjAEhEAw4C0GNASEQDDcLQY4BIRAMNgtBjwEhEAw1C0GQASEQDDQLQZEBIRAMMwtBkgEhEAwyC0GTASEQDDELQZQBIRAMMAtBlQEhEAwvC0GWASEQDC4LQZcBIRAMLQtBmAEhEAwsC0GZASEQDCsLQZoBIRAMKgtBmwEhEAwpC0GcASEQDCgLQZ0BIRAMJwtBngEhEAwmC0GfASEQDCULQaABIRAMJAtBoQEhEAwjC0GiASEQDCILQaMBIRAMIQtBpAEhEAwgC0GlASEQDB8LQaYBIRAMHgtBpwEhEAwdC0GoASEQDBwLQakBIRAMGwtBqgEhEAwaC0GrASEQDBkLQawBIRAMGAtBrQEhEAwXC0GuASEQDBYLQQEhEAwVC0GvASEQDBQLQbABIRAMEwtBsQEhEAwSC0GzASEQDBELQbIBIRAMEAtBtAEhEAwPC0G1ASEQDA4LQbYBIRAMDQtBtwEhEAwMC0G4ASEQDAsLQbkBIRAMCgtBugEhEAwJC0G7ASEQDAgLQcYBIRAMBwtBvAEhEAwGC0G9ASEQDAULQb4BIRAMBAtBvwEhEAwDC0HAASEQDAILQcIBIRAMAQtBwQEhEAsDQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAOxwEAAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB4fICEjJSg/QEFERUZHSElKS0xNT1BRUlPeA1dZW1xdYGJlZmdoaWprbG1vcHFyc3R1dnd4eXp7fH1+gAGCAYUBhgGHAYkBiwGMAY0BjgGPAZABkQGUAZUBlgGXAZgBmQGaAZsBnAGdAZ4BnwGgAaEBogGjAaQBpQGmAacBqAGpAaoBqwGsAa0BrgGvAbABsQGyAbMBtAG1AbYBtwG4AbkBugG7AbwBvQG+Ab8BwAHBAcIBwwHEAcUBxgHHAcgByQHKAcsBzAHNAc4BzwHQAdEB0gHTAdQB1QHWAdcB2AHZAdoB2wHcAd0B3gHgAeEB4gHjAeQB5QHmAecB6AHpAeoB6wHsAe0B7gHvAfAB8QHyAfMBmQKkArAC/gL+AgsgASIEIAJHDfMBQd0BIRAM/wMLIAEiECACRw3dAUHDASEQDP4DCyABIgEgAkcNkAFB9wAhEAz9AwsgASIBIAJHDYYBQe8AIRAM/AMLIAEiASACRw1/QeoAIRAM+wMLIAEiASACRw17QegAIRAM+gMLIAEiASACRw14QeYAIRAM+QMLIAEiASACRw0aQRghEAz4AwsgASIBIAJHDRRBEiEQDPcDCyABIgEgAkcNWUHFACEQDPYDCyABIgEgAkcNSkE/IRAM9QMLIAEiASACRw1IQTwhEAz0AwsgASIBIAJHDUFBMSEQDPMDCyAALQAuQQFGDesDDIcCCyAAIAEiASACEMCAgIAAQQFHDeYBIABCADcDIAznAQsgACABIgEgAhC0gICAACIQDecBIAEhAQz1AgsCQCABIgEgAkcNAEEGIRAM8AMLIAAgAUEBaiIBIAIQu4CAgAAiEA3oASABIQEMMQsgAEIANwMgQRIhEAzVAwsgASIQIAJHDStBHSEQDO0DCwJAIAEiASACRg0AIAFBAWohAUEQIRAM1AMLQQchEAzsAwsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3lAUEIIRAM6wMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQRQhEAzSAwtBCSEQDOoDCyABIQEgACkDIFAN5AEgASEBDPICCwJAIAEiASACRw0AQQshEAzpAwsgACABQQFqIgEgAhC2gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeUBIAEhAQzyAgsgACABIgEgAhC4gICAACIQDeYBIAEhAQwNCyAAIAEiASACELqAgIAAIhAN5wEgASEBDPACCwJAIAEiASACRw0AQQ8hEAzlAwsgAS0AACIQQTtGDQggEEENRw3oASABQQFqIQEM7wILIAAgASIBIAIQuoCAgAAiEA3oASABIQEM8gILA0ACQCABLQAAQfC1gIAAai0AACIQQQFGDQAgEEECRw3rASAAKAIEIRAgAEEANgIEIAAgECABQQFqIgEQuYCAgAAiEA3qASABIQEM9AILIAFBAWoiASACRw0AC0ESIRAM4gMLIAAgASIBIAIQuoCAgAAiEA3pASABIQEMCgsgASIBIAJHDQZBGyEQDOADCwJAIAEiASACRw0AQRYhEAzgAwsgAEGKgICAADYCCCAAIAE2AgQgACABIAIQuICAgAAiEA3qASABIQFBICEQDMYDCwJAIAEiASACRg0AA0ACQCABLQAAQfC3gIAAai0AACIQQQJGDQACQCAQQX9qDgTlAewBAOsB7AELIAFBAWohAUEIIRAMyAMLIAFBAWoiASACRw0AC0EVIRAM3wMLQRUhEAzeAwsDQAJAIAEtAABB8LmAgABqLQAAIhBBAkYNACAQQX9qDgTeAewB4AHrAewBCyABQQFqIgEgAkcNAAtBGCEQDN0DCwJAIAEiASACRg0AIABBi4CAgAA2AgggACABNgIEIAEhAUEHIRAMxAMLQRkhEAzcAwsgAUEBaiEBDAILAkAgASIUIAJHDQBBGiEQDNsDCyAUIQECQCAULQAAQXNqDhTdAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAu4C7gLuAgDuAgtBACEQIABBADYCHCAAQa+LgIAANgIQIABBAjYCDCAAIBRBAWo2AhQM2gMLAkAgAS0AACIQQTtGDQAgEEENRw3oASABQQFqIQEM5QILIAFBAWohAQtBIiEQDL8DCwJAIAEiECACRw0AQRwhEAzYAwtCACERIBAhASAQLQAAQVBqDjfnAeYBAQIDBAUGBwgAAAAAAAAACQoLDA0OAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPEBESExQAC0EeIRAMvQMLQgIhEQzlAQtCAyERDOQBC0IEIREM4wELQgUhEQziAQtCBiERDOEBC0IHIREM4AELQgghEQzfAQtCCSERDN4BC0IKIREM3QELQgshEQzcAQtCDCERDNsBC0INIREM2gELQg4hEQzZAQtCDyERDNgBC0IKIREM1wELQgshEQzWAQtCDCERDNUBC0INIREM1AELQg4hEQzTAQtCDyERDNIBC0IAIRECQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAIBAtAABBUGoON+UB5AEAAQIDBAUGB+YB5gHmAeYB5gHmAeYBCAkKCwwN5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAeYB5gHmAQ4PEBESE+YBC0ICIREM5AELQgMhEQzjAQtCBCERDOIBC0IFIREM4QELQgYhEQzgAQtCByERDN8BC0IIIREM3gELQgkhEQzdAQtCCiERDNwBC0ILIREM2wELQgwhEQzaAQtCDSERDNkBC0IOIREM2AELQg8hEQzXAQtCCiERDNYBC0ILIREM1QELQgwhEQzUAQtCDSERDNMBC0IOIREM0gELQg8hEQzRAQsgAEIAIAApAyAiESACIAEiEGutIhJ9IhMgEyARVhs3AyAgESASViIURQ3SAUEfIRAMwAMLAkAgASIBIAJGDQAgAEGJgICAADYCCCAAIAE2AgQgASEBQSQhEAynAwtBICEQDL8DCyAAIAEiECACEL6AgIAAQX9qDgW2AQDFAgHRAdIBC0ERIRAMpAMLIABBAToALyAQIQEMuwMLIAEiASACRw3SAUEkIRAMuwMLIAEiDSACRw0eQcYAIRAMugMLIAAgASIBIAIQsoCAgAAiEA3UASABIQEMtQELIAEiECACRw0mQdAAIRAMuAMLAkAgASIBIAJHDQBBKCEQDLgDCyAAQQA2AgQgAEGMgICAADYCCCAAIAEgARCxgICAACIQDdMBIAEhAQzYAQsCQCABIhAgAkcNAEEpIRAMtwMLIBAtAAAiAUEgRg0UIAFBCUcN0wEgEEEBaiEBDBULAkAgASIBIAJGDQAgAUEBaiEBDBcLQSohEAy1AwsCQCABIhAgAkcNAEErIRAMtQMLAkAgEC0AACIBQQlGDQAgAUEgRw3VAQsgAC0ALEEIRg3TASAQIQEMkQMLAkAgASIBIAJHDQBBLCEQDLQDCyABLQAAQQpHDdUBIAFBAWohAQzJAgsgASIOIAJHDdUBQS8hEAyyAwsDQAJAIAEtAAAiEEEgRg0AAkAgEEF2ag4EANwB3AEA2gELIAEhAQzgAQsgAUEBaiIBIAJHDQALQTEhEAyxAwtBMiEQIAEiFCACRg2wAyACIBRrIAAoAgAiAWohFSAUIAFrQQNqIRYCQANAIBQtAAAiF0EgciAXIBdBv39qQf8BcUEaSRtB/wFxIAFB8LuAgABqLQAARw0BAkAgAUEDRw0AQQYhAQyWAwsgAUEBaiEBIBRBAWoiFCACRw0ACyAAIBU2AgAMsQMLIABBADYCACAUIQEM2QELQTMhECABIhQgAkYNrwMgAiAUayAAKAIAIgFqIRUgFCABa0EIaiEWAkADQCAULQAAIhdBIHIgFyAXQb9/akH/AXFBGkkbQf8BcSABQfS7gIAAai0AAEcNAQJAIAFBCEcNAEEFIQEMlQMLIAFBAWohASAUQQFqIhQgAkcNAAsgACAVNgIADLADCyAAQQA2AgAgFCEBDNgBC0E0IRAgASIUIAJGDa4DIAIgFGsgACgCACIBaiEVIBQgAWtBBWohFgJAA0AgFC0AACIXQSByIBcgF0G/f2pB/wFxQRpJG0H/AXEgAUHQwoCAAGotAABHDQECQCABQQVHDQBBByEBDJQDCyABQQFqIQEgFEEBaiIUIAJHDQALIAAgFTYCAAyvAwsgAEEANgIAIBQhAQzXAQsCQCABIgEgAkYNAANAAkAgAS0AAEGAvoCAAGotAAAiEEEBRg0AIBBBAkYNCiABIQEM3QELIAFBAWoiASACRw0AC0EwIRAMrgMLQTAhEAytAwsCQCABIgEgAkYNAANAAkAgAS0AACIQQSBGDQAgEEF2ag4E2QHaAdoB2QHaAQsgAUEBaiIBIAJHDQALQTghEAytAwtBOCEQDKwDCwNAAkAgAS0AACIQQSBGDQAgEEEJRw0DCyABQQFqIgEgAkcNAAtBPCEQDKsDCwNAAkAgAS0AACIQQSBGDQACQAJAIBBBdmoOBNoBAQHaAQALIBBBLEYN2wELIAEhAQwECyABQQFqIgEgAkcNAAtBPyEQDKoDCyABIQEM2wELQcAAIRAgASIUIAJGDagDIAIgFGsgACgCACIBaiEWIBQgAWtBBmohFwJAA0AgFC0AAEEgciABQYDAgIAAai0AAEcNASABQQZGDY4DIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADKkDCyAAQQA2AgAgFCEBC0E2IRAMjgMLAkAgASIPIAJHDQBBwQAhEAynAwsgAEGMgICAADYCCCAAIA82AgQgDyEBIAAtACxBf2oOBM0B1QHXAdkBhwMLIAFBAWohAQzMAQsCQCABIgEgAkYNAANAAkAgAS0AACIQQSByIBAgEEG/f2pB/wFxQRpJG0H/AXEiEEEJRg0AIBBBIEYNAAJAAkACQAJAIBBBnX9qDhMAAwMDAwMDAwEDAwMDAwMDAwMCAwsgAUEBaiEBQTEhEAyRAwsgAUEBaiEBQTIhEAyQAwsgAUEBaiEBQTMhEAyPAwsgASEBDNABCyABQQFqIgEgAkcNAAtBNSEQDKUDC0E1IRAMpAMLAkAgASIBIAJGDQADQAJAIAEtAABBgLyAgABqLQAAQQFGDQAgASEBDNMBCyABQQFqIgEgAkcNAAtBPSEQDKQDC0E9IRAMowMLIAAgASIBIAIQsICAgAAiEA3WASABIQEMAQsgEEEBaiEBC0E8IRAMhwMLAkAgASIBIAJHDQBBwgAhEAygAwsCQANAAkAgAS0AAEF3ag4YAAL+Av4ChAP+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gL+Av4C/gIA/gILIAFBAWoiASACRw0AC0HCACEQDKADCyABQQFqIQEgAC0ALUEBcUUNvQEgASEBC0EsIRAMhQMLIAEiASACRw3TAUHEACEQDJ0DCwNAAkAgAS0AAEGQwICAAGotAABBAUYNACABIQEMtwILIAFBAWoiASACRw0AC0HFACEQDJwDCyANLQAAIhBBIEYNswEgEEE6Rw2BAyAAKAIEIQEgAEEANgIEIAAgASANEK+AgIAAIgEN0AEgDUEBaiEBDLMCC0HHACEQIAEiDSACRg2aAyACIA1rIAAoAgAiAWohFiANIAFrQQVqIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQZDCgIAAai0AAEcNgAMgAUEFRg30AiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyaAwtByAAhECABIg0gAkYNmQMgAiANayAAKAIAIgFqIRYgDSABa0EJaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUGWwoCAAGotAABHDf8CAkAgAUEJRw0AQQIhAQz1AgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMmQMLAkAgASINIAJHDQBByQAhEAyZAwsCQAJAIA0tAAAiAUEgciABIAFBv39qQf8BcUEaSRtB/wFxQZJ/ag4HAIADgAOAA4ADgAMBgAMLIA1BAWohAUE+IRAMgAMLIA1BAWohAUE/IRAM/wILQcoAIRAgASINIAJGDZcDIAIgDWsgACgCACIBaiEWIA0gAWtBAWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFBoMKAgABqLQAARw39AiABQQFGDfACIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJcDC0HLACEQIAEiDSACRg2WAyACIA1rIAAoAgAiAWohFiANIAFrQQ5qIRcDQCANLQAAIhRBIHIgFCAUQb9/akH/AXFBGkkbQf8BcSABQaLCgIAAai0AAEcN/AIgAUEORg3wAiABQQFqIQEgDUEBaiINIAJHDQALIAAgFjYCAAyWAwtBzAAhECABIg0gAkYNlQMgAiANayAAKAIAIgFqIRYgDSABa0EPaiEXA0AgDS0AACIUQSByIBQgFEG/f2pB/wFxQRpJG0H/AXEgAUHAwoCAAGotAABHDfsCAkAgAUEPRw0AQQMhAQzxAgsgAUEBaiEBIA1BAWoiDSACRw0ACyAAIBY2AgAMlQMLQc0AIRAgASINIAJGDZQDIAIgDWsgACgCACIBaiEWIA0gAWtBBWohFwNAIA0tAAAiFEEgciAUIBRBv39qQf8BcUEaSRtB/wFxIAFB0MKAgABqLQAARw36AgJAIAFBBUcNAEEEIQEM8AILIAFBAWohASANQQFqIg0gAkcNAAsgACAWNgIADJQDCwJAIAEiDSACRw0AQc4AIRAMlAMLAkACQAJAAkAgDS0AACIBQSByIAEgAUG/f2pB/wFxQRpJG0H/AXFBnX9qDhMA/QL9Av0C/QL9Av0C/QL9Av0C/QL9Av0CAf0C/QL9AgID/QILIA1BAWohAUHBACEQDP0CCyANQQFqIQFBwgAhEAz8AgsgDUEBaiEBQcMAIRAM+wILIA1BAWohAUHEACEQDPoCCwJAIAEiASACRg0AIABBjYCAgAA2AgggACABNgIEIAEhAUHFACEQDPoCC0HPACEQDJIDCyAQIQECQAJAIBAtAABBdmoOBAGoAqgCAKgCCyAQQQFqIQELQSchEAz4AgsCQCABIgEgAkcNAEHRACEQDJEDCwJAIAEtAABBIEYNACABIQEMjQELIAFBAWohASAALQAtQQFxRQ3HASABIQEMjAELIAEiFyACRw3IAUHSACEQDI8DC0HTACEQIAEiFCACRg2OAyACIBRrIAAoAgAiAWohFiAUIAFrQQFqIRcDQCAULQAAIAFB1sKAgABqLQAARw3MASABQQFGDccBIAFBAWohASAUQQFqIhQgAkcNAAsgACAWNgIADI4DCwJAIAEiASACRw0AQdUAIRAMjgMLIAEtAABBCkcNzAEgAUEBaiEBDMcBCwJAIAEiASACRw0AQdYAIRAMjQMLAkACQCABLQAAQXZqDgQAzQHNAQHNAQsgAUEBaiEBDMcBCyABQQFqIQFBygAhEAzzAgsgACABIgEgAhCugICAACIQDcsBIAEhAUHNACEQDPICCyAALQApQSJGDYUDDKYCCwJAIAEiASACRw0AQdsAIRAMigMLQQAhFEEBIRdBASEWQQAhEAJAAkACQAJAAkACQAJAAkACQCABLQAAQVBqDgrUAdMBAAECAwQFBgjVAQtBAiEQDAYLQQMhEAwFC0EEIRAMBAtBBSEQDAMLQQYhEAwCC0EHIRAMAQtBCCEQC0EAIRdBACEWQQAhFAzMAQtBCSEQQQEhFEEAIRdBACEWDMsBCwJAIAEiASACRw0AQd0AIRAMiQMLIAEtAABBLkcNzAEgAUEBaiEBDKYCCyABIgEgAkcNzAFB3wAhEAyHAwsCQCABIgEgAkYNACAAQY6AgIAANgIIIAAgATYCBCABIQFB0AAhEAzuAgtB4AAhEAyGAwtB4QAhECABIgEgAkYNhQMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQeLCgIAAai0AAEcNzQEgFEEDRg3MASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyFAwtB4gAhECABIgEgAkYNhAMgAiABayAAKAIAIhRqIRYgASAUa0ECaiEXA0AgAS0AACAUQebCgIAAai0AAEcNzAEgFEECRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyEAwtB4wAhECABIgEgAkYNgwMgAiABayAAKAIAIhRqIRYgASAUa0EDaiEXA0AgAS0AACAUQenCgIAAai0AAEcNywEgFEEDRg3OASAUQQFqIRQgAUEBaiIBIAJHDQALIAAgFjYCAAyDAwsCQCABIgEgAkcNAEHlACEQDIMDCyAAIAFBAWoiASACEKiAgIAAIhANzQEgASEBQdYAIRAM6QILAkAgASIBIAJGDQADQAJAIAEtAAAiEEEgRg0AAkACQAJAIBBBuH9qDgsAAc8BzwHPAc8BzwHPAc8BzwECzwELIAFBAWohAUHSACEQDO0CCyABQQFqIQFB0wAhEAzsAgsgAUEBaiEBQdQAIRAM6wILIAFBAWoiASACRw0AC0HkACEQDIIDC0HkACEQDIEDCwNAAkAgAS0AAEHwwoCAAGotAAAiEEEBRg0AIBBBfmoOA88B0AHRAdIBCyABQQFqIgEgAkcNAAtB5gAhEAyAAwsCQCABIgEgAkYNACABQQFqIQEMAwtB5wAhEAz/AgsDQAJAIAEtAABB8MSAgABqLQAAIhBBAUYNAAJAIBBBfmoOBNIB0wHUAQDVAQsgASEBQdcAIRAM5wILIAFBAWoiASACRw0AC0HoACEQDP4CCwJAIAEiASACRw0AQekAIRAM/gILAkAgAS0AACIQQXZqDhq6AdUB1QG8AdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAdUB1QHVAcoB1QHVAQDTAQsgAUEBaiEBC0EGIRAM4wILA0ACQCABLQAAQfDGgIAAai0AAEEBRg0AIAEhAQyeAgsgAUEBaiIBIAJHDQALQeoAIRAM+wILAkAgASIBIAJGDQAgAUEBaiEBDAMLQesAIRAM+gILAkAgASIBIAJHDQBB7AAhEAz6AgsgAUEBaiEBDAELAkAgASIBIAJHDQBB7QAhEAz5AgsgAUEBaiEBC0EEIRAM3gILAkAgASIUIAJHDQBB7gAhEAz3AgsgFCEBAkACQAJAIBQtAABB8MiAgABqLQAAQX9qDgfUAdUB1gEAnAIBAtcBCyAUQQFqIQEMCgsgFEEBaiEBDM0BC0EAIRAgAEEANgIcIABBm5KAgAA2AhAgAEEHNgIMIAAgFEEBajYCFAz2AgsCQANAAkAgAS0AAEHwyICAAGotAAAiEEEERg0AAkACQCAQQX9qDgfSAdMB1AHZAQAEAdkBCyABIQFB2gAhEAzgAgsgAUEBaiEBQdwAIRAM3wILIAFBAWoiASACRw0AC0HvACEQDPYCCyABQQFqIQEMywELAkAgASIUIAJHDQBB8AAhEAz1AgsgFC0AAEEvRw3UASAUQQFqIQEMBgsCQCABIhQgAkcNAEHxACEQDPQCCwJAIBQtAAAiAUEvRw0AIBRBAWohAUHdACEQDNsCCyABQXZqIgRBFksN0wFBASAEdEGJgIACcUUN0wEMygILAkAgASIBIAJGDQAgAUEBaiEBQd4AIRAM2gILQfIAIRAM8gILAkAgASIUIAJHDQBB9AAhEAzyAgsgFCEBAkAgFC0AAEHwzICAAGotAABBf2oOA8kClAIA1AELQeEAIRAM2AILAkAgASIUIAJGDQADQAJAIBQtAABB8MqAgABqLQAAIgFBA0YNAAJAIAFBf2oOAssCANUBCyAUIQFB3wAhEAzaAgsgFEEBaiIUIAJHDQALQfMAIRAM8QILQfMAIRAM8AILAkAgASIBIAJGDQAgAEGPgICAADYCCCAAIAE2AgQgASEBQeAAIRAM1wILQfUAIRAM7wILAkAgASIBIAJHDQBB9gAhEAzvAgsgAEGPgICAADYCCCAAIAE2AgQgASEBC0EDIRAM1AILA0AgAS0AAEEgRw3DAiABQQFqIgEgAkcNAAtB9wAhEAzsAgsCQCABIgEgAkcNAEH4ACEQDOwCCyABLQAAQSBHDc4BIAFBAWohAQzvAQsgACABIgEgAhCsgICAACIQDc4BIAEhAQyOAgsCQCABIgQgAkcNAEH6ACEQDOoCCyAELQAAQcwARw3RASAEQQFqIQFBEyEQDM8BCwJAIAEiBCACRw0AQfsAIRAM6QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEANAIAQtAAAgAUHwzoCAAGotAABHDdABIAFBBUYNzgEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBB+wAhEAzoAgsCQCABIgQgAkcNAEH8ACEQDOgCCwJAAkAgBC0AAEG9f2oODADRAdEB0QHRAdEB0QHRAdEB0QHRAQHRAQsgBEEBaiEBQeYAIRAMzwILIARBAWohAUHnACEQDM4CCwJAIAEiBCACRw0AQf0AIRAM5wILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNzwEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf0AIRAM5wILIABBADYCACAQQQFqIQFBECEQDMwBCwJAIAEiBCACRw0AQf4AIRAM5gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQfbOgIAAai0AAEcNzgEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf4AIRAM5gILIABBADYCACAQQQFqIQFBFiEQDMsBCwJAIAEiBCACRw0AQf8AIRAM5QILIAIgBGsgACgCACIBaiEUIAQgAWtBA2ohEAJAA0AgBC0AACABQfzOgIAAai0AAEcNzQEgAUEDRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQf8AIRAM5QILIABBADYCACAQQQFqIQFBBSEQDMoBCwJAIAEiBCACRw0AQYABIRAM5AILIAQtAABB2QBHDcsBIARBAWohAUEIIRAMyQELAkAgASIEIAJHDQBBgQEhEAzjAgsCQAJAIAQtAABBsn9qDgMAzAEBzAELIARBAWohAUHrACEQDMoCCyAEQQFqIQFB7AAhEAzJAgsCQCABIgQgAkcNAEGCASEQDOICCwJAAkAgBC0AAEG4f2oOCADLAcsBywHLAcsBywEBywELIARBAWohAUHqACEQDMkCCyAEQQFqIQFB7QAhEAzIAgsCQCABIgQgAkcNAEGDASEQDOECCyACIARrIAAoAgAiAWohECAEIAFrQQJqIRQCQANAIAQtAAAgAUGAz4CAAGotAABHDckBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgEDYCAEGDASEQDOECC0EAIRAgAEEANgIAIBRBAWohAQzGAQsCQCABIgQgAkcNAEGEASEQDOACCyACIARrIAAoAgAiAWohFCAEIAFrQQRqIRACQANAIAQtAAAgAUGDz4CAAGotAABHDcgBIAFBBEYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGEASEQDOACCyAAQQA2AgAgEEEBaiEBQSMhEAzFAQsCQCABIgQgAkcNAEGFASEQDN8CCwJAAkAgBC0AAEG0f2oOCADIAcgByAHIAcgByAEByAELIARBAWohAUHvACEQDMYCCyAEQQFqIQFB8AAhEAzFAgsCQCABIgQgAkcNAEGGASEQDN4CCyAELQAAQcUARw3FASAEQQFqIQEMgwILAkAgASIEIAJHDQBBhwEhEAzdAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFBiM+AgABqLQAARw3FASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBhwEhEAzdAgsgAEEANgIAIBBBAWohAUEtIRAMwgELAkAgASIEIAJHDQBBiAEhEAzcAgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw3EASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiAEhEAzcAgsgAEEANgIAIBBBAWohAUEpIRAMwQELAkAgASIBIAJHDQBBiQEhEAzbAgtBASEQIAEtAABB3wBHDcABIAFBAWohAQyBAgsCQCABIgQgAkcNAEGKASEQDNoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRADQCAELQAAIAFBjM+AgABqLQAARw3BASABQQFGDa8CIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQYoBIRAM2QILAkAgASIEIAJHDQBBiwEhEAzZAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFBjs+AgABqLQAARw3BASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBiwEhEAzZAgsgAEEANgIAIBBBAWohAUECIRAMvgELAkAgASIEIAJHDQBBjAEhEAzYAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw3AASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjAEhEAzYAgsgAEEANgIAIBBBAWohAUEfIRAMvQELAkAgASIEIAJHDQBBjQEhEAzXAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8s+AgABqLQAARw2/ASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBjQEhEAzXAgsgAEEANgIAIBBBAWohAUEJIRAMvAELAkAgASIEIAJHDQBBjgEhEAzWAgsCQAJAIAQtAABBt39qDgcAvwG/Ab8BvwG/AQG/AQsgBEEBaiEBQfgAIRAMvQILIARBAWohAUH5ACEQDLwCCwJAIAEiBCACRw0AQY8BIRAM1QILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQZHPgIAAai0AAEcNvQEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQY8BIRAM1QILIABBADYCACAQQQFqIQFBGCEQDLoBCwJAIAEiBCACRw0AQZABIRAM1AILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQZfPgIAAai0AAEcNvAEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZABIRAM1AILIABBADYCACAQQQFqIQFBFyEQDLkBCwJAIAEiBCACRw0AQZEBIRAM0wILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQZrPgIAAai0AAEcNuwEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZEBIRAM0wILIABBADYCACAQQQFqIQFBFSEQDLgBCwJAIAEiBCACRw0AQZIBIRAM0gILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQaHPgIAAai0AAEcNugEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZIBIRAM0gILIABBADYCACAQQQFqIQFBHiEQDLcBCwJAIAEiBCACRw0AQZMBIRAM0QILIAQtAABBzABHDbgBIARBAWohAUEKIRAMtgELAkAgBCACRw0AQZQBIRAM0AILAkACQCAELQAAQb9/ag4PALkBuQG5AbkBuQG5AbkBuQG5AbkBuQG5AbkBAbkBCyAEQQFqIQFB/gAhEAy3AgsgBEEBaiEBQf8AIRAMtgILAkAgBCACRw0AQZUBIRAMzwILAkACQCAELQAAQb9/ag4DALgBAbgBCyAEQQFqIQFB/QAhEAy2AgsgBEEBaiEEQYABIRAMtQILAkAgBCACRw0AQZYBIRAMzgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQafPgIAAai0AAEcNtgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZYBIRAMzgILIABBADYCACAQQQFqIQFBCyEQDLMBCwJAIAQgAkcNAEGXASEQDM0CCwJAAkACQAJAIAQtAABBU2oOIwC4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBuAG4AbgBAbgBuAG4AbgBuAECuAG4AbgBA7gBCyAEQQFqIQFB+wAhEAy2AgsgBEEBaiEBQfwAIRAMtQILIARBAWohBEGBASEQDLQCCyAEQQFqIQRBggEhEAyzAgsCQCAEIAJHDQBBmAEhEAzMAgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBqc+AgABqLQAARw20ASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmAEhEAzMAgsgAEEANgIAIBBBAWohAUEZIRAMsQELAkAgBCACRw0AQZkBIRAMywILIAIgBGsgACgCACIBaiEUIAQgAWtBBWohEAJAA0AgBC0AACABQa7PgIAAai0AAEcNswEgAUEFRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZkBIRAMywILIABBADYCACAQQQFqIQFBBiEQDLABCwJAIAQgAkcNAEGaASEQDMoCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG0z4CAAGotAABHDbIBIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGaASEQDMoCCyAAQQA2AgAgEEEBaiEBQRwhEAyvAQsCQCAEIAJHDQBBmwEhEAzJAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBts+AgABqLQAARw2xASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBmwEhEAzJAgsgAEEANgIAIBBBAWohAUEnIRAMrgELAkAgBCACRw0AQZwBIRAMyAILAkACQCAELQAAQax/ag4CAAGxAQsgBEEBaiEEQYYBIRAMrwILIARBAWohBEGHASEQDK4CCwJAIAQgAkcNAEGdASEQDMcCCyACIARrIAAoAgAiAWohFCAEIAFrQQFqIRACQANAIAQtAAAgAUG4z4CAAGotAABHDa8BIAFBAUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGdASEQDMcCCyAAQQA2AgAgEEEBaiEBQSYhEAysAQsCQCAEIAJHDQBBngEhEAzGAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFBus+AgABqLQAARw2uASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBngEhEAzGAgsgAEEANgIAIBBBAWohAUEDIRAMqwELAkAgBCACRw0AQZ8BIRAMxQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNrQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQZ8BIRAMxQILIABBADYCACAQQQFqIQFBDCEQDKoBCwJAIAQgAkcNAEGgASEQDMQCCyACIARrIAAoAgAiAWohFCAEIAFrQQNqIRACQANAIAQtAAAgAUG8z4CAAGotAABHDawBIAFBA0YNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGgASEQDMQCCyAAQQA2AgAgEEEBaiEBQQ0hEAypAQsCQCAEIAJHDQBBoQEhEAzDAgsCQAJAIAQtAABBun9qDgsArAGsAawBrAGsAawBrAGsAawBAawBCyAEQQFqIQRBiwEhEAyqAgsgBEEBaiEEQYwBIRAMqQILAkAgBCACRw0AQaIBIRAMwgILIAQtAABB0ABHDakBIARBAWohBAzpAQsCQCAEIAJHDQBBowEhEAzBAgsCQAJAIAQtAABBt39qDgcBqgGqAaoBqgGqAQCqAQsgBEEBaiEEQY4BIRAMqAILIARBAWohAUEiIRAMpgELAkAgBCACRw0AQaQBIRAMwAILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQcDPgIAAai0AAEcNqAEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaQBIRAMwAILIABBADYCACAQQQFqIQFBHSEQDKUBCwJAIAQgAkcNAEGlASEQDL8CCwJAAkAgBC0AAEGuf2oOAwCoAQGoAQsgBEEBaiEEQZABIRAMpgILIARBAWohAUEEIRAMpAELAkAgBCACRw0AQaYBIRAMvgILAkACQAJAAkACQCAELQAAQb9/ag4VAKoBqgGqAaoBqgGqAaoBqgGqAaoBAaoBqgECqgGqAQOqAaoBBKoBCyAEQQFqIQRBiAEhEAyoAgsgBEEBaiEEQYkBIRAMpwILIARBAWohBEGKASEQDKYCCyAEQQFqIQRBjwEhEAylAgsgBEEBaiEEQZEBIRAMpAILAkAgBCACRw0AQacBIRAMvQILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQe3PgIAAai0AAEcNpQEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQacBIRAMvQILIABBADYCACAQQQFqIQFBESEQDKIBCwJAIAQgAkcNAEGoASEQDLwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHCz4CAAGotAABHDaQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGoASEQDLwCCyAAQQA2AgAgEEEBaiEBQSwhEAyhAQsCQCAEIAJHDQBBqQEhEAy7AgsgAiAEayAAKAIAIgFqIRQgBCABa0EEaiEQAkADQCAELQAAIAFBxc+AgABqLQAARw2jASABQQRGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBqQEhEAy7AgsgAEEANgIAIBBBAWohAUErIRAMoAELAkAgBCACRw0AQaoBIRAMugILIAIgBGsgACgCACIBaiEUIAQgAWtBAmohEAJAA0AgBC0AACABQcrPgIAAai0AAEcNogEgAUECRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQaoBIRAMugILIABBADYCACAQQQFqIQFBFCEQDJ8BCwJAIAQgAkcNAEGrASEQDLkCCwJAAkACQAJAIAQtAABBvn9qDg8AAQKkAaQBpAGkAaQBpAGkAaQBpAGkAaQBA6QBCyAEQQFqIQRBkwEhEAyiAgsgBEEBaiEEQZQBIRAMoQILIARBAWohBEGVASEQDKACCyAEQQFqIQRBlgEhEAyfAgsCQCAEIAJHDQBBrAEhEAy4AgsgBC0AAEHFAEcNnwEgBEEBaiEEDOABCwJAIAQgAkcNAEGtASEQDLcCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHNz4CAAGotAABHDZ8BIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEGtASEQDLcCCyAAQQA2AgAgEEEBaiEBQQ4hEAycAQsCQCAEIAJHDQBBrgEhEAy2AgsgBC0AAEHQAEcNnQEgBEEBaiEBQSUhEAybAQsCQCAEIAJHDQBBrwEhEAy1AgsgAiAEayAAKAIAIgFqIRQgBCABa0EIaiEQAkADQCAELQAAIAFB0M+AgABqLQAARw2dASABQQhGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBrwEhEAy1AgsgAEEANgIAIBBBAWohAUEqIRAMmgELAkAgBCACRw0AQbABIRAMtAILAkACQCAELQAAQat/ag4LAJ0BnQGdAZ0BnQGdAZ0BnQGdAQGdAQsgBEEBaiEEQZoBIRAMmwILIARBAWohBEGbASEQDJoCCwJAIAQgAkcNAEGxASEQDLMCCwJAAkAgBC0AAEG/f2oOFACcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAGcAZwBnAEBnAELIARBAWohBEGZASEQDJoCCyAEQQFqIQRBnAEhEAyZAgsCQCAEIAJHDQBBsgEhEAyyAgsgAiAEayAAKAIAIgFqIRQgBCABa0EDaiEQAkADQCAELQAAIAFB2c+AgABqLQAARw2aASABQQNGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBsgEhEAyyAgsgAEEANgIAIBBBAWohAUEhIRAMlwELAkAgBCACRw0AQbMBIRAMsQILIAIgBGsgACgCACIBaiEUIAQgAWtBBmohEAJAA0AgBC0AACABQd3PgIAAai0AAEcNmQEgAUEGRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbMBIRAMsQILIABBADYCACAQQQFqIQFBGiEQDJYBCwJAIAQgAkcNAEG0ASEQDLACCwJAAkACQCAELQAAQbt/ag4RAJoBmgGaAZoBmgGaAZoBmgGaAQGaAZoBmgGaAZoBApoBCyAEQQFqIQRBnQEhEAyYAgsgBEEBaiEEQZ4BIRAMlwILIARBAWohBEGfASEQDJYCCwJAIAQgAkcNAEG1ASEQDK8CCyACIARrIAAoAgAiAWohFCAEIAFrQQVqIRACQANAIAQtAAAgAUHkz4CAAGotAABHDZcBIAFBBUYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG1ASEQDK8CCyAAQQA2AgAgEEEBaiEBQSghEAyUAQsCQCAEIAJHDQBBtgEhEAyuAgsgAiAEayAAKAIAIgFqIRQgBCABa0ECaiEQAkADQCAELQAAIAFB6s+AgABqLQAARw2WASABQQJGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBtgEhEAyuAgsgAEEANgIAIBBBAWohAUEHIRAMkwELAkAgBCACRw0AQbcBIRAMrQILAkACQCAELQAAQbt/ag4OAJYBlgGWAZYBlgGWAZYBlgGWAZYBlgGWAQGWAQsgBEEBaiEEQaEBIRAMlAILIARBAWohBEGiASEQDJMCCwJAIAQgAkcNAEG4ASEQDKwCCyACIARrIAAoAgAiAWohFCAEIAFrQQJqIRACQANAIAQtAAAgAUHtz4CAAGotAABHDZQBIAFBAkYNASABQQFqIQEgBEEBaiIEIAJHDQALIAAgFDYCAEG4ASEQDKwCCyAAQQA2AgAgEEEBaiEBQRIhEAyRAQsCQCAEIAJHDQBBuQEhEAyrAgsgAiAEayAAKAIAIgFqIRQgBCABa0EBaiEQAkADQCAELQAAIAFB8M+AgABqLQAARw2TASABQQFGDQEgAUEBaiEBIARBAWoiBCACRw0ACyAAIBQ2AgBBuQEhEAyrAgsgAEEANgIAIBBBAWohAUEgIRAMkAELAkAgBCACRw0AQboBIRAMqgILIAIgBGsgACgCACIBaiEUIAQgAWtBAWohEAJAA0AgBC0AACABQfLPgIAAai0AAEcNkgEgAUEBRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQboBIRAMqgILIABBADYCACAQQQFqIQFBDyEQDI8BCwJAIAQgAkcNAEG7ASEQDKkCCwJAAkAgBC0AAEG3f2oOBwCSAZIBkgGSAZIBAZIBCyAEQQFqIQRBpQEhEAyQAgsgBEEBaiEEQaYBIRAMjwILAkAgBCACRw0AQbwBIRAMqAILIAIgBGsgACgCACIBaiEUIAQgAWtBB2ohEAJAA0AgBC0AACABQfTPgIAAai0AAEcNkAEgAUEHRg0BIAFBAWohASAEQQFqIgQgAkcNAAsgACAUNgIAQbwBIRAMqAILIABBADYCACAQQQFqIQFBGyEQDI0BCwJAIAQgAkcNAEG9ASEQDKcCCwJAAkACQCAELQAAQb5/ag4SAJEBkQGRAZEBkQGRAZEBkQGRAQGRAZEBkQGRAZEBkQECkQELIARBAWohBEGkASEQDI8CCyAEQQFqIQRBpwEhEAyOAgsgBEEBaiEEQagBIRAMjQILAkAgBCACRw0AQb4BIRAMpgILIAQtAABBzgBHDY0BIARBAWohBAzPAQsCQCAEIAJHDQBBvwEhEAylAgsCQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQCAELQAAQb9/ag4VAAECA5wBBAUGnAGcAZwBBwgJCgucAQwNDg+cAQsgBEEBaiEBQegAIRAMmgILIARBAWohAUHpACEQDJkCCyAEQQFqIQFB7gAhEAyYAgsgBEEBaiEBQfIAIRAMlwILIARBAWohAUHzACEQDJYCCyAEQQFqIQFB9gAhEAyVAgsgBEEBaiEBQfcAIRAMlAILIARBAWohAUH6ACEQDJMCCyAEQQFqIQRBgwEhEAySAgsgBEEBaiEEQYQBIRAMkQILIARBAWohBEGFASEQDJACCyAEQQFqIQRBkgEhEAyPAgsgBEEBaiEEQZgBIRAMjgILIARBAWohBEGgASEQDI0CCyAEQQFqIQRBowEhEAyMAgsgBEEBaiEEQaoBIRAMiwILAkAgBCACRg0AIABBkICAgAA2AgggACAENgIEQasBIRAMiwILQcABIRAMowILIAAgBSACEKqAgIAAIgENiwEgBSEBDFwLAkAgBiACRg0AIAZBAWohBQyNAQtBwgEhEAyhAgsDQAJAIBAtAABBdmoOBIwBAACPAQALIBBBAWoiECACRw0AC0HDASEQDKACCwJAIAcgAkYNACAAQZGAgIAANgIIIAAgBzYCBCAHIQFBASEQDIcCC0HEASEQDJ8CCwJAIAcgAkcNAEHFASEQDJ8CCwJAAkAgBy0AAEF2ag4EAc4BzgEAzgELIAdBAWohBgyNAQsgB0EBaiEFDIkBCwJAIAcgAkcNAEHGASEQDJ4CCwJAAkAgBy0AAEF2ag4XAY8BjwEBjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BAI8BCyAHQQFqIQcLQbABIRAMhAILAkAgCCACRw0AQcgBIRAMnQILIAgtAABBIEcNjQEgAEEAOwEyIAhBAWohAUGzASEQDIMCCyABIRcCQANAIBciByACRg0BIActAABBUGpB/wFxIhBBCk8NzAECQCAALwEyIhRBmTNLDQAgACAUQQpsIhQ7ATIgEEH//wNzIBRB/v8DcUkNACAHQQFqIRcgACAUIBBqIhA7ATIgEEH//wNxQegHSQ0BCwtBACEQIABBADYCHCAAQcGJgIAANgIQIABBDTYCDCAAIAdBAWo2AhQMnAILQccBIRAMmwILIAAgCCACEK6AgIAAIhBFDcoBIBBBFUcNjAEgAEHIATYCHCAAIAg2AhQgAEHJl4CAADYCECAAQRU2AgxBACEQDJoCCwJAIAkgAkcNAEHMASEQDJoCC0EAIRRBASEXQQEhFkEAIRACQAJAAkACQAJAAkACQAJAAkAgCS0AAEFQag4KlgGVAQABAgMEBQYIlwELQQIhEAwGC0EDIRAMBQtBBCEQDAQLQQUhEAwDC0EGIRAMAgtBByEQDAELQQghEAtBACEXQQAhFkEAIRQMjgELQQkhEEEBIRRBACEXQQAhFgyNAQsCQCAKIAJHDQBBzgEhEAyZAgsgCi0AAEEuRw2OASAKQQFqIQkMygELIAsgAkcNjgFB0AEhEAyXAgsCQCALIAJGDQAgAEGOgICAADYCCCAAIAs2AgRBtwEhEAz+AQtB0QEhEAyWAgsCQCAEIAJHDQBB0gEhEAyWAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EEaiELA0AgBC0AACAQQfzPgIAAai0AAEcNjgEgEEEERg3pASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHSASEQDJUCCyAAIAwgAhCsgICAACIBDY0BIAwhAQy4AQsCQCAEIAJHDQBB1AEhEAyUAgsgAiAEayAAKAIAIhBqIRQgBCAQa0EBaiEMA0AgBC0AACAQQYHQgIAAai0AAEcNjwEgEEEBRg2OASAQQQFqIRAgBEEBaiIEIAJHDQALIAAgFDYCAEHUASEQDJMCCwJAIAQgAkcNAEHWASEQDJMCCyACIARrIAAoAgAiEGohFCAEIBBrQQJqIQsDQCAELQAAIBBBg9CAgABqLQAARw2OASAQQQJGDZABIBBBAWohECAEQQFqIgQgAkcNAAsgACAUNgIAQdYBIRAMkgILAkAgBCACRw0AQdcBIRAMkgILAkACQCAELQAAQbt/ag4QAI8BjwGPAY8BjwGPAY8BjwGPAY8BjwGPAY8BjwEBjwELIARBAWohBEG7ASEQDPkBCyAEQQFqIQRBvAEhEAz4AQsCQCAEIAJHDQBB2AEhEAyRAgsgBC0AAEHIAEcNjAEgBEEBaiEEDMQBCwJAIAQgAkYNACAAQZCAgIAANgIIIAAgBDYCBEG+ASEQDPcBC0HZASEQDI8CCwJAIAQgAkcNAEHaASEQDI8CCyAELQAAQcgARg3DASAAQQE6ACgMuQELIABBAjoALyAAIAQgAhCmgICAACIQDY0BQcIBIRAM9AELIAAtAChBf2oOArcBuQG4AQsDQAJAIAQtAABBdmoOBACOAY4BAI4BCyAEQQFqIgQgAkcNAAtB3QEhEAyLAgsgAEEAOgAvIAAtAC1BBHFFDYQCCyAAQQA6AC8gAEEBOgA0IAEhAQyMAQsgEEEVRg3aASAAQQA2AhwgACABNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAyIAgsCQCAAIBAgAhC0gICAACIEDQAgECEBDIECCwJAIARBFUcNACAAQQM2AhwgACAQNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAyIAgsgAEEANgIcIAAgEDYCFCAAQaeOgIAANgIQIABBEjYCDEEAIRAMhwILIBBBFUYN1gEgAEEANgIcIAAgATYCFCAAQdqNgIAANgIQIABBFDYCDEEAIRAMhgILIAAoAgQhFyAAQQA2AgQgECARp2oiFiEBIAAgFyAQIBYgFBsiEBC1gICAACIURQ2NASAAQQc2AhwgACAQNgIUIAAgFDYCDEEAIRAMhQILIAAgAC8BMEGAAXI7ATAgASEBC0EqIRAM6gELIBBBFUYN0QEgAEEANgIcIAAgATYCFCAAQYOMgIAANgIQIABBEzYCDEEAIRAMggILIBBBFUYNzwEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAMgQILIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDI0BCyAAQQw2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAMgAILIBBBFUYNzAEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM/wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIwBCyAAQQ02AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/gELIBBBFUYNyQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM/QELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIsBCyAAQQ42AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM/AELIABBADYCHCAAIAE2AhQgAEHAlYCAADYCECAAQQI2AgxBACEQDPsBCyAQQRVGDcUBIABBADYCHCAAIAE2AhQgAEHGjICAADYCECAAQSM2AgxBACEQDPoBCyAAQRA2AhwgACABNgIUIAAgEDYCDEEAIRAM+QELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDPEBCyAAQRE2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM+AELIBBBFUYNwQEgAEEANgIcIAAgATYCFCAAQcaMgIAANgIQIABBIzYCDEEAIRAM9wELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC5gICAACIQDQAgAUEBaiEBDIgBCyAAQRM2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM9gELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC5gICAACIEDQAgAUEBaiEBDO0BCyAAQRQ2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM9QELIBBBFUYNvQEgAEEANgIcIAAgATYCFCAAQZqPgIAANgIQIABBIjYCDEEAIRAM9AELIAAoAgQhECAAQQA2AgQCQCAAIBAgARC3gICAACIQDQAgAUEBaiEBDIYBCyAAQRY2AhwgACAQNgIMIAAgAUEBajYCFEEAIRAM8wELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARC3gICAACIEDQAgAUEBaiEBDOkBCyAAQRc2AhwgACAENgIMIAAgAUEBajYCFEEAIRAM8gELIABBADYCHCAAIAE2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDPEBC0IBIRELIBBBAWohAQJAIAApAyAiEkL//////////w9WDQAgACASQgSGIBGENwMgIAEhAQyEAQsgAEEANgIcIAAgATYCFCAAQa2JgIAANgIQIABBDDYCDEEAIRAM7wELIABBADYCHCAAIBA2AhQgAEHNk4CAADYCECAAQQw2AgxBACEQDO4BCyAAKAIEIRcgAEEANgIEIBAgEadqIhYhASAAIBcgECAWIBQbIhAQtYCAgAAiFEUNcyAAQQU2AhwgACAQNgIUIAAgFDYCDEEAIRAM7QELIABBADYCHCAAIBA2AhQgAEGqnICAADYCECAAQQ82AgxBACEQDOwBCyAAIBAgAhC0gICAACIBDQEgECEBC0EOIRAM0QELAkAgAUEVRw0AIABBAjYCHCAAIBA2AhQgAEGwmICAADYCECAAQRU2AgxBACEQDOoBCyAAQQA2AhwgACAQNgIUIABBp46AgAA2AhAgAEESNgIMQQAhEAzpAQsgAUEBaiEQAkAgAC8BMCIBQYABcUUNAAJAIAAgECACELuAgIAAIgENACAQIQEMcAsgAUEVRw26ASAAQQU2AhwgACAQNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAzpAQsCQCABQaAEcUGgBEcNACAALQAtQQJxDQAgAEEANgIcIAAgEDYCFCAAQZaTgIAANgIQIABBBDYCDEEAIRAM6QELIAAgECACEL2AgIAAGiAQIQECQAJAAkACQAJAIAAgECACELOAgIAADhYCAQAEBAQEBAQEBAQEBAQEBAQEBAQDBAsgAEEBOgAuCyAAIAAvATBBwAByOwEwIBAhAQtBJiEQDNEBCyAAQSM2AhwgACAQNgIUIABBpZaAgAA2AhAgAEEVNgIMQQAhEAzpAQsgAEEANgIcIAAgEDYCFCAAQdWLgIAANgIQIABBETYCDEEAIRAM6AELIAAtAC1BAXFFDQFBwwEhEAzOAQsCQCANIAJGDQADQAJAIA0tAABBIEYNACANIQEMxAELIA1BAWoiDSACRw0AC0ElIRAM5wELQSUhEAzmAQsgACgCBCEEIABBADYCBCAAIAQgDRCvgICAACIERQ2tASAAQSY2AhwgACAENgIMIAAgDUEBajYCFEEAIRAM5QELIBBBFUYNqwEgAEEANgIcIAAgATYCFCAAQf2NgIAANgIQIABBHTYCDEEAIRAM5AELIABBJzYCHCAAIAE2AhQgACAQNgIMQQAhEAzjAQsgECEBQQEhFAJAAkACQAJAAkACQAJAIAAtACxBfmoOBwYFBQMBAgAFCyAAIAAvATBBCHI7ATAMAwtBAiEUDAELQQQhFAsgAEEBOgAsIAAgAC8BMCAUcjsBMAsgECEBC0ErIRAMygELIABBADYCHCAAIBA2AhQgAEGrkoCAADYCECAAQQs2AgxBACEQDOIBCyAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMQQAhEAzhAQsgAEEAOgAsIBAhAQy9AQsgECEBQQEhFAJAAkACQAJAAkAgAC0ALEF7ag4EAwECAAULIAAgAC8BMEEIcjsBMAwDC0ECIRQMAQtBBCEUCyAAQQE6ACwgACAALwEwIBRyOwEwCyAQIQELQSkhEAzFAQsgAEEANgIcIAAgATYCFCAAQfCUgIAANgIQIABBAzYCDEEAIRAM3QELAkAgDi0AAEENRw0AIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDkEBaiEBDHULIABBLDYCHCAAIAE2AgwgACAOQQFqNgIUQQAhEAzdAQsgAC0ALUEBcUUNAUHEASEQDMMBCwJAIA4gAkcNAEEtIRAM3AELAkACQANAAkAgDi0AAEF2ag4EAgAAAwALIA5BAWoiDiACRw0AC0EtIRAM3QELIAAoAgQhASAAQQA2AgQCQCAAIAEgDhCxgICAACIBDQAgDiEBDHQLIABBLDYCHCAAIA42AhQgACABNgIMQQAhEAzcAQsgACgCBCEBIABBADYCBAJAIAAgASAOELGAgIAAIgENACAOQQFqIQEMcwsgAEEsNgIcIAAgATYCDCAAIA5BAWo2AhRBACEQDNsBCyAAKAIEIQQgAEEANgIEIAAgBCAOELGAgIAAIgQNoAEgDiEBDM4BCyAQQSxHDQEgAUEBaiEQQQEhAQJAAkACQAJAAkAgAC0ALEF7ag4EAwECBAALIBAhAQwEC0ECIQEMAQtBBCEBCyAAQQE6ACwgACAALwEwIAFyOwEwIBAhAQwBCyAAIAAvATBBCHI7ATAgECEBC0E5IRAMvwELIABBADoALCABIQELQTQhEAy9AQsgACAALwEwQSByOwEwIAEhAQwCCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQsYCAgAAiBA0AIAEhAQzHAQsgAEE3NgIcIAAgATYCFCAAIAQ2AgxBACEQDNQBCyAAQQg6ACwgASEBC0EwIRAMuQELAkAgAC0AKEEBRg0AIAEhAQwECyAALQAtQQhxRQ2TASABIQEMAwsgAC0AMEEgcQ2UAUHFASEQDLcBCwJAIA8gAkYNAAJAA0ACQCAPLQAAQVBqIgFB/wFxQQpJDQAgDyEBQTUhEAy6AQsgACkDICIRQpmz5syZs+bMGVYNASAAIBFCCn4iETcDICARIAGtQv8BgyISQn+FVg0BIAAgESASfDcDICAPQQFqIg8gAkcNAAtBOSEQDNEBCyAAKAIEIQIgAEEANgIEIAAgAiAPQQFqIgQQsYCAgAAiAg2VASAEIQEMwwELQTkhEAzPAQsCQCAALwEwIgFBCHFFDQAgAC0AKEEBRw0AIAAtAC1BCHFFDZABCyAAIAFB9/sDcUGABHI7ATAgDyEBC0E3IRAMtAELIAAgAC8BMEEQcjsBMAyrAQsgEEEVRg2LASAAQQA2AhwgACABNgIUIABB8I6AgAA2AhAgAEEcNgIMQQAhEAzLAQsgAEHDADYCHCAAIAE2AgwgACANQQFqNgIUQQAhEAzKAQsCQCABLQAAQTpHDQAgACgCBCEQIABBADYCBAJAIAAgECABEK+AgIAAIhANACABQQFqIQEMYwsgAEHDADYCHCAAIBA2AgwgACABQQFqNgIUQQAhEAzKAQsgAEEANgIcIAAgATYCFCAAQbGRgIAANgIQIABBCjYCDEEAIRAMyQELIABBADYCHCAAIAE2AhQgAEGgmYCAADYCECAAQR42AgxBACEQDMgBCyAAQQA2AgALIABBgBI7ASogACAXQQFqIgEgAhCogICAACIQDQEgASEBC0HHACEQDKwBCyAQQRVHDYMBIABB0QA2AhwgACABNgIUIABB45eAgAA2AhAgAEEVNgIMQQAhEAzEAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMXgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAzDAQsgAEEANgIcIAAgFDYCFCAAQcGogIAANgIQIABBBzYCDCAAQQA2AgBBACEQDMIBCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxdCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDMEBC0EAIRAgAEEANgIcIAAgATYCFCAAQYCRgIAANgIQIABBCTYCDAzAAQsgEEEVRg19IABBADYCHCAAIAE2AhQgAEGUjYCAADYCECAAQSE2AgxBACEQDL8BC0EBIRZBACEXQQAhFEEBIRALIAAgEDoAKyABQQFqIQECQAJAIAAtAC1BEHENAAJAAkACQCAALQAqDgMBAAIECyAWRQ0DDAILIBQNAQwCCyAXRQ0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQrYCAgAAiEA0AIAEhAQxcCyAAQdgANgIcIAAgATYCFCAAIBA2AgxBACEQDL4BCyAAKAIEIQQgAEEANgIEAkAgACAEIAEQrYCAgAAiBA0AIAEhAQytAQsgAEHZADYCHCAAIAE2AhQgACAENgIMQQAhEAy9AQsgACgCBCEEIABBADYCBAJAIAAgBCABEK2AgIAAIgQNACABIQEMqwELIABB2gA2AhwgACABNgIUIAAgBDYCDEEAIRAMvAELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKkBCyAAQdwANgIcIAAgATYCFCAAIAQ2AgxBACEQDLsBCwJAIAEtAABBUGoiEEH/AXFBCk8NACAAIBA6ACogAUEBaiEBQc8AIRAMogELIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCtgICAACIEDQAgASEBDKcBCyAAQd4ANgIcIAAgATYCFCAAIAQ2AgxBACEQDLoBCyAAQQA2AgAgF0EBaiEBAkAgAC0AKUEjTw0AIAEhAQxZCyAAQQA2AhwgACABNgIUIABB04mAgAA2AhAgAEEINgIMQQAhEAy5AQsgAEEANgIAC0EAIRAgAEEANgIcIAAgATYCFCAAQZCzgIAANgIQIABBCDYCDAy3AQsgAEEANgIAIBdBAWohAQJAIAAtAClBIUcNACABIQEMVgsgAEEANgIcIAAgATYCFCAAQZuKgIAANgIQIABBCDYCDEEAIRAMtgELIABBADYCACAXQQFqIQECQCAALQApIhBBXWpBC08NACABIQEMVQsCQCAQQQZLDQBBASAQdEHKAHFFDQAgASEBDFULQQAhECAAQQA2AhwgACABNgIUIABB94mAgAA2AhAgAEEINgIMDLUBCyAQQRVGDXEgAEEANgIcIAAgATYCFCAAQbmNgIAANgIQIABBGjYCDEEAIRAMtAELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFQLIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMswELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0gA2AhwgACABNgIUIAAgEDYCDEEAIRAMsgELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDE0LIABB0wA2AhwgACABNgIUIAAgEDYCDEEAIRAMsQELIAAoAgQhECAAQQA2AgQCQCAAIBAgARCngICAACIQDQAgASEBDFELIABB5QA2AhwgACABNgIUIAAgEDYCDEEAIRAMsAELIABBADYCHCAAIAE2AhQgAEHGioCAADYCECAAQQc2AgxBACEQDK8BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdIANgIcIAAgATYCFCAAIBA2AgxBACEQDK4BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxJCyAAQdMANgIcIAAgATYCFCAAIBA2AgxBACEQDK0BCyAAKAIEIRAgAEEANgIEAkAgACAQIAEQp4CAgAAiEA0AIAEhAQxNCyAAQeUANgIcIAAgATYCFCAAIBA2AgxBACEQDKwBCyAAQQA2AhwgACABNgIUIABB3IiAgAA2AhAgAEEHNgIMQQAhEAyrAQsgEEE/Rw0BIAFBAWohAQtBBSEQDJABC0EAIRAgAEEANgIcIAAgATYCFCAAQf2SgIAANgIQIABBBzYCDAyoAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHSADYCHCAAIAE2AhQgACAQNgIMQQAhEAynAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMQgsgAEHTADYCHCAAIAE2AhQgACAQNgIMQQAhEAymAQsgACgCBCEQIABBADYCBAJAIAAgECABEKeAgIAAIhANACABIQEMRgsgAEHlADYCHCAAIAE2AhQgACAQNgIMQQAhEAylAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHSADYCHCAAIBQ2AhQgACABNgIMQQAhEAykAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMPwsgAEHTADYCHCAAIBQ2AhQgACABNgIMQQAhEAyjAQsgACgCBCEBIABBADYCBAJAIAAgASAUEKeAgIAAIgENACAUIQEMQwsgAEHlADYCHCAAIBQ2AhQgACABNgIMQQAhEAyiAQsgAEEANgIcIAAgFDYCFCAAQcOPgIAANgIQIABBBzYCDEEAIRAMoQELIABBADYCHCAAIAE2AhQgAEHDj4CAADYCECAAQQc2AgxBACEQDKABC0EAIRAgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDAyfAQsgAEEANgIcIAAgFDYCFCAAQYycgIAANgIQIABBBzYCDEEAIRAMngELIABBADYCHCAAIBQ2AhQgAEH+kYCAADYCECAAQQc2AgxBACEQDJ0BCyAAQQA2AhwgACABNgIUIABBjpuAgAA2AhAgAEEGNgIMQQAhEAycAQsgEEEVRg1XIABBADYCHCAAIAE2AhQgAEHMjoCAADYCECAAQSA2AgxBACEQDJsBCyAAQQA2AgAgEEEBaiEBQSQhEAsgACAQOgApIAAoAgQhECAAQQA2AgQgACAQIAEQq4CAgAAiEA1UIAEhAQw+CyAAQQA2AgALQQAhECAAQQA2AhwgACAENgIUIABB8ZuAgAA2AhAgAEEGNgIMDJcBCyABQRVGDVAgAEEANgIcIAAgBTYCFCAAQfCMgIAANgIQIABBGzYCDEEAIRAMlgELIAAoAgQhBSAAQQA2AgQgACAFIBAQqYCAgAAiBQ0BIBBBAWohBQtBrQEhEAx7CyAAQcEBNgIcIAAgBTYCDCAAIBBBAWo2AhRBACEQDJMBCyAAKAIEIQYgAEEANgIEIAAgBiAQEKmAgIAAIgYNASAQQQFqIQYLQa4BIRAMeAsgAEHCATYCHCAAIAY2AgwgACAQQQFqNgIUQQAhEAyQAQsgAEEANgIcIAAgBzYCFCAAQZeLgIAANgIQIABBDTYCDEEAIRAMjwELIABBADYCHCAAIAg2AhQgAEHjkICAADYCECAAQQk2AgxBACEQDI4BCyAAQQA2AhwgACAINgIUIABBlI2AgAA2AhAgAEEhNgIMQQAhEAyNAQtBASEWQQAhF0EAIRRBASEQCyAAIBA6ACsgCUEBaiEIAkACQCAALQAtQRBxDQACQAJAAkAgAC0AKg4DAQACBAsgFkUNAwwCCyAUDQEMAgsgF0UNAQsgACgCBCEQIABBADYCBCAAIBAgCBCtgICAACIQRQ09IABByQE2AhwgACAINgIUIAAgEDYCDEEAIRAMjAELIAAoAgQhBCAAQQA2AgQgACAEIAgQrYCAgAAiBEUNdiAAQcoBNgIcIAAgCDYCFCAAIAQ2AgxBACEQDIsBCyAAKAIEIQQgAEEANgIEIAAgBCAJEK2AgIAAIgRFDXQgAEHLATYCHCAAIAk2AhQgACAENgIMQQAhEAyKAQsgACgCBCEEIABBADYCBCAAIAQgChCtgICAACIERQ1yIABBzQE2AhwgACAKNgIUIAAgBDYCDEEAIRAMiQELAkAgCy0AAEFQaiIQQf8BcUEKTw0AIAAgEDoAKiALQQFqIQpBtgEhEAxwCyAAKAIEIQQgAEEANgIEIAAgBCALEK2AgIAAIgRFDXAgAEHPATYCHCAAIAs2AhQgACAENgIMQQAhEAyIAQsgAEEANgIcIAAgBDYCFCAAQZCzgIAANgIQIABBCDYCDCAAQQA2AgBBACEQDIcBCyABQRVGDT8gAEEANgIcIAAgDDYCFCAAQcyOgIAANgIQIABBIDYCDEEAIRAMhgELIABBgQQ7ASggACgCBCEQIABCADcDACAAIBAgDEEBaiIMEKuAgIAAIhBFDTggAEHTATYCHCAAIAw2AhQgACAQNgIMQQAhEAyFAQsgAEEANgIAC0EAIRAgAEEANgIcIAAgBDYCFCAAQdibgIAANgIQIABBCDYCDAyDAQsgACgCBCEQIABCADcDACAAIBAgC0EBaiILEKuAgIAAIhANAUHGASEQDGkLIABBAjoAKAxVCyAAQdUBNgIcIAAgCzYCFCAAIBA2AgxBACEQDIABCyAQQRVGDTcgAEEANgIcIAAgBDYCFCAAQaSMgIAANgIQIABBEDYCDEEAIRAMfwsgAC0ANEEBRw00IAAgBCACELyAgIAAIhBFDTQgEEEVRw01IABB3AE2AhwgACAENgIUIABB1ZaAgAA2AhAgAEEVNgIMQQAhEAx+C0EAIRAgAEEANgIcIABBr4uAgAA2AhAgAEECNgIMIAAgFEEBajYCFAx9C0EAIRAMYwtBAiEQDGILQQ0hEAxhC0EPIRAMYAtBJSEQDF8LQRMhEAxeC0EVIRAMXQtBFiEQDFwLQRchEAxbC0EYIRAMWgtBGSEQDFkLQRohEAxYC0EbIRAMVwtBHCEQDFYLQR0hEAxVC0EfIRAMVAtBISEQDFMLQSMhEAxSC0HGACEQDFELQS4hEAxQC0EvIRAMTwtBOyEQDE4LQT0hEAxNC0HIACEQDEwLQckAIRAMSwtBywAhEAxKC0HMACEQDEkLQc4AIRAMSAtB0QAhEAxHC0HVACEQDEYLQdgAIRAMRQtB2QAhEAxEC0HbACEQDEMLQeQAIRAMQgtB5QAhEAxBC0HxACEQDEALQfQAIRAMPwtBjQEhEAw+C0GXASEQDD0LQakBIRAMPAtBrAEhEAw7C0HAASEQDDoLQbkBIRAMOQtBrwEhEAw4C0GxASEQDDcLQbIBIRAMNgtBtAEhEAw1C0G1ASEQDDQLQboBIRAMMwtBvQEhEAwyC0G/ASEQDDELQcEBIRAMMAsgAEEANgIcIAAgBDYCFCAAQemLgIAANgIQIABBHzYCDEEAIRAMSAsgAEHbATYCHCAAIAQ2AhQgAEH6loCAADYCECAAQRU2AgxBACEQDEcLIABB+AA2AhwgACAMNgIUIABBypiAgAA2AhAgAEEVNgIMQQAhEAxGCyAAQdEANgIcIAAgBTYCFCAAQbCXgIAANgIQIABBFTYCDEEAIRAMRQsgAEH5ADYCHCAAIAE2AhQgACAQNgIMQQAhEAxECyAAQfgANgIcIAAgATYCFCAAQcqYgIAANgIQIABBFTYCDEEAIRAMQwsgAEHkADYCHCAAIAE2AhQgAEHjl4CAADYCECAAQRU2AgxBACEQDEILIABB1wA2AhwgACABNgIUIABByZeAgAA2AhAgAEEVNgIMQQAhEAxBCyAAQQA2AhwgACABNgIUIABBuY2AgAA2AhAgAEEaNgIMQQAhEAxACyAAQcIANgIcIAAgATYCFCAAQeOYgIAANgIQIABBFTYCDEEAIRAMPwsgAEEANgIEIAAgDyAPELGAgIAAIgRFDQEgAEE6NgIcIAAgBDYCDCAAIA9BAWo2AhRBACEQDD4LIAAoAgQhBCAAQQA2AgQCQCAAIAQgARCxgICAACIERQ0AIABBOzYCHCAAIAQ2AgwgACABQQFqNgIUQQAhEAw+CyABQQFqIQEMLQsgD0EBaiEBDC0LIABBADYCHCAAIA82AhQgAEHkkoCAADYCECAAQQQ2AgxBACEQDDsLIABBNjYCHCAAIAQ2AhQgACACNgIMQQAhEAw6CyAAQS42AhwgACAONgIUIAAgBDYCDEEAIRAMOQsgAEHQADYCHCAAIAE2AhQgAEGRmICAADYCECAAQRU2AgxBACEQDDgLIA1BAWohAQwsCyAAQRU2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAw2CyAAQRs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw1CyAAQQ82AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAw0CyAAQQs2AhwgACABNgIUIABBkZeAgAA2AhAgAEEVNgIMQQAhEAwzCyAAQRo2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwyCyAAQQs2AhwgACABNgIUIABBgpmAgAA2AhAgAEEVNgIMQQAhEAwxCyAAQQo2AhwgACABNgIUIABB5JaAgAA2AhAgAEEVNgIMQQAhEAwwCyAAQR42AhwgACABNgIUIABB+ZeAgAA2AhAgAEEVNgIMQQAhEAwvCyAAQQA2AhwgACAQNgIUIABB2o2AgAA2AhAgAEEUNgIMQQAhEAwuCyAAQQQ2AhwgACABNgIUIABBsJiAgAA2AhAgAEEVNgIMQQAhEAwtCyAAQQA2AgAgC0EBaiELC0G4ASEQDBILIABBADYCACAQQQFqIQFB9QAhEAwRCyABIQECQCAALQApQQVHDQBB4wAhEAwRC0HiACEQDBALQQAhECAAQQA2AhwgAEHkkYCAADYCECAAQQc2AgwgACAUQQFqNgIUDCgLIABBADYCACAXQQFqIQFBwAAhEAwOC0EBIQELIAAgAToALCAAQQA2AgAgF0EBaiEBC0EoIRAMCwsgASEBC0E4IRAMCQsCQCABIg8gAkYNAANAAkAgDy0AAEGAvoCAAGotAAAiAUEBRg0AIAFBAkcNAyAPQQFqIQEMBAsgD0EBaiIPIAJHDQALQT4hEAwiC0E+IRAMIQsgAEEAOgAsIA8hAQwBC0ELIRAMBgtBOiEQDAULIAFBAWohAUEtIRAMBAsgACABOgAsIABBADYCACAWQQFqIQFBDCEQDAMLIABBADYCACAXQQFqIQFBCiEQDAILIABBADYCAAsgAEEAOgAsIA0hAUEJIRAMAAsLQQAhECAAQQA2AhwgACALNgIUIABBzZCAgAA2AhAgAEEJNgIMDBcLQQAhECAAQQA2AhwgACAKNgIUIABB6YqAgAA2AhAgAEEJNgIMDBYLQQAhECAAQQA2AhwgACAJNgIUIABBt5CAgAA2AhAgAEEJNgIMDBULQQAhECAAQQA2AhwgACAINgIUIABBnJGAgAA2AhAgAEEJNgIMDBQLQQAhECAAQQA2AhwgACABNgIUIABBzZCAgAA2AhAgAEEJNgIMDBMLQQAhECAAQQA2AhwgACABNgIUIABB6YqAgAA2AhAgAEEJNgIMDBILQQAhECAAQQA2AhwgACABNgIUIABBt5CAgAA2AhAgAEEJNgIMDBELQQAhECAAQQA2AhwgACABNgIUIABBnJGAgAA2AhAgAEEJNgIMDBALQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA8LQQAhECAAQQA2AhwgACABNgIUIABBl5WAgAA2AhAgAEEPNgIMDA4LQQAhECAAQQA2AhwgACABNgIUIABBwJKAgAA2AhAgAEELNgIMDA0LQQAhECAAQQA2AhwgACABNgIUIABBlYmAgAA2AhAgAEELNgIMDAwLQQAhECAAQQA2AhwgACABNgIUIABB4Y+AgAA2AhAgAEEKNgIMDAsLQQAhECAAQQA2AhwgACABNgIUIABB+4+AgAA2AhAgAEEKNgIMDAoLQQAhECAAQQA2AhwgACABNgIUIABB8ZmAgAA2AhAgAEECNgIMDAkLQQAhECAAQQA2AhwgACABNgIUIABBxJSAgAA2AhAgAEECNgIMDAgLQQAhECAAQQA2AhwgACABNgIUIABB8pWAgAA2AhAgAEECNgIMDAcLIABBAjYCHCAAIAE2AhQgAEGcmoCAADYCECAAQRY2AgxBACEQDAYLQQEhEAwFC0HUACEQIAEiBCACRg0EIANBCGogACAEIAJB2MKAgABBChDFgICAACADKAIMIQQgAygCCA4DAQQCAAsQyoCAgAAACyAAQQA2AhwgAEG1moCAADYCECAAQRc2AgwgACAEQQFqNgIUQQAhEAwCCyAAQQA2AhwgACAENgIUIABBypqAgAA2AhAgAEEJNgIMQQAhEAwBCwJAIAEiBCACRw0AQSIhEAwBCyAAQYmAgIAANgIIIAAgBDYCBEEhIRALIANBEGokgICAgAAgEAuvAQECfyABKAIAIQYCQAJAIAIgA0YNACAEIAZqIQQgBiADaiACayEHIAIgBkF/cyAFaiIGaiEFA0ACQCACLQAAIAQtAABGDQBBAiEEDAMLAkAgBg0AQQAhBCAFIQIMAwsgBkF/aiEGIARBAWohBCACQQFqIgIgA0cNAAsgByEGIAMhAgsgAEEBNgIAIAEgBjYCACAAIAI2AgQPCyABQQA2AgAgACAENgIAIAAgAjYCBAsKACAAEMeAgIAAC/I2AQt/I4CAgIAAQRBrIgEkgICAgAACQEEAKAKg0ICAAA0AQQAQy4CAgABBgNSEgABrIgJB2QBJDQBBACEDAkBBACgC4NOAgAAiBA0AQQBCfzcC7NOAgABBAEKAgISAgIDAADcC5NOAgABBACABQQhqQXBxQdiq1aoFcyIENgLg04CAAEEAQQA2AvTTgIAAQQBBADYCxNOAgAALQQAgAjYCzNOAgABBAEGA1ISAADYCyNOAgABBAEGA1ISAADYCmNCAgABBACAENgKs0ICAAEEAQX82AqjQgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAtBgNSEgABBeEGA1ISAAGtBD3FBAEGA1ISAAEEIakEPcRsiA2oiBEEEaiACQUhqIgUgA2siA0EBcjYCAEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgABBgNSEgAAgBWpBODYCBAsCQAJAAkACQAJAAkACQAJAAkACQAJAAkAgAEHsAUsNAAJAQQAoAojQgIAAIgZBECAAQRNqQXBxIABBC0kbIgJBA3YiBHYiA0EDcUUNAAJAAkAgA0EBcSAEckEBcyIFQQN0IgRBsNCAgABqIgMgBEG40ICAAGooAgAiBCgCCCICRw0AQQAgBkF+IAV3cTYCiNCAgAAMAQsgAyACNgIIIAIgAzYCDAsgBEEIaiEDIAQgBUEDdCIFQQNyNgIEIAQgBWoiBCAEKAIEQQFyNgIEDAwLIAJBACgCkNCAgAAiB00NAQJAIANFDQACQAJAIAMgBHRBAiAEdCIDQQAgA2tycSIDQQAgA2txQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmoiBEEDdCIDQbDQgIAAaiIFIANBuNCAgABqKAIAIgMoAggiAEcNAEEAIAZBfiAEd3EiBjYCiNCAgAAMAQsgBSAANgIIIAAgBTYCDAsgAyACQQNyNgIEIAMgBEEDdCIEaiAEIAJrIgU2AgAgAyACaiIAIAVBAXI2AgQCQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhBAJAAkAgBkEBIAdBA3Z0IghxDQBBACAGIAhyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAQ2AgwgAiAENgIIIAQgAjYCDCAEIAg2AggLIANBCGohA0EAIAA2ApzQgIAAQQAgBTYCkNCAgAAMDAtBACgCjNCAgAAiCUUNASAJQQAgCWtxQX9qIgMgA0EMdkEQcSIDdiIEQQV2QQhxIgUgA3IgBCAFdiIDQQJ2QQRxIgRyIAMgBHYiA0EBdkECcSIEciADIAR2IgNBAXZBAXEiBHIgAyAEdmpBAnRBuNKAgABqKAIAIgAoAgRBeHEgAmshBCAAIQUCQANAAkAgBSgCECIDDQAgBUEUaigCACIDRQ0CCyADKAIEQXhxIAJrIgUgBCAFIARJIgUbIQQgAyAAIAUbIQAgAyEFDAALCyAAKAIYIQoCQCAAKAIMIgggAEYNACAAKAIIIgNBACgCmNCAgABJGiAIIAM2AgggAyAINgIMDAsLAkAgAEEUaiIFKAIAIgMNACAAKAIQIgNFDQMgAEEQaiEFCwNAIAUhCyADIghBFGoiBSgCACIDDQAgCEEQaiEFIAgoAhAiAw0ACyALQQA2AgAMCgtBfyECIABBv39LDQAgAEETaiIDQXBxIQJBACgCjNCAgAAiB0UNAEEAIQsCQCACQYACSQ0AQR8hCyACQf///wdLDQAgA0EIdiIDIANBgP4/akEQdkEIcSIDdCIEIARBgOAfakEQdkEEcSIEdCIFIAVBgIAPakEQdkECcSIFdEEPdiADIARyIAVyayIDQQF0IAIgA0EVanZBAXFyQRxqIQsLQQAgAmshBAJAAkACQAJAIAtBAnRBuNKAgABqKAIAIgUNAEEAIQNBACEIDAELQQAhAyACQQBBGSALQQF2ayALQR9GG3QhAEEAIQgDQAJAIAUoAgRBeHEgAmsiBiAETw0AIAYhBCAFIQggBg0AQQAhBCAFIQggBSEDDAMLIAMgBUEUaigCACIGIAYgBSAAQR12QQRxakEQaigCACIFRhsgAyAGGyEDIABBAXQhACAFDQALCwJAIAMgCHINAEEAIQhBAiALdCIDQQAgA2tyIAdxIgNFDQMgA0EAIANrcUF/aiIDIANBDHZBEHEiA3YiBUEFdkEIcSIAIANyIAUgAHYiA0ECdkEEcSIFciADIAV2IgNBAXZBAnEiBXIgAyAFdiIDQQF2QQFxIgVyIAMgBXZqQQJ0QbjSgIAAaigCACEDCyADRQ0BCwNAIAMoAgRBeHEgAmsiBiAESSEAAkAgAygCECIFDQAgA0EUaigCACEFCyAGIAQgABshBCADIAggABshCCAFIQMgBQ0ACwsgCEUNACAEQQAoApDQgIAAIAJrTw0AIAgoAhghCwJAIAgoAgwiACAIRg0AIAgoAggiA0EAKAKY0ICAAEkaIAAgAzYCCCADIAA2AgwMCQsCQCAIQRRqIgUoAgAiAw0AIAgoAhAiA0UNAyAIQRBqIQULA0AgBSEGIAMiAEEUaiIFKAIAIgMNACAAQRBqIQUgACgCECIDDQALIAZBADYCAAwICwJAQQAoApDQgIAAIgMgAkkNAEEAKAKc0ICAACEEAkACQCADIAJrIgVBEEkNACAEIAJqIgAgBUEBcjYCBEEAIAU2ApDQgIAAQQAgADYCnNCAgAAgBCADaiAFNgIAIAQgAkEDcjYCBAwBCyAEIANBA3I2AgQgBCADaiIDIAMoAgRBAXI2AgRBAEEANgKc0ICAAEEAQQA2ApDQgIAACyAEQQhqIQMMCgsCQEEAKAKU0ICAACIAIAJNDQBBACgCoNCAgAAiAyACaiIEIAAgAmsiBUEBcjYCBEEAIAU2ApTQgIAAQQAgBDYCoNCAgAAgAyACQQNyNgIEIANBCGohAwwKCwJAAkBBACgC4NOAgABFDQBBACgC6NOAgAAhBAwBC0EAQn83AuzTgIAAQQBCgICEgICAwAA3AuTTgIAAQQAgAUEMakFwcUHYqtWqBXM2AuDTgIAAQQBBADYC9NOAgABBAEEANgLE04CAAEGAgAQhBAtBACEDAkAgBCACQccAaiIHaiIGQQAgBGsiC3EiCCACSw0AQQBBMDYC+NOAgAAMCgsCQEEAKALA04CAACIDRQ0AAkBBACgCuNOAgAAiBCAIaiIFIARNDQAgBSADTQ0BC0EAIQNBAEEwNgL404CAAAwKC0EALQDE04CAAEEEcQ0EAkACQAJAQQAoAqDQgIAAIgRFDQBByNOAgAAhAwNAAkAgAygCACIFIARLDQAgBSADKAIEaiAESw0DCyADKAIIIgMNAAsLQQAQy4CAgAAiAEF/Rg0FIAghBgJAQQAoAuTTgIAAIgNBf2oiBCAAcUUNACAIIABrIAQgAGpBACADa3FqIQYLIAYgAk0NBSAGQf7///8HSw0FAkBBACgCwNOAgAAiA0UNAEEAKAK404CAACIEIAZqIgUgBE0NBiAFIANLDQYLIAYQy4CAgAAiAyAARw0BDAcLIAYgAGsgC3EiBkH+////B0sNBCAGEMuAgIAAIgAgAygCACADKAIEakYNAyAAIQMLAkAgA0F/Rg0AIAJByABqIAZNDQACQCAHIAZrQQAoAujTgIAAIgRqQQAgBGtxIgRB/v///wdNDQAgAyEADAcLAkAgBBDLgICAAEF/Rg0AIAQgBmohBiADIQAMBwtBACAGaxDLgICAABoMBAsgAyEAIANBf0cNBQwDC0EAIQgMBwtBACEADAULIABBf0cNAgtBAEEAKALE04CAAEEEcjYCxNOAgAALIAhB/v///wdLDQEgCBDLgICAACEAQQAQy4CAgAAhAyAAQX9GDQEgA0F/Rg0BIAAgA08NASADIABrIgYgAkE4ak0NAQtBAEEAKAK404CAACAGaiIDNgK404CAAAJAIANBACgCvNOAgABNDQBBACADNgK804CAAAsCQAJAAkACQEEAKAKg0ICAACIERQ0AQcjTgIAAIQMDQCAAIAMoAgAiBSADKAIEIghqRg0CIAMoAggiAw0ADAMLCwJAAkBBACgCmNCAgAAiA0UNACAAIANPDQELQQAgADYCmNCAgAALQQAhA0EAIAY2AszTgIAAQQAgADYCyNOAgABBAEF/NgKo0ICAAEEAQQAoAuDTgIAANgKs0ICAAEEAQQA2AtTTgIAAA0AgA0HE0ICAAGogA0G40ICAAGoiBDYCACAEIANBsNCAgABqIgU2AgAgA0G80ICAAGogBTYCACADQczQgIAAaiADQcDQgIAAaiIFNgIAIAUgBDYCACADQdTQgIAAaiADQcjQgIAAaiIENgIAIAQgBTYCACADQdDQgIAAaiAENgIAIANBIGoiA0GAAkcNAAsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiBCAGQUhqIgUgA2siA0EBcjYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAM2ApTQgIAAQQAgBDYCoNCAgAAgACAFakE4NgIEDAILIAMtAAxBCHENACAEIAVJDQAgBCAATw0AIARBeCAEa0EPcUEAIARBCGpBD3EbIgVqIgBBACgClNCAgAAgBmoiCyAFayIFQQFyNgIEIAMgCCAGajYCBEEAQQAoAvDTgIAANgKk0ICAAEEAIAU2ApTQgIAAQQAgADYCoNCAgAAgBCALakE4NgIEDAELAkAgAEEAKAKY0ICAACIITw0AQQAgADYCmNCAgAAgACEICyAAIAZqIQVByNOAgAAhAwJAAkACQAJAAkACQAJAA0AgAygCACAFRg0BIAMoAggiAw0ADAILCyADLQAMQQhxRQ0BC0HI04CAACEDA0ACQCADKAIAIgUgBEsNACAFIAMoAgRqIgUgBEsNAwsgAygCCCEDDAALCyADIAA2AgAgAyADKAIEIAZqNgIEIABBeCAAa0EPcUEAIABBCGpBD3EbaiILIAJBA3I2AgQgBUF4IAVrQQ9xQQAgBUEIakEPcRtqIgYgCyACaiICayEDAkAgBiAERw0AQQAgAjYCoNCAgABBAEEAKAKU0ICAACADaiIDNgKU0ICAACACIANBAXI2AgQMAwsCQCAGQQAoApzQgIAARw0AQQAgAjYCnNCAgABBAEEAKAKQ0ICAACADaiIDNgKQ0ICAACACIANBAXI2AgQgAiADaiADNgIADAMLAkAgBigCBCIEQQNxQQFHDQAgBEF4cSEHAkACQCAEQf8BSw0AIAYoAggiBSAEQQN2IghBA3RBsNCAgABqIgBGGgJAIAYoAgwiBCAFRw0AQQBBACgCiNCAgABBfiAId3E2AojQgIAADAILIAQgAEYaIAQgBTYCCCAFIAQ2AgwMAQsgBigCGCEJAkACQCAGKAIMIgAgBkYNACAGKAIIIgQgCEkaIAAgBDYCCCAEIAA2AgwMAQsCQCAGQRRqIgQoAgAiBQ0AIAZBEGoiBCgCACIFDQBBACEADAELA0AgBCEIIAUiAEEUaiIEKAIAIgUNACAAQRBqIQQgACgCECIFDQALIAhBADYCAAsgCUUNAAJAAkAgBiAGKAIcIgVBAnRBuNKAgABqIgQoAgBHDQAgBCAANgIAIAANAUEAQQAoAozQgIAAQX4gBXdxNgKM0ICAAAwCCyAJQRBBFCAJKAIQIAZGG2ogADYCACAARQ0BCyAAIAk2AhgCQCAGKAIQIgRFDQAgACAENgIQIAQgADYCGAsgBigCFCIERQ0AIABBFGogBDYCACAEIAA2AhgLIAcgA2ohAyAGIAdqIgYoAgQhBAsgBiAEQX5xNgIEIAIgA2ogAzYCACACIANBAXI2AgQCQCADQf8BSw0AIANBeHFBsNCAgABqIQQCQAJAQQAoAojQgIAAIgVBASADQQN2dCIDcQ0AQQAgBSADcjYCiNCAgAAgBCEDDAELIAQoAgghAwsgAyACNgIMIAQgAjYCCCACIAQ2AgwgAiADNgIIDAMLQR8hBAJAIANB////B0sNACADQQh2IgQgBEGA/j9qQRB2QQhxIgR0IgUgBUGA4B9qQRB2QQRxIgV0IgAgAEGAgA9qQRB2QQJxIgB0QQ92IAQgBXIgAHJrIgRBAXQgAyAEQRVqdkEBcXJBHGohBAsgAiAENgIcIAJCADcCECAEQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiAEEBIAR0IghxDQAgBSACNgIAQQAgACAIcjYCjNCAgAAgAiAFNgIYIAIgAjYCCCACIAI2AgwMAwsgA0EAQRkgBEEBdmsgBEEfRht0IQQgBSgCACEAA0AgACIFKAIEQXhxIANGDQIgBEEddiEAIARBAXQhBCAFIABBBHFqQRBqIggoAgAiAA0ACyAIIAI2AgAgAiAFNgIYIAIgAjYCDCACIAI2AggMAgsgAEF4IABrQQ9xQQAgAEEIakEPcRsiA2oiCyAGQUhqIgggA2siA0EBcjYCBCAAIAhqQTg2AgQgBCAFQTcgBWtBD3FBACAFQUlqQQ9xG2pBQWoiCCAIIARBEGpJGyIIQSM2AgRBAEEAKALw04CAADYCpNCAgABBACADNgKU0ICAAEEAIAs2AqDQgIAAIAhBEGpBACkC0NOAgAA3AgAgCEEAKQLI04CAADcCCEEAIAhBCGo2AtDTgIAAQQAgBjYCzNOAgABBACAANgLI04CAAEEAQQA2AtTTgIAAIAhBJGohAwNAIANBBzYCACADQQRqIgMgBUkNAAsgCCAERg0DIAggCCgCBEF+cTYCBCAIIAggBGsiADYCACAEIABBAXI2AgQCQCAAQf8BSw0AIABBeHFBsNCAgABqIQMCQAJAQQAoAojQgIAAIgVBASAAQQN2dCIAcQ0AQQAgBSAAcjYCiNCAgAAgAyEFDAELIAMoAgghBQsgBSAENgIMIAMgBDYCCCAEIAM2AgwgBCAFNgIIDAQLQR8hAwJAIABB////B0sNACAAQQh2IgMgA0GA/j9qQRB2QQhxIgN0IgUgBUGA4B9qQRB2QQRxIgV0IgggCEGAgA9qQRB2QQJxIgh0QQ92IAMgBXIgCHJrIgNBAXQgACADQRVqdkEBcXJBHGohAwsgBCADNgIcIARCADcCECADQQJ0QbjSgIAAaiEFAkBBACgCjNCAgAAiCEEBIAN0IgZxDQAgBSAENgIAQQAgCCAGcjYCjNCAgAAgBCAFNgIYIAQgBDYCCCAEIAQ2AgwMBAsgAEEAQRkgA0EBdmsgA0EfRht0IQMgBSgCACEIA0AgCCIFKAIEQXhxIABGDQMgA0EddiEIIANBAXQhAyAFIAhBBHFqQRBqIgYoAgAiCA0ACyAGIAQ2AgAgBCAFNgIYIAQgBDYCDCAEIAQ2AggMAwsgBSgCCCIDIAI2AgwgBSACNgIIIAJBADYCGCACIAU2AgwgAiADNgIICyALQQhqIQMMBQsgBSgCCCIDIAQ2AgwgBSAENgIIIARBADYCGCAEIAU2AgwgBCADNgIIC0EAKAKU0ICAACIDIAJNDQBBACgCoNCAgAAiBCACaiIFIAMgAmsiA0EBcjYCBEEAIAM2ApTQgIAAQQAgBTYCoNCAgAAgBCACQQNyNgIEIARBCGohAwwDC0EAIQNBAEEwNgL404CAAAwCCwJAIAtFDQACQAJAIAggCCgCHCIFQQJ0QbjSgIAAaiIDKAIARw0AIAMgADYCACAADQFBACAHQX4gBXdxIgc2AozQgIAADAILIAtBEEEUIAsoAhAgCEYbaiAANgIAIABFDQELIAAgCzYCGAJAIAgoAhAiA0UNACAAIAM2AhAgAyAANgIYCyAIQRRqKAIAIgNFDQAgAEEUaiADNgIAIAMgADYCGAsCQAJAIARBD0sNACAIIAQgAmoiA0EDcjYCBCAIIANqIgMgAygCBEEBcjYCBAwBCyAIIAJqIgAgBEEBcjYCBCAIIAJBA3I2AgQgACAEaiAENgIAAkAgBEH/AUsNACAEQXhxQbDQgIAAaiEDAkACQEEAKAKI0ICAACIFQQEgBEEDdnQiBHENAEEAIAUgBHI2AojQgIAAIAMhBAwBCyADKAIIIQQLIAQgADYCDCADIAA2AgggACADNgIMIAAgBDYCCAwBC0EfIQMCQCAEQf///wdLDQAgBEEIdiIDIANBgP4/akEQdkEIcSIDdCIFIAVBgOAfakEQdkEEcSIFdCICIAJBgIAPakEQdkECcSICdEEPdiADIAVyIAJyayIDQQF0IAQgA0EVanZBAXFyQRxqIQMLIAAgAzYCHCAAQgA3AhAgA0ECdEG40oCAAGohBQJAIAdBASADdCICcQ0AIAUgADYCAEEAIAcgAnI2AozQgIAAIAAgBTYCGCAAIAA2AgggACAANgIMDAELIARBAEEZIANBAXZrIANBH0YbdCEDIAUoAgAhAgJAA0AgAiIFKAIEQXhxIARGDQEgA0EddiECIANBAXQhAyAFIAJBBHFqQRBqIgYoAgAiAg0ACyAGIAA2AgAgACAFNgIYIAAgADYCDCAAIAA2AggMAQsgBSgCCCIDIAA2AgwgBSAANgIIIABBADYCGCAAIAU2AgwgACADNgIICyAIQQhqIQMMAQsCQCAKRQ0AAkACQCAAIAAoAhwiBUECdEG40oCAAGoiAygCAEcNACADIAg2AgAgCA0BQQAgCUF+IAV3cTYCjNCAgAAMAgsgCkEQQRQgCigCECAARhtqIAg2AgAgCEUNAQsgCCAKNgIYAkAgACgCECIDRQ0AIAggAzYCECADIAg2AhgLIABBFGooAgAiA0UNACAIQRRqIAM2AgAgAyAINgIYCwJAAkAgBEEPSw0AIAAgBCACaiIDQQNyNgIEIAAgA2oiAyADKAIEQQFyNgIEDAELIAAgAmoiBSAEQQFyNgIEIAAgAkEDcjYCBCAFIARqIAQ2AgACQCAHRQ0AIAdBeHFBsNCAgABqIQJBACgCnNCAgAAhAwJAAkBBASAHQQN2dCIIIAZxDQBBACAIIAZyNgKI0ICAACACIQgMAQsgAigCCCEICyAIIAM2AgwgAiADNgIIIAMgAjYCDCADIAg2AggLQQAgBTYCnNCAgABBACAENgKQ0ICAAAsgAEEIaiEDCyABQRBqJICAgIAAIAMLCgAgABDJgICAAAviDQEHfwJAIABFDQAgAEF4aiIBIABBfGooAgAiAkF4cSIAaiEDAkAgAkEBcQ0AIAJBA3FFDQEgASABKAIAIgJrIgFBACgCmNCAgAAiBEkNASACIABqIQACQCABQQAoApzQgIAARg0AAkAgAkH/AUsNACABKAIIIgQgAkEDdiIFQQN0QbDQgIAAaiIGRhoCQCABKAIMIgIgBEcNAEEAQQAoAojQgIAAQX4gBXdxNgKI0ICAAAwDCyACIAZGGiACIAQ2AgggBCACNgIMDAILIAEoAhghBwJAAkAgASgCDCIGIAFGDQAgASgCCCICIARJGiAGIAI2AgggAiAGNgIMDAELAkAgAUEUaiICKAIAIgQNACABQRBqIgIoAgAiBA0AQQAhBgwBCwNAIAIhBSAEIgZBFGoiAigCACIEDQAgBkEQaiECIAYoAhAiBA0ACyAFQQA2AgALIAdFDQECQAJAIAEgASgCHCIEQQJ0QbjSgIAAaiICKAIARw0AIAIgBjYCACAGDQFBAEEAKAKM0ICAAEF+IAR3cTYCjNCAgAAMAwsgB0EQQRQgBygCECABRhtqIAY2AgAgBkUNAgsgBiAHNgIYAkAgASgCECICRQ0AIAYgAjYCECACIAY2AhgLIAEoAhQiAkUNASAGQRRqIAI2AgAgAiAGNgIYDAELIAMoAgQiAkEDcUEDRw0AIAMgAkF+cTYCBEEAIAA2ApDQgIAAIAEgAGogADYCACABIABBAXI2AgQPCyABIANPDQAgAygCBCICQQFxRQ0AAkACQCACQQJxDQACQCADQQAoAqDQgIAARw0AQQAgATYCoNCAgABBAEEAKAKU0ICAACAAaiIANgKU0ICAACABIABBAXI2AgQgAUEAKAKc0ICAAEcNA0EAQQA2ApDQgIAAQQBBADYCnNCAgAAPCwJAIANBACgCnNCAgABHDQBBACABNgKc0ICAAEEAQQAoApDQgIAAIABqIgA2ApDQgIAAIAEgAEEBcjYCBCABIABqIAA2AgAPCyACQXhxIABqIQACQAJAIAJB/wFLDQAgAygCCCIEIAJBA3YiBUEDdEGw0ICAAGoiBkYaAkAgAygCDCICIARHDQBBAEEAKAKI0ICAAEF+IAV3cTYCiNCAgAAMAgsgAiAGRhogAiAENgIIIAQgAjYCDAwBCyADKAIYIQcCQAJAIAMoAgwiBiADRg0AIAMoAggiAkEAKAKY0ICAAEkaIAYgAjYCCCACIAY2AgwMAQsCQCADQRRqIgIoAgAiBA0AIANBEGoiAigCACIEDQBBACEGDAELA0AgAiEFIAQiBkEUaiICKAIAIgQNACAGQRBqIQIgBigCECIEDQALIAVBADYCAAsgB0UNAAJAAkAgAyADKAIcIgRBAnRBuNKAgABqIgIoAgBHDQAgAiAGNgIAIAYNAUEAQQAoAozQgIAAQX4gBHdxNgKM0ICAAAwCCyAHQRBBFCAHKAIQIANGG2ogBjYCACAGRQ0BCyAGIAc2AhgCQCADKAIQIgJFDQAgBiACNgIQIAIgBjYCGAsgAygCFCICRQ0AIAZBFGogAjYCACACIAY2AhgLIAEgAGogADYCACABIABBAXI2AgQgAUEAKAKc0ICAAEcNAUEAIAA2ApDQgIAADwsgAyACQX5xNgIEIAEgAGogADYCACABIABBAXI2AgQLAkAgAEH/AUsNACAAQXhxQbDQgIAAaiECAkACQEEAKAKI0ICAACIEQQEgAEEDdnQiAHENAEEAIAQgAHI2AojQgIAAIAIhAAwBCyACKAIIIQALIAAgATYCDCACIAE2AgggASACNgIMIAEgADYCCA8LQR8hAgJAIABB////B0sNACAAQQh2IgIgAkGA/j9qQRB2QQhxIgJ0IgQgBEGA4B9qQRB2QQRxIgR0IgYgBkGAgA9qQRB2QQJxIgZ0QQ92IAIgBHIgBnJrIgJBAXQgACACQRVqdkEBcXJBHGohAgsgASACNgIcIAFCADcCECACQQJ0QbjSgIAAaiEEAkACQEEAKAKM0ICAACIGQQEgAnQiA3ENACAEIAE2AgBBACAGIANyNgKM0ICAACABIAQ2AhggASABNgIIIAEgATYCDAwBCyAAQQBBGSACQQF2ayACQR9GG3QhAiAEKAIAIQYCQANAIAYiBCgCBEF4cSAARg0BIAJBHXYhBiACQQF0IQIgBCAGQQRxakEQaiIDKAIAIgYNAAsgAyABNgIAIAEgBDYCGCABIAE2AgwgASABNgIIDAELIAQoAggiACABNgIMIAQgATYCCCABQQA2AhggASAENgIMIAEgADYCCAtBAEEAKAKo0ICAAEF/aiIBQX8gARs2AqjQgIAACwsEAAAAC04AAkAgAA0APwBBEHQPCwJAIABB//8DcQ0AIABBf0wNAAJAIABBEHZAACIAQX9HDQBBAEEwNgL404CAAEF/DwsgAEEQdA8LEMqAgIAAAAvyAgIDfwF+AkAgAkUNACAAIAE6AAAgAiAAaiIDQX9qIAE6AAAgAkEDSQ0AIAAgAToAAiAAIAE6AAEgA0F9aiABOgAAIANBfmogAToAACACQQdJDQAgACABOgADIANBfGogAToAACACQQlJDQAgAEEAIABrQQNxIgRqIgMgAUH/AXFBgYKECGwiATYCACADIAIgBGtBfHEiBGoiAkF8aiABNgIAIARBCUkNACADIAE2AgggAyABNgIEIAJBeGogATYCACACQXRqIAE2AgAgBEEZSQ0AIAMgATYCGCADIAE2AhQgAyABNgIQIAMgATYCDCACQXBqIAE2AgAgAkFsaiABNgIAIAJBaGogATYCACACQWRqIAE2AgAgBCADQQRxQRhyIgVrIgJBIEkNACABrUKBgICAEH4hBiADIAVqIQEDQCABIAY3AxggASAGNwMQIAEgBjcDCCABIAY3AwAgAUEgaiEBIAJBYGoiAkEfSw0ACwsgAAsLjkgBAEGACAuGSAEAAAACAAAAAwAAAAAAAAAAAAAABAAAAAUAAAAAAAAAAAAAAAYAAAAHAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW52YWxpZCBjaGFyIGluIHVybCBxdWVyeQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2JvZHkAQ29udGVudC1MZW5ndGggb3ZlcmZsb3cAQ2h1bmsgc2l6ZSBvdmVyZmxvdwBSZXNwb25zZSBvdmVyZmxvdwBJbnZhbGlkIG1ldGhvZCBmb3IgSFRUUC94LnggcmVxdWVzdABJbnZhbGlkIG1ldGhvZCBmb3IgUlRTUC94LnggcmVxdWVzdABFeHBlY3RlZCBTT1VSQ0UgbWV0aG9kIGZvciBJQ0UveC54IHJlcXVlc3QASW52YWxpZCBjaGFyIGluIHVybCBmcmFnbWVudCBzdGFydABFeHBlY3RlZCBkb3QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9zdGF0dXMASW52YWxpZCByZXNwb25zZSBzdGF0dXMASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucwBVc2VyIGNhbGxiYWNrIGVycm9yAGBvbl9yZXNldGAgY2FsbGJhY2sgZXJyb3IAYG9uX2NodW5rX2hlYWRlcmAgY2FsbGJhY2sgZXJyb3IAYG9uX21lc3NhZ2VfYmVnaW5gIGNhbGxiYWNrIGVycm9yAGBvbl9jaHVua19leHRlbnNpb25fdmFsdWVgIGNhbGxiYWNrIGVycm9yAGBvbl9zdGF0dXNfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl92ZXJzaW9uX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fdXJsX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGVgIGNhbGxiYWNrIGVycm9yAGBvbl9tZXNzYWdlX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fbWV0aG9kX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlYCBjYWxsYmFjayBlcnJvcgBgb25fY2h1bmtfZXh0ZW5zaW9uX25hbWVgIGNhbGxiYWNrIGVycm9yAFVuZXhwZWN0ZWQgY2hhciBpbiB1cmwgc2VydmVyAEludmFsaWQgaGVhZGVyIHZhbHVlIGNoYXIASW52YWxpZCBoZWFkZXIgZmllbGQgY2hhcgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3ZlcnNpb24ASW52YWxpZCBtaW5vciB2ZXJzaW9uAEludmFsaWQgbWFqb3IgdmVyc2lvbgBFeHBlY3RlZCBzcGFjZSBhZnRlciB2ZXJzaW9uAEV4cGVjdGVkIENSTEYgYWZ0ZXIgdmVyc2lvbgBJbnZhbGlkIEhUVFAgdmVyc2lvbgBJbnZhbGlkIGhlYWRlciB0b2tlbgBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX3VybABJbnZhbGlkIGNoYXJhY3RlcnMgaW4gdXJsAFVuZXhwZWN0ZWQgc3RhcnQgY2hhciBpbiB1cmwARG91YmxlIEAgaW4gdXJsAEVtcHR5IENvbnRlbnQtTGVuZ3RoAEludmFsaWQgY2hhcmFjdGVyIGluIENvbnRlbnQtTGVuZ3RoAER1cGxpY2F0ZSBDb250ZW50LUxlbmd0aABJbnZhbGlkIGNoYXIgaW4gdXJsIHBhdGgAQ29udGVudC1MZW5ndGggY2FuJ3QgYmUgcHJlc2VudCB3aXRoIFRyYW5zZmVyLUVuY29kaW5nAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIHNpemUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfdmFsdWUAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9jaHVua19leHRlbnNpb25fdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyB2YWx1ZQBNaXNzaW5nIGV4cGVjdGVkIExGIGFmdGVyIGhlYWRlciB2YWx1ZQBJbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AgaGVhZGVyIHZhbHVlAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgcXVvdGUgdmFsdWUASW52YWxpZCBjaGFyYWN0ZXIgaW4gY2h1bmsgZXh0ZW5zaW9ucyBxdW90ZWQgdmFsdWUAUGF1c2VkIGJ5IG9uX2hlYWRlcnNfY29tcGxldGUASW52YWxpZCBFT0Ygc3RhdGUAb25fcmVzZXQgcGF1c2UAb25fY2h1bmtfaGVhZGVyIHBhdXNlAG9uX21lc3NhZ2VfYmVnaW4gcGF1c2UAb25fY2h1bmtfZXh0ZW5zaW9uX3ZhbHVlIHBhdXNlAG9uX3N0YXR1c19jb21wbGV0ZSBwYXVzZQBvbl92ZXJzaW9uX2NvbXBsZXRlIHBhdXNlAG9uX3VybF9jb21wbGV0ZSBwYXVzZQBvbl9jaHVua19jb21wbGV0ZSBwYXVzZQBvbl9oZWFkZXJfdmFsdWVfY29tcGxldGUgcGF1c2UAb25fbWVzc2FnZV9jb21wbGV0ZSBwYXVzZQBvbl9tZXRob2RfY29tcGxldGUgcGF1c2UAb25faGVhZGVyX2ZpZWxkX2NvbXBsZXRlIHBhdXNlAG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lIHBhdXNlAFVuZXhwZWN0ZWQgc3BhY2UgYWZ0ZXIgc3RhcnQgbGluZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX2NodW5rX2V4dGVuc2lvbl9uYW1lAEludmFsaWQgY2hhcmFjdGVyIGluIGNodW5rIGV4dGVuc2lvbnMgbmFtZQBQYXVzZSBvbiBDT05ORUNUL1VwZ3JhZGUAUGF1c2Ugb24gUFJJL1VwZ3JhZGUARXhwZWN0ZWQgSFRUUC8yIENvbm5lY3Rpb24gUHJlZmFjZQBTcGFuIGNhbGxiYWNrIGVycm9yIGluIG9uX21ldGhvZABFeHBlY3RlZCBzcGFjZSBhZnRlciBtZXRob2QAU3BhbiBjYWxsYmFjayBlcnJvciBpbiBvbl9oZWFkZXJfZmllbGQAUGF1c2VkAEludmFsaWQgd29yZCBlbmNvdW50ZXJlZABJbnZhbGlkIG1ldGhvZCBlbmNvdW50ZXJlZABVbmV4cGVjdGVkIGNoYXIgaW4gdXJsIHNjaGVtYQBSZXF1ZXN0IGhhcyBpbnZhbGlkIGBUcmFuc2Zlci1FbmNvZGluZ2AAU1dJVENIX1BST1hZAFVTRV9QUk9YWQBNS0FDVElWSVRZAFVOUFJPQ0VTU0FCTEVfRU5USVRZAENPUFkATU9WRURfUEVSTUFORU5UTFkAVE9PX0VBUkxZAE5PVElGWQBGQUlMRURfREVQRU5ERU5DWQBCQURfR0FURVdBWQBQTEFZAFBVVABDSEVDS09VVABHQVRFV0FZX1RJTUVPVVQAUkVRVUVTVF9USU1FT1VUAE5FVFdPUktfQ09OTkVDVF9USU1FT1VUAENPTk5FQ1RJT05fVElNRU9VVABMT0dJTl9USU1FT1VUAE5FVFdPUktfUkVBRF9USU1FT1VUAFBPU1QATUlTRElSRUNURURfUkVRVUVTVABDTElFTlRfQ0xPU0VEX1JFUVVFU1QAQ0xJRU5UX0NMT1NFRF9MT0FEX0JBTEFOQ0VEX1JFUVVFU1QAQkFEX1JFUVVFU1QASFRUUF9SRVFVRVNUX1NFTlRfVE9fSFRUUFNfUE9SVABSRVBPUlQASU1fQV9URUFQT1QAUkVTRVRfQ09OVEVOVABOT19DT05URU5UAFBBUlRJQUxfQ09OVEVOVABIUEVfSU5WQUxJRF9DT05TVEFOVABIUEVfQ0JfUkVTRVQAR0VUAEhQRV9TVFJJQ1QAQ09ORkxJQ1QAVEVNUE9SQVJZX1JFRElSRUNUAFBFUk1BTkVOVF9SRURJUkVDVABDT05ORUNUAE1VTFRJX1NUQVRVUwBIUEVfSU5WQUxJRF9TVEFUVVMAVE9PX01BTllfUkVRVUVTVFMARUFSTFlfSElOVFMAVU5BVkFJTEFCTEVfRk9SX0xFR0FMX1JFQVNPTlMAT1BUSU9OUwBTV0lUQ0hJTkdfUFJPVE9DT0xTAFZBUklBTlRfQUxTT19ORUdPVElBVEVTAE1VTFRJUExFX0NIT0lDRVMASU5URVJOQUxfU0VSVkVSX0VSUk9SAFdFQl9TRVJWRVJfVU5LTk9XTl9FUlJPUgBSQUlMR1VOX0VSUk9SAElERU5USVRZX1BST1ZJREVSX0FVVEhFTlRJQ0FUSU9OX0VSUk9SAFNTTF9DRVJUSUZJQ0FURV9FUlJPUgBJTlZBTElEX1hfRk9SV0FSREVEX0ZPUgBTRVRfUEFSQU1FVEVSAEdFVF9QQVJBTUVURVIASFBFX1VTRVIAU0VFX09USEVSAEhQRV9DQl9DSFVOS19IRUFERVIATUtDQUxFTkRBUgBTRVRVUABXRUJfU0VSVkVSX0lTX0RPV04AVEVBUkRPV04ASFBFX0NMT1NFRF9DT05ORUNUSU9OAEhFVVJJU1RJQ19FWFBJUkFUSU9OAERJU0NPTk5FQ1RFRF9PUEVSQVRJT04ATk9OX0FVVEhPUklUQVRJVkVfSU5GT1JNQVRJT04ASFBFX0lOVkFMSURfVkVSU0lPTgBIUEVfQ0JfTUVTU0FHRV9CRUdJTgBTSVRFX0lTX0ZST1pFTgBIUEVfSU5WQUxJRF9IRUFERVJfVE9LRU4ASU5WQUxJRF9UT0tFTgBGT1JCSURERU4ARU5IQU5DRV9ZT1VSX0NBTE0ASFBFX0lOVkFMSURfVVJMAEJMT0NLRURfQllfUEFSRU5UQUxfQ09OVFJPTABNS0NPTABBQ0wASFBFX0lOVEVSTkFMAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0VfVU5PRkZJQ0lBTABIUEVfT0sAVU5MSU5LAFVOTE9DSwBQUkkAUkVUUllfV0lUSABIUEVfSU5WQUxJRF9DT05URU5UX0xFTkdUSABIUEVfVU5FWFBFQ1RFRF9DT05URU5UX0xFTkdUSABGTFVTSABQUk9QUEFUQ0gATS1TRUFSQ0gAVVJJX1RPT19MT05HAFBST0NFU1NJTkcATUlTQ0VMTEFORU9VU19QRVJTSVNURU5UX1dBUk5JTkcATUlTQ0VMTEFORU9VU19XQVJOSU5HAEhQRV9JTlZBTElEX1RSQU5TRkVSX0VOQ09ESU5HAEV4cGVjdGVkIENSTEYASFBFX0lOVkFMSURfQ0hVTktfU0laRQBNT1ZFAENPTlRJTlVFAEhQRV9DQl9TVEFUVVNfQ09NUExFVEUASFBFX0NCX0hFQURFUlNfQ09NUExFVEUASFBFX0NCX1ZFUlNJT05fQ09NUExFVEUASFBFX0NCX1VSTF9DT01QTEVURQBIUEVfQ0JfQ0hVTktfQ09NUExFVEUASFBFX0NCX0hFQURFUl9WQUxVRV9DT01QTEVURQBIUEVfQ0JfQ0hVTktfRVhURU5TSU9OX1ZBTFVFX0NPTVBMRVRFAEhQRV9DQl9DSFVOS19FWFRFTlNJT05fTkFNRV9DT01QTEVURQBIUEVfQ0JfTUVTU0FHRV9DT01QTEVURQBIUEVfQ0JfTUVUSE9EX0NPTVBMRVRFAEhQRV9DQl9IRUFERVJfRklFTERfQ09NUExFVEUAREVMRVRFAEhQRV9JTlZBTElEX0VPRl9TVEFURQBJTlZBTElEX1NTTF9DRVJUSUZJQ0FURQBQQVVTRQBOT19SRVNQT05TRQBVTlNVUFBPUlRFRF9NRURJQV9UWVBFAEdPTkUATk9UX0FDQ0VQVEFCTEUAU0VSVklDRV9VTkFWQUlMQUJMRQBSQU5HRV9OT1RfU0FUSVNGSUFCTEUAT1JJR0lOX0lTX1VOUkVBQ0hBQkxFAFJFU1BPTlNFX0lTX1NUQUxFAFBVUkdFAE1FUkdFAFJFUVVFU1RfSEVBREVSX0ZJRUxEU19UT09fTEFSR0UAUkVRVUVTVF9IRUFERVJfVE9PX0xBUkdFAFBBWUxPQURfVE9PX0xBUkdFAElOU1VGRklDSUVOVF9TVE9SQUdFAEhQRV9QQVVTRURfVVBHUkFERQBIUEVfUEFVU0VEX0gyX1VQR1JBREUAU09VUkNFAEFOTk9VTkNFAFRSQUNFAEhQRV9VTkVYUEVDVEVEX1NQQUNFAERFU0NSSUJFAFVOU1VCU0NSSUJFAFJFQ09SRABIUEVfSU5WQUxJRF9NRVRIT0QATk9UX0ZPVU5EAFBST1BGSU5EAFVOQklORABSRUJJTkQAVU5BVVRIT1JJWkVEAE1FVEhPRF9OT1RfQUxMT1dFRABIVFRQX1ZFUlNJT05fTk9UX1NVUFBPUlRFRABBTFJFQURZX1JFUE9SVEVEAEFDQ0VQVEVEAE5PVF9JTVBMRU1FTlRFRABMT09QX0RFVEVDVEVEAEhQRV9DUl9FWFBFQ1RFRABIUEVfTEZfRVhQRUNURUQAQ1JFQVRFRABJTV9VU0VEAEhQRV9QQVVTRUQAVElNRU9VVF9PQ0NVUkVEAFBBWU1FTlRfUkVRVUlSRUQAUFJFQ09ORElUSU9OX1JFUVVJUkVEAFBST1hZX0FVVEhFTlRJQ0FUSU9OX1JFUVVJUkVEAE5FVFdPUktfQVVUSEVOVElDQVRJT05fUkVRVUlSRUQATEVOR1RIX1JFUVVJUkVEAFNTTF9DRVJUSUZJQ0FURV9SRVFVSVJFRABVUEdSQURFX1JFUVVJUkVEAFBBR0VfRVhQSVJFRABQUkVDT05ESVRJT05fRkFJTEVEAEVYUEVDVEFUSU9OX0ZBSUxFRABSRVZBTElEQVRJT05fRkFJTEVEAFNTTF9IQU5EU0hBS0VfRkFJTEVEAExPQ0tFRABUUkFOU0ZPUk1BVElPTl9BUFBMSUVEAE5PVF9NT0RJRklFRABOT1RfRVhURU5ERUQAQkFORFdJRFRIX0xJTUlUX0VYQ0VFREVEAFNJVEVfSVNfT1ZFUkxPQURFRABIRUFEAEV4cGVjdGVkIEhUVFAvAABeEwAAJhMAADAQAADwFwAAnRMAABUSAAA5FwAA8BIAAAoQAAB1EgAArRIAAIITAABPFAAAfxAAAKAVAAAjFAAAiRIAAIsUAABNFQAA1BEAAM8UAAAQGAAAyRYAANwWAADBEQAA4BcAALsUAAB0FAAAfBUAAOUUAAAIFwAAHxAAAGUVAACjFAAAKBUAAAIVAACZFQAALBAAAIsZAABPDwAA1A4AAGoQAADOEAAAAhcAAIkOAABuEwAAHBMAAGYUAABWFwAAwRMAAM0TAABsEwAAaBcAAGYXAABfFwAAIhMAAM4PAABpDgAA2A4AAGMWAADLEwAAqg4AACgXAAAmFwAAxRMAAF0WAADoEQAAZxMAAGUTAADyFgAAcxMAAB0XAAD5FgAA8xEAAM8OAADOFQAADBIAALMRAAClEQAAYRAAADIXAAC7EwAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgMCAgICAgAAAgIAAgIAAgICAgICAgICAgAEAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAIAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAgICAgIAAAICAAICAAICAgICAgICAgIAAwAEAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgIAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgACAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABsb3NlZWVwLWFsaXZlAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQEBAQEBAQEBAQEBAgEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFjaHVua2VkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAQABAQEBAQAAAQEAAQEAAQEBAQEBAQEBAQAAAAAAAAABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGVjdGlvbmVudC1sZW5ndGhvbnJveHktY29ubmVjdGlvbgAAAAAAAAAAAAAAAAAAAHJhbnNmZXItZW5jb2RpbmdwZ3JhZGUNCg0KDQpTTQ0KDQpUVFAvQ0UvVFNQLwAAAAAAAAAAAAAAAAECAAEDAAAAAAAAAAAAAAAAAAAAAAAABAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAABAgABAwAAAAAAAAAAAAAAAAAAAAAAAAQBAQUBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAQEAAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQABAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQAAAAAAAAAAAAABAAACAAAAAAAAAAAAAAAAAAAAAAAAAwQAAAQEBAQEBAQEBAQEBQQEBAQEBAQEBAQEBAAEAAYHBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAQABAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAQAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAgAAAAACAAAAAAAAAAAAAAAAAAAAAAADAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwAAAAAAAAMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE5PVU5DRUVDS09VVE5FQ1RFVEVDUklCRUxVU0hFVEVBRFNFQVJDSFJHRUNUSVZJVFlMRU5EQVJWRU9USUZZUFRJT05TQ0hTRUFZU1RBVENIR0VPUkRJUkVDVE9SVFJDSFBBUkFNRVRFUlVSQ0VCU0NSSUJFQVJET1dOQUNFSU5ETktDS1VCU0NSSUJFSFRUUC9BRFRQLw=='\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.enumToMap = void 0;\nfunction enumToMap(obj) {\n const res = {};\n Object.keys(obj).forEach((key) => {\n const value = obj[key];\n if (typeof value === 'number') {\n res[key] = value;\n }\n });\n return res;\n}\nexports.enumToMap = enumToMap;\n//# sourceMappingURL=utils.js.map","'use strict'\n\nconst { kClients } = require('../core/symbols')\nconst Agent = require('../agent')\nconst {\n kAgent,\n kMockAgentSet,\n kMockAgentGet,\n kDispatches,\n kIsMockActive,\n kNetConnect,\n kGetNetConnect,\n kOptions,\n kFactory\n} = require('./mock-symbols')\nconst MockClient = require('./mock-client')\nconst MockPool = require('./mock-pool')\nconst { matchValue, buildMockOptions } = require('./mock-utils')\nconst { InvalidArgumentError, UndiciError } = require('../core/errors')\nconst Dispatcher = require('../dispatcher')\nconst Pluralizer = require('./pluralizer')\nconst PendingInterceptorsFormatter = require('./pending-interceptors-formatter')\n\nclass FakeWeakRef {\n constructor (value) {\n this.value = value\n }\n\n deref () {\n return this.value\n }\n}\n\nclass MockAgent extends Dispatcher {\n constructor (opts) {\n super(opts)\n\n this[kNetConnect] = true\n this[kIsMockActive] = true\n\n // Instantiate Agent and encapsulate\n if ((opts && opts.agent && typeof opts.agent.dispatch !== 'function')) {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n const agent = opts && opts.agent ? opts.agent : new Agent(opts)\n this[kAgent] = agent\n\n this[kClients] = agent[kClients]\n this[kOptions] = buildMockOptions(opts)\n }\n\n get (origin) {\n let dispatcher = this[kMockAgentGet](origin)\n\n if (!dispatcher) {\n dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n }\n return dispatcher\n }\n\n dispatch (opts, handler) {\n // Call MockAgent.get to perform additional setup before dispatching as normal\n this.get(opts.origin)\n return this[kAgent].dispatch(opts, handler)\n }\n\n async close () {\n await this[kAgent].close()\n this[kClients].clear()\n }\n\n deactivate () {\n this[kIsMockActive] = false\n }\n\n activate () {\n this[kIsMockActive] = true\n }\n\n enableNetConnect (matcher) {\n if (typeof matcher === 'string' || typeof matcher === 'function' || matcher instanceof RegExp) {\n if (Array.isArray(this[kNetConnect])) {\n this[kNetConnect].push(matcher)\n } else {\n this[kNetConnect] = [matcher]\n }\n } else if (typeof matcher === 'undefined') {\n this[kNetConnect] = true\n } else {\n throw new InvalidArgumentError('Unsupported matcher. Must be one of String|Function|RegExp.')\n }\n }\n\n disableNetConnect () {\n this[kNetConnect] = false\n }\n\n // This is required to bypass issues caused by using global symbols - see:\n // https://github.com/nodejs/undici/issues/1447\n get isMockActive () {\n return this[kIsMockActive]\n }\n\n [kMockAgentSet] (origin, dispatcher) {\n this[kClients].set(origin, new FakeWeakRef(dispatcher))\n }\n\n [kFactory] (origin) {\n const mockOptions = Object.assign({ agent: this }, this[kOptions])\n return this[kOptions] && this[kOptions].connections === 1\n ? new MockClient(origin, mockOptions)\n : new MockPool(origin, mockOptions)\n }\n\n [kMockAgentGet] (origin) {\n // First check if we can immediately find it\n const ref = this[kClients].get(origin)\n if (ref) {\n return ref.deref()\n }\n\n // If the origin is not a string create a dummy parent pool and return to user\n if (typeof origin !== 'string') {\n const dispatcher = this[kFactory]('http://localhost:9999')\n this[kMockAgentSet](origin, dispatcher)\n return dispatcher\n }\n\n // If we match, create a pool and assign the same dispatches\n for (const [keyMatcher, nonExplicitRef] of Array.from(this[kClients])) {\n const nonExplicitDispatcher = nonExplicitRef.deref()\n if (nonExplicitDispatcher && typeof keyMatcher !== 'string' && matchValue(keyMatcher, origin)) {\n const dispatcher = this[kFactory](origin)\n this[kMockAgentSet](origin, dispatcher)\n dispatcher[kDispatches] = nonExplicitDispatcher[kDispatches]\n return dispatcher\n }\n }\n }\n\n [kGetNetConnect] () {\n return this[kNetConnect]\n }\n\n pendingInterceptors () {\n const mockAgentClients = this[kClients]\n\n return Array.from(mockAgentClients.entries())\n .flatMap(([origin, scope]) => scope.deref()[kDispatches].map(dispatch => ({ ...dispatch, origin })))\n .filter(({ pending }) => pending)\n }\n\n assertNoPendingInterceptors ({ pendingInterceptorsFormatter = new PendingInterceptorsFormatter() } = {}) {\n const pending = this.pendingInterceptors()\n\n if (pending.length === 0) {\n return\n }\n\n const pluralizer = new Pluralizer('interceptor', 'interceptors').pluralize(pending.length)\n\n throw new UndiciError(`\n${pluralizer.count} ${pluralizer.noun} ${pluralizer.is} pending:\n\n${pendingInterceptorsFormatter.format(pending)}\n`.trim())\n }\n}\n\nmodule.exports = MockAgent\n","'use strict'\n\nconst { promisify } = require('util')\nconst Client = require('../client')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockClient provides an API that extends the Client to influence the mockDispatches.\n */\nclass MockClient extends Client {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockClient\n","'use strict'\n\nconst { UndiciError } = require('../core/errors')\n\nclass MockNotMatchedError extends UndiciError {\n constructor (message) {\n super(message)\n Error.captureStackTrace(this, MockNotMatchedError)\n this.name = 'MockNotMatchedError'\n this.message = message || 'The request does not match any registered mock dispatches'\n this.code = 'UND_MOCK_ERR_MOCK_NOT_MATCHED'\n }\n}\n\nmodule.exports = {\n MockNotMatchedError\n}\n","'use strict'\n\nconst { getResponseData, buildKey, addMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kDispatchKey,\n kDefaultHeaders,\n kDefaultTrailers,\n kContentLength,\n kMockDispatch\n} = require('./mock-symbols')\nconst { InvalidArgumentError } = require('../core/errors')\nconst { buildURL } = require('../core/util')\n\n/**\n * Defines the scope API for an interceptor reply\n */\nclass MockScope {\n constructor (mockDispatch) {\n this[kMockDispatch] = mockDispatch\n }\n\n /**\n * Delay a reply by a set amount in ms.\n */\n delay (waitInMs) {\n if (typeof waitInMs !== 'number' || !Number.isInteger(waitInMs) || waitInMs <= 0) {\n throw new InvalidArgumentError('waitInMs must be a valid integer > 0')\n }\n\n this[kMockDispatch].delay = waitInMs\n return this\n }\n\n /**\n * For a defined reply, never mark as consumed.\n */\n persist () {\n this[kMockDispatch].persist = true\n return this\n }\n\n /**\n * Allow one to define a reply for a set amount of matching requests.\n */\n times (repeatTimes) {\n if (typeof repeatTimes !== 'number' || !Number.isInteger(repeatTimes) || repeatTimes <= 0) {\n throw new InvalidArgumentError('repeatTimes must be a valid integer > 0')\n }\n\n this[kMockDispatch].times = repeatTimes\n return this\n }\n}\n\n/**\n * Defines an interceptor for a Mock\n */\nclass MockInterceptor {\n constructor (opts, mockDispatches) {\n if (typeof opts !== 'object') {\n throw new InvalidArgumentError('opts must be an object')\n }\n if (typeof opts.path === 'undefined') {\n throw new InvalidArgumentError('opts.path must be defined')\n }\n if (typeof opts.method === 'undefined') {\n opts.method = 'GET'\n }\n // See https://github.com/nodejs/undici/issues/1245\n // As per RFC 3986, clients are not supposed to send URI\n // fragments to servers when they retrieve a document,\n if (typeof opts.path === 'string') {\n if (opts.query) {\n opts.path = buildURL(opts.path, opts.query)\n } else {\n // Matches https://github.com/nodejs/undici/blob/main/lib/fetch/index.js#L1811\n const parsedURL = new URL(opts.path, 'data://')\n opts.path = parsedURL.pathname + parsedURL.search\n }\n }\n if (typeof opts.method === 'string') {\n opts.method = opts.method.toUpperCase()\n }\n\n this[kDispatchKey] = buildKey(opts)\n this[kDispatches] = mockDispatches\n this[kDefaultHeaders] = {}\n this[kDefaultTrailers] = {}\n this[kContentLength] = false\n }\n\n createMockScopeDispatchData (statusCode, data, responseOptions = {}) {\n const responseData = getResponseData(data)\n const contentLength = this[kContentLength] ? { 'content-length': responseData.length } : {}\n const headers = { ...this[kDefaultHeaders], ...contentLength, ...responseOptions.headers }\n const trailers = { ...this[kDefaultTrailers], ...responseOptions.trailers }\n\n return { statusCode, data, headers, trailers }\n }\n\n validateReplyParameters (statusCode, data, responseOptions) {\n if (typeof statusCode === 'undefined') {\n throw new InvalidArgumentError('statusCode must be defined')\n }\n if (typeof data === 'undefined') {\n throw new InvalidArgumentError('data must be defined')\n }\n if (typeof responseOptions !== 'object') {\n throw new InvalidArgumentError('responseOptions must be an object')\n }\n }\n\n /**\n * Mock an undici request with a defined reply.\n */\n reply (replyData) {\n // Values of reply aren't available right now as they\n // can only be available when the reply callback is invoked.\n if (typeof replyData === 'function') {\n // We'll first wrap the provided callback in another function,\n // this function will properly resolve the data from the callback\n // when invoked.\n const wrappedDefaultsCallback = (opts) => {\n // Our reply options callback contains the parameter for statusCode, data and options.\n const resolvedData = replyData(opts)\n\n // Check if it is in the right format\n if (typeof resolvedData !== 'object') {\n throw new InvalidArgumentError('reply options callback must return an object')\n }\n\n const { statusCode, data = '', responseOptions = {} } = resolvedData\n this.validateReplyParameters(statusCode, data, responseOptions)\n // Since the values can be obtained immediately we return them\n // from this higher order function that will be resolved later.\n return {\n ...this.createMockScopeDispatchData(statusCode, data, responseOptions)\n }\n }\n\n // Add usual dispatch data, but this time set the data parameter to function that will eventually provide data.\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback)\n return new MockScope(newMockDispatch)\n }\n\n // We can have either one or three parameters, if we get here,\n // we should have 1-3 parameters. So we spread the arguments of\n // this function to obtain the parameters, since replyData will always\n // just be the statusCode.\n const [statusCode, data = '', responseOptions = {}] = [...arguments]\n this.validateReplyParameters(statusCode, data, responseOptions)\n\n // Send in-already provided data like usual\n const dispatchData = this.createMockScopeDispatchData(statusCode, data, responseOptions)\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], dispatchData)\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Mock an undici request with a defined error.\n */\n replyWithError (error) {\n if (typeof error === 'undefined') {\n throw new InvalidArgumentError('error must be defined')\n }\n\n const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], { error })\n return new MockScope(newMockDispatch)\n }\n\n /**\n * Set default reply headers on the interceptor for subsequent replies\n */\n defaultReplyHeaders (headers) {\n if (typeof headers === 'undefined') {\n throw new InvalidArgumentError('headers must be defined')\n }\n\n this[kDefaultHeaders] = headers\n return this\n }\n\n /**\n * Set default reply trailers on the interceptor for subsequent replies\n */\n defaultReplyTrailers (trailers) {\n if (typeof trailers === 'undefined') {\n throw new InvalidArgumentError('trailers must be defined')\n }\n\n this[kDefaultTrailers] = trailers\n return this\n }\n\n /**\n * Set reply content length header for replies on the interceptor\n */\n replyContentLength () {\n this[kContentLength] = true\n return this\n }\n}\n\nmodule.exports.MockInterceptor = MockInterceptor\nmodule.exports.MockScope = MockScope\n","'use strict'\n\nconst { promisify } = require('util')\nconst Pool = require('../pool')\nconst { buildMockDispatch } = require('./mock-utils')\nconst {\n kDispatches,\n kMockAgent,\n kClose,\n kOriginalClose,\n kOrigin,\n kOriginalDispatch,\n kConnected\n} = require('./mock-symbols')\nconst { MockInterceptor } = require('./mock-interceptor')\nconst Symbols = require('../core/symbols')\nconst { InvalidArgumentError } = require('../core/errors')\n\n/**\n * MockPool provides an API that extends the Pool to influence the mockDispatches.\n */\nclass MockPool extends Pool {\n constructor (origin, opts) {\n super(origin, opts)\n\n if (!opts || !opts.agent || typeof opts.agent.dispatch !== 'function') {\n throw new InvalidArgumentError('Argument opts.agent must implement Agent')\n }\n\n this[kMockAgent] = opts.agent\n this[kOrigin] = origin\n this[kDispatches] = []\n this[kConnected] = 1\n this[kOriginalDispatch] = this.dispatch\n this[kOriginalClose] = this.close.bind(this)\n\n this.dispatch = buildMockDispatch.call(this)\n this.close = this[kClose]\n }\n\n get [Symbols.kConnected] () {\n return this[kConnected]\n }\n\n /**\n * Sets up the base interceptor for mocking replies from undici.\n */\n intercept (opts) {\n return new MockInterceptor(opts, this[kDispatches])\n }\n\n async [kClose] () {\n await promisify(this[kOriginalClose])()\n this[kConnected] = 0\n this[kMockAgent][Symbols.kClients].delete(this[kOrigin])\n }\n}\n\nmodule.exports = MockPool\n","'use strict'\n\nmodule.exports = {\n kAgent: Symbol('agent'),\n kOptions: Symbol('options'),\n kFactory: Symbol('factory'),\n kDispatches: Symbol('dispatches'),\n kDispatchKey: Symbol('dispatch key'),\n kDefaultHeaders: Symbol('default headers'),\n kDefaultTrailers: Symbol('default trailers'),\n kContentLength: Symbol('content length'),\n kMockAgent: Symbol('mock agent'),\n kMockAgentSet: Symbol('mock agent set'),\n kMockAgentGet: Symbol('mock agent get'),\n kMockDispatch: Symbol('mock dispatch'),\n kClose: Symbol('close'),\n kOriginalClose: Symbol('original agent close'),\n kOrigin: Symbol('origin'),\n kIsMockActive: Symbol('is mock active'),\n kNetConnect: Symbol('net connect'),\n kGetNetConnect: Symbol('get net connect'),\n kConnected: Symbol('connected')\n}\n","'use strict'\n\nconst { MockNotMatchedError } = require('./mock-errors')\nconst {\n kDispatches,\n kMockAgent,\n kOriginalDispatch,\n kOrigin,\n kGetNetConnect\n} = require('./mock-symbols')\nconst { buildURL, nop } = require('../core/util')\nconst { STATUS_CODES } = require('http')\nconst {\n types: {\n isPromise\n }\n} = require('util')\n\nfunction matchValue (match, value) {\n if (typeof match === 'string') {\n return match === value\n }\n if (match instanceof RegExp) {\n return match.test(value)\n }\n if (typeof match === 'function') {\n return match(value) === true\n }\n return false\n}\n\nfunction lowerCaseEntries (headers) {\n return Object.fromEntries(\n Object.entries(headers).map(([headerName, headerValue]) => {\n return [headerName.toLocaleLowerCase(), headerValue]\n })\n )\n}\n\n/**\n * @param {import('../../index').Headers|string[]|Record} headers\n * @param {string} key\n */\nfunction getHeaderByName (headers, key) {\n if (Array.isArray(headers)) {\n for (let i = 0; i < headers.length; i += 2) {\n if (headers[i].toLocaleLowerCase() === key.toLocaleLowerCase()) {\n return headers[i + 1]\n }\n }\n\n return undefined\n } else if (typeof headers.get === 'function') {\n return headers.get(key)\n } else {\n return lowerCaseEntries(headers)[key.toLocaleLowerCase()]\n }\n}\n\n/** @param {string[]} headers */\nfunction buildHeadersFromArray (headers) { // fetch HeadersList\n const clone = headers.slice()\n const entries = []\n for (let index = 0; index < clone.length; index += 2) {\n entries.push([clone[index], clone[index + 1]])\n }\n return Object.fromEntries(entries)\n}\n\nfunction matchHeaders (mockDispatch, headers) {\n if (typeof mockDispatch.headers === 'function') {\n if (Array.isArray(headers)) { // fetch HeadersList\n headers = buildHeadersFromArray(headers)\n }\n return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {})\n }\n if (typeof mockDispatch.headers === 'undefined') {\n return true\n }\n if (typeof headers !== 'object' || typeof mockDispatch.headers !== 'object') {\n return false\n }\n\n for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {\n const headerValue = getHeaderByName(headers, matchHeaderName)\n\n if (!matchValue(matchHeaderValue, headerValue)) {\n return false\n }\n }\n return true\n}\n\nfunction safeUrl (path) {\n if (typeof path !== 'string') {\n return path\n }\n\n const pathSegments = path.split('?')\n\n if (pathSegments.length !== 2) {\n return path\n }\n\n const qp = new URLSearchParams(pathSegments.pop())\n qp.sort()\n return [...pathSegments, qp.toString()].join('?')\n}\n\nfunction matchKey (mockDispatch, { path, method, body, headers }) {\n const pathMatch = matchValue(mockDispatch.path, path)\n const methodMatch = matchValue(mockDispatch.method, method)\n const bodyMatch = typeof mockDispatch.body !== 'undefined' ? matchValue(mockDispatch.body, body) : true\n const headersMatch = matchHeaders(mockDispatch, headers)\n return pathMatch && methodMatch && bodyMatch && headersMatch\n}\n\nfunction getResponseData (data) {\n if (Buffer.isBuffer(data)) {\n return data\n } else if (typeof data === 'object') {\n return JSON.stringify(data)\n } else {\n return data.toString()\n }\n}\n\nfunction getMockDispatch (mockDispatches, key) {\n const basePath = key.query ? buildURL(key.path, key.query) : key.path\n const resolvedPath = typeof basePath === 'string' ? safeUrl(basePath) : basePath\n\n // Match path\n let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path }) => matchValue(safeUrl(path), resolvedPath))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`)\n }\n\n // Match method\n matchedMockDispatches = matchedMockDispatches.filter(({ method }) => matchValue(method, key.method))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for method '${key.method}'`)\n }\n\n // Match body\n matchedMockDispatches = matchedMockDispatches.filter(({ body }) => typeof body !== 'undefined' ? matchValue(body, key.body) : true)\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}'`)\n }\n\n // Match headers\n matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers))\n if (matchedMockDispatches.length === 0) {\n throw new MockNotMatchedError(`Mock dispatch not matched for headers '${typeof key.headers === 'object' ? JSON.stringify(key.headers) : key.headers}'`)\n }\n\n return matchedMockDispatches[0]\n}\n\nfunction addMockDispatch (mockDispatches, key, data) {\n const baseData = { timesInvoked: 0, times: 1, persist: false, consumed: false }\n const replyData = typeof data === 'function' ? { callback: data } : { ...data }\n const newMockDispatch = { ...baseData, ...key, pending: true, data: { error: null, ...replyData } }\n mockDispatches.push(newMockDispatch)\n return newMockDispatch\n}\n\nfunction deleteMockDispatch (mockDispatches, key) {\n const index = mockDispatches.findIndex(dispatch => {\n if (!dispatch.consumed) {\n return false\n }\n return matchKey(dispatch, key)\n })\n if (index !== -1) {\n mockDispatches.splice(index, 1)\n }\n}\n\nfunction buildKey (opts) {\n const { path, method, body, headers, query } = opts\n return {\n path,\n method,\n body,\n headers,\n query\n }\n}\n\nfunction generateKeyValues (data) {\n return Object.entries(data).reduce((keyValuePairs, [key, value]) => [\n ...keyValuePairs,\n Buffer.from(`${key}`),\n Array.isArray(value) ? value.map(x => Buffer.from(`${x}`)) : Buffer.from(`${value}`)\n ], [])\n}\n\n/**\n * @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Status\n * @param {number} statusCode\n */\nfunction getStatusText (statusCode) {\n return STATUS_CODES[statusCode] || 'unknown'\n}\n\nasync function getResponse (body) {\n const buffers = []\n for await (const data of body) {\n buffers.push(data)\n }\n return Buffer.concat(buffers).toString('utf8')\n}\n\n/**\n * Mock dispatch function used to simulate undici dispatches\n */\nfunction mockDispatch (opts, handler) {\n // Get mock dispatch from built key\n const key = buildKey(opts)\n const mockDispatch = getMockDispatch(this[kDispatches], key)\n\n mockDispatch.timesInvoked++\n\n // Here's where we resolve a callback if a callback is present for the dispatch data.\n if (mockDispatch.data.callback) {\n mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) }\n }\n\n // Parse mockDispatch data\n const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch\n const { timesInvoked, times } = mockDispatch\n\n // If it's used up and not persistent, mark as consumed\n mockDispatch.consumed = !persist && timesInvoked >= times\n mockDispatch.pending = timesInvoked < times\n\n // If specified, trigger dispatch error\n if (error !== null) {\n deleteMockDispatch(this[kDispatches], key)\n handler.onError(error)\n return true\n }\n\n // Handle the request with a delay if necessary\n if (typeof delay === 'number' && delay > 0) {\n setTimeout(() => {\n handleReply(this[kDispatches])\n }, delay)\n } else {\n handleReply(this[kDispatches])\n }\n\n function handleReply (mockDispatches, _data = data) {\n // fetch's HeadersList is a 1D string array\n const optsHeaders = Array.isArray(opts.headers)\n ? buildHeadersFromArray(opts.headers)\n : opts.headers\n const body = typeof _data === 'function'\n ? _data({ ...opts, headers: optsHeaders })\n : _data\n\n // util.types.isPromise is likely needed for jest.\n if (isPromise(body)) {\n // If handleReply is asynchronous, throwing an error\n // in the callback will reject the promise, rather than\n // synchronously throw the error, which breaks some tests.\n // Rather, we wait for the callback to resolve if it is a\n // promise, and then re-run handleReply with the new body.\n body.then((newData) => handleReply(mockDispatches, newData))\n return\n }\n\n const responseData = getResponseData(body)\n const responseHeaders = generateKeyValues(headers)\n const responseTrailers = generateKeyValues(trailers)\n\n handler.abort = nop\n handler.onHeaders(statusCode, responseHeaders, resume, getStatusText(statusCode))\n handler.onData(Buffer.from(responseData))\n handler.onComplete(responseTrailers)\n deleteMockDispatch(mockDispatches, key)\n }\n\n function resume () {}\n\n return true\n}\n\nfunction buildMockDispatch () {\n const agent = this[kMockAgent]\n const origin = this[kOrigin]\n const originalDispatch = this[kOriginalDispatch]\n\n return function dispatch (opts, handler) {\n if (agent.isMockActive) {\n try {\n mockDispatch.call(this, opts, handler)\n } catch (error) {\n if (error instanceof MockNotMatchedError) {\n const netConnect = agent[kGetNetConnect]()\n if (netConnect === false) {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect disabled)`)\n }\n if (checkNetConnect(netConnect, origin)) {\n originalDispatch.call(this, opts, handler)\n } else {\n throw new MockNotMatchedError(`${error.message}: subsequent request to origin ${origin} was not allowed (net.connect is not enabled for this origin)`)\n }\n } else {\n throw error\n }\n }\n } else {\n originalDispatch.call(this, opts, handler)\n }\n }\n}\n\nfunction checkNetConnect (netConnect, origin) {\n const url = new URL(origin)\n if (netConnect === true) {\n return true\n } else if (Array.isArray(netConnect) && netConnect.some((matcher) => matchValue(matcher, url.host))) {\n return true\n }\n return false\n}\n\nfunction buildMockOptions (opts) {\n if (opts) {\n const { agent, ...mockOptions } = opts\n return mockOptions\n }\n}\n\nmodule.exports = {\n getResponseData,\n getMockDispatch,\n addMockDispatch,\n deleteMockDispatch,\n buildKey,\n generateKeyValues,\n matchValue,\n getResponse,\n getStatusText,\n mockDispatch,\n buildMockDispatch,\n checkNetConnect,\n buildMockOptions,\n getHeaderByName\n}\n","'use strict'\n\nconst { Transform } = require('stream')\nconst { Console } = require('console')\n\n/**\n * Gets the output of `console.table(…)` as a string.\n */\nmodule.exports = class PendingInterceptorsFormatter {\n constructor ({ disableColors } = {}) {\n this.transform = new Transform({\n transform (chunk, _enc, cb) {\n cb(null, chunk)\n }\n })\n\n this.logger = new Console({\n stdout: this.transform,\n inspectOptions: {\n colors: !disableColors && !process.env.CI\n }\n })\n }\n\n format (pendingInterceptors) {\n const withPrettyHeaders = pendingInterceptors.map(\n ({ method, path, data: { statusCode }, persist, times, timesInvoked, origin }) => ({\n Method: method,\n Origin: origin,\n Path: path,\n 'Status code': statusCode,\n Persistent: persist ? '✅' : '❌',\n Invocations: timesInvoked,\n Remaining: persist ? Infinity : times - timesInvoked\n }))\n\n this.logger.table(withPrettyHeaders)\n return this.transform.read().toString()\n }\n}\n","'use strict'\n\nconst singulars = {\n pronoun: 'it',\n is: 'is',\n was: 'was',\n this: 'this'\n}\n\nconst plurals = {\n pronoun: 'they',\n is: 'are',\n was: 'were',\n this: 'these'\n}\n\nmodule.exports = class Pluralizer {\n constructor (singular, plural) {\n this.singular = singular\n this.plural = plural\n }\n\n pluralize (count) {\n const one = count === 1\n const keys = one ? singulars : plurals\n const noun = one ? this.singular : this.plural\n return { ...keys, count, noun }\n }\n}\n","/* eslint-disable */\n\n'use strict'\n\n// Extracted from node/lib/internal/fixed_queue.js\n\n// Currently optimal queue size, tested on V8 6.0 - 6.6. Must be power of two.\nconst kSize = 2048;\nconst kMask = kSize - 1;\n\n// The FixedQueue is implemented as a singly-linked list of fixed-size\n// circular buffers. It looks something like this:\n//\n// head tail\n// | |\n// v v\n// +-----------+ <-----\\ +-----------+ <------\\ +-----------+\n// | [null] | \\----- | next | \\------- | next |\n// +-----------+ +-----------+ +-----------+\n// | item | <-- bottom | item | <-- bottom | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | | [empty] |\n// | item | | item | bottom --> | item |\n// | item | | item | | item |\n// | ... | | ... | | ... |\n// | item | | item | | item |\n// | item | | item | | item |\n// | [empty] | <-- top | item | | item |\n// | [empty] | | item | | item |\n// | [empty] | | [empty] | <-- top top --> | [empty] |\n// +-----------+ +-----------+ +-----------+\n//\n// Or, if there is only one circular buffer, it looks something\n// like either of these:\n//\n// head tail head tail\n// | | | |\n// v v v v\n// +-----------+ +-----------+\n// | [null] | | [null] |\n// +-----------+ +-----------+\n// | [empty] | | item |\n// | [empty] | | item |\n// | item | <-- bottom top --> | [empty] |\n// | item | | [empty] |\n// | [empty] | <-- top bottom --> | item |\n// | [empty] | | item |\n// +-----------+ +-----------+\n//\n// Adding a value means moving `top` forward by one, removing means\n// moving `bottom` forward by one. After reaching the end, the queue\n// wraps around.\n//\n// When `top === bottom` the current queue is empty and when\n// `top + 1 === bottom` it's full. This wastes a single space of storage\n// but allows much quicker checks.\n\nclass FixedCircularBuffer {\n constructor() {\n this.bottom = 0;\n this.top = 0;\n this.list = new Array(kSize);\n this.next = null;\n }\n\n isEmpty() {\n return this.top === this.bottom;\n }\n\n isFull() {\n return ((this.top + 1) & kMask) === this.bottom;\n }\n\n push(data) {\n this.list[this.top] = data;\n this.top = (this.top + 1) & kMask;\n }\n\n shift() {\n const nextItem = this.list[this.bottom];\n if (nextItem === undefined)\n return null;\n this.list[this.bottom] = undefined;\n this.bottom = (this.bottom + 1) & kMask;\n return nextItem;\n }\n}\n\nmodule.exports = class FixedQueue {\n constructor() {\n this.head = this.tail = new FixedCircularBuffer();\n }\n\n isEmpty() {\n return this.head.isEmpty();\n }\n\n push(data) {\n if (this.head.isFull()) {\n // Head is full: Creates a new queue, sets the old queue's `.next` to it,\n // and sets it as the new main queue.\n this.head = this.head.next = new FixedCircularBuffer();\n }\n this.head.push(data);\n }\n\n shift() {\n const tail = this.tail;\n const next = tail.shift();\n if (tail.isEmpty() && tail.next !== null) {\n // If there is another queue, it forms the new tail.\n this.tail = tail.next;\n }\n return next;\n }\n};\n","'use strict'\n\nconst DispatcherBase = require('./dispatcher-base')\nconst FixedQueue = require('./node/fixed-queue')\nconst { kConnected, kSize, kRunning, kPending, kQueued, kBusy, kFree, kUrl, kClose, kDestroy, kDispatch } = require('./core/symbols')\nconst PoolStats = require('./pool-stats')\n\nconst kClients = Symbol('clients')\nconst kNeedDrain = Symbol('needDrain')\nconst kQueue = Symbol('queue')\nconst kClosedResolve = Symbol('closed resolve')\nconst kOnDrain = Symbol('onDrain')\nconst kOnConnect = Symbol('onConnect')\nconst kOnDisconnect = Symbol('onDisconnect')\nconst kOnConnectionError = Symbol('onConnectionError')\nconst kGetDispatcher = Symbol('get dispatcher')\nconst kAddClient = Symbol('add client')\nconst kRemoveClient = Symbol('remove client')\nconst kStats = Symbol('stats')\n\nclass PoolBase extends DispatcherBase {\n constructor () {\n super()\n\n this[kQueue] = new FixedQueue()\n this[kClients] = []\n this[kQueued] = 0\n\n const pool = this\n\n this[kOnDrain] = function onDrain (origin, targets) {\n const queue = pool[kQueue]\n\n let needDrain = false\n\n while (!needDrain) {\n const item = queue.shift()\n if (!item) {\n break\n }\n pool[kQueued]--\n needDrain = !this.dispatch(item.opts, item.handler)\n }\n\n this[kNeedDrain] = needDrain\n\n if (!this[kNeedDrain] && pool[kNeedDrain]) {\n pool[kNeedDrain] = false\n pool.emit('drain', origin, [pool, ...targets])\n }\n\n if (pool[kClosedResolve] && queue.isEmpty()) {\n Promise\n .all(pool[kClients].map(c => c.close()))\n .then(pool[kClosedResolve])\n }\n }\n\n this[kOnConnect] = (origin, targets) => {\n pool.emit('connect', origin, [pool, ...targets])\n }\n\n this[kOnDisconnect] = (origin, targets, err) => {\n pool.emit('disconnect', origin, [pool, ...targets], err)\n }\n\n this[kOnConnectionError] = (origin, targets, err) => {\n pool.emit('connectionError', origin, [pool, ...targets], err)\n }\n\n this[kStats] = new PoolStats(this)\n }\n\n get [kBusy] () {\n return this[kNeedDrain]\n }\n\n get [kConnected] () {\n return this[kClients].filter(client => client[kConnected]).length\n }\n\n get [kFree] () {\n return this[kClients].filter(client => client[kConnected] && !client[kNeedDrain]).length\n }\n\n get [kPending] () {\n let ret = this[kQueued]\n for (const { [kPending]: pending } of this[kClients]) {\n ret += pending\n }\n return ret\n }\n\n get [kRunning] () {\n let ret = 0\n for (const { [kRunning]: running } of this[kClients]) {\n ret += running\n }\n return ret\n }\n\n get [kSize] () {\n let ret = this[kQueued]\n for (const { [kSize]: size } of this[kClients]) {\n ret += size\n }\n return ret\n }\n\n get stats () {\n return this[kStats]\n }\n\n async [kClose] () {\n if (this[kQueue].isEmpty()) {\n return Promise.all(this[kClients].map(c => c.close()))\n } else {\n return new Promise((resolve) => {\n this[kClosedResolve] = resolve\n })\n }\n }\n\n async [kDestroy] (err) {\n while (true) {\n const item = this[kQueue].shift()\n if (!item) {\n break\n }\n item.handler.onError(err)\n }\n\n return Promise.all(this[kClients].map(c => c.destroy(err)))\n }\n\n [kDispatch] (opts, handler) {\n const dispatcher = this[kGetDispatcher]()\n\n if (!dispatcher) {\n this[kNeedDrain] = true\n this[kQueue].push({ opts, handler })\n this[kQueued]++\n } else if (!dispatcher.dispatch(opts, handler)) {\n dispatcher[kNeedDrain] = true\n this[kNeedDrain] = !this[kGetDispatcher]()\n }\n\n return !this[kNeedDrain]\n }\n\n [kAddClient] (client) {\n client\n .on('drain', this[kOnDrain])\n .on('connect', this[kOnConnect])\n .on('disconnect', this[kOnDisconnect])\n .on('connectionError', this[kOnConnectionError])\n\n this[kClients].push(client)\n\n if (this[kNeedDrain]) {\n process.nextTick(() => {\n if (this[kNeedDrain]) {\n this[kOnDrain](client[kUrl], [this, client])\n }\n })\n }\n\n return this\n }\n\n [kRemoveClient] (client) {\n client.close(() => {\n const idx = this[kClients].indexOf(client)\n if (idx !== -1) {\n this[kClients].splice(idx, 1)\n }\n })\n\n this[kNeedDrain] = this[kClients].some(dispatcher => (\n !dispatcher[kNeedDrain] &&\n dispatcher.closed !== true &&\n dispatcher.destroyed !== true\n ))\n }\n}\n\nmodule.exports = {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kRemoveClient,\n kGetDispatcher\n}\n","const { kFree, kConnected, kPending, kQueued, kRunning, kSize } = require('./core/symbols')\nconst kPool = Symbol('pool')\n\nclass PoolStats {\n constructor (pool) {\n this[kPool] = pool\n }\n\n get connected () {\n return this[kPool][kConnected]\n }\n\n get free () {\n return this[kPool][kFree]\n }\n\n get pending () {\n return this[kPool][kPending]\n }\n\n get queued () {\n return this[kPool][kQueued]\n }\n\n get running () {\n return this[kPool][kRunning]\n }\n\n get size () {\n return this[kPool][kSize]\n }\n}\n\nmodule.exports = PoolStats\n","'use strict'\n\nconst {\n PoolBase,\n kClients,\n kNeedDrain,\n kAddClient,\n kGetDispatcher\n} = require('./pool-base')\nconst Client = require('./client')\nconst {\n InvalidArgumentError\n} = require('./core/errors')\nconst util = require('./core/util')\nconst { kUrl, kInterceptors } = require('./core/symbols')\nconst buildConnector = require('./core/connect')\n\nconst kOptions = Symbol('options')\nconst kConnections = Symbol('connections')\nconst kFactory = Symbol('factory')\n\nfunction defaultFactory (origin, opts) {\n return new Client(origin, opts)\n}\n\nclass Pool extends PoolBase {\n constructor (origin, {\n connections,\n factory = defaultFactory,\n connect,\n connectTimeout,\n tls,\n maxCachedSessions,\n socketPath,\n autoSelectFamily,\n autoSelectFamilyAttemptTimeout,\n allowH2,\n ...options\n } = {}) {\n super()\n\n if (connections != null && (!Number.isFinite(connections) || connections < 0)) {\n throw new InvalidArgumentError('invalid connections')\n }\n\n if (typeof factory !== 'function') {\n throw new InvalidArgumentError('factory must be a function.')\n }\n\n if (connect != null && typeof connect !== 'function' && typeof connect !== 'object') {\n throw new InvalidArgumentError('connect must be a function or an object')\n }\n\n if (typeof connect !== 'function') {\n connect = buildConnector({\n ...tls,\n maxCachedSessions,\n allowH2,\n socketPath,\n timeout: connectTimeout,\n ...(util.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined),\n ...connect\n })\n }\n\n this[kInterceptors] = options.interceptors && options.interceptors.Pool && Array.isArray(options.interceptors.Pool)\n ? options.interceptors.Pool\n : []\n this[kConnections] = connections || null\n this[kUrl] = util.parseOrigin(origin)\n this[kOptions] = { ...util.deepClone(options), connect, allowH2 }\n this[kOptions].interceptors = options.interceptors\n ? { ...options.interceptors }\n : undefined\n this[kFactory] = factory\n }\n\n [kGetDispatcher] () {\n let dispatcher = this[kClients].find(dispatcher => !dispatcher[kNeedDrain])\n\n if (dispatcher) {\n return dispatcher\n }\n\n if (!this[kConnections] || this[kClients].length < this[kConnections]) {\n dispatcher = this[kFactory](this[kUrl], this[kOptions])\n this[kAddClient](dispatcher)\n }\n\n return dispatcher\n }\n}\n\nmodule.exports = Pool\n","'use strict'\n\nconst { kProxy, kClose, kDestroy, kInterceptors } = require('./core/symbols')\nconst { URL } = require('url')\nconst Agent = require('./agent')\nconst Pool = require('./pool')\nconst DispatcherBase = require('./dispatcher-base')\nconst { InvalidArgumentError, RequestAbortedError } = require('./core/errors')\nconst buildConnector = require('./core/connect')\n\nconst kAgent = Symbol('proxy agent')\nconst kClient = Symbol('proxy client')\nconst kProxyHeaders = Symbol('proxy headers')\nconst kRequestTls = Symbol('request tls settings')\nconst kProxyTls = Symbol('proxy tls settings')\nconst kConnectEndpoint = Symbol('connect endpoint function')\n\nfunction defaultProtocolPort (protocol) {\n return protocol === 'https:' ? 443 : 80\n}\n\nfunction buildProxyOptions (opts) {\n if (typeof opts === 'string') {\n opts = { uri: opts }\n }\n\n if (!opts || !opts.uri) {\n throw new InvalidArgumentError('Proxy opts.uri is mandatory')\n }\n\n return {\n uri: opts.uri,\n protocol: opts.protocol || 'https'\n }\n}\n\nfunction defaultFactory (origin, opts) {\n return new Pool(origin, opts)\n}\n\nclass ProxyAgent extends DispatcherBase {\n constructor (opts) {\n super(opts)\n this[kProxy] = buildProxyOptions(opts)\n this[kAgent] = new Agent(opts)\n this[kInterceptors] = opts.interceptors && opts.interceptors.ProxyAgent && Array.isArray(opts.interceptors.ProxyAgent)\n ? opts.interceptors.ProxyAgent\n : []\n\n if (typeof opts === 'string') {\n opts = { uri: opts }\n }\n\n if (!opts || !opts.uri) {\n throw new InvalidArgumentError('Proxy opts.uri is mandatory')\n }\n\n const { clientFactory = defaultFactory } = opts\n\n if (typeof clientFactory !== 'function') {\n throw new InvalidArgumentError('Proxy opts.clientFactory must be a function.')\n }\n\n this[kRequestTls] = opts.requestTls\n this[kProxyTls] = opts.proxyTls\n this[kProxyHeaders] = opts.headers || {}\n\n if (opts.auth && opts.token) {\n throw new InvalidArgumentError('opts.auth cannot be used in combination with opts.token')\n } else if (opts.auth) {\n /* @deprecated in favour of opts.token */\n this[kProxyHeaders]['proxy-authorization'] = `Basic ${opts.auth}`\n } else if (opts.token) {\n this[kProxyHeaders]['proxy-authorization'] = opts.token\n }\n\n const resolvedUrl = new URL(opts.uri)\n const { origin, port, host } = resolvedUrl\n\n const connect = buildConnector({ ...opts.proxyTls })\n this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })\n this[kClient] = clientFactory(resolvedUrl, { connect })\n this[kAgent] = new Agent({\n ...opts,\n connect: async (opts, callback) => {\n let requestedHost = opts.host\n if (!opts.port) {\n requestedHost += `:${defaultProtocolPort(opts.protocol)}`\n }\n try {\n const { socket, statusCode } = await this[kClient].connect({\n origin,\n port,\n path: requestedHost,\n signal: opts.signal,\n headers: {\n ...this[kProxyHeaders],\n host\n }\n })\n if (statusCode !== 200) {\n socket.on('error', () => {}).destroy()\n callback(new RequestAbortedError('Proxy response !== 200 when HTTP Tunneling'))\n }\n if (opts.protocol !== 'https:') {\n callback(null, socket)\n return\n }\n let servername\n if (this[kRequestTls]) {\n servername = this[kRequestTls].servername\n } else {\n servername = opts.servername\n }\n this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback)\n } catch (err) {\n callback(err)\n }\n }\n })\n }\n\n dispatch (opts, handler) {\n const { host } = new URL(opts.origin)\n const headers = buildHeaders(opts.headers)\n throwIfProxyAuthIsSent(headers)\n return this[kAgent].dispatch(\n {\n ...opts,\n headers: {\n ...headers,\n host\n }\n },\n handler\n )\n }\n\n async [kClose] () {\n await this[kAgent].close()\n await this[kClient].close()\n }\n\n async [kDestroy] () {\n await this[kAgent].destroy()\n await this[kClient].destroy()\n }\n}\n\n/**\n * @param {string[] | Record} headers\n * @returns {Record}\n */\nfunction buildHeaders (headers) {\n // When using undici.fetch, the headers list is stored\n // as an array.\n if (Array.isArray(headers)) {\n /** @type {Record} */\n const headersPair = {}\n\n for (let i = 0; i < headers.length; i += 2) {\n headersPair[headers[i]] = headers[i + 1]\n }\n\n return headersPair\n }\n\n return headers\n}\n\n/**\n * @param {Record} headers\n *\n * Previous versions of ProxyAgent suggests the Proxy-Authorization in request headers\n * Nevertheless, it was changed and to avoid a security vulnerability by end users\n * this check was created.\n * It should be removed in the next major version for performance reasons\n */\nfunction throwIfProxyAuthIsSent (headers) {\n const existProxyAuth = headers && Object.keys(headers)\n .find((key) => key.toLowerCase() === 'proxy-authorization')\n if (existProxyAuth) {\n throw new InvalidArgumentError('Proxy-Authorization should be sent in ProxyAgent constructor')\n }\n}\n\nmodule.exports = ProxyAgent\n","'use strict'\n\nlet fastNow = Date.now()\nlet fastNowTimeout\n\nconst fastTimers = []\n\nfunction onTimeout () {\n fastNow = Date.now()\n\n let len = fastTimers.length\n let idx = 0\n while (idx < len) {\n const timer = fastTimers[idx]\n\n if (timer.state === 0) {\n timer.state = fastNow + timer.delay\n } else if (timer.state > 0 && fastNow >= timer.state) {\n timer.state = -1\n timer.callback(timer.opaque)\n }\n\n if (timer.state === -1) {\n timer.state = -2\n if (idx !== len - 1) {\n fastTimers[idx] = fastTimers.pop()\n } else {\n fastTimers.pop()\n }\n len -= 1\n } else {\n idx += 1\n }\n }\n\n if (fastTimers.length > 0) {\n refreshTimeout()\n }\n}\n\nfunction refreshTimeout () {\n if (fastNowTimeout && fastNowTimeout.refresh) {\n fastNowTimeout.refresh()\n } else {\n clearTimeout(fastNowTimeout)\n fastNowTimeout = setTimeout(onTimeout, 1e3)\n if (fastNowTimeout.unref) {\n fastNowTimeout.unref()\n }\n }\n}\n\nclass Timeout {\n constructor (callback, delay, opaque) {\n this.callback = callback\n this.delay = delay\n this.opaque = opaque\n\n // -2 not in timer list\n // -1 in timer list but inactive\n // 0 in timer list waiting for time\n // > 0 in timer list waiting for time to expire\n this.state = -2\n\n this.refresh()\n }\n\n refresh () {\n if (this.state === -2) {\n fastTimers.push(this)\n if (!fastNowTimeout || fastTimers.length === 1) {\n refreshTimeout()\n }\n }\n\n this.state = 0\n }\n\n clear () {\n this.state = -1\n }\n}\n\nmodule.exports = {\n setTimeout (callback, delay, opaque) {\n return delay < 1e3\n ? setTimeout(callback, delay, opaque)\n : new Timeout(callback, delay, opaque)\n },\n clearTimeout (timeout) {\n if (timeout instanceof Timeout) {\n timeout.clear()\n } else {\n clearTimeout(timeout)\n }\n }\n}\n","'use strict'\n\nconst diagnosticsChannel = require('diagnostics_channel')\nconst { uid, states } = require('./constants')\nconst {\n kReadyState,\n kSentClose,\n kByteParser,\n kReceivedClose\n} = require('./symbols')\nconst { fireEvent, failWebsocketConnection } = require('./util')\nconst { CloseEvent } = require('./events')\nconst { makeRequest } = require('../fetch/request')\nconst { fetching } = require('../fetch/index')\nconst { Headers } = require('../fetch/headers')\nconst { getGlobalDispatcher } = require('../global')\nconst { kHeadersList } = require('../core/symbols')\n\nconst channels = {}\nchannels.open = diagnosticsChannel.channel('undici:websocket:open')\nchannels.close = diagnosticsChannel.channel('undici:websocket:close')\nchannels.socketError = diagnosticsChannel.channel('undici:websocket:socket_error')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n crypto = require('crypto')\n} catch {\n\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#concept-websocket-establish\n * @param {URL} url\n * @param {string|string[]} protocols\n * @param {import('./websocket').WebSocket} ws\n * @param {(response: any) => void} onEstablish\n * @param {Partial} options\n */\nfunction establishWebSocketConnection (url, protocols, ws, onEstablish, options) {\n // 1. Let requestURL be a copy of url, with its scheme set to \"http\", if url’s\n // scheme is \"ws\", and to \"https\" otherwise.\n const requestURL = url\n\n requestURL.protocol = url.protocol === 'ws:' ? 'http:' : 'https:'\n\n // 2. Let request be a new request, whose URL is requestURL, client is client,\n // service-workers mode is \"none\", referrer is \"no-referrer\", mode is\n // \"websocket\", credentials mode is \"include\", cache mode is \"no-store\" ,\n // and redirect mode is \"error\".\n const request = makeRequest({\n urlList: [requestURL],\n serviceWorkers: 'none',\n referrer: 'no-referrer',\n mode: 'websocket',\n credentials: 'include',\n cache: 'no-store',\n redirect: 'error'\n })\n\n // Note: undici extension, allow setting custom headers.\n if (options.headers) {\n const headersList = new Headers(options.headers)[kHeadersList]\n\n request.headersList = headersList\n }\n\n // 3. Append (`Upgrade`, `websocket`) to request’s header list.\n // 4. Append (`Connection`, `Upgrade`) to request’s header list.\n // Note: both of these are handled by undici currently.\n // https://github.com/nodejs/undici/blob/68c269c4144c446f3f1220951338daef4a6b5ec4/lib/client.js#L1397\n\n // 5. Let keyValue be a nonce consisting of a randomly selected\n // 16-byte value that has been forgiving-base64-encoded and\n // isomorphic encoded.\n const keyValue = crypto.randomBytes(16).toString('base64')\n\n // 6. Append (`Sec-WebSocket-Key`, keyValue) to request’s\n // header list.\n request.headersList.append('sec-websocket-key', keyValue)\n\n // 7. Append (`Sec-WebSocket-Version`, `13`) to request’s\n // header list.\n request.headersList.append('sec-websocket-version', '13')\n\n // 8. For each protocol in protocols, combine\n // (`Sec-WebSocket-Protocol`, protocol) in request’s header\n // list.\n for (const protocol of protocols) {\n request.headersList.append('sec-websocket-protocol', protocol)\n }\n\n // 9. Let permessageDeflate be a user-agent defined\n // \"permessage-deflate\" extension header value.\n // https://github.com/mozilla/gecko-dev/blob/ce78234f5e653a5d3916813ff990f053510227bc/netwerk/protocol/websocket/WebSocketChannel.cpp#L2673\n // TODO: enable once permessage-deflate is supported\n const permessageDeflate = '' // 'permessage-deflate; 15'\n\n // 10. Append (`Sec-WebSocket-Extensions`, permessageDeflate) to\n // request’s header list.\n // request.headersList.append('sec-websocket-extensions', permessageDeflate)\n\n // 11. Fetch request with useParallelQueue set to true, and\n // processResponse given response being these steps:\n const controller = fetching({\n request,\n useParallelQueue: true,\n dispatcher: options.dispatcher ?? getGlobalDispatcher(),\n processResponse (response) {\n // 1. If response is a network error or its status is not 101,\n // fail the WebSocket connection.\n if (response.type === 'error' || response.status !== 101) {\n failWebsocketConnection(ws, 'Received network error or non-101 status code.')\n return\n }\n\n // 2. If protocols is not the empty list and extracting header\n // list values given `Sec-WebSocket-Protocol` and response’s\n // header list results in null, failure, or the empty byte\n // sequence, then fail the WebSocket connection.\n if (protocols.length !== 0 && !response.headersList.get('Sec-WebSocket-Protocol')) {\n failWebsocketConnection(ws, 'Server did not respond with sent protocols.')\n return\n }\n\n // 3. Follow the requirements stated step 2 to step 6, inclusive,\n // of the last set of steps in section 4.1 of The WebSocket\n // Protocol to validate response. This either results in fail\n // the WebSocket connection or the WebSocket connection is\n // established.\n\n // 2. If the response lacks an |Upgrade| header field or the |Upgrade|\n // header field contains a value that is not an ASCII case-\n // insensitive match for the value \"websocket\", the client MUST\n // _Fail the WebSocket Connection_.\n if (response.headersList.get('Upgrade')?.toLowerCase() !== 'websocket') {\n failWebsocketConnection(ws, 'Server did not set Upgrade header to \"websocket\".')\n return\n }\n\n // 3. If the response lacks a |Connection| header field or the\n // |Connection| header field doesn't contain a token that is an\n // ASCII case-insensitive match for the value \"Upgrade\", the client\n // MUST _Fail the WebSocket Connection_.\n if (response.headersList.get('Connection')?.toLowerCase() !== 'upgrade') {\n failWebsocketConnection(ws, 'Server did not set Connection header to \"upgrade\".')\n return\n }\n\n // 4. If the response lacks a |Sec-WebSocket-Accept| header field or\n // the |Sec-WebSocket-Accept| contains a value other than the\n // base64-encoded SHA-1 of the concatenation of the |Sec-WebSocket-\n // Key| (as a string, not base64-decoded) with the string \"258EAFA5-\n // E914-47DA-95CA-C5AB0DC85B11\" but ignoring any leading and\n // trailing whitespace, the client MUST _Fail the WebSocket\n // Connection_.\n const secWSAccept = response.headersList.get('Sec-WebSocket-Accept')\n const digest = crypto.createHash('sha1').update(keyValue + uid).digest('base64')\n if (secWSAccept !== digest) {\n failWebsocketConnection(ws, 'Incorrect hash received in Sec-WebSocket-Accept header.')\n return\n }\n\n // 5. If the response includes a |Sec-WebSocket-Extensions| header\n // field and this header field indicates the use of an extension\n // that was not present in the client's handshake (the server has\n // indicated an extension not requested by the client), the client\n // MUST _Fail the WebSocket Connection_. (The parsing of this\n // header field to determine which extensions are requested is\n // discussed in Section 9.1.)\n const secExtension = response.headersList.get('Sec-WebSocket-Extensions')\n\n if (secExtension !== null && secExtension !== permessageDeflate) {\n failWebsocketConnection(ws, 'Received different permessage-deflate than the one set.')\n return\n }\n\n // 6. If the response includes a |Sec-WebSocket-Protocol| header field\n // and this header field indicates the use of a subprotocol that was\n // not present in the client's handshake (the server has indicated a\n // subprotocol not requested by the client), the client MUST _Fail\n // the WebSocket Connection_.\n const secProtocol = response.headersList.get('Sec-WebSocket-Protocol')\n\n if (secProtocol !== null && secProtocol !== request.headersList.get('Sec-WebSocket-Protocol')) {\n failWebsocketConnection(ws, 'Protocol was not set in the opening handshake.')\n return\n }\n\n response.socket.on('data', onSocketData)\n response.socket.on('close', onSocketClose)\n response.socket.on('error', onSocketError)\n\n if (channels.open.hasSubscribers) {\n channels.open.publish({\n address: response.socket.address(),\n protocol: secProtocol,\n extensions: secExtension\n })\n }\n\n onEstablish(response)\n }\n })\n\n return controller\n}\n\n/**\n * @param {Buffer} chunk\n */\nfunction onSocketData (chunk) {\n if (!this.ws[kByteParser].write(chunk)) {\n this.pause()\n }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.4\n */\nfunction onSocketClose () {\n const { ws } = this\n\n // If the TCP connection was closed after the\n // WebSocket closing handshake was completed, the WebSocket connection\n // is said to have been closed _cleanly_.\n const wasClean = ws[kSentClose] && ws[kReceivedClose]\n\n let code = 1005\n let reason = ''\n\n const result = ws[kByteParser].closingInfo\n\n if (result) {\n code = result.code ?? 1005\n reason = result.reason\n } else if (!ws[kSentClose]) {\n // If _The WebSocket\n // Connection is Closed_ and no Close control frame was received by the\n // endpoint (such as could occur if the underlying transport connection\n // is lost), _The WebSocket Connection Close Code_ is considered to be\n // 1006.\n code = 1006\n }\n\n // 1. Change the ready state to CLOSED (3).\n ws[kReadyState] = states.CLOSED\n\n // 2. If the user agent was required to fail the WebSocket\n // connection, or if the WebSocket connection was closed\n // after being flagged as full, fire an event named error\n // at the WebSocket object.\n // TODO\n\n // 3. Fire an event named close at the WebSocket object,\n // using CloseEvent, with the wasClean attribute\n // initialized to true if the connection closed cleanly\n // and false otherwise, the code attribute initialized to\n // the WebSocket connection close code, and the reason\n // attribute initialized to the result of applying UTF-8\n // decode without BOM to the WebSocket connection close\n // reason.\n fireEvent('close', ws, CloseEvent, {\n wasClean, code, reason\n })\n\n if (channels.close.hasSubscribers) {\n channels.close.publish({\n websocket: ws,\n code,\n reason\n })\n }\n}\n\nfunction onSocketError (error) {\n const { ws } = this\n\n ws[kReadyState] = states.CLOSING\n\n if (channels.socketError.hasSubscribers) {\n channels.socketError.publish(error)\n }\n\n this.destroy()\n}\n\nmodule.exports = {\n establishWebSocketConnection\n}\n","'use strict'\n\n// This is a Globally Unique Identifier unique used\n// to validate that the endpoint accepts websocket\n// connections.\n// See https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3\nconst uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'\n\n/** @type {PropertyDescriptor} */\nconst staticPropertyDescriptors = {\n enumerable: true,\n writable: false,\n configurable: false\n}\n\nconst states = {\n CONNECTING: 0,\n OPEN: 1,\n CLOSING: 2,\n CLOSED: 3\n}\n\nconst opcodes = {\n CONTINUATION: 0x0,\n TEXT: 0x1,\n BINARY: 0x2,\n CLOSE: 0x8,\n PING: 0x9,\n PONG: 0xA\n}\n\nconst maxUnsigned16Bit = 2 ** 16 - 1 // 65535\n\nconst parserStates = {\n INFO: 0,\n PAYLOADLENGTH_16: 2,\n PAYLOADLENGTH_64: 3,\n READ_DATA: 4\n}\n\nconst emptyBuffer = Buffer.allocUnsafe(0)\n\nmodule.exports = {\n uid,\n staticPropertyDescriptors,\n states,\n opcodes,\n maxUnsigned16Bit,\n parserStates,\n emptyBuffer\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { kEnumerableProperty } = require('../core/util')\nconst { MessagePort } = require('worker_threads')\n\n/**\n * @see https://html.spec.whatwg.org/multipage/comms.html#messageevent\n */\nclass MessageEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent constructor' })\n\n type = webidl.converters.DOMString(type)\n eventInitDict = webidl.converters.MessageEventInit(eventInitDict)\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n }\n\n get data () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.data\n }\n\n get origin () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.origin\n }\n\n get lastEventId () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.lastEventId\n }\n\n get source () {\n webidl.brandCheck(this, MessageEvent)\n\n return this.#eventInit.source\n }\n\n get ports () {\n webidl.brandCheck(this, MessageEvent)\n\n if (!Object.isFrozen(this.#eventInit.ports)) {\n Object.freeze(this.#eventInit.ports)\n }\n\n return this.#eventInit.ports\n }\n\n initMessageEvent (\n type,\n bubbles = false,\n cancelable = false,\n data = null,\n origin = '',\n lastEventId = '',\n source = null,\n ports = []\n ) {\n webidl.brandCheck(this, MessageEvent)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'MessageEvent.initMessageEvent' })\n\n return new MessageEvent(type, {\n bubbles, cancelable, data, origin, lastEventId, source, ports\n })\n }\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#the-closeevent-interface\n */\nclass CloseEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict = {}) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'CloseEvent constructor' })\n\n type = webidl.converters.DOMString(type)\n eventInitDict = webidl.converters.CloseEventInit(eventInitDict)\n\n super(type, eventInitDict)\n\n this.#eventInit = eventInitDict\n }\n\n get wasClean () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.wasClean\n }\n\n get code () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.code\n }\n\n get reason () {\n webidl.brandCheck(this, CloseEvent)\n\n return this.#eventInit.reason\n }\n}\n\n// https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface\nclass ErrorEvent extends Event {\n #eventInit\n\n constructor (type, eventInitDict) {\n webidl.argumentLengthCheck(arguments, 1, { header: 'ErrorEvent constructor' })\n\n super(type, eventInitDict)\n\n type = webidl.converters.DOMString(type)\n eventInitDict = webidl.converters.ErrorEventInit(eventInitDict ?? {})\n\n this.#eventInit = eventInitDict\n }\n\n get message () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.message\n }\n\n get filename () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.filename\n }\n\n get lineno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.lineno\n }\n\n get colno () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.colno\n }\n\n get error () {\n webidl.brandCheck(this, ErrorEvent)\n\n return this.#eventInit.error\n }\n}\n\nObject.defineProperties(MessageEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'MessageEvent',\n configurable: true\n },\n data: kEnumerableProperty,\n origin: kEnumerableProperty,\n lastEventId: kEnumerableProperty,\n source: kEnumerableProperty,\n ports: kEnumerableProperty,\n initMessageEvent: kEnumerableProperty\n})\n\nObject.defineProperties(CloseEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'CloseEvent',\n configurable: true\n },\n reason: kEnumerableProperty,\n code: kEnumerableProperty,\n wasClean: kEnumerableProperty\n})\n\nObject.defineProperties(ErrorEvent.prototype, {\n [Symbol.toStringTag]: {\n value: 'ErrorEvent',\n configurable: true\n },\n message: kEnumerableProperty,\n filename: kEnumerableProperty,\n lineno: kEnumerableProperty,\n colno: kEnumerableProperty,\n error: kEnumerableProperty\n})\n\nwebidl.converters.MessagePort = webidl.interfaceConverter(MessagePort)\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.MessagePort\n)\n\nconst eventInit = [\n {\n key: 'bubbles',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'cancelable',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'composed',\n converter: webidl.converters.boolean,\n defaultValue: false\n }\n]\n\nwebidl.converters.MessageEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'data',\n converter: webidl.converters.any,\n defaultValue: null\n },\n {\n key: 'origin',\n converter: webidl.converters.USVString,\n defaultValue: ''\n },\n {\n key: 'lastEventId',\n converter: webidl.converters.DOMString,\n defaultValue: ''\n },\n {\n key: 'source',\n // Node doesn't implement WindowProxy or ServiceWorker, so the only\n // valid value for source is a MessagePort.\n converter: webidl.nullableConverter(webidl.converters.MessagePort),\n defaultValue: null\n },\n {\n key: 'ports',\n converter: webidl.converters['sequence'],\n get defaultValue () {\n return []\n }\n }\n])\n\nwebidl.converters.CloseEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'wasClean',\n converter: webidl.converters.boolean,\n defaultValue: false\n },\n {\n key: 'code',\n converter: webidl.converters['unsigned short'],\n defaultValue: 0\n },\n {\n key: 'reason',\n converter: webidl.converters.USVString,\n defaultValue: ''\n }\n])\n\nwebidl.converters.ErrorEventInit = webidl.dictionaryConverter([\n ...eventInit,\n {\n key: 'message',\n converter: webidl.converters.DOMString,\n defaultValue: ''\n },\n {\n key: 'filename',\n converter: webidl.converters.USVString,\n defaultValue: ''\n },\n {\n key: 'lineno',\n converter: webidl.converters['unsigned long'],\n defaultValue: 0\n },\n {\n key: 'colno',\n converter: webidl.converters['unsigned long'],\n defaultValue: 0\n },\n {\n key: 'error',\n converter: webidl.converters.any\n }\n])\n\nmodule.exports = {\n MessageEvent,\n CloseEvent,\n ErrorEvent\n}\n","'use strict'\n\nconst { maxUnsigned16Bit } = require('./constants')\n\n/** @type {import('crypto')} */\nlet crypto\ntry {\n crypto = require('crypto')\n} catch {\n\n}\n\nclass WebsocketFrameSend {\n /**\n * @param {Buffer|undefined} data\n */\n constructor (data) {\n this.frameData = data\n this.maskKey = crypto.randomBytes(4)\n }\n\n createFrame (opcode) {\n const bodyLength = this.frameData?.byteLength ?? 0\n\n /** @type {number} */\n let payloadLength = bodyLength // 0-125\n let offset = 6\n\n if (bodyLength > maxUnsigned16Bit) {\n offset += 8 // payload length is next 8 bytes\n payloadLength = 127\n } else if (bodyLength > 125) {\n offset += 2 // payload length is next 2 bytes\n payloadLength = 126\n }\n\n const buffer = Buffer.allocUnsafe(bodyLength + offset)\n\n // Clear first 2 bytes, everything else is overwritten\n buffer[0] = buffer[1] = 0\n buffer[0] |= 0x80 // FIN\n buffer[0] = (buffer[0] & 0xF0) + opcode // opcode\n\n /*! ws. MIT License. Einar Otto Stangvik */\n buffer[offset - 4] = this.maskKey[0]\n buffer[offset - 3] = this.maskKey[1]\n buffer[offset - 2] = this.maskKey[2]\n buffer[offset - 1] = this.maskKey[3]\n\n buffer[1] = payloadLength\n\n if (payloadLength === 126) {\n buffer.writeUInt16BE(bodyLength, 2)\n } else if (payloadLength === 127) {\n // Clear extended payload length\n buffer[2] = buffer[3] = 0\n buffer.writeUIntBE(bodyLength, 4, 6)\n }\n\n buffer[1] |= 0x80 // MASK\n\n // mask body\n for (let i = 0; i < bodyLength; i++) {\n buffer[offset + i] = this.frameData[i] ^ this.maskKey[i % 4]\n }\n\n return buffer\n }\n}\n\nmodule.exports = {\n WebsocketFrameSend\n}\n","'use strict'\n\nconst { Writable } = require('stream')\nconst diagnosticsChannel = require('diagnostics_channel')\nconst { parserStates, opcodes, states, emptyBuffer } = require('./constants')\nconst { kReadyState, kSentClose, kResponse, kReceivedClose } = require('./symbols')\nconst { isValidStatusCode, failWebsocketConnection, websocketMessageReceived } = require('./util')\nconst { WebsocketFrameSend } = require('./frame')\n\n// This code was influenced by ws released under the MIT license.\n// Copyright (c) 2011 Einar Otto Stangvik \n// Copyright (c) 2013 Arnout Kazemier and contributors\n// Copyright (c) 2016 Luigi Pinca and contributors\n\nconst channels = {}\nchannels.ping = diagnosticsChannel.channel('undici:websocket:ping')\nchannels.pong = diagnosticsChannel.channel('undici:websocket:pong')\n\nclass ByteParser extends Writable {\n #buffers = []\n #byteOffset = 0\n\n #state = parserStates.INFO\n\n #info = {}\n #fragments = []\n\n constructor (ws) {\n super()\n\n this.ws = ws\n }\n\n /**\n * @param {Buffer} chunk\n * @param {() => void} callback\n */\n _write (chunk, _, callback) {\n this.#buffers.push(chunk)\n this.#byteOffset += chunk.length\n\n this.run(callback)\n }\n\n /**\n * Runs whenever a new chunk is received.\n * Callback is called whenever there are no more chunks buffering,\n * or not enough bytes are buffered to parse.\n */\n run (callback) {\n while (true) {\n if (this.#state === parserStates.INFO) {\n // If there aren't enough bytes to parse the payload length, etc.\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.fin = (buffer[0] & 0x80) !== 0\n this.#info.opcode = buffer[0] & 0x0F\n\n // If we receive a fragmented message, we use the type of the first\n // frame to parse the full message as binary/text, when it's terminated\n this.#info.originalOpcode ??= this.#info.opcode\n\n this.#info.fragmented = !this.#info.fin && this.#info.opcode !== opcodes.CONTINUATION\n\n if (this.#info.fragmented && this.#info.opcode !== opcodes.BINARY && this.#info.opcode !== opcodes.TEXT) {\n // Only text and binary frames can be fragmented\n failWebsocketConnection(this.ws, 'Invalid frame type was fragmented.')\n return\n }\n\n const payloadLength = buffer[1] & 0x7F\n\n if (payloadLength <= 125) {\n this.#info.payloadLength = payloadLength\n this.#state = parserStates.READ_DATA\n } else if (payloadLength === 126) {\n this.#state = parserStates.PAYLOADLENGTH_16\n } else if (payloadLength === 127) {\n this.#state = parserStates.PAYLOADLENGTH_64\n }\n\n if (this.#info.fragmented && payloadLength > 125) {\n // A fragmented frame can't be fragmented itself\n failWebsocketConnection(this.ws, 'Fragmented frame exceeded 125 bytes.')\n return\n } else if (\n (this.#info.opcode === opcodes.PING ||\n this.#info.opcode === opcodes.PONG ||\n this.#info.opcode === opcodes.CLOSE) &&\n payloadLength > 125\n ) {\n // Control frames can have a payload length of 125 bytes MAX\n failWebsocketConnection(this.ws, 'Payload length for control frame exceeded 125 bytes.')\n return\n } else if (this.#info.opcode === opcodes.CLOSE) {\n if (payloadLength === 1) {\n failWebsocketConnection(this.ws, 'Received close frame with a 1-byte body.')\n return\n }\n\n const body = this.consume(payloadLength)\n\n this.#info.closeInfo = this.parseCloseBody(false, body)\n\n if (!this.ws[kSentClose]) {\n // If an endpoint receives a Close frame and did not previously send a\n // Close frame, the endpoint MUST send a Close frame in response. (When\n // sending a Close frame in response, the endpoint typically echos the\n // status code it received.)\n const body = Buffer.allocUnsafe(2)\n body.writeUInt16BE(this.#info.closeInfo.code, 0)\n const closeFrame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(\n closeFrame.createFrame(opcodes.CLOSE),\n (err) => {\n if (!err) {\n this.ws[kSentClose] = true\n }\n }\n )\n }\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n this.ws[kReadyState] = states.CLOSING\n this.ws[kReceivedClose] = true\n\n this.end()\n\n return\n } else if (this.#info.opcode === opcodes.PING) {\n // Upon receipt of a Ping frame, an endpoint MUST send a Pong frame in\n // response, unless it already received a Close frame.\n // A Pong frame sent in response to a Ping frame must have identical\n // \"Application data\"\n\n const body = this.consume(payloadLength)\n\n if (!this.ws[kReceivedClose]) {\n const frame = new WebsocketFrameSend(body)\n\n this.ws[kResponse].socket.write(frame.createFrame(opcodes.PONG))\n\n if (channels.ping.hasSubscribers) {\n channels.ping.publish({\n payload: body\n })\n }\n }\n\n this.#state = parserStates.INFO\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n return\n }\n } else if (this.#info.opcode === opcodes.PONG) {\n // A Pong frame MAY be sent unsolicited. This serves as a\n // unidirectional heartbeat. A response to an unsolicited Pong frame is\n // not expected.\n\n const body = this.consume(payloadLength)\n\n if (channels.pong.hasSubscribers) {\n channels.pong.publish({\n payload: body\n })\n }\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n return\n }\n }\n } else if (this.#state === parserStates.PAYLOADLENGTH_16) {\n if (this.#byteOffset < 2) {\n return callback()\n }\n\n const buffer = this.consume(2)\n\n this.#info.payloadLength = buffer.readUInt16BE(0)\n this.#state = parserStates.READ_DATA\n } else if (this.#state === parserStates.PAYLOADLENGTH_64) {\n if (this.#byteOffset < 8) {\n return callback()\n }\n\n const buffer = this.consume(8)\n const upper = buffer.readUInt32BE(0)\n\n // 2^31 is the maxinimum bytes an arraybuffer can contain\n // on 32-bit systems. Although, on 64-bit systems, this is\n // 2^53-1 bytes.\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/common/globals.h;drc=1946212ac0100668f14eb9e2843bdd846e510a1e;bpv=1;bpt=1;l=1275\n // https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/js-array-buffer.h;l=34;drc=1946212ac0100668f14eb9e2843bdd846e510a1e\n if (upper > 2 ** 31 - 1) {\n failWebsocketConnection(this.ws, 'Received payload length > 2^31 bytes.')\n return\n }\n\n const lower = buffer.readUInt32BE(4)\n\n this.#info.payloadLength = (upper << 8) + lower\n this.#state = parserStates.READ_DATA\n } else if (this.#state === parserStates.READ_DATA) {\n if (this.#byteOffset < this.#info.payloadLength) {\n // If there is still more data in this chunk that needs to be read\n return callback()\n } else if (this.#byteOffset >= this.#info.payloadLength) {\n // If the server sent multiple frames in a single chunk\n\n const body = this.consume(this.#info.payloadLength)\n\n this.#fragments.push(body)\n\n // If the frame is unfragmented, or a fragmented frame was terminated,\n // a message was received\n if (!this.#info.fragmented || (this.#info.fin && this.#info.opcode === opcodes.CONTINUATION)) {\n const fullMessage = Buffer.concat(this.#fragments)\n\n websocketMessageReceived(this.ws, this.#info.originalOpcode, fullMessage)\n\n this.#info = {}\n this.#fragments.length = 0\n }\n\n this.#state = parserStates.INFO\n }\n }\n\n if (this.#byteOffset > 0) {\n continue\n } else {\n callback()\n break\n }\n }\n }\n\n /**\n * Take n bytes from the buffered Buffers\n * @param {number} n\n * @returns {Buffer|null}\n */\n consume (n) {\n if (n > this.#byteOffset) {\n return null\n } else if (n === 0) {\n return emptyBuffer\n }\n\n if (this.#buffers[0].length === n) {\n this.#byteOffset -= this.#buffers[0].length\n return this.#buffers.shift()\n }\n\n const buffer = Buffer.allocUnsafe(n)\n let offset = 0\n\n while (offset !== n) {\n const next = this.#buffers[0]\n const { length } = next\n\n if (length + offset === n) {\n buffer.set(this.#buffers.shift(), offset)\n break\n } else if (length + offset > n) {\n buffer.set(next.subarray(0, n - offset), offset)\n this.#buffers[0] = next.subarray(n - offset)\n break\n } else {\n buffer.set(this.#buffers.shift(), offset)\n offset += next.length\n }\n }\n\n this.#byteOffset -= n\n\n return buffer\n }\n\n parseCloseBody (onlyCode, data) {\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.5\n /** @type {number|undefined} */\n let code\n\n if (data.length >= 2) {\n // _The WebSocket Connection Close Code_ is\n // defined as the status code (Section 7.4) contained in the first Close\n // control frame received by the application\n code = data.readUInt16BE(0)\n }\n\n if (onlyCode) {\n if (!isValidStatusCode(code)) {\n return null\n }\n\n return { code }\n }\n\n // https://datatracker.ietf.org/doc/html/rfc6455#section-7.1.6\n /** @type {Buffer} */\n let reason = data.subarray(2)\n\n // Remove BOM\n if (reason[0] === 0xEF && reason[1] === 0xBB && reason[2] === 0xBF) {\n reason = reason.subarray(3)\n }\n\n if (code !== undefined && !isValidStatusCode(code)) {\n return null\n }\n\n try {\n // TODO: optimize this\n reason = new TextDecoder('utf-8', { fatal: true }).decode(reason)\n } catch {\n return null\n }\n\n return { code, reason }\n }\n\n get closingInfo () {\n return this.#info.closeInfo\n }\n}\n\nmodule.exports = {\n ByteParser\n}\n","'use strict'\n\nmodule.exports = {\n kWebSocketURL: Symbol('url'),\n kReadyState: Symbol('ready state'),\n kController: Symbol('controller'),\n kResponse: Symbol('response'),\n kBinaryType: Symbol('binary type'),\n kSentClose: Symbol('sent close'),\n kReceivedClose: Symbol('received close'),\n kByteParser: Symbol('byte parser')\n}\n","'use strict'\n\nconst { kReadyState, kController, kResponse, kBinaryType, kWebSocketURL } = require('./symbols')\nconst { states, opcodes } = require('./constants')\nconst { MessageEvent, ErrorEvent } = require('./events')\n\n/* globals Blob */\n\n/**\n * @param {import('./websocket').WebSocket} ws\n */\nfunction isEstablished (ws) {\n // If the server's response is validated as provided for above, it is\n // said that _The WebSocket Connection is Established_ and that the\n // WebSocket Connection is in the OPEN state.\n return ws[kReadyState] === states.OPEN\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n */\nfunction isClosing (ws) {\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n return ws[kReadyState] === states.CLOSING\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n */\nfunction isClosed (ws) {\n return ws[kReadyState] === states.CLOSED\n}\n\n/**\n * @see https://dom.spec.whatwg.org/#concept-event-fire\n * @param {string} e\n * @param {EventTarget} target\n * @param {EventInit | undefined} eventInitDict\n */\nfunction fireEvent (e, target, eventConstructor = Event, eventInitDict) {\n // 1. If eventConstructor is not given, then let eventConstructor be Event.\n\n // 2. Let event be the result of creating an event given eventConstructor,\n // in the relevant realm of target.\n // 3. Initialize event’s type attribute to e.\n const event = new eventConstructor(e, eventInitDict) // eslint-disable-line new-cap\n\n // 4. Initialize any other IDL attributes of event as described in the\n // invocation of this algorithm.\n\n // 5. Return the result of dispatching event at target, with legacy target\n // override flag set if set.\n target.dispatchEvent(event)\n}\n\n/**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n * @param {import('./websocket').WebSocket} ws\n * @param {number} type Opcode\n * @param {Buffer} data application data\n */\nfunction websocketMessageReceived (ws, type, data) {\n // 1. If ready state is not OPEN (1), then return.\n if (ws[kReadyState] !== states.OPEN) {\n return\n }\n\n // 2. Let dataForEvent be determined by switching on type and binary type:\n let dataForEvent\n\n if (type === opcodes.TEXT) {\n // -> type indicates that the data is Text\n // a new DOMString containing data\n try {\n dataForEvent = new TextDecoder('utf-8', { fatal: true }).decode(data)\n } catch {\n failWebsocketConnection(ws, 'Received invalid UTF-8 in text frame.')\n return\n }\n } else if (type === opcodes.BINARY) {\n if (ws[kBinaryType] === 'blob') {\n // -> type indicates that the data is Binary and binary type is \"blob\"\n // a new Blob object, created in the relevant Realm of the WebSocket\n // object, that represents data as its raw data\n dataForEvent = new Blob([data])\n } else {\n // -> type indicates that the data is Binary and binary type is \"arraybuffer\"\n // a new ArrayBuffer object, created in the relevant Realm of the\n // WebSocket object, whose contents are data\n dataForEvent = new Uint8Array(data).buffer\n }\n }\n\n // 3. Fire an event named message at the WebSocket object, using MessageEvent,\n // with the origin attribute initialized to the serialization of the WebSocket\n // object’s url's origin, and the data attribute initialized to dataForEvent.\n fireEvent('message', ws, MessageEvent, {\n origin: ws[kWebSocketURL].origin,\n data: dataForEvent\n })\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455\n * @see https://datatracker.ietf.org/doc/html/rfc2616\n * @see https://bugs.chromium.org/p/chromium/issues/detail?id=398407\n * @param {string} protocol\n */\nfunction isValidSubprotocol (protocol) {\n // If present, this value indicates one\n // or more comma-separated subprotocol the client wishes to speak,\n // ordered by preference. The elements that comprise this value\n // MUST be non-empty strings with characters in the range U+0021 to\n // U+007E not including separator characters as defined in\n // [RFC2616] and MUST all be unique strings.\n if (protocol.length === 0) {\n return false\n }\n\n for (const char of protocol) {\n const code = char.charCodeAt(0)\n\n if (\n code < 0x21 ||\n code > 0x7E ||\n char === '(' ||\n char === ')' ||\n char === '<' ||\n char === '>' ||\n char === '@' ||\n char === ',' ||\n char === ';' ||\n char === ':' ||\n char === '\\\\' ||\n char === '\"' ||\n char === '/' ||\n char === '[' ||\n char === ']' ||\n char === '?' ||\n char === '=' ||\n char === '{' ||\n char === '}' ||\n code === 32 || // SP\n code === 9 // HT\n ) {\n return false\n }\n }\n\n return true\n}\n\n/**\n * @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4\n * @param {number} code\n */\nfunction isValidStatusCode (code) {\n if (code >= 1000 && code < 1015) {\n return (\n code !== 1004 && // reserved\n code !== 1005 && // \"MUST NOT be set as a status code\"\n code !== 1006 // \"MUST NOT be set as a status code\"\n )\n }\n\n return code >= 3000 && code <= 4999\n}\n\n/**\n * @param {import('./websocket').WebSocket} ws\n * @param {string|undefined} reason\n */\nfunction failWebsocketConnection (ws, reason) {\n const { [kController]: controller, [kResponse]: response } = ws\n\n controller.abort()\n\n if (response?.socket && !response.socket.destroyed) {\n response.socket.destroy()\n }\n\n if (reason) {\n fireEvent('error', ws, ErrorEvent, {\n error: new Error(reason)\n })\n }\n}\n\nmodule.exports = {\n isEstablished,\n isClosing,\n isClosed,\n fireEvent,\n isValidSubprotocol,\n isValidStatusCode,\n failWebsocketConnection,\n websocketMessageReceived\n}\n","'use strict'\n\nconst { webidl } = require('../fetch/webidl')\nconst { DOMException } = require('../fetch/constants')\nconst { URLSerializer } = require('../fetch/dataURL')\nconst { getGlobalOrigin } = require('../fetch/global')\nconst { staticPropertyDescriptors, states, opcodes, emptyBuffer } = require('./constants')\nconst {\n kWebSocketURL,\n kReadyState,\n kController,\n kBinaryType,\n kResponse,\n kSentClose,\n kByteParser\n} = require('./symbols')\nconst { isEstablished, isClosing, isValidSubprotocol, failWebsocketConnection, fireEvent } = require('./util')\nconst { establishWebSocketConnection } = require('./connection')\nconst { WebsocketFrameSend } = require('./frame')\nconst { ByteParser } = require('./receiver')\nconst { kEnumerableProperty, isBlobLike } = require('../core/util')\nconst { getGlobalDispatcher } = require('../global')\nconst { types } = require('util')\n\nlet experimentalWarned = false\n\n// https://websockets.spec.whatwg.org/#interface-definition\nclass WebSocket extends EventTarget {\n #events = {\n open: null,\n error: null,\n close: null,\n message: null\n }\n\n #bufferedAmount = 0\n #protocol = ''\n #extensions = ''\n\n /**\n * @param {string} url\n * @param {string|string[]} protocols\n */\n constructor (url, protocols = []) {\n super()\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket constructor' })\n\n if (!experimentalWarned) {\n experimentalWarned = true\n process.emitWarning('WebSockets are experimental, expect them to change at any time.', {\n code: 'UNDICI-WS'\n })\n }\n\n const options = webidl.converters['DOMString or sequence or WebSocketInit'](protocols)\n\n url = webidl.converters.USVString(url)\n protocols = options.protocols\n\n // 1. Let baseURL be this's relevant settings object's API base URL.\n const baseURL = getGlobalOrigin()\n\n // 1. Let urlRecord be the result of applying the URL parser to url with baseURL.\n let urlRecord\n\n try {\n urlRecord = new URL(url, baseURL)\n } catch (e) {\n // 3. If urlRecord is failure, then throw a \"SyntaxError\" DOMException.\n throw new DOMException(e, 'SyntaxError')\n }\n\n // 4. If urlRecord’s scheme is \"http\", then set urlRecord’s scheme to \"ws\".\n if (urlRecord.protocol === 'http:') {\n urlRecord.protocol = 'ws:'\n } else if (urlRecord.protocol === 'https:') {\n // 5. Otherwise, if urlRecord’s scheme is \"https\", set urlRecord’s scheme to \"wss\".\n urlRecord.protocol = 'wss:'\n }\n\n // 6. If urlRecord’s scheme is not \"ws\" or \"wss\", then throw a \"SyntaxError\" DOMException.\n if (urlRecord.protocol !== 'ws:' && urlRecord.protocol !== 'wss:') {\n throw new DOMException(\n `Expected a ws: or wss: protocol, got ${urlRecord.protocol}`,\n 'SyntaxError'\n )\n }\n\n // 7. If urlRecord’s fragment is non-null, then throw a \"SyntaxError\"\n // DOMException.\n if (urlRecord.hash || urlRecord.href.endsWith('#')) {\n throw new DOMException('Got fragment', 'SyntaxError')\n }\n\n // 8. If protocols is a string, set protocols to a sequence consisting\n // of just that string.\n if (typeof protocols === 'string') {\n protocols = [protocols]\n }\n\n // 9. If any of the values in protocols occur more than once or otherwise\n // fail to match the requirements for elements that comprise the value\n // of `Sec-WebSocket-Protocol` fields as defined by The WebSocket\n // protocol, then throw a \"SyntaxError\" DOMException.\n if (protocols.length !== new Set(protocols.map(p => p.toLowerCase())).size) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n if (protocols.length > 0 && !protocols.every(p => isValidSubprotocol(p))) {\n throw new DOMException('Invalid Sec-WebSocket-Protocol value', 'SyntaxError')\n }\n\n // 10. Set this's url to urlRecord.\n this[kWebSocketURL] = new URL(urlRecord.href)\n\n // 11. Let client be this's relevant settings object.\n\n // 12. Run this step in parallel:\n\n // 1. Establish a WebSocket connection given urlRecord, protocols,\n // and client.\n this[kController] = establishWebSocketConnection(\n urlRecord,\n protocols,\n this,\n (response) => this.#onConnectionEstablished(response),\n options\n )\n\n // Each WebSocket object has an associated ready state, which is a\n // number representing the state of the connection. Initially it must\n // be CONNECTING (0).\n this[kReadyState] = WebSocket.CONNECTING\n\n // The extensions attribute must initially return the empty string.\n\n // The protocol attribute must initially return the empty string.\n\n // Each WebSocket object has an associated binary type, which is a\n // BinaryType. Initially it must be \"blob\".\n this[kBinaryType] = 'blob'\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-close\n * @param {number|undefined} code\n * @param {string|undefined} reason\n */\n close (code = undefined, reason = undefined) {\n webidl.brandCheck(this, WebSocket)\n\n if (code !== undefined) {\n code = webidl.converters['unsigned short'](code, { clamp: true })\n }\n\n if (reason !== undefined) {\n reason = webidl.converters.USVString(reason)\n }\n\n // 1. If code is present, but is neither an integer equal to 1000 nor an\n // integer in the range 3000 to 4999, inclusive, throw an\n // \"InvalidAccessError\" DOMException.\n if (code !== undefined) {\n if (code !== 1000 && (code < 3000 || code > 4999)) {\n throw new DOMException('invalid code', 'InvalidAccessError')\n }\n }\n\n let reasonByteLength = 0\n\n // 2. If reason is present, then run these substeps:\n if (reason !== undefined) {\n // 1. Let reasonBytes be the result of encoding reason.\n // 2. If reasonBytes is longer than 123 bytes, then throw a\n // \"SyntaxError\" DOMException.\n reasonByteLength = Buffer.byteLength(reason)\n\n if (reasonByteLength > 123) {\n throw new DOMException(\n `Reason must be less than 123 bytes; received ${reasonByteLength}`,\n 'SyntaxError'\n )\n }\n }\n\n // 3. Run the first matching steps from the following list:\n if (this[kReadyState] === WebSocket.CLOSING || this[kReadyState] === WebSocket.CLOSED) {\n // If this's ready state is CLOSING (2) or CLOSED (3)\n // Do nothing.\n } else if (!isEstablished(this)) {\n // If the WebSocket connection is not yet established\n // Fail the WebSocket connection and set this's ready state\n // to CLOSING (2).\n failWebsocketConnection(this, 'Connection was closed before it was established.')\n this[kReadyState] = WebSocket.CLOSING\n } else if (!isClosing(this)) {\n // If the WebSocket closing handshake has not yet been started\n // Start the WebSocket closing handshake and set this's ready\n // state to CLOSING (2).\n // - If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n // - If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n // - If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n\n const frame = new WebsocketFrameSend()\n\n // If neither code nor reason is present, the WebSocket Close\n // message must not have a body.\n\n // If code is present, then the status code to use in the\n // WebSocket Close message must be the integer given by code.\n if (code !== undefined && reason === undefined) {\n frame.frameData = Buffer.allocUnsafe(2)\n frame.frameData.writeUInt16BE(code, 0)\n } else if (code !== undefined && reason !== undefined) {\n // If reason is also present, then reasonBytes must be\n // provided in the Close message after the status code.\n frame.frameData = Buffer.allocUnsafe(2 + reasonByteLength)\n frame.frameData.writeUInt16BE(code, 0)\n // the body MAY contain UTF-8-encoded data with value /reason/\n frame.frameData.write(reason, 2, 'utf-8')\n } else {\n frame.frameData = emptyBuffer\n }\n\n /** @type {import('stream').Duplex} */\n const socket = this[kResponse].socket\n\n socket.write(frame.createFrame(opcodes.CLOSE), (err) => {\n if (!err) {\n this[kSentClose] = true\n }\n })\n\n // Upon either sending or receiving a Close control frame, it is said\n // that _The WebSocket Closing Handshake is Started_ and that the\n // WebSocket connection is in the CLOSING state.\n this[kReadyState] = states.CLOSING\n } else {\n // Otherwise\n // Set this's ready state to CLOSING (2).\n this[kReadyState] = WebSocket.CLOSING\n }\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#dom-websocket-send\n * @param {NodeJS.TypedArray|ArrayBuffer|Blob|string} data\n */\n send (data) {\n webidl.brandCheck(this, WebSocket)\n\n webidl.argumentLengthCheck(arguments, 1, { header: 'WebSocket.send' })\n\n data = webidl.converters.WebSocketSendData(data)\n\n // 1. If this's ready state is CONNECTING, then throw an\n // \"InvalidStateError\" DOMException.\n if (this[kReadyState] === WebSocket.CONNECTING) {\n throw new DOMException('Sent before connected.', 'InvalidStateError')\n }\n\n // 2. Run the appropriate set of steps from the following list:\n // https://datatracker.ietf.org/doc/html/rfc6455#section-6.1\n // https://datatracker.ietf.org/doc/html/rfc6455#section-5.2\n\n if (!isEstablished(this) || isClosing(this)) {\n return\n }\n\n /** @type {import('stream').Duplex} */\n const socket = this[kResponse].socket\n\n // If data is a string\n if (typeof data === 'string') {\n // If the WebSocket connection is established and the WebSocket\n // closing handshake has not yet started, then the user agent\n // must send a WebSocket Message comprised of the data argument\n // using a text frame opcode; if the data cannot be sent, e.g.\n // because it would need to be buffered but the buffer is full,\n // the user agent must flag the WebSocket as full and then close\n // the WebSocket connection. Any invocation of this method with a\n // string argument that does not throw an exception must increase\n // the bufferedAmount attribute by the number of bytes needed to\n // express the argument as UTF-8.\n\n const value = Buffer.from(data)\n const frame = new WebsocketFrameSend(value)\n const buffer = frame.createFrame(opcodes.TEXT)\n\n this.#bufferedAmount += value.byteLength\n socket.write(buffer, () => {\n this.#bufferedAmount -= value.byteLength\n })\n } else if (types.isArrayBuffer(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need\n // to be buffered but the buffer is full, the user agent must flag\n // the WebSocket as full and then close the WebSocket connection.\n // The data to be sent is the data stored in the buffer described\n // by the ArrayBuffer object. Any invocation of this method with an\n // ArrayBuffer argument that does not throw an exception must\n // increase the bufferedAmount attribute by the length of the\n // ArrayBuffer in bytes.\n\n const value = Buffer.from(data)\n const frame = new WebsocketFrameSend(value)\n const buffer = frame.createFrame(opcodes.BINARY)\n\n this.#bufferedAmount += value.byteLength\n socket.write(buffer, () => {\n this.#bufferedAmount -= value.byteLength\n })\n } else if (ArrayBuffer.isView(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The\n // data to be sent is the data stored in the section of the buffer\n // described by the ArrayBuffer object that data references. Any\n // invocation of this method with this kind of argument that does\n // not throw an exception must increase the bufferedAmount attribute\n // by the length of data’s buffer in bytes.\n\n const ab = Buffer.from(data, data.byteOffset, data.byteLength)\n\n const frame = new WebsocketFrameSend(ab)\n const buffer = frame.createFrame(opcodes.BINARY)\n\n this.#bufferedAmount += ab.byteLength\n socket.write(buffer, () => {\n this.#bufferedAmount -= ab.byteLength\n })\n } else if (isBlobLike(data)) {\n // If the WebSocket connection is established, and the WebSocket\n // closing handshake has not yet started, then the user agent must\n // send a WebSocket Message comprised of data using a binary frame\n // opcode; if the data cannot be sent, e.g. because it would need to\n // be buffered but the buffer is full, the user agent must flag the\n // WebSocket as full and then close the WebSocket connection. The data\n // to be sent is the raw data represented by the Blob object. Any\n // invocation of this method with a Blob argument that does not throw\n // an exception must increase the bufferedAmount attribute by the size\n // of the Blob object’s raw data, in bytes.\n\n const frame = new WebsocketFrameSend()\n\n data.arrayBuffer().then((ab) => {\n const value = Buffer.from(ab)\n frame.frameData = value\n const buffer = frame.createFrame(opcodes.BINARY)\n\n this.#bufferedAmount += value.byteLength\n socket.write(buffer, () => {\n this.#bufferedAmount -= value.byteLength\n })\n })\n }\n }\n\n get readyState () {\n webidl.brandCheck(this, WebSocket)\n\n // The readyState getter steps are to return this's ready state.\n return this[kReadyState]\n }\n\n get bufferedAmount () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#bufferedAmount\n }\n\n get url () {\n webidl.brandCheck(this, WebSocket)\n\n // The url getter steps are to return this's url, serialized.\n return URLSerializer(this[kWebSocketURL])\n }\n\n get extensions () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#extensions\n }\n\n get protocol () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#protocol\n }\n\n get onopen () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.open\n }\n\n set onopen (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.open) {\n this.removeEventListener('open', this.#events.open)\n }\n\n if (typeof fn === 'function') {\n this.#events.open = fn\n this.addEventListener('open', fn)\n } else {\n this.#events.open = null\n }\n }\n\n get onerror () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.error\n }\n\n set onerror (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.error) {\n this.removeEventListener('error', this.#events.error)\n }\n\n if (typeof fn === 'function') {\n this.#events.error = fn\n this.addEventListener('error', fn)\n } else {\n this.#events.error = null\n }\n }\n\n get onclose () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.close\n }\n\n set onclose (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.close) {\n this.removeEventListener('close', this.#events.close)\n }\n\n if (typeof fn === 'function') {\n this.#events.close = fn\n this.addEventListener('close', fn)\n } else {\n this.#events.close = null\n }\n }\n\n get onmessage () {\n webidl.brandCheck(this, WebSocket)\n\n return this.#events.message\n }\n\n set onmessage (fn) {\n webidl.brandCheck(this, WebSocket)\n\n if (this.#events.message) {\n this.removeEventListener('message', this.#events.message)\n }\n\n if (typeof fn === 'function') {\n this.#events.message = fn\n this.addEventListener('message', fn)\n } else {\n this.#events.message = null\n }\n }\n\n get binaryType () {\n webidl.brandCheck(this, WebSocket)\n\n return this[kBinaryType]\n }\n\n set binaryType (type) {\n webidl.brandCheck(this, WebSocket)\n\n if (type !== 'blob' && type !== 'arraybuffer') {\n this[kBinaryType] = 'blob'\n } else {\n this[kBinaryType] = type\n }\n }\n\n /**\n * @see https://websockets.spec.whatwg.org/#feedback-from-the-protocol\n */\n #onConnectionEstablished (response) {\n // processResponse is called when the \"response’s header list has been received and initialized.\"\n // once this happens, the connection is open\n this[kResponse] = response\n\n const parser = new ByteParser(this)\n parser.on('drain', function onParserDrain () {\n this.ws[kResponse].socket.resume()\n })\n\n response.socket.ws = this\n this[kByteParser] = parser\n\n // 1. Change the ready state to OPEN (1).\n this[kReadyState] = states.OPEN\n\n // 2. Change the extensions attribute’s value to the extensions in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-9.1\n const extensions = response.headersList.get('sec-websocket-extensions')\n\n if (extensions !== null) {\n this.#extensions = extensions\n }\n\n // 3. Change the protocol attribute’s value to the subprotocol in use, if\n // it is not the null value.\n // https://datatracker.ietf.org/doc/html/rfc6455#section-1.9\n const protocol = response.headersList.get('sec-websocket-protocol')\n\n if (protocol !== null) {\n this.#protocol = protocol\n }\n\n // 4. Fire an event named open at the WebSocket object.\n fireEvent('open', this)\n }\n}\n\n// https://websockets.spec.whatwg.org/#dom-websocket-connecting\nWebSocket.CONNECTING = WebSocket.prototype.CONNECTING = states.CONNECTING\n// https://websockets.spec.whatwg.org/#dom-websocket-open\nWebSocket.OPEN = WebSocket.prototype.OPEN = states.OPEN\n// https://websockets.spec.whatwg.org/#dom-websocket-closing\nWebSocket.CLOSING = WebSocket.prototype.CLOSING = states.CLOSING\n// https://websockets.spec.whatwg.org/#dom-websocket-closed\nWebSocket.CLOSED = WebSocket.prototype.CLOSED = states.CLOSED\n\nObject.defineProperties(WebSocket.prototype, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors,\n url: kEnumerableProperty,\n readyState: kEnumerableProperty,\n bufferedAmount: kEnumerableProperty,\n onopen: kEnumerableProperty,\n onerror: kEnumerableProperty,\n onclose: kEnumerableProperty,\n close: kEnumerableProperty,\n onmessage: kEnumerableProperty,\n binaryType: kEnumerableProperty,\n send: kEnumerableProperty,\n extensions: kEnumerableProperty,\n protocol: kEnumerableProperty,\n [Symbol.toStringTag]: {\n value: 'WebSocket',\n writable: false,\n enumerable: false,\n configurable: true\n }\n})\n\nObject.defineProperties(WebSocket, {\n CONNECTING: staticPropertyDescriptors,\n OPEN: staticPropertyDescriptors,\n CLOSING: staticPropertyDescriptors,\n CLOSED: staticPropertyDescriptors\n})\n\nwebidl.converters['sequence'] = webidl.sequenceConverter(\n webidl.converters.DOMString\n)\n\nwebidl.converters['DOMString or sequence'] = function (V) {\n if (webidl.util.Type(V) === 'Object' && Symbol.iterator in V) {\n return webidl.converters['sequence'](V)\n }\n\n return webidl.converters.DOMString(V)\n}\n\n// This implements the propsal made in https://github.com/whatwg/websockets/issues/42\nwebidl.converters.WebSocketInit = webidl.dictionaryConverter([\n {\n key: 'protocols',\n converter: webidl.converters['DOMString or sequence'],\n get defaultValue () {\n return []\n }\n },\n {\n key: 'dispatcher',\n converter: (V) => V,\n get defaultValue () {\n return getGlobalDispatcher()\n }\n },\n {\n key: 'headers',\n converter: webidl.nullableConverter(webidl.converters.HeadersInit)\n }\n])\n\nwebidl.converters['DOMString or sequence or WebSocketInit'] = function (V) {\n if (webidl.util.Type(V) === 'Object' && !(Symbol.iterator in V)) {\n return webidl.converters.WebSocketInit(V)\n }\n\n return { protocols: webidl.converters['DOMString or sequence'](V) }\n}\n\nwebidl.converters.WebSocketSendData = function (V) {\n if (webidl.util.Type(V) === 'Object') {\n if (isBlobLike(V)) {\n return webidl.converters.Blob(V, { strict: false })\n }\n\n if (ArrayBuffer.isView(V) || types.isAnyArrayBuffer(V)) {\n return webidl.converters.BufferSource(V)\n }\n }\n\n return webidl.converters.USVString(V)\n}\n\nmodule.exports = {\n WebSocket\n}\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nfunction getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n\n if (typeof process === \"object\" && \"version\" in process) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n\n return \"\";\n}\n\nexports.getUserAgent = getUserAgent;\n//# sourceMappingURL=index.js.map\n","/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */\n(function (global, factory) {\n\ttypeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :\n\ttypeof define === 'function' && define.amd ? define(['exports'], factory) :\n\t(factory((global.URI = global.URI || {})));\n}(this, (function (exports) { 'use strict';\n\nfunction merge() {\n for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {\n sets[_key] = arguments[_key];\n }\n\n if (sets.length > 1) {\n sets[0] = sets[0].slice(0, -1);\n var xl = sets.length - 1;\n for (var x = 1; x < xl; ++x) {\n sets[x] = sets[x].slice(1, -1);\n }\n sets[xl] = sets[xl].slice(1);\n return sets.join('');\n } else {\n return sets[0];\n }\n}\nfunction subexp(str) {\n return \"(?:\" + str + \")\";\n}\nfunction typeOf(o) {\n return o === undefined ? \"undefined\" : o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase();\n}\nfunction toUpperCase(str) {\n return str.toUpperCase();\n}\nfunction toArray(obj) {\n return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];\n}\nfunction assign(target, source) {\n var obj = target;\n if (source) {\n for (var key in source) {\n obj[key] = source[key];\n }\n }\n return obj;\n}\n\nfunction buildExps(isIRI) {\n var ALPHA$$ = \"[A-Za-z]\",\n CR$ = \"[\\\\x0D]\",\n DIGIT$$ = \"[0-9]\",\n DQUOTE$$ = \"[\\\\x22]\",\n HEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"),\n //case-insensitive\n LF$$ = \"[\\\\x0A]\",\n SP$$ = \"[\\\\x20]\",\n PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)),\n //expanded\n GEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n SUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n UCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\",\n //subset, excludes bidi control characters\n IPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\",\n //subset\n UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n USERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n DEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n DEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$),\n //relaxed parsing rules\n IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n H16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n LS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n IPV6ADDRESS1$ = subexp(subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$),\n // 6( h16 \":\" ) ls32\n IPV6ADDRESS2$ = subexp(\"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$),\n // \"::\" 5( h16 \":\" ) ls32\n IPV6ADDRESS3$ = subexp(subexp(H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$),\n //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$),\n //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$),\n //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$),\n //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$),\n //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$),\n //[ *5( h16 \":\" ) h16 ] \"::\" h16\n IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\"),\n //[ *6( h16 \":\" ) h16 ] \"::\"\n IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n ZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"),\n //RFC 6874\n IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$),\n //RFC 6874\n IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$),\n //RFC 6874, with relaxed parsing rules\n IPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n IP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"),\n //RFC 6874\n REG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n HOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n PORT$ = subexp(DIGIT$$ + \"*\"),\n AUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n PCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n SEGMENT$ = subexp(PCHAR$ + \"*\"),\n SEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n PATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n PATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"),\n //simplified\n PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),\n //simplified\n PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),\n //simplified\n PATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n PATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n QUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n FRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n HIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n RELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n RELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n URI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n ABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n GENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n RELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n ABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n SAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n AUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\";\n return {\n NOT_SCHEME: new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n NOT_USERINFO: new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_HOST: new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_PATH: new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_PATH_NOSCHEME: new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n NOT_QUERY: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n NOT_FRAGMENT: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n ESCAPE: new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n UNRESERVED: new RegExp(UNRESERVED$$, \"g\"),\n OTHER_CHARS: new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n PCT_ENCODED: new RegExp(PCT_ENCODED$, \"g\"),\n IPV4ADDRESS: new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n IPV6ADDRESS: new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n };\n}\nvar URI_PROTOCOL = buildExps(false);\n\nvar IRI_PROTOCOL = buildExps(true);\n\nvar slicedToArray = function () {\n function sliceIterator(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"]) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n }\n\n return function (arr, i) {\n if (Array.isArray(arr)) {\n return arr;\n } else if (Symbol.iterator in Object(arr)) {\n return sliceIterator(arr, i);\n } else {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n }\n };\n}();\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar toConsumableArray = function (arr) {\n if (Array.isArray(arr)) {\n for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];\n\n return arr2;\n } else {\n return Array.from(arr);\n }\n};\n\n/** Highest positive signed 32-bit float value */\n\nvar maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nvar base = 36;\nvar tMin = 1;\nvar tMax = 26;\nvar skew = 38;\nvar damp = 700;\nvar initialBias = 72;\nvar initialN = 128; // 0x80\nvar delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nvar regexPunycode = /^xn--/;\nvar regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nvar regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nvar errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nvar baseMinusTMin = base - tMin;\nvar floor = Math.floor;\nvar stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error$1(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tvar result = [];\n\tvar length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tvar parts = string.split('@');\n\tvar result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tvar labels = string.split('.');\n\tvar encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tvar output = [];\n\tvar counter = 0;\n\tvar length = string.length;\n\twhile (counter < length) {\n\t\tvar value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tvar extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) {\n\t\t\t\t// Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nvar ucs2encode = function ucs2encode(array) {\n\treturn String.fromCodePoint.apply(String, toConsumableArray(array));\n};\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nvar basicToDigit = function basicToDigit(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nvar digitToBasic = function digitToBasic(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nvar adapt = function adapt(delta, numPoints, firstTime) {\n\tvar k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nvar decode = function decode(input) {\n\t// Don't use UCS-2.\n\tvar output = [];\n\tvar inputLength = input.length;\n\tvar i = 0;\n\tvar n = initialN;\n\tvar bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tvar basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (var j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror$1('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tvar oldi = i;\n\t\tfor (var w = 1, k = base;; /* no condition */k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror$1('invalid-input');\n\t\t\t}\n\n\t\t\tvar digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror$1('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tvar t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tvar baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror$1('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\t\t}\n\n\t\tvar out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror$1('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\t}\n\n\treturn String.fromCodePoint.apply(String, output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nvar encode = function encode(input) {\n\tvar output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tvar inputLength = input.length;\n\n\t// Initialize the state.\n\tvar n = initialN;\n\tvar delta = 0;\n\tvar bias = initialBias;\n\n\t// Handle the basic code points.\n\tvar _iteratorNormalCompletion = true;\n\tvar _didIteratorError = false;\n\tvar _iteratorError = undefined;\n\n\ttry {\n\t\tfor (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n\t\t\tvar _currentValue2 = _step.value;\n\n\t\t\tif (_currentValue2 < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(_currentValue2));\n\t\t\t}\n\t\t}\n\t} catch (err) {\n\t\t_didIteratorError = true;\n\t\t_iteratorError = err;\n\t} finally {\n\t\ttry {\n\t\t\tif (!_iteratorNormalCompletion && _iterator.return) {\n\t\t\t\t_iterator.return();\n\t\t\t}\n\t\t} finally {\n\t\t\tif (_didIteratorError) {\n\t\t\t\tthrow _iteratorError;\n\t\t\t}\n\t\t}\n\t}\n\n\tvar basicLength = output.length;\n\tvar handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tvar m = maxInt;\n\t\tvar _iteratorNormalCompletion2 = true;\n\t\tvar _didIteratorError2 = false;\n\t\tvar _iteratorError2 = undefined;\n\n\t\ttry {\n\t\t\tfor (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {\n\t\t\t\tvar currentValue = _step2.value;\n\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow.\n\t\t} catch (err) {\n\t\t\t_didIteratorError2 = true;\n\t\t\t_iteratorError2 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion2 && _iterator2.return) {\n\t\t\t\t\t_iterator2.return();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError2) {\n\t\t\t\t\tthrow _iteratorError2;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tvar handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror$1('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tvar _iteratorNormalCompletion3 = true;\n\t\tvar _didIteratorError3 = false;\n\t\tvar _iteratorError3 = undefined;\n\n\t\ttry {\n\t\t\tfor (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {\n\t\t\t\tvar _currentValue = _step3.value;\n\n\t\t\t\tif (_currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror$1('overflow');\n\t\t\t\t}\n\t\t\t\tif (_currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\t\tvar q = delta;\n\t\t\t\t\tfor (var k = base;; /* no condition */k += base) {\n\t\t\t\t\t\tvar t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar qMinusT = q - t;\n\t\t\t\t\t\tvar baseMinusT = base - t;\n\t\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_didIteratorError3 = true;\n\t\t\t_iteratorError3 = err;\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (!_iteratorNormalCompletion3 && _iterator3.return) {\n\t\t\t\t\t_iterator3.return();\n\t\t\t\t}\n\t\t\t} finally {\n\t\t\t\tif (_didIteratorError3) {\n\t\t\t\t\tthrow _iteratorError3;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nvar toUnicode = function toUnicode(input) {\n\treturn mapDomain(input, function (string) {\n\t\treturn regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nvar toASCII = function toASCII(input) {\n\treturn mapDomain(input, function (string) {\n\t\treturn regexNonASCII.test(string) ? 'xn--' + encode(string) : string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nvar punycode = {\n\t/**\n * A string representing the current Punycode.js version number.\n * @memberOf punycode\n * @type String\n */\n\t'version': '2.1.0',\n\t/**\n * An object of methods to convert from JavaScript's internal character\n * representation (UCS-2) to Unicode code points, and back.\n * @see \n * @memberOf punycode\n * @type Object\n */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\n/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\nvar SCHEMES = {};\nfunction pctEncChar(chr) {\n var c = chr.charCodeAt(0);\n var e = void 0;\n if (c < 16) e = \"%0\" + c.toString(16).toUpperCase();else if (c < 128) e = \"%\" + c.toString(16).toUpperCase();else if (c < 2048) e = \"%\" + (c >> 6 | 192).toString(16).toUpperCase() + \"%\" + (c & 63 | 128).toString(16).toUpperCase();else e = \"%\" + (c >> 12 | 224).toString(16).toUpperCase() + \"%\" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + \"%\" + (c & 63 | 128).toString(16).toUpperCase();\n return e;\n}\nfunction pctDecChars(str) {\n var newStr = \"\";\n var i = 0;\n var il = str.length;\n while (i < il) {\n var c = parseInt(str.substr(i + 1, 2), 16);\n if (c < 128) {\n newStr += String.fromCharCode(c);\n i += 3;\n } else if (c >= 194 && c < 224) {\n if (il - i >= 6) {\n var c2 = parseInt(str.substr(i + 4, 2), 16);\n newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);\n } else {\n newStr += str.substr(i, 6);\n }\n i += 6;\n } else if (c >= 224) {\n if (il - i >= 9) {\n var _c = parseInt(str.substr(i + 4, 2), 16);\n var c3 = parseInt(str.substr(i + 7, 2), 16);\n newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);\n } else {\n newStr += str.substr(i, 9);\n }\n i += 9;\n } else {\n newStr += str.substr(i, 3);\n i += 3;\n }\n }\n return newStr;\n}\nfunction _normalizeComponentEncoding(components, protocol) {\n function decodeUnreserved(str) {\n var decStr = pctDecChars(str);\n return !decStr.match(protocol.UNRESERVED) ? str : decStr;\n }\n if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n return components;\n}\n\nfunction _stripLeadingZeros(str) {\n return str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\nfunction _normalizeIPv4(host, protocol) {\n var matches = host.match(protocol.IPV4ADDRESS) || [];\n\n var _matches = slicedToArray(matches, 2),\n address = _matches[1];\n\n if (address) {\n return address.split(\".\").map(_stripLeadingZeros).join(\".\");\n } else {\n return host;\n }\n}\nfunction _normalizeIPv6(host, protocol) {\n var matches = host.match(protocol.IPV6ADDRESS) || [];\n\n var _matches2 = slicedToArray(matches, 3),\n address = _matches2[1],\n zone = _matches2[2];\n\n if (address) {\n var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),\n _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),\n last = _address$toLowerCase$2[0],\n first = _address$toLowerCase$2[1];\n\n var firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n var lastFields = last.split(\":\").map(_stripLeadingZeros);\n var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n var fieldCount = isLastFieldIPv4Address ? 7 : 8;\n var lastFieldsStart = lastFields.length - fieldCount;\n var fields = Array(fieldCount);\n for (var x = 0; x < fieldCount; ++x) {\n fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n }\n if (isLastFieldIPv4Address) {\n fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n }\n var allZeroFields = fields.reduce(function (acc, field, index) {\n if (!field || field === \"0\") {\n var lastLongest = acc[acc.length - 1];\n if (lastLongest && lastLongest.index + lastLongest.length === index) {\n lastLongest.length++;\n } else {\n acc.push({ index: index, length: 1 });\n }\n }\n return acc;\n }, []);\n var longestZeroFields = allZeroFields.sort(function (a, b) {\n return b.length - a.length;\n })[0];\n var newHost = void 0;\n if (longestZeroFields && longestZeroFields.length > 1) {\n var newFirst = fields.slice(0, longestZeroFields.index);\n var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n newHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n } else {\n newHost = fields.join(\":\");\n }\n if (zone) {\n newHost += \"%\" + zone;\n }\n return newHost;\n } else {\n return host;\n }\n}\nvar URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nvar NO_MATCH_IS_UNDEFINED = \"\".match(/(){0}/)[1] === undefined;\nfunction parse(uriString) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var components = {};\n var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;\n if (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n var matches = uriString.match(URI_PARSE);\n if (matches) {\n if (NO_MATCH_IS_UNDEFINED) {\n //store each component\n components.scheme = matches[1];\n components.userinfo = matches[3];\n components.host = matches[4];\n components.port = parseInt(matches[5], 10);\n components.path = matches[6] || \"\";\n components.query = matches[7];\n components.fragment = matches[8];\n //fix port number\n if (isNaN(components.port)) {\n components.port = matches[5];\n }\n } else {\n //IE FIX for improper RegExp matching\n //store each component\n components.scheme = matches[1] || undefined;\n components.userinfo = uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined;\n components.host = uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined;\n components.port = parseInt(matches[5], 10);\n components.path = matches[6] || \"\";\n components.query = uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined;\n components.fragment = uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined;\n //fix port number\n if (isNaN(components.port)) {\n components.port = uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined;\n }\n }\n if (components.host) {\n //normalize IP hosts\n components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n }\n //determine reference type\n if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n components.reference = \"same-document\";\n } else if (components.scheme === undefined) {\n components.reference = \"relative\";\n } else if (components.fragment === undefined) {\n components.reference = \"absolute\";\n } else {\n components.reference = \"uri\";\n }\n //check for reference errors\n if (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n components.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n }\n //find scheme handler\n var schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n //check if scheme can't handle IRIs\n if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n //if host component is a domain name\n if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {\n //convert Unicode IDN -> ASCII IDN\n try {\n components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n } catch (e) {\n components.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n }\n }\n //convert IRI -> URI\n _normalizeComponentEncoding(components, URI_PROTOCOL);\n } else {\n //normalize encodings\n _normalizeComponentEncoding(components, protocol);\n }\n //perform scheme specific parsing\n if (schemeHandler && schemeHandler.parse) {\n schemeHandler.parse(components, options);\n }\n } else {\n components.error = components.error || \"URI can not be parsed.\";\n }\n return components;\n}\n\nfunction _recomposeAuthority(components, options) {\n var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;\n var uriTokens = [];\n if (components.userinfo !== undefined) {\n uriTokens.push(components.userinfo);\n uriTokens.push(\"@\");\n }\n if (components.host !== undefined) {\n //normalize IP hosts, add brackets and escape zone separator for IPv6\n uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {\n return \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\";\n }));\n }\n if (typeof components.port === \"number\" || typeof components.port === \"string\") {\n uriTokens.push(\":\");\n uriTokens.push(String(components.port));\n }\n return uriTokens.length ? uriTokens.join(\"\") : undefined;\n}\n\nvar RDS1 = /^\\.\\.?\\//;\nvar RDS2 = /^\\/\\.(\\/|$)/;\nvar RDS3 = /^\\/\\.\\.(\\/|$)/;\nvar RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\nfunction removeDotSegments(input) {\n var output = [];\n while (input.length) {\n if (input.match(RDS1)) {\n input = input.replace(RDS1, \"\");\n } else if (input.match(RDS2)) {\n input = input.replace(RDS2, \"/\");\n } else if (input.match(RDS3)) {\n input = input.replace(RDS3, \"/\");\n output.pop();\n } else if (input === \".\" || input === \"..\") {\n input = \"\";\n } else {\n var im = input.match(RDS5);\n if (im) {\n var s = im[0];\n input = input.slice(s.length);\n output.push(s);\n } else {\n throw new Error(\"Unexpected dot segment condition\");\n }\n }\n }\n return output.join(\"\");\n}\n\nfunction serialize(components) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;\n var uriTokens = [];\n //find scheme handler\n var schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n //perform scheme specific serialization\n if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n if (components.host) {\n //if host component is an IPv6 address\n if (protocol.IPV6ADDRESS.test(components.host)) {}\n //TODO: normalize IPv6 address as per RFC 5952\n\n //if host component is a domain name\n else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {\n //convert IDN via punycode\n try {\n components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);\n } catch (e) {\n components.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n }\n }\n }\n //normalize encoding\n _normalizeComponentEncoding(components, protocol);\n if (options.reference !== \"suffix\" && components.scheme) {\n uriTokens.push(components.scheme);\n uriTokens.push(\":\");\n }\n var authority = _recomposeAuthority(components, options);\n if (authority !== undefined) {\n if (options.reference !== \"suffix\") {\n uriTokens.push(\"//\");\n }\n uriTokens.push(authority);\n if (components.path && components.path.charAt(0) !== \"/\") {\n uriTokens.push(\"/\");\n }\n }\n if (components.path !== undefined) {\n var s = components.path;\n if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n s = removeDotSegments(s);\n }\n if (authority === undefined) {\n s = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n }\n uriTokens.push(s);\n }\n if (components.query !== undefined) {\n uriTokens.push(\"?\");\n uriTokens.push(components.query);\n }\n if (components.fragment !== undefined) {\n uriTokens.push(\"#\");\n uriTokens.push(components.fragment);\n }\n return uriTokens.join(\"\"); //merge tokens into a string\n}\n\nfunction resolveComponents(base, relative) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var skipNormalization = arguments[3];\n\n var target = {};\n if (!skipNormalization) {\n base = parse(serialize(base, options), options); //normalize base components\n relative = parse(serialize(relative, options), options); //normalize relative components\n }\n options = options || {};\n if (!options.tolerant && relative.scheme) {\n target.scheme = relative.scheme;\n //target.authority = relative.authority;\n target.userinfo = relative.userinfo;\n target.host = relative.host;\n target.port = relative.port;\n target.path = removeDotSegments(relative.path || \"\");\n target.query = relative.query;\n } else {\n if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n //target.authority = relative.authority;\n target.userinfo = relative.userinfo;\n target.host = relative.host;\n target.port = relative.port;\n target.path = removeDotSegments(relative.path || \"\");\n target.query = relative.query;\n } else {\n if (!relative.path) {\n target.path = base.path;\n if (relative.query !== undefined) {\n target.query = relative.query;\n } else {\n target.query = base.query;\n }\n } else {\n if (relative.path.charAt(0) === \"/\") {\n target.path = removeDotSegments(relative.path);\n } else {\n if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n target.path = \"/\" + relative.path;\n } else if (!base.path) {\n target.path = relative.path;\n } else {\n target.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n }\n target.path = removeDotSegments(target.path);\n }\n target.query = relative.query;\n }\n //target.authority = base.authority;\n target.userinfo = base.userinfo;\n target.host = base.host;\n target.port = base.port;\n }\n target.scheme = base.scheme;\n }\n target.fragment = relative.fragment;\n return target;\n}\n\nfunction resolve(baseURI, relativeURI, options) {\n var schemelessOptions = assign({ scheme: 'null' }, options);\n return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n}\n\nfunction normalize(uri, options) {\n if (typeof uri === \"string\") {\n uri = serialize(parse(uri, options), options);\n } else if (typeOf(uri) === \"object\") {\n uri = parse(serialize(uri, options), options);\n }\n return uri;\n}\n\nfunction equal(uriA, uriB, options) {\n if (typeof uriA === \"string\") {\n uriA = serialize(parse(uriA, options), options);\n } else if (typeOf(uriA) === \"object\") {\n uriA = serialize(uriA, options);\n }\n if (typeof uriB === \"string\") {\n uriB = serialize(parse(uriB, options), options);\n } else if (typeOf(uriB) === \"object\") {\n uriB = serialize(uriB, options);\n }\n return uriA === uriB;\n}\n\nfunction escapeComponent(str, options) {\n return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);\n}\n\nfunction unescapeComponent(str, options) {\n return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);\n}\n\nvar handler = {\n scheme: \"http\",\n domainHost: true,\n parse: function parse(components, options) {\n //report missing host\n if (!components.host) {\n components.error = components.error || \"HTTP URIs must have a host.\";\n }\n return components;\n },\n serialize: function serialize(components, options) {\n var secure = String(components.scheme).toLowerCase() === \"https\";\n //normalize the default port\n if (components.port === (secure ? 443 : 80) || components.port === \"\") {\n components.port = undefined;\n }\n //normalize the empty path\n if (!components.path) {\n components.path = \"/\";\n }\n //NOTE: We do not parse query strings for HTTP URIs\n //as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n //and not the HTTP spec.\n return components;\n }\n};\n\nvar handler$1 = {\n scheme: \"https\",\n domainHost: handler.domainHost,\n parse: handler.parse,\n serialize: handler.serialize\n};\n\nfunction isSecure(wsComponents) {\n return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n//RFC 6455\nvar handler$2 = {\n scheme: \"ws\",\n domainHost: true,\n parse: function parse(components, options) {\n var wsComponents = components;\n //indicate if the secure flag is set\n wsComponents.secure = isSecure(wsComponents);\n //construct resouce name\n wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n wsComponents.path = undefined;\n wsComponents.query = undefined;\n return wsComponents;\n },\n serialize: function serialize(wsComponents, options) {\n //normalize the default port\n if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n wsComponents.port = undefined;\n }\n //ensure scheme matches secure flag\n if (typeof wsComponents.secure === 'boolean') {\n wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';\n wsComponents.secure = undefined;\n }\n //reconstruct path from resource name\n if (wsComponents.resourceName) {\n var _wsComponents$resourc = wsComponents.resourceName.split('?'),\n _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),\n path = _wsComponents$resourc2[0],\n query = _wsComponents$resourc2[1];\n\n wsComponents.path = path && path !== '/' ? path : undefined;\n wsComponents.query = query;\n wsComponents.resourceName = undefined;\n }\n //forbid fragment component\n wsComponents.fragment = undefined;\n return wsComponents;\n }\n};\n\nvar handler$3 = {\n scheme: \"wss\",\n domainHost: handler$2.domainHost,\n parse: handler$2.parse,\n serialize: handler$2.serialize\n};\n\nvar O = {};\nvar isIRI = true;\n//RFC 3986\nvar UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nvar HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nvar PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nvar ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nvar QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nvar VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nvar SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nvar UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nvar PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nvar NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nvar NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nvar NOT_HFVALUE = NOT_HFNAME;\nfunction decodeUnreserved(str) {\n var decStr = pctDecChars(str);\n return !decStr.match(UNRESERVED) ? str : decStr;\n}\nvar handler$4 = {\n scheme: \"mailto\",\n parse: function parse$$1(components, options) {\n var mailtoComponents = components;\n var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(\",\") : [];\n mailtoComponents.path = undefined;\n if (mailtoComponents.query) {\n var unknownHeaders = false;\n var headers = {};\n var hfields = mailtoComponents.query.split(\"&\");\n for (var x = 0, xl = hfields.length; x < xl; ++x) {\n var hfield = hfields[x].split(\"=\");\n switch (hfield[0]) {\n case \"to\":\n var toAddrs = hfield[1].split(\",\");\n for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {\n to.push(toAddrs[_x]);\n }\n break;\n case \"subject\":\n mailtoComponents.subject = unescapeComponent(hfield[1], options);\n break;\n case \"body\":\n mailtoComponents.body = unescapeComponent(hfield[1], options);\n break;\n default:\n unknownHeaders = true;\n headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n break;\n }\n }\n if (unknownHeaders) mailtoComponents.headers = headers;\n }\n mailtoComponents.query = undefined;\n for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {\n var addr = to[_x2].split(\"@\");\n addr[0] = unescapeComponent(addr[0]);\n if (!options.unicodeSupport) {\n //convert Unicode IDN -> ASCII IDN\n try {\n addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n } catch (e) {\n mailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n }\n } else {\n addr[1] = unescapeComponent(addr[1], options).toLowerCase();\n }\n to[_x2] = addr.join(\"@\");\n }\n return mailtoComponents;\n },\n serialize: function serialize$$1(mailtoComponents, options) {\n var components = mailtoComponents;\n var to = toArray(mailtoComponents.to);\n if (to) {\n for (var x = 0, xl = to.length; x < xl; ++x) {\n var toAddr = String(to[x]);\n var atIdx = toAddr.lastIndexOf(\"@\");\n var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n var domain = toAddr.slice(atIdx + 1);\n //convert IDN via punycode\n try {\n domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);\n } catch (e) {\n components.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n }\n to[x] = localPart + \"@\" + domain;\n }\n components.path = to.join(\",\");\n }\n var headers = mailtoComponents.headers = mailtoComponents.headers || {};\n if (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n if (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n var fields = [];\n for (var name in headers) {\n if (headers[name] !== O[name]) {\n fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + \"=\" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));\n }\n }\n if (fields.length) {\n components.query = fields.join(\"&\");\n }\n return components;\n }\n};\n\nvar URN_PARSE = /^([^\\:]+)\\:(.*)/;\n//RFC 2141\nvar handler$5 = {\n scheme: \"urn\",\n parse: function parse$$1(components, options) {\n var matches = components.path && components.path.match(URN_PARSE);\n var urnComponents = components;\n if (matches) {\n var scheme = options.scheme || urnComponents.scheme || \"urn\";\n var nid = matches[1].toLowerCase();\n var nss = matches[2];\n var urnScheme = scheme + \":\" + (options.nid || nid);\n var schemeHandler = SCHEMES[urnScheme];\n urnComponents.nid = nid;\n urnComponents.nss = nss;\n urnComponents.path = undefined;\n if (schemeHandler) {\n urnComponents = schemeHandler.parse(urnComponents, options);\n }\n } else {\n urnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n }\n return urnComponents;\n },\n serialize: function serialize$$1(urnComponents, options) {\n var scheme = options.scheme || urnComponents.scheme || \"urn\";\n var nid = urnComponents.nid;\n var urnScheme = scheme + \":\" + (options.nid || nid);\n var schemeHandler = SCHEMES[urnScheme];\n if (schemeHandler) {\n urnComponents = schemeHandler.serialize(urnComponents, options);\n }\n var uriComponents = urnComponents;\n var nss = urnComponents.nss;\n uriComponents.path = (nid || options.nid) + \":\" + nss;\n return uriComponents;\n }\n};\n\nvar UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\n//RFC 4122\nvar handler$6 = {\n scheme: \"urn:uuid\",\n parse: function parse(urnComponents, options) {\n var uuidComponents = urnComponents;\n uuidComponents.uuid = uuidComponents.nss;\n uuidComponents.nss = undefined;\n if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n uuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n }\n return uuidComponents;\n },\n serialize: function serialize(uuidComponents, options) {\n var urnComponents = uuidComponents;\n //normalize UUID\n urnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n return urnComponents;\n }\n};\n\nSCHEMES[handler.scheme] = handler;\nSCHEMES[handler$1.scheme] = handler$1;\nSCHEMES[handler$2.scheme] = handler$2;\nSCHEMES[handler$3.scheme] = handler$3;\nSCHEMES[handler$4.scheme] = handler$4;\nSCHEMES[handler$5.scheme] = handler$5;\nSCHEMES[handler$6.scheme] = handler$6;\n\nexports.SCHEMES = SCHEMES;\nexports.pctEncChar = pctEncChar;\nexports.pctDecChars = pctDecChars;\nexports.parse = parse;\nexports.removeDotSegments = removeDotSegments;\nexports.serialize = serialize;\nexports.resolveComponents = resolveComponents;\nexports.resolve = resolve;\nexports.normalize = normalize;\nexports.equal = equal;\nexports.escapeComponent = escapeComponent;\nexports.unescapeComponent = unescapeComponent;\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=uri.all.js.map\n","/*\n * verror.js: richer JavaScript errors\n */\n\nvar mod_assertplus = require('assert-plus');\nvar mod_util = require('util');\n\nvar mod_extsprintf = require('extsprintf');\nvar mod_isError = require('core-util-is').isError;\nvar sprintf = mod_extsprintf.sprintf;\n\n/*\n * Public interface\n */\n\n/* So you can 'var VError = require('verror')' */\nmodule.exports = VError;\n/* For compatibility */\nVError.VError = VError;\n/* Other exported classes */\nVError.SError = SError;\nVError.WError = WError;\nVError.MultiError = MultiError;\n\n/*\n * Common function used to parse constructor arguments for VError, WError, and\n * SError. Named arguments to this function:\n *\n * strict\t\tforce strict interpretation of sprintf arguments, even\n * \t\t\tif the options in \"argv\" don't say so\n *\n * argv\t\terror's constructor arguments, which are to be\n * \t\t\tinterpreted as described in README.md. For quick\n * \t\t\treference, \"argv\" has one of the following forms:\n *\n * [ sprintf_args... ] (argv[0] is a string)\n * [ cause, sprintf_args... ] (argv[0] is an Error)\n * [ options, sprintf_args... ] (argv[0] is an object)\n *\n * This function normalizes these forms, producing an object with the following\n * properties:\n *\n * options equivalent to \"options\" in third form. This will never\n * \t\t\tbe a direct reference to what the caller passed in\n * \t\t\t(i.e., it may be a shallow copy), so it can be freely\n * \t\t\tmodified.\n *\n * shortmessage result of sprintf(sprintf_args), taking options.strict\n * \t\t\tinto account as described in README.md.\n */\nfunction parseConstructorArguments(args)\n{\n\tvar argv, options, sprintf_args, shortmessage, k;\n\n\tmod_assertplus.object(args, 'args');\n\tmod_assertplus.bool(args.strict, 'args.strict');\n\tmod_assertplus.array(args.argv, 'args.argv');\n\targv = args.argv;\n\n\t/*\n\t * First, figure out which form of invocation we've been given.\n\t */\n\tif (argv.length === 0) {\n\t\toptions = {};\n\t\tsprintf_args = [];\n\t} else if (mod_isError(argv[0])) {\n\t\toptions = { 'cause': argv[0] };\n\t\tsprintf_args = argv.slice(1);\n\t} else if (typeof (argv[0]) === 'object') {\n\t\toptions = {};\n\t\tfor (k in argv[0]) {\n\t\t\toptions[k] = argv[0][k];\n\t\t}\n\t\tsprintf_args = argv.slice(1);\n\t} else {\n\t\tmod_assertplus.string(argv[0],\n\t\t 'first argument to VError, SError, or WError ' +\n\t\t 'constructor must be a string, object, or Error');\n\t\toptions = {};\n\t\tsprintf_args = argv;\n\t}\n\n\t/*\n\t * Now construct the error's message.\n\t *\n\t * extsprintf (which we invoke here with our caller's arguments in order\n\t * to construct this Error's message) is strict in its interpretation of\n\t * values to be processed by the \"%s\" specifier. The value passed to\n\t * extsprintf must actually be a string or something convertible to a\n\t * String using .toString(). Passing other values (notably \"null\" and\n\t * \"undefined\") is considered a programmer error. The assumption is\n\t * that if you actually want to print the string \"null\" or \"undefined\",\n\t * then that's easy to do that when you're calling extsprintf; on the\n\t * other hand, if you did NOT want that (i.e., there's actually a bug\n\t * where the program assumes some variable is non-null and tries to\n\t * print it, which might happen when constructing a packet or file in\n\t * some specific format), then it's better to stop immediately than\n\t * produce bogus output.\n\t *\n\t * However, sometimes the bug is only in the code calling VError, and a\n\t * programmer might prefer to have the error message contain \"null\" or\n\t * \"undefined\" rather than have the bug in the error path crash the\n\t * program (making the first bug harder to identify). For that reason,\n\t * by default VError converts \"null\" or \"undefined\" arguments to their\n\t * string representations and passes those to extsprintf. Programmers\n\t * desiring the strict behavior can use the SError class or pass the\n\t * \"strict\" option to the VError constructor.\n\t */\n\tmod_assertplus.object(options);\n\tif (!options.strict && !args.strict) {\n\t\tsprintf_args = sprintf_args.map(function (a) {\n\t\t\treturn (a === null ? 'null' :\n\t\t\t a === undefined ? 'undefined' : a);\n\t\t});\n\t}\n\n\tif (sprintf_args.length === 0) {\n\t\tshortmessage = '';\n\t} else {\n\t\tshortmessage = sprintf.apply(null, sprintf_args);\n\t}\n\n\treturn ({\n\t 'options': options,\n\t 'shortmessage': shortmessage\n\t});\n}\n\n/*\n * See README.md for reference documentation.\n */\nfunction VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}\n\nmod_util.inherits(VError, Error);\nVError.prototype.name = 'VError';\n\nVError.prototype.toString = function ve_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\n\treturn (str);\n};\n\n/*\n * This method is provided for compatibility. New callers should use\n * VError.cause() instead. That method also uses the saner `null` return value\n * when there is no cause.\n */\nVError.prototype.cause = function ve_cause()\n{\n\tvar cause = VError.cause(this);\n\treturn (cause === null ? undefined : cause);\n};\n\n/*\n * Static methods\n *\n * These class-level methods are provided so that callers can use them on\n * instances of Errors that are not VErrors. New interfaces should be provided\n * only using static methods to eliminate the class of programming mistake where\n * people fail to check whether the Error object has the corresponding methods.\n */\n\nVError.cause = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\treturn (mod_isError(err.jse_cause) ? err.jse_cause : null);\n};\n\nVError.info = function (err)\n{\n\tvar rv, cause, k;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tcause = VError.cause(err);\n\tif (cause !== null) {\n\t\trv = VError.info(cause);\n\t} else {\n\t\trv = {};\n\t}\n\n\tif (typeof (err.jse_info) == 'object' && err.jse_info !== null) {\n\t\tfor (k in err.jse_info) {\n\t\t\trv[k] = err.jse_info[k];\n\t\t}\n\t}\n\n\treturn (rv);\n};\n\nVError.findCauseByName = function (err, name)\n{\n\tvar cause;\n\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.string(name, 'name');\n\tmod_assertplus.ok(name.length > 0, 'name cannot be empty');\n\n\tfor (cause = err; cause !== null; cause = VError.cause(cause)) {\n\t\tmod_assertplus.ok(mod_isError(cause));\n\t\tif (cause.name == name) {\n\t\t\treturn (cause);\n\t\t}\n\t}\n\n\treturn (null);\n};\n\nVError.hasCauseWithName = function (err, name)\n{\n\treturn (VError.findCauseByName(err, name) !== null);\n};\n\nVError.fullStack = function (err)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\n\tvar cause = VError.cause(err);\n\n\tif (cause) {\n\t\treturn (err.stack + '\\ncaused by: ' + VError.fullStack(cause));\n\t}\n\n\treturn (err.stack);\n};\n\nVError.errorFromList = function (errors)\n{\n\tmod_assertplus.arrayOfObject(errors, 'errors');\n\n\tif (errors.length === 0) {\n\t\treturn (null);\n\t}\n\n\terrors.forEach(function (e) {\n\t\tmod_assertplus.ok(mod_isError(e));\n\t});\n\n\tif (errors.length == 1) {\n\t\treturn (errors[0]);\n\t}\n\n\treturn (new MultiError(errors));\n};\n\nVError.errorForEach = function (err, func)\n{\n\tmod_assertplus.ok(mod_isError(err), 'err must be an Error');\n\tmod_assertplus.func(func, 'func');\n\n\tif (err instanceof MultiError) {\n\t\terr.errors().forEach(function iterError(e) { func(e); });\n\t} else {\n\t\tfunc(err);\n\t}\n};\n\n\n/*\n * SError is like VError, but stricter about types. You cannot pass \"null\" or\n * \"undefined\" as string arguments to the formatter.\n */\nfunction SError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof SError)) {\n\t\tobj = Object.create(SError.prototype);\n\t\tSError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': true\n\t});\n\n\toptions = parsed.options;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\n/*\n * We don't bother setting SError.prototype.name because once constructed,\n * SErrors are just like VErrors.\n */\nmod_util.inherits(SError, VError);\n\n\n/*\n * Represents a collection of errors for the purpose of consumers that generally\n * only deal with one error. Callers can extract the individual errors\n * contained in this object, but may also just treat it as a normal single\n * error, in which case a summary message will be printed.\n */\nfunction MultiError(errors)\n{\n\tmod_assertplus.array(errors, 'list of errors');\n\tmod_assertplus.ok(errors.length > 0, 'must be at least one error');\n\tthis.ase_errors = errors;\n\n\tVError.call(this, {\n\t 'cause': errors[0]\n\t}, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');\n}\n\nmod_util.inherits(MultiError, VError);\nMultiError.prototype.name = 'MultiError';\n\nMultiError.prototype.errors = function me_errors()\n{\n\treturn (this.ase_errors.slice(0));\n};\n\n\n/*\n * See README.md for reference details.\n */\nfunction WError()\n{\n\tvar args, obj, parsed, options;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\tif (!(this instanceof WError)) {\n\t\tobj = Object.create(WError.prototype);\n\t\tWError.apply(obj, args);\n\t\treturn (obj);\n\t}\n\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\toptions = parsed.options;\n\toptions['skipCauseMessage'] = true;\n\tVError.call(this, options, '%s', parsed.shortmessage);\n\n\treturn (this);\n}\n\nmod_util.inherits(WError, VError);\nWError.prototype.name = 'WError';\n\nWError.prototype.toString = function we_toString()\n{\n\tvar str = (this.hasOwnProperty('name') && this.name ||\n\t\tthis.constructor.name || this.constructor.prototype.name);\n\tif (this.message)\n\t\tstr += ': ' + this.message;\n\tif (this.jse_cause && this.jse_cause.message)\n\t\tstr += '; caused by ' + this.jse_cause.toString();\n\n\treturn (str);\n};\n\n/*\n * For purely historical reasons, WError's cause() function allows you to set\n * the cause.\n */\nWError.prototype.cause = function we_cause(c)\n{\n\tif (mod_isError(c))\n\t\tthis.jse_cause = c;\n\n\treturn (this.jse_cause);\n};\n","/*\n * extsprintf.js: extended POSIX-style sprintf\n */\n\nvar mod_assert = require('assert');\nvar mod_util = require('util');\n\n/*\n * Public interface\n */\nexports.sprintf = jsSprintf;\nexports.printf = jsPrintf;\nexports.fprintf = jsFprintf;\n\n/*\n * Stripped down version of s[n]printf(3c). We make a best effort to throw an\n * exception when given a format string we don't understand, rather than\n * ignoring it, so that we won't break existing programs if/when we go implement\n * the rest of this.\n *\n * This implementation currently supports specifying\n *\t- field alignment ('-' flag),\n * \t- zero-pad ('0' flag)\n *\t- always show numeric sign ('+' flag),\n *\t- field width\n *\t- conversions for strings, decimal integers, and floats (numbers).\n *\t- argument size specifiers. These are all accepted but ignored, since\n *\t Javascript has no notion of the physical size of an argument.\n *\n * Everything else is currently unsupported, most notably precision, unsigned\n * numbers, non-decimal numbers, and characters.\n */\nfunction jsSprintf(ofmt)\n{\n\tvar regex = [\n\t '([^%]*)',\t\t\t\t/* normal text */\n\t '%',\t\t\t\t/* start of format */\n\t '([\\'\\\\-+ #0]*?)',\t\t\t/* flags (optional) */\n\t '([1-9]\\\\d*)?',\t\t\t/* width (optional) */\n\t '(\\\\.([1-9]\\\\d*))?',\t\t/* precision (optional) */\n\t '[lhjztL]*?',\t\t\t/* length mods (ignored) */\n\t '([diouxXfFeEgGaAcCsSp%jr])'\t/* conversion */\n\t].join('');\n\n\tvar re = new RegExp(regex);\n\n\t/* variadic arguments used to fill in conversion specifiers */\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\t/* remaining format string */\n\tvar fmt = ofmt;\n\n\t/* components of the current conversion specifier */\n\tvar flags, width, precision, conversion;\n\tvar left, pad, sign, arg, match;\n\n\t/* return value */\n\tvar ret = '';\n\n\t/* current variadic argument (1-based) */\n\tvar argn = 1;\n\t/* 0-based position in the format string that we've read */\n\tvar posn = 0;\n\t/* 1-based position in the format string of the current conversion */\n\tvar convposn;\n\t/* current conversion specifier */\n\tvar curconv;\n\n\tmod_assert.equal('string', typeof (fmt),\n\t 'first argument must be a format string');\n\n\twhile ((match = re.exec(fmt)) !== null) {\n\t\tret += match[1];\n\t\tfmt = fmt.substring(match[0].length);\n\n\t\t/*\n\t\t * Update flags related to the current conversion specifier's\n\t\t * position so that we can report clear error messages.\n\t\t */\n\t\tcurconv = match[0].substring(match[1].length);\n\t\tconvposn = posn + match[1].length + 1;\n\t\tposn += match[0].length;\n\n\t\tflags = match[2] || '';\n\t\twidth = match[3] || 0;\n\t\tprecision = match[4] || '';\n\t\tconversion = match[6];\n\t\tleft = false;\n\t\tsign = false;\n\t\tpad = ' ';\n\n\t\tif (conversion == '%') {\n\t\t\tret += '%';\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (args.length === 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'has no matching argument ' +\n\t\t\t '(too few arguments passed)'));\n\t\t}\n\n\t\targ = args.shift();\n\t\targn++;\n\n\t\tif (flags.match(/[\\' #]/)) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses unsupported flags'));\n\t\t}\n\n\t\tif (precision.length > 0) {\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'uses non-zero precision (not supported)'));\n\t\t}\n\n\t\tif (flags.match(/-/))\n\t\t\tleft = true;\n\n\t\tif (flags.match(/0/))\n\t\t\tpad = '0';\n\n\t\tif (flags.match(/\\+/))\n\t\t\tsign = true;\n\n\t\tswitch (conversion) {\n\t\tcase 's':\n\t\t\tif (arg === undefined || arg === null) {\n\t\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t\t 'attempted to print undefined or null ' +\n\t\t\t\t 'as a string (argument ' + argn + ' to ' +\n\t\t\t\t 'sprintf)'));\n\t\t\t}\n\t\t\tret += doPad(pad, width, left, arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'd':\n\t\t\targ = Math.floor(arg);\n\t\t\t/*jsl:fallthru*/\n\t\tcase 'f':\n\t\t\tsign = sign && arg > 0 ? '+' : '';\n\t\t\tret += sign + doPad(pad, width, left,\n\t\t\t arg.toString());\n\t\t\tbreak;\n\n\t\tcase 'x':\n\t\t\tret += doPad(pad, width, left, arg.toString(16));\n\t\t\tbreak;\n\n\t\tcase 'j': /* non-standard */\n\t\t\tif (width === 0)\n\t\t\t\twidth = 10;\n\t\t\tret += mod_util.inspect(arg, false, width);\n\t\t\tbreak;\n\n\t\tcase 'r': /* non-standard */\n\t\t\tret += dumpException(arg);\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tthrow (jsError(ofmt, convposn, curconv,\n\t\t\t 'is not supported'));\n\t\t}\n\t}\n\n\tret += fmt;\n\treturn (ret);\n}\n\nfunction jsError(fmtstr, convposn, curconv, reason) {\n\tmod_assert.equal(typeof (fmtstr), 'string');\n\tmod_assert.equal(typeof (curconv), 'string');\n\tmod_assert.equal(typeof (convposn), 'number');\n\tmod_assert.equal(typeof (reason), 'string');\n\treturn (new Error('format string \"' + fmtstr +\n\t '\": conversion specifier \"' + curconv + '\" at character ' +\n\t convposn + ' ' + reason));\n}\n\nfunction jsPrintf() {\n\tvar args = Array.prototype.slice.call(arguments);\n\targs.unshift(process.stdout);\n\tjsFprintf.apply(null, args);\n}\n\nfunction jsFprintf(stream) {\n\tvar args = Array.prototype.slice.call(arguments, 1);\n\treturn (stream.write(jsSprintf.apply(this, args)));\n}\n\nfunction doPad(chr, width, left, str)\n{\n\tvar ret = str;\n\n\twhile (ret.length < width) {\n\t\tif (left)\n\t\t\tret += chr;\n\t\telse\n\t\t\tret = chr + ret;\n\t}\n\n\treturn (ret);\n}\n\n/*\n * This function dumps long stack traces for exceptions having a cause() method.\n * See node-verror for an example.\n */\nfunction dumpException(ex)\n{\n\tvar ret;\n\n\tif (!(ex instanceof Error))\n\t\tthrow (new Error(jsSprintf('invalid type for %%r: %j', ex)));\n\n\t/* Note that V8 prepends \"ex.stack\" with ex.toString(). */\n\tret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;\n\n\tif (ex.cause && typeof (ex.cause) === 'function') {\n\t\tvar cex = ex.cause();\n\t\tif (cex) {\n\t\t\tret += '\\nCaused by: ' + dumpException(cex);\n\t\t}\n\t}\n\n\treturn (ret);\n}\n","const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n","// Returns a wrapper function that returns a wrapped callback\n// The wrapper function should do some stuff, and return a\n// presumably different callback function.\n// This makes sure that own properties are retained, so that\n// decorations and such are not lost along the way.\nmodule.exports = wrappy\nfunction wrappy (fn, cb) {\n if (fn && cb) return wrappy(fn)(cb)\n\n if (typeof fn !== 'function')\n throw new TypeError('need wrapper function')\n\n Object.keys(fn).forEach(function (k) {\n wrapper[k] = fn[k]\n })\n\n return wrapper\n\n function wrapper() {\n var args = new Array(arguments.length)\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i]\n }\n var ret = fn.apply(this, args)\n var cb = args[args.length-1]\n if (typeof ret === 'function' && ret !== cb) {\n Object.keys(cb).forEach(function (k) {\n ret[k] = cb[k]\n })\n }\n return ret\n }\n}\n","'use strict';\n\nconst WebSocket = require('./lib/websocket');\n\nWebSocket.createWebSocketStream = require('./lib/stream');\nWebSocket.Server = require('./lib/websocket-server');\nWebSocket.Receiver = require('./lib/receiver');\nWebSocket.Sender = require('./lib/sender');\n\nmodule.exports = WebSocket;\n","'use strict';\n\nconst { EMPTY_BUFFER } = require('./constants');\n\n/**\n * Merges an array of buffers into a new buffer.\n *\n * @param {Buffer[]} list The array of buffers to concat\n * @param {Number} totalLength The total length of buffers in the list\n * @return {Buffer} The resulting buffer\n * @public\n */\nfunction concat(list, totalLength) {\n if (list.length === 0) return EMPTY_BUFFER;\n if (list.length === 1) return list[0];\n\n const target = Buffer.allocUnsafe(totalLength);\n let offset = 0;\n\n for (let i = 0; i < list.length; i++) {\n const buf = list[i];\n target.set(buf, offset);\n offset += buf.length;\n }\n\n if (offset < totalLength) return target.slice(0, offset);\n\n return target;\n}\n\n/**\n * Masks a buffer using the given mask.\n *\n * @param {Buffer} source The buffer to mask\n * @param {Buffer} mask The mask to use\n * @param {Buffer} output The buffer where to store the result\n * @param {Number} offset The offset at which to start writing\n * @param {Number} length The number of bytes to mask.\n * @public\n */\nfunction _mask(source, mask, output, offset, length) {\n for (let i = 0; i < length; i++) {\n output[offset + i] = source[i] ^ mask[i & 3];\n }\n}\n\n/**\n * Unmasks a buffer using the given mask.\n *\n * @param {Buffer} buffer The buffer to unmask\n * @param {Buffer} mask The mask to use\n * @public\n */\nfunction _unmask(buffer, mask) {\n // Required until https://github.com/nodejs/node/issues/9006 is resolved.\n const length = buffer.length;\n for (let i = 0; i < length; i++) {\n buffer[i] ^= mask[i & 3];\n }\n}\n\n/**\n * Converts a buffer to an `ArrayBuffer`.\n *\n * @param {Buffer} buf The buffer to convert\n * @return {ArrayBuffer} Converted buffer\n * @public\n */\nfunction toArrayBuffer(buf) {\n if (buf.byteLength === buf.buffer.byteLength) {\n return buf.buffer;\n }\n\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n}\n\n/**\n * Converts `data` to a `Buffer`.\n *\n * @param {*} data The data to convert\n * @return {Buffer} The buffer\n * @throws {TypeError}\n * @public\n */\nfunction toBuffer(data) {\n toBuffer.readOnly = true;\n\n if (Buffer.isBuffer(data)) return data;\n\n let buf;\n\n if (data instanceof ArrayBuffer) {\n buf = Buffer.from(data);\n } else if (ArrayBuffer.isView(data)) {\n buf = Buffer.from(data.buffer, data.byteOffset, data.byteLength);\n } else {\n buf = Buffer.from(data);\n toBuffer.readOnly = false;\n }\n\n return buf;\n}\n\ntry {\n const bufferUtil = require('bufferutil');\n const bu = bufferUtil.BufferUtil || bufferUtil;\n\n module.exports = {\n concat,\n mask(source, mask, output, offset, length) {\n if (length < 48) _mask(source, mask, output, offset, length);\n else bu.mask(source, mask, output, offset, length);\n },\n toArrayBuffer,\n toBuffer,\n unmask(buffer, mask) {\n if (buffer.length < 32) _unmask(buffer, mask);\n else bu.unmask(buffer, mask);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n concat,\n mask: _mask,\n toArrayBuffer,\n toBuffer,\n unmask: _unmask\n };\n}\n","'use strict';\n\nmodule.exports = {\n BINARY_TYPES: ['nodebuffer', 'arraybuffer', 'fragments'],\n GUID: '258EAFA5-E914-47DA-95CA-C5AB0DC85B11',\n kStatusCode: Symbol('status-code'),\n kWebSocket: Symbol('websocket'),\n EMPTY_BUFFER: Buffer.alloc(0),\n NOOP: () => {}\n};\n","'use strict';\n\n/**\n * Class representing an event.\n *\n * @private\n */\nclass Event {\n /**\n * Create a new `Event`.\n *\n * @param {String} type The name of the event\n * @param {Object} target A reference to the target to which the event was\n * dispatched\n */\n constructor(type, target) {\n this.target = target;\n this.type = type;\n }\n}\n\n/**\n * Class representing a message event.\n *\n * @extends Event\n * @private\n */\nclass MessageEvent extends Event {\n /**\n * Create a new `MessageEvent`.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The received data\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(data, target) {\n super('message', target);\n\n this.data = data;\n }\n}\n\n/**\n * Class representing a close event.\n *\n * @extends Event\n * @private\n */\nclass CloseEvent extends Event {\n /**\n * Create a new `CloseEvent`.\n *\n * @param {Number} code The status code explaining why the connection is being\n * closed\n * @param {String} reason A human-readable string explaining why the\n * connection is closing\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(code, reason, target) {\n super('close', target);\n\n this.wasClean = target._closeFrameReceived && target._closeFrameSent;\n this.reason = reason;\n this.code = code;\n }\n}\n\n/**\n * Class representing an open event.\n *\n * @extends Event\n * @private\n */\nclass OpenEvent extends Event {\n /**\n * Create a new `OpenEvent`.\n *\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(target) {\n super('open', target);\n }\n}\n\n/**\n * Class representing an error event.\n *\n * @extends Event\n * @private\n */\nclass ErrorEvent extends Event {\n /**\n * Create a new `ErrorEvent`.\n *\n * @param {Object} error The error that generated this event\n * @param {WebSocket} target A reference to the target to which the event was\n * dispatched\n */\n constructor(error, target) {\n super('error', target);\n\n this.message = error.message;\n this.error = error;\n }\n}\n\n/**\n * This provides methods for emulating the `EventTarget` interface. It's not\n * meant to be used directly.\n *\n * @mixin\n */\nconst EventTarget = {\n /**\n * Register an event listener.\n *\n * @param {String} type A string representing the event type to listen for\n * @param {Function} listener The listener to add\n * @param {Object} [options] An options object specifies characteristics about\n * the event listener\n * @param {Boolean} [options.once=false] A `Boolean`` indicating that the\n * listener should be invoked at most once after being added. If `true`,\n * the listener would be automatically removed when invoked.\n * @public\n */\n addEventListener(type, listener, options) {\n if (typeof listener !== 'function') return;\n\n function onMessage(data) {\n listener.call(this, new MessageEvent(data, this));\n }\n\n function onClose(code, message) {\n listener.call(this, new CloseEvent(code, message, this));\n }\n\n function onError(error) {\n listener.call(this, new ErrorEvent(error, this));\n }\n\n function onOpen() {\n listener.call(this, new OpenEvent(this));\n }\n\n const method = options && options.once ? 'once' : 'on';\n\n if (type === 'message') {\n onMessage._listener = listener;\n this[method](type, onMessage);\n } else if (type === 'close') {\n onClose._listener = listener;\n this[method](type, onClose);\n } else if (type === 'error') {\n onError._listener = listener;\n this[method](type, onError);\n } else if (type === 'open') {\n onOpen._listener = listener;\n this[method](type, onOpen);\n } else {\n this[method](type, listener);\n }\n },\n\n /**\n * Remove an event listener.\n *\n * @param {String} type A string representing the event type to remove\n * @param {Function} listener The listener to remove\n * @public\n */\n removeEventListener(type, listener) {\n const listeners = this.listeners(type);\n\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i] === listener || listeners[i]._listener === listener) {\n this.removeListener(type, listeners[i]);\n }\n }\n }\n};\n\nmodule.exports = EventTarget;\n","'use strict';\n\n//\n// Allowed token characters:\n//\n// '!', '#', '$', '%', '&', ''', '*', '+', '-',\n// '.', 0-9, A-Z, '^', '_', '`', a-z, '|', '~'\n//\n// tokenChars[32] === 0 // ' '\n// tokenChars[33] === 1 // '!'\n// tokenChars[34] === 0 // '\"'\n// ...\n//\n// prettier-ignore\nconst tokenChars = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31\n 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0, // 32 - 47\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63\n 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 64 - 79\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, // 80 - 95\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, // 96 - 111\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0 // 112 - 127\n];\n\n/**\n * Adds an offer to the map of extension offers or a parameter to the map of\n * parameters.\n *\n * @param {Object} dest The map of extension offers or parameters\n * @param {String} name The extension or parameter name\n * @param {(Object|Boolean|String)} elem The extension parameters or the\n * parameter value\n * @private\n */\nfunction push(dest, name, elem) {\n if (dest[name] === undefined) dest[name] = [elem];\n else dest[name].push(elem);\n}\n\n/**\n * Parses the `Sec-WebSocket-Extensions` header into an object.\n *\n * @param {String} header The field value of the header\n * @return {Object} The parsed object\n * @public\n */\nfunction parse(header) {\n const offers = Object.create(null);\n\n if (header === undefined || header === '') return offers;\n\n let params = Object.create(null);\n let mustUnescape = false;\n let isEscaping = false;\n let inQuotes = false;\n let extensionName;\n let paramName;\n let start = -1;\n let end = -1;\n let i = 0;\n\n for (; i < header.length; i++) {\n const code = header.charCodeAt(i);\n\n if (extensionName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 /* ' ' */ || code === 0x09 /* '\\t' */) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b /* ';' */ || code === 0x2c /* ',' */) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n const name = header.slice(start, end);\n if (code === 0x2c) {\n push(offers, name, params);\n params = Object.create(null);\n } else {\n extensionName = name;\n }\n\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (paramName === undefined) {\n if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x20 || code === 0x09) {\n if (end === -1 && start !== -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n push(params, header.slice(start, end), true);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = Object.create(null);\n extensionName = undefined;\n }\n\n start = end = -1;\n } else if (code === 0x3d /* '=' */ && start !== -1 && end === -1) {\n paramName = header.slice(start, i);\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else {\n //\n // The value of a quoted-string after unescaping must conform to the\n // token ABNF, so only token characters are valid.\n // Ref: https://tools.ietf.org/html/rfc6455#section-9.1\n //\n if (isEscaping) {\n if (tokenChars[code] !== 1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n if (start === -1) start = i;\n else if (!mustUnescape) mustUnescape = true;\n isEscaping = false;\n } else if (inQuotes) {\n if (tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (code === 0x22 /* '\"' */ && start !== -1) {\n inQuotes = false;\n end = i;\n } else if (code === 0x5c /* '\\' */) {\n isEscaping = true;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n } else if (code === 0x22 && header.charCodeAt(i - 1) === 0x3d) {\n inQuotes = true;\n } else if (end === -1 && tokenChars[code] === 1) {\n if (start === -1) start = i;\n } else if (start !== -1 && (code === 0x20 || code === 0x09)) {\n if (end === -1) end = i;\n } else if (code === 0x3b || code === 0x2c) {\n if (start === -1) {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n\n if (end === -1) end = i;\n let value = header.slice(start, end);\n if (mustUnescape) {\n value = value.replace(/\\\\/g, '');\n mustUnescape = false;\n }\n push(params, paramName, value);\n if (code === 0x2c) {\n push(offers, extensionName, params);\n params = Object.create(null);\n extensionName = undefined;\n }\n\n paramName = undefined;\n start = end = -1;\n } else {\n throw new SyntaxError(`Unexpected character at index ${i}`);\n }\n }\n }\n\n if (start === -1 || inQuotes) {\n throw new SyntaxError('Unexpected end of input');\n }\n\n if (end === -1) end = i;\n const token = header.slice(start, end);\n if (extensionName === undefined) {\n push(offers, token, params);\n } else {\n if (paramName === undefined) {\n push(params, token, true);\n } else if (mustUnescape) {\n push(params, paramName, token.replace(/\\\\/g, ''));\n } else {\n push(params, paramName, token);\n }\n push(offers, extensionName, params);\n }\n\n return offers;\n}\n\n/**\n * Builds the `Sec-WebSocket-Extensions` header field value.\n *\n * @param {Object} extensions The map of extensions and parameters to format\n * @return {String} A string representing the given object\n * @public\n */\nfunction format(extensions) {\n return Object.keys(extensions)\n .map((extension) => {\n let configurations = extensions[extension];\n if (!Array.isArray(configurations)) configurations = [configurations];\n return configurations\n .map((params) => {\n return [extension]\n .concat(\n Object.keys(params).map((k) => {\n let values = params[k];\n if (!Array.isArray(values)) values = [values];\n return values\n .map((v) => (v === true ? k : `${k}=${v}`))\n .join('; ');\n })\n )\n .join('; ');\n })\n .join(', ');\n })\n .join(', ');\n}\n\nmodule.exports = { format, parse };\n","'use strict';\n\nconst kDone = Symbol('kDone');\nconst kRun = Symbol('kRun');\n\n/**\n * A very simple job queue with adjustable concurrency. Adapted from\n * https://github.com/STRML/async-limiter\n */\nclass Limiter {\n /**\n * Creates a new `Limiter`.\n *\n * @param {Number} [concurrency=Infinity] The maximum number of jobs allowed\n * to run concurrently\n */\n constructor(concurrency) {\n this[kDone] = () => {\n this.pending--;\n this[kRun]();\n };\n this.concurrency = concurrency || Infinity;\n this.jobs = [];\n this.pending = 0;\n }\n\n /**\n * Adds a job to the queue.\n *\n * @param {Function} job The job to run\n * @public\n */\n add(job) {\n this.jobs.push(job);\n this[kRun]();\n }\n\n /**\n * Removes a job from the queue and runs it if possible.\n *\n * @private\n */\n [kRun]() {\n if (this.pending === this.concurrency) return;\n\n if (this.jobs.length) {\n const job = this.jobs.shift();\n\n this.pending++;\n job(this[kDone]);\n }\n }\n}\n\nmodule.exports = Limiter;\n","'use strict';\n\nconst zlib = require('zlib');\n\nconst bufferUtil = require('./buffer-util');\nconst Limiter = require('./limiter');\nconst { kStatusCode, NOOP } = require('./constants');\n\nconst TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);\nconst kPerMessageDeflate = Symbol('permessage-deflate');\nconst kTotalLength = Symbol('total-length');\nconst kCallback = Symbol('callback');\nconst kBuffers = Symbol('buffers');\nconst kError = Symbol('error');\n\n//\n// We limit zlib concurrency, which prevents severe memory fragmentation\n// as documented in https://github.com/nodejs/node/issues/8871#issuecomment-250915913\n// and https://github.com/websockets/ws/issues/1202\n//\n// Intentionally global; it's the global thread pool that's an issue.\n//\nlet zlibLimiter;\n\n/**\n * permessage-deflate implementation.\n */\nclass PerMessageDeflate {\n /**\n * Creates a PerMessageDeflate instance.\n *\n * @param {Object} [options] Configuration options\n * @param {Boolean} [options.serverNoContextTakeover=false] Request/accept\n * disabling of server context takeover\n * @param {Boolean} [options.clientNoContextTakeover=false] Advertise/\n * acknowledge disabling of client context takeover\n * @param {(Boolean|Number)} [options.serverMaxWindowBits] Request/confirm the\n * use of a custom server window size\n * @param {(Boolean|Number)} [options.clientMaxWindowBits] Advertise support\n * for, or request, a custom client window size\n * @param {Object} [options.zlibDeflateOptions] Options to pass to zlib on\n * deflate\n * @param {Object} [options.zlibInflateOptions] Options to pass to zlib on\n * inflate\n * @param {Number} [options.threshold=1024] Size (in bytes) below which\n * messages should not be compressed\n * @param {Number} [options.concurrencyLimit=10] The number of concurrent\n * calls to zlib\n * @param {Boolean} [isServer=false] Create the instance in either server or\n * client mode\n * @param {Number} [maxPayload=0] The maximum allowed message length\n */\n constructor(options, isServer, maxPayload) {\n this._maxPayload = maxPayload | 0;\n this._options = options || {};\n this._threshold =\n this._options.threshold !== undefined ? this._options.threshold : 1024;\n this._isServer = !!isServer;\n this._deflate = null;\n this._inflate = null;\n\n this.params = null;\n\n if (!zlibLimiter) {\n const concurrency =\n this._options.concurrencyLimit !== undefined\n ? this._options.concurrencyLimit\n : 10;\n zlibLimiter = new Limiter(concurrency);\n }\n }\n\n /**\n * @type {String}\n */\n static get extensionName() {\n return 'permessage-deflate';\n }\n\n /**\n * Create an extension negotiation offer.\n *\n * @return {Object} Extension parameters\n * @public\n */\n offer() {\n const params = {};\n\n if (this._options.serverNoContextTakeover) {\n params.server_no_context_takeover = true;\n }\n if (this._options.clientNoContextTakeover) {\n params.client_no_context_takeover = true;\n }\n if (this._options.serverMaxWindowBits) {\n params.server_max_window_bits = this._options.serverMaxWindowBits;\n }\n if (this._options.clientMaxWindowBits) {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n } else if (this._options.clientMaxWindowBits == null) {\n params.client_max_window_bits = true;\n }\n\n return params;\n }\n\n /**\n * Accept an extension negotiation offer/response.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Object} Accepted configuration\n * @public\n */\n accept(configurations) {\n configurations = this.normalizeParams(configurations);\n\n this.params = this._isServer\n ? this.acceptAsServer(configurations)\n : this.acceptAsClient(configurations);\n\n return this.params;\n }\n\n /**\n * Releases all resources used by the extension.\n *\n * @public\n */\n cleanup() {\n if (this._inflate) {\n this._inflate.close();\n this._inflate = null;\n }\n\n if (this._deflate) {\n const callback = this._deflate[kCallback];\n\n this._deflate.close();\n this._deflate = null;\n\n if (callback) {\n callback(\n new Error(\n 'The deflate stream was closed while data was being processed'\n )\n );\n }\n }\n }\n\n /**\n * Accept an extension negotiation offer.\n *\n * @param {Array} offers The extension negotiation offers\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsServer(offers) {\n const opts = this._options;\n const accepted = offers.find((params) => {\n if (\n (opts.serverNoContextTakeover === false &&\n params.server_no_context_takeover) ||\n (params.server_max_window_bits &&\n (opts.serverMaxWindowBits === false ||\n (typeof opts.serverMaxWindowBits === 'number' &&\n opts.serverMaxWindowBits > params.server_max_window_bits))) ||\n (typeof opts.clientMaxWindowBits === 'number' &&\n !params.client_max_window_bits)\n ) {\n return false;\n }\n\n return true;\n });\n\n if (!accepted) {\n throw new Error('None of the extension offers can be accepted');\n }\n\n if (opts.serverNoContextTakeover) {\n accepted.server_no_context_takeover = true;\n }\n if (opts.clientNoContextTakeover) {\n accepted.client_no_context_takeover = true;\n }\n if (typeof opts.serverMaxWindowBits === 'number') {\n accepted.server_max_window_bits = opts.serverMaxWindowBits;\n }\n if (typeof opts.clientMaxWindowBits === 'number') {\n accepted.client_max_window_bits = opts.clientMaxWindowBits;\n } else if (\n accepted.client_max_window_bits === true ||\n opts.clientMaxWindowBits === false\n ) {\n delete accepted.client_max_window_bits;\n }\n\n return accepted;\n }\n\n /**\n * Accept the extension negotiation response.\n *\n * @param {Array} response The extension negotiation response\n * @return {Object} Accepted configuration\n * @private\n */\n acceptAsClient(response) {\n const params = response[0];\n\n if (\n this._options.clientNoContextTakeover === false &&\n params.client_no_context_takeover\n ) {\n throw new Error('Unexpected parameter \"client_no_context_takeover\"');\n }\n\n if (!params.client_max_window_bits) {\n if (typeof this._options.clientMaxWindowBits === 'number') {\n params.client_max_window_bits = this._options.clientMaxWindowBits;\n }\n } else if (\n this._options.clientMaxWindowBits === false ||\n (typeof this._options.clientMaxWindowBits === 'number' &&\n params.client_max_window_bits > this._options.clientMaxWindowBits)\n ) {\n throw new Error(\n 'Unexpected or invalid parameter \"client_max_window_bits\"'\n );\n }\n\n return params;\n }\n\n /**\n * Normalize parameters.\n *\n * @param {Array} configurations The extension negotiation offers/reponse\n * @return {Array} The offers/response with normalized parameters\n * @private\n */\n normalizeParams(configurations) {\n configurations.forEach((params) => {\n Object.keys(params).forEach((key) => {\n let value = params[key];\n\n if (value.length > 1) {\n throw new Error(`Parameter \"${key}\" must have only a single value`);\n }\n\n value = value[0];\n\n if (key === 'client_max_window_bits') {\n if (value !== true) {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (!this._isServer) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else if (key === 'server_max_window_bits') {\n const num = +value;\n if (!Number.isInteger(num) || num < 8 || num > 15) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n value = num;\n } else if (\n key === 'client_no_context_takeover' ||\n key === 'server_no_context_takeover'\n ) {\n if (value !== true) {\n throw new TypeError(\n `Invalid value for parameter \"${key}\": ${value}`\n );\n }\n } else {\n throw new Error(`Unknown parameter \"${key}\"`);\n }\n\n params[key] = value;\n });\n });\n\n return configurations;\n }\n\n /**\n * Decompress data. Concurrency limited.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n decompress(data, fin, callback) {\n zlibLimiter.add((done) => {\n this._decompress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Compress data. Concurrency limited.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @public\n */\n compress(data, fin, callback) {\n zlibLimiter.add((done) => {\n this._compress(data, fin, (err, result) => {\n done();\n callback(err, result);\n });\n });\n }\n\n /**\n * Decompress data.\n *\n * @param {Buffer} data Compressed data\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _decompress(data, fin, callback) {\n const endpoint = this._isServer ? 'client' : 'server';\n\n if (!this._inflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._inflate = zlib.createInflateRaw({\n ...this._options.zlibInflateOptions,\n windowBits\n });\n this._inflate[kPerMessageDeflate] = this;\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n this._inflate.on('error', inflateOnError);\n this._inflate.on('data', inflateOnData);\n }\n\n this._inflate[kCallback] = callback;\n\n this._inflate.write(data);\n if (fin) this._inflate.write(TRAILER);\n\n this._inflate.flush(() => {\n const err = this._inflate[kError];\n\n if (err) {\n this._inflate.close();\n this._inflate = null;\n callback(err);\n return;\n }\n\n const data = bufferUtil.concat(\n this._inflate[kBuffers],\n this._inflate[kTotalLength]\n );\n\n if (this._inflate._readableState.endEmitted) {\n this._inflate.close();\n this._inflate = null;\n } else {\n this._inflate[kTotalLength] = 0;\n this._inflate[kBuffers] = [];\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._inflate.reset();\n }\n }\n\n callback(null, data);\n });\n }\n\n /**\n * Compress data.\n *\n * @param {Buffer} data Data to compress\n * @param {Boolean} fin Specifies whether or not this is the last fragment\n * @param {Function} callback Callback\n * @private\n */\n _compress(data, fin, callback) {\n const endpoint = this._isServer ? 'server' : 'client';\n\n if (!this._deflate) {\n const key = `${endpoint}_max_window_bits`;\n const windowBits =\n typeof this.params[key] !== 'number'\n ? zlib.Z_DEFAULT_WINDOWBITS\n : this.params[key];\n\n this._deflate = zlib.createDeflateRaw({\n ...this._options.zlibDeflateOptions,\n windowBits\n });\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n //\n // An `'error'` event is emitted, only on Node.js < 10.0.0, if the\n // `zlib.DeflateRaw` instance is closed while data is being processed.\n // This can happen if `PerMessageDeflate#cleanup()` is called at the wrong\n // time due to an abnormal WebSocket closure.\n //\n this._deflate.on('error', NOOP);\n this._deflate.on('data', deflateOnData);\n }\n\n this._deflate[kCallback] = callback;\n\n this._deflate.write(data);\n this._deflate.flush(zlib.Z_SYNC_FLUSH, () => {\n if (!this._deflate) {\n //\n // The deflate stream was closed while data was being processed.\n //\n return;\n }\n\n let data = bufferUtil.concat(\n this._deflate[kBuffers],\n this._deflate[kTotalLength]\n );\n\n if (fin) data = data.slice(0, data.length - 4);\n\n //\n // Ensure that the callback will not be called again in\n // `PerMessageDeflate#cleanup()`.\n //\n this._deflate[kCallback] = null;\n\n this._deflate[kTotalLength] = 0;\n this._deflate[kBuffers] = [];\n\n if (fin && this.params[`${endpoint}_no_context_takeover`]) {\n this._deflate.reset();\n }\n\n callback(null, data);\n });\n }\n}\n\nmodule.exports = PerMessageDeflate;\n\n/**\n * The listener of the `zlib.DeflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction deflateOnData(chunk) {\n this[kBuffers].push(chunk);\n this[kTotalLength] += chunk.length;\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction inflateOnData(chunk) {\n this[kTotalLength] += chunk.length;\n\n if (\n this[kPerMessageDeflate]._maxPayload < 1 ||\n this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload\n ) {\n this[kBuffers].push(chunk);\n return;\n }\n\n this[kError] = new RangeError('Max payload size exceeded');\n this[kError].code = 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH';\n this[kError][kStatusCode] = 1009;\n this.removeListener('data', inflateOnData);\n this.reset();\n}\n\n/**\n * The listener of the `zlib.InflateRaw` stream `'error'` event.\n *\n * @param {Error} err The emitted error\n * @private\n */\nfunction inflateOnError(err) {\n //\n // There is no need to call `Zlib#close()` as the handle is automatically\n // closed when an error is emitted.\n //\n this[kPerMessageDeflate]._inflate = null;\n err[kStatusCode] = 1007;\n this[kCallback](err);\n}\n","'use strict';\n\nconst { Writable } = require('stream');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n kStatusCode,\n kWebSocket\n} = require('./constants');\nconst { concat, toArrayBuffer, unmask } = require('./buffer-util');\nconst { isValidStatusCode, isValidUTF8 } = require('./validation');\n\nconst GET_INFO = 0;\nconst GET_PAYLOAD_LENGTH_16 = 1;\nconst GET_PAYLOAD_LENGTH_64 = 2;\nconst GET_MASK = 3;\nconst GET_DATA = 4;\nconst INFLATING = 5;\n\n/**\n * HyBi Receiver implementation.\n *\n * @extends Writable\n */\nclass Receiver extends Writable {\n /**\n * Creates a Receiver instance.\n *\n * @param {String} [binaryType=nodebuffer] The type for binary data\n * @param {Object} [extensions] An object containing the negotiated extensions\n * @param {Boolean} [isServer=false] Specifies whether to operate in client or\n * server mode\n * @param {Number} [maxPayload=0] The maximum allowed message length\n */\n constructor(binaryType, extensions, isServer, maxPayload) {\n super();\n\n this._binaryType = binaryType || BINARY_TYPES[0];\n this[kWebSocket] = undefined;\n this._extensions = extensions || {};\n this._isServer = !!isServer;\n this._maxPayload = maxPayload | 0;\n\n this._bufferedBytes = 0;\n this._buffers = [];\n\n this._compressed = false;\n this._payloadLength = 0;\n this._mask = undefined;\n this._fragmented = 0;\n this._masked = false;\n this._fin = false;\n this._opcode = 0;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragments = [];\n\n this._state = GET_INFO;\n this._loop = false;\n }\n\n /**\n * Implements `Writable.prototype._write()`.\n *\n * @param {Buffer} chunk The chunk of data to write\n * @param {String} encoding The character encoding of `chunk`\n * @param {Function} cb Callback\n * @private\n */\n _write(chunk, encoding, cb) {\n if (this._opcode === 0x08 && this._state == GET_INFO) return cb();\n\n this._bufferedBytes += chunk.length;\n this._buffers.push(chunk);\n this.startLoop(cb);\n }\n\n /**\n * Consumes `n` bytes from the buffered data.\n *\n * @param {Number} n The number of bytes to consume\n * @return {Buffer} The consumed bytes\n * @private\n */\n consume(n) {\n this._bufferedBytes -= n;\n\n if (n === this._buffers[0].length) return this._buffers.shift();\n\n if (n < this._buffers[0].length) {\n const buf = this._buffers[0];\n this._buffers[0] = buf.slice(n);\n return buf.slice(0, n);\n }\n\n const dst = Buffer.allocUnsafe(n);\n\n do {\n const buf = this._buffers[0];\n const offset = dst.length - n;\n\n if (n >= buf.length) {\n dst.set(this._buffers.shift(), offset);\n } else {\n dst.set(new Uint8Array(buf.buffer, buf.byteOffset, n), offset);\n this._buffers[0] = buf.slice(n);\n }\n\n n -= buf.length;\n } while (n > 0);\n\n return dst;\n }\n\n /**\n * Starts the parsing loop.\n *\n * @param {Function} cb Callback\n * @private\n */\n startLoop(cb) {\n let err;\n this._loop = true;\n\n do {\n switch (this._state) {\n case GET_INFO:\n err = this.getInfo();\n break;\n case GET_PAYLOAD_LENGTH_16:\n err = this.getPayloadLength16();\n break;\n case GET_PAYLOAD_LENGTH_64:\n err = this.getPayloadLength64();\n break;\n case GET_MASK:\n this.getMask();\n break;\n case GET_DATA:\n err = this.getData(cb);\n break;\n default:\n // `INFLATING`\n this._loop = false;\n return;\n }\n } while (this._loop);\n\n cb(err);\n }\n\n /**\n * Reads the first two bytes of a frame.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getInfo() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(2);\n\n if ((buf[0] & 0x30) !== 0x00) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV2 and RSV3 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_2_3'\n );\n }\n\n const compressed = (buf[0] & 0x40) === 0x40;\n\n if (compressed && !this._extensions[PerMessageDeflate.extensionName]) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n this._fin = (buf[0] & 0x80) === 0x80;\n this._opcode = buf[0] & 0x0f;\n this._payloadLength = buf[1] & 0x7f;\n\n if (this._opcode === 0x00) {\n if (compressed) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n if (!this._fragmented) {\n this._loop = false;\n return error(\n RangeError,\n 'invalid opcode 0',\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n this._opcode = this._fragmented;\n } else if (this._opcode === 0x01 || this._opcode === 0x02) {\n if (this._fragmented) {\n this._loop = false;\n return error(\n RangeError,\n `invalid opcode ${this._opcode}`,\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n this._compressed = compressed;\n } else if (this._opcode > 0x07 && this._opcode < 0x0b) {\n if (!this._fin) {\n this._loop = false;\n return error(\n RangeError,\n 'FIN must be set',\n true,\n 1002,\n 'WS_ERR_EXPECTED_FIN'\n );\n }\n\n if (compressed) {\n this._loop = false;\n return error(\n RangeError,\n 'RSV1 must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_RSV_1'\n );\n }\n\n if (this._payloadLength > 0x7d) {\n this._loop = false;\n return error(\n RangeError,\n `invalid payload length ${this._payloadLength}`,\n true,\n 1002,\n 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'\n );\n }\n } else {\n this._loop = false;\n return error(\n RangeError,\n `invalid opcode ${this._opcode}`,\n true,\n 1002,\n 'WS_ERR_INVALID_OPCODE'\n );\n }\n\n if (!this._fin && !this._fragmented) this._fragmented = this._opcode;\n this._masked = (buf[1] & 0x80) === 0x80;\n\n if (this._isServer) {\n if (!this._masked) {\n this._loop = false;\n return error(\n RangeError,\n 'MASK must be set',\n true,\n 1002,\n 'WS_ERR_EXPECTED_MASK'\n );\n }\n } else if (this._masked) {\n this._loop = false;\n return error(\n RangeError,\n 'MASK must be clear',\n true,\n 1002,\n 'WS_ERR_UNEXPECTED_MASK'\n );\n }\n\n if (this._payloadLength === 126) this._state = GET_PAYLOAD_LENGTH_16;\n else if (this._payloadLength === 127) this._state = GET_PAYLOAD_LENGTH_64;\n else return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+16).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength16() {\n if (this._bufferedBytes < 2) {\n this._loop = false;\n return;\n }\n\n this._payloadLength = this.consume(2).readUInt16BE(0);\n return this.haveLength();\n }\n\n /**\n * Gets extended payload length (7+64).\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n getPayloadLength64() {\n if (this._bufferedBytes < 8) {\n this._loop = false;\n return;\n }\n\n const buf = this.consume(8);\n const num = buf.readUInt32BE(0);\n\n //\n // The maximum safe integer in JavaScript is 2^53 - 1. An error is returned\n // if payload length is greater than this number.\n //\n if (num > Math.pow(2, 53 - 32) - 1) {\n this._loop = false;\n return error(\n RangeError,\n 'Unsupported WebSocket frame: payload length > 2^53 - 1',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH'\n );\n }\n\n this._payloadLength = num * Math.pow(2, 32) + buf.readUInt32BE(4);\n return this.haveLength();\n }\n\n /**\n * Payload length has been read.\n *\n * @return {(RangeError|undefined)} A possible error\n * @private\n */\n haveLength() {\n if (this._payloadLength && this._opcode < 0x08) {\n this._totalPayloadLength += this._payloadLength;\n if (this._totalPayloadLength > this._maxPayload && this._maxPayload > 0) {\n this._loop = false;\n return error(\n RangeError,\n 'Max payload size exceeded',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n );\n }\n }\n\n if (this._masked) this._state = GET_MASK;\n else this._state = GET_DATA;\n }\n\n /**\n * Reads mask bytes.\n *\n * @private\n */\n getMask() {\n if (this._bufferedBytes < 4) {\n this._loop = false;\n return;\n }\n\n this._mask = this.consume(4);\n this._state = GET_DATA;\n }\n\n /**\n * Reads data bytes.\n *\n * @param {Function} cb Callback\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n getData(cb) {\n let data = EMPTY_BUFFER;\n\n if (this._payloadLength) {\n if (this._bufferedBytes < this._payloadLength) {\n this._loop = false;\n return;\n }\n\n data = this.consume(this._payloadLength);\n if (this._masked) unmask(data, this._mask);\n }\n\n if (this._opcode > 0x07) return this.controlMessage(data);\n\n if (this._compressed) {\n this._state = INFLATING;\n this.decompress(data, cb);\n return;\n }\n\n if (data.length) {\n //\n // This message is not compressed so its lenght is the sum of the payload\n // length of all fragments.\n //\n this._messageLength = this._totalPayloadLength;\n this._fragments.push(data);\n }\n\n return this.dataMessage();\n }\n\n /**\n * Decompresses data.\n *\n * @param {Buffer} data Compressed data\n * @param {Function} cb Callback\n * @private\n */\n decompress(data, cb) {\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n perMessageDeflate.decompress(data, this._fin, (err, buf) => {\n if (err) return cb(err);\n\n if (buf.length) {\n this._messageLength += buf.length;\n if (this._messageLength > this._maxPayload && this._maxPayload > 0) {\n return cb(\n error(\n RangeError,\n 'Max payload size exceeded',\n false,\n 1009,\n 'WS_ERR_UNSUPPORTED_MESSAGE_LENGTH'\n )\n );\n }\n\n this._fragments.push(buf);\n }\n\n const er = this.dataMessage();\n if (er) return cb(er);\n\n this.startLoop(cb);\n });\n }\n\n /**\n * Handles a data message.\n *\n * @return {(Error|undefined)} A possible error\n * @private\n */\n dataMessage() {\n if (this._fin) {\n const messageLength = this._messageLength;\n const fragments = this._fragments;\n\n this._totalPayloadLength = 0;\n this._messageLength = 0;\n this._fragmented = 0;\n this._fragments = [];\n\n if (this._opcode === 2) {\n let data;\n\n if (this._binaryType === 'nodebuffer') {\n data = concat(fragments, messageLength);\n } else if (this._binaryType === 'arraybuffer') {\n data = toArrayBuffer(concat(fragments, messageLength));\n } else {\n data = fragments;\n }\n\n this.emit('message', data);\n } else {\n const buf = concat(fragments, messageLength);\n\n if (!isValidUTF8(buf)) {\n this._loop = false;\n return error(\n Error,\n 'invalid UTF-8 sequence',\n true,\n 1007,\n 'WS_ERR_INVALID_UTF8'\n );\n }\n\n this.emit('message', buf.toString());\n }\n }\n\n this._state = GET_INFO;\n }\n\n /**\n * Handles a control message.\n *\n * @param {Buffer} data Data to handle\n * @return {(Error|RangeError|undefined)} A possible error\n * @private\n */\n controlMessage(data) {\n if (this._opcode === 0x08) {\n this._loop = false;\n\n if (data.length === 0) {\n this.emit('conclude', 1005, '');\n this.end();\n } else if (data.length === 1) {\n return error(\n RangeError,\n 'invalid payload length 1',\n true,\n 1002,\n 'WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH'\n );\n } else {\n const code = data.readUInt16BE(0);\n\n if (!isValidStatusCode(code)) {\n return error(\n RangeError,\n `invalid status code ${code}`,\n true,\n 1002,\n 'WS_ERR_INVALID_CLOSE_CODE'\n );\n }\n\n const buf = data.slice(2);\n\n if (!isValidUTF8(buf)) {\n return error(\n Error,\n 'invalid UTF-8 sequence',\n true,\n 1007,\n 'WS_ERR_INVALID_UTF8'\n );\n }\n\n this.emit('conclude', code, buf.toString());\n this.end();\n }\n } else if (this._opcode === 0x09) {\n this.emit('ping', data);\n } else {\n this.emit('pong', data);\n }\n\n this._state = GET_INFO;\n }\n}\n\nmodule.exports = Receiver;\n\n/**\n * Builds an error object.\n *\n * @param {function(new:Error|RangeError)} ErrorCtor The error constructor\n * @param {String} message The error message\n * @param {Boolean} prefix Specifies whether or not to add a default prefix to\n * `message`\n * @param {Number} statusCode The status code\n * @param {String} errorCode The exposed error code\n * @return {(Error|RangeError)} The error\n * @private\n */\nfunction error(ErrorCtor, message, prefix, statusCode, errorCode) {\n const err = new ErrorCtor(\n prefix ? `Invalid WebSocket frame: ${message}` : message\n );\n\n Error.captureStackTrace(err, error);\n err.code = errorCode;\n err[kStatusCode] = statusCode;\n return err;\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^net|tls$\" }] */\n\n'use strict';\n\nconst net = require('net');\nconst tls = require('tls');\nconst { randomFillSync } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst { EMPTY_BUFFER } = require('./constants');\nconst { isValidStatusCode } = require('./validation');\nconst { mask: applyMask, toBuffer } = require('./buffer-util');\n\nconst mask = Buffer.alloc(4);\n\n/**\n * HyBi Sender implementation.\n */\nclass Sender {\n /**\n * Creates a Sender instance.\n *\n * @param {(net.Socket|tls.Socket)} socket The connection socket\n * @param {Object} [extensions] An object containing the negotiated extensions\n */\n constructor(socket, extensions) {\n this._extensions = extensions || {};\n this._socket = socket;\n\n this._firstFragment = true;\n this._compress = false;\n\n this._bufferedBytes = 0;\n this._deflating = false;\n this._queue = [];\n }\n\n /**\n * Frames a piece of data according to the HyBi WebSocket protocol.\n *\n * @param {Buffer} data The data to frame\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n * modified\n * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n * FIN bit\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n * RSV1 bit\n * @return {Buffer[]} The framed data as a list of `Buffer` instances\n * @public\n */\n static frame(data, options) {\n const merge = options.mask && options.readOnly;\n let offset = options.mask ? 6 : 2;\n let payloadLength = data.length;\n\n if (data.length >= 65536) {\n offset += 8;\n payloadLength = 127;\n } else if (data.length > 125) {\n offset += 2;\n payloadLength = 126;\n }\n\n const target = Buffer.allocUnsafe(merge ? data.length + offset : offset);\n\n target[0] = options.fin ? options.opcode | 0x80 : options.opcode;\n if (options.rsv1) target[0] |= 0x40;\n\n target[1] = payloadLength;\n\n if (payloadLength === 126) {\n target.writeUInt16BE(data.length, 2);\n } else if (payloadLength === 127) {\n target.writeUInt32BE(0, 2);\n target.writeUInt32BE(data.length, 6);\n }\n\n if (!options.mask) return [target, data];\n\n randomFillSync(mask, 0, 4);\n\n target[1] |= 0x80;\n target[offset - 4] = mask[0];\n target[offset - 3] = mask[1];\n target[offset - 2] = mask[2];\n target[offset - 1] = mask[3];\n\n if (merge) {\n applyMask(data, mask, target, offset, data.length);\n return [target];\n }\n\n applyMask(data, mask, data, 0, data.length);\n return [target, data];\n }\n\n /**\n * Sends a close message to the other peer.\n *\n * @param {Number} [code] The status code component of the body\n * @param {String} [data] The message component of the body\n * @param {Boolean} [mask=false] Specifies whether or not to mask the message\n * @param {Function} [cb] Callback\n * @public\n */\n close(code, data, mask, cb) {\n let buf;\n\n if (code === undefined) {\n buf = EMPTY_BUFFER;\n } else if (typeof code !== 'number' || !isValidStatusCode(code)) {\n throw new TypeError('First argument must be a valid error code number');\n } else if (data === undefined || data === '') {\n buf = Buffer.allocUnsafe(2);\n buf.writeUInt16BE(code, 0);\n } else {\n const length = Buffer.byteLength(data);\n\n if (length > 123) {\n throw new RangeError('The message must not be greater than 123 bytes');\n }\n\n buf = Buffer.allocUnsafe(2 + length);\n buf.writeUInt16BE(code, 0);\n buf.write(data, 2);\n }\n\n if (this._deflating) {\n this.enqueue([this.doClose, buf, mask, cb]);\n } else {\n this.doClose(buf, mask, cb);\n }\n }\n\n /**\n * Frames and sends a close message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @private\n */\n doClose(data, mask, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x08,\n mask,\n readOnly: false\n }),\n cb\n );\n }\n\n /**\n * Sends a ping message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @public\n */\n ping(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (buf.length > 125) {\n throw new RangeError('The data size must not be greater than 125 bytes');\n }\n\n if (this._deflating) {\n this.enqueue([this.doPing, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPing(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a ping message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n * @param {Function} [cb] Callback\n * @private\n */\n doPing(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x09,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a pong message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback\n * @public\n */\n pong(data, mask, cb) {\n const buf = toBuffer(data);\n\n if (buf.length > 125) {\n throw new RangeError('The data size must not be greater than 125 bytes');\n }\n\n if (this._deflating) {\n this.enqueue([this.doPong, buf, mask, toBuffer.readOnly, cb]);\n } else {\n this.doPong(buf, mask, toBuffer.readOnly, cb);\n }\n }\n\n /**\n * Frames and sends a pong message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [mask=false] Specifies whether or not to mask `data`\n * @param {Boolean} [readOnly=false] Specifies whether `data` can be modified\n * @param {Function} [cb] Callback\n * @private\n */\n doPong(data, mask, readOnly, cb) {\n this.sendFrame(\n Sender.frame(data, {\n fin: true,\n rsv1: false,\n opcode: 0x0a,\n mask,\n readOnly\n }),\n cb\n );\n }\n\n /**\n * Sends a data message to the other peer.\n *\n * @param {*} data The message to send\n * @param {Object} options Options object\n * @param {Boolean} [options.compress=false] Specifies whether or not to\n * compress `data`\n * @param {Boolean} [options.binary=false] Specifies whether `data` is binary\n * or text\n * @param {Boolean} [options.fin=false] Specifies whether the fragment is the\n * last one\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Function} [cb] Callback\n * @public\n */\n send(data, options, cb) {\n const buf = toBuffer(data);\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n let opcode = options.binary ? 2 : 1;\n let rsv1 = options.compress;\n\n if (this._firstFragment) {\n this._firstFragment = false;\n if (rsv1 && perMessageDeflate) {\n rsv1 = buf.length >= perMessageDeflate._threshold;\n }\n this._compress = rsv1;\n } else {\n rsv1 = false;\n opcode = 0;\n }\n\n if (options.fin) this._firstFragment = true;\n\n if (perMessageDeflate) {\n const opts = {\n fin: options.fin,\n rsv1,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n };\n\n if (this._deflating) {\n this.enqueue([this.dispatch, buf, this._compress, opts, cb]);\n } else {\n this.dispatch(buf, this._compress, opts, cb);\n }\n } else {\n this.sendFrame(\n Sender.frame(buf, {\n fin: options.fin,\n rsv1: false,\n opcode,\n mask: options.mask,\n readOnly: toBuffer.readOnly\n }),\n cb\n );\n }\n }\n\n /**\n * Dispatches a data message.\n *\n * @param {Buffer} data The message to send\n * @param {Boolean} [compress=false] Specifies whether or not to compress\n * `data`\n * @param {Object} options Options object\n * @param {Number} options.opcode The opcode\n * @param {Boolean} [options.readOnly=false] Specifies whether `data` can be\n * modified\n * @param {Boolean} [options.fin=false] Specifies whether or not to set the\n * FIN bit\n * @param {Boolean} [options.mask=false] Specifies whether or not to mask\n * `data`\n * @param {Boolean} [options.rsv1=false] Specifies whether or not to set the\n * RSV1 bit\n * @param {Function} [cb] Callback\n * @private\n */\n dispatch(data, compress, options, cb) {\n if (!compress) {\n this.sendFrame(Sender.frame(data, options), cb);\n return;\n }\n\n const perMessageDeflate = this._extensions[PerMessageDeflate.extensionName];\n\n this._bufferedBytes += data.length;\n this._deflating = true;\n perMessageDeflate.compress(data, options.fin, (_, buf) => {\n if (this._socket.destroyed) {\n const err = new Error(\n 'The socket was closed while data was being compressed'\n );\n\n if (typeof cb === 'function') cb(err);\n\n for (let i = 0; i < this._queue.length; i++) {\n const callback = this._queue[i][4];\n\n if (typeof callback === 'function') callback(err);\n }\n\n return;\n }\n\n this._bufferedBytes -= data.length;\n this._deflating = false;\n options.readOnly = false;\n this.sendFrame(Sender.frame(buf, options), cb);\n this.dequeue();\n });\n }\n\n /**\n * Executes queued send operations.\n *\n * @private\n */\n dequeue() {\n while (!this._deflating && this._queue.length) {\n const params = this._queue.shift();\n\n this._bufferedBytes -= params[1].length;\n Reflect.apply(params[0], this, params.slice(1));\n }\n }\n\n /**\n * Enqueues a send operation.\n *\n * @param {Array} params Send operation parameters.\n * @private\n */\n enqueue(params) {\n this._bufferedBytes += params[1].length;\n this._queue.push(params);\n }\n\n /**\n * Sends a frame.\n *\n * @param {Buffer[]} list The frame to send\n * @param {Function} [cb] Callback\n * @private\n */\n sendFrame(list, cb) {\n if (list.length === 2) {\n this._socket.cork();\n this._socket.write(list[0]);\n this._socket.write(list[1], cb);\n this._socket.uncork();\n } else {\n this._socket.write(list[0], cb);\n }\n }\n}\n\nmodule.exports = Sender;\n","'use strict';\n\nconst { Duplex } = require('stream');\n\n/**\n * Emits the `'close'` event on a stream.\n *\n * @param {Duplex} stream The stream.\n * @private\n */\nfunction emitClose(stream) {\n stream.emit('close');\n}\n\n/**\n * The listener of the `'end'` event.\n *\n * @private\n */\nfunction duplexOnEnd() {\n if (!this.destroyed && this._writableState.finished) {\n this.destroy();\n }\n}\n\n/**\n * The listener of the `'error'` event.\n *\n * @param {Error} err The error\n * @private\n */\nfunction duplexOnError(err) {\n this.removeListener('error', duplexOnError);\n this.destroy();\n if (this.listenerCount('error') === 0) {\n // Do not suppress the throwing behavior.\n this.emit('error', err);\n }\n}\n\n/**\n * Wraps a `WebSocket` in a duplex stream.\n *\n * @param {WebSocket} ws The `WebSocket` to wrap\n * @param {Object} [options] The options for the `Duplex` constructor\n * @return {Duplex} The duplex stream\n * @public\n */\nfunction createWebSocketStream(ws, options) {\n let resumeOnReceiverDrain = true;\n let terminateOnDestroy = true;\n\n function receiverOnDrain() {\n if (resumeOnReceiverDrain) ws._socket.resume();\n }\n\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n ws._receiver.removeAllListeners('drain');\n ws._receiver.on('drain', receiverOnDrain);\n });\n } else {\n ws._receiver.removeAllListeners('drain');\n ws._receiver.on('drain', receiverOnDrain);\n }\n\n const duplex = new Duplex({\n ...options,\n autoDestroy: false,\n emitClose: false,\n objectMode: false,\n writableObjectMode: false\n });\n\n ws.on('message', function message(msg) {\n if (!duplex.push(msg)) {\n resumeOnReceiverDrain = false;\n ws._socket.pause();\n }\n });\n\n ws.once('error', function error(err) {\n if (duplex.destroyed) return;\n\n // Prevent `ws.terminate()` from being called by `duplex._destroy()`.\n //\n // - If the `'error'` event is emitted before the `'open'` event, then\n // `ws.terminate()` is a noop as no socket is assigned.\n // - Otherwise, the error is re-emitted by the listener of the `'error'`\n // event of the `Receiver` object. The listener already closes the\n // connection by calling `ws.close()`. This allows a close frame to be\n // sent to the other peer. If `ws.terminate()` is called right after this,\n // then the close frame might not be sent.\n terminateOnDestroy = false;\n duplex.destroy(err);\n });\n\n ws.once('close', function close() {\n if (duplex.destroyed) return;\n\n duplex.push(null);\n });\n\n duplex._destroy = function (err, callback) {\n if (ws.readyState === ws.CLOSED) {\n callback(err);\n process.nextTick(emitClose, duplex);\n return;\n }\n\n let called = false;\n\n ws.once('error', function error(err) {\n called = true;\n callback(err);\n });\n\n ws.once('close', function close() {\n if (!called) callback(err);\n process.nextTick(emitClose, duplex);\n });\n\n if (terminateOnDestroy) ws.terminate();\n };\n\n duplex._final = function (callback) {\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n duplex._final(callback);\n });\n return;\n }\n\n // If the value of the `_socket` property is `null` it means that `ws` is a\n // client websocket and the handshake failed. In fact, when this happens, a\n // socket is never assigned to the websocket. Wait for the `'error'` event\n // that will be emitted by the websocket.\n if (ws._socket === null) return;\n\n if (ws._socket._writableState.finished) {\n callback();\n if (duplex._readableState.endEmitted) duplex.destroy();\n } else {\n ws._socket.once('finish', function finish() {\n // `duplex` is not destroyed here because the `'end'` event will be\n // emitted on `duplex` after this `'finish'` event. The EOF signaling\n // `null` chunk is, in fact, pushed when the websocket emits `'close'`.\n callback();\n });\n ws.close();\n }\n };\n\n duplex._read = function () {\n if (\n (ws.readyState === ws.OPEN || ws.readyState === ws.CLOSING) &&\n !resumeOnReceiverDrain\n ) {\n resumeOnReceiverDrain = true;\n if (!ws._receiver._writableState.needDrain) ws._socket.resume();\n }\n };\n\n duplex._write = function (chunk, encoding, callback) {\n if (ws.readyState === ws.CONNECTING) {\n ws.once('open', function open() {\n duplex._write(chunk, encoding, callback);\n });\n return;\n }\n\n ws.send(chunk, callback);\n };\n\n duplex.on('end', duplexOnEnd);\n duplex.on('error', duplexOnError);\n return duplex;\n}\n\nmodule.exports = createWebSocketStream;\n","'use strict';\n\n/**\n * Checks if a status code is allowed in a close frame.\n *\n * @param {Number} code The status code\n * @return {Boolean} `true` if the status code is valid, else `false`\n * @public\n */\nfunction isValidStatusCode(code) {\n return (\n (code >= 1000 &&\n code <= 1014 &&\n code !== 1004 &&\n code !== 1005 &&\n code !== 1006) ||\n (code >= 3000 && code <= 4999)\n );\n}\n\n/**\n * Checks if a given buffer contains only correct UTF-8.\n * Ported from https://www.cl.cam.ac.uk/%7Emgk25/ucs/utf8_check.c by\n * Markus Kuhn.\n *\n * @param {Buffer} buf The buffer to check\n * @return {Boolean} `true` if `buf` contains only correct UTF-8, else `false`\n * @public\n */\nfunction _isValidUTF8(buf) {\n const len = buf.length;\n let i = 0;\n\n while (i < len) {\n if ((buf[i] & 0x80) === 0) {\n // 0xxxxxxx\n i++;\n } else if ((buf[i] & 0xe0) === 0xc0) {\n // 110xxxxx 10xxxxxx\n if (\n i + 1 === len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i] & 0xfe) === 0xc0 // Overlong\n ) {\n return false;\n }\n\n i += 2;\n } else if ((buf[i] & 0xf0) === 0xe0) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n if (\n i + 2 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i] === 0xe0 && (buf[i + 1] & 0xe0) === 0x80) || // Overlong\n (buf[i] === 0xed && (buf[i + 1] & 0xe0) === 0xa0) // Surrogate (U+D800 - U+DFFF)\n ) {\n return false;\n }\n\n i += 3;\n } else if ((buf[i] & 0xf8) === 0xf0) {\n // 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx\n if (\n i + 3 >= len ||\n (buf[i + 1] & 0xc0) !== 0x80 ||\n (buf[i + 2] & 0xc0) !== 0x80 ||\n (buf[i + 3] & 0xc0) !== 0x80 ||\n (buf[i] === 0xf0 && (buf[i + 1] & 0xf0) === 0x80) || // Overlong\n (buf[i] === 0xf4 && buf[i + 1] > 0x8f) ||\n buf[i] > 0xf4 // > U+10FFFF\n ) {\n return false;\n }\n\n i += 4;\n } else {\n return false;\n }\n }\n\n return true;\n}\n\ntry {\n let isValidUTF8 = require('utf-8-validate');\n\n /* istanbul ignore if */\n if (typeof isValidUTF8 === 'object') {\n isValidUTF8 = isValidUTF8.Validation.isValidUTF8; // utf-8-validate@<3.0.0\n }\n\n module.exports = {\n isValidStatusCode,\n isValidUTF8(buf) {\n return buf.length < 150 ? _isValidUTF8(buf) : isValidUTF8(buf);\n }\n };\n} catch (e) /* istanbul ignore next */ {\n module.exports = {\n isValidStatusCode,\n isValidUTF8: _isValidUTF8\n };\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^net|tls|https$\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst http = require('http');\nconst https = require('https');\nconst net = require('net');\nconst tls = require('tls');\nconst { createHash } = require('crypto');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst WebSocket = require('./websocket');\nconst { format, parse } = require('./extension');\nconst { GUID, kWebSocket } = require('./constants');\n\nconst keyRegex = /^[+/0-9A-Za-z]{22}==$/;\n\nconst RUNNING = 0;\nconst CLOSING = 1;\nconst CLOSED = 2;\n\n/**\n * Class representing a WebSocket server.\n *\n * @extends EventEmitter\n */\nclass WebSocketServer extends EventEmitter {\n /**\n * Create a `WebSocketServer` instance.\n *\n * @param {Object} options Configuration options\n * @param {Number} [options.backlog=511] The maximum length of the queue of\n * pending connections\n * @param {Boolean} [options.clientTracking=true] Specifies whether or not to\n * track clients\n * @param {Function} [options.handleProtocols] A hook to handle protocols\n * @param {String} [options.host] The hostname where to bind the server\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n * size\n * @param {Boolean} [options.noServer=false] Enable no server mode\n * @param {String} [options.path] Accept only connections matching this path\n * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable\n * permessage-deflate\n * @param {Number} [options.port] The port where to bind the server\n * @param {(http.Server|https.Server)} [options.server] A pre-created HTTP/S\n * server to use\n * @param {Function} [options.verifyClient] A hook to reject connections\n * @param {Function} [callback] A listener for the `listening` event\n */\n constructor(options, callback) {\n super();\n\n options = {\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: false,\n handleProtocols: null,\n clientTracking: true,\n verifyClient: null,\n noServer: false,\n backlog: null, // use default (511 as implemented in net.js)\n server: null,\n host: null,\n path: null,\n port: null,\n ...options\n };\n\n if (\n (options.port == null && !options.server && !options.noServer) ||\n (options.port != null && (options.server || options.noServer)) ||\n (options.server && options.noServer)\n ) {\n throw new TypeError(\n 'One and only one of the \"port\", \"server\", or \"noServer\" options ' +\n 'must be specified'\n );\n }\n\n if (options.port != null) {\n this._server = http.createServer((req, res) => {\n const body = http.STATUS_CODES[426];\n\n res.writeHead(426, {\n 'Content-Length': body.length,\n 'Content-Type': 'text/plain'\n });\n res.end(body);\n });\n this._server.listen(\n options.port,\n options.host,\n options.backlog,\n callback\n );\n } else if (options.server) {\n this._server = options.server;\n }\n\n if (this._server) {\n const emitConnection = this.emit.bind(this, 'connection');\n\n this._removeListeners = addListeners(this._server, {\n listening: this.emit.bind(this, 'listening'),\n error: this.emit.bind(this, 'error'),\n upgrade: (req, socket, head) => {\n this.handleUpgrade(req, socket, head, emitConnection);\n }\n });\n }\n\n if (options.perMessageDeflate === true) options.perMessageDeflate = {};\n if (options.clientTracking) this.clients = new Set();\n this.options = options;\n this._state = RUNNING;\n }\n\n /**\n * Returns the bound address, the address family name, and port of the server\n * as reported by the operating system if listening on an IP socket.\n * If the server is listening on a pipe or UNIX domain socket, the name is\n * returned as a string.\n *\n * @return {(Object|String|null)} The address of the server\n * @public\n */\n address() {\n if (this.options.noServer) {\n throw new Error('The server is operating in \"noServer\" mode');\n }\n\n if (!this._server) return null;\n return this._server.address();\n }\n\n /**\n * Close the server.\n *\n * @param {Function} [cb] Callback\n * @public\n */\n close(cb) {\n if (cb) this.once('close', cb);\n\n if (this._state === CLOSED) {\n process.nextTick(emitClose, this);\n return;\n }\n\n if (this._state === CLOSING) return;\n this._state = CLOSING;\n\n //\n // Terminate all associated clients.\n //\n if (this.clients) {\n for (const client of this.clients) client.terminate();\n }\n\n const server = this._server;\n\n if (server) {\n this._removeListeners();\n this._removeListeners = this._server = null;\n\n //\n // Close the http server if it was internally created.\n //\n if (this.options.port != null) {\n server.close(emitClose.bind(undefined, this));\n return;\n }\n }\n\n process.nextTick(emitClose, this);\n }\n\n /**\n * See if a given request should be handled by this server instance.\n *\n * @param {http.IncomingMessage} req Request object to inspect\n * @return {Boolean} `true` if the request is valid, else `false`\n * @public\n */\n shouldHandle(req) {\n if (this.options.path) {\n const index = req.url.indexOf('?');\n const pathname = index !== -1 ? req.url.slice(0, index) : req.url;\n\n if (pathname !== this.options.path) return false;\n }\n\n return true;\n }\n\n /**\n * Handle a HTTP Upgrade request.\n *\n * @param {http.IncomingMessage} req The request object\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @public\n */\n handleUpgrade(req, socket, head, cb) {\n socket.on('error', socketOnError);\n\n const key =\n req.headers['sec-websocket-key'] !== undefined\n ? req.headers['sec-websocket-key'].trim()\n : false;\n const version = +req.headers['sec-websocket-version'];\n const extensions = {};\n\n if (\n req.method !== 'GET' ||\n req.headers.upgrade.toLowerCase() !== 'websocket' ||\n !key ||\n !keyRegex.test(key) ||\n (version !== 8 && version !== 13) ||\n !this.shouldHandle(req)\n ) {\n return abortHandshake(socket, 400);\n }\n\n if (this.options.perMessageDeflate) {\n const perMessageDeflate = new PerMessageDeflate(\n this.options.perMessageDeflate,\n true,\n this.options.maxPayload\n );\n\n try {\n const offers = parse(req.headers['sec-websocket-extensions']);\n\n if (offers[PerMessageDeflate.extensionName]) {\n perMessageDeflate.accept(offers[PerMessageDeflate.extensionName]);\n extensions[PerMessageDeflate.extensionName] = perMessageDeflate;\n }\n } catch (err) {\n return abortHandshake(socket, 400);\n }\n }\n\n //\n // Optionally call external client verification handler.\n //\n if (this.options.verifyClient) {\n const info = {\n origin:\n req.headers[`${version === 8 ? 'sec-websocket-origin' : 'origin'}`],\n secure: !!(req.socket.authorized || req.socket.encrypted),\n req\n };\n\n if (this.options.verifyClient.length === 2) {\n this.options.verifyClient(info, (verified, code, message, headers) => {\n if (!verified) {\n return abortHandshake(socket, code || 401, message, headers);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n });\n return;\n }\n\n if (!this.options.verifyClient(info)) return abortHandshake(socket, 401);\n }\n\n this.completeUpgrade(key, extensions, req, socket, head, cb);\n }\n\n /**\n * Upgrade the connection to WebSocket.\n *\n * @param {String} key The value of the `Sec-WebSocket-Key` header\n * @param {Object} extensions The accepted extensions\n * @param {http.IncomingMessage} req The request object\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Function} cb Callback\n * @throws {Error} If called more than once with the same socket\n * @private\n */\n completeUpgrade(key, extensions, req, socket, head, cb) {\n //\n // Destroy the socket if the client has already sent a FIN packet.\n //\n if (!socket.readable || !socket.writable) return socket.destroy();\n\n if (socket[kWebSocket]) {\n throw new Error(\n 'server.handleUpgrade() was called more than once with the same ' +\n 'socket, possibly due to a misconfiguration'\n );\n }\n\n if (this._state > RUNNING) return abortHandshake(socket, 503);\n\n const digest = createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n const headers = [\n 'HTTP/1.1 101 Switching Protocols',\n 'Upgrade: websocket',\n 'Connection: Upgrade',\n `Sec-WebSocket-Accept: ${digest}`\n ];\n\n const ws = new WebSocket(null);\n let protocol = req.headers['sec-websocket-protocol'];\n\n if (protocol) {\n protocol = protocol.split(',').map(trim);\n\n //\n // Optionally call external protocol selection handler.\n //\n if (this.options.handleProtocols) {\n protocol = this.options.handleProtocols(protocol, req);\n } else {\n protocol = protocol[0];\n }\n\n if (protocol) {\n headers.push(`Sec-WebSocket-Protocol: ${protocol}`);\n ws._protocol = protocol;\n }\n }\n\n if (extensions[PerMessageDeflate.extensionName]) {\n const params = extensions[PerMessageDeflate.extensionName].params;\n const value = format({\n [PerMessageDeflate.extensionName]: [params]\n });\n headers.push(`Sec-WebSocket-Extensions: ${value}`);\n ws._extensions = extensions;\n }\n\n //\n // Allow external modification/inspection of handshake headers.\n //\n this.emit('headers', headers, req);\n\n socket.write(headers.concat('\\r\\n').join('\\r\\n'));\n socket.removeListener('error', socketOnError);\n\n ws.setSocket(socket, head, this.options.maxPayload);\n\n if (this.clients) {\n this.clients.add(ws);\n ws.on('close', () => this.clients.delete(ws));\n }\n\n cb(ws, req);\n }\n}\n\nmodule.exports = WebSocketServer;\n\n/**\n * Add event listeners on an `EventEmitter` using a map of \n * pairs.\n *\n * @param {EventEmitter} server The event emitter\n * @param {Object.} map The listeners to add\n * @return {Function} A function that will remove the added listeners when\n * called\n * @private\n */\nfunction addListeners(server, map) {\n for (const event of Object.keys(map)) server.on(event, map[event]);\n\n return function removeListeners() {\n for (const event of Object.keys(map)) {\n server.removeListener(event, map[event]);\n }\n };\n}\n\n/**\n * Emit a `'close'` event on an `EventEmitter`.\n *\n * @param {EventEmitter} server The event emitter\n * @private\n */\nfunction emitClose(server) {\n server._state = CLOSED;\n server.emit('close');\n}\n\n/**\n * Handle premature socket errors.\n *\n * @private\n */\nfunction socketOnError() {\n this.destroy();\n}\n\n/**\n * Close the connection when preconditions are not fulfilled.\n *\n * @param {(net.Socket|tls.Socket)} socket The socket of the upgrade request\n * @param {Number} code The HTTP response status code\n * @param {String} [message] The HTTP response body\n * @param {Object} [headers] Additional HTTP response headers\n * @private\n */\nfunction abortHandshake(socket, code, message, headers) {\n if (socket.writable) {\n message = message || http.STATUS_CODES[code];\n headers = {\n Connection: 'close',\n 'Content-Type': 'text/html',\n 'Content-Length': Buffer.byteLength(message),\n ...headers\n };\n\n socket.write(\n `HTTP/1.1 ${code} ${http.STATUS_CODES[code]}\\r\\n` +\n Object.keys(headers)\n .map((h) => `${h}: ${headers[h]}`)\n .join('\\r\\n') +\n '\\r\\n\\r\\n' +\n message\n );\n }\n\n socket.removeListener('error', socketOnError);\n socket.destroy();\n}\n\n/**\n * Remove whitespace characters from both ends of a string.\n *\n * @param {String} str The string\n * @return {String} A new string representing `str` stripped of whitespace\n * characters from both its beginning and end\n * @private\n */\nfunction trim(str) {\n return str.trim();\n}\n","/* eslint no-unused-vars: [\"error\", { \"varsIgnorePattern\": \"^Readable$\" }] */\n\n'use strict';\n\nconst EventEmitter = require('events');\nconst https = require('https');\nconst http = require('http');\nconst net = require('net');\nconst tls = require('tls');\nconst { randomBytes, createHash } = require('crypto');\nconst { Readable } = require('stream');\nconst { URL } = require('url');\n\nconst PerMessageDeflate = require('./permessage-deflate');\nconst Receiver = require('./receiver');\nconst Sender = require('./sender');\nconst {\n BINARY_TYPES,\n EMPTY_BUFFER,\n GUID,\n kStatusCode,\n kWebSocket,\n NOOP\n} = require('./constants');\nconst { addEventListener, removeEventListener } = require('./event-target');\nconst { format, parse } = require('./extension');\nconst { toBuffer } = require('./buffer-util');\n\nconst readyStates = ['CONNECTING', 'OPEN', 'CLOSING', 'CLOSED'];\nconst protocolVersions = [8, 13];\nconst closeTimeout = 30 * 1000;\n\n/**\n * Class representing a WebSocket.\n *\n * @extends EventEmitter\n */\nclass WebSocket extends EventEmitter {\n /**\n * Create a new `WebSocket`.\n *\n * @param {(String|URL)} address The URL to which to connect\n * @param {(String|String[])} [protocols] The subprotocols\n * @param {Object} [options] Connection options\n */\n constructor(address, protocols, options) {\n super();\n\n this._binaryType = BINARY_TYPES[0];\n this._closeCode = 1006;\n this._closeFrameReceived = false;\n this._closeFrameSent = false;\n this._closeMessage = '';\n this._closeTimer = null;\n this._extensions = {};\n this._protocol = '';\n this._readyState = WebSocket.CONNECTING;\n this._receiver = null;\n this._sender = null;\n this._socket = null;\n\n if (address !== null) {\n this._bufferedAmount = 0;\n this._isServer = false;\n this._redirects = 0;\n\n if (Array.isArray(protocols)) {\n protocols = protocols.join(', ');\n } else if (typeof protocols === 'object' && protocols !== null) {\n options = protocols;\n protocols = undefined;\n }\n\n initAsClient(this, address, protocols, options);\n } else {\n this._isServer = true;\n }\n }\n\n /**\n * This deviates from the WHATWG interface since ws doesn't support the\n * required default \"blob\" type (instead we define a custom \"nodebuffer\"\n * type).\n *\n * @type {String}\n */\n get binaryType() {\n return this._binaryType;\n }\n\n set binaryType(type) {\n if (!BINARY_TYPES.includes(type)) return;\n\n this._binaryType = type;\n\n //\n // Allow to change `binaryType` on the fly.\n //\n if (this._receiver) this._receiver._binaryType = type;\n }\n\n /**\n * @type {Number}\n */\n get bufferedAmount() {\n if (!this._socket) return this._bufferedAmount;\n\n return this._socket._writableState.length + this._sender._bufferedBytes;\n }\n\n /**\n * @type {String}\n */\n get extensions() {\n return Object.keys(this._extensions).join();\n }\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onclose() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onclose(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onerror() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onerror(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onopen() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onopen(listener) {}\n\n /**\n * @type {Function}\n */\n /* istanbul ignore next */\n get onmessage() {\n return undefined;\n }\n\n /* istanbul ignore next */\n set onmessage(listener) {}\n\n /**\n * @type {String}\n */\n get protocol() {\n return this._protocol;\n }\n\n /**\n * @type {Number}\n */\n get readyState() {\n return this._readyState;\n }\n\n /**\n * @type {String}\n */\n get url() {\n return this._url;\n }\n\n /**\n * Set up the socket and the internal resources.\n *\n * @param {(net.Socket|tls.Socket)} socket The network socket between the\n * server and client\n * @param {Buffer} head The first packet of the upgraded stream\n * @param {Number} [maxPayload=0] The maximum allowed message size\n * @private\n */\n setSocket(socket, head, maxPayload) {\n const receiver = new Receiver(\n this.binaryType,\n this._extensions,\n this._isServer,\n maxPayload\n );\n\n this._sender = new Sender(socket, this._extensions);\n this._receiver = receiver;\n this._socket = socket;\n\n receiver[kWebSocket] = this;\n socket[kWebSocket] = this;\n\n receiver.on('conclude', receiverOnConclude);\n receiver.on('drain', receiverOnDrain);\n receiver.on('error', receiverOnError);\n receiver.on('message', receiverOnMessage);\n receiver.on('ping', receiverOnPing);\n receiver.on('pong', receiverOnPong);\n\n socket.setTimeout(0);\n socket.setNoDelay();\n\n if (head.length > 0) socket.unshift(head);\n\n socket.on('close', socketOnClose);\n socket.on('data', socketOnData);\n socket.on('end', socketOnEnd);\n socket.on('error', socketOnError);\n\n this._readyState = WebSocket.OPEN;\n this.emit('open');\n }\n\n /**\n * Emit the `'close'` event.\n *\n * @private\n */\n emitClose() {\n if (!this._socket) {\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n return;\n }\n\n if (this._extensions[PerMessageDeflate.extensionName]) {\n this._extensions[PerMessageDeflate.extensionName].cleanup();\n }\n\n this._receiver.removeAllListeners();\n this._readyState = WebSocket.CLOSED;\n this.emit('close', this._closeCode, this._closeMessage);\n }\n\n /**\n * Start a closing handshake.\n *\n * +----------+ +-----------+ +----------+\n * - - -|ws.close()|-->|close frame|-->|ws.close()|- - -\n * | +----------+ +-----------+ +----------+ |\n * +----------+ +-----------+ |\n * CLOSING |ws.close()|<--|close frame|<--+-----+ CLOSING\n * +----------+ +-----------+ |\n * | | | +---+ |\n * +------------------------+-->|fin| - - - -\n * | +---+ | +---+\n * - - - - -|fin|<---------------------+\n * +---+\n *\n * @param {Number} [code] Status code explaining why the connection is closing\n * @param {String} [data] A string explaining why the connection is closing\n * @public\n */\n close(code, data) {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this.readyState === WebSocket.CLOSING) {\n if (\n this._closeFrameSent &&\n (this._closeFrameReceived || this._receiver._writableState.errorEmitted)\n ) {\n this._socket.end();\n }\n\n return;\n }\n\n this._readyState = WebSocket.CLOSING;\n this._sender.close(code, data, !this._isServer, (err) => {\n //\n // This error is handled by the `'error'` listener on the socket. We only\n // want to know if the close frame has been sent here.\n //\n if (err) return;\n\n this._closeFrameSent = true;\n\n if (\n this._closeFrameReceived ||\n this._receiver._writableState.errorEmitted\n ) {\n this._socket.end();\n }\n });\n\n //\n // Specify a timeout for the closing handshake to complete.\n //\n this._closeTimer = setTimeout(\n this._socket.destroy.bind(this._socket),\n closeTimeout\n );\n }\n\n /**\n * Send a ping.\n *\n * @param {*} [data] The data to send\n * @param {Boolean} [mask] Indicates whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when the ping is sent\n * @public\n */\n ping(data, mask, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n if (mask === undefined) mask = !this._isServer;\n this._sender.ping(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a pong.\n *\n * @param {*} [data] The data to send\n * @param {Boolean} [mask] Indicates whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when the pong is sent\n * @public\n */\n pong(data, mask, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof data === 'function') {\n cb = data;\n data = mask = undefined;\n } else if (typeof mask === 'function') {\n cb = mask;\n mask = undefined;\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n if (mask === undefined) mask = !this._isServer;\n this._sender.pong(data || EMPTY_BUFFER, mask, cb);\n }\n\n /**\n * Send a data message.\n *\n * @param {*} data The message to send\n * @param {Object} [options] Options object\n * @param {Boolean} [options.compress] Specifies whether or not to compress\n * `data`\n * @param {Boolean} [options.binary] Specifies whether `data` is binary or\n * text\n * @param {Boolean} [options.fin=true] Specifies whether the fragment is the\n * last one\n * @param {Boolean} [options.mask] Specifies whether or not to mask `data`\n * @param {Function} [cb] Callback which is executed when data is written out\n * @public\n */\n send(data, options, cb) {\n if (this.readyState === WebSocket.CONNECTING) {\n throw new Error('WebSocket is not open: readyState 0 (CONNECTING)');\n }\n\n if (typeof options === 'function') {\n cb = options;\n options = {};\n }\n\n if (typeof data === 'number') data = data.toString();\n\n if (this.readyState !== WebSocket.OPEN) {\n sendAfterClose(this, data, cb);\n return;\n }\n\n const opts = {\n binary: typeof data !== 'string',\n mask: !this._isServer,\n compress: true,\n fin: true,\n ...options\n };\n\n if (!this._extensions[PerMessageDeflate.extensionName]) {\n opts.compress = false;\n }\n\n this._sender.send(data || EMPTY_BUFFER, opts, cb);\n }\n\n /**\n * Forcibly close the connection.\n *\n * @public\n */\n terminate() {\n if (this.readyState === WebSocket.CLOSED) return;\n if (this.readyState === WebSocket.CONNECTING) {\n const msg = 'WebSocket was closed before the connection was established';\n return abortHandshake(this, this._req, msg);\n }\n\n if (this._socket) {\n this._readyState = WebSocket.CLOSING;\n this._socket.destroy();\n }\n }\n}\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CONNECTING', {\n enumerable: true,\n value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} CONNECTING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CONNECTING', {\n enumerable: true,\n value: readyStates.indexOf('CONNECTING')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'OPEN', {\n enumerable: true,\n value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} OPEN\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'OPEN', {\n enumerable: true,\n value: readyStates.indexOf('OPEN')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSING', {\n enumerable: true,\n value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSING\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSING', {\n enumerable: true,\n value: readyStates.indexOf('CLOSING')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket\n */\nObject.defineProperty(WebSocket, 'CLOSED', {\n enumerable: true,\n value: readyStates.indexOf('CLOSED')\n});\n\n/**\n * @constant {Number} CLOSED\n * @memberof WebSocket.prototype\n */\nObject.defineProperty(WebSocket.prototype, 'CLOSED', {\n enumerable: true,\n value: readyStates.indexOf('CLOSED')\n});\n\n[\n 'binaryType',\n 'bufferedAmount',\n 'extensions',\n 'protocol',\n 'readyState',\n 'url'\n].forEach((property) => {\n Object.defineProperty(WebSocket.prototype, property, { enumerable: true });\n});\n\n//\n// Add the `onopen`, `onerror`, `onclose`, and `onmessage` attributes.\n// See https://html.spec.whatwg.org/multipage/comms.html#the-websocket-interface\n//\n['open', 'error', 'close', 'message'].forEach((method) => {\n Object.defineProperty(WebSocket.prototype, `on${method}`, {\n enumerable: true,\n get() {\n const listeners = this.listeners(method);\n for (let i = 0; i < listeners.length; i++) {\n if (listeners[i]._listener) return listeners[i]._listener;\n }\n\n return undefined;\n },\n set(listener) {\n const listeners = this.listeners(method);\n for (let i = 0; i < listeners.length; i++) {\n //\n // Remove only the listeners added via `addEventListener`.\n //\n if (listeners[i]._listener) this.removeListener(method, listeners[i]);\n }\n this.addEventListener(method, listener);\n }\n });\n});\n\nWebSocket.prototype.addEventListener = addEventListener;\nWebSocket.prototype.removeEventListener = removeEventListener;\n\nmodule.exports = WebSocket;\n\n/**\n * Initialize a WebSocket client.\n *\n * @param {WebSocket} websocket The client to initialize\n * @param {(String|URL)} address The URL to which to connect\n * @param {String} [protocols] The subprotocols\n * @param {Object} [options] Connection options\n * @param {(Boolean|Object)} [options.perMessageDeflate=true] Enable/disable\n * permessage-deflate\n * @param {Number} [options.handshakeTimeout] Timeout in milliseconds for the\n * handshake request\n * @param {Number} [options.protocolVersion=13] Value of the\n * `Sec-WebSocket-Version` header\n * @param {String} [options.origin] Value of the `Origin` or\n * `Sec-WebSocket-Origin` header\n * @param {Number} [options.maxPayload=104857600] The maximum allowed message\n * size\n * @param {Boolean} [options.followRedirects=false] Whether or not to follow\n * redirects\n * @param {Number} [options.maxRedirects=10] The maximum number of redirects\n * allowed\n * @private\n */\nfunction initAsClient(websocket, address, protocols, options) {\n const opts = {\n protocolVersion: protocolVersions[1],\n maxPayload: 100 * 1024 * 1024,\n perMessageDeflate: true,\n followRedirects: false,\n maxRedirects: 10,\n ...options,\n createConnection: undefined,\n socketPath: undefined,\n hostname: undefined,\n protocol: undefined,\n timeout: undefined,\n method: undefined,\n host: undefined,\n path: undefined,\n port: undefined\n };\n\n if (!protocolVersions.includes(opts.protocolVersion)) {\n throw new RangeError(\n `Unsupported protocol version: ${opts.protocolVersion} ` +\n `(supported versions: ${protocolVersions.join(', ')})`\n );\n }\n\n let parsedUrl;\n\n if (address instanceof URL) {\n parsedUrl = address;\n websocket._url = address.href;\n } else {\n parsedUrl = new URL(address);\n websocket._url = address;\n }\n\n const isUnixSocket = parsedUrl.protocol === 'ws+unix:';\n\n if (!parsedUrl.host && (!isUnixSocket || !parsedUrl.pathname)) {\n const err = new Error(`Invalid URL: ${websocket.url}`);\n\n if (websocket._redirects === 0) {\n throw err;\n } else {\n emitErrorAndClose(websocket, err);\n return;\n }\n }\n\n const isSecure =\n parsedUrl.protocol === 'wss:' || parsedUrl.protocol === 'https:';\n const defaultPort = isSecure ? 443 : 80;\n const key = randomBytes(16).toString('base64');\n const get = isSecure ? https.get : http.get;\n let perMessageDeflate;\n\n opts.createConnection = isSecure ? tlsConnect : netConnect;\n opts.defaultPort = opts.defaultPort || defaultPort;\n opts.port = parsedUrl.port || defaultPort;\n opts.host = parsedUrl.hostname.startsWith('[')\n ? parsedUrl.hostname.slice(1, -1)\n : parsedUrl.hostname;\n opts.headers = {\n 'Sec-WebSocket-Version': opts.protocolVersion,\n 'Sec-WebSocket-Key': key,\n Connection: 'Upgrade',\n Upgrade: 'websocket',\n ...opts.headers\n };\n opts.path = parsedUrl.pathname + parsedUrl.search;\n opts.timeout = opts.handshakeTimeout;\n\n if (opts.perMessageDeflate) {\n perMessageDeflate = new PerMessageDeflate(\n opts.perMessageDeflate !== true ? opts.perMessageDeflate : {},\n false,\n opts.maxPayload\n );\n opts.headers['Sec-WebSocket-Extensions'] = format({\n [PerMessageDeflate.extensionName]: perMessageDeflate.offer()\n });\n }\n if (protocols) {\n opts.headers['Sec-WebSocket-Protocol'] = protocols;\n }\n if (opts.origin) {\n if (opts.protocolVersion < 13) {\n opts.headers['Sec-WebSocket-Origin'] = opts.origin;\n } else {\n opts.headers.Origin = opts.origin;\n }\n }\n if (parsedUrl.username || parsedUrl.password) {\n opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;\n }\n\n if (isUnixSocket) {\n const parts = opts.path.split(':');\n\n opts.socketPath = parts[0];\n opts.path = parts[1];\n }\n\n if (opts.followRedirects) {\n if (websocket._redirects === 0) {\n websocket._originalUnixSocket = isUnixSocket;\n websocket._originalSecure = isSecure;\n websocket._originalHostOrSocketPath = isUnixSocket\n ? opts.socketPath\n : parsedUrl.host;\n\n const headers = options && options.headers;\n\n //\n // Shallow copy the user provided options so that headers can be changed\n // without mutating the original object.\n //\n options = { ...options, headers: {} };\n\n if (headers) {\n for (const [key, value] of Object.entries(headers)) {\n options.headers[key.toLowerCase()] = value;\n }\n }\n } else {\n const isSameHost = isUnixSocket\n ? websocket._originalUnixSocket\n ? opts.socketPath === websocket._originalHostOrSocketPath\n : false\n : websocket._originalUnixSocket\n ? false\n : parsedUrl.host === websocket._originalHostOrSocketPath;\n\n if (!isSameHost || (websocket._originalSecure && !isSecure)) {\n //\n // Match curl 7.77.0 behavior and drop the following headers. These\n // headers are also dropped when following a redirect to a subdomain.\n //\n delete opts.headers.authorization;\n delete opts.headers.cookie;\n\n if (!isSameHost) delete opts.headers.host;\n\n opts.auth = undefined;\n }\n }\n\n //\n // Match curl 7.77.0 behavior and make the first `Authorization` header win.\n // If the `Authorization` header is set, then there is nothing to do as it\n // will take precedence.\n //\n if (opts.auth && !options.headers.authorization) {\n options.headers.authorization =\n 'Basic ' + Buffer.from(opts.auth).toString('base64');\n }\n }\n\n let req = (websocket._req = get(opts));\n\n if (opts.timeout) {\n req.on('timeout', () => {\n abortHandshake(websocket, req, 'Opening handshake has timed out');\n });\n }\n\n req.on('error', (err) => {\n if (req === null || req.aborted) return;\n\n req = websocket._req = null;\n emitErrorAndClose(websocket, err);\n });\n\n req.on('response', (res) => {\n const location = res.headers.location;\n const statusCode = res.statusCode;\n\n if (\n location &&\n opts.followRedirects &&\n statusCode >= 300 &&\n statusCode < 400\n ) {\n if (++websocket._redirects > opts.maxRedirects) {\n abortHandshake(websocket, req, 'Maximum redirects exceeded');\n return;\n }\n\n req.abort();\n\n let addr;\n\n try {\n addr = new URL(location, address);\n } catch (err) {\n emitErrorAndClose(websocket, err);\n return;\n }\n\n initAsClient(websocket, addr, protocols, options);\n } else if (!websocket.emit('unexpected-response', req, res)) {\n abortHandshake(\n websocket,\n req,\n `Unexpected server response: ${res.statusCode}`\n );\n }\n });\n\n req.on('upgrade', (res, socket, head) => {\n websocket.emit('upgrade', res);\n\n //\n // The user may have closed the connection from a listener of the `upgrade`\n // event.\n //\n if (websocket.readyState !== WebSocket.CONNECTING) return;\n\n req = websocket._req = null;\n\n if (res.headers.upgrade.toLowerCase() !== 'websocket') {\n abortHandshake(websocket, socket, 'Invalid Upgrade header');\n return;\n }\n\n const digest = createHash('sha1')\n .update(key + GUID)\n .digest('base64');\n\n if (res.headers['sec-websocket-accept'] !== digest) {\n abortHandshake(websocket, socket, 'Invalid Sec-WebSocket-Accept header');\n return;\n }\n\n const serverProt = res.headers['sec-websocket-protocol'];\n const protList = (protocols || '').split(/, */);\n let protError;\n\n if (!protocols && serverProt) {\n protError = 'Server sent a subprotocol but none was requested';\n } else if (protocols && !serverProt) {\n protError = 'Server sent no subprotocol';\n } else if (serverProt && !protList.includes(serverProt)) {\n protError = 'Server sent an invalid subprotocol';\n }\n\n if (protError) {\n abortHandshake(websocket, socket, protError);\n return;\n }\n\n if (serverProt) websocket._protocol = serverProt;\n\n const secWebSocketExtensions = res.headers['sec-websocket-extensions'];\n\n if (secWebSocketExtensions !== undefined) {\n if (!perMessageDeflate) {\n const message =\n 'Server sent a Sec-WebSocket-Extensions header but no extension ' +\n 'was requested';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n let extensions;\n\n try {\n extensions = parse(secWebSocketExtensions);\n } catch (err) {\n const message = 'Invalid Sec-WebSocket-Extensions header';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n const extensionNames = Object.keys(extensions);\n\n if (extensionNames.length) {\n if (\n extensionNames.length !== 1 ||\n extensionNames[0] !== PerMessageDeflate.extensionName\n ) {\n const message =\n 'Server indicated an extension that was not requested';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n try {\n perMessageDeflate.accept(extensions[PerMessageDeflate.extensionName]);\n } catch (err) {\n const message = 'Invalid Sec-WebSocket-Extensions header';\n abortHandshake(websocket, socket, message);\n return;\n }\n\n websocket._extensions[PerMessageDeflate.extensionName] =\n perMessageDeflate;\n }\n }\n\n websocket.setSocket(socket, head, opts.maxPayload);\n });\n}\n\n/**\n * Emit the `'error'` and `'close'` event.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {Error} The error to emit\n * @private\n */\nfunction emitErrorAndClose(websocket, err) {\n websocket._readyState = WebSocket.CLOSING;\n websocket.emit('error', err);\n websocket.emitClose();\n}\n\n/**\n * Create a `net.Socket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {net.Socket} The newly created socket used to start the connection\n * @private\n */\nfunction netConnect(options) {\n options.path = options.socketPath;\n return net.connect(options);\n}\n\n/**\n * Create a `tls.TLSSocket` and initiate a connection.\n *\n * @param {Object} options Connection options\n * @return {tls.TLSSocket} The newly created socket used to start the connection\n * @private\n */\nfunction tlsConnect(options) {\n options.path = undefined;\n\n if (!options.servername && options.servername !== '') {\n options.servername = net.isIP(options.host) ? '' : options.host;\n }\n\n return tls.connect(options);\n}\n\n/**\n * Abort the handshake and emit an error.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {(http.ClientRequest|net.Socket|tls.Socket)} stream The request to\n * abort or the socket to destroy\n * @param {String} message The error message\n * @private\n */\nfunction abortHandshake(websocket, stream, message) {\n websocket._readyState = WebSocket.CLOSING;\n\n const err = new Error(message);\n Error.captureStackTrace(err, abortHandshake);\n\n if (stream.setHeader) {\n stream.abort();\n\n if (stream.socket && !stream.socket.destroyed) {\n //\n // On Node.js >= 14.3.0 `request.abort()` does not destroy the socket if\n // called after the request completed. See\n // https://github.com/websockets/ws/issues/1869.\n //\n stream.socket.destroy();\n }\n\n stream.once('abort', websocket.emitClose.bind(websocket));\n websocket.emit('error', err);\n } else {\n stream.destroy(err);\n stream.once('error', websocket.emit.bind(websocket, 'error'));\n stream.once('close', websocket.emitClose.bind(websocket));\n }\n}\n\n/**\n * Handle cases where the `ping()`, `pong()`, or `send()` methods are called\n * when the `readyState` attribute is `CLOSING` or `CLOSED`.\n *\n * @param {WebSocket} websocket The WebSocket instance\n * @param {*} [data] The data to send\n * @param {Function} [cb] Callback\n * @private\n */\nfunction sendAfterClose(websocket, data, cb) {\n if (data) {\n const length = toBuffer(data).length;\n\n //\n // The `_bufferedAmount` property is used only when the peer is a client and\n // the opening handshake fails. Under these circumstances, in fact, the\n // `setSocket()` method is not called, so the `_socket` and `_sender`\n // properties are set to `null`.\n //\n if (websocket._socket) websocket._sender._bufferedBytes += length;\n else websocket._bufferedAmount += length;\n }\n\n if (cb) {\n const err = new Error(\n `WebSocket is not open: readyState ${websocket.readyState} ` +\n `(${readyStates[websocket.readyState]})`\n );\n cb(err);\n }\n}\n\n/**\n * The listener of the `Receiver` `'conclude'` event.\n *\n * @param {Number} code The status code\n * @param {String} reason The reason for closing\n * @private\n */\nfunction receiverOnConclude(code, reason) {\n const websocket = this[kWebSocket];\n\n websocket._closeFrameReceived = true;\n websocket._closeMessage = reason;\n websocket._closeCode = code;\n\n if (websocket._socket[kWebSocket] === undefined) return;\n\n websocket._socket.removeListener('data', socketOnData);\n process.nextTick(resume, websocket._socket);\n\n if (code === 1005) websocket.close();\n else websocket.close(code, reason);\n}\n\n/**\n * The listener of the `Receiver` `'drain'` event.\n *\n * @private\n */\nfunction receiverOnDrain() {\n this[kWebSocket]._socket.resume();\n}\n\n/**\n * The listener of the `Receiver` `'error'` event.\n *\n * @param {(RangeError|Error)} err The emitted error\n * @private\n */\nfunction receiverOnError(err) {\n const websocket = this[kWebSocket];\n\n if (websocket._socket[kWebSocket] !== undefined) {\n websocket._socket.removeListener('data', socketOnData);\n\n //\n // On Node.js < 14.0.0 the `'error'` event is emitted synchronously. See\n // https://github.com/websockets/ws/issues/1940.\n //\n process.nextTick(resume, websocket._socket);\n\n websocket.close(err[kStatusCode]);\n }\n\n websocket.emit('error', err);\n}\n\n/**\n * The listener of the `Receiver` `'finish'` event.\n *\n * @private\n */\nfunction receiverOnFinish() {\n this[kWebSocket].emitClose();\n}\n\n/**\n * The listener of the `Receiver` `'message'` event.\n *\n * @param {(String|Buffer|ArrayBuffer|Buffer[])} data The message\n * @private\n */\nfunction receiverOnMessage(data) {\n this[kWebSocket].emit('message', data);\n}\n\n/**\n * The listener of the `Receiver` `'ping'` event.\n *\n * @param {Buffer} data The data included in the ping frame\n * @private\n */\nfunction receiverOnPing(data) {\n const websocket = this[kWebSocket];\n\n websocket.pong(data, !websocket._isServer, NOOP);\n websocket.emit('ping', data);\n}\n\n/**\n * The listener of the `Receiver` `'pong'` event.\n *\n * @param {Buffer} data The data included in the pong frame\n * @private\n */\nfunction receiverOnPong(data) {\n this[kWebSocket].emit('pong', data);\n}\n\n/**\n * Resume a readable stream\n *\n * @param {Readable} stream The readable stream\n * @private\n */\nfunction resume(stream) {\n stream.resume();\n}\n\n/**\n * The listener of the `net.Socket` `'close'` event.\n *\n * @private\n */\nfunction socketOnClose() {\n const websocket = this[kWebSocket];\n\n this.removeListener('close', socketOnClose);\n this.removeListener('data', socketOnData);\n this.removeListener('end', socketOnEnd);\n\n websocket._readyState = WebSocket.CLOSING;\n\n let chunk;\n\n //\n // The close frame might not have been received or the `'end'` event emitted,\n // for example, if the socket was destroyed due to an error. Ensure that the\n // `receiver` stream is closed after writing any remaining buffered data to\n // it. If the readable side of the socket is in flowing mode then there is no\n // buffered data as everything has been already written and `readable.read()`\n // will return `null`. If instead, the socket is paused, any possible buffered\n // data will be read as a single chunk.\n //\n if (\n !this._readableState.endEmitted &&\n !websocket._closeFrameReceived &&\n !websocket._receiver._writableState.errorEmitted &&\n (chunk = websocket._socket.read()) !== null\n ) {\n websocket._receiver.write(chunk);\n }\n\n websocket._receiver.end();\n\n this[kWebSocket] = undefined;\n\n clearTimeout(websocket._closeTimer);\n\n if (\n websocket._receiver._writableState.finished ||\n websocket._receiver._writableState.errorEmitted\n ) {\n websocket.emitClose();\n } else {\n websocket._receiver.on('error', receiverOnFinish);\n websocket._receiver.on('finish', receiverOnFinish);\n }\n}\n\n/**\n * The listener of the `net.Socket` `'data'` event.\n *\n * @param {Buffer} chunk A chunk of data\n * @private\n */\nfunction socketOnData(chunk) {\n if (!this[kWebSocket]._receiver.write(chunk)) {\n this.pause();\n }\n}\n\n/**\n * The listener of the `net.Socket` `'end'` event.\n *\n * @private\n */\nfunction socketOnEnd() {\n const websocket = this[kWebSocket];\n\n websocket._readyState = WebSocket.CLOSING;\n websocket._receiver.end();\n this.end();\n}\n\n/**\n * The listener of the `net.Socket` `'error'` event.\n *\n * @private\n */\nfunction socketOnError() {\n const websocket = this[kWebSocket];\n\n this.removeListener('error', socketOnError);\n this.on('error', NOOP);\n\n if (websocket) {\n websocket._readyState = WebSocket.CLOSING;\n this.destroy();\n }\n}\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n exports.stripBOM = function(str) {\n if (str[0] === '\\uFEFF') {\n return str.substring(1);\n } else {\n return str;\n }\n };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n var builder, defaults, escapeCDATA, requiresCDATA, wrapCDATA,\n hasProp = {}.hasOwnProperty;\n\n builder = require('xmlbuilder');\n\n defaults = require('./defaults').defaults;\n\n requiresCDATA = function(entry) {\n return typeof entry === \"string\" && (entry.indexOf('&') >= 0 || entry.indexOf('>') >= 0 || entry.indexOf('<') >= 0);\n };\n\n wrapCDATA = function(entry) {\n return \"\";\n };\n\n escapeCDATA = function(entry) {\n return entry.replace(']]>', ']]]]>');\n };\n\n exports.Builder = (function() {\n function Builder(opts) {\n var key, ref, value;\n this.options = {};\n ref = defaults[\"0.2\"];\n for (key in ref) {\n if (!hasProp.call(ref, key)) continue;\n value = ref[key];\n this.options[key] = value;\n }\n for (key in opts) {\n if (!hasProp.call(opts, key)) continue;\n value = opts[key];\n this.options[key] = value;\n }\n }\n\n Builder.prototype.buildObject = function(rootObj) {\n var attrkey, charkey, render, rootElement, rootName;\n attrkey = this.options.attrkey;\n charkey = this.options.charkey;\n if ((Object.keys(rootObj).length === 1) && (this.options.rootName === defaults['0.2'].rootName)) {\n rootName = Object.keys(rootObj)[0];\n rootObj = rootObj[rootName];\n } else {\n rootName = this.options.rootName;\n }\n render = (function(_this) {\n return function(element, obj) {\n var attr, child, entry, index, key, value;\n if (typeof obj !== 'object') {\n if (_this.options.cdata && requiresCDATA(obj)) {\n element.raw(wrapCDATA(obj));\n } else {\n element.txt(obj);\n }\n } else if (Array.isArray(obj)) {\n for (index in obj) {\n if (!hasProp.call(obj, index)) continue;\n child = obj[index];\n for (key in child) {\n entry = child[key];\n element = render(element.ele(key), entry).up();\n }\n }\n } else {\n for (key in obj) {\n if (!hasProp.call(obj, key)) continue;\n child = obj[key];\n if (key === attrkey) {\n if (typeof child === \"object\") {\n for (attr in child) {\n value = child[attr];\n element = element.att(attr, value);\n }\n }\n } else if (key === charkey) {\n if (_this.options.cdata && requiresCDATA(child)) {\n element = element.raw(wrapCDATA(child));\n } else {\n element = element.txt(child);\n }\n } else if (Array.isArray(child)) {\n for (index in child) {\n if (!hasProp.call(child, index)) continue;\n entry = child[index];\n if (typeof entry === 'string') {\n if (_this.options.cdata && requiresCDATA(entry)) {\n element = element.ele(key).raw(wrapCDATA(entry)).up();\n } else {\n element = element.ele(key, entry).up();\n }\n } else {\n element = render(element.ele(key), entry).up();\n }\n }\n } else if (typeof child === \"object\") {\n element = render(element.ele(key), child).up();\n } else {\n if (typeof child === 'string' && _this.options.cdata && requiresCDATA(child)) {\n element = element.ele(key).raw(wrapCDATA(child)).up();\n } else {\n if (child == null) {\n child = '';\n }\n element = element.ele(key, child.toString()).up();\n }\n }\n }\n }\n return element;\n };\n })(this);\n rootElement = builder.create(rootName, this.options.xmldec, this.options.doctype, {\n headless: this.options.headless,\n allowSurrogateChars: this.options.allowSurrogateChars\n });\n return render(rootElement, rootObj).end(this.options.renderOpts);\n };\n\n return Builder;\n\n })();\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n exports.defaults = {\n \"0.1\": {\n explicitCharkey: false,\n trim: true,\n normalize: true,\n normalizeTags: false,\n attrkey: \"@\",\n charkey: \"#\",\n explicitArray: false,\n ignoreAttrs: false,\n mergeAttrs: false,\n explicitRoot: false,\n validator: null,\n xmlns: false,\n explicitChildren: false,\n childkey: '@@',\n charsAsChildren: false,\n includeWhiteChars: false,\n async: false,\n strict: true,\n attrNameProcessors: null,\n attrValueProcessors: null,\n tagNameProcessors: null,\n valueProcessors: null,\n emptyTag: ''\n },\n \"0.2\": {\n explicitCharkey: false,\n trim: false,\n normalize: false,\n normalizeTags: false,\n attrkey: \"$\",\n charkey: \"_\",\n explicitArray: true,\n ignoreAttrs: false,\n mergeAttrs: false,\n explicitRoot: true,\n validator: null,\n xmlns: false,\n explicitChildren: false,\n preserveChildrenOrder: false,\n childkey: '$$',\n charsAsChildren: false,\n includeWhiteChars: false,\n async: false,\n strict: true,\n attrNameProcessors: null,\n attrValueProcessors: null,\n tagNameProcessors: null,\n valueProcessors: null,\n rootName: 'root',\n xmldec: {\n 'version': '1.0',\n 'encoding': 'UTF-8',\n 'standalone': true\n },\n doctype: null,\n renderOpts: {\n 'pretty': true,\n 'indent': ' ',\n 'newline': '\\n'\n },\n headless: false,\n chunkSize: 10000,\n emptyTag: '',\n cdata: false\n }\n };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n var bom, defaults, events, isEmpty, processItem, processors, sax, setImmediate,\n bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n 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; },\n hasProp = {}.hasOwnProperty;\n\n sax = require('sax');\n\n events = require('events');\n\n bom = require('./bom');\n\n processors = require('./processors');\n\n setImmediate = require('timers').setImmediate;\n\n defaults = require('./defaults').defaults;\n\n isEmpty = function(thing) {\n return typeof thing === \"object\" && (thing != null) && Object.keys(thing).length === 0;\n };\n\n processItem = function(processors, item, key) {\n var i, len, process;\n for (i = 0, len = processors.length; i < len; i++) {\n process = processors[i];\n item = process(item, key);\n }\n return item;\n };\n\n exports.Parser = (function(superClass) {\n extend(Parser, superClass);\n\n function Parser(opts) {\n this.parseStringPromise = bind(this.parseStringPromise, this);\n this.parseString = bind(this.parseString, this);\n this.reset = bind(this.reset, this);\n this.assignOrPush = bind(this.assignOrPush, this);\n this.processAsync = bind(this.processAsync, this);\n var key, ref, value;\n if (!(this instanceof exports.Parser)) {\n return new exports.Parser(opts);\n }\n this.options = {};\n ref = defaults[\"0.2\"];\n for (key in ref) {\n if (!hasProp.call(ref, key)) continue;\n value = ref[key];\n this.options[key] = value;\n }\n for (key in opts) {\n if (!hasProp.call(opts, key)) continue;\n value = opts[key];\n this.options[key] = value;\n }\n if (this.options.xmlns) {\n this.options.xmlnskey = this.options.attrkey + \"ns\";\n }\n if (this.options.normalizeTags) {\n if (!this.options.tagNameProcessors) {\n this.options.tagNameProcessors = [];\n }\n this.options.tagNameProcessors.unshift(processors.normalize);\n }\n this.reset();\n }\n\n Parser.prototype.processAsync = function() {\n var chunk, err;\n try {\n if (this.remaining.length <= this.options.chunkSize) {\n chunk = this.remaining;\n this.remaining = '';\n this.saxParser = this.saxParser.write(chunk);\n return this.saxParser.close();\n } else {\n chunk = this.remaining.substr(0, this.options.chunkSize);\n this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length);\n this.saxParser = this.saxParser.write(chunk);\n return setImmediate(this.processAsync);\n }\n } catch (error1) {\n err = error1;\n if (!this.saxParser.errThrown) {\n this.saxParser.errThrown = true;\n return this.emit(err);\n }\n }\n };\n\n Parser.prototype.assignOrPush = function(obj, key, newValue) {\n if (!(key in obj)) {\n if (!this.options.explicitArray) {\n return obj[key] = newValue;\n } else {\n return obj[key] = [newValue];\n }\n } else {\n if (!(obj[key] instanceof Array)) {\n obj[key] = [obj[key]];\n }\n return obj[key].push(newValue);\n }\n };\n\n Parser.prototype.reset = function() {\n var attrkey, charkey, ontext, stack;\n this.removeAllListeners();\n this.saxParser = sax.parser(this.options.strict, {\n trim: false,\n normalize: false,\n xmlns: this.options.xmlns\n });\n this.saxParser.errThrown = false;\n this.saxParser.onerror = (function(_this) {\n return function(error) {\n _this.saxParser.resume();\n if (!_this.saxParser.errThrown) {\n _this.saxParser.errThrown = true;\n return _this.emit(\"error\", error);\n }\n };\n })(this);\n this.saxParser.onend = (function(_this) {\n return function() {\n if (!_this.saxParser.ended) {\n _this.saxParser.ended = true;\n return _this.emit(\"end\", _this.resultObject);\n }\n };\n })(this);\n this.saxParser.ended = false;\n this.EXPLICIT_CHARKEY = this.options.explicitCharkey;\n this.resultObject = null;\n stack = [];\n attrkey = this.options.attrkey;\n charkey = this.options.charkey;\n this.saxParser.onopentag = (function(_this) {\n return function(node) {\n var key, newValue, obj, processedKey, ref;\n obj = Object.create(null);\n obj[charkey] = \"\";\n if (!_this.options.ignoreAttrs) {\n ref = node.attributes;\n for (key in ref) {\n if (!hasProp.call(ref, key)) continue;\n if (!(attrkey in obj) && !_this.options.mergeAttrs) {\n obj[attrkey] = Object.create(null);\n }\n newValue = _this.options.attrValueProcessors ? processItem(_this.options.attrValueProcessors, node.attributes[key], key) : node.attributes[key];\n processedKey = _this.options.attrNameProcessors ? processItem(_this.options.attrNameProcessors, key) : key;\n if (_this.options.mergeAttrs) {\n _this.assignOrPush(obj, processedKey, newValue);\n } else {\n obj[attrkey][processedKey] = newValue;\n }\n }\n }\n obj[\"#name\"] = _this.options.tagNameProcessors ? processItem(_this.options.tagNameProcessors, node.name) : node.name;\n if (_this.options.xmlns) {\n obj[_this.options.xmlnskey] = {\n uri: node.uri,\n local: node.local\n };\n }\n return stack.push(obj);\n };\n })(this);\n this.saxParser.onclosetag = (function(_this) {\n return function() {\n var cdata, emptyStr, key, node, nodeName, obj, objClone, old, s, xpath;\n obj = stack.pop();\n nodeName = obj[\"#name\"];\n if (!_this.options.explicitChildren || !_this.options.preserveChildrenOrder) {\n delete obj[\"#name\"];\n }\n if (obj.cdata === true) {\n cdata = obj.cdata;\n delete obj.cdata;\n }\n s = stack[stack.length - 1];\n if (obj[charkey].match(/^\\s*$/) && !cdata) {\n emptyStr = obj[charkey];\n delete obj[charkey];\n } else {\n if (_this.options.trim) {\n obj[charkey] = obj[charkey].trim();\n }\n if (_this.options.normalize) {\n obj[charkey] = obj[charkey].replace(/\\s{2,}/g, \" \").trim();\n }\n obj[charkey] = _this.options.valueProcessors ? processItem(_this.options.valueProcessors, obj[charkey], nodeName) : obj[charkey];\n if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {\n obj = obj[charkey];\n }\n }\n if (isEmpty(obj)) {\n if (typeof _this.options.emptyTag === 'function') {\n obj = _this.options.emptyTag();\n } else {\n obj = _this.options.emptyTag !== '' ? _this.options.emptyTag : emptyStr;\n }\n }\n if (_this.options.validator != null) {\n xpath = \"/\" + ((function() {\n var i, len, results;\n results = [];\n for (i = 0, len = stack.length; i < len; i++) {\n node = stack[i];\n results.push(node[\"#name\"]);\n }\n return results;\n })()).concat(nodeName).join(\"/\");\n (function() {\n var err;\n try {\n return obj = _this.options.validator(xpath, s && s[nodeName], obj);\n } catch (error1) {\n err = error1;\n return _this.emit(\"error\", err);\n }\n })();\n }\n if (_this.options.explicitChildren && !_this.options.mergeAttrs && typeof obj === 'object') {\n if (!_this.options.preserveChildrenOrder) {\n node = Object.create(null);\n if (_this.options.attrkey in obj) {\n node[_this.options.attrkey] = obj[_this.options.attrkey];\n delete obj[_this.options.attrkey];\n }\n if (!_this.options.charsAsChildren && _this.options.charkey in obj) {\n node[_this.options.charkey] = obj[_this.options.charkey];\n delete obj[_this.options.charkey];\n }\n if (Object.getOwnPropertyNames(obj).length > 0) {\n node[_this.options.childkey] = obj;\n }\n obj = node;\n } else if (s) {\n s[_this.options.childkey] = s[_this.options.childkey] || [];\n objClone = Object.create(null);\n for (key in obj) {\n if (!hasProp.call(obj, key)) continue;\n objClone[key] = obj[key];\n }\n s[_this.options.childkey].push(objClone);\n delete obj[\"#name\"];\n if (Object.keys(obj).length === 1 && charkey in obj && !_this.EXPLICIT_CHARKEY) {\n obj = obj[charkey];\n }\n }\n }\n if (stack.length > 0) {\n return _this.assignOrPush(s, nodeName, obj);\n } else {\n if (_this.options.explicitRoot) {\n old = obj;\n obj = Object.create(null);\n obj[nodeName] = old;\n }\n _this.resultObject = obj;\n _this.saxParser.ended = true;\n return _this.emit(\"end\", _this.resultObject);\n }\n };\n })(this);\n ontext = (function(_this) {\n return function(text) {\n var charChild, s;\n s = stack[stack.length - 1];\n if (s) {\n s[charkey] += text;\n if (_this.options.explicitChildren && _this.options.preserveChildrenOrder && _this.options.charsAsChildren && (_this.options.includeWhiteChars || text.replace(/\\\\n/g, '').trim() !== '')) {\n s[_this.options.childkey] = s[_this.options.childkey] || [];\n charChild = {\n '#name': '__text__'\n };\n charChild[charkey] = text;\n if (_this.options.normalize) {\n charChild[charkey] = charChild[charkey].replace(/\\s{2,}/g, \" \").trim();\n }\n s[_this.options.childkey].push(charChild);\n }\n return s;\n }\n };\n })(this);\n this.saxParser.ontext = ontext;\n return this.saxParser.oncdata = (function(_this) {\n return function(text) {\n var s;\n s = ontext(text);\n if (s) {\n return s.cdata = true;\n }\n };\n })(this);\n };\n\n Parser.prototype.parseString = function(str, cb) {\n var err;\n if ((cb != null) && typeof cb === \"function\") {\n this.on(\"end\", function(result) {\n this.reset();\n return cb(null, result);\n });\n this.on(\"error\", function(err) {\n this.reset();\n return cb(err);\n });\n }\n try {\n str = str.toString();\n if (str.trim() === '') {\n this.emit(\"end\", null);\n return true;\n }\n str = bom.stripBOM(str);\n if (this.options.async) {\n this.remaining = str;\n setImmediate(this.processAsync);\n return this.saxParser;\n }\n return this.saxParser.write(str).close();\n } catch (error1) {\n err = error1;\n if (!(this.saxParser.errThrown || this.saxParser.ended)) {\n this.emit('error', err);\n return this.saxParser.errThrown = true;\n } else if (this.saxParser.ended) {\n throw err;\n }\n }\n };\n\n Parser.prototype.parseStringPromise = function(str) {\n return new Promise((function(_this) {\n return function(resolve, reject) {\n return _this.parseString(str, function(err, value) {\n if (err) {\n return reject(err);\n } else {\n return resolve(value);\n }\n });\n };\n })(this));\n };\n\n return Parser;\n\n })(events);\n\n exports.parseString = function(str, a, b) {\n var cb, options, parser;\n if (b != null) {\n if (typeof b === 'function') {\n cb = b;\n }\n if (typeof a === 'object') {\n options = a;\n }\n } else {\n if (typeof a === 'function') {\n cb = a;\n }\n options = {};\n }\n parser = new exports.Parser(options);\n return parser.parseString(str, cb);\n };\n\n exports.parseStringPromise = function(str, a) {\n var options, parser;\n if (typeof a === 'object') {\n options = a;\n }\n parser = new exports.Parser(options);\n return parser.parseStringPromise(str);\n };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n var prefixMatch;\n\n prefixMatch = new RegExp(/(?!xmlns)^.*:/);\n\n exports.normalize = function(str) {\n return str.toLowerCase();\n };\n\n exports.firstCharLowerCase = function(str) {\n return str.charAt(0).toLowerCase() + str.slice(1);\n };\n\n exports.stripPrefix = function(str) {\n return str.replace(prefixMatch, '');\n };\n\n exports.parseNumbers = function(str) {\n if (!isNaN(str)) {\n str = str % 1 === 0 ? parseInt(str, 10) : parseFloat(str);\n }\n return str;\n };\n\n exports.parseBooleans = function(str) {\n if (/^(?:true|false)$/i.test(str)) {\n str = str.toLowerCase() === 'true';\n }\n return str;\n };\n\n}).call(this);\n","// Generated by CoffeeScript 1.12.7\n(function() {\n \"use strict\";\n var builder, defaults, parser, processors,\n 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; },\n hasProp = {}.hasOwnProperty;\n\n defaults = require('./defaults');\n\n builder = require('./builder');\n\n parser = require('./parser');\n\n processors = require('./processors');\n\n exports.defaults = defaults.defaults;\n\n exports.processors = processors;\n\n exports.ValidationError = (function(superClass) {\n extend(ValidationError, superClass);\n\n function ValidationError(message) {\n this.message = message;\n }\n\n return ValidationError;\n\n })(Error);\n\n exports.Builder = builder.Builder;\n\n exports.Parser = parser.Parser;\n\n exports.parseString = parser.parseString;\n\n exports.parseStringPromise = parser.parseStringPromise;\n\n}).call(this);\n",";(function (sax) { // wrapper for non-node envs\n sax.parser = function (strict, opt) { return new SAXParser(strict, opt) }\n sax.SAXParser = SAXParser\n sax.SAXStream = SAXStream\n sax.createStream = createStream\n\n // When we pass the MAX_BUFFER_LENGTH position, start checking for buffer overruns.\n // When we check, schedule the next check for MAX_BUFFER_LENGTH - (max(buffer lengths)),\n // since that's the earliest that a buffer overrun could occur. This way, checks are\n // as rare as required, but as often as necessary to ensure never crossing this bound.\n // Furthermore, buffers are only tested at most once per write(), so passing a very\n // large string into write() might have undesirable effects, but this is manageable by\n // the caller, so it is assumed to be safe. Thus, a call to write() may, in the extreme\n // edge case, result in creating at most one complete copy of the string passed in.\n // Set to Infinity to have unlimited buffers.\n sax.MAX_BUFFER_LENGTH = 64 * 1024\n\n var buffers = [\n 'comment', 'sgmlDecl', 'textNode', 'tagName', 'doctype',\n 'procInstName', 'procInstBody', 'entity', 'attribName',\n 'attribValue', 'cdata', 'script'\n ]\n\n sax.EVENTS = [\n 'text',\n 'processinginstruction',\n 'sgmldeclaration',\n 'doctype',\n 'comment',\n 'opentagstart',\n 'attribute',\n 'opentag',\n 'closetag',\n 'opencdata',\n 'cdata',\n 'closecdata',\n 'error',\n 'end',\n 'ready',\n 'script',\n 'opennamespace',\n 'closenamespace'\n ]\n\n function SAXParser (strict, opt) {\n if (!(this instanceof SAXParser)) {\n return new SAXParser(strict, opt)\n }\n\n var parser = this\n clearBuffers(parser)\n parser.q = parser.c = ''\n parser.bufferCheckPosition = sax.MAX_BUFFER_LENGTH\n parser.opt = opt || {}\n parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags\n parser.looseCase = parser.opt.lowercase ? 'toLowerCase' : 'toUpperCase'\n parser.tags = []\n parser.closed = parser.closedRoot = parser.sawRoot = false\n parser.tag = parser.error = null\n parser.strict = !!strict\n parser.noscript = !!(strict || parser.opt.noscript)\n parser.state = S.BEGIN\n parser.strictEntities = parser.opt.strictEntities\n parser.ENTITIES = parser.strictEntities ? Object.create(sax.XML_ENTITIES) : Object.create(sax.ENTITIES)\n parser.attribList = []\n\n // namespaces form a prototype chain.\n // it always points at the current tag,\n // which protos to its parent tag.\n if (parser.opt.xmlns) {\n parser.ns = Object.create(rootNS)\n }\n\n // mostly just for error reporting\n parser.trackPosition = parser.opt.position !== false\n if (parser.trackPosition) {\n parser.position = parser.line = parser.column = 0\n }\n emit(parser, 'onready')\n }\n\n if (!Object.create) {\n Object.create = function (o) {\n function F () {}\n F.prototype = o\n var newf = new F()\n return newf\n }\n }\n\n if (!Object.keys) {\n Object.keys = function (o) {\n var a = []\n for (var i in o) if (o.hasOwnProperty(i)) a.push(i)\n return a\n }\n }\n\n function checkBufferLength (parser) {\n var maxAllowed = Math.max(sax.MAX_BUFFER_LENGTH, 10)\n var maxActual = 0\n for (var i = 0, l = buffers.length; i < l; i++) {\n var len = parser[buffers[i]].length\n if (len > maxAllowed) {\n // Text/cdata nodes can get big, and since they're buffered,\n // we can get here under normal conditions.\n // Avoid issues by emitting the text node now,\n // so at least it won't get any bigger.\n switch (buffers[i]) {\n case 'textNode':\n closeText(parser)\n break\n\n case 'cdata':\n emitNode(parser, 'oncdata', parser.cdata)\n parser.cdata = ''\n break\n\n case 'script':\n emitNode(parser, 'onscript', parser.script)\n parser.script = ''\n break\n\n default:\n error(parser, 'Max buffer length exceeded: ' + buffers[i])\n }\n }\n maxActual = Math.max(maxActual, len)\n }\n // schedule the next check for the earliest possible buffer overrun.\n var m = sax.MAX_BUFFER_LENGTH - maxActual\n parser.bufferCheckPosition = m + parser.position\n }\n\n function clearBuffers (parser) {\n for (var i = 0, l = buffers.length; i < l; i++) {\n parser[buffers[i]] = ''\n }\n }\n\n function flushBuffers (parser) {\n closeText(parser)\n if (parser.cdata !== '') {\n emitNode(parser, 'oncdata', parser.cdata)\n parser.cdata = ''\n }\n if (parser.script !== '') {\n emitNode(parser, 'onscript', parser.script)\n parser.script = ''\n }\n }\n\n SAXParser.prototype = {\n end: function () { end(this) },\n write: write,\n resume: function () { this.error = null; return this },\n close: function () { return this.write(null) },\n flush: function () { flushBuffers(this) }\n }\n\n var Stream\n try {\n Stream = require('stream').Stream\n } catch (ex) {\n Stream = function () {}\n }\n\n var streamWraps = sax.EVENTS.filter(function (ev) {\n return ev !== 'error' && ev !== 'end'\n })\n\n function createStream (strict, opt) {\n return new SAXStream(strict, opt)\n }\n\n function SAXStream (strict, opt) {\n if (!(this instanceof SAXStream)) {\n return new SAXStream(strict, opt)\n }\n\n Stream.apply(this)\n\n this._parser = new SAXParser(strict, opt)\n this.writable = true\n this.readable = true\n\n var me = this\n\n this._parser.onend = function () {\n me.emit('end')\n }\n\n this._parser.onerror = function (er) {\n me.emit('error', er)\n\n // if didn't throw, then means error was handled.\n // go ahead and clear error, so we can write again.\n me._parser.error = null\n }\n\n this._decoder = null\n\n streamWraps.forEach(function (ev) {\n Object.defineProperty(me, 'on' + ev, {\n get: function () {\n return me._parser['on' + ev]\n },\n set: function (h) {\n if (!h) {\n me.removeAllListeners(ev)\n me._parser['on' + ev] = h\n return h\n }\n me.on(ev, h)\n },\n enumerable: true,\n configurable: false\n })\n })\n }\n\n SAXStream.prototype = Object.create(Stream.prototype, {\n constructor: {\n value: SAXStream\n }\n })\n\n SAXStream.prototype.write = function (data) {\n if (typeof Buffer === 'function' &&\n typeof Buffer.isBuffer === 'function' &&\n Buffer.isBuffer(data)) {\n if (!this._decoder) {\n var SD = require('string_decoder').StringDecoder\n this._decoder = new SD('utf8')\n }\n data = this._decoder.write(data)\n }\n\n this._parser.write(data.toString())\n this.emit('data', data)\n return true\n }\n\n SAXStream.prototype.end = function (chunk) {\n if (chunk && chunk.length) {\n this.write(chunk)\n }\n this._parser.end()\n return true\n }\n\n SAXStream.prototype.on = function (ev, handler) {\n var me = this\n if (!me._parser['on' + ev] && streamWraps.indexOf(ev) !== -1) {\n me._parser['on' + ev] = function () {\n var args = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments)\n args.splice(0, 0, ev)\n me.emit.apply(me, args)\n }\n }\n\n return Stream.prototype.on.call(me, ev, handler)\n }\n\n // this really needs to be replaced with character classes.\n // XML allows all manner of ridiculous numbers and digits.\n var CDATA = '[CDATA['\n var DOCTYPE = 'DOCTYPE'\n var XML_NAMESPACE = 'http://www.w3.org/XML/1998/namespace'\n var XMLNS_NAMESPACE = 'http://www.w3.org/2000/xmlns/'\n var rootNS = { xml: XML_NAMESPACE, xmlns: XMLNS_NAMESPACE }\n\n // http://www.w3.org/TR/REC-xml/#NT-NameStartChar\n // This implementation works on strings, a single character at a time\n // as such, it cannot ever support astral-plane characters (10000-EFFFF)\n // without a significant breaking change to either this parser, or the\n // JavaScript language. Implementation of an emoji-capable xml parser\n // is left as an exercise for the reader.\n 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]/\n\n 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-]/\n\n 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]/\n 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-]/\n\n function isWhitespace (c) {\n return c === ' ' || c === '\\n' || c === '\\r' || c === '\\t'\n }\n\n function isQuote (c) {\n return c === '\"' || c === '\\''\n }\n\n function isAttribEnd (c) {\n return c === '>' || isWhitespace(c)\n }\n\n function isMatch (regex, c) {\n return regex.test(c)\n }\n\n function notMatch (regex, c) {\n return !isMatch(regex, c)\n }\n\n var S = 0\n sax.STATE = {\n BEGIN: S++, // leading byte order mark or whitespace\n BEGIN_WHITESPACE: S++, // leading whitespace\n TEXT: S++, // general stuff\n TEXT_ENTITY: S++, // & and such.\n OPEN_WAKA: S++, // <\n SGML_DECL: S++, // \n SCRIPT: S++, //